Fix File
•
/
home
/
sportsfe...
/
httpdocs
/
clone
/
wp-inclu...
/
js
/
dist
•
File:
block-library.js
•
Content:
* 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/upper-case-first/dist.es2015/index.js /** * Upper case the first character of an input string. */ function upperCaseFirst(input) { return input.charAt(0).toUpperCase() + input.substr(1); } ;// CONCATENATED MODULE: ./node_modules/capital-case/dist.es2015/index.js function capitalCaseTransform(input) { return upperCaseFirst(input.toLowerCase()); } function capitalCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options)); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js /** * WordPress dependencies */ const symbolFilled = /*#__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: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) }); /* harmony default export */ const symbol_filled = (symbolFilled); ;// 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/block-library/build-module/template-part/edit/utils/hooks.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Retrieves the available template parts for the given area. * * @param {string} area Template part area. * @param {string} excludedId Template part ID to exclude. * * @return {{ templateParts: Array, isResolving: boolean }} array of template parts. */ function useAlternativeTemplateParts(area, excludedId) { const { templateParts, isResolving } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords, isResolving: _isResolving } = select(external_wp_coreData_namespaceObject.store); const query = { per_page: -1 }; return { templateParts: getEntityRecords('postType', 'wp_template_part', query), isResolving: _isResolving('getEntityRecords', ['postType', 'wp_template_part', query]) }; }, []); const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!templateParts) { return []; } return templateParts.filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== excludedId && (!area || 'uncategorized' === area || templatePart.area === area)) || []; }, [templateParts, area, excludedId]); return { templateParts: filteredTemplateParts, isResolving }; } /** * Retrieves the available block patterns for the given area. * * @param {string} area Template part area. * @param {string} clientId Block Client ID. (The container of the block can impact allowed blocks). * * @return {Array} array of block patterns. */ function useAlternativeBlockPatterns(area, clientId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const blockNameWithArea = area ? `core/template-part/${area}` : 'core/template-part'; const { getBlockRootClientId, getPatternsByBlockTypes } = select(external_wp_blockEditor_namespaceObject.store); const rootClientId = getBlockRootClientId(clientId); return getPatternsByBlockTypes(blockNameWithArea, rootClientId); }, [area, clientId]); } function useCreateTemplatePartFromBlocks(area, setAttributes) { const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); return async (blocks = [], title = (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part')) => { // Currently template parts only allow latin chars. // Fallback slug will receive suffix by default. const cleanSlug = paramCase(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; // If we have `area` set from block attributes, means an exposed // block variation was inserted. So add this prop to the template // part entity on creation. Afterwards remove `area` value from // block attributes. const record = { title, slug: cleanSlug, content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), // `area` is filterable on the server and defaults to `UNCATEGORIZED` // if provided value is not allowed. area }; const templatePart = await saveEntityRecord('postType', 'wp_template_part', record); setAttributes({ slug: templatePart.slug, theme: templatePart.theme, area: undefined }); }; } /** * Retrieves the template part area object. * * @param {string} area Template part area identifier. * * @return {{icon: Object, label: string, tagName: string}} Template Part area. */ function useTemplatePartArea(area) { return (0,external_wp_data_namespaceObject.useSelect)(select => { var _selectedArea$area_ta; // FIXME: @wordpress/block-library should not depend on @wordpress/editor. // Blocks can be loaded into a *non-post* block editor. /* eslint-disable @wordpress/data-no-store-string-literals */ const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas(); /* eslint-enable @wordpress/data-no-store-string-literals */ const selectedArea = definedAreas.find(definedArea => definedArea.area === area); const defaultArea = definedAreas.find(definedArea => definedArea.area === 'uncategorized'); return { icon: selectedArea?.icon || defaultArea?.icon, label: selectedArea?.label || (0,external_wp_i18n_namespaceObject.__)('Template Part'), tagName: (_selectedArea$area_ta = selectedArea?.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div' }; }, [area]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/title-modal.js /** * WordPress dependencies */ function TitleModal({ areaLabel, onClose, onSubmit }) { // Restructure onCreate to set the blocks on local state. // Add modal to confirm title and trigger onCreate. const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_i18n_namespaceObject.__)('Untitled Template Part')); const submitForCreation = event => { event.preventDefault(); onSubmit(title); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.). (0,external_wp_i18n_namespaceObject.__)('Name and create your new %s'), areaLabel.toLowerCase()), overlayClassName: "wp-block-template-part__placeholder-create-new__title-form", onRequestClose: onClose, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: submitForCreation, 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, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", __experimentalIsFocusable: true, disabled: !title.length, children: (0,external_wp_i18n_namespaceObject.__)('Create') }) })] }) }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartPlaceholder({ area, clientId, templatePartId, onOpenSelectionModal, setAttributes }) { const { templateParts, isResolving } = useAlternativeTemplateParts(area, templatePartId); const blockPatterns = useAlternativeBlockPatterns(area, clientId); const [showTitleModal, setShowTitleModal] = (0,external_wp_element_namespaceObject.useState)(false); const areaObject = useTemplatePartArea(area); const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: areaObject.icon, label: areaObject.label, instructions: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.). (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaObject.label.toLowerCase()), children: [isResolving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !isResolving && !!(templateParts.length || blockPatterns.length) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", onClick: onOpenSelectionModal, children: (0,external_wp_i18n_namespaceObject.__)('Choose') }), !isResolving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "secondary", onClick: () => { setShowTitleModal(true); }, children: (0,external_wp_i18n_namespaceObject.__)('Start blank') }), showTitleModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TitleModal, { areaLabel: areaObject.label, onClose: () => setShowTitleModal(false), onSubmit: title => { createFromBlocks([], title); } })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * This maps the properties of a template part to those of a block pattern. * @param {Object} templatePart * @return {Object} The template part in the shape of block pattern. */ function mapTemplatePartToBlockPattern(templatePart) { return { name: createTemplatePartId(templatePart.theme, templatePart.slug), title: templatePart.title.rendered, blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw), templatePart }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection-modal.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartSelectionModal({ setAttributes, onClose, templatePartId = null, area, clientId }) { const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); const { templateParts } = useAlternativeTemplateParts(area, templatePartId); // We can map template parts to block patters to reuse the BlockPatternsList UI const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => { const partsAsPatterns = templateParts.map(templatePart => mapTemplatePartToBlockPattern(templatePart)); return searchPatterns(partsAsPatterns, searchValue); }, [templateParts, searchValue]); const shownTemplateParts = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredTemplateParts); const blockPatterns = useAlternativeBlockPatterns(area, clientId); const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { return searchPatterns(blockPatterns, searchValue); }, [blockPatterns, searchValue]); const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onTemplatePartSelect = templatePart => { setAttributes({ slug: templatePart.slug, theme: templatePart.theme, area: undefined }); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template part title. */ (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), templatePart.title?.rendered || templatePart.slug), { type: 'snackbar' }); onClose(); }; const hasTemplateParts = !!filteredTemplateParts.length; const hasBlockPatterns = !!filteredBlockPatterns.length; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-library-template-part__selection-content", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-template-part__selection-search", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, onChange: setSearchValue, value: searchValue, label: (0,external_wp_i18n_namespaceObject.__)('Search for replacements'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') }) }), hasTemplateParts && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { children: (0,external_wp_i18n_namespaceObject.__)('Existing template parts') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { blockPatterns: filteredTemplateParts, shownPatterns: shownTemplateParts, onClickPattern: pattern => { onTemplatePartSelect(pattern.templatePart); } })] }), !hasTemplateParts && !hasBlockPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('No results found.') }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/transformers.js /** * WordPress dependencies */ /** * Converts a widget entity record into a block. * * @param {Object} widget The widget entity record. * @return {Object} a block (converted from the entity record). */ function transformWidgetToBlock(widget) { if (widget.id_base !== 'block') { let attributes; if (widget._embedded.about[0].is_multi) { attributes = { idBase: widget.id_base, instance: widget.instance }; } else { attributes = { id: widget.id }; } return switchLegacyWidgetType((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes)); } const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, { __unstableSkipAutop: true }); if (!parsedBlocks.length) { return undefined; } const block = parsedBlocks[0]; if (block.name === 'core/widget-group') { return (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getGroupingBlockName)(), undefined, transformInnerBlocks(block.innerBlocks)); } if (block.innerBlocks.length > 0) { return (0,external_wp_blocks_namespaceObject.cloneBlock)(block, undefined, transformInnerBlocks(block.innerBlocks)); } return block; } /** * Switch Legacy Widget to the first matching transformation block. * * @param {Object} block Legacy Widget block object * @return {Object|undefined} a block */ function switchLegacyWidgetType(block) { const transforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)([block]).filter(item => { // The block without any transformations can't be a wildcard. if (!item.transforms) { return true; } const hasWildCardFrom = item.transforms?.from?.find(from => from.blocks && from.blocks.includes('*')); const hasWildCardTo = item.transforms?.to?.find(to => to.blocks && to.blocks.includes('*')); // Skip wildcard transformations. return !hasWildCardFrom && !hasWildCardTo; }); if (!transforms.length) { return undefined; } return (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, transforms[0].name); } function transformInnerBlocks(innerBlocks = []) { return innerBlocks.flatMap(block => { if (block.name === 'core/legacy-widget') { return switchLegacyWidgetType(block); } return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, transformInnerBlocks(block.innerBlocks)); }).filter(block => !!block); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/import-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const SIDEBARS_QUERY = { per_page: -1, _fields: 'id,name,description,status,widgets' }; function TemplatePartImportControls({ area, setAttributes }) { const [selectedSidebar, setSelectedSidebar] = (0,external_wp_element_namespaceObject.useState)(''); const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { sidebars, hasResolved } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSidebars, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); return { sidebars: getSidebars(SIDEBARS_QUERY), hasResolved: hasFinishedResolution('getSidebars', [SIDEBARS_QUERY]) }; }, []); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); const options = (0,external_wp_element_namespaceObject.useMemo)(() => { const sidebarOptions = (sidebars !== null && sidebars !== void 0 ? sidebars : []).filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets' && widgetArea.widgets.length > 0).map(widgetArea => { return { value: widgetArea.id, label: widgetArea.name }; }); if (!sidebarOptions.length) { return []; } return [{ value: '', label: (0,external_wp_i18n_namespaceObject.__)('Select widget area') }, ...sidebarOptions]; }, [sidebars]); // Render an empty node while data is loading to avoid SlotFill re-positioning bug. // See: https://github.com/WordPress/gutenberg/issues/15641. if (!hasResolved) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: "0" }); } if (hasResolved && !options.length) { return null; } async function createFromWidgets(event) { event.preventDefault(); if (isBusy || !selectedSidebar) { return; } setIsBusy(true); const sidebar = options.find(({ value }) => value === selectedSidebar); const { getWidgets } = registry.resolveSelect(external_wp_coreData_namespaceObject.store); // The widgets API always returns a successful response. const widgets = await getWidgets({ sidebar: sidebar.value, _embed: 'about' }); const skippedWidgets = new Set(); const blocks = widgets.flatMap(widget => { const block = transformWidgetToBlock(widget); // Skip the block if we have no matching transformations. if (!block) { skippedWidgets.add(widget.id_base); return []; } return block; }); await createFromBlocks(blocks, /* translators: %s: name of the widget area */ (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Widget area: %s'), sidebar.label)); if (skippedWidgets.size) { createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the list of widgets */ (0,external_wp_i18n_namespaceObject.__)('Unable to import the following widgets: %s.'), Array.from(skippedWidgets).join(', ')), { type: 'snackbar' }); } setIsBusy(false); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: "4", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { as: "form", onSubmit: createFromWidgets, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { label: (0,external_wp_i18n_namespaceObject.__)('Import widget area'), value: selectedSidebar, options: options, onChange: value => setSelectedSidebar(value), disabled: !options.length, __next40pxDefaultSize: true, __nextHasNoMarginBottom: true }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: { marginBottom: '8px', marginTop: 'auto' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", isBusy: isBusy, "aria-disabled": isBusy || !selectedSidebar, children: (0,external_wp_i18n_namespaceObject._x)('Import', 'button label') }) })] }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const htmlElementMessages = { header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'), main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only.'), section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."), article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'), aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."), footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).') }; function TemplatePartAdvancedControls({ tagName, setAttributes, isEntityAvailable, templatePartId, defaultWrapper, hasInnerBlocks }) { const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId); const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId); const definedAreas = (0,external_wp_data_namespaceObject.useSelect)(select => { // FIXME: @wordpress/block-library should not depend on @wordpress/editor. // Blocks can be loaded into a *non-post* block editor. /* eslint-disable-next-line @wordpress/data-no-store-string-literals */ return select('core/editor').__experimentalGetDefaultTemplatePartAreas(); }, []); const areaOptions = definedAreas.map(({ label, area: _area }) => ({ label, value: _area })); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Title'), value: title, onChange: value => { setTitle(value); }, onFocus: event => event.target.select() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Area'), labelPosition: "top", options: areaOptions, value: area, onChange: setArea })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), options: [{ label: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: HTML tag based on area. */ (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<${defaultWrapper}>`), value: '' }, { label: '<header>', value: 'header' }, { label: '<main>', value: 'main' }, { label: '<section>', value: 'section' }, { label: '<article>', value: 'article' }, { label: '<aside>', value: 'aside' }, { label: '<footer>', value: 'footer' }, { label: '<div>', value: 'div' }], value: tagName || '', onChange: value => setAttributes({ tagName: value }), help: htmlElementMessages[tagName] }), !hasInnerBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartImportControls, { area: area, setAttributes: setAttributes })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js /** * WordPress dependencies */ function useRenderAppender(hasInnerBlocks) { const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); // Disable appending when the editing mode is 'contentOnly'. This is so that the user can't // append into a template part when editing a page in the site editor. See // DisableNonPageContentBlocks. Ideally instead of (mis)using editing mode there would be a // block editor API for achieving this. if (blockEditingMode === 'contentOnly') { return false; } if (!hasInnerBlocks) { return external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender; } } function useLayout(layout) { const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return getSettings()?.supportsLayout; }, []); const [defaultLayout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('layout'); if (themeSupportsLayout) { return layout?.inherit ? defaultLayout || {} : layout; } } function NonEditableTemplatePartPreview({ postId: id, layout, tagName: TagName, blockProps }) { (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)('disabled'); const { content, editedBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!id) { return {}; } const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const editedRecord = getEditedEntityRecord('postType', 'wp_template_part', id, { context: 'view' }); return { editedBlocks: editedRecord.blocks, content: editedRecord.content }; }, [id]); const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!id) { return undefined; } if (editedBlocks) { return editedBlocks; } if (!content || typeof content !== 'string') { return []; } return (0,external_wp_blocks_namespaceObject.parse)(content); }, [id, editedBlocks, content]); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { value: blocks, onInput: () => {}, onChange: () => {}, renderAppender: false, layout: useLayout(layout) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...innerBlocksProps }); } function EditableTemplatePartInnerBlocks({ postId: id, hasInnerBlocks, layout, tagName: TagName, blockProps }) { const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', { id }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { value: blocks, onInput, onChange, renderAppender: useRenderAppender(hasInnerBlocks), layout: useLayout(layout) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...innerBlocksProps }); } function TemplatePartInnerBlocks({ postId: id, hasInnerBlocks, layout, tagName: TagName, blockProps }) { const { canViewTemplatePart, canEditTemplatePart } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _select$canUser, _select$canUser2; return { canViewTemplatePart: (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('read', 'templates')) !== null && _select$canUser !== void 0 ? _select$canUser : false, canEditTemplatePart: (_select$canUser2 = select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates')) !== null && _select$canUser2 !== void 0 ? _select$canUser2 : false }; }, []); if (!canViewTemplatePart) { return null; } const TemplatePartInnerBlocksComponent = canEditTemplatePart ? EditableTemplatePartInnerBlocks : NonEditableTemplatePartPreview; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartInnerBlocksComponent, { postId: id, hasInnerBlocks: hasInnerBlocks, layout: layout, tagName: TagName, blockProps: blockProps }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function ReplaceButton({ isEntityAvailable, area, templatePartId, isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen }) { // This hook fetches patterns, so don't run it unconditionally in the main // edit function! const { templateParts } = useAlternativeTemplateParts(area, templatePartId); const hasReplacements = !!templateParts.length; const canReplace = isEntityAvailable && hasReplacements && (area === 'header' || area === 'footer'); if (!canReplace) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { setIsTemplatePartSelectionOpen(true); }, "aria-expanded": isTemplatePartSelectionOpen, "aria-haspopup": "dialog", children: (0,external_wp_i18n_namespaceObject.__)('Replace') }); } function TemplatesList({ area, clientId, isEntityAvailable, onSelect }) { // This hook fetches patterns, so don't run it unconditionally in the main // edit function! const blockPatterns = useAlternativeBlockPatterns(area, clientId); const canReplace = isEntityAvailable && !!blockPatterns.length && (area === 'header' || area === 'footer'); const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns); if (!canReplace) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Design'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { label: (0,external_wp_i18n_namespaceObject.__)('Templates'), blockPatterns: blockPatterns, shownPatterns: shownTemplates, onClickPattern: onSelect, showTitle: false }) }); } function TemplatePartEdit({ attributes, setAttributes, clientId }) { const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const currentTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet, []); const { slug, theme = currentTheme, tagName, layout = {} } = attributes; const templatePartId = createTemplatePartId(theme, slug); const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(templatePartId); const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_wp_element_namespaceObject.useState)(false); const { isResolved, hasInnerBlocks, isMissing, area, onNavigateToEntityRecord, title, canEditTemplate } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _select$canUser; const { getEditedEntityRecord, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); const { getBlockCount, getSettings } = select(external_wp_blockEditor_namespaceObject.store); const getEntityArgs = ['postType', 'wp_template_part', templatePartId]; const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null; const _area = entityRecord?.area || attributes.area; const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false; const _canEditTemplate = (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates')) !== null && _select$canUser !== void 0 ? _select$canUser : false; return { hasInnerBlocks: getBlockCount(clientId) > 0, isResolved: hasResolvedEntity, isMissing: hasResolvedEntity && (!entityRecord || Object.keys(entityRecord).length === 0), area: _area, onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord, title: entityRecord?.title, canEditTemplate: _canEditTemplate }; }, [templatePartId, attributes.area, clientId]); const areaObject = useTemplatePartArea(area); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const isPlaceholder = !slug; const isEntityAvailable = !isPlaceholder && !isMissing && isResolved; const TagName = tagName || areaObject.tagName; const onPatternSelect = async pattern => { await editEntityRecord('postType', 'wp_template_part', templatePartId, { blocks: pattern.blocks, content: (0,external_wp_blocks_namespaceObject.serialize)(pattern.blocks) }); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template part title. */ (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" updated.'), title || slug), { type: 'snackbar' }); }; // We don't want to render a missing state if we have any inner blocks. // A new template part is automatically created if we have any inner blocks but no entity. if (!hasInnerBlocks && (slug && !theme || slug && isMissing)) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Template part slug */ (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug) }) }); } if (isEntityAvailable && hasAlreadyRendered) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.RecursionProvider, { uniqueId: templatePartId, children: [isEntityAvailable && onNavigateToEntityRecord && canEditTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => onNavigateToEntityRecord({ postId: templatePartId, postType: 'wp_template_part' }), children: (0,external_wp_i18n_namespaceObject.__)('Edit') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartAdvancedControls, { tagName: tagName, setAttributes: setAttributes, isEntityAvailable: isEntityAvailable, templatePartId: templatePartId, defaultWrapper: areaObject.tagName, hasInnerBlocks: hasInnerBlocks }) }), isPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartPlaceholder, { area: attributes.area, templatePartId: templatePartId, clientId: clientId, setAttributes: setAttributes, onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { children: ({ selectedClientIds }) => { // Only enable for single selection that matches the current block. // Ensures menu item doesn't render multiple times. if (!(selectedClientIds.length === 1 && clientId === selectedClientIds[0])) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReplaceButton, { isEntityAvailable, area, clientId, templatePartId, isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen }); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatesList, { area: area, clientId: clientId, isEntityAvailable: isEntityAvailable, onSelect: pattern => onPatternSelect(pattern) }) }), isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartInnerBlocks, { tagName: TagName, blockProps: blockProps, postId: templatePartId, hasInnerBlocks: hasInnerBlocks, layout: layout }), !isPlaceholder && !isResolved && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) })] }), isTemplatePartSelectionOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { overlayClassName: "block-editor-template-part__selection-modal", title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.). (0,external_wp_i18n_namespaceObject.__)('Choose a %s'), areaObject.label.toLowerCase()), onRequestClose: () => setIsTemplatePartSelectionOpen(false), isFullScreen: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartSelectionModal, { templatePartId: templatePartId, clientId: clientId, area: area, setAttributes: setAttributes, onClose: () => setIsTemplatePartSelectionOpen(false) }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js /** * WordPress dependencies */ const header = /*#__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: "M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_header = (header); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js /** * WordPress dependencies */ const footer = /*#__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", d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_footer = (footer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js /** * WordPress dependencies */ const sidebar = /*#__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: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_sidebar = (sidebar); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/variations.js /** * WordPress dependencies */ function getTemplatePartIcon(iconName) { if ('header' === iconName) { return library_header; } else if ('footer' === iconName) { return library_footer; } else if ('sidebar' === iconName) { return library_sidebar; } return symbol_filled; } function enhanceTemplatePartVariations(settings, name) { if (name !== 'core/template-part') { return settings; } if (settings.variations) { const isActive = (blockAttributes, variationAttributes) => { const { area, theme, slug } = blockAttributes; // We first check the `area` block attribute which is set during insertion. // This property is removed on the creation of a template part. if (area) { return area === variationAttributes.area; } // Find a matching variation from the created template part // by checking the entity's `area` property. if (!slug) { return false; } const { getCurrentTheme, getEntityRecord } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const entity = getEntityRecord('postType', 'wp_template_part', `${theme || getCurrentTheme()?.stylesheet}//${slug}`); if (entity?.slug) { return entity.slug === variationAttributes.slug; } return entity?.area === variationAttributes.area; }; const variations = settings.variations.map(variation => { return { ...variation, ...(!variation.isActive && { isActive }), ...(typeof variation.icon === 'string' && { icon: getTemplatePartIcon(variation.icon) }) }; }); return { ...settings, variations }; } return settings; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const template_part_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/template-part", title: "Template Part", category: "theme", description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.", textdomain: "default", attributes: { slug: { type: "string" }, theme: { type: "string" }, tagName: { type: "string" }, area: { type: "string" } }, supports: { align: true, html: false, reusable: false, renaming: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-template-part-editor" }; const { name: template_part_name } = template_part_metadata; const template_part_settings = { icon: symbol_filled, __experimentalLabel: ({ slug, theme }) => { // Attempt to find entity title if block is a template part. // Require slug to request, otherwise entity is uncreated and will throw 404. if (!slug) { return; } const { getCurrentTheme, getEditedEntityRecord } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const entity = getEditedEntityRecord('postType', 'wp_template_part', (theme || getCurrentTheme()?.stylesheet) + '//' + slug); if (!entity) { return; } return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entity.title) || capitalCase(entity.slug || ''); }, edit: TemplatePartEdit }; const template_part_init = () => { (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates. const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content']; (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'core/block-library/removeTemplatePartsFromPostTemplates', (canInsert, blockType, rootClientId, { getBlock, getBlockParentsByBlockName }) => { if (blockType.name !== 'core/template-part') { return canInsert; } for (const disallowedParentType of DISALLOWED_PARENTS) { const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length; if (hasDisallowedParent) { return false; } } return true; }); return initBlock({ name: template_part_name, metadata: template_part_metadata, settings: template_part_settings }); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js /** * WordPress dependencies */ const term_description_tag = /*#__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.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z" }) }); /* harmony default export */ const term_description = (term_description_tag); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/edit.js /** * External dependencies */ /** * WordPress dependencies */ function TermDescriptionEdit({ attributes, setAttributes, mergedStyle }) { const { textAlign } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }), style: mergedStyle }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-term-description__placeholder", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: (0,external_wp_i18n_namespaceObject.__)('Term Description') }) }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const term_description_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/term-description", title: "Term Description", category: "theme", description: "Display the description of categories, tags and custom taxonomies when viewing an archive.", textdomain: "default", attributes: { textAlign: { type: "string" } }, supports: { align: ["wide", "full"], html: false, color: { link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { padding: true, margin: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: term_description_name } = term_description_metadata; const term_description_settings = { icon: term_description, edit: TermDescriptionEdit }; const term_description_init = () => initBlock({ name: term_description_name, metadata: term_description_metadata, settings: term_description_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/edit.js /** * WordPress dependencies */ function TextColumnsEdit({ attributes, setAttributes }) { const { width, content, columns } = attributes; external_wp_deprecated_default()('The Text Columns block', { since: '5.3', alternative: 'the Columns block' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, { value: width, onChange: nextWidth => setAttributes({ width: nextWidth }), controls: ['center', 'wide', 'full'] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: columns, onChange: value => setAttributes({ columns: value }), min: 2, max: 4, required: true }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: `align${width} columns-${columns}` }), children: Array.from({ length: columns }).map((_, index) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-column", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "p", value: content?.[index]?.children, onChange: nextContent => { setAttributes({ content: [...content.slice(0, index), { children: nextContent }, ...content.slice(index + 1)] }); }, "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: column index (starting with 1) (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1), placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column') }) }, `column-${index}`); }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/save.js /** * WordPress dependencies */ function text_columns_save_save({ attributes }) { const { width, content, columns } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: `align${width} columns-${columns}` }), children: Array.from({ length: columns }).map((_, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-column", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", value: content?.[index]?.children }) }, `column-${index}`)) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js /** * WordPress dependencies */ const text_columns_transforms_transforms = { to: [{ type: 'block', blocks: ['core/columns'], transform: ({ className, columns, content, width }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { align: 'wide' === width || 'full' === width ? width : undefined, className, columns }, content.map(({ children }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: children })]))) }] }; /* harmony default export */ const text_columns_transforms = (text_columns_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js /** * Internal dependencies */ const text_columns_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/text-columns", title: "Text Columns (deprecated)", icon: "columns", category: "design", description: "This block is deprecated. Please use the Columns block instead.", textdomain: "default", attributes: { content: { type: "array", source: "query", selector: "p", query: { children: { type: "string", source: "html" } }, "default": [{}, {}] }, columns: { type: "number", "default": 2 }, width: { type: "string" } }, supports: { inserter: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-text-columns-editor", style: "wp-block-text-columns" }; const { name: text_columns_name } = text_columns_metadata; const text_columns_settings = { transforms: text_columns_transforms, getEditWrapperProps(attributes) { const { width } = attributes; if ('wide' === width || 'full' === width) { return { 'data-align': width }; } }, edit: TextColumnsEdit, save: text_columns_save_save }; const text_columns_init = () => initBlock({ name: text_columns_name, metadata: text_columns_metadata, settings: text_columns_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const verse_deprecated_v1 = { attributes: { content: { type: 'string', source: 'html', selector: 'pre', default: '' }, textAlign: { type: 'string' } }, save({ attributes }) { const { textAlign, content } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "pre", style: { textAlign }, value: content }); } }; const verse_deprecated_v2 = { attributes: { content: { type: 'string', source: 'html', selector: 'pre', default: '', __unstablePreserveWhiteSpace: true, __experimentalRole: 'content' }, textAlign: { type: 'string' } }, supports: { anchor: true, color: { gradients: true, link: true }, typography: { fontSize: true, __experimentalFontFamily: true }, spacing: { padding: true } }, save({ attributes }) { const { textAlign, content } = attributes; const className = dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/edit.js /** * External dependencies */ /** * WordPress dependencies */ function VerseEdit({ attributes, setAttributes, mergeBlocks, onRemove, insertBlocksAfter, style }) { const { textAlign, content } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }), style }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "pre", identifier: "content", preserveWhiteSpace: true, value: content, onChange: nextContent => { setAttributes({ content: nextContent }); }, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'), onRemove: onRemove, onMerge: mergeBlocks, textAlign: textAlign, ...blockProps, __unstablePastePlainText: true, __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/save.js /** * External dependencies */ /** * WordPress dependencies */ function verse_save_save({ attributes }) { const { textAlign, content } = attributes; const className = dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/transforms.js /** * WordPress dependencies */ const verse_transforms_transforms = { from: [{ type: 'block', blocks: ['core/paragraph'], transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes) }], to: [{ type: 'block', blocks: ['core/paragraph'], transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes) }] }; /* harmony default export */ const verse_transforms = (verse_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const verse_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/verse", title: "Verse", category: "text", description: "Insert poetry. Use special spacing formats. Or quote song lyrics.", keywords: ["poetry", "poem"], textdomain: "default", attributes: { content: { type: "rich-text", source: "rich-text", selector: "pre", __unstablePreserveWhiteSpace: true, __experimentalRole: "content" }, textAlign: { type: "string" } }, supports: { anchor: true, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, typography: { fontSize: true, __experimentalFontFamily: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, __experimentalBorder: { radius: true, width: true, color: true, style: true }, interactivity: { clientNavigation: true } }, style: "wp-block-verse", editorStyle: "wp-block-verse-editor" }; const { name: verse_name } = verse_metadata; const verse_settings = { icon: library_verse, example: { attributes: { /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work. content: (0,external_wp_i18n_namespaceObject.__)('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.') /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ } }, transforms: verse_transforms, deprecated: verse_deprecated, merge(attributes, attributesToMerge) { return { content: attributes.content + '\n\n' + attributesToMerge.content }; }, edit: VerseEdit, save: verse_save_save }; const verse_init = () => initBlock({ name: verse_name, metadata: verse_metadata, settings: verse_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/video.js /** * WordPress dependencies */ const video = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" }) }); /* harmony default export */ const library_video = (video); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks.js function Tracks({ tracks = [] }) { return tracks.map(track => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("track", { ...track }, track.src); }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/deprecated.js /** * WordPress dependencies */ /** * Internal dependencies */ const video_deprecated_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/video", title: "Video", category: "media", description: "Embed a video from your media library or upload a new one.", keywords: ["movie"], textdomain: "default", attributes: { autoplay: { type: "boolean", source: "attribute", selector: "video", attribute: "autoplay" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", __experimentalRole: "content" }, controls: { type: "boolean", source: "attribute", selector: "video", attribute: "controls", "default": true }, id: { type: "number", __experimentalRole: "content" }, loop: { type: "boolean", source: "attribute", selector: "video", attribute: "loop" }, muted: { type: "boolean", source: "attribute", selector: "video", attribute: "muted" }, poster: { type: "string", source: "attribute", selector: "video", attribute: "poster" }, preload: { type: "string", source: "attribute", selector: "video", attribute: "preload", "default": "metadata" }, src: { type: "string", source: "attribute", selector: "video", attribute: "src", __experimentalRole: "content" }, playsInline: { type: "boolean", source: "attribute", selector: "video", attribute: "playsinline" }, tracks: { __experimentalRole: "content", type: "array", items: { type: "object" }, "default": [] } }, supports: { anchor: true, align: true, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-video-editor", style: "wp-block-video" }; const { attributes: video_deprecated_blockAttributes } = video_deprecated_metadata; // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname // to the video figcaption element. const video_deprecated_v1 = { attributes: video_deprecated_blockAttributes, save({ attributes }) { const { autoplay, caption, controls, loop, muted, poster, preload, src, playsInline, tracks } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [src && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { autoPlay: autoplay, controls: controls, loop: loop, muted: muted, poster: poster, preload: preload !== 'metadata' ? preload : undefined, src: src, playsInline: playsInline, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tracks, { tracks: tracks }) }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; const video_deprecated_deprecated = [video_deprecated_v1]; /* harmony default export */ const video_deprecated = (video_deprecated_deprecated); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js /** * WordPress dependencies */ const options = [{ value: 'auto', label: (0,external_wp_i18n_namespaceObject.__)('Auto') }, { value: 'metadata', label: (0,external_wp_i18n_namespaceObject.__)('Metadata') }, { value: 'none', label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value') }]; const VideoSettings = ({ setAttributes, attributes }) => { const { autoplay, controls, loop, muted, playsInline, preload } = attributes; const autoPlayHelpText = (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.'); const getAutoplayHelp = external_wp_element_namespaceObject.Platform.select({ web: (0,external_wp_element_namespaceObject.useCallback)(checked => { return checked ? autoPlayHelpText : null; }, []), native: autoPlayHelpText }); const toggleFactory = (0,external_wp_element_namespaceObject.useMemo)(() => { const toggleAttribute = attribute => { return newValue => { setAttributes({ [attribute]: newValue }); }; }; return { autoplay: toggleAttribute('autoplay'), loop: toggleAttribute('loop'), muted: toggleAttribute('muted'), controls: toggleAttribute('controls'), playsInline: toggleAttribute('playsInline') }; }, []); const onChangePreload = (0,external_wp_element_namespaceObject.useCallback)(value => { setAttributes({ preload: value }); }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), onChange: toggleFactory.autoplay, checked: !!autoplay, help: getAutoplayHelp }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Loop'), onChange: toggleFactory.loop, checked: !!loop }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Muted'), onChange: toggleFactory.muted, checked: !!muted }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'), onChange: toggleFactory.controls, checked: !!controls }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true /* translators: Setting to play videos within the webpage on mobile browsers rather than opening in a fullscreen player. */, label: (0,external_wp_i18n_namespaceObject.__)('Play inline'), onChange: toggleFactory.playsInline, checked: !!playsInline, help: (0,external_wp_i18n_namespaceObject.__)('When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Preload'), value: preload, onChange: onChangePreload, options: options, hideCancelButton: true })] }); }; /* harmony default export */ const edit_common_settings = (VideoSettings); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks-editor.js /** * WordPress dependencies */ const ALLOWED_TYPES = ['text/vtt']; const DEFAULT_KIND = 'subtitles'; const KIND_OPTIONS = [{ label: (0,external_wp_i18n_namespaceObject.__)('Subtitles'), value: 'subtitles' }, { label: (0,external_wp_i18n_namespaceObject.__)('Captions'), value: 'captions' }, { label: (0,external_wp_i18n_namespaceObject.__)('Descriptions'), value: 'descriptions' }, { label: (0,external_wp_i18n_namespaceObject.__)('Chapters'), value: 'chapters' }, { label: (0,external_wp_i18n_namespaceObject.__)('Metadata'), value: 'metadata' }]; function TrackList({ tracks, onEditPress }) { let content; if (tracks.length === 0) { content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-library-video-tracks-editor__tracks-informative-message", children: (0,external_wp_i18n_namespaceObject.__)('Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.') }); } else { content = tracks.map((track, index) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "block-library-video-tracks-editor__track-list-track", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { children: [track.label, " "] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => onEditPress(index), "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Label of the video text track e.g: "French subtitles" */ (0,external_wp_i18n_namespaceObject.__)('Edit %s'), track.label), children: (0,external_wp_i18n_namespaceObject.__)('Edit') })] }, index); }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'), className: "block-library-video-tracks-editor__track-list", children: content }); } function SingleTrackEditor({ track, onChange, onClose, onRemove }) { const { src = '', label = '', srcLang = '', kind = DEFAULT_KIND } = track; const fileName = src.startsWith('blob:') ? '' : (0,external_wp_url_namespaceObject.getFilename)(src) || ''; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NavigableMenu, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-library-video-tracks-editor__single-track-editor", spacing: "4", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-library-video-tracks-editor__single-track-editor-edit-track-label", children: (0,external_wp_i18n_namespaceObject.__)('Edit track') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { children: [(0,external_wp_i18n_namespaceObject.__)('File'), ": ", /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("b", { children: fileName })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { columns: 2, gap: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true /* eslint-disable jsx-a11y/no-autofocus */, autoFocus: true /* eslint-enable jsx-a11y/no-autofocus */, onChange: newLabel => onChange({ ...track, label: newLabel }), label: (0,external_wp_i18n_namespaceObject.__)('Label'), value: label, help: (0,external_wp_i18n_namespaceObject.__)('Title of track') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, onChange: newSrcLang => onChange({ ...track, srcLang: newSrcLang }), label: (0,external_wp_i18n_namespaceObject.__)('Source language'), value: srcLang, help: (0,external_wp_i18n_namespaceObject.__)('Language tag (en, fr, etc.)') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "8", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, className: "block-library-video-tracks-editor__single-track-editor-kind-select", options: KIND_OPTIONS, value: kind, label: (0,external_wp_i18n_namespaceObject.__)('Kind'), onChange: newKind => { onChange({ ...track, kind: newKind }); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "block-library-video-tracks-editor__single-track-editor-buttons-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "secondary", onClick: () => { const changes = {}; let hasChanges = false; if (label === '') { changes.label = (0,external_wp_i18n_namespaceObject.__)('English'); hasChanges = true; } if (srcLang === '') { changes.srcLang = 'en'; hasChanges = true; } if (track.kind === undefined) { changes.kind = DEFAULT_KIND; hasChanges = true; } if (hasChanges) { onChange({ ...track, ...changes }); } onClose(); }, children: (0,external_wp_i18n_namespaceObject.__)('Close') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { isDestructive: true, variant: "link", onClick: onRemove, children: (0,external_wp_i18n_namespaceObject.__)('Remove track') })] })] })] }) }); } function TracksEditor({ tracks = [], onChange }) { const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload; }, []); const [trackBeingEdited, setTrackBeingEdited] = (0,external_wp_element_namespaceObject.useState)(null); if (!mediaUpload) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { contentClassName: "block-library-video-tracks-editor", renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'), showTooltip: true, "aria-expanded": isOpen, "aria-haspopup": "true", onClick: onToggle, children: (0,external_wp_i18n_namespaceObject.__)('Text tracks') }) }), renderContent: () => { if (trackBeingEdited !== null) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleTrackEditor, { track: tracks[trackBeingEdited], onChange: newTrack => { const newTracks = [...tracks]; newTracks[trackBeingEdited] = newTrack; onChange(newTracks); }, onClose: () => setTrackBeingEdited(null), onRemove: () => { onChange(tracks.filter((_track, index) => index !== trackBeingEdited)); setTrackBeingEdited(null); } }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.NavigableMenu, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TrackList, { tracks: tracks, onEditPress: setTrackBeingEdited }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { className: "block-library-video-tracks-editor__add-tracks-container", label: (0,external_wp_i18n_namespaceObject.__)('Add tracks'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, { onSelect: ({ url }) => { const trackIndex = tracks.length; onChange([...tracks, { src: url }]); setTrackBeingEdited(trackIndex); }, allowedTypes: ALLOWED_TYPES, render: ({ open }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: library_media, onClick: open, children: (0,external_wp_i18n_namespaceObject.__)('Open Media Library') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormFileUpload, { onChange: event => { const files = event.target.files; const trackIndex = tracks.length; mediaUpload({ allowedTypes: ALLOWED_TYPES, filesList: files, onFileChange: ([{ url }]) => { const newTracks = [...tracks]; if (!newTracks[trackIndex]) { newTracks[trackIndex] = {}; } newTracks[trackIndex] = { ...tracks[trackIndex], src: url }; onChange(newTracks); setTrackBeingEdited(trackIndex); } }); }, accept: ".vtt,text/vtt", render: ({ openFileDialog }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: library_upload, onClick: () => { openFileDialog(); }, children: (0,external_wp_i18n_namespaceObject.__)('Upload') }); } }) })] })] }) }); } }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ // Much of this description is duplicated from MediaPlaceholder. const video_edit_placeholder = content => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: "block-editor-media-placeholder", withIllustration: true, icon: library_video, label: (0,external_wp_i18n_namespaceObject.__)('Video'), instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a video file, pick one from your media library, or add one with a URL.'), children: content }); }; const video_edit_ALLOWED_MEDIA_TYPES = ['video']; const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image']; function VideoEdit({ isSelected: isSingleSelected, attributes, className, setAttributes, insertBlocksAfter, onReplace }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(VideoEdit); const videoPlayer = (0,external_wp_element_namespaceObject.useRef)(); const posterImageButton = (0,external_wp_element_namespaceObject.useRef)(); const { id, controls, poster, src, tracks } = attributes; const isTemporaryVideo = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src); useUploadMediaFromBlobURL({ url: src, allowedTypes: video_edit_ALLOWED_MEDIA_TYPES, onChange: onSelectVideo, onError: onUploadError }); (0,external_wp_element_namespaceObject.useEffect)(() => { // Placeholder may be rendered. if (videoPlayer.current) { videoPlayer.current.load(); } }, [poster]); function onSelectVideo(media) { if (!media || !media.url) { // In this case there was an error // previous attributes should be removed // because they may be temporary blob urls. setAttributes({ src: undefined, id: undefined, poster: undefined, caption: undefined }); return; } // Sets the block's attribute and updates the edit component from the // selected media. setAttributes({ src: media.url, id: media.id, poster: media.image?.src !== media.icon ? media.image?.src : undefined, caption: media.caption }); } function onSelectURL(newSrc) { if (newSrc !== src) { // Check if there's an embed block that handles this URL. const embedBlock = createUpgradedEmbedBlock({ attributes: { url: newSrc } }); if (undefined !== embedBlock && onReplace) { onReplace(embedBlock); return; } setAttributes({ src: newSrc, id: undefined, poster: undefined }); } } const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); function onUploadError(message) { createErrorNotice(message, { type: 'snackbar' }); } const classes = dist_clsx(className, { 'is-transient': isTemporaryVideo }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); if (!src) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_video }), onSelect: onSelectVideo, onSelectURL: onSelectURL, accept: "video/*", allowedTypes: video_edit_ALLOWED_MEDIA_TYPES, value: attributes, onError: onUploadError, placeholder: video_edit_placeholder }) }); } function onSelectPoster(image) { setAttributes({ poster: image.url }); } function onRemovePoster() { setAttributes({ poster: undefined }); // Move focus back to the Media Upload button. posterImageButton.current.focus(); } const videoPosterDescription = `video-block__poster-image-description-${instanceId}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TracksEditor, { tracks: tracks, onChange: newTracks => { setAttributes({ tracks: newTracks }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: src, allowedTypes: video_edit_ALLOWED_MEDIA_TYPES, accept: "video/*", onSelect: onSelectVideo, onSelectURL: onSelectURL, onError: onUploadError }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_common_settings, { setAttributes: setAttributes, attributes: attributes }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.BaseControl, { className: "editor-video-poster-control", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { children: (0,external_wp_i18n_namespaceObject.__)('Poster image') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, { title: (0,external_wp_i18n_namespaceObject.__)('Select poster image'), onSelect: onSelectPoster, allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES, render: ({ open }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", onClick: open, ref: posterImageButton, "aria-describedby": videoPosterDescription, children: !poster ? (0,external_wp_i18n_namespaceObject.__)('Select') : (0,external_wp_i18n_namespaceObject.__)('Replace') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { id: videoPosterDescription, hidden: true, children: poster ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: poster image URL. */ (0,external_wp_i18n_namespaceObject.__)('The current poster image url is %s'), poster) : (0,external_wp_i18n_namespaceObject.__)('There is no poster image currently selected') }), !!poster && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { onClick: onRemovePoster, variant: "tertiary", children: (0,external_wp_i18n_namespaceObject.__)('Remove') })] }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { isDisabled: !isSingleSelected, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: controls, poster: poster, src: src, ref: videoPlayer, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tracks, { tracks: tracks }) }) }), isTemporaryVideo && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { attributes: attributes, setAttributes: setAttributes, isSelected: isSingleSelected, insertBlocksAfter: insertBlocksAfter, label: (0,external_wp_i18n_namespaceObject.__)('Video caption text'), showToolbarButton: isSingleSelected })] })] }); } /* harmony default export */ const video_edit = (VideoEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/save.js /** * WordPress dependencies */ /** * Internal dependencies */ function video_save_save({ attributes }) { const { autoplay, caption, controls, loop, muted, poster, preload, src, playsInline, tracks } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [src && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { autoPlay: autoplay, controls: controls, loop: loop, muted: muted, poster: poster, preload: preload !== 'metadata' ? preload : undefined, src: src, playsInline: playsInline, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tracks, { tracks: tracks }) }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), tagName: "figcaption", value: caption })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/transforms.js /** * WordPress dependencies */ const video_transforms_transforms = { from: [{ type: 'files', isMatch(files) { return files.length === 1 && files[0].type.indexOf('video/') === 0; }, transform(files) { const file = files[0]; // We don't need to upload the media directly here // It's already done as part of the `componentDidMount` // in the video block const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { src: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }); return block; } }, { type: 'shortcode', tag: 'video', attributes: { src: { type: 'string', shortcode: ({ named: { src, mp4, m4v, webm, ogv, flv } }) => { return src || mp4 || m4v || webm || ogv || flv; } }, poster: { type: 'string', shortcode: ({ named: { poster } }) => { return poster; } }, loop: { type: 'string', shortcode: ({ named: { loop } }) => { return loop; } }, autoplay: { type: 'string', shortcode: ({ named: { autoplay } }) => { return autoplay; } }, preload: { type: 'string', shortcode: ({ named: { preload } }) => { return preload; } } } }, { type: 'raw', isMatch: node => node.nodeName === 'P' && node.children.length === 1 && node.firstChild.nodeName === 'VIDEO', transform: node => { const videoElement = node.firstChild; const attributes = { autoplay: videoElement.hasAttribute('autoplay') ? true : undefined, controls: videoElement.hasAttribute('controls') ? undefined : false, loop: videoElement.hasAttribute('loop') ? true : undefined, muted: videoElement.hasAttribute('muted') ? true : undefined, preload: videoElement.getAttribute('preload') || undefined, playsInline: videoElement.hasAttribute('playsinline') ? true : undefined, poster: videoElement.getAttribute('poster') || undefined, src: videoElement.getAttribute('src') || undefined }; return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', attributes); } }] }; /* harmony default export */ const video_transforms = (video_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const video_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/video", title: "Video", category: "media", description: "Embed a video from your media library or upload a new one.", keywords: ["movie"], textdomain: "default", attributes: { autoplay: { type: "boolean", source: "attribute", selector: "video", attribute: "autoplay" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", __experimentalRole: "content" }, controls: { type: "boolean", source: "attribute", selector: "video", attribute: "controls", "default": true }, id: { type: "number", __experimentalRole: "content" }, loop: { type: "boolean", source: "attribute", selector: "video", attribute: "loop" }, muted: { type: "boolean", source: "attribute", selector: "video", attribute: "muted" }, poster: { type: "string", source: "attribute", selector: "video", attribute: "poster" }, preload: { type: "string", source: "attribute", selector: "video", attribute: "preload", "default": "metadata" }, src: { type: "string", source: "attribute", selector: "video", attribute: "src", __experimentalRole: "content" }, playsInline: { type: "boolean", source: "attribute", selector: "video", attribute: "playsinline" }, tracks: { __experimentalRole: "content", type: "array", items: { type: "object" }, "default": [] } }, supports: { anchor: true, align: true, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-video-editor", style: "wp-block-video" }; const { name: video_name } = video_metadata; const video_settings = { icon: library_video, example: { attributes: { src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm', // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block. caption: (0,external_wp_i18n_namespaceObject.__)('Wood thrush singing in Central Park, NYC.') } }, transforms: video_transforms, deprecated: video_deprecated, edit: video_edit, save: video_save_save }; const video_init = () => initBlock({ name: video_name, metadata: video_metadata, settings: video_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/footnotes/edit.js /** * WordPress dependencies */ function FootnotesEdit({ context: { postType, postId } }) { const [meta, updateMeta] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'meta', postId); const footnotesSupported = 'string' === typeof meta?.footnotes; const footnotes = meta?.footnotes ? JSON.parse(meta.footnotes) : []; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); if (!footnotesSupported) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: format_list_numbered }), label: (0,external_wp_i18n_namespaceObject.__)('Footnotes'), instructions: (0,external_wp_i18n_namespaceObject.__)('Footnotes are not supported here. Add this block to post or page content.') }) }); } if (!footnotes.length) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: format_list_numbered }), label: (0,external_wp_i18n_namespaceObject.__)('Footnotes'), instructions: (0,external_wp_i18n_namespaceObject.__)('Footnotes found in blocks within this document will be displayed here.') }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { ...blockProps, children: footnotes.map(({ id, content }) => /*#__PURE__*/ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { onMouseDown: event => { // When clicking on the list item (not on descendants), // focus the rich text element since it's only 1px wide when // empty. if (event.target === event.currentTarget) { event.target.firstElementChild.focus(); event.preventDefault(); } }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { id: id, tagName: "span", value: content, identifier: id // To do: figure out why the browser is not scrolling // into view when it receives focus. , onFocus: event => { if (!event.target.textContent.trim()) { event.target.scrollIntoView(); } }, onChange: nextFootnote => { updateMeta({ ...meta, footnotes: JSON.stringify(footnotes.map(footnote => { return footnote.id === id ? { content: nextFootnote, id } : footnote; })) }); } }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: `#${id}-link`, children: "\u21A9\uFE0E" })] }, id)) }); } ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/native.js const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); /* harmony default export */ const esm_browser_native = ({ randomUUID }); ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js // Unique ID creation requires a high quality random # generator. In the browser we therefore // require the crypto API and do not support built-in fallback to lower quality random number // generators (like Math.random()). let getRandomValues; const rnds8 = new Uint8Array(16); function rng() { // lazy load so that environments that need to polyfill have a chance to do so if (!getRandomValues) { // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); if (!getRandomValues) { throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); } } return getRandomValues(rnds8); } ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ const byteToHex = []; for (let i = 0; i < 256; ++i) { byteToHex.push((i + 0x100).toString(16).slice(1)); } function unsafeStringify(arr, offset = 0) { // Note: Be careful editing this code! It's been tuned for performance // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } function stringify(arr, offset = 0) { const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one // of the following: // - One or more input array values don't map to a hex octet (leading to // "undefined" in the uuid) // - Invalid input values for the RFC `version` or `variant` fields if (!validate(uuid)) { throw TypeError('Stringified UUID is invalid'); } return uuid; } /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js function v4_v4(options, buf, offset) { if (esm_browser_native.randomUUID && !buf && !options) { return esm_browser_native.randomUUID(); } options = options || {}; const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = rnds[6] & 0x0f | 0x40; rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided if (buf) { offset = offset || 0; for (let i = 0; i < 16; ++i) { buf[offset + i] = rnds[i]; } return buf; } return unsafeStringify(rnds); } /* harmony default export */ const esm_browser_v4 = (v4_v4); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/footnotes/format.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { usesContextKey } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const formatName = 'core/footnote'; const POST_CONTENT_BLOCK_NAME = 'core/post-content'; const SYNCED_PATTERN_BLOCK_NAME = 'core/block'; const format = { title: (0,external_wp_i18n_namespaceObject.__)('Footnote'), tagName: 'sup', className: 'fn', attributes: { 'data-fn': 'data-fn' }, interactive: true, contentEditable: false, [usesContextKey]: ['postType', 'postId'], edit: function Edit({ value, onChange, isObjectActive, context: { postType, postId } }) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { getSelectedBlockClientId, getBlocks, getBlockRootClientId, getBlockName, getBlockParentsByBlockName } = registry.select(external_wp_blockEditor_namespaceObject.store); const isFootnotesSupported = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!select(external_wp_blocks_namespaceObject.store).getBlockType('core/footnotes')) { return false; } const allowedBlocks = select(external_wp_blockEditor_namespaceObject.store).getSettings().allowedBlockTypes; if (allowedBlocks === false || Array.isArray(allowedBlocks) && !allowedBlocks.includes('core/footnotes')) { return false; } const entityRecord = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId); if ('string' !== typeof entityRecord?.meta?.footnotes) { return false; } // Checks if the selected block lives within a pattern. const { getBlockParentsByBlockName: _getBlockParentsByBlockName, getSelectedBlockClientId: _getSelectedBlockClientId } = select(external_wp_blockEditor_namespaceObject.store); const parentCoreBlocks = _getBlockParentsByBlockName(_getSelectedBlockClientId(), SYNCED_PATTERN_BLOCK_NAME); return !parentCoreBlocks || parentCoreBlocks.length === 0; }, [postType, postId]); const { selectionChange, insertBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); if (!isFootnotesSupported) { return null; } function onClick() { registry.batch(() => { let id; if (isObjectActive) { const object = value.replacements[value.start]; id = object?.attributes?.['data-fn']; } else { id = esm_browser_v4(); const newValue = (0,external_wp_richText_namespaceObject.insertObject)(value, { type: formatName, attributes: { 'data-fn': id }, innerHTML: `<a href="#${id}" id="${id}-link">*</a>` }, value.end, value.end); newValue.start = newValue.end - 1; onChange(newValue); } const selectedClientId = getSelectedBlockClientId(); /* * Attempts to find a common parent post content block. * This allows for locating blocks within a page edited in the site editor. */ const parentPostContent = getBlockParentsByBlockName(selectedClientId, POST_CONTENT_BLOCK_NAME); // When called with a post content block, getBlocks will return // the block with controlled inner blocks included. const blocks = parentPostContent.length ? getBlocks(parentPostContent[0]) : getBlocks(); // BFS search to find the first footnote block. let fnBlock = null; { const queue = [...blocks]; while (queue.length) { const block = queue.shift(); if (block.name === 'core/footnotes') { fnBlock = block; break; } queue.push(...block.innerBlocks); } } // Maybe this should all also be moved to the entity provider. // When there is no footnotes block in the post, create one and // insert it at the bottom. if (!fnBlock) { let rootClientId = getBlockRootClientId(selectedClientId); while (rootClientId && getBlockName(rootClientId) !== POST_CONTENT_BLOCK_NAME) { rootClientId = getBlockRootClientId(rootClientId); } fnBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/footnotes'); insertBlock(fnBlock, undefined, rootClientId); } selectionChange(fnBlock.clientId, id, 0, 0); }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichTextToolbarButton, { icon: format_list_numbered, title: (0,external_wp_i18n_namespaceObject.__)('Footnote'), onClick: onClick, isActive: isObjectActive }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/footnotes/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const footnotes_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/footnotes", title: "Footnotes", category: "text", description: "Display footnotes added to the page.", keywords: ["references"], textdomain: "default", usesContext: ["postId", "postType"], supports: { __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: false, color: false, width: false, style: false } }, color: { background: true, link: true, text: true, __experimentalDefaultControls: { link: true, text: true } }, html: false, multiple: false, reusable: false, inserter: false, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextDecoration: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, style: "wp-block-footnotes" }; const { name: footnotes_name } = footnotes_metadata; const footnotes_settings = { icon: format_list_numbered, edit: FootnotesEdit }; (0,external_wp_richText_namespaceObject.registerFormatType)(formatName, format); const footnotes_init = () => { initBlock({ name: footnotes_name, metadata: footnotes_metadata, settings: footnotes_settings }); }; // EXTERNAL MODULE: ./node_modules/@wordpress/block-library/build-module/utils/is-block-metadata-experimental.js var is_block_metadata_experimental = __webpack_require__(2321); var is_block_metadata_experimental_default = /*#__PURE__*/__webpack_require__.n(is_block_metadata_experimental); ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"] const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block-keyboard-shortcuts/index.js /** * WordPress dependencies */ function BlockKeyboardShortcuts() { const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { getBlockName, getSelectedBlockClientId, getBlockAttributes } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const handleTransformHeadingAndParagraph = (event, level) => { event.preventDefault(); const currentClientId = getSelectedBlockClientId(); if (currentClientId === null) { return; } const blockName = getBlockName(currentClientId); const isParagraph = blockName === 'core/paragraph'; const isHeading = blockName === 'core/heading'; if (!isParagraph && !isHeading) { return; } const destinationBlockName = level === 0 ? 'core/paragraph' : 'core/heading'; const attributes = getBlockAttributes(currentClientId); // Avoid unnecessary block transform when attempting to transform to // the same block type and/or same level. if (isParagraph && level === 0 || isHeading && attributes.level === level) { return; } const textAlign = blockName === 'core/paragraph' ? 'align' : 'textAlign'; const destinationTextAlign = destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign'; replaceBlocks(currentClientId, (0,external_wp_blocks_namespaceObject.createBlock)(destinationBlockName, { level, content: attributes.content, ...{ [destinationTextAlign]: attributes[textAlign] } })); }; (0,external_wp_element_namespaceObject.useEffect)(() => { registerShortcut({ name: 'core/block-editor/transform-heading-to-paragraph', category: 'block-library', description: (0,external_wp_i18n_namespaceObject.__)('Transform heading to paragraph.'), keyCombination: { modifier: 'access', character: '0' }, aliases: [{ modifier: 'access', character: '7' }] }); [1, 2, 3, 4, 5, 6].forEach(level => { registerShortcut({ name: `core/block-editor/transform-paragraph-to-heading-${level}`, category: 'block-library', description: (0,external_wp_i18n_namespaceObject.__)('Transform paragraph to heading.'), keyCombination: { modifier: 'access', character: `${level}` } }); }); }, []); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-heading-to-paragraph', event => handleTransformHeadingAndParagraph(event, 0)); [1, 2, 3, 4, 5, 6].forEach(level => { //the loop is based off on a constant therefore //the hook will execute the same way every time //eslint-disable-next-line react-hooks/rules-of-hooks (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)(`core/block-editor/transform-paragraph-to-heading-${level}`, event => handleTransformHeadingAndParagraph(event, level)); }); return null; } /* harmony default export */ const block_keyboard_shortcuts = (BlockKeyboardShortcuts); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/private-apis.js /** * Internal dependencies */ /** * @private */ const privateApis = {}; lock(privateApis, { BlockKeyboardShortcuts: block_keyboard_shortcuts }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/index.js /** * WordPress dependencies */ /** * Internal dependencies */ // When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks // are transformed by packages/block-library/src/index.js as follows: // import * as experimentalBlock from './experimental-block' // becomes // const experimentalBlock = null; // This enables webpack to eliminate the experimental blocks code from the // production build to make the final bundle smaller. // // See https://github.com/WordPress/gutenberg/pull/40655 for more context. /** * Function to get all the block-library blocks in an array */ const getAllBlocks = () => { const blocks = [ // Common blocks are grouped at the top to prioritize their display // in various contexts — like the inserter and auto-complete components. build_module_paragraph_namespaceObject, build_module_image_namespaceObject, build_module_heading_namespaceObject, build_module_gallery_namespaceObject, build_module_list_namespaceObject, build_module_list_item_namespaceObject, build_module_quote_namespaceObject, // Register all remaining core blocks. archives_namespaceObject, build_module_audio_namespaceObject, build_module_button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, build_module_code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_comment_author_avatar_namespaceObject, build_module_cover_namespaceObject, build_module_details_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, build_module_group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, page_list_item_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, build_module_search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, tag_cloud_namespaceObject, text_columns_namespaceObject, build_module_verse_namespaceObject, build_module_video_namespaceObject, footnotes_namespaceObject, // theme blocks build_module_navigation_namespaceObject, navigation_link_namespaceObject, navigation_submenu_namespaceObject, build_module_site_logo_namespaceObject, site_title_namespaceObject, site_tagline_namespaceObject, query_namespaceObject, template_part_namespaceObject, avatar_namespaceObject, post_title_namespaceObject, build_module_post_excerpt_namespaceObject, build_module_post_featured_image_namespaceObject, build_module_post_content_namespaceObject, build_module_post_author_namespaceObject, post_author_name_namespaceObject, post_comment_namespaceObject, build_module_post_comments_count_namespaceObject, post_comments_link_namespaceObject, build_module_post_date_namespaceObject, build_module_post_terms_namespaceObject, post_navigation_link_namespaceObject, post_template_namespaceObject, post_time_to_read_namespaceObject, build_module_query_pagination_namespaceObject, build_module_query_pagination_next_namespaceObject, build_module_query_pagination_numbers_namespaceObject, build_module_query_pagination_previous_namespaceObject, query_no_results_namespaceObject, read_more_namespaceObject, comments_namespaceObject, build_module_comment_author_name_namespaceObject, build_module_comment_content_namespaceObject, comment_date_namespaceObject, build_module_comment_edit_link_namespaceObject, build_module_comment_reply_link_namespaceObject, comment_template_namespaceObject, comments_title_namespaceObject, comments_pagination_namespaceObject, comments_pagination_next_namespaceObject, comments_pagination_numbers_namespaceObject, comments_pagination_previous_namespaceObject, build_module_post_comments_form_namespaceObject, build_module_table_of_contents_namespaceObject, home_link_namespaceObject, loginout_namespaceObject, build_module_term_description_namespaceObject, query_title_namespaceObject, post_author_biography_namespaceObject]; if (window?.__experimentalEnableFormBlocks) { blocks.push(build_module_form_namespaceObject); blocks.push(form_input_namespaceObject); blocks.push(form_submit_button_namespaceObject); blocks.push(form_submission_notification_namespaceObject); } // When in a WordPress context, conditionally // add the classic block and TinyMCE editor // under any of the following conditions: // - the current post contains a classic block // - the experiment to disable TinyMCE isn't active. // - a query argument specifies that TinyMCE should be loaded if (window?.wp?.oldEditor && (window?.wp?.needsClassicBlock || !window?.__experimentalDisableTinymce || !!new URLSearchParams(window?.location?.search).get('requiresTinymce'))) { blocks.push(freeform_namespaceObject); } return blocks.filter(Boolean); }; /** * Function to get all the core blocks in an array. * * @example * ```js * import { __experimentalGetCoreBlocks } from '@wordpress/block-library'; * * const coreBlocks = __experimentalGetCoreBlocks(); * ``` */ const __experimentalGetCoreBlocks = () => getAllBlocks().filter(({ metadata }) => !is_block_metadata_experimental_default()(metadata)); /** * Function to register core blocks provided by the block editor. * * @param {Array} blocks An optional array of the core blocks being registered. * * @example * ```js * import { registerCoreBlocks } from '@wordpress/block-library'; * * registerCoreBlocks(); * ``` */ const registerCoreBlocks = (blocks = __experimentalGetCoreBlocks()) => { blocks.forEach(({ init }) => init()); (0,external_wp_blocks_namespaceObject.setDefaultBlockName)(paragraph_name); if (window.wp && window.wp.oldEditor && blocks.some(({ name }) => name === freeform_name)) { (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name); } (0,external_wp_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name); (0,external_wp_blocks_namespaceObject.setGroupingBlockName)(group_name); }; /** * Function to register experimental core blocks depending on editor settings. * * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks. * @example * ```js * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library'; * * __experimentalRegisterExperimentalCoreBlocks( settings ); * ``` */ const __experimentalRegisterExperimentalCoreBlocks = false ? 0 : undefined; })(); (window.wp = window.wp || {}).blockLibrary = __webpack_exports__; /******/ })() ;
•
Search:
•
Replace:
1
2
3
4
5
6
7
Function
Edit by line
Download
Information
Rename
Copy
Move
Delete
Chmod
List