[ SYSTEM ]: Linux wordpress 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
src
/
admin
/
blocks
/
blocks
/
playlist-list-item
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 Placeholder.js
2,795 B
SET
[ EDIT ]
|
[ DEL ]
📄 attributes.js
172 B
SET
[ EDIT ]
|
[ DEL ]
📄 edit.js
2,251 B
SET
[ EDIT ]
|
[ DEL ]
📄 index.js
845 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: edit.js
import { PrestoPlaylistItem } from "@presto-player/components-react"; import { InspectorControls, RichText, useBlockProps, } from "@wordpress/block-editor"; import { PanelBody, TextControl } from "@wordpress/components"; import { store as coreStore } from "@wordpress/core-data"; import { useSelect } from "@wordpress/data"; import { __ } from "@wordpress/i18n"; export default (props) => { const { attributes, setAttributes, context } = props; const { id, title, duration } = attributes; const blockProps = useBlockProps(); const { entityTitle } = useSelect( (select) => { const queryArgs = ["postType", "pp_video_block", id]; const videoRecord = select(coreStore).getEntityRecord(...queryArgs); return { entityTitle: videoRecord ? videoRecord?.title : null, }; }, [id] ); return ( <> <InspectorControls> <PanelBody title={__("General", "presto-player")} initialOpen={true}> <TextControl label={__("Title", "presto-player")} value={title} onChange={(value) => { setAttributes({ title: value }); }} /> <TextControl label={__("Duration", "presto-player")} value={duration} onChange={(value) => { setAttributes({ duration: value }); }} /> </PanelBody> </InspectorControls> <div {...blockProps}> <PrestoPlaylistItem active={context["presto-player/playlist-media-id"] === id} > <div className="item-title" slot="item-title"> <RichText tagName="span" value={!title ? entityTitle : title} allowedFormats={[]} onChange={(title) => setAttributes({ title })} placeholder={__("Title...", "presto-player")} /> </div> <div className="item-duration" slot="item-duration"> <RichText tagName="span" value={duration} allowedFormats={[]} onChange={(duration) => setAttributes({ duration })} /> </div> </PrestoPlaylistItem> </div> </> ); };