Fix File
•
/
home
/
sportsfe...
/
httpdocs
/
clone
/
wp-inclu...
/
js
/
dist
•
File:
editor.js
•
Content:
return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenamePatternModal, { onClose: closeModal, pattern: record }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/pattern-duplicate-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { DuplicatePatternModal } = unlock(external_wp_patterns_namespaceObject.privateApis); const pattern_duplicate_modal_modalName = 'editor/pattern-duplicate'; function PatternDuplicateModal() { const { record, postType } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType, getCurrentPostId } = select(store_store); const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const _postType = getCurrentPostType(); return { record: getEditedEntityRecord('postType', _postType, getCurrentPostId()), postType: _postType }; }, []); const { closeModal } = (0,external_wp_data_namespaceObject.useDispatch)(store); const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(pattern_duplicate_modal_modalName)); if (!isActive || postType !== PATTERN_POST_TYPE) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DuplicatePatternModal, { onClose: closeModal, onSuccess: () => closeModal(), pattern: record }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/commands/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function useEditorCommandLoader() { const { editorMode, isListViewOpen, showBlockBreadcrumbs, isDistractionFree, isTopToolbar, isFocusMode, isPreviewMode, isViewable, isCodeEditingEnabled, isRichEditingEnabled, isPublishSidebarEnabled } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _get, _getPostType$viewable; const { get } = select(external_wp_preferences_namespaceObject.store); const { isListViewOpened, getCurrentPostType, getEditorSettings } = select(store_store); const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { getPostType } = select(external_wp_coreData_namespaceObject.store); return { editorMode: (_get = get('core', 'editorMode')) !== null && _get !== void 0 ? _get : 'visual', isListViewOpen: isListViewOpened(), showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'), isDistractionFree: get('core', 'distractionFree'), isFocusMode: get('core', 'focusMode'), isTopToolbar: get('core', 'fixedToolbar'), isPreviewMode: getSettings().__unstableIsPreviewMode, isViewable: (_getPostType$viewable = getPostType(getCurrentPostType())?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false, isCodeEditingEnabled: getEditorSettings().codeEditingEnabled, isRichEditingEnabled: getEditorSettings().richEditingEnabled, isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled() }; }, []); const { getActiveComplementaryArea } = (0,external_wp_data_namespaceObject.useSelect)(store); const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); const { createInfoNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { __unstableSaveForPreview, setIsListViewOpened, switchEditorMode, toggleDistractionFree } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { openModal, enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { getCurrentPostId } = (0,external_wp_data_namespaceObject.useSelect)(store_store); const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled; if (isPreviewMode) { return { commands: [], isLoading: false }; } const commands = []; commands.push({ name: 'core/open-shortcut-help', label: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), icon: library_keyboard, callback: () => { openModal('editor/keyboard-shortcut-help'); } }); commands.push({ name: 'core/toggle-distraction-free', label: isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Exit Distraction Free') : (0,external_wp_i18n_namespaceObject.__)('Enter Distraction Free'), callback: ({ close }) => { toggleDistractionFree(); close(); } }); commands.push({ name: 'core/open-preferences', label: (0,external_wp_i18n_namespaceObject.__)('Editor preferences'), callback: () => { openModal('editor/preferences'); } }); commands.push({ name: 'core/toggle-spotlight-mode', label: (0,external_wp_i18n_namespaceObject.__)('Toggle spotlight'), callback: ({ close }) => { toggle('core', 'focusMode'); close(); createInfoNotice(isFocusMode ? (0,external_wp_i18n_namespaceObject.__)('Spotlight off.') : (0,external_wp_i18n_namespaceObject.__)('Spotlight on.'), { id: 'core/editor/toggle-spotlight-mode/notice', type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick: () => { toggle('core', 'focusMode'); } }] }); } }); commands.push({ name: 'core/toggle-list-view', label: isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('Close List View') : (0,external_wp_i18n_namespaceObject.__)('Open List View'), icon: list_view, callback: ({ close }) => { setIsListViewOpened(!isListViewOpen); close(); createInfoNotice(isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('List View off.') : (0,external_wp_i18n_namespaceObject.__)('List View on.'), { id: 'core/editor/toggle-list-view/notice', type: 'snackbar' }); } }); commands.push({ name: 'core/toggle-top-toolbar', label: (0,external_wp_i18n_namespaceObject.__)('Toggle top toolbar'), callback: ({ close }) => { toggle('core', 'fixedToolbar'); if (isDistractionFree) { toggleDistractionFree(); } close(); createInfoNotice(isTopToolbar ? (0,external_wp_i18n_namespaceObject.__)('Top toolbar off.') : (0,external_wp_i18n_namespaceObject.__)('Top toolbar on.'), { id: 'core/editor/toggle-top-toolbar/notice', type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick: () => { toggle('core', 'fixedToolbar'); } }] }); } }); if (allowSwitchEditorMode) { commands.push({ name: 'core/toggle-code-editor', label: editorMode === 'visual' ? (0,external_wp_i18n_namespaceObject.__)('Open code editor') : (0,external_wp_i18n_namespaceObject.__)('Exit code editor'), icon: library_code, callback: ({ close }) => { switchEditorMode(editorMode === 'visual' ? 'text' : 'visual'); close(); } }); } commands.push({ name: 'core/toggle-breadcrumbs', label: showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Hide block breadcrumbs') : (0,external_wp_i18n_namespaceObject.__)('Show block breadcrumbs'), callback: ({ close }) => { toggle('core', 'showBlockBreadcrumbs'); close(); createInfoNotice(showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs hidden.') : (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs visible.'), { id: 'core/editor/toggle-breadcrumbs/notice', type: 'snackbar' }); } }); commands.push({ name: 'core/open-settings-sidebar', label: (0,external_wp_i18n_namespaceObject.__)('Toggle settings sidebar'), icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right, callback: ({ close }) => { const activeSidebar = getActiveComplementaryArea('core'); close(); if (activeSidebar === 'edit-post/document') { disableComplementaryArea('core'); } else { enableComplementaryArea('core', 'edit-post/document'); } } }); commands.push({ name: 'core/open-block-inspector', label: (0,external_wp_i18n_namespaceObject.__)('Toggle block inspector'), icon: block_default, callback: ({ close }) => { const activeSidebar = getActiveComplementaryArea('core'); close(); if (activeSidebar === 'edit-post/block') { disableComplementaryArea('core'); } else { enableComplementaryArea('core', 'edit-post/block'); } } }); commands.push({ name: 'core/toggle-publish-sidebar', label: isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Disable pre-publish checks') : (0,external_wp_i18n_namespaceObject.__)('Enable pre-publish checks'), icon: format_list_bullets, callback: ({ close }) => { close(); toggle('core', 'isPublishSidebarEnabled'); createInfoNotice(isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks disabled.') : (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks enabled.'), { id: 'core/editor/publish-sidebar/notice', type: 'snackbar' }); } }); if (isViewable) { commands.push({ name: 'core/preview-link', label: (0,external_wp_i18n_namespaceObject.__)('Preview in a new tab'), icon: library_external, callback: async ({ close }) => { close(); const postId = getCurrentPostId(); const link = await __unstableSaveForPreview(); window.open(link, `wp-preview-${postId}`); } }); } return { commands, isLoading: false }; } function useEditedEntityContextualCommands() { const { postType } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType } = select(store_store); return { postType: getCurrentPostType() }; }, []); const { openModal } = (0,external_wp_data_namespaceObject.useDispatch)(store); const commands = []; if (postType === PATTERN_POST_TYPE) { commands.push({ name: 'core/rename-pattern', label: (0,external_wp_i18n_namespaceObject.__)('Rename pattern'), icon: edit, callback: ({ close }) => { openModal(modalName); close(); } }); commands.push({ name: 'core/duplicate-pattern', label: (0,external_wp_i18n_namespaceObject.__)('Duplicate pattern'), icon: library_symbol, callback: ({ close }) => { openModal(pattern_duplicate_modal_modalName); close(); } }); } return { isLoading: false, commands }; } function useCommands() { (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/editor/edit-ui', hook: useEditorCommandLoader }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/editor/contextual-commands', hook: useEditedEntityContextualCommands, context: 'entity-edit' }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/block-removal-warnings/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { BlockRemovalWarningModal } = unlock(external_wp_blockEditor_namespaceObject.privateApis); // Prevent accidental removal of certain blocks, asking the user for confirmation first. const TEMPLATE_BLOCKS = ['core/post-content', 'core/post-template', 'core/query']; const BLOCK_REMOVAL_RULES = [{ // Template blocks. // The warning is only shown when a user manipulates templates or template parts. postTypes: ['wp_template', 'wp_template_part'], callback(removedBlocks) { const removedTemplateBlocks = removedBlocks.filter(({ name }) => TEMPLATE_BLOCKS.includes(name)); if (removedTemplateBlocks.length) { return (0,external_wp_i18n_namespaceObject._n)('Deleting this block will stop your post or page content from displaying on this template. It is not recommended.', 'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.', removedBlocks.length); } } }, { // Pattern overrides. // The warning is only shown when the user edits a pattern. postTypes: ['wp_block'], callback(removedBlocks) { const removedBlocksWithOverrides = removedBlocks.filter(({ attributes }) => attributes?.metadata?.bindings && Object.values(attributes.metadata.bindings).some(binding => binding.source === 'core/pattern-overrides')); if (removedBlocksWithOverrides.length) { return (0,external_wp_i18n_namespaceObject._n)('The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?', 'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?', removedBlocks.length); } } }]; function BlockRemovalWarnings() { const currentPostType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []); const removalRulesForPostType = (0,external_wp_element_namespaceObject.useMemo)(() => BLOCK_REMOVAL_RULES.filter(rule => rule.postTypes.includes(currentPostType)), [currentPostType]); // `BlockRemovalWarnings` is rendered in the editor provider, a shared component // across react native and web. However, `BlockRemovalWarningModal` is web only. // Check it exists before trying to render it. if (!BlockRemovalWarningModal) { return null; } if (!removalRulesForPostType) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarningModal, { rules: removalRulesForPostType }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/start-page-options/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function useStartPatterns() { // A pattern is a start pattern if it includes 'core/post-content' in its blockTypes, // and it has no postTypes declared and the current post type is page or if // the current post type is part of the postTypes declared. const { blockPatternsWithPostContentBlockType, postType } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getPatternsByBlockTypes, getBlocksByName } = select(external_wp_blockEditor_namespaceObject.store); const { getCurrentPostType, getRenderingMode } = select(store_store); const rootClientId = getRenderingMode() === 'post-only' ? '' : getBlocksByName('core/post-content')?.[0]; return { blockPatternsWithPostContentBlockType: getPatternsByBlockTypes('core/post-content', rootClientId), postType: getCurrentPostType() }; }, []); return (0,external_wp_element_namespaceObject.useMemo)(() => { // filter patterns without postTypes declared if the current postType is page // or patterns that declare the current postType in its post type array. return blockPatternsWithPostContentBlockType.filter(pattern => { return postType === 'page' && !pattern.postTypes || Array.isArray(pattern.postTypes) && pattern.postTypes.includes(postType); }); }, [postType, blockPatternsWithPostContentBlockType]); } function PatternSelection({ blockPatterns, onChoosePattern }) { const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { postType, postId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType, getCurrentPostId } = select(store_store); return { postType: getCurrentPostType(), postId: getCurrentPostId() }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { blockPatterns: blockPatterns, shownPatterns: shownBlockPatterns, onClickPattern: (_pattern, blocks) => { editEntityRecord('postType', postType, postId, { blocks, content: ({ blocks: blocksForSerialization = [] }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization) }); onChoosePattern(); } }); } function StartPageOptionsModal({ onClose }) { const startPatterns = useStartPatterns(); const hasStartPattern = startPatterns.length > 0; if (!hasStartPattern) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'), isFullScreen: true, onRequestClose: onClose, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-start-page-options__modal-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, { blockPatterns: startPatterns, onChoosePattern: onClose }) }) }); } function StartPageOptions() { const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); const { shouldEnableModal, postType, postId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isEditedPostDirty, isEditedPostEmpty, getCurrentPostType, getCurrentPostId } = select(store_store); const _postType = getCurrentPostType(); return { shouldEnableModal: !isEditedPostDirty() && isEditedPostEmpty() && TEMPLATE_POST_TYPE !== _postType, postType: _postType, postId: getCurrentPostId() }; }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { // Should reset the modal state when navigating to a new page/post. setIsClosed(false); }, [postType, postId]); if (!shouldEnableModal || isClosed) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptionsModal, { onClose: () => setIsClosed(true) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/config.js /** * WordPress dependencies */ const textFormattingShortcuts = [{ keyCombination: { modifier: 'primary', character: 'b' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text bold.') }, { keyCombination: { modifier: 'primary', character: 'i' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text italic.') }, { keyCombination: { modifier: 'primary', character: 'k' }, description: (0,external_wp_i18n_namespaceObject.__)('Convert the selected text into a link.') }, { keyCombination: { modifier: 'primaryShift', character: 'k' }, description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.') }, { keyCombination: { character: '[[' }, description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page.') }, { keyCombination: { modifier: 'primary', character: 'u' }, description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.') }, { keyCombination: { modifier: 'access', character: 'd' }, description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.') }, { keyCombination: { modifier: 'access', character: 'x' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.') }, { keyCombination: { modifier: 'access', character: '0' }, aliases: [{ modifier: 'access', character: '7' }], description: (0,external_wp_i18n_namespaceObject.__)('Convert the current heading to a paragraph.') }, { keyCombination: { modifier: 'access', character: '1-6' }, description: (0,external_wp_i18n_namespaceObject.__)('Convert the current paragraph or heading to a heading of level 1 to 6.') }, { keyCombination: { modifier: 'primaryShift', character: 'SPACE' }, description: (0,external_wp_i18n_namespaceObject.__)('Add non breaking space.') }]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/shortcut.js /** * WordPress dependencies */ function KeyCombination({ keyCombination, forceAriaLabel }) { const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character; const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { className: "editor-keyboard-shortcut-help-modal__shortcut-key-combination", "aria-label": forceAriaLabel || ariaLabel, children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => { if (character === '+') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children: character }, index); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { className: "editor-keyboard-shortcut-help-modal__shortcut-key", children: character }, index); }) }); } function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-keyboard-shortcut-help-modal__shortcut-description", children: description }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-keyboard-shortcut-help-modal__shortcut-term", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { keyCombination: keyCombination, forceAriaLabel: ariaLabel }), aliases.map((alias, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { keyCombination: alias, forceAriaLabel: ariaLabel }, index))] })] }); } /* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js /** * WordPress dependencies */ /** * Internal dependencies */ function DynamicShortcut({ name }) { const { keyCombination, description, aliases } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getShortcutKeyCombination, getShortcutDescription, getShortcutAliases } = select(external_wp_keyboardShortcuts_namespaceObject.store); return { keyCombination: getShortcutKeyCombination(name), aliases: getShortcutAliases(name), description: getShortcutDescription(name) }; }, [name]); if (!keyCombination) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { keyCombination: keyCombination, description: description, aliases: aliases }); } /* harmony default export */ const dynamic_shortcut = (DynamicShortcut); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help'; const ShortcutList = ({ shortcuts }) => /*#__PURE__*/ /* * Disable reason: The `list` ARIA role is redundant but * Safari+VoiceOver won't announce the list otherwise. */ /* eslint-disable jsx-a11y/no-redundant-roles */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "editor-keyboard-shortcut-help-modal__shortcut-list", role: "list", children: shortcuts.map((shortcut, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "editor-keyboard-shortcut-help-modal__shortcut", children: typeof shortcut === 'string' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dynamic_shortcut, { name: shortcut }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { ...shortcut }) }, index)) }) /* eslint-enable jsx-a11y/no-redundant-roles */; const ShortcutSection = ({ title, shortcuts, className }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { className: dist_clsx('editor-keyboard-shortcut-help-modal__section', className), children: [!!title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "editor-keyboard-shortcut-help-modal__section-title", children: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutList, { shortcuts: shortcuts })] }); const ShortcutCategorySection = ({ title, categoryName, additionalShortcuts = [] }) => { const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName); }, [categoryName]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { title: title, shortcuts: categoryShortcuts.concat(additionalShortcuts) }); }; function KeyboardShortcutHelpModal() { const isModalActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(KEYBOARD_SHORTCUT_HELP_MODAL_NAME), []); const { openModal, closeModal } = (0,external_wp_data_namespaceObject.useDispatch)(store); const toggleModal = () => { if (isModalActive) { closeModal(); } else { openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME); } }; (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/keyboard-shortcuts', toggleModal); if (!isModalActive) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { className: "editor-keyboard-shortcut-help-modal", title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)('Close'), onRequestClose: toggleModal, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { className: "editor-keyboard-shortcut-help-modal__main-shortcuts", shortcuts: ['core/editor/keyboard-shortcuts'] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'), categoryName: "global" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'), categoryName: "selection" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'), categoryName: "block", additionalShortcuts: [{ keyCombination: { character: '/' }, description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'), /* translators: The forward-slash character. e.g. '/'. */ ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash') }] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'), shortcuts: textFormattingShortcuts }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('List View shortcuts'), categoryName: "list-view" })] }); } /* harmony default export */ const keyboard_shortcut_help_modal = (KeyboardShortcutHelpModal); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/content-only-settings-menu.js /** * WordPress dependencies */ /** * Internal dependencies */ function ContentOnlySettingsMenuItems({ clientId, onClose }) { const { entity, onNavigateToEntityRecord, canEditTemplates } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockEditingMode, getBlockParentsByBlockName, getSettings, getBlockAttributes } = select(external_wp_blockEditor_namespaceObject.store); const contentOnly = getBlockEditingMode(clientId) === 'contentOnly'; if (!contentOnly) { return {}; } const patternParent = getBlockParentsByBlockName(clientId, 'core/block', true)[0]; let record; if (patternParent) { record = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_block', getBlockAttributes(patternParent).ref); } else { const { getCurrentTemplateId } = select(store_store); const templateId = getCurrentTemplateId(); const { getContentLockingParent } = unlock(select(external_wp_blockEditor_namespaceObject.store)); if (!getContentLockingParent(clientId) && templateId) { record = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template', templateId); } } const _canEditTemplates = select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates'); return { canEditTemplates: _canEditTemplates, entity: record, onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord }; }, [clientId]); if (!entity) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateLockContentOnlyMenuItems, { clientId: clientId, onClose: onClose }); } const isPattern = entity.type === 'wp_block'; let helpText = isPattern ? (0,external_wp_i18n_namespaceObject.__)('Edit the pattern to move, delete, or make further changes to this block.') : (0,external_wp_i18n_namespaceObject.__)('Edit the template to move, delete, or make further changes to this block.'); if (!canEditTemplates) { helpText = (0,external_wp_i18n_namespaceObject.__)('Only users with permissions to edit the template can move or delete this block'); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { onNavigateToEntityRecord({ postId: entity.id, postType: entity.type }); }, disabled: !canEditTemplates, children: isPattern ? (0,external_wp_i18n_namespaceObject.__)('Edit pattern') : (0,external_wp_i18n_namespaceObject.__)('Edit template') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", as: "p", className: "editor-content-only-settings-menu__description", children: helpText })] }); } function TemplateLockContentOnlyMenuItems({ clientId, onClose }) { const { contentLockingParent } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getContentLockingParent } = unlock(select(external_wp_blockEditor_namespaceObject.store)); return { contentLockingParent: getContentLockingParent(clientId) }; }, [clientId]); const blockDisplayInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(contentLockingParent); // Disable reason: We're using a hook here so it has to be on top-level. // eslint-disable-next-line @wordpress/no-unused-vars-before-return const { modifyContentLockBlock, selectBlock } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); if (!blockDisplayInformation?.title) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { selectBlock(contentLockingParent); modifyContentLockBlock(contentLockingParent); onClose(); }, children: (0,external_wp_i18n_namespaceObject.__)('Unlock') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", as: "p", className: "editor-content-only-settings-menu__description", children: (0,external_wp_i18n_namespaceObject.__)('Temporarily unlock the parent block to edit, delete or make further changes to this block.') })] }); } function ContentOnlySettingsMenu() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { children: ({ selectedClientIds, onClose }) => selectedClientIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenuItems, { clientId: selectedClientIds[0], onClose: onClose }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/start-template-options/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function useFallbackTemplateContent(slug, isCustom = false) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord, getDefaultTemplateId } = select(external_wp_coreData_namespaceObject.store); const templateId = getDefaultTemplateId({ slug, is_custom: isCustom, ignore_empty: true }); return templateId ? getEntityRecord('postType', TEMPLATE_POST_TYPE, templateId)?.content?.raw : undefined; }, [slug, isCustom]); } function start_template_options_useStartPatterns(fallbackContent) { const { slug, patterns } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType, getCurrentPostId } = select(store_store); const { getEntityRecord, getBlockPatterns } = select(external_wp_coreData_namespaceObject.store); const postId = getCurrentPostId(); const postType = getCurrentPostType(); const record = getEntityRecord('postType', postType, postId); return { slug: record.slug, patterns: getBlockPatterns() }; }, []); const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet); // Duplicated from packages/block-library/src/pattern/edit.js. function injectThemeAttributeInBlockTemplateContent(block) { if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) { block.innerBlocks = block.innerBlocks.map(innerBlock => { if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) { innerBlock.attributes.theme = currentThemeStylesheet; } return innerBlock; }); } if (block.name === 'core/template-part' && block.attributes.theme === undefined) { block.attributes.theme = currentThemeStylesheet; } return block; } return (0,external_wp_element_namespaceObject.useMemo)(() => { // filter patterns that are supposed to be used in the current template being edited. return [{ name: 'fallback', blocks: (0,external_wp_blocks_namespaceObject.parse)(fallbackContent), title: (0,external_wp_i18n_namespaceObject.__)('Fallback content') }, ...patterns.filter(pattern => { return Array.isArray(pattern.templateTypes) && pattern.templateTypes.some(templateType => slug.startsWith(templateType)); }).map(pattern => { return { ...pattern, blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content).map(block => injectThemeAttributeInBlockTemplateContent(block)) }; })]; }, [fallbackContent, slug, patterns]); } function start_template_options_PatternSelection({ fallbackContent, onChoosePattern, postType }) { const [,, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType); const blockPatterns = start_template_options_useStartPatterns(fallbackContent); const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { blockPatterns: blockPatterns, shownPatterns: shownBlockPatterns, onClickPattern: (pattern, blocks) => { onChange(blocks, { selection: undefined }); onChoosePattern(); } }); } function StartModal({ slug, isCustom, onClose, postType }) { const fallbackContent = useFallbackTemplateContent(slug, isCustom); if (!fallbackContent) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { className: "editor-start-template-options__modal", title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'), closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'), focusOnMount: "firstElement", onRequestClose: onClose, isFullScreen: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-start-template-options__modal-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(start_template_options_PatternSelection, { fallbackContent: fallbackContent, slug: slug, isCustom: isCustom, postType: postType, onChoosePattern: () => { onClose(); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { className: "editor-start-template-options__modal__actions", justify: "flex-end", expanded: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: onClose, children: (0,external_wp_i18n_namespaceObject.__)('Skip') }) }) })] }); } function StartTemplateOptions() { const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); const { shouldOpenModal, slug, isCustom, postType, postId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType, getCurrentPostId } = select(store_store); const _postType = getCurrentPostType(); const _postId = getCurrentPostId(); const { getEditedEntityRecord, hasEditsForEntityRecord } = select(external_wp_coreData_namespaceObject.store); const templateRecord = getEditedEntityRecord('postType', _postType, _postId); const hasEdits = hasEditsForEntityRecord('postType', _postType, _postId); return { shouldOpenModal: !hasEdits && '' === templateRecord.content && TEMPLATE_POST_TYPE === _postType, slug: templateRecord.slug, isCustom: templateRecord.is_custom, postType: _postType, postId: _postId }; }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { // Should reset the modal state when navigating to a new page/post. setIsClosed(false); }, [postType, postId]); if (!shouldOpenModal || isClosed) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartModal, { slug: slug, isCustom: isCustom, postType: postType, onClose: () => setIsClosed(true) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/provider/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { ExperimentalBlockEditorProvider } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { PatternsMenuItems } = unlock(external_wp_patterns_namespaceObject.privateApis); const provider_noop = () => {}; /** * These are global entities that are only there to split blocks into logical units * They don't provide a "context" for the current post/page being rendered. * So we should not use their ids as post context. This is important to allow post blocks * (post content, post title) to be used within them without issues. */ const NON_CONTEXTUAL_POST_TYPES = ['wp_block', 'wp_template', 'wp_navigation', 'wp_template_part']; /** * Depending on the post, template and template mode, * returns the appropriate blocks and change handlers for the block editor provider. * * @param {Array} post Block list. * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`. * @param {string} mode Rendering mode. * * @example * ```jsx * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode ); * ``` * * @return {Array} Block editor props. */ function useBlockEditorProps(post, template, mode) { const rootLevelPost = mode === 'post-only' || !template ? 'post' : 'template'; const [postBlocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', post.type, { id: post.id }); const [templateBlocks, onInputTemplate, onChangeTemplate] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', template?.type, { id: template?.id }); const maybeNavigationBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => { if (post.type === 'wp_navigation') { return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', { ref: post.id, // As the parent editor is locked with `templateLock`, the template locking // must be explicitly "unset" on the block itself to allow the user to modify // the block's content. templateLock: false })]; } }, [post.type, post.id]); // It is important that we don't create a new instance of blocks on every change // We should only create a new instance if the blocks them selves change, not a dependency of them. const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { if (maybeNavigationBlocks) { return maybeNavigationBlocks; } if (rootLevelPost === 'template') { return templateBlocks; } return postBlocks; }, [maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks]); // Handle fallback to postBlocks outside of the above useMemo, to ensure // that constructed block templates that call `createBlock` are not generated // too frequently. This ensures that clientIds are stable. const disableRootLevelChanges = !!template && mode === 'template-locked' || post.type === 'wp_navigation'; if (disableRootLevelChanges) { return [blocks, provider_noop, provider_noop]; } return [blocks, rootLevelPost === 'post' ? onInput : onInputTemplate, rootLevelPost === 'post' ? onChange : onChangeTemplate]; } /** * This component provides the editor context and manages the state of the block editor. * * @param {Object} props The component props. * @param {Object} props.post The post object. * @param {Object} props.settings The editor settings. * @param {boolean} props.recovery Indicates if the editor is in recovery mode. * @param {Array} props.initialEdits The initial edits for the editor. * @param {Object} props.children The child components. * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider. * @param {Object} [props.__unstableTemplate] The template object. * * @example * ```jsx * <ExperimentalEditorProvider * post={ post } * settings={ settings } * recovery={ recovery } * initialEdits={ initialEdits } * __unstableTemplate={ template } * > * { children } * </ExperimentalEditorProvider> * * @return {Object} The rendered ExperimentalEditorProvider component. */ const ExperimentalEditorProvider = with_registry_provider(({ post, settings, recovery, initialEdits, children, BlockEditorProviderComponent = ExperimentalBlockEditorProvider, __unstableTemplate: template }) => { const mode = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getRenderingMode(), []); const shouldRenderTemplate = !!template && mode !== 'post-only'; const rootLevelPost = shouldRenderTemplate ? template : post; const defaultBlockContext = (0,external_wp_element_namespaceObject.useMemo)(() => { const postContext = !NON_CONTEXTUAL_POST_TYPES.includes(rootLevelPost.type) || shouldRenderTemplate ? { postId: post.id, postType: post.type } : {}; return { ...postContext, templateSlug: rootLevelPost.type === 'wp_template' ? rootLevelPost.slug : undefined }; }, [shouldRenderTemplate, post.id, post.type, rootLevelPost.type, rootLevelPost.slug]); const { editorSettings, selection, isReady } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorSettings, getEditorSelection, __unstableIsEditorReady } = select(store_store); return { editorSettings: getEditorSettings(), isReady: __unstableIsEditorReady(), selection: getEditorSelection() }; }, []); const { id, type } = rootLevelPost; const blockEditorSettings = use_block_editor_settings(editorSettings, type, id, mode); const [blocks, onInput, onChange] = useBlockEditorProps(post, template, mode); const { updatePostLock, setupEditor, updateEditorSettings, setCurrentTemplateId, setEditedPost, setRenderingMode } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const { createWarningNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); // Ideally this should be synced on each change and not just something you do once. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { // Assume that we don't need to initialize in the case of an error recovery. if (recovery) { return; } updatePostLock(settings.postLock); setupEditor(post, initialEdits, settings.template); if (settings.autosave) { createWarningNotice((0,external_wp_i18n_namespaceObject.__)('There is an autosave of this post that is more recent than the version below.'), { id: 'autosave-exists', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('View the autosave'), url: settings.autosave.editLink }] }); } }, []); // Synchronizes the active post with the state (0,external_wp_element_namespaceObject.useEffect)(() => { setEditedPost(post.type, post.id); }, [post.type, post.id, setEditedPost]); // Synchronize the editor settings as they change. (0,external_wp_element_namespaceObject.useEffect)(() => { updateEditorSettings(settings); }, [settings, updateEditorSettings]); // Synchronizes the active template with the state. (0,external_wp_element_namespaceObject.useEffect)(() => { setCurrentTemplateId(template?.id); }, [template?.id, setCurrentTemplateId]); // Sets the right rendering mode when loading the editor. (0,external_wp_element_namespaceObject.useEffect)(() => { var _settings$defaultRend; setRenderingMode((_settings$defaultRend = settings.defaultRenderingMode) !== null && _settings$defaultRend !== void 0 ? _settings$defaultRend : 'post-only'); }, [settings.defaultRenderingMode, setRenderingMode]); useHideBlocksFromInserter(post.type, mode); // Register the editor commands. useCommands(); if (!isReady) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { kind: "root", type: "site", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { kind: "postType", type: post.type, id: post.id, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { value: defaultBlockContext, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockEditorProviderComponent, { value: blocks, onChange: onChange, onInput: onInput, selection: selection, settings: blockEditorSettings, useSubRegistry: false, children: [children, !settings.__unstableIsPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenu, {}), mode === 'template-locked' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DisableNonPageContentBlocks, {}), type === 'wp_navigation' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationBlockEditingMode, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarnings, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartTemplateOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternRenameModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternDuplicateModal, {})] })] }) }) }) }); }); /** * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor). * * It supports a large number of post types, including post, page, templates, * custom post types, patterns, template parts. * * All modification and changes are performed to the `@wordpress/core-data` store. * * @param {Object} props The component props. * @param {Object} [props.post] The post object to edit. This is required. * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post. * This is optional and can only be used when the post type supports templates (like posts and pages). * @param {Object} [props.settings] The settings object to use for the editor. * This is optional and can be used to override the default settings. * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply. * This is optional. * * @example * ```jsx * <EditorProvider * post={ post } * settings={ settings } * __unstableTemplate={ template } * > * { children } * </EditorProvider> * ``` * * @return {JSX.Element} The rendered EditorProvider component. */ function EditorProvider(props) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalEditorProvider, { ...props, BlockEditorProviderComponent: external_wp_blockEditor_namespaceObject.BlockEditorProvider, children: props.children }); } /* harmony default export */ const provider = (EditorProvider); ;// CONCATENATED MODULE: external ["wp","serverSideRender"] const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/deprecated.js // Block Creation Components. /** * WordPress dependencies */ function deprecateComponent(name, Wrapped, staticsToHoist = []) { const Component = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { external_wp_deprecated_default()('wp.editor.' + name, { since: '5.3', alternative: 'wp.blockEditor.' + name, version: '6.2' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapped, { ref: ref, ...props }); }); staticsToHoist.forEach(staticName => { Component[staticName] = deprecateComponent(name + '.' + staticName, Wrapped[staticName]); }); return Component; } function deprecateFunction(name, func) { return (...args) => { external_wp_deprecated_default()('wp.editor.' + name, { since: '5.3', alternative: 'wp.blockEditor.' + name, version: '6.2' }); return func(...args); }; } /** * @deprecated since 5.3, use `wp.blockEditor.RichText` instead. */ const RichText = deprecateComponent('RichText', external_wp_blockEditor_namespaceObject.RichText, ['Content']); RichText.isEmpty = deprecateFunction('RichText.isEmpty', external_wp_blockEditor_namespaceObject.RichText.isEmpty); /** * @deprecated since 5.3, use `wp.blockEditor.Autocomplete` instead. */ const Autocomplete = deprecateComponent('Autocomplete', external_wp_blockEditor_namespaceObject.Autocomplete); /** * @deprecated since 5.3, use `wp.blockEditor.AlignmentToolbar` instead. */ const AlignmentToolbar = deprecateComponent('AlignmentToolbar', external_wp_blockEditor_namespaceObject.AlignmentToolbar); /** * @deprecated since 5.3, use `wp.blockEditor.BlockAlignmentToolbar` instead. */ const BlockAlignmentToolbar = deprecateComponent('BlockAlignmentToolbar', external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar); /** * @deprecated since 5.3, use `wp.blockEditor.BlockControls` instead. */ const BlockControls = deprecateComponent('BlockControls', external_wp_blockEditor_namespaceObject.BlockControls, ['Slot']); /** * @deprecated since 5.3, use `wp.blockEditor.BlockEdit` instead. */ const BlockEdit = deprecateComponent('BlockEdit', external_wp_blockEditor_namespaceObject.BlockEdit); /** * @deprecated since 5.3, use `wp.blockEditor.BlockEditorKeyboardShortcuts` instead. */ const BlockEditorKeyboardShortcuts = deprecateComponent('BlockEditorKeyboardShortcuts', external_wp_blockEditor_namespaceObject.BlockEditorKeyboardShortcuts); /** * @deprecated since 5.3, use `wp.blockEditor.BlockFormatControls` instead. */ const BlockFormatControls = deprecateComponent('BlockFormatControls', external_wp_blockEditor_namespaceObject.BlockFormatControls, ['Slot']); /** * @deprecated since 5.3, use `wp.blockEditor.BlockIcon` instead. */ const BlockIcon = deprecateComponent('BlockIcon', external_wp_blockEditor_namespaceObject.BlockIcon); /** * @deprecated since 5.3, use `wp.blockEditor.BlockInspector` instead. */ const BlockInspector = deprecateComponent('BlockInspector', external_wp_blockEditor_namespaceObject.BlockInspector); /** * @deprecated since 5.3, use `wp.blockEditor.BlockList` instead. */ const BlockList = deprecateComponent('BlockList', external_wp_blockEditor_namespaceObject.BlockList); /** * @deprecated since 5.3, use `wp.blockEditor.BlockMover` instead. */ const BlockMover = deprecateComponent('BlockMover', external_wp_blockEditor_namespaceObject.BlockMover); /** * @deprecated since 5.3, use `wp.blockEditor.BlockNavigationDropdown` instead. */ const BlockNavigationDropdown = deprecateComponent('BlockNavigationDropdown', external_wp_blockEditor_namespaceObject.BlockNavigationDropdown); /** * @deprecated since 5.3, use `wp.blockEditor.BlockSelectionClearer` instead. */ const BlockSelectionClearer = deprecateComponent('BlockSelectionClearer', external_wp_blockEditor_namespaceObject.BlockSelectionClearer); /** * @deprecated since 5.3, use `wp.blockEditor.BlockSettingsMenu` instead. */ const BlockSettingsMenu = deprecateComponent('BlockSettingsMenu', external_wp_blockEditor_namespaceObject.BlockSettingsMenu); /** * @deprecated since 5.3, use `wp.blockEditor.BlockTitle` instead. */ const BlockTitle = deprecateComponent('BlockTitle', external_wp_blockEditor_namespaceObject.BlockTitle); /** * @deprecated since 5.3, use `wp.blockEditor.BlockToolbar` instead. */ const BlockToolbar = deprecateComponent('BlockToolbar', external_wp_blockEditor_namespaceObject.BlockToolbar); /** * @deprecated since 5.3, use `wp.blockEditor.ColorPalette` instead. */ const ColorPalette = deprecateComponent('ColorPalette', external_wp_blockEditor_namespaceObject.ColorPalette); /** * @deprecated since 5.3, use `wp.blockEditor.ContrastChecker` instead. */ const ContrastChecker = deprecateComponent('ContrastChecker', external_wp_blockEditor_namespaceObject.ContrastChecker); /** * @deprecated since 5.3, use `wp.blockEditor.CopyHandler` instead. */ const CopyHandler = deprecateComponent('CopyHandler', external_wp_blockEditor_namespaceObject.CopyHandler); /** * @deprecated since 5.3, use `wp.blockEditor.DefaultBlockAppender` instead. */ const DefaultBlockAppender = deprecateComponent('DefaultBlockAppender', external_wp_blockEditor_namespaceObject.DefaultBlockAppender); /** * @deprecated since 5.3, use `wp.blockEditor.FontSizePicker` instead. */ const FontSizePicker = deprecateComponent('FontSizePicker', external_wp_blockEditor_namespaceObject.FontSizePicker); /** * @deprecated since 5.3, use `wp.blockEditor.Inserter` instead. */ const Inserter = deprecateComponent('Inserter', external_wp_blockEditor_namespaceObject.Inserter); /** * @deprecated since 5.3, use `wp.blockEditor.InnerBlocks` instead. */ const InnerBlocks = deprecateComponent('InnerBlocks', external_wp_blockEditor_namespaceObject.InnerBlocks, ['ButtonBlockAppender', 'DefaultBlockAppender', 'Content']); /** * @deprecated since 5.3, use `wp.blockEditor.InspectorAdvancedControls` instead. */ const InspectorAdvancedControls = deprecateComponent('InspectorAdvancedControls', external_wp_blockEditor_namespaceObject.InspectorAdvancedControls, ['Slot']); /** * @deprecated since 5.3, use `wp.blockEditor.InspectorControls` instead. */ const InspectorControls = deprecateComponent('InspectorControls', external_wp_blockEditor_namespaceObject.InspectorControls, ['Slot']); /** * @deprecated since 5.3, use `wp.blockEditor.PanelColorSettings` instead. */ const PanelColorSettings = deprecateComponent('PanelColorSettings', external_wp_blockEditor_namespaceObject.PanelColorSettings); /** * @deprecated since 5.3, use `wp.blockEditor.PlainText` instead. */ const PlainText = deprecateComponent('PlainText', external_wp_blockEditor_namespaceObject.PlainText); /** * @deprecated since 5.3, use `wp.blockEditor.RichTextShortcut` instead. */ const RichTextShortcut = deprecateComponent('RichTextShortcut', external_wp_blockEditor_namespaceObject.RichTextShortcut); /** * @deprecated since 5.3, use `wp.blockEditor.RichTextToolbarButton` instead. */ const RichTextToolbarButton = deprecateComponent('RichTextToolbarButton', external_wp_blockEditor_namespaceObject.RichTextToolbarButton); /** * @deprecated since 5.3, use `wp.blockEditor.__unstableRichTextInputEvent` instead. */ const __unstableRichTextInputEvent = deprecateComponent('__unstableRichTextInputEvent', external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent); /** * @deprecated since 5.3, use `wp.blockEditor.MediaPlaceholder` instead. */ const MediaPlaceholder = deprecateComponent('MediaPlaceholder', external_wp_blockEditor_namespaceObject.MediaPlaceholder); /** * @deprecated since 5.3, use `wp.blockEditor.MediaUpload` instead. */ const MediaUpload = deprecateComponent('MediaUpload', external_wp_blockEditor_namespaceObject.MediaUpload); /** * @deprecated since 5.3, use `wp.blockEditor.MediaUploadCheck` instead. */ const MediaUploadCheck = deprecateComponent('MediaUploadCheck', external_wp_blockEditor_namespaceObject.MediaUploadCheck); /** * @deprecated since 5.3, use `wp.blockEditor.MultiSelectScrollIntoView` instead. */ const MultiSelectScrollIntoView = deprecateComponent('MultiSelectScrollIntoView', external_wp_blockEditor_namespaceObject.MultiSelectScrollIntoView); /** * @deprecated since 5.3, use `wp.blockEditor.NavigableToolbar` instead. */ const NavigableToolbar = deprecateComponent('NavigableToolbar', external_wp_blockEditor_namespaceObject.NavigableToolbar); /** * @deprecated since 5.3, use `wp.blockEditor.ObserveTyping` instead. */ const ObserveTyping = deprecateComponent('ObserveTyping', external_wp_blockEditor_namespaceObject.ObserveTyping); /** * @deprecated since 5.3, use `wp.blockEditor.SkipToSelectedBlock` instead. */ const SkipToSelectedBlock = deprecateComponent('SkipToSelectedBlock', external_wp_blockEditor_namespaceObject.SkipToSelectedBlock); /** * @deprecated since 5.3, use `wp.blockEditor.URLInput` instead. */ const URLInput = deprecateComponent('URLInput', external_wp_blockEditor_namespaceObject.URLInput); /** * @deprecated since 5.3, use `wp.blockEditor.URLInputButton` instead. */ const URLInputButton = deprecateComponent('URLInputButton', external_wp_blockEditor_namespaceObject.URLInputButton); /** * @deprecated since 5.3, use `wp.blockEditor.URLPopover` instead. */ const URLPopover = deprecateComponent('URLPopover', external_wp_blockEditor_namespaceObject.URLPopover); /** * @deprecated since 5.3, use `wp.blockEditor.Warning` instead. */ const Warning = deprecateComponent('Warning', external_wp_blockEditor_namespaceObject.Warning); /** * @deprecated since 5.3, use `wp.blockEditor.WritingFlow` instead. */ const WritingFlow = deprecateComponent('WritingFlow', external_wp_blockEditor_namespaceObject.WritingFlow); /** * @deprecated since 5.3, use `wp.blockEditor.createCustomColorsHOC` instead. */ const createCustomColorsHOC = deprecateFunction('createCustomColorsHOC', external_wp_blockEditor_namespaceObject.createCustomColorsHOC); /** * @deprecated since 5.3, use `wp.blockEditor.getColorClassName` instead. */ const getColorClassName = deprecateFunction('getColorClassName', external_wp_blockEditor_namespaceObject.getColorClassName); /** * @deprecated since 5.3, use `wp.blockEditor.getColorObjectByAttributeValues` instead. */ const getColorObjectByAttributeValues = deprecateFunction('getColorObjectByAttributeValues', external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues); /** * @deprecated since 5.3, use `wp.blockEditor.getColorObjectByColorValue` instead. */ const getColorObjectByColorValue = deprecateFunction('getColorObjectByColorValue', external_wp_blockEditor_namespaceObject.getColorObjectByColorValue); /** * @deprecated since 5.3, use `wp.blockEditor.getFontSize` instead. */ const getFontSize = deprecateFunction('getFontSize', external_wp_blockEditor_namespaceObject.getFontSize); /** * @deprecated since 5.3, use `wp.blockEditor.getFontSizeClass` instead. */ const getFontSizeClass = deprecateFunction('getFontSizeClass', external_wp_blockEditor_namespaceObject.getFontSizeClass); /** * @deprecated since 5.3, use `wp.blockEditor.createCustomColorsHOC` instead. */ const withColorContext = deprecateFunction('withColorContext', external_wp_blockEditor_namespaceObject.withColorContext); /** * @deprecated since 5.3, use `wp.blockEditor.withColors` instead. */ const withColors = deprecateFunction('withColors', external_wp_blockEditor_namespaceObject.withColors); /** * @deprecated since 5.3, use `wp.blockEditor.withFontSizes` instead. */ const withFontSizes = deprecateFunction('withFontSizes', external_wp_blockEditor_namespaceObject.withFontSizes); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/index.js /** * Internal dependencies */ // Block Creation Components. // Post Related Components. // State Related Components. const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts; const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts; ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/url.js /** * WordPress dependencies */ /** * Performs some basic cleanup of a string for use as a post slug * * This replicates some of what sanitize_title() does in WordPress core, but * is only designed to approximate what the slug will be. * * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin letters. * Removes combining diacritical marks. Converts whitespace, periods, * and forward slashes to hyphens. Removes any remaining non-word characters * except hyphens and underscores. Converts remaining string to lowercase. * It does not account for octets, HTML entities, or other encoded characters. * * @param {string} string Title or slug to be processed * * @return {string} Processed string */ function cleanForSlug(string) { external_wp_deprecated_default()('wp.editor.cleanForSlug', { since: '12.7', plugin: 'Gutenberg', alternative: 'wp.url.cleanForSlug' }); return (0,external_wp_url_namespaceObject.cleanForSlug)(string); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/index.js /** * Internal dependencies */ ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-interface/content-slot-fill.js /** * WordPress dependencies */ /** * Internal dependencies */ const { createPrivateSlotFill } = unlock(external_wp_components_namespaceObject.privateApis); const SLOT_FILL_NAME = 'EditCanvasContainerSlot'; const EditorContentSlotFill = createPrivateSlotFill(SLOT_FILL_NAME); /* harmony default export */ const content_slot_fill = (EditorContentSlotFill); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/header/back-button.js /** * WordPress dependencies */ // Keeping an old name for backward compatibility. const slotName = '__experimentalMainDashboardButton'; const { Fill: back_button_Fill, Slot: back_button_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)(slotName); const BackButton = back_button_Fill; const BackButtonSlot = ({ children }) => { const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotName); const hasFills = Boolean(fills && fills.length); if (!hasFills) { return children; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button_Slot, { bubblesVirtually: true, fillProps: { length: !fills ? 0 : fills.length } }); }; BackButton.Slot = BackButtonSlot; /* harmony default export */ const back_button = (BackButton); ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { env.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; function __disposeResources(env) { function fail(e) { env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } function next() { while (env.stack.length) { var rec = env.stack.pop(); try { var result = rec.dispose && rec.dispose.call(rec.value); if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); } catch (e) { fail(e); } } if (env.hasError) throw env.error; } return next(); } /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, }); ;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js /** * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt */ var SUPPORTED_LOCALE = { tr: { regexp: /\u0130|\u0049|\u0049\u0307/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, az: { regexp: /\u0130/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, lt: { regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, map: { I: "\u0069\u0307", J: "\u006A\u0307", Į: "\u012F\u0307", Ì: "\u0069\u0307\u0300", Í: "\u0069\u0307\u0301", Ĩ: "\u0069\u0307\u0303", }, }, }; /** * Localized lower case. */ function localeLowerCase(str, locale) { var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; if (lang) return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); return lowerCase(str); } /** * Lower case as a function. */ function lowerCase(str) { return str.toLowerCase(); } ;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; // Remove all non-word characters. var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; /** * Normalize the string into something other libraries can manipulate easier. */ function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; // Trim the delimiter from around the output string. while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; // Transform each token independently. return result.slice(start, end).split("\0").map(transform).join(delimiter); } /** * Replace `re` in the input string with the replacement value. */ function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function (input, re) { return input.replace(re, value); }, input); } ;// CONCATENATED MODULE: ./node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "." }, options)); } ;// CONCATENATED MODULE: ./node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { if (options === void 0) { options = {}; } return dotCase(input, __assign({ delimiter: "-" }, options)); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/create-template-part-modal/utils.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const useExistingTemplateParts = () => { return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { per_page: -1 }), []); }; /** * Return a unique template part title based on * the given title and existing template parts. * * @param {string} title The original template part title. * @param {Object} templateParts The array of template part entities. * @return {string} A unique template part title. */ const getUniqueTemplatePartTitle = (title, templateParts) => { const lowercaseTitle = title.toLowerCase(); const existingTitles = templateParts.map(templatePart => templatePart.title.rendered.toLowerCase()); if (!existingTitles.includes(lowercaseTitle)) { return title; } let suffix = 2; while (existingTitles.includes(`${lowercaseTitle} ${suffix}`)) { suffix++; } return `${title} ${suffix}`; }; /** * Get a valid slug for a template part. * Currently template parts only allow latin chars. * The fallback slug will receive suffix by default. * * @param {string} title The template part title. * @return {string} A valid template part slug. */ const getCleanTemplatePartSlug = title => { return paramCase(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/create-template-part-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function CreateTemplatePartModal({ modalTitle, ...restProps }) { const defaultModalTitle = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(TEMPLATE_PART_POST_TYPE)?.labels?.add_new_item, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: modalTitle || defaultModalTitle, onRequestClose: restProps.closeModal, overlayClassName: "editor-create-template-part-modal", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModalContents, { ...restProps }) }); } function CreateTemplatePartModalContents({ defaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY, blocks = [], confirmLabel = (0,external_wp_i18n_namespaceObject.__)('Add'), closeModal, onCreate, onError, defaultTitle = '' }) { const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const existingTemplateParts = useExistingTemplateParts(); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(defaultTitle); const [area, setArea] = (0,external_wp_element_namespaceObject.useState)(defaultArea); const [isSubmitting, setIsSubmitting] = (0,external_wp_element_namespaceObject.useState)(false); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CreateTemplatePartModal); const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).__experimentalGetDefaultTemplatePartAreas(), []); async function createTemplatePart() { if (!title || isSubmitting) { return; } try { setIsSubmitting(true); const uniqueTitle = getUniqueTemplatePartTitle(title, existingTemplateParts); const cleanSlug = getCleanTemplatePartSlug(uniqueTitle); const templatePart = await saveEntityRecord('postType', TEMPLATE_PART_POST_TYPE, { slug: cleanSlug, title: uniqueTitle, content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), area }, { throwOnError: true }); await onCreate(templatePart); // TODO: Add a success notice? } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.'); createErrorNotice(errorMessage, { type: 'snackbar' }); onError?.(); } finally { setIsSubmitting(false); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: async event => { event.preventDefault(); await createTemplatePart(); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "4", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle, required: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl, { label: (0,external_wp_i18n_namespaceObject.__)('Area'), id: `editor-create-template-part-modal__area-selection-${instanceId}`, className: "editor-create-template-part-modal__area-base-control", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalRadioGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Area'), className: "editor-create-template-part-modal__area-radio-group", id: `editor-create-template-part-modal__area-selection-${instanceId}`, onChange: setArea, checked: area, children: templatePartAreas.map(({ icon, label, area: value, description }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalRadio, { value: value, className: "editor-create-template-part-modal__area-radio", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { align: "start", justify: "start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: icon }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.FlexBlock, { className: "editor-create-template-part-modal__option-label", children: [label, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: description })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "editor-create-template-part-modal__checkbox", children: area === value && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: library_check }) })] }) }, label)) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: () => { closeModal(); }, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", "aria-disabled": !title || isSubmitting, isBusy: isSubmitting, children: confirmLabel })] })] }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js /** * WordPress dependencies */ const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) }); /* harmony default export */ const library_next = (next); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js /** * WordPress dependencies */ const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) }); /* harmony default export */ const library_previous = (previous); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/collapsible-block-toolbar/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { useHasBlockToolbar } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function CollapsableBlockToolbar({ isCollapsed, onToggle }) { const { blockSelectionStart } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { blockSelectionStart: select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart() }; }, []); const hasBlockToolbar = useHasBlockToolbar(); const hasBlockSelection = !!blockSelectionStart; (0,external_wp_element_namespaceObject.useEffect)(() => { // If we have a new block selection, show the block tools if (blockSelectionStart) { onToggle(false); } }, [blockSelectionStart, onToggle]); if (!hasBlockToolbar) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('editor-collapsible-block-toolbar', { 'is-collapsed': isCollapsed || !hasBlockSelection }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover.Slot, { name: "block-toolbar" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "editor-collapsible-block-toolbar__toggle", icon: isCollapsed ? library_next : library_previous, onClick: () => { onToggle(!isCollapsed); }, label: isCollapsed ? (0,external_wp_i18n_namespaceObject.__)('Show block tools') : (0,external_wp_i18n_namespaceObject.__)('Hide block tools'), size: "compact" })] }); } /* harmony default export */ const collapsible_block_toolbar = (CollapsableBlockToolbar); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js /** * WordPress dependencies */ const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); /* harmony default export */ const library_plus = (plus); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-tools/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function DocumentTools({ className, disableBlockTools = false }) { const { setIsInserterOpened, setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { isDistractionFree, isInserterOpened, isListViewOpen, listViewShortcut, inserterSidebarToggleRef, listViewToggleRef, hasFixedToolbar, showIconLabels } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { get } = select(external_wp_preferences_namespaceObject.store); const { isListViewOpened, getEditorMode, getInserterSidebarToggleRef, getListViewToggleRef } = unlock(select(store_store)); const { getShortcutRepresentation } = select(external_wp_keyboardShortcuts_namespaceObject.store); const { __unstableGetEditorMode } = select(external_wp_blockEditor_namespaceObject.store); return { isInserterOpened: select(store_store).isInserterOpened(), isListViewOpen: isListViewOpened(), listViewShortcut: getShortcutRepresentation('core/editor/toggle-list-view'), inserterSidebarToggleRef: getInserterSidebarToggleRef(), listViewToggleRef: getListViewToggleRef(), hasFixedToolbar: getSettings().hasFixedToolbar, showIconLabels: get('core', 'showIconLabels'), isDistractionFree: get('core', 'distractionFree'), isVisualMode: getEditorMode() === 'visual', isZoomedOutView: __unstableGetEditorMode() === 'zoom-out' }; }, []); const preventDefault = event => { // Because the inserter behaves like a dialog, // if the inserter is opened already then when we click on the toggle button // then the initial click event will close the inserter and then be propagated // to the inserter toggle and it will open it again. // To prevent this we need to stop the propagation of the event. // This won't be necessary when the inserter no longer behaves like a dialog. if (isInserterOpened) { event.preventDefault(); } }; const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('wide'); /* translators: accessibility text for the editor toolbar */ const toolbarAriaLabel = (0,external_wp_i18n_namespaceObject.__)('Document tools'); const toggleListView = (0,external_wp_element_namespaceObject.useCallback)(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]); const toggleInserter = (0,external_wp_element_namespaceObject.useCallback)(() => setIsInserterOpened(!isInserterOpened), [isInserterOpened, setIsInserterOpened]); /* translators: button label text should, if possible, be under 16 characters. */ const longLabel = (0,external_wp_i18n_namespaceObject._x)('Toggle block inserter', 'Generic label for block inserter button'); const shortLabel = !isInserterOpened ? (0,external_wp_i18n_namespaceObject.__)('Add') : (0,external_wp_i18n_namespaceObject.__)('Close'); return ( /*#__PURE__*/ // Some plugins expect and use the `edit-post-header-toolbar` CSS class to // find the toolbar and inject UI elements into it. This is not officially // supported, but we're keeping it in the list of class names for backwards // compatibility. (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.NavigableToolbar, { className: dist_clsx('editor-document-tools', 'edit-post-header-toolbar', className), "aria-label": toolbarAriaLabel, variant: "unstyled", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-document-tools__left", children: [!isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { ref: inserterSidebarToggleRef, as: external_wp_components_namespaceObject.Button, className: "editor-document-tools__inserter-toggle", variant: "primary", isPressed: isInserterOpened, onMouseDown: preventDefault, onClick: toggleInserter, disabled: disableBlockTools, icon: library_plus, label: showIconLabels ? shortLabel : longLabel, showTooltip: !showIconLabels, "aria-expanded": isInserterOpened }), (isWideViewport || !showIconLabels) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isLargeViewport && !hasFixedToolbar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: external_wp_blockEditor_namespaceObject.ToolSelector, showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, disabled: disableBlockTools, size: "compact" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: editor_history_undo, showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, size: "compact" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: editor_history_redo, showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, size: "compact" }), !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: external_wp_components_namespaceObject.Button, className: "editor-document-tools__document-overview-toggle", icon: list_view, disabled: disableBlockTools, isPressed: isListViewOpen /* translators: button label text should, if possible, be under 16 characters. */, label: (0,external_wp_i18n_namespaceObject.__)('Document Overview'), onClick: toggleListView, shortcut: listViewShortcut, showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, "aria-expanded": isListViewOpen, ref: listViewToggleRef, size: "compact" })] })] }) }) ); } /* harmony default export */ const document_tools = (DocumentTools); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js /** * WordPress dependencies */ const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); /* harmony default export */ const more_vertical = (moreVertical); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/more-menu/copy-content-menu-item.js /** * WordPress dependencies */ /** * Internal dependencies */ function CopyContentMenuItem() { const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { getCurrentPostId, getCurrentPostType } = (0,external_wp_data_namespaceObject.useSelect)(store_store); const { getEditedEntityRecord } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); function getText() { const record = getEditedEntityRecord('postType', getCurrentPostType(), getCurrentPostId()); if (!record) { return ''; } if (typeof record.content === 'function') { return record.content(record); } else if (record.blocks) { return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(record.blocks); } else if (record.content) { return record.content; } } function onSuccess() { createNotice('info', (0,external_wp_i18n_namespaceObject.__)('All content copied.'), { isDismissible: true, type: 'snackbar' }); } const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(getText, onSuccess); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ref: ref, children: (0,external_wp_i18n_namespaceObject.__)('Copy all blocks') }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/mode-switcher/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Set of available mode options. * * @type {Array} */ const MODES = [{ value: 'visual', label: (0,external_wp_i18n_namespaceObject.__)('Visual editor') }, { value: 'text', label: (0,external_wp_i18n_namespaceObject.__)('Code editor') }]; function ModeSwitcher() { const { shortcut, isRichEditingEnabled, isCodeEditingEnabled, mode } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ shortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation('core/editor/toggle-mode'), isRichEditingEnabled: select(store_store).getEditorSettings().richEditingEnabled, isCodeEditingEnabled: select(store_store).getEditorSettings().codeEditingEnabled, mode: select(store_store).getEditorMode() }), []); const { switchEditorMode } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); let selectedMode = mode; if (!isRichEditingEnabled && mode === 'visual') { selectedMode = 'text'; } if (!isCodeEditingEnabled && mode === 'text') { selectedMode = 'visual'; } const choices = MODES.map(choice => { if (!isCodeEditingEnabled && choice.value === 'text') { choice = { ...choice, disabled: true }; } if (!isRichEditingEnabled && choice.value === 'visual') { choice = { ...choice, disabled: true, info: (0,external_wp_i18n_namespaceObject.__)('You can enable the visual editor in your profile settings.') }; } if (choice.value !== selectedMode && !choice.disabled) { return { ...choice, shortcut }; } return choice; }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Editor'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, { choices: choices, value: selectedMode, onSelect: switchEditorMode }) }); } /* harmony default export */ const mode_switcher = (ModeSwitcher); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/more-menu/tools-more-menu-group.js /** * WordPress dependencies */ const { Fill: ToolsMoreMenuGroup, Slot: tools_more_menu_group_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)('ToolsMoreMenuGroup'); ToolsMoreMenuGroup.Slot = ({ fillProps }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_more_menu_group_Slot, { fillProps: fillProps }); /* harmony default export */ const tools_more_menu_group = (ToolsMoreMenuGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/more-menu/view-more-menu-group.js /** * WordPress dependencies */ const { Fill: ViewMoreMenuGroup, Slot: view_more_menu_group_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)(external_wp_element_namespaceObject.Platform.OS === 'web' ? Symbol('ViewMoreMenuGroup') : 'ViewMoreMenuGroup'); ViewMoreMenuGroup.Slot = ({ fillProps }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_more_menu_group_Slot, { fillProps: fillProps }); /* harmony default export */ const view_more_menu_group = (ViewMoreMenuGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/more-menu/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function MoreMenu() { const { openModal } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); const { toggleDistractionFree } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels'), []); const turnOffDistractionFree = () => { setPreference('core', 'distractionFree', false); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Options'), popoverProps: { placement: 'bottom-end', className: 'more-menu-dropdown__content' }, toggleProps: { showTooltip: !showIconLabels, ...(showIconLabels && { variant: 'tertiary' }), tooltipPosition: 'bottom', size: 'compact' }, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core", name: "fixedToolbar", onToggle: turnOffDistractionFree, label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core", name: "distractionFree", label: (0,external_wp_i18n_namespaceObject.__)('Distraction free'), info: (0,external_wp_i18n_namespaceObject.__)('Write with calmness'), handleToggling: false, onToggle: toggleDistractionFree, messageActivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode deactivated'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('\\') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core", name: "focusMode", label: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode'), info: (0,external_wp_i18n_namespaceObject.__)('Focus on one block at a time'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode deactivated') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_more_menu_group.Slot, { fillProps: { onClose } })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mode_switcher, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item.Slot, { name: "core/plugin-more-menu", label: (0,external_wp_i18n_namespaceObject.__)('Plugins'), as: external_wp_components_namespaceObject.MenuGroup, fillProps: { onClick: onClose } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Tools'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => openModal('editor/keyboard-shortcut-help'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h'), children: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyContentMenuItem, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, { icon: library_external, href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'), target: "_blank", rel: "noopener noreferrer", children: [(0,external_wp_i18n_namespaceObject.__)('Help'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span", children: /* translators: accessibility text */ (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_more_menu_group.Slot, { fillProps: { onClose } })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => openModal('editor/preferences'), children: (0,external_wp_i18n_namespaceObject.__)('Preferences') }) })] }) }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-button/post-publish-button-or-toggle.js /** * WordPress dependencies */ /** * Internal dependencies */ function PostPublishButtonOrToggle({ forceIsDirty, hasPublishAction, isBeingScheduled, isPending, isPublished, isPublishSidebarEnabled, isPublishSidebarOpened, isScheduled, togglePublishSidebar, setEntitiesSavedStatesCallback, postStatusHasChanged, postStatus }) { const IS_TOGGLE = 'toggle'; const IS_BUTTON = 'button'; const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); let component; /** * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar): * * 1) We want to show a BUTTON when the post status is at the _final stage_ * for a particular role (see https://wordpress.org/documentation/article/post-status/): * * - is published * - post status has changed explicitely to something different than 'future' or 'publish' * - is scheduled to be published * - is pending and can't be published (but only for viewports >= medium). * Originally, we considered showing a button for pending posts that couldn't be published * (for example, for an author with the contributor role). Some languages can have * long translations for "Submit for review", so given the lack of UI real estate available * we decided to take into account the viewport in that case. * See: https://github.com/WordPress/gutenberg/issues/10475 * * 2) Then, in small viewports, we'll show a TOGGLE. * * 3) Finally, we'll use the publish sidebar status to decide: * * - if it is enabled, we show a TOGGLE * - if it is disabled, we show a BUTTON */ if (isPublished || postStatusHasChanged && !['future', 'publish'].includes(postStatus) || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) { component = IS_BUTTON; } else if (isSmallerThanMediumViewport || isPublishSidebarEnabled) { component = IS_TOGGLE; } else { component = IS_BUTTON; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_button, { forceIsDirty: forceIsDirty, isOpen: isPublishSidebarOpened, isToggle: component === IS_TOGGLE, onToggle: togglePublishSidebar, setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback }); } /* harmony default export */ const post_publish_button_or_toggle = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)(select => { var _select$getCurrentPos; return { hasPublishAction: (_select$getCurrentPos = select(store_store).getCurrentPost()?._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false, isBeingScheduled: select(store_store).isEditedPostBeingScheduled(), isPending: select(store_store).isCurrentPostPending(), isPublished: select(store_store).isCurrentPostPublished(), isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled(), isPublishSidebarOpened: select(store_store).isPublishSidebarOpened(), isScheduled: select(store_store).isCurrentPostScheduled(), postStatus: select(store_store).getEditedPostAttribute('status'), postStatusHasChanged: select(store_store).getPostEdits()?.status }; }), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => { const { togglePublishSidebar } = dispatch(store_store); return { togglePublishSidebar }; }))(PostPublishButtonOrToggle)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-view-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function PostViewLink() { const { hasLoaded, permalink, isPublished, label, showIconLabels } = (0,external_wp_data_namespaceObject.useSelect)(select => { // Grab post type to retrieve the view_item label. const postTypeSlug = select(store_store).getCurrentPostType(); const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug); const { get } = select(external_wp_preferences_namespaceObject.store); return { permalink: select(store_store).getPermalink(), isPublished: select(store_store).isCurrentPostPublished(), label: postType?.labels.view_item, hasLoaded: !!postType, showIconLabels: get('core', 'showIconLabels') }; }, []); // Only render the view button if the post is published and has a permalink. if (!isPublished || !permalink || !hasLoaded) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: library_external, label: label || (0,external_wp_i18n_namespaceObject.__)('View post'), href: permalink, target: "_blank", showTooltip: !showIconLabels, size: "compact" }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/mobile.js /** * WordPress dependencies */ const mobile = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) }); /* harmony default export */ const library_mobile = (mobile); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tablet.js /** * WordPress dependencies */ const tablet = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z" }) }); /* harmony default export */ const library_tablet = (tablet); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/desktop.js /** * WordPress dependencies */ const desktop = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z" }) }); /* harmony default export */ const library_desktop = (desktop); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/preview-dropdown/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function PreviewDropdown({ forceIsAutosaveable, disabled }) { const { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getPostType$viewable; const { getDeviceType, getCurrentPostType } = select(store_store); const { getUnstableBase, getPostType } = select(external_wp_coreData_namespaceObject.store); const { get } = select(external_wp_preferences_namespaceObject.store); const _currentPostType = getCurrentPostType(); return { deviceType: getDeviceType(), homeUrl: getUnstableBase()?.home, isTemplate: _currentPostType === 'wp_template', isViewable: (_getPostType$viewable = getPostType(_currentPostType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false, showIconLabels: get('core', 'showIconLabels') }; }, []); const { setDeviceType } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); if (isMobile) { return null; } const popoverProps = { placement: 'bottom-end' }; const toggleProps = { className: 'editor-preview-dropdown__toggle', size: 'compact', showTooltip: !showIconLabels, disabled, __experimentalIsFocusable: disabled }; const menuProps = { 'aria-label': (0,external_wp_i18n_namespaceObject.__)('View options') }; const deviceIcons = { mobile: library_mobile, tablet: library_tablet, desktop: library_desktop }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { className: "editor-preview-dropdown", popoverProps: popoverProps, toggleProps: toggleProps, menuProps: menuProps, icon: deviceIcons[deviceType.toLowerCase()], label: (0,external_wp_i18n_namespaceObject.__)('View'), disableOpenOnArrowDown: disabled, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => setDeviceType('Desktop'), icon: deviceType === 'Desktop' && library_check, children: (0,external_wp_i18n_namespaceObject.__)('Desktop') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => setDeviceType('Tablet'), icon: deviceType === 'Tablet' && library_check, children: (0,external_wp_i18n_namespaceObject.__)('Tablet') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => setDeviceType('Mobile'), icon: deviceType === 'Mobile' && library_check, children: (0,external_wp_i18n_namespaceObject.__)('Mobile') })] }), isTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, { href: homeUrl, target: "_blank", icon: library_external, onClick: onClose, children: [(0,external_wp_i18n_namespaceObject.__)('View site'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span", children: /* translators: accessibility text */ (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)') })] }) }), isViewable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewButton, { className: "editor-preview-dropdown__button-external", role: "menuitem", forceIsAutosaveable: forceIsAutosaveable, textContent: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(0,external_wp_i18n_namespaceObject.__)('Preview in new tab'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: library_external })] }), onPreview: onClose }) })] }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/header/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const toolbarVariations = { distractionFreeDisabled: { y: '-50px' }, distractionFreeHover: { y: 0 }, distractionFreeHidden: { y: '-50px' }, visible: { y: 0 }, hidden: { y: 0 } }; const backButtonVariations = { distractionFreeDisabled: { x: '-100%' }, distractionFreeHover: { x: 0 }, distractionFreeHidden: { x: '-100%' }, visible: { x: 0 }, hidden: { x: 0 } }; function Header({ customSaveButton, forceIsDirty, forceDisableBlockTools, setEntitiesSavedStatesCallback, title }) { const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large'); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const { isTextEditor, isPublishSidebarOpened, showIconLabels, hasFixedToolbar, isNestedEntity, isZoomedOutView } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get: getPreference } = select(external_wp_preferences_namespaceObject.store); const { getEditorMode, getEditorSettings, isPublishSidebarOpened: _isPublishSidebarOpened } = select(store_store); const { __unstableGetEditorMode } = select(external_wp_blockEditor_namespaceObject.store); return { isTextEditor: getEditorMode() === 'text', isPublishSidebarOpened: _isPublishSidebarOpened(), showIconLabels: getPreference('core', 'showIconLabels'), hasFixedToolbar: getPreference('core', 'fixedToolbar'), isNestedEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord, isZoomedOutView: __unstableGetEditorMode() === 'zoom-out' }; }, []); const hasTopToolbar = isLargeViewport && hasFixedToolbar; const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = (0,external_wp_element_namespaceObject.useState)(true); // The edit-post-header classname is only kept for backward compatibilty // as some plugins might be relying on its presence. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-header edit-post-header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: backButtonVariations, transition: { type: 'tween' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button.Slot, {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: toolbarVariations, className: "editor-header__toolbar", transition: { type: 'tween' }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(document_tools, { disableBlockTools: forceDisableBlockTools || isTextEditor }), hasTopToolbar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(collapsible_block_toolbar, { isCollapsed: isBlockToolsCollapsed, onToggle: setIsBlockToolsCollapsed }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('editor-header__center', { 'is-collapsed': !isBlockToolsCollapsed && hasTopToolbar }), children: !title ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentBar, {}) : title })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: toolbarVariations, transition: { type: 'tween' }, className: "editor-header__settings", children: [!customSaveButton && !isPublishSidebarOpened && /*#__PURE__*/ // This button isn't completely hidden by the publish sidebar. // We can't hide the whole toolbar when the publish sidebar is open because // we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node. // We track that DOM node to return focus to the PostPublishButtonOrToggle // when the publish sidebar has been closed. (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSavedState, { forceIsDirty: forceIsDirty }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewDropdown, { forceIsAutosaveable: forceIsDirty, disabled: isNestedEntity || isZoomedOutView }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewButton, { className: "editor-header__post-preview-button", forceIsAutosaveable: forceIsDirty }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostViewLink, {}), !customSaveButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_button_or_toggle, { forceIsDirty: forceIsDirty, setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback }), customSaveButton, (isWideViewport || !showIconLabels) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items.Slot, { scope: "core" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})] })] }); } /* harmony default export */ const components_header = (Header); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/inserter-sidebar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PrivateInserterLibrary } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function InserterSidebar() { const { blockSectionRootClientId, inserterSidebarToggleRef, insertionPoint, showMostUsedBlocks, sidebarIsOpened } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getInserterSidebarToggleRef, getInsertionPoint, isPublishSidebarOpened } = unlock(select(store_store)); const { getBlockRootClientId, __unstableGetEditorMode, getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { get } = select(external_wp_preferences_namespaceObject.store); const { getActiveComplementaryArea } = select(store); const getBlockSectionRootClientId = () => { if (__unstableGetEditorMode() === 'zoom-out') { const { sectionRootClientId } = unlock(getSettings()); if (sectionRootClientId) { return sectionRootClientId; } } return getBlockRootClientId(); }; return { inserterSidebarToggleRef: getInserterSidebarToggleRef(), insertionPoint: getInsertionPoint(), showMostUsedBlocks: get('core', 'mostUsedBlocks'), blockSectionRootClientId: getBlockSectionRootClientId(), sidebarIsOpened: !!(getActiveComplementaryArea('core') || isPublishSidebarOpened()) }; }, []); const { setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const [inserterDialogRef, inserterDialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({ onClose: () => setIsInserterOpened(false), focusOnMount: true }); const libraryRef = (0,external_wp_element_namespaceObject.useRef)(); // When closing the inserter, focus should return to the toggle button. const closeInserterSidebar = (0,external_wp_element_namespaceObject.useCallback)(() => { setIsInserterOpened(false); inserterSidebarToggleRef.current?.focus(); }, [inserterSidebarToggleRef, setIsInserterOpened]); const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => { if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { event.preventDefault(); closeInserterSidebar(); } }, [closeInserterSidebar]); const inserterContents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-inserter-sidebar__content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInserterLibrary, { showMostUsedBlocks: showMostUsedBlocks, showInserterHelpPanel: true, shouldFocusBlock: isMobileViewport, rootClientId: blockSectionRootClientId !== null && blockSectionRootClientId !== void 0 ? blockSectionRootClientId : insertionPoint.rootClientId, __experimentalInsertionIndex: insertionPoint.insertionIndex, __experimentalInitialTab: insertionPoint.tab, __experimentalInitialCategory: insertionPoint.category, __experimentalFilterValue: insertionPoint.filterValue, onPatternCategorySelection: sidebarIsOpened ? () => disableComplementaryArea('core') : undefined, ref: libraryRef, onClose: closeInserterSidebar }) }); if (window.__experimentalEnableZoomedOutPatternsTab) { return ( /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/no-static-element-interactions (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { onKeyDown: closeOnEscape, className: "editor-inserter-sidebar", children: inserterContents }) ); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: inserterDialogRef, ...inserterDialogProps, className: "editor-inserter-sidebar", children: inserterContents }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/list-view-outline.js /** * WordPress dependencies */ /** * Internal dependencies */ function ListViewOutline() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-list-view-sidebar__outline", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)('Characters:') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CharacterCount, {}) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)('Words:') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WordCount, {})] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)('Time to read:') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeToRead, {})] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentOutline, {})] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); function ListViewSidebar() { const { setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { getListViewToggleRef } = unlock((0,external_wp_data_namespaceObject.useSelect)(store_store)); // This hook handles focus when the sidebar first renders. const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); // When closing the list view, focus should return to the toggle button. const closeListView = (0,external_wp_element_namespaceObject.useCallback)(() => { setIsListViewOpened(false); getListViewToggleRef().current?.focus(); }, [getListViewToggleRef, setIsListViewOpened]); const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => { if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { event.preventDefault(); closeListView(); } }, [closeListView]); // Use internal state instead of a ref to make sure that the component // re-renders when the dropZoneElement updates. const [dropZoneElement, setDropZoneElement] = (0,external_wp_element_namespaceObject.useState)(null); // Tracks our current tab. const [tab, setTab] = (0,external_wp_element_namespaceObject.useState)('list-view'); // This ref refers to the sidebar as a whole. const sidebarRef = (0,external_wp_element_namespaceObject.useRef)(); // This ref refers to the tab panel. const tabsRef = (0,external_wp_element_namespaceObject.useRef)(); // This ref refers to the list view application area. const listViewRef = (0,external_wp_element_namespaceObject.useRef)(); // Must merge the refs together so focus can be handled properly in the next function. const listViewContainerRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([focusOnMountRef, listViewRef, setDropZoneElement]); /* * Callback function to handle list view or outline focus. * * @param {string} currentTab The current tab. Either list view or outline. * * @return void */ function handleSidebarFocus(currentTab) { // Tab panel focus. const tabPanelFocus = external_wp_dom_namespaceObject.focus.tabbable.find(tabsRef.current)[0]; // List view tab is selected. if (currentTab === 'list-view') { // Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks. const listViewApplicationFocus = external_wp_dom_namespaceObject.focus.tabbable.find(listViewRef.current)[0]; const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus; listViewFocusArea.focus(); // Outline tab is selected. } else { tabPanelFocus.focus(); } } const handleToggleListViewShortcut = (0,external_wp_element_namespaceObject.useCallback)(() => { // If the sidebar has focus, it is safe to close. if (sidebarRef.current.contains(sidebarRef.current.ownerDocument.activeElement)) { closeListView(); } else { // If the list view or outline does not have focus, focus should be moved to it. handleSidebarFocus(tab); } }, [closeListView, tab]); // This only fires when the sidebar is open because of the conditional rendering. // It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/toggle-list-view', handleToggleListViewShortcut); return ( /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/no-static-element-interactions (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-list-view-sidebar", onKeyDown: closeOnEscape, ref: sidebarRef, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, { onSelect: tabName => setTab(tabName), selectOnMove: false // The initial tab value is set explicitly to avoid an initial // render where no tab is selected. This ensures that the // tabpanel height is correct so the relevant scroll container // can be rendered internally. , defaultTabId: "list-view", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-list-view-sidebar__header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "editor-list-view-sidebar__close-button", icon: close_small, label: (0,external_wp_i18n_namespaceObject.__)('Close'), onClick: closeListView, size: "small" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, { className: "editor-list-view-sidebar__tabs-tablist", ref: tabsRef, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { className: "editor-list-view-sidebar__tabs-tab", tabId: "list-view", children: (0,external_wp_i18n_namespaceObject._x)('List View', 'Post overview') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { className: "editor-list-view-sidebar__tabs-tab", tabId: "outline", children: (0,external_wp_i18n_namespaceObject._x)('Outline', 'Post overview') })] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { ref: listViewContainerRef, className: "editor-list-view-sidebar__tabs-tabpanel", tabId: "list-view", focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-list-view-sidebar__list-view-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-list-view-sidebar__list-view-panel-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalListView, { dropZoneElement: dropZoneElement }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { className: "editor-list-view-sidebar__tabs-tabpanel", tabId: "outline", focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-list-view-sidebar__list-view-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewOutline, {}) }) })] }) }) ); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/save-publish-panels/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Fill: save_publish_panels_Fill, Slot: save_publish_panels_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)('ActionsPanel'); const ActionsPanelFill = (/* unused pure expression or super */ null && (save_publish_panels_Fill)); function SavePublishPanels({ setEntitiesSavedStatesCallback, closeEntitiesSavedStates, isEntitiesSavedStatesOpen, forceIsDirtyPublishPanel }) { const { closePublishSidebar, togglePublishSidebar } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { publishSidebarOpened, isPublishable, isDirty, hasOtherEntitiesChanges } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isPublishSidebarOpened, isEditedPostPublishable, isCurrentPostPublished, isEditedPostDirty, hasNonPostEntityChanges } = select(store_store); const _hasOtherEntitiesChanges = hasNonPostEntityChanges(); return { publishSidebarOpened: isPublishSidebarOpened(), isPublishable: !isCurrentPostPublished() && isEditedPostPublishable(), isDirty: _hasOtherEntitiesChanges || isEditedPostDirty(), hasOtherEntitiesChanges: _hasOtherEntitiesChanges }; }, []); const openEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(() => setEntitiesSavedStatesCallback(true), []); // It is ok for these components to be unmounted when not in visual use. // We don't want more than one present at a time, decide which to render. let unmountableContent; if (publishSidebarOpened) { unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_panel, { onClose: closePublishSidebar, forceIsDirty: forceIsDirtyPublishPanel, PrePublishExtension: plugin_pre_publish_panel.Slot, PostPublishExtension: plugin_post_publish_panel.Slot }); } else if (isPublishable && !hasOtherEntitiesChanges) { unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-layout__toggle-publish-panel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "secondary", className: "editor-layout__toggle-publish-panel-button", onClick: togglePublishSidebar, "aria-expanded": false, children: (0,external_wp_i18n_namespaceObject.__)('Open publish panel') }) }); } else { unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-layout__toggle-entities-saved-states-panel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "secondary", className: "editor-layout__toggle-entities-saved-states-panel-button", onClick: openEntitiesSavedStates, "aria-expanded": false, disabled: !isDirty, __experimentalIsFocusable: true, children: (0,external_wp_i18n_namespaceObject.__)('Open save panel') }) }); } // Since EntitiesSavedStates controls its own panel, we can keep it // always mounted to retain its own component state (such as checkboxes). return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isEntitiesSavedStatesOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStates, { close: closeEntitiesSavedStates }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(save_publish_panels_Slot, { bubblesVirtually: true }), !isEntitiesSavedStatesOpen && unmountableContent] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/text-editor/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function TextEditor({ autoFocus = false }) { const { switchEditorMode } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { shortcut, isRichEditingEnabled } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorSettings } = select(store_store); const { getShortcutRepresentation } = select(external_wp_keyboardShortcuts_namespaceObject.store); return { shortcut: getShortcutRepresentation('core/editor/toggle-mode'), isRichEditingEnabled: getEditorSettings().richEditingEnabled }; }, []); const titleRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { if (autoFocus) { return; } titleRef?.current?.focus(); }, [autoFocus]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-text-editor", children: [isRichEditingEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-text-editor__toolbar", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { children: (0,external_wp_i18n_namespaceObject.__)('Editing code') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => switchEditorMode('visual'), shortcut: shortcut, children: (0,external_wp_i18n_namespaceObject.__)('Exit code editor') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-text-editor__body", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_title_raw, { ref: titleRef }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTextEditor, {})] })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/visual-editor/edit-template-blocks-notification.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Component that: * * - Displays a 'Edit your template to edit this block' notification when the * user is focusing on editing page content and clicks on a disabled template * block. * - Displays a 'Edit your template to edit this block' dialog when the user * is focusing on editing page conetnt and double clicks on a disabled * template block. * * @param {Object} props * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block * editor iframe canvas. */ function EditTemplateBlocksNotification({ contentRef }) { const { onNavigateToEntityRecord, templateId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorSettings, getCurrentTemplateId } = select(store_store); return { onNavigateToEntityRecord: getEditorSettings().onNavigateToEntityRecord, templateId: getCurrentTemplateId() }; }, []); const canEditTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => { var _select$canUser; return (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates')) !== null && _select$canUser !== void 0 ? _select$canUser : false; }); const [isDialogOpen, setIsDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { const handleDblClick = event => { if (!canEditTemplate) { return; } if (!event.target.classList.contains('is-root-container')) { return; } setIsDialogOpen(true); }; const canvas = contentRef.current; canvas?.addEventListener('dblclick', handleDblClick); return () => { canvas?.removeEventListener('dblclick', handleDblClick); }; }, [contentRef, canEditTemplate]); if (!canEditTemplate) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { isOpen: isDialogOpen, confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Edit template'), onConfirm: () => { setIsDialogOpen(false); onNavigateToEntityRecord({ postId: templateId, postType: 'wp_template' }); }, onCancel: () => setIsDialogOpen(false), size: "medium", children: (0,external_wp_i18n_namespaceObject.__)('You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?') }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/resizable-editor/resize-handle.js /** * WordPress dependencies */ const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels. function ResizeHandle({ direction, resizeWidthBy }) { function handleKeyDown(event) { const { keyCode } = event; if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.LEFT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.RIGHT) { resizeWidthBy(DELTA_DISTANCE); } else if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.RIGHT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.LEFT) { resizeWidthBy(-DELTA_DISTANCE); } } const resizeHandleVariants = { active: { opacity: 1, scaleY: 1.3 } }; const resizableHandleHelpId = `resizable-editor__resize-help-${direction}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.button, { className: `editor-resizable-editor__resize-handle is-${direction}`, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), "aria-describedby": resizableHandleHelpId, onKeyDown: handleKeyDown, variants: resizeHandleVariants, whileFocus: "active", whileHover: "active", whileTap: "active", role: "separator", "aria-orientation": "vertical" }, "handle") }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: resizableHandleHelpId, children: (0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to resize the canvas.') })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/resizable-editor/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ // Removes the inline styles in the drag handles. const HANDLE_STYLES_OVERRIDE = { position: undefined, userSelect: undefined, cursor: undefined, width: undefined, height: undefined, top: undefined, right: undefined, bottom: undefined, left: undefined }; function ResizableEditor({ className, enableResizing, height, children }) { const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)('100%'); const resizableRef = (0,external_wp_element_namespaceObject.useRef)(); const resizeWidthBy = (0,external_wp_element_namespaceObject.useCallback)(deltaPixels => { if (resizableRef.current) { setWidth(resizableRef.current.offsetWidth + deltaPixels); } }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { className: dist_clsx('editor-resizable-editor', className, { 'is-resizable': enableResizing }), ref: api => { resizableRef.current = api?.resizable; }, size: { width: enableResizing ? width : '100%', height: enableResizing && height ? height : '100%' }, onResizeStop: (event, direction, element) => { setWidth(element.style.width); }, minWidth: 300, maxWidth: "100%", maxHeight: "100%", enable: { left: enableResizing, right: enableResizing }, showHandle: enableResizing // The editor is centered horizontally, resizing it only // moves half the distance. Hence double the ratio to correctly // align the cursor to the resizer handle. , resizeRatio: 2, handleComponent: { left: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizeHandle, { direction: "left", resizeWidthBy: resizeWidthBy }), right: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizeHandle, { direction: "right", resizeWidthBy: resizeWidthBy }) }, handleClasses: undefined, handleStyles: { left: HANDLE_STYLES_OVERRIDE, right: HANDLE_STYLES_OVERRIDE }, children: children }); } /* harmony default export */ const resizable_editor = (ResizableEditor); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/use-select-nearest-editable-block.js /** * WordPress dependencies */ /** * Internal dependencies */ const DISTANCE_THRESHOLD = 500; function clamp(value, min, max) { return Math.min(Math.max(value, min), max); } function distanceFromRect(x, y, rect) { const dx = x - clamp(x, rect.left, rect.right); const dy = y - clamp(y, rect.top, rect.bottom); return Math.sqrt(dx * dx + dy * dy); } function useSelectNearestEditableBlock({ isEnabled = true } = {}) { const { getEnabledClientIdsTree, getBlockName, getBlockOrder } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store)); const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { if (!isEnabled) { return; } const selectNearestEditableBlock = (x, y) => { const editableBlockClientIds = getEnabledClientIdsTree().flatMap(({ clientId }) => { const blockName = getBlockName(clientId); if (blockName === 'core/template-part') { return []; } if (blockName === 'core/post-content') { const innerBlocks = getBlockOrder(clientId); if (innerBlocks.length) { return innerBlocks; } } return [clientId]; }); let nearestDistance = Infinity, nearestClientId = null; for (const clientId of editableBlockClientIds) { const block = element.querySelector(`[data-block="${clientId}"]`); if (!block) { continue; } const rect = block.getBoundingClientRect(); const distance = distanceFromRect(x, y, rect); if (distance < nearestDistance && distance < DISTANCE_THRESHOLD) { nearestDistance = distance; nearestClientId = clientId; } } if (nearestClientId) { selectBlock(nearestClientId); } }; const handleClick = event => { const shouldSelect = event.target === element || event.target.classList.contains('is-root-container'); if (shouldSelect) { selectNearestEditableBlock(event.clientX, event.clientY); } }; element.addEventListener('click', handleClick); return () => element.removeEventListener('click', handleClick); }, [isEnabled]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/visual-editor/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { LayoutStyle, useLayoutClasses, useLayoutStyles, ExperimentalBlockCanvas: BlockCanvas, useFlashEditableBlocks } = unlock(external_wp_blockEditor_namespaceObject.privateApis); /** * These post types have a special editor where they don't allow you to fill the title * and they don't apply the layout styles. */ const visual_editor_DESIGN_POST_TYPES = [PATTERN_POST_TYPE, TEMPLATE_POST_TYPE, NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE]; /** * Given an array of nested blocks, find the first Post Content * block inside it, recursing through any nesting levels, * and return its attributes. * * @param {Array} blocks A list of blocks. * * @return {Object | undefined} The Post Content block. */ function getPostContentAttributes(blocks) { for (let i = 0; i < blocks.length; i++) { if (blocks[i].name === 'core/post-content') { return blocks[i].attributes; } if (blocks[i].innerBlocks.length) { const nestedPostContent = getPostContentAttributes(blocks[i].innerBlocks); if (nestedPostContent) { return nestedPostContent; } } } } function checkForPostContentAtRootLevel(blocks) { for (let i = 0; i < blocks.length; i++) { if (blocks[i].name === 'core/post-content') { return true; } } return false; } function VisualEditor({ // Ideally as we unify post and site editors, we won't need these props. autoFocus, styles, disableIframe = false, iframeProps, contentRef, className }) { const [resizeObserver, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); const { renderingMode, postContentAttributes, editedPostTemplate = {}, wrapperBlockName, wrapperUniqueId, deviceType, isFocusedEntity, isDesignPostType, postType, isPreview } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostId, getCurrentPostType, getCurrentTemplateId, getEditorSettings, getRenderingMode, getDeviceType } = select(store_store); const { getPostType, canUser, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const postTypeSlug = getCurrentPostType(); const _renderingMode = getRenderingMode(); let _wrapperBlockName; if (postTypeSlug === PATTERN_POST_TYPE) { _wrapperBlockName = 'core/block'; } else if (_renderingMode === 'post-only') { _wrapperBlockName = 'core/post-content'; } const editorSettings = getEditorSettings(); const supportsTemplateMode = editorSettings.supportsTemplateMode; const postTypeObject = getPostType(postTypeSlug); const canEditTemplate = canUser('create', 'templates'); const currentTemplateId = getCurrentTemplateId(); const template = currentTemplateId ? getEditedEntityRecord('postType', TEMPLATE_POST_TYPE, currentTemplateId) : undefined; return { renderingMode: _renderingMode, postContentAttributes: editorSettings.postContentAttributes, isDesignPostType: visual_editor_DESIGN_POST_TYPES.includes(postTypeSlug), // Post template fetch returns a 404 on classic themes, which // messes with e2e tests, so check it's a block theme first. editedPostTemplate: postTypeObject?.viewable && supportsTemplateMode && canEditTemplate ? template : undefined, wrapperBlockName: _wrapperBlockName, wrapperUniqueId: getCurrentPostId(), deviceType: getDeviceType(), isFocusedEntity: !!editorSettings.onNavigateToPreviousEntityRecord, postType: postTypeSlug, isPreview: editorSettings.__unstableIsPreviewMode }; }, []); const { isCleanNewPost } = (0,external_wp_data_namespaceObject.useSelect)(store_store); const { hasRootPaddingAwareAlignments, themeHasDisabledLayoutStyles, themeSupportsLayout, isZoomOutMode } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings, __unstableGetEditorMode } = select(external_wp_blockEditor_namespaceObject.store); const _settings = getSettings(); return { themeHasDisabledLayoutStyles: _settings.disableLayoutStyles, themeSupportsLayout: _settings.supportsLayout, hasRootPaddingAwareAlignments: _settings.__experimentalFeatures?.useRootPaddingAwareAlignments, isZoomOutMode: __unstableGetEditorMode() === 'zoom-out' }; }, []); const deviceStyles = (0,external_wp_blockEditor_namespaceObject.__experimentalUseResizeCanvas)(deviceType); const [globalLayoutSettings] = (0,external_wp_blockEditor_namespaceObject.useSettings)('layout'); // fallbackLayout is used if there is no Post Content, // and for Post Title. const fallbackLayout = (0,external_wp_element_namespaceObject.useMemo)(() => { if (renderingMode !== 'post-only' || isDesignPostType) { return { type: 'default' }; } if (themeSupportsLayout) { // We need to ensure support for wide and full alignments, // so we add the constrained type. return { ...globalLayoutSettings, type: 'constrained' }; } // Set default layout for classic themes so all alignments are supported. return { type: 'default' }; }, [renderingMode, themeSupportsLayout, globalLayoutSettings, isDesignPostType]); const newestPostContentAttributes = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!editedPostTemplate?.content && !editedPostTemplate?.blocks && postContentAttributes) { return postContentAttributes; } // When in template editing mode, we can access the blocks directly. if (editedPostTemplate?.blocks) { return getPostContentAttributes(editedPostTemplate?.blocks); } // If there are no blocks, we have to parse the content string. // Best double-check it's a string otherwise the parse function gets unhappy. const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : ''; return getPostContentAttributes((0,external_wp_blocks_namespaceObject.parse)(parseableContent)) || {}; }, [editedPostTemplate?.content, editedPostTemplate?.blocks, postContentAttributes]); const hasPostContentAtRootLevel = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!editedPostTemplate?.content && !editedPostTemplate?.blocks) { return false; } // When in template editing mode, we can access the blocks directly. if (editedPostTemplate?.blocks) { return checkForPostContentAtRootLevel(editedPostTemplate?.blocks); } // If there are no blocks, we have to parse the content string. // Best double-check it's a string otherwise the parse function gets unhappy. const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : ''; return checkForPostContentAtRootLevel((0,external_wp_blocks_namespaceObject.parse)(parseableContent)) || false; }, [editedPostTemplate?.content, editedPostTemplate?.blocks]); const { layout = {}, align = '' } = newestPostContentAttributes || {}; const postContentLayoutClasses = useLayoutClasses(newestPostContentAttributes, 'core/post-content'); const blockListLayoutClass = dist_clsx({ 'is-layout-flow': !themeSupportsLayout }, themeSupportsLayout && postContentLayoutClasses, align && `align${align}`); const postContentLayoutStyles = useLayoutStyles(newestPostContentAttributes, 'core/post-content', '.block-editor-block-list__layout.is-root-container'); // Update type for blocks using legacy layouts. const postContentLayout = (0,external_wp_element_namespaceObject.useMemo)(() => { return layout && (layout?.type === 'constrained' || layout?.inherit || layout?.contentSize || layout?.wideSize) ? { ...globalLayoutSettings, ...layout, type: 'constrained' } : { ...globalLayoutSettings, ...layout, type: 'default' }; }, [layout?.type, layout?.inherit, layout?.contentSize, layout?.wideSize, globalLayoutSettings]); // If there is a Post Content block we use its layout for the block list; // if not, this must be a classic theme, in which case we use the fallback layout. const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout; const postEditorLayout = blockListLayout?.type === 'default' && !hasPostContentAtRootLevel ? fallbackLayout : blockListLayout; const observeTypingRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseTypingObserver)(); const titleRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!autoFocus || !isCleanNewPost()) { return; } titleRef?.current?.focus(); }, [autoFocus, isCleanNewPost]); // Add some styles for alignwide/alignfull Post Content and its children. const alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;} .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);} .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`; const localRef = (0,external_wp_element_namespaceObject.useRef)(); const typewriterRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseTypewriter)(); contentRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([localRef, contentRef, renderingMode === 'post-only' ? typewriterRef : null, useFlashEditableBlocks({ isEnabled: renderingMode === 'template-locked' }), useSelectNearestEditableBlock({ isEnabled: renderingMode === 'template-locked' })]); const zoomOutProps = isZoomOutMode ? { scale: 'default', frameSize: '20px' } : {}; const forceFullHeight = postType === NAVIGATION_POST_TYPE; const enableResizing = [NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE].includes(postType) && // Disable in previews / view mode. !isPreview && // Disable resizing in mobile viewport. !isMobileViewport && // Dsiable resizing in zoomed-out mode. !isZoomOutMode; const shouldIframe = !disableIframe || ['Tablet', 'Mobile'].includes(deviceType); const iframeStyles = (0,external_wp_element_namespaceObject.useMemo)(() => { return [...(styles !== null && styles !== void 0 ? styles : []), { css: `.is-root-container{display:flow-root;${ // Some themes will have `min-height: 100vh` for the root container, // which isn't a requirement in auto resize mode. enableResizing ? 'min-height:0!important;' : ''}}` }]; }, [styles, enableResizing]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('editor-visual-editor', // this class is here for backward compatibility reasons. 'edit-post-visual-editor', className, { 'has-padding': isFocusedEntity || enableResizing, 'is-resizable': enableResizing, 'is-iframed': shouldIframe }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resizable_editor, { enableResizing: enableResizing, height: sizes.height && !forceFullHeight ? sizes.height : '100%', children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockCanvas, { shouldIframe: shouldIframe, contentRef: contentRef, styles: iframeStyles, height: "100%", iframeProps: { ...iframeProps, ...zoomOutProps, style: { ...iframeProps?.style, ...deviceStyles } }, children: [themeSupportsLayout && !themeHasDisabledLayoutStyles && renderingMode === 'post-only' && !isDesignPostType && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, { selector: ".editor-visual-editor__post-title-wrapper", layout: fallbackLayout }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, { selector: ".block-editor-block-list__layout.is-root-container", layout: postEditorLayout }), align && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, { css: alignCSS }), postContentLayoutStyles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, { layout: postContentLayout, css: postContentLayoutStyles })] }), renderingMode === 'post-only' && !isDesignPostType && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('editor-visual-editor__post-title-wrapper', // The following class is only here for backward comapatibility // some themes might be using it to style the post title. 'edit-post-visual-editor__post-title-wrapper', { 'has-global-padding': hasRootPaddingAwareAlignments }), contentEditable: false, ref: observeTypingRef, style: { // This is using inline styles // so it's applied for both iframed and non iframed editors. marginTop: '4rem' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_title, { ref: titleRef }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.RecursionProvider, { blockName: wrapperBlockName, uniqueId: wrapperUniqueId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { className: dist_clsx('is-' + deviceType.toLowerCase() + '-preview', renderingMode !== 'post-only' || isDesignPostType ? 'wp-site-blocks' : `${blockListLayoutClass} wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules. ), layout: blockListLayout, dropZoneElement: // When iframed, pass in the html element of the iframe to // ensure the drop zone extends to the edges of the iframe. disableIframe ? localRef.current : localRef.current?.parentNode, __unstableDisableDropZone: // In template preview mode, disable drop zones at the root of the template. renderingMode === 'template-locked' ? true : false }), renderingMode === 'template-locked' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditTemplateBlocksNotification, { contentRef: localRef })] }), // Avoid resize listeners when not needed, // these will trigger unnecessary re-renders // when animating the iframe width. enableResizing && resizeObserver] }) }) }); } /* harmony default export */ const visual_editor = (VisualEditor); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-interface/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const interfaceLabels = { /* translators: accessibility text for the editor top bar landmark region. */ header: (0,external_wp_i18n_namespaceObject.__)('Editor top bar'), /* translators: accessibility text for the editor content landmark region. */ body: (0,external_wp_i18n_namespaceObject.__)('Editor content'), /* translators: accessibility text for the editor settings landmark region. */ sidebar: (0,external_wp_i18n_namespaceObject.__)('Editor settings'), /* translators: accessibility text for the editor publish landmark region. */ actions: (0,external_wp_i18n_namespaceObject.__)('Editor publish'), /* translators: accessibility text for the editor footer landmark region. */ footer: (0,external_wp_i18n_namespaceObject.__)('Editor footer') }; function EditorInterface({ className, enableRegionNavigation, styles, children, forceIsDirty, contentRef, disableIframe, autoFocus, customSaveButton, customSavePanel, forceDisableBlockTools, title, iframeProps }) { const { mode, isRichEditingEnabled, isInserterOpened, isListViewOpened, isDistractionFree, isPreviewMode, previousShortcut, nextShortcut, showBlockBreadcrumbs, documentLabel, blockEditorMode } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get } = select(external_wp_preferences_namespaceObject.store); const { getEditorSettings, getPostTypeLabel } = select(store_store); const editorSettings = getEditorSettings(); const postTypeLabel = getPostTypeLabel(); return { mode: select(store_store).getEditorMode(), isRichEditingEnabled: editorSettings.richEditingEnabled, isInserterOpened: select(store_store).isInserterOpened(), isListViewOpened: select(store_store).isListViewOpened(), isDistractionFree: get('core', 'distractionFree'), isPreviewMode: editorSettings.__unstableIsPreviewMode, previousShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/editor/previous-region'), nextShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/editor/next-region'), showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'), // translators: Default label for the Document in the Block Breadcrumb. documentLabel: postTypeLabel || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun'), blockEditorMode: select(external_wp_blockEditor_namespaceObject.store).__unstableGetEditorMode() }; }, []); const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large'); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('Document Overview') : (0,external_wp_i18n_namespaceObject.__)('Block Library'); // Local state for save panel. // Note 'truthy' callback implies an open panel. const [entitiesSavedStatesCallback, setEntitiesSavedStatesCallback] = (0,external_wp_element_namespaceObject.useState)(false); const closeEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(arg => { if (typeof entitiesSavedStatesCallback === 'function') { entitiesSavedStatesCallback(arg); } setEntitiesSavedStatesCallback(false); }, [entitiesSavedStatesCallback]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(interface_skeleton, { enableRegionNavigation: enableRegionNavigation, isDistractionFree: isDistractionFree && isWideViewport, className: dist_clsx('editor-editor-interface', className, { 'is-entity-save-view-open': !!entitiesSavedStatesCallback, 'is-distraction-free': isDistractionFree && isWideViewport && !isPreviewMode }), labels: { ...interfaceLabels, secondarySidebar: secondarySidebarLabel }, header: !isPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_header, { forceIsDirty: forceIsDirty, setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback, customSaveButton: customSaveButton, forceDisableBlockTools: forceDisableBlockTools, title: title }), editorNotices: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_notices, {}), secondarySidebar: !isPreviewMode && mode === 'visual' && (isInserterOpened && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InserterSidebar, {}) || isListViewOpened && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewSidebar, {})), sidebar: !isPreviewMode && !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area.Slot, { scope: "core" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!isDistractionFree && !isPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_notices, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(content_slot_fill.Slot, { children: ([editorCanvasView]) => editorCanvasView ? editorCanvasView : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!isPreviewMode && (mode === 'text' || !isRichEditingEnabled) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TextEditor // We should auto-focus the canvas (title) on load. // eslint-disable-next-line jsx-a11y/no-autofocus , { autoFocus: autoFocus }), !isPreviewMode && !isLargeViewport && mode === 'visual' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true }), (isPreviewMode || isRichEditingEnabled && mode === 'visual') && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(visual_editor, { styles: styles, contentRef: contentRef, disableIframe: disableIframe // We should auto-focus the canvas (title) on load. // eslint-disable-next-line jsx-a11y/no-autofocus , autoFocus: autoFocus, iframeProps: iframeProps }), children] }) })] }), footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && isRichEditingEnabled && blockEditorMode !== 'zoom-out' && mode === 'visual' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, { rootLabelText: documentLabel }), actions: !isPreviewMode ? customSavePanel || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePublishPanels, { closeEntitiesSavedStates: closeEntitiesSavedStates, isEntitiesSavedStatesOpen: entitiesSavedStatesCallback, setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback, forceIsDirtyPublishPanel: forceIsDirty }) : undefined, shortcuts: { previous: previousShortcut, next: nextShortcut } }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/pattern-overrides-panel/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { OverridesPanel } = unlock(external_wp_patterns_namespaceObject.privateApis); function PatternOverridesPanel() { const supportsPatternOverridesPanel = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType() === 'wp_block', []); if (!supportsPatternOverridesPanel) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverridesPanel, {}); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/trash.js /** * WordPress dependencies */ const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" }) }); /* harmony default export */ const library_trash = (trash); ;// CONCATENATED MODULE: ./node_modules/client-zip/index.js "stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,n,t){const i=Number(0xffffffffn&n),r=Number(n>>32n);this.setUint32(e+(t?0:4),i,t),this.setUint32(e+(t?4:0),r,t)}});var e=e=>new DataView(new ArrayBuffer(e)),n=e=>new Uint8Array(e.buffer||e),t=e=>(new TextEncoder).encode(String(e)),i=e=>Math.min(4294967295,Number(e)),client_zip_r=e=>Math.min(65535,Number(e));function f(e,i){if(void 0===i||i instanceof Date||(i=new Date(i)),e instanceof File)return{isFile:1,t:i||new Date(e.lastModified),i:e.stream()};if(e instanceof Response)return{isFile:1,t:i||new Date(e.headers.get("Last-Modified")||Date.now()),i:e.body};if(void 0===i)i=new Date;else if(isNaN(i))throw new Error("Invalid modification date.");if(void 0===e)return{isFile:0,t:i};if("string"==typeof e)return{isFile:1,t:i,i:t(e)};if(e instanceof Blob)return{isFile:1,t:i,i:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:1,t:i,i:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:1,t:i,i:n(e)};if(Symbol.asyncIterator in e)return{isFile:1,t:i,i:o(e[Symbol.asyncIterator]())};throw new TypeError("Unsupported input format.")}function o(e,n=e){return new ReadableStream({async pull(n){let t=0;for(;n.desiredSize>t;){const i=await e.next();if(!i.value){n.close();break}{const e=a(i.value);n.enqueue(e),t+=e.byteLength}}},cancel(e){n.throw?.(e)}})}function a(e){return"string"==typeof e?t(e):e instanceof Uint8Array?e:n(e)}function s(e,i,r){let[f,o]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[n(e),1]:[t(e),0]:[void 0,0]}(i);if(e instanceof File)return{o:d(f||t(e.name)),u:BigInt(e.size),l:o};if(e instanceof Response){const n=e.headers.get("content-disposition"),i=n&&n.match(/;\s*filename\*?=["']?(.*?)["']?$/i),a=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),s=a&&decodeURIComponent(a),u=r||+e.headers.get("content-length");return{o:d(f||t(s)),u:BigInt(u),l:o}}return f=d(f,void 0!==e||void 0!==r),"string"==typeof e?{o:f,u:BigInt(t(e).length),l:o}:e instanceof Blob?{o:f,u:BigInt(e.size),l:o}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{o:f,u:BigInt(e.byteLength),l:o}:{o:f,u:u(e,r),l:o}}function u(e,n){return n>-1?BigInt(n):e?void 0:0n}function d(e,n=1){if(!e||e.every((c=>47===c)))throw new Error("The file must have a name.");if(n)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var l=new Uint32Array(256);for(let e=0;e<256;++e){let n=e;for(let e=0;e<8;++e)n=n>>>1^(1&n&&3988292384);l[e]=n}function y(e,n=0){n^=-1;for(var t=0,i=e.length;t<i;t++)n=n>>>8^l[255&n^e[t]];return(-1^n)>>>0}function w(e,n,t=0){const i=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,r=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;n.setUint16(t,i,1),n.setUint16(t+2,r,1)}function B({o:e,l:n},t){return 8*(!n||(t??function(e){try{b.decode(e)}catch{return 0}return 1}(e)))}var b=new TextDecoder("utf8",{fatal:1});function p(t,i=0){const r=e(30);return r.setUint32(0,1347093252),r.setUint32(4,754976768|i),w(t.t,r,10),r.setUint16(26,t.o.length,1),n(r)}async function*g(e){let{i:n}=e;if("then"in n&&(n=await n),n instanceof Uint8Array)yield n,e.m=y(n,0),e.u=BigInt(n.length);else{e.u=0n;const t=n.getReader();for(;;){const{value:n,done:i}=await t.read();if(i)break;e.m=y(n,e.m),e.u+=BigInt(n.length),yield n}}}function I(t,r){const f=e(16+(r?8:0));return f.setUint32(0,1347094280),f.setUint32(4,t.isFile?t.m:0,1),r?(f.setBigUint64(8,t.u,1),f.setBigUint64(16,t.u,1)):(f.setUint32(8,i(t.u),1),f.setUint32(12,i(t.u),1)),n(f)}function v(t,r,f=0,o=0){const a=e(46);return a.setUint32(0,1347092738),a.setUint32(4,755182848),a.setUint16(8,2048|f),w(t.t,a,12),a.setUint32(16,t.isFile?t.m:0,1),a.setUint32(20,i(t.u),1),a.setUint32(24,i(t.u),1),a.setUint16(28,t.o.length,1),a.setUint16(30,o,1),a.setUint16(40,t.isFile?33204:16893,1),a.setUint32(42,i(r),1),n(a)}function h(t,i,r){const f=e(r);return f.setUint16(0,1,1),f.setUint16(2,r-4,1),16&r&&(f.setBigUint64(4,t.u,1),f.setBigUint64(12,t.u,1)),f.setBigUint64(r-8,i,1),n(f)}function D(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified]]}var S=e=>function(e){let n=BigInt(22),t=0n,i=0;for(const r of e){if(!r.o)throw new Error("Every file must have a non-empty name.");if(void 0===r.u)throw new Error(`Missing size for file "${(new TextDecoder).decode(r.o)}".`);const e=r.u>=0xffffffffn,f=t>=0xffffffffn;t+=BigInt(46+r.o.length+(e&&8))+r.u,n+=BigInt(r.o.length+46+(12*f|28*e)),i||(i=e)}return(i||t>=0xffffffffn)&&(n+=BigInt(76)),n+t}(function*(e){for(const n of e)yield s(...D(n)[0])}(e));function A(e,n={}){const t={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof n.length||Number.isInteger(n.length))&&n.length>0&&(t["Content-Length"]=String(n.length)),n.metadata&&(t["Content-Length"]=String(S(n.metadata))),new Response(N(e,n),{headers:t})}function N(t,a={}){const u=function(e){const n=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await n.next();if(e.done)return e;const[t,i]=D(e.value);return{done:0,value:Object.assign(f(...i),s(...t))}},throw:n.throw?.bind(n),[Symbol.asyncIterator](){return this}}}(t);return o(async function*(t,f){const o=[];let a=0n,s=0n,u=0;for await(const e of t){const n=B(e,f.buffersAreUTF8);yield p(e,n),yield new Uint8Array(e.o),e.isFile&&(yield*g(e));const t=e.u>=0xffffffffn,i=12*(a>=0xffffffffn)|28*t;yield I(e,t),o.push(v(e,a,n,i)),o.push(e.o),i&&o.push(h(e,a,i)),t&&(a+=8n),s++,a+=BigInt(46+e.o.length)+e.u,u||(u=t)}let d=0n;for(const e of o)yield e,d+=BigInt(e.length);if(u||a>=0xffffffffn){const t=e(76);t.setUint32(0,1347094022),t.setBigUint64(4,BigInt(44),1),t.setUint32(12,755182848),t.setBigUint64(24,s,1),t.setBigUint64(32,s,1),t.setBigUint64(40,d,1),t.setBigUint64(48,a,1),t.setUint32(56,1347094023),t.setBigUint64(64,a+d,1),t.setUint32(72,1,1),yield n(t)}const l=e(22);l.setUint32(0,1347093766),l.setUint16(8,client_zip_r(s),1),l.setUint16(10,client_zip_r(s),1),l.setUint32(12,i(d),1),l.setUint32(16,i(a),1),yield n(l)}(u,a),u)} ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-actions/export-pattern-action.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ // Patterns. const { PATTERN_TYPES: export_pattern_action_PATTERN_TYPES } = unlock(external_wp_patterns_namespaceObject.privateApis); function getJsonFromItem(item) { return JSON.stringify({ __file: item.type, title: item.title || item.name, content: item?.patternPost?.content?.raw || item.content, syncStatus: item?.patternPost?.wp_pattern_sync_status || item.wp_pattern_sync_status }, null, 2); } const exportPatternAsJSONAction = { id: 'export-pattern', label: (0,external_wp_i18n_namespaceObject.__)('Export as JSON'), supportsBulk: true, isEligible: item => { if (!item.type) { return false; } return item.type === export_pattern_action_PATTERN_TYPES.user; }, callback: async items => { if (items.length === 1) { return (0,external_wp_blob_namespaceObject.downloadBlob)(`${paramCase(items[0].title || items[0].name)}.json`, getJsonFromItem(items[0]), 'application/json'); } const nameCount = {}; const filesToZip = items.map(item => { const name = paramCase(item.title || item.name); nameCount[name] = (nameCount[name] || 0) + 1; return { name: `${name + (nameCount[name] > 1 ? '-' + (nameCount[name] - 1) : '')}.json`, lastModified: new Date(), input: getJsonFromItem(item) }; }); return (0,external_wp_blob_namespaceObject.downloadBlob)((0,external_wp_i18n_namespaceObject.__)('patterns-export') + '.zip', await A(filesToZip).blob(), 'application/zip'); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-actions/actions.js /** * WordPress dependencies */ /** * Internal dependencies */ // Patterns. const { PATTERN_TYPES: actions_PATTERN_TYPES, CreatePatternModalContents, useDuplicatePatternProps } = unlock(external_wp_patterns_namespaceObject.privateApis); /** * Check if a template is removable. * * @param {Object} template The template entity to check. * @return {boolean} Whether the template is removable. */ function isTemplateRemovable(template) { if (!template) { return false; } // In patterns list page we map the templates parts to a different object // than the one returned from the endpoint. This is why we need to check for // two props whether is custom or has a theme file. return [template.source, template.templatePart?.source].includes(TEMPLATE_ORIGINS.custom) && !template.has_theme_file && !template.templatePart?.has_theme_file; } function getItemTitle(item) { if (typeof item.title === 'string') { return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title); } return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title?.rendered || ''); } // This action is used for templates, patterns and template parts. // Every other post type uses the similar `trashPostAction` which // moves the post to trash. const deletePostAction = { id: 'delete-post', label: (0,external_wp_i18n_namespaceObject.__)('Delete'), isPrimary: true, icon: library_trash, isEligible(post) { if ([TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(post.type)) { return isTemplateRemovable(post); } // We can only remove user patterns. return post.type === actions_PATTERN_TYPES.user; }, supportsBulk: true, hideModalHeader: true, RenderModal: ({ items, closeModal, onActionStart, onActionPerformed }) => { const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); const { removeTemplates } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: number of items to delete. (0,external_wp_i18n_namespaceObject._n)('Delete %d item?', 'Delete %d items?', items.length), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The template or template part's titles (0,external_wp_i18n_namespaceObject.__)('Delete "%s"?'), getItemTitle(items[0])) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: closeModal, disabled: isBusy, __experimentalIsFocusable: true, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", onClick: async () => { setIsBusy(true); if (onActionStart) { onActionStart(items); } await removeTemplates(items, { allowUndo: false }); onActionPerformed?.(items); setIsBusy(false); closeModal(); }, isBusy: isBusy, disabled: isBusy, __experimentalIsFocusable: true, children: (0,external_wp_i18n_namespaceObject.__)('Delete') })] })] }); } }; function useCanUserEligibilityCheckPostType(capability, resource, action) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); return (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...action, isEligible(item) { return action.isEligible(item) && registry.select(external_wp_coreData_namespaceObject.store).canUser(capability, resource, item.id); } }), [action, registry, capability, resource]); } const trashPostAction = { id: 'move-to-trash', label: (0,external_wp_i18n_namespaceObject.__)('Move to Trash'), isPrimary: true, icon: library_trash, isEligible(item) { return !['auto-draft', 'trash'].includes(item.status); }, supportsBulk: true, hideModalHeader: true, RenderModal: ({ items, closeModal, onActionStart, onActionPerformed }) => { const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { deleteEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: items.length === 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The item's title. (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to move to trash "%s"?'), getItemTitle(items[0])) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: The number of items (2 or more). (0,external_wp_i18n_namespaceObject._n)('Are you sure you want to move to trash %d item?', 'Are you sure you want to move to trash %d items?', items.length), items.length) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: closeModal, disabled: isBusy, __experimentalIsFocusable: true, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", onClick: async () => { setIsBusy(true); if (onActionStart) { onActionStart(items); } const promiseResult = await Promise.allSettled(items.map(item => deleteEntityRecord('postType', item.type, item.id, {}, { throwOnError: true }))); // If all the promises were fulfilled with success. if (promiseResult.every(({ status }) => status === 'fulfilled')) { let successMessage; if (promiseResult.length === 1) { successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The item's title. */ (0,external_wp_i18n_namespaceObject.__)('"%s" moved to trash.'), getItemTitle(items[0])); } else { successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of items. */ (0,external_wp_i18n_namespaceObject._n)('%s item moved to trash.', '%s items moved to trash.', items.length), items.length); } createSuccessNotice(successMessage, { type: 'snackbar', id: 'move-to-trash-action' }); } else { // If there was at least one failure. let errorMessage; // If we were trying to delete a single item. if (promiseResult.length === 1) { if (promiseResult[0].reason?.message) { errorMessage = promiseResult[0].reason.message; } else { errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving to trash the item.'); } // If we were trying to delete multiple items. } else { const errorMessages = new Set(); const failedPromises = promiseResult.filter(({ status }) => status === 'rejected'); for (const failedPromise of failedPromises) { if (failedPromise.reason?.message) { errorMessages.add(failedPromise.reason.message); } } if (errorMessages.size === 0) { errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving to trash the items.'); } else if (errorMessages.size === 1) { errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving to trash the item: %s'), [...errorMessages][0]); } else { errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while moving to trash the items: %s'), [...errorMessages].join(',')); } } createErrorNotice(errorMessage, { type: 'snackbar' }); } if (onActionPerformed) { onActionPerformed(items); } setIsBusy(false); closeModal(); }, isBusy: isBusy, disabled: isBusy, __experimentalIsFocusable: true, children: (0,external_wp_i18n_namespaceObject.__)('Trash') })] })] }); } }; function useTrashPostAction(resource) { return useCanUserEligibilityCheckPostType('delete', resource, trashPostAction); } function usePermanentlyDeletePostAction(resource) { const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { deleteEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const permanentlyDeletePostAction = (0,external_wp_element_namespaceObject.useMemo)(() => ({ id: 'permanently-delete', label: (0,external_wp_i18n_namespaceObject.__)('Permanently delete'), supportsBulk: true, isEligible({ status }) { return status === 'trash'; }, async callback(posts, onActionPerformed) { const promiseResult = await Promise.allSettled(posts.map(post => { return deleteEntityRecord('postType', post.type, post.id, { force: true }, { throwOnError: true }); })); // If all the promises were fulfilled with success. if (promiseResult.every(({ status }) => status === 'fulfilled')) { let successMessage; if (promiseResult.length === 1) { successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The posts's title. */ (0,external_wp_i18n_namespaceObject.__)('"%s" permanently deleted.'), getItemTitle(posts[0])); } else { successMessage = (0,external_wp_i18n_namespaceObject.__)('The posts were permanently deleted.'); } createSuccessNotice(successMessage, { type: 'snackbar', id: 'permanently-delete-post-action' }); if (onActionPerformed) { onActionPerformed(posts); } } else { // If there was at lease one failure. let errorMessage; // If we were trying to permanently delete a single post. if (promiseResult.length === 1) { if (promiseResult[0].reason?.message) { errorMessage = promiseResult[0].reason.message; } else { errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the post.'); } // If we were trying to permanently delete multiple posts } else { const errorMessages = new Set(); const failedPromises = promiseResult.filter(({ status }) => status === 'rejected'); for (const failedPromise of failedPromises) { if (failedPromise.reason?.message) { errorMessages.add(failedPromise.reason.message); } } if (errorMessages.size === 0) { errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the posts.'); } else if (errorMessages.size === 1) { errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the posts: %s'), [...errorMessages][0]); } else { errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while permanently deleting the posts: %s'), [...errorMessages].join(',')); } } createErrorNotice(errorMessage, { type: 'snackbar' }); } } }), [createSuccessNotice, createErrorNotice, deleteEntityRecord]); return useCanUserEligibilityCheckPostType('delete', resource, permanentlyDeletePostAction); } function useRestorePostAction(resource) { const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { editEntityRecord, saveEditedEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const restorePostAction = (0,external_wp_element_namespaceObject.useMemo)(() => ({ id: 'restore', label: (0,external_wp_i18n_namespaceObject.__)('Restore'), isPrimary: true, icon: library_backup, supportsBulk: true, isEligible({ status }) { return status === 'trash'; }, async callback(posts, onActionPerformed) { await Promise.allSettled(posts.map(post => { return editEntityRecord('postType', post.type, post.id, { status: 'draft' }); })); const promiseResult = await Promise.allSettled(posts.map(post => { return saveEditedEntityRecord('postType', post.type, post.id, { throwOnError: true }); })); if (promiseResult.every(({ status }) => status === 'fulfilled')) { let successMessage; if (posts.length === 1) { successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of posts. */ (0,external_wp_i18n_namespaceObject.__)('"%s" has been restored.'), getItemTitle(posts[0])); } else if (posts[0].type === 'page') { successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of posts. */ (0,external_wp_i18n_namespaceObject.__)('%d pages have been restored.'), posts.length); } else { successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of posts. */ (0,external_wp_i18n_namespaceObject.__)('%d posts have been restored.'), posts.length); } createSuccessNotice(successMessage, { type: 'snackbar', id: 'restore-post-action' }); if (onActionPerformed) { onActionPerformed(posts); } } else { // If there was at lease one failure. let errorMessage; // If we were trying to move a single post to the trash. if (promiseResult.length === 1) { if (promiseResult[0].reason?.message) { errorMessage = promiseResult[0].reason.message; } else { errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the post.'); } // If we were trying to move multiple posts to the trash } else { const errorMessages = new Set(); const failedPromises = promiseResult.filter(({ status }) => status === 'rejected'); for (const failedPromise of failedPromises) { if (failedPromise.reason?.message) { errorMessages.add(failedPromise.reason.message); } } if (errorMessages.size === 0) { errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the posts.'); } else if (errorMessages.size === 1) { errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the posts: %s'), [...errorMessages][0]); } else { errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while restoring the posts: %s'), [...errorMessages].join(',')); } } createErrorNotice(errorMessage, { type: 'snackbar' }); } } }), [createSuccessNotice, createErrorNotice, editEntityRecord, saveEditedEntityRecord]); return useCanUserEligibilityCheckPostType('update', resource, restorePostAction); } const viewPostAction = { id: 'view-post', label: (0,external_wp_i18n_namespaceObject.__)('View'), isPrimary: true, icon: library_external, isEligible(post) { return post.status !== 'trash'; }, callback(posts, onActionPerformed) { const post = posts[0]; window.open(post.link, '_blank'); if (onActionPerformed) { onActionPerformed(posts); } } }; const postRevisionsAction = { id: 'view-post-revisions', context: 'list', label(items) { var _items$0$_links$versi; const revisionsCount = (_items$0$_links$versi = items[0]._links?.['version-history']?.[0]?.count) !== null && _items$0$_links$versi !== void 0 ? _items$0$_links$versi : 0; return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of revisions */ (0,external_wp_i18n_namespaceObject.__)('View revisions (%s)'), revisionsCount); }, isEligible: post => { var _post$_links$predeces, _post$_links$version; if (post.status === 'trash') { return false; } const lastRevisionId = (_post$_links$predeces = post?._links?.['predecessor-version']?.[0]?.id) !== null && _post$_links$predeces !== void 0 ? _post$_links$predeces : null; const revisionsCount = (_post$_links$version = post?._links?.['version-history']?.[0]?.count) !== null && _post$_links$version !== void 0 ? _post$_links$version : 0; return lastRevisionId && revisionsCount > 1; }, callback(posts, onActionPerformed) { const post = posts[0]; const href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { revision: post?._links?.['predecessor-version']?.[0]?.id }); document.location.href = href; if (onActionPerformed) { onActionPerformed(posts); } } }; const renamePostAction = { id: 'rename-post', label: (0,external_wp_i18n_namespaceObject.__)('Rename'), isEligible(post) { if (post.status === 'trash') { return false; } // Templates, template parts and patterns have special checks for renaming. if (![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, ...Object.values(actions_PATTERN_TYPES)].includes(post.type)) { return true; } // In the case of templates, we can only rename custom templates. if (post.type === TEMPLATE_POST_TYPE) { return isTemplateRemovable(post) && post.is_custom; } // Make necessary checks for template parts and patterns. const isTemplatePart = post.type === TEMPLATE_PART_POST_TYPE; const isUserPattern = post.type === actions_PATTERN_TYPES.user; // In patterns list page we map the templates parts to a different object // than the one returned from the endpoint. This is why we need to check for // two props whether is custom or has a theme file. const isCustomPattern = isUserPattern || isTemplatePart && (post.isCustom || post.source === TEMPLATE_ORIGINS.custom); const hasThemeFile = isTemplatePart && (post.templatePart?.has_theme_file || post.has_theme_file); return isCustomPattern && !hasThemeFile; }, RenderModal: ({ items, closeModal, onActionPerformed }) => { const [item] = items; const originalTitle = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(typeof item.title === 'string' ? item.title : item.title.rendered); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(() => originalTitle); const { editEntityRecord, saveEditedEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); async function onRename(event) { event.preventDefault(); try { await editEntityRecord('postType', item.type, item.id, { title }); // Update state before saving rerenders the list. setTitle(''); closeModal(); // Persist edited entity. await saveEditedEntityRecord('postType', item.type, item.id, { throwOnError: true }); createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Name updated'), { type: 'snackbar' }); onActionPerformed?.(items); } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while updating the name'); createErrorNotice(errorMessage, { type: 'snackbar' }); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: onRename, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle, required: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: () => { closeModal(); }, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", children: (0,external_wp_i18n_namespaceObject.__)('Save') })] })] }) }); } }; function useRenamePostAction(resource) { return useCanUserEligibilityCheckPostType('update', resource, renamePostAction); } const duplicatePostAction = { id: 'duplicate-post', label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), isEligible({ status }) { return status !== 'trash'; }, RenderModal: ({ items, closeModal, onActionPerformed }) => { const [item] = items; const [isCreatingPage, setIsCreatingPage] = (0,external_wp_element_namespaceObject.useState)(false); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Existing item title */ (0,external_wp_i18n_namespaceObject.__)('%s (Copy)'), getItemTitle(item))); const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); async function createPage(event) { event.preventDefault(); if (isCreatingPage) { return; } setIsCreatingPage(true); try { const newItem = await saveEntityRecord('postType', item.type, { status: 'draft', title, slug: title || (0,external_wp_i18n_namespaceObject.__)('No title'), author: item.author, comment_status: item.comment_status, content: typeof item.content === 'string' ? item.content : item.content.raw, excerpt: item.excerpt.raw, meta: item.meta, parent: item.parent, password: item.password, template: item.template, format: item.format, featured_media: item.featured_media, menu_order: item.menu_order, ping_status: item.ping_status, categories: item.categories, tags: item.tags }, { throwOnError: true }); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the created template e.g: "Category". (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newItem.title?.rendered || title)), { id: 'duplicate-post-action', type: 'snackbar' }); if (onActionPerformed) { onActionPerformed([newItem]); } } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while duplicating the page.'); createErrorNotice(errorMessage, { type: 'snackbar' }); } finally { setIsCreatingPage(false); closeModal(); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: createPage, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { label: (0,external_wp_i18n_namespaceObject.__)('Title'), onChange: setTitle, placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), value: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, justify: "end", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: closeModal, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", isBusy: isCreatingPage, "aria-disabled": isCreatingPage, children: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label') })] })] }) }); } }; const resetTemplateAction = { id: 'reset-template', label: (0,external_wp_i18n_namespaceObject.__)('Reset'), isEligible: item => { return isTemplateRevertable(item); }, icon: library_backup, supportsBulk: true, hideModalHeader: true, RenderModal: ({ items, closeModal, onActionStart, onActionPerformed }) => { const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); const { revertTemplate } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const { saveEditedEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onConfirm = async () => { try { for (const template of items) { await revertTemplate(template, { allowUndo: false }); await saveEditedEntityRecord('postType', template.type, template.id); } createSuccessNotice(items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of items. */ (0,external_wp_i18n_namespaceObject.__)('%s items reset.'), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */ (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(items[0]))), { type: 'snackbar', id: 'revert-template-action' }); } catch (error) { let fallbackErrorMessage; if (items[0].type === TEMPLATE_POST_TYPE) { fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the templates.'); } else { fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template part.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template parts.'); } const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : fallbackErrorMessage; createErrorNotice(errorMessage, { type: 'snackbar' }); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)('Reset to default and clear all customizations?') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: closeModal, disabled: isBusy, __experimentalIsFocusable: true, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", onClick: async () => { setIsBusy(true); if (onActionStart) { onActionStart(items); } await onConfirm(items); onActionPerformed?.(items); setIsBusy(false); closeModal(); }, isBusy: isBusy, disabled: isBusy, __experimentalIsFocusable: true, children: (0,external_wp_i18n_namespaceObject.__)('Reset') })] })] }); } }; const duplicatePatternAction = { id: 'duplicate-pattern', label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), isEligible: item => item.type !== TEMPLATE_PART_POST_TYPE, modalHeader: (0,external_wp_i18n_namespaceObject._x)('Duplicate pattern', 'action label'), RenderModal: ({ items, closeModal }) => { const [item] = items; const isThemePattern = item.type === actions_PATTERN_TYPES.theme; const duplicatedProps = useDuplicatePatternProps({ pattern: isThemePattern || !item.patternPost ? item : item.patternPost, onSuccess: () => closeModal() }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreatePatternModalContents, { onClose: closeModal, confirmLabel: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), ...duplicatedProps }); } }; const duplicateTemplatePartAction = { id: 'duplicate-template-part', label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'), isEligible: item => item.type === TEMPLATE_PART_POST_TYPE, modalHeader: (0,external_wp_i18n_namespaceObject._x)('Duplicate template part', 'action label'), RenderModal: ({ items, closeModal }) => { const [item] = items; const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); function onTemplatePartSuccess() { createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The new template part's title e.g. 'Call to action (copy)'. (0,external_wp_i18n_namespaceObject.__)('"%s" duplicated.'), item.title), { type: 'snackbar', id: 'edit-site-patterns-success' }); closeModal(); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModalContents, { blocks: item.blocks, defaultArea: item.templatePart?.area || item.area, defaultTitle: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Existing template part title */ (0,external_wp_i18n_namespaceObject.__)('%s (Copy)'), item.title), onCreate: onTemplatePartSuccess, onError: closeModal, confirmLabel: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label') }); } }; function usePostActions({ postType, onActionPerformed, context }) { const { postTypeObject, resource, cachedCanUserResolvers, userCanCreatePostType, isBlockBasedTheme } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getPostType, getCachedResolvers, canUser, getCurrentTheme } = select(external_wp_coreData_namespaceObject.store); const _postTypeObject = getPostType(postType); const _resource = _postTypeObject?.rest_base || ''; return { postTypeObject: _postTypeObject, resource: _resource, cachedCanUserResolvers: getCachedResolvers()?.canUser, userCanCreatePostType: canUser('create', _resource), isBlockBasedTheme: getCurrentTheme()?.is_block_theme }; }, [postType]); const trashPostActionForPostType = useTrashPostAction(resource); const permanentlyDeletePostActionForPostType = usePermanentlyDeletePostAction(resource); const renamePostActionForPostType = useRenamePostAction(resource); const restorePostActionForPostType = useRestorePostAction(resource); const isTemplateOrTemplatePart = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType); const isPattern = postType === PATTERN_POST_TYPE; const isLoaded = !!postTypeObject; const supportsRevisions = !!postTypeObject?.supports?.revisions; const supportsTitle = !!postTypeObject?.supports?.title; return (0,external_wp_element_namespaceObject.useMemo)(() => { if (!isLoaded) { return []; } let actions = [postTypeObject?.viewable && viewPostAction, supportsRevisions && postRevisionsAction, false ? 0 : false, isTemplateOrTemplatePart && userCanCreatePostType && isBlockBasedTheme && duplicateTemplatePartAction, isPattern && userCanCreatePostType && duplicatePatternAction, supportsTitle && renamePostActionForPostType, isPattern && exportPatternAsJSONAction, isTemplateOrTemplatePart ? resetTemplateAction : restorePostActionForPostType, isTemplateOrTemplatePart || isPattern ? deletePostAction : trashPostActionForPostType, !isTemplateOrTemplatePart && permanentlyDeletePostActionForPostType].filter(Boolean); // Filter actions based on provided context. If not provided // all actions are returned. We'll have a single entry for getting the actions // and the consumer should provide the context to filter the actions, if needed. // Actions should also provide the `context` they support, if it's specific, to // compare with the provided context to get all the actions. // Right now the only supported context is `list`. actions = actions.filter(action => { if (!action.context) { return true; } return action.context === context; }); if (onActionPerformed) { for (let i = 0; i < actions.length; ++i) { if (actions[i].callback) { const existingCallback = actions[i].callback; actions[i] = { ...actions[i], callback: (items, _onActionPerformed) => { existingCallback(items, _items => { if (_onActionPerformed) { _onActionPerformed(_items); } onActionPerformed(actions[i].id, _items); }); } }; } if (actions[i].RenderModal) { const ExistingRenderModal = actions[i].RenderModal; actions[i] = { ...actions[i], RenderModal: props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExistingRenderModal, { ...props, onActionPerformed: _items => { if (props.onActionPerformed) { props.onActionPerformed(_items); } onActionPerformed(actions[i].id, _items); } }); } }; } } } return actions; // We are making this use memo depend on cachedCanUserResolvers as a way to make the component using this hook re-render // when user capabilities are resolved. This makes sure the isEligible functions of actions dependent on capabilities are re-evaluated. // eslint-disable-next-line react-hooks/exhaustive-deps }, [isTemplateOrTemplatePart, isPattern, postTypeObject?.viewable, permanentlyDeletePostActionForPostType, restorePostActionForPostType, renamePostActionForPostType, trashPostActionForPostType, onActionPerformed, isLoaded, supportsRevisions, supportsTitle, context, userCanCreatePostType, cachedCanUserResolvers]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-actions/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { DropdownMenuV2: DropdownMenu, DropdownMenuGroupV2: DropdownMenuGroup, DropdownMenuItemV2: DropdownMenuItem, DropdownMenuItemLabelV2: DropdownMenuItemLabel, kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); function PostActions({ onActionPerformed, buttonProps }) { const [isActionsMenuOpen, setIsActionsMenuOpen] = (0,external_wp_element_namespaceObject.useState)(false); const { item, postType } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType, getCurrentPostId } = select(store_store); const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const _postType = getCurrentPostType(); return { item: getEditedEntityRecord('postType', _postType, getCurrentPostId()), postType: _postType }; }, []); const allActions = usePostActions({ postType, onActionPerformed }); const actions = (0,external_wp_element_namespaceObject.useMemo)(() => { return allActions.filter(action => { return !action.isEligible || action.isEligible(item); }); }, [allActions, item]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenu, { open: isActionsMenuOpen, trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Actions'), disabled: !actions.length, __experimentalIsFocusable: true, className: "editor-all-actions-button", onClick: () => setIsActionsMenuOpen(!isActionsMenuOpen), ...buttonProps }), onOpenChange: setIsActionsMenuOpen, placement: "bottom-end", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, { actions: actions, item: item, onClose: () => { setIsActionsMenuOpen(false); } }) }); } // From now on all the functions on this file are copied as from the dataviews packages, // The editor packages should not be using the dataviews packages directly, // and the dataviews package should not be using the editor packages directly, // so duplicating the code here seems like the least bad option. // Copied as is from packages/dataviews/src/item-actions.js function DropdownMenuItemTrigger({ action, onClick, items }) { const label = typeof action.label === 'string' ? action.label : action.label(items); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItem, { onClick: onClick, hideOnClick: !action.RenderModal, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemLabel, { children: label }) }); } // Copied as is from packages/dataviews/src/item-actions.js // With an added onClose prop. function ActionWithModal({ action, item, ActionTrigger, onClose }) { const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); const actionTriggerProps = { action, onClick: () => setIsModalOpen(true), items: [item] }; const { RenderModal, hideModalHeader } = action; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, { ...actionTriggerProps }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: action.modalHeader || action.label, __experimentalHideHeader: !!hideModalHeader, onRequestClose: () => { setIsModalOpen(false); }, overlayClassName: `editor-action-modal editor-action-modal__${kebabCase(action.id)}`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderModal, { items: [item], closeModal: () => { setIsModalOpen(false); onClose(); } }) })] }); } // Copied as is from packages/dataviews/src/item-actions.js // With an added onClose prop. function ActionsDropdownMenuGroup({ actions, item, onClose }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuGroup, { children: actions.map(action => { if (action.RenderModal) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { action: action, item: item, ActionTrigger: DropdownMenuItemTrigger, onClose: onClose }, action.id); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemTrigger, { action: action, onClick: () => action.callback([item]), items: [item] }, action.id); }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-card-panel/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function PostCardPanel({ actions }) { const { isFrontPage, isPostsPage, title, icon, isSync } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostAttribute, getCurrentPostType, getCurrentPostId, __experimentalGetTemplateInfo } = select(store_store); const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getEditedEntityRecord('root', 'site'); const _type = getCurrentPostType(); const _id = getCurrentPostId(); const _record = getEditedEntityRecord('postType', _type, _id); const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(_type) && __experimentalGetTemplateInfo(_record); let _isSync = false; if (GLOBAL_POST_TYPES.includes(_type)) { if (PATTERN_POST_TYPE === _type) { // When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead. const currentSyncStatus = getEditedPostAttribute('meta')?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : getEditedPostAttribute('wp_pattern_sync_status'); _isSync = currentSyncStatus !== 'unsynced'; } else { _isSync = true; } } return { title: _templateInfo?.title || getEditedPostAttribute('title'), icon: unlock(select(store_store)).getPostIcon(_type, { area: _record?.area }), isSync: _isSync, isFrontPage: siteSettings?.page_on_front === _id, isPostsPage: siteSettings?.page_for_posts === _id }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-card-panel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, className: "editor-post-card-panel__header", align: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { className: dist_clsx('editor-post-card-panel__icon', { 'is-sync': isSync }), icon: icon }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalText, { numberOfLines: 2, truncate: true, className: "editor-post-card-panel__title", weight: 500, as: "h2", lineHeight: "20px", children: [title ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) : (0,external_wp_i18n_namespaceObject.__)('No Title'), isFrontPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-card-panel__title-badge", children: (0,external_wp_i18n_namespaceObject.__)('Front Page') }), isPostsPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "editor-post-card-panel__title-badge", children: (0,external_wp_i18n_namespaceObject.__)('Posts Page') })] }), actions] }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-content-information/index.js /** * WordPress dependencies */ /** * Internal dependencies */ // Taken from packages/editor/src/components/time-to-read/index.js. const post_content_information_AVERAGE_READING_RATE = 189; // This component renders the wordcount and reading time for the post. function PostContentInformation() { const { postContent } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } = select(store_store); const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getEntityRecord('root', 'site'); const postType = getCurrentPostType(); const _id = getCurrentPostId(); const isPostsPage = +_id === siteSettings?.page_for_posts; const showPostContentInfo = !isPostsPage && ![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType); return { postContent: showPostContentInfo && getEditedPostAttribute('content') }; }, []); /* * translators: If your word count is based on single characters (e.g. East Asian characters), * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. * Do not translate into your own language. */ const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!'); const wordsCounted = (0,external_wp_element_namespaceObject.useMemo)(() => postContent ? (0,external_wp_wordcount_namespaceObject.count)(postContent, wordCountType) : 0, [postContent, wordCountType]); if (!wordsCounted) { return null; } const readingTime = Math.round(wordsCounted / post_content_information_AVERAGE_READING_RATE); const wordsCountText = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the number of words in the post. (0,external_wp_i18n_namespaceObject._n)('%s word', '%s words', wordsCounted), wordsCounted.toLocaleString()); const minutesText = readingTime <= 1 ? (0,external_wp_i18n_namespaceObject.__)('1 minute') : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the number of minutes to read the post. (0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', readingTime), readingTime.toLocaleString()); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-content-information", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */ (0,external_wp_i18n_namespaceObject.__)('%1$s, %2$s read time.'), wordsCountText, minutesText) }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/panel.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Renders the Post Author Panel component. * * @return {Component} The component to be rendered. */ function panel_PostFormat() { const { postFormat } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostAttribute } = select(store_store); const _postFormat = getEditedPostAttribute('format'); return { postFormat: _postFormat !== null && _postFormat !== void 0 ? _postFormat : 'standard' }; }, []); const activeFormat = POST_FORMATS.find(format => format.id === postFormat); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); // Memoize popoverProps to avoid returning a new object every time. const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ // Anchor the popover to the middle of the entire row so that it doesn't // move around when the label changes. anchor: popoverAnchor, placement: 'left-start', offset: 36, shift: true }), [popoverAnchor]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_check, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, { label: (0,external_wp_i18n_namespaceObject.__)('Format'), ref: setPopoverAnchor, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, contentClassName: "editor-post-format__dialog", focusOnMount: true, renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", variant: "tertiary", "aria-expanded": isOpen, "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Current post format. (0,external_wp_i18n_namespaceObject.__)('Change format: %s'), activeFormat?.caption), onClick: onToggle, children: activeFormat?.caption }), renderContent: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-post-format__dialog-content", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, { title: (0,external_wp_i18n_namespaceObject.__)('Format'), onClose: onClose }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormat, {})] }) }) }) }); } /* harmony default export */ const post_format_panel = (panel_PostFormat); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-edited-panel/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function PostLastEditedPanel() { const modified = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('modified'), []); const lastEditedText = modified && (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Human-readable time difference, e.g. "2 days ago". (0,external_wp_i18n_namespaceObject.__)('Last edited %s.'), (0,external_wp_date_namespaceObject.humanTimeDiff)(modified)); if (!lastEditedText) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "editor-post-last-edited-panel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: lastEditedText }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-panel-section/index.js /** * External dependencies */ /** * WordPress dependencies */ function PostPanelSection({ className, children }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: dist_clsx('editor-post-panel__section', className), children: children }); } /* harmony default export */ const post_panel_section = (PostPanelSection); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/blog-title/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const blog_title_EMPTY_OBJECT = {}; function BlogTitle() { const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { postsPageTitle, postsPageId, isTemplate, postSlug } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getEntityRecord('root', 'site'); const _postsPageRecord = siteSettings?.page_for_posts ? getEditedEntityRecord('postType', 'page', siteSettings?.page_for_posts) : blog_title_EMPTY_OBJECT; const { getEditedPostAttribute, getCurrentPostType } = select(store_store); return { postsPageId: _postsPageRecord?.id, postsPageTitle: _postsPageRecord?.title, isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE, postSlug: getEditedPostAttribute('slug') }; }, []); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); // Memoize popoverProps to avoid returning a new object every time. const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ // Anchor the popover to the middle of the entire row so that it doesn't // move around when the label changes. anchor: popoverAnchor, placement: 'left-start', offset: 36, shift: true }), [popoverAnchor]); if (!isTemplate || !['home', 'index'].includes(postSlug) || !postsPageId) { return null; } const setPostsPageTitle = newValue => { editEntityRecord('postType', 'page', postsPageId, { title: newValue }); }; const decodedTitle = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postsPageTitle); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, { label: (0,external_wp_i18n_namespaceObject.__)('Blog title'), ref: setPopoverAnchor, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, contentClassName: "editor-blog-title-dropdown__content", focusOnMount: true, renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", variant: "tertiary", "aria-expanded": isOpen, "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Current post link. (0,external_wp_i18n_namespaceObject.__)('Change blog title: %s'), decodedTitle), onClick: onToggle, children: decodedTitle }), renderContent: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, { title: (0,external_wp_i18n_namespaceObject.__)('Blog title'), onClose: onClose }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { placeholder: (0,external_wp_i18n_namespaceObject.__)('No Title'), size: "__unstable-large", value: postsPageTitle, onChange: (0,external_wp_compose_namespaceObject.debounce)(setPostsPageTitle, 300), label: (0,external_wp_i18n_namespaceObject.__)('Blog title'), help: (0,external_wp_i18n_namespaceObject.__)('Set the Posts Page title. Appears in search results, and when the page is shared on social media.'), hideLabelFromVision: true })] }) }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/posts-per-page/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function PostsPerPage() { const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { postsPerPage, isTemplate, postSlug } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostAttribute, getCurrentPostType } = select(store_store); const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getEditedEntityRecord('root', 'site'); return { isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE, postSlug: getEditedPostAttribute('slug'), postsPerPage: siteSettings?.posts_per_page || 1 }; }, []); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); // Memoize popoverProps to avoid returning a new object every time. const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ // Anchor the popover to the middle of the entire row so that it doesn't // move around when the label changes. anchor: popoverAnchor, placement: 'left-start', offset: 36, shift: true }), [popoverAnchor]); if (!isTemplate || !['home', 'index'].includes(postSlug)) { return null; } const setPostsPerPage = newValue => { editEntityRecord('root', 'site', undefined, { posts_per_page: newValue }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, { label: (0,external_wp_i18n_namespaceObject.__)('Posts per page'), ref: setPopoverAnchor, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, contentClassName: "editor-posts-per-page-dropdown__content", focusOnMount: true, renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", variant: "tertiary", "aria-expanded": isOpen, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Change posts per page'), onClick: onToggle, children: postsPerPage }), renderContent: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, { title: (0,external_wp_i18n_namespaceObject.__)('Posts per page'), onClose: onClose }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { placeholder: 0, value: postsPerPage, size: "__unstable-large", spinControls: "custom", step: "1", min: "1", onChange: setPostsPerPage, label: (0,external_wp_i18n_namespaceObject.__)('Posts per page'), help: (0,external_wp_i18n_namespaceObject.__)('Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.'), hideLabelFromVision: true })] }) }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/site-discussion/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const site_discussion_COMMENT_OPTIONS = [{ label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(0,external_wp_i18n_namespaceObject.__)('Open'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", size: 12, children: (0,external_wp_i18n_namespaceObject.__)('Visitors can add new comments and replies.') })] }), value: 'open' }, { label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(0,external_wp_i18n_namespaceObject.__)('Closed'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", size: 12, children: (0,external_wp_i18n_namespaceObject.__)('Visitors cannot add new comments or replies.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", size: 12, children: (0,external_wp_i18n_namespaceObject.__)('Existing comments remain visible.') })] }), value: '' }]; function SiteDiscussion() { const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { allowCommentsOnNewPosts, isTemplate, postSlug } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostAttribute, getCurrentPostType } = select(store_store); const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getEditedEntityRecord('root', 'site'); return { isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE, postSlug: getEditedPostAttribute('slug'), allowCommentsOnNewPosts: siteSettings?.default_comment_status || '' }; }, []); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); // Memoize popoverProps to avoid returning a new object every time. const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ // Anchor the popover to the middle of the entire row so that it doesn't // move around when the label changes. anchor: popoverAnchor, placement: 'left-start', offset: 36, shift: true }), [popoverAnchor]); if (!isTemplate || !['home', 'index'].includes(postSlug)) { return null; } const setAllowCommentsOnNewPosts = newValue => { editEntityRecord('root', 'site', undefined, { default_comment_status: newValue ? 'open' : null }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, { label: (0,external_wp_i18n_namespaceObject.__)('Discussion'), ref: setPopoverAnchor, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, contentClassName: "editor-site-discussion-dropdown__content", focusOnMount: true, renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", variant: "tertiary", "aria-expanded": isOpen, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Change discussion settings'), onClick: onToggle, children: allowCommentsOnNewPosts ? (0,external_wp_i18n_namespaceObject.__)('Comments open') : (0,external_wp_i18n_namespaceObject.__)('Comments closed') }), renderContent: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, { title: (0,external_wp_i18n_namespaceObject.__)('Discussion'), onClose: onClose }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)('Changes will apply to new posts only. Individual posts may override these settings.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, { className: "editor-site-discussion__options", hideLabelFromVision: true, label: (0,external_wp_i18n_namespaceObject.__)('Comment status'), options: site_discussion_COMMENT_OPTIONS, onChange: setAllowCommentsOnNewPosts, selected: allowCommentsOnNewPosts })] })] }) }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/template-areas/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplateAreaItem({ area, clientId }) { const { selectBlock, toggleBlockHighlight } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const templatePartArea = (0,external_wp_data_namespaceObject.useSelect)(select => { const defaultAreas = select(store_store).__experimentalGetDefaultTemplatePartAreas(); return defaultAreas.find(defaultArea => defaultArea.area === area); }, [area]); const highlightBlock = () => toggleBlockHighlight(clientId, true); const cancelHighlightBlock = () => toggleBlockHighlight(clientId, false); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "editor-template-areas__item", icon: templatePartArea?.icon, onMouseOver: highlightBlock, onMouseLeave: cancelHighlightBlock, onFocus: highlightBlock, onBlur: cancelHighlightBlock, onClick: () => { selectBlock(clientId); }, children: templatePartArea?.label }); } function TemplateAreas() { const { isTemplate, templateParts } = (0,external_wp_data_namespaceObject.useSelect)(select => { const _isTemplate = select(store_store).getCurrentPostType() === TEMPLATE_POST_TYPE; return { isTemplate: _isTemplate, templateParts: _isTemplate && unlock(select(store_store)).getCurrentTemplateTemplateParts() }; }, []); if (!isTemplate || !templateParts.length) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { className: "editor-template-areas", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 3, className: "editor-template-areas__title", children: (0,external_wp_i18n_namespaceObject.__)('Areas') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "editor-template-areas__list", children: templateParts.map(({ templatePart, block }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateAreaItem, { area: templatePart.area, clientId: block.clientId }) }, block.clientId)) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/sidebar/post-summary.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Module Constants */ const post_summary_PANEL_NAME = 'post-status'; function PostSummary({ onActionPerformed }) { const { isRemovedPostStatusPanel } = (0,external_wp_data_namespaceObject.useSelect)(select => { // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do // not use isEditorPanelEnabled since this panel should not be disabled through the UI. const { isEditorPanelRemoved, getCurrentPostType } = select(store_store); return { isRemovedPostStatusPanel: isEditorPanelRemoved(post_summary_PANEL_NAME), postType: getCurrentPostType() }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_section, { className: "editor-post-summary", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_post_status_info.Slot, { children: fills => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCardPanel, { actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostActions, { onActionPerformed: onActionPerformed }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFeaturedImagePanel, { withPanelBody: false }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostExcerptPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostContentInformation, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostLastEditedPanel, {})] }), !isRemovedPostStatusPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostStatus, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedulePanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURLPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplatePanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostDiscussionPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostLastRevision, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSyncStatus, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlogTitle, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostsPerPage, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteDiscussion, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSticky, {})] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateAreas, {}), fills] })] }) }) }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/hooks.js /** * WordPress dependencies */ /** * Internal dependencies */ const { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES: hooks_PATTERN_TYPES } = unlock(external_wp_patterns_namespaceObject.privateApis); function injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet) { block.innerBlocks = block.innerBlocks.map(innerBlock => { return injectThemeAttributeInBlockTemplateContent(innerBlock, currentThemeStylesheet); }); if (block.name === 'core/template-part' && block.attributes.theme === undefined) { block.attributes.theme = currentThemeStylesheet; } return block; } /** * Filter all patterns and return only the ones that are compatible with the current template. * * @param {Array} patterns An array of patterns. * @param {Object} template The current template. * @return {Array} Array of patterns that are compatible with the current template. */ function filterPatterns(patterns, template) { // Filter out duplicates. const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name); // Filter out core/directory patterns not included in theme.json. const filterOutExcludedPatternSources = pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source); // Looks for patterns that have the same template type as the current template, // or have a block type that matches the current template area. const filterCompatiblePatterns = pattern => pattern.templateTypes?.includes(template.slug) || pattern.blockTypes?.includes('core/template-part/' + template.area); return patterns.filter((pattern, index, items) => { return filterOutDuplicatesByName(pattern, index, items) && filterOutExcludedPatternSources(pattern) && filterCompatiblePatterns(pattern); }); } function preparePatterns(patterns, currentThemeStylesheet) { return patterns.map(pattern => ({ ...pattern, keywords: pattern.keywords || [], type: hooks_PATTERN_TYPES.theme, blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, { __unstableSkipMigrationLogs: true }).map(block => injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet)) })); } function useAvailablePatterns(template) { const { blockPatterns, restBlockPatterns, currentThemeStylesheet } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _settings$__experimen; const { getEditorSettings } = select(store_store); const settings = getEditorSettings(); return { blockPatterns: (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns, restBlockPatterns: select(external_wp_coreData_namespaceObject.store).getBlockPatterns(), currentThemeStylesheet: select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet }; }, []); return (0,external_wp_element_namespaceObject.useMemo)(() => { const mergedPatterns = [...(blockPatterns || []), ...(restBlockPatterns || [])]; const filteredPatterns = filterPatterns(mergedPatterns, template); return preparePatterns(filteredPatterns, template, currentThemeStylesheet); }, [blockPatterns, restBlockPatterns, template, currentThemeStylesheet]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function post_transform_panel_TemplatesList({ availableTemplates, onSelect }) { const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(availableTemplates); if (!availableTemplates || availableTemplates?.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { label: (0,external_wp_i18n_namespaceObject.__)('Templates'), blockPatterns: availableTemplates, shownPatterns: shownTemplates, onClickPattern: onSelect, showTitlesAsTooltip: true }); } function PostTransform() { const { record, postType, postId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType, getCurrentPostId } = select(store_store); const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const type = getCurrentPostType(); const id = getCurrentPostId(); return { postType: type, postId: id, record: getEditedEntityRecord('postType', type, id) }; }, []); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const availablePatterns = useAvailablePatterns(record); const onTemplateSelect = async selectedTemplate => { await editEntityRecord('postType', postType, postId, { blocks: selectedTemplate.blocks, content: (0,external_wp_blocks_namespaceObject.serialize)(selectedTemplate.blocks) }); }; if (!availablePatterns?.length) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Design'), initialOpen: record.type === TEMPLATE_PART_POST_TYPE, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_transform_panel_TemplatesList, { availableTemplates: availablePatterns, onSelect: onTemplateSelect }) }); } function PostTransformPanel() { const { postType } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType } = select(store_store); return { postType: getCurrentPostType() }; }, []); if (![TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE].includes(postType)) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransform, {}); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/sidebar/constants.js const sidebars = { document: 'edit-post/document', block: 'edit-post/block' }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/sidebar/header.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Tabs: header_Tabs } = unlock(external_wp_components_namespaceObject.privateApis); const SidebarHeader = (_, ref) => { const { documentLabel } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getPostTypeLabel } = select(store_store); return { // translators: Default label for the Document sidebar tab, not selected. documentLabel: getPostTypeLabel() || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun') }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(header_Tabs.TabList, { ref: ref, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header_Tabs.Tab, { tabId: sidebars.document // Used for focus management in the SettingsSidebar component. , "data-tab-id": sidebars.document, children: documentLabel }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header_Tabs.Tab, { tabId: sidebars.block // Used for focus management in the SettingsSidebar component. , "data-tab-id": sidebars.block, children: (0,external_wp_i18n_namespaceObject.__)('Block') })] }); }; /* harmony default export */ const sidebar_header = ((0,external_wp_element_namespaceObject.forwardRef)(SidebarHeader)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/template-content-panel/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { BlockQuickNavigation } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const PAGE_CONTENT_BLOCKS = ['core/post-content', 'core/post-featured-image', 'core/post-title']; function TemplateContentPanel() { const clientIds = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlocksByName } = select(external_wp_blockEditor_namespaceObject.store); return getBlocksByName(PAGE_CONTENT_BLOCKS); }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Content'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockQuickNavigation, { clientIds: clientIds }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/provider/use-auto-switch-editor-sidebars.js /** * WordPress dependencies */ /** * This listener hook monitors for block selection and triggers the appropriate * sidebar state. */ function useAutoSwitchEditorSidebars() { const { hasBlockSelection } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { hasBlockSelection: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart() }; }, []); const { getActiveComplementaryArea } = (0,external_wp_data_namespaceObject.useSelect)(store); const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { get: getPreference } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { const activeGeneralSidebar = getActiveComplementaryArea('core'); const isEditorSidebarOpened = ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar); const isDistractionFree = getPreference('core', 'distractionFree'); if (!isEditorSidebarOpened || isDistractionFree) { return; } if (hasBlockSelection) { enableComplementaryArea('core', 'edit-post/block'); } else { enableComplementaryArea('core', 'edit-post/document'); } }, [hasBlockSelection, getActiveComplementaryArea, enableComplementaryArea, getPreference]); } /* harmony default export */ const use_auto_switch_editor_sidebars = (useAutoSwitchEditorSidebars); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/sidebar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Tabs: sidebar_Tabs } = unlock(external_wp_components_namespaceObject.privateApis); const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_namespaceObject.Platform.select({ web: true, native: false }); const SidebarContent = ({ tabName, keyboardShortcut, renderingMode, onActionPerformed, extraPanels }) => { const tabListRef = (0,external_wp_element_namespaceObject.useRef)(null); // Because `PluginSidebar` renders a `ComplementaryArea`, we // need to forward the `Tabs` context so it can be passed through the // underlying slot/fill. const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(sidebar_Tabs.Context); // This effect addresses a race condition caused by tabbing from the last // block in the editor into the settings sidebar. Without this effect, the // selected tab and browser focus can become separated in an unexpected way // (e.g the "block" tab is focused, but the "post" tab is selected). (0,external_wp_element_namespaceObject.useEffect)(() => { const tabsElements = Array.from(tabListRef.current?.querySelectorAll('[role="tab"]') || []); const selectedTabElement = tabsElements.find( // We are purposefully using a custom `data-tab-id` attribute here // because we don't want rely on any assumptions about `Tabs` // component internals. element => element.getAttribute('data-tab-id') === tabName); const activeElement = selectedTabElement?.ownerDocument.activeElement; const tabsHasFocus = tabsElements.some(element => { return activeElement && activeElement.id === element.id; }); if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) { selectedTabElement?.focus(); } }, [tabName]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginSidebar, { identifier: tabName, header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.Context.Provider, { value: tabsContextValue, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_header, { ref: tabListRef }) }), closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close Settings') // This classname is added so we can apply a corrective negative // margin to the panel. // see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049 , className: "editor-sidebar__panel", headerClassName: "editor-sidebar__panel-tabs" /* translators: button label text should, if possible, be under 16 characters. */, title: (0,external_wp_i18n_namespaceObject.__)('Settings'), toggleShortcut: keyboardShortcut, icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right, isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(sidebar_Tabs.Context.Provider, { value: tabsContextValue, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(sidebar_Tabs.TabPanel, { tabId: sidebars.document, focusable: false, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSummary, { onActionPerformed: onActionPerformed }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_document_setting_panel.Slot, {}), renderingMode !== 'post-only' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateContentPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransformPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesPanel, {}), extraPanels] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.TabPanel, { tabId: sidebars.block, focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockInspector, {}) })] }) }); }; const Sidebar = ({ extraPanels, onActionPerformed }) => { use_auto_switch_editor_sidebars(); const { tabName, keyboardShortcut, showSummary, renderingMode } = (0,external_wp_data_namespaceObject.useSelect)(select => { const shortcut = select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation('core/editor/toggle-sidebar'); const sidebar = select(store).getActiveComplementaryArea('core'); const _isEditorSidebarOpened = [sidebars.block, sidebars.document].includes(sidebar); let _tabName = sidebar; if (!_isEditorSidebarOpened) { _tabName = !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart() ? sidebars.block : sidebars.document; } return { tabName: _tabName, keyboardShortcut: shortcut, showSummary: ![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE].includes(select(store_store).getCurrentPostType()), renderingMode: select(store_store).getRenderingMode() }; }, []); const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)(newSelectedTabId => { if (!!newSelectedTabId) { enableComplementaryArea('core', newSelectedTabId); } }, [enableComplementaryArea]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs, { selectedTabId: tabName, onSelect: onTabSelect, selectOnMove: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { tabName: tabName, keyboardShortcut: keyboardShortcut, showSummary: showSummary, renderingMode: renderingMode, onActionPerformed: onActionPerformed, extraPanels: extraPanels }) }); }; /* harmony default export */ const components_sidebar = (Sidebar); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function Editor({ postType, postId, templateId, settings, children, // This could be part of the settings. onActionPerformed, // The following abstractions are not ideal but necessary // to account for site editor and post editor differences for now. className, styles, customSaveButton, customSavePanel, forceDisableBlockTools, title, iframeProps, extraSidebarPanels, enableRegionNavigation = true }) { const { post, template, hasLoadedPost } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); return { post: getEntityRecord('postType', postType, postId), template: templateId ? getEntityRecord('postType', TEMPLATE_POST_TYPE, templateId) : undefined, hasLoadedPost: hasFinishedResolution('getEntityRecord', ['postType', postType, postId]) }; }, [postType, postId, templateId]); if (!post) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalEditorProvider, { post: post, __unstableTemplate: template, settings: settings, useSubRegistry: false, children: [hasLoadedPost && !post && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?") }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInterface, { className: className, styles: styles, enableRegionNavigation: enableRegionNavigation, customSaveButton: customSaveButton, customSavePanel: customSavePanel, forceDisableBlockTools: forceDisableBlockTools, title: title, iframeProps: iframeProps }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_sidebar, { onActionPerformed: onActionPerformed, extraPanels: extraSidebarPanels }), children] }); } /* harmony default export */ const editor = (Editor); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/preferences-modal/enable-publish-sidebar.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferenceBaseOption: enable_publish_sidebar_PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); /* harmony default export */ const enable_publish_sidebar = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)(select => ({ isChecked: select(store_store).isPublishSidebarEnabled() })), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => { const { enablePublishSidebar, disablePublishSidebar } = dispatch(store_store); return { onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar() }; }))(enable_publish_sidebar_PreferenceBaseOption)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/block-manager/checklist.js /** * WordPress dependencies */ function BlockTypesChecklist({ blockTypes, value, onItemChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "editor-block-manager__checklist", children: blockTypes.map(blockType => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "editor-block-manager__checklist-item", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, label: blockType.title, checked: value.includes(blockType.name), onChange: (...args) => onItemChange(blockType.name, ...args) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: blockType.icon })] }, blockType.name)) }); } /* harmony default export */ const checklist = (BlockTypesChecklist); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/block-manager/category.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockManagerCategory({ title, blockTypes }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockManagerCategory); const { allowedBlockTypes, hiddenBlockTypes } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorSettings } = select(store_store); const { get } = select(external_wp_preferences_namespaceObject.store); return { allowedBlockTypes: getEditorSettings().allowedBlockTypes, hiddenBlockTypes: get('core', 'hiddenBlockTypes') }; }, []); const filteredBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { if (allowedBlockTypes === true) { return blockTypes; } return blockTypes.filter(({ name }) => { return allowedBlockTypes?.includes(name); }); }, [allowedBlockTypes, blockTypes]); const { showBlockTypes, hideBlockTypes } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const toggleVisible = (0,external_wp_element_namespaceObject.useCallback)((blockName, nextIsChecked) => { if (nextIsChecked) { showBlockTypes(blockName); } else { hideBlockTypes(blockName); } }, [showBlockTypes, hideBlockTypes]); const toggleAllVisible = (0,external_wp_element_namespaceObject.useCallback)(nextIsChecked => { const blockNames = blockTypes.map(({ name }) => name); if (nextIsChecked) { showBlockTypes(blockNames); } else { hideBlockTypes(blockNames); } }, [blockTypes, showBlockTypes, hideBlockTypes]); if (!filteredBlockTypes.length) { return null; } const checkedBlockNames = filteredBlockTypes.map(({ name }) => name).filter(type => !(hiddenBlockTypes !== null && hiddenBlockTypes !== void 0 ? hiddenBlockTypes : []).includes(type)); const titleId = 'editor-block-manager__category-title-' + instanceId; const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length; const isIndeterminate = !isAllChecked && checkedBlockNames.length > 0; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { role: "group", "aria-labelledby": titleId, className: "editor-block-manager__category", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, checked: isAllChecked, onChange: toggleAllVisible, className: "editor-block-manager__category-title", indeterminate: isIndeterminate, label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { id: titleId, children: title }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(checklist, { blockTypes: filteredBlockTypes, value: checkedBlockNames, onItemChange: toggleVisible })] }); } /* harmony default export */ const block_manager_category = (BlockManagerCategory); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/block-manager/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockManager({ blockTypes, categories, hasBlockSupport, isMatchingSearchTerm, numberOfHiddenBlocks, enableAllBlockTypes }) { const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); // Filtering occurs here (as opposed to `withSelect`) to avoid // wasted renders by consequence of `Array#filter` producing // a new value reference on each call. blockTypes = blockTypes.filter(blockType => hasBlockSupport(blockType, 'inserter', true) && (!search || isMatchingSearchTerm(blockType, search)) && (!blockType.parent || blockType.parent.includes('core/post-content'))); // Announce search results on change (0,external_wp_element_namespaceObject.useEffect)(() => { if (!search) { return; } const count = blockTypes.length; const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count); debouncedSpeak(resultsFoundMessage); }, [blockTypes.length, search, debouncedSpeak]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-block-manager__content", children: [!!numberOfHiddenBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "editor-block-manager__disabled-blocks-count", children: [(0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of blocks. */ (0,external_wp_i18n_namespaceObject._n)('%d block is hidden.', '%d blocks are hidden.', numberOfHiddenBlocks), numberOfHiddenBlocks), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "link", onClick: () => enableAllBlockTypes(blockTypes), children: (0,external_wp_i18n_namespaceObject.__)('Reset') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Search for a block'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search for a block'), value: search, onChange: nextSearch => setSearch(nextSearch), className: "editor-block-manager__search" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { tabIndex: "0", role: "region", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Available block types'), className: "editor-block-manager__results", children: [blockTypes.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "editor-block-manager__no-results", children: (0,external_wp_i18n_namespaceObject.__)('No blocks found.') }), categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_manager_category, { title: category.title, blockTypes: blockTypes.filter(blockType => blockType.category === category.slug) }, category.slug)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_manager_category, { title: (0,external_wp_i18n_namespaceObject.__)('Uncategorized'), blockTypes: blockTypes.filter(({ category }) => !category) })] })] }); } /* harmony default export */ const block_manager = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => { var _get; const { getBlockTypes, getCategories, hasBlockSupport, isMatchingSearchTerm } = select(external_wp_blocks_namespaceObject.store); const { get } = select(external_wp_preferences_namespaceObject.store); // Some hidden blocks become unregistered // by removing for instance the plugin that registered them, yet // they're still remain as hidden by the user's action. // We consider "hidden", blocks which were hidden and // are still registered. const blockTypes = getBlockTypes(); const hiddenBlockTypes = ((_get = get('core', 'hiddenBlockTypes')) !== null && _get !== void 0 ? _get : []).filter(hiddenBlock => { return blockTypes.some(registeredBlock => registeredBlock.name === hiddenBlock); }); const numberOfHiddenBlocks = Array.isArray(hiddenBlockTypes) && hiddenBlockTypes.length; return { blockTypes, categories: getCategories(), hasBlockSupport, isMatchingSearchTerm, numberOfHiddenBlocks }; }), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => { const { showBlockTypes } = unlock(dispatch(store_store)); return { enableAllBlockTypes: blockTypes => { const blockNames = blockTypes.map(({ name }) => name); showBlockTypes(blockNames); } }; })])(BlockManager)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/preferences-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferencesModal, PreferencesModalTabs, PreferencesModalSection, PreferenceToggleControl } = unlock(external_wp_preferences_namespaceObject.privateApis); function EditorPreferencesModal({ extraSections = {} }) { const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const { isActive, showBlockBreadcrumbsOption } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorSettings } = select(store_store); const { get } = select(external_wp_preferences_namespaceObject.store); const { isModalActive } = select(store); const isRichEditingEnabled = getEditorSettings().richEditingEnabled; const isDistractionFreeEnabled = get('core', 'distractionFree'); return { showBlockBreadcrumbsOption: !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled, isActive: isModalActive('editor/preferences') }; }, [isLargeViewport]); const { closeModal } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { setIsListViewOpened, setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); const sections = (0,external_wp_element_namespaceObject.useMemo)(() => [{ name: 'general', tabLabel: (0,external_wp_i18n_namespaceObject.__)('General'), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Interface'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "showListViewByDefault", help: (0,external_wp_i18n_namespaceObject.__)('Opens the List View sidebar by default.'), label: (0,external_wp_i18n_namespaceObject.__)('Always open List View') }), showBlockBreadcrumbsOption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "showBlockBreadcrumbs", help: (0,external_wp_i18n_namespaceObject.__)('Display the block hierarchy trail at the bottom of the editor.'), label: (0,external_wp_i18n_namespaceObject.__)('Show block breadcrumbs') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "allowRightClickOverrides", help: (0,external_wp_i18n_namespaceObject.__)('Allows contextual List View menus via right-click, overriding browser defaults.'), label: (0,external_wp_i18n_namespaceObject.__)('Allow right-click contextual menus') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Document settings'), description: (0,external_wp_i18n_namespaceObject.__)('Select what settings are shown in the document panel.'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_plugin_document_setting_panel.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies, { taxonomyWrapper: (content, taxonomy) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { label: taxonomy.labels.menu_name, panelName: `taxonomy-panel-${taxonomy.slug}` }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { label: (0,external_wp_i18n_namespaceObject.__)('Featured image'), panelName: "featured-image" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'), panelName: "post-excerpt" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, { supportKeys: ['comments', 'trackbacks'], children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { label: (0,external_wp_i18n_namespaceObject.__)('Discussion'), panelName: "discussion-panel" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_attributes_check, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { label: (0,external_wp_i18n_namespaceObject.__)('Page attributes'), panelName: "page-attributes" }) })] }), isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Publishing'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_publish_sidebar, { help: (0,external_wp_i18n_namespaceObject.__)('Review settings, such as visibility and tags.'), label: (0,external_wp_i18n_namespaceObject.__)('Enable pre-publish checks') }) }), extraSections?.general] }) }, { name: 'appearance', tabLabel: (0,external_wp_i18n_namespaceObject.__)('Appearance'), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Appearance'), description: (0,external_wp_i18n_namespaceObject.__)('Customize the editor interface to suit your needs.'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "fixedToolbar", onToggle: () => setPreference('core', 'distractionFree', false), help: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place.'), label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "distractionFree", onToggle: () => { setPreference('core', 'fixedToolbar', true); setIsInserterOpened(false); setIsListViewOpened(false); }, help: (0,external_wp_i18n_namespaceObject.__)('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'), label: (0,external_wp_i18n_namespaceObject.__)('Distraction free') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "focusMode", help: (0,external_wp_i18n_namespaceObject.__)('Highlights the current block and fades other content.'), label: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode') }), extraSections?.appearance] }) }, { name: 'accessibility', tabLabel: (0,external_wp_i18n_namespaceObject.__)('Accessibility'), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Navigation'), description: (0,external_wp_i18n_namespaceObject.__)('Optimize the editing experience for enhanced control.'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "keepCaretInsideBlock", help: (0,external_wp_i18n_namespaceObject.__)('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'), label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Interface'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "showIconLabels", label: (0,external_wp_i18n_namespaceObject.__)('Show button text labels'), help: (0,external_wp_i18n_namespaceObject.__)('Show text instead of icons on buttons across the interface.') }) })] }) }, { name: 'blocks', tabLabel: (0,external_wp_i18n_namespaceObject.__)('Blocks'), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Inserter'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core", featureName: "mostUsedBlocks", help: (0,external_wp_i18n_namespaceObject.__)('Adds a category with the most frequently used blocks in the inserter.'), label: (0,external_wp_i18n_namespaceObject.__)('Show most used blocks') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, { title: (0,external_wp_i18n_namespaceObject.__)('Manage block visibility'), description: (0,external_wp_i18n_namespaceObject.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_manager, {}) })] }) }], [showBlockBreadcrumbsOption, extraSections, setIsInserterOpened, setIsListViewOpened, setPreference, isLargeViewport]); if (!isActive) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, { closeModal: closeModal, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalTabs, { sections: sections }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/private-apis.js /** * WordPress dependencies */ /** * Internal dependencies */ const { store: interfaceStore, ...remainingInterfaceApis } = build_module_namespaceObject; const privateApis = {}; lock(privateApis, { CreateTemplatePartModal: CreateTemplatePartModal, BackButton: back_button, ExperimentalEditorProvider: ExperimentalEditorProvider, EntitiesSavedStatesExtensible: EntitiesSavedStatesExtensible, Editor: editor, EditorInterface: EditorInterface, EditorContentSlotFill: content_slot_fill, GlobalStylesProvider: GlobalStylesProvider, mergeBaseAndUserConfigs: mergeBaseAndUserConfigs, PluginPostExcerpt: post_excerpt_plugin, PreferencesModal: EditorPreferencesModal, usePostActions: usePostActions, ToolsMoreMenuGroup: tools_more_menu_group, ViewMoreMenuGroup: view_more_menu_group, ResizableEditor: resizable_editor, Sidebar: components_sidebar, // This is a temporary private API while we're updating the site editor to use EditorProvider. useBlockEditorSettings: use_block_editor_settings, interfaceStore, ...remainingInterfaceApis }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/index.js /** * Internal dependencies */ /* * Backward compatibility */ })(); (window.wp = window.wp || {}).editor = __webpack_exports__; /******/ })() ;
•
Search:
•
Replace:
1
2
3
Function
Edit by line
Download
Information
Rename
Copy
Move
Delete
Chmod
List