MediaProviders
5 days ago
ProvidersPlaceholder
5 days ago
audioPresets
5 days ago
branding
6 months ago
chapters
2 years ago
components
5 days ago
media
5 days ago
overlays
5 days ago
presets
5 days ago
services
4 years ago
settings
1 month ago
styles
1 year ago
tracks
5 days ago
BlockInspectorControls.js
5 days ago
BlockInspectorControls.scss
5 days ago
Editing.js
1 year ago
LinkPlaceholder.js
1 month ago
Player.js
1 month ago
Preview.js
2 years ago
ProUpgradeModal.js
1 month ago
VisibilityEditor.js
6 months ago
audio-placeholder.js
5 days ago
helpers.js
5 years ago
options.js
5 days ago
placeholder.js
5 days ago
VisibilityEditor.js
77 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | // import { __, sprintf } from '@wordpress/i18n'; |
| 5 | import { __, sprintf } from "@wordpress/i18n"; |
| 6 | const { |
| 7 | NavigableMenu, |
| 8 | MenuItem, |
| 9 | FormFileUpload, |
| 10 | MenuGroup, |
| 11 | ToolbarGroup, |
| 12 | ToolbarButton, |
| 13 | Dropdown, |
| 14 | SVG, |
| 15 | Rect, |
| 16 | Path, |
| 17 | Button, |
| 18 | TextControl, |
| 19 | SelectControl, |
| 20 | } = wp.components; |
| 21 | |
| 22 | const captionIcon = ( |
| 23 | <svg |
| 24 | style={{ fill: "none" }} |
| 25 | xmlns="http://www.w3.org/2000/svg" |
| 26 | viewBox="0 0 24 24" |
| 27 | fill="none" |
| 28 | stroke="currentColor" |
| 29 | strokeWidth="2" |
| 30 | strokeLinecap="round" |
| 31 | strokeLinejoin="round" |
| 32 | className="feather feather-eye" |
| 33 | > |
| 34 | <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path> |
| 35 | <circle cx="12" cy="12" r="3"></circle> |
| 36 | </svg> |
| 37 | ); |
| 38 | |
| 39 | export default ({ attributes, setAttributes }) => { |
| 40 | return ( |
| 41 | <Dropdown |
| 42 | contentClassName="block-library-video-tracks-editor" |
| 43 | renderToggle={({ isOpen, onToggle }) => ( |
| 44 | <ToolbarGroup> |
| 45 | <ToolbarButton |
| 46 | label={__("Visibility", "presto-player")} |
| 47 | showTooltip |
| 48 | aria-expanded={isOpen} |
| 49 | aria-haspopup="true" |
| 50 | onClick={onToggle} |
| 51 | icon={captionIcon} |
| 52 | /> |
| 53 | </ToolbarGroup> |
| 54 | )} |
| 55 | renderContent={({}) => { |
| 56 | return ( |
| 57 | <> |
| 58 | <NavigableMenu> |
| 59 | <MenuGroup |
| 60 | className="block-library-video-tracks-editor__add-tracks-container" |
| 61 | label={__("Set Visibility", "presto-player")} |
| 62 | > |
| 63 | <MenuItem icon={"media"} onClick={() => {}} isSelected={true}> |
| 64 | {__("Anyone with access to this page", "presto-player")} |
| 65 | </MenuItem> |
| 66 | <MenuItem icon={"media"} onClick={() => {}} isSelected> |
| 67 | {__("Must be logged in", "presto-player")} |
| 68 | </MenuItem> |
| 69 | </MenuGroup> |
| 70 | </NavigableMenu> |
| 71 | </> |
| 72 | ); |
| 73 | }} |
| 74 | /> |
| 75 | ); |
| 76 | }; |
| 77 |