} [currentPath] Set to track and backtrack graph paths.
* @return {boolean} Whether any cycle was found.
*/
function hasCycle(deps, slug, visitedNodes = new Set(), currentPath = new Set()) {
var _deps$get;
visitedNodes.add(slug);
currentPath.add(slug);
const dependencies = (_deps$get = deps.get(slug)) !== null && _deps$get !== void 0 ? _deps$get : new Set();
for (const dependency of dependencies) {
if (!visitedNodes.has(dependency)) {
if (hasCycle(deps, dependency, visitedNodes, currentPath)) {
return true;
}
} else if (currentPath.has(dependency)) {
return true;
}
}
// Remove the current node from the current path when backtracking
currentPath.delete(slug);
return false;
}
;// ./node_modules/@wordpress/block-library/build-module/pattern/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const PatternEdit = ({
attributes,
clientId
}) => {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet, []);
const {
replaceBlocks,
setBlockEditingMode,
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const {
getBlockRootClientId,
getBlockEditingMode
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const [hasRecursionError, setHasRecursionError] = (0,external_wp_element_namespaceObject.useState)(false);
const parsePatternDependencies = useParsePatternDependencies();
// Duplicated in packages/editor/src/components/start-template-options/index.js.
function injectThemeAttributeInBlockTemplateContent(block) {
if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) {
block.innerBlocks = block.innerBlocks.map(innerBlock => {
if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) {
innerBlock.attributes.theme = currentThemeStylesheet;
}
return innerBlock;
});
}
if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
block.attributes.theme = currentThemeStylesheet;
}
return block;
}
// Run this effect when the component loads.
// This adds the Pattern's contents to the post.
// This change won't be saved.
// It will continue to pull from the pattern file unless changes are made to its respective template part.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!hasRecursionError && selectedPattern?.blocks) {
try {
parsePatternDependencies(selectedPattern);
} catch (error) {
setHasRecursionError(true);
return;
}
// We batch updates to block list settings to avoid triggering cascading renders
// for each container block included in a tree and optimize initial render.
// Since the above uses microtasks, we need to use a microtask here as well,
// because nested pattern blocks cannot be inserted if the parent block supports
// inner blocks but doesn't have blockSettings in the state.
window.queueMicrotask(() => {
const rootClientId = getBlockRootClientId(clientId);
// Clone blocks from the pattern before insertion to ensure they receive
// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.
const clonedBlocks = selectedPattern.blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(injectThemeAttributeInBlockTemplateContent(block)));
// If the pattern has a single block and categories, we should add the
// categories of the pattern to the block's metadata.
if (clonedBlocks.length === 1 && selectedPattern.categories?.length > 0) {
clonedBlocks[0].attributes = {
...clonedBlocks[0].attributes,
metadata: {
...clonedBlocks[0].attributes.metadata,
categories: selectedPattern.categories,
patternName: selectedPattern.name,
name: clonedBlocks[0].attributes.metadata.name || selectedPattern.title
}
};
}
const rootEditingMode = getBlockEditingMode(rootClientId);
registry.batch(() => {
// Temporarily set the root block to default mode to allow replacing the pattern.
// This could happen when the page is disabling edits of non-content blocks.
__unstableMarkNextChangeAsNotPersistent();
setBlockEditingMode(rootClientId, 'default');
__unstableMarkNextChangeAsNotPersistent();
replaceBlocks(clientId, clonedBlocks);
// Restore the root block's original mode.
__unstableMarkNextChangeAsNotPersistent();
setBlockEditingMode(rootClientId, rootEditingMode);
});
});
}
}, [clientId, hasRecursionError, selectedPattern, __unstableMarkNextChangeAsNotPersistent, replaceBlocks, getBlockEditingMode, setBlockEditingMode, getBlockRootClientId]);
const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
if (hasRecursionError) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...props,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: A warning in which %s is the name of a pattern.
(0,external_wp_i18n_namespaceObject.__)('Pattern "%s" cannot be rendered inside itself.'), selectedPattern?.name)
})
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...props
});
};
/* harmony default export */ const pattern_edit = (PatternEdit);
;// ./node_modules/@wordpress/block-library/build-module/pattern/index.js
/**
* Internal dependencies
*/
const pattern_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/pattern",
title: "Pattern Placeholder",
category: "theme",
description: "Show a block pattern.",
supports: {
html: false,
inserter: false,
renaming: false,
interactivity: {
clientNavigation: true
}
},
textdomain: "default",
attributes: {
slug: {
type: "string"
}
}
};
const {
name: pattern_name
} = pattern_metadata;
const pattern_settings = {
edit: pattern_edit
};
const pattern_init = () => initBlock({
name: pattern_name,
metadata: pattern_metadata,
settings: pattern_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/pages.js
/**
* WordPress dependencies
*/
const pages = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(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: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"
})]
});
/* harmony default export */ const library_pages = (pages);
;// ./node_modules/@wordpress/block-library/build-module/page-list/use-convert-to-navigation-links.js
/**
* WordPress dependencies
*/
/**
* Converts an array of pages into a nested array of navigation link blocks.
*
* @param {Array} pages An array of pages.
*
* @return {Array} A nested array of navigation link blocks.
*/
function createNavigationLinks(pages = []) {
const linkMap = {};
const navigationLinks = [];
pages.forEach(({
id,
title,
link: url,
type,
parent
}) => {
var _linkMap$id$innerBloc;
// See if a placeholder exists. This is created if children appear before parents in list.
const innerBlocks = (_linkMap$id$innerBloc = linkMap[id]?.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : [];
linkMap[id] = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', {
id,
label: title.rendered,
url,
type,
kind: 'post-type'
}, innerBlocks);
if (!parent) {
navigationLinks.push(linkMap[id]);
} else {
if (!linkMap[parent]) {
// Use a placeholder if the child appears before parent in list.
linkMap[parent] = {
innerBlocks: []
};
}
// Although these variables are not referenced, they are needed to store the innerBlocks in memory.
const parentLinkInnerBlocks = linkMap[parent].innerBlocks;
parentLinkInnerBlocks.push(linkMap[id]);
}
});
return navigationLinks;
}
/**
* Finds a navigation link block by id, recursively.
* It might be possible to make this a more generic helper function.
*
* @param {Array} navigationLinks An array of navigation link blocks.
* @param {number} id The id of the navigation link to find.
*
* @return {Object|null} The navigation link block with the given id.
*/
function findNavigationLinkById(navigationLinks, id) {
for (const navigationLink of navigationLinks) {
// Is this the link we're looking for?
if (navigationLink.attributes.id === id) {
return navigationLink;
}
// If not does it have innerBlocks?
if (navigationLink.innerBlocks && navigationLink.innerBlocks.length) {
const foundNavigationLink = findNavigationLinkById(navigationLink.innerBlocks, id);
if (foundNavigationLink) {
return foundNavigationLink;
}
}
}
return null;
}
function convertToNavigationLinks(pages = [], parentPageID = null) {
let navigationLinks = createNavigationLinks(pages);
// If a parent page ID is provided, only return the children of that page.
if (parentPageID) {
const parentPage = findNavigationLinkById(navigationLinks, parentPageID);
if (parentPage && parentPage.innerBlocks) {
navigationLinks = parentPage.innerBlocks;
}
}
// Transform all links with innerBlocks into Submenus. This can't be done
// sooner because page objects have no information on their children.
const transformSubmenus = listOfLinks => {
listOfLinks.forEach((block, index, listOfLinksArray) => {
const {
attributes,
innerBlocks
} = block;
if (innerBlocks.length !== 0) {
transformSubmenus(innerBlocks);
const transformedBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks);
listOfLinksArray[index] = transformedBlock;
}
});
};
transformSubmenus(navigationLinks);
return navigationLinks;
}
function useConvertToNavigationLinks({
clientId,
pages,
parentClientId,
parentPageID
}) {
const {
replaceBlock,
selectBlock
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
return () => {
const navigationLinks = convertToNavigationLinks(pages, parentPageID);
// Replace the Page List block with the Navigation Links.
replaceBlock(clientId, navigationLinks);
// Select the Navigation block to reveal the changes.
selectBlock(parentClientId);
};
}
;// ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js
/**
* WordPress dependencies
*/
const convertDescription = (0,external_wp_i18n_namespaceObject.__)("This Navigation Menu displays your website's pages. Editing it will enable you to add, delete, or reorder pages. However, new pages will no longer be added automatically.");
function ConvertToLinksModal({
onClick,
onClose,
disabled
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, {
onRequestClose: onClose,
title: (0,external_wp_i18n_namespaceObject.__)('Edit Page List'),
className: "wp-block-page-list-modal",
aria: {
describedby: (0,external_wp_compose_namespaceObject.useInstanceId)(ConvertToLinksModal, 'wp-block-page-list-modal__description')
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
id: (0,external_wp_compose_namespaceObject.useInstanceId)(ConvertToLinksModal, 'wp-block-page-list-modal__description'),
children: convertDescription
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "wp-block-page-list-modal-buttons",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onClose,
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "primary",
accessibleWhenDisabled: true,
disabled: disabled,
onClick: onClick,
children: (0,external_wp_i18n_namespaceObject.__)('Edit')
})]
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/page-list/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
// We only show the edit option when page count is <= MAX_PAGE_COUNT
// Performance of Navigation Links is not good past this value.
const MAX_PAGE_COUNT = 100;
const NOOP = () => {};
function BlockContent({
blockProps,
innerBlocksProps,
hasResolvedPages,
blockList,
pages,
parentPageID
}) {
if (!hasResolvedPages) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "wp-block-page-list__loading-indicator-container",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {
className: "wp-block-page-list__loading-indicator"
})
})
});
}
if (pages === null) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
status: "warning",
isDismissible: false,
children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')
})
});
}
if (pages.length === 0) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
status: "info",
isDismissible: false,
children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')
})
});
}
if (blockList.length === 0) {
const parentPageDetails = pages.find(page => page.id === parentPageID);
if (parentPageDetails?.title?.rendered) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Page title.
(0,external_wp_i18n_namespaceObject.__)('Page List: "%s" page has no children.'), parentPageDetails.title.rendered)
})
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
status: "warning",
isDismissible: false,
children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')
})
});
}
if (pages.length > 0) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
...innerBlocksProps
});
}
}
function PageListEdit({
context,
clientId,
attributes,
setAttributes
}) {
const {
parentPageID
} = attributes;
const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const openModal = (0,external_wp_element_namespaceObject.useCallback)(() => setOpen(true), []);
const closeModal = () => setOpen(false);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const {
records: pages,
hasResolved: hasResolvedPages
} = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', {
per_page: MAX_PAGE_COUNT,
_fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'],
// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby
// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent
// sort.
orderby: 'menu_order',
order: 'asc'
});
const allowConvertToLinks = 'showSubmenuIcon' in context && pages?.length > 0 && pages?.length <= MAX_PAGE_COUNT;
const pagesByParentId = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (pages === null) {
return new Map();
}
// TODO: Once the REST API supports passing multiple values to
// 'orderby', this can be removed.
// https://core.trac.wordpress.org/ticket/39037
const sortedPages = pages.sort((a, b) => {
if (a.menu_order === b.menu_order) {
return a.title.rendered.localeCompare(b.title.rendered);
}
return a.menu_order - b.menu_order;
});
return sortedPages.reduce((accumulator, page) => {
const {
parent
} = page;
if (accumulator.has(parent)) {
accumulator.get(parent).push(page);
} else {
accumulator.set(parent, [page]);
}
return accumulator;
}, new Map());
}, [pages]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx('wp-block-page-list', {
'has-text-color': !!context.textColor,
[(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor,
'has-background': !!context.backgroundColor,
[(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor
}),
style: {
...context.style?.color
}
});
const pagesTree = (0,external_wp_element_namespaceObject.useMemo)(function makePagesTree(parentId = 0, level = 0) {
const childPages = pagesByParentId.get(parentId);
if (!childPages?.length) {
return [];
}
return childPages.reduce((tree, page) => {
const hasChildren = pagesByParentId.has(page.id);
const item = {
value: page.id,
label: '— '.repeat(level) + page.title.rendered,
rawName: page.title.rendered
};
tree.push(item);
if (hasChildren) {
tree.push(...makePagesTree(page.id, level + 1));
}
return tree;
}, []);
}, [pagesByParentId]);
const blockList = (0,external_wp_element_namespaceObject.useMemo)(function getBlockList(parentId = parentPageID) {
const childPages = pagesByParentId.get(parentId);
if (!childPages?.length) {
return [];
}
return childPages.reduce((template, page) => {
const hasChildren = pagesByParentId.has(page.id);
const pageProps = {
id: page.id,
label:
// translators: displayed when a page has an empty title.
page.title?.rendered?.trim() !== '' ? page.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'),
title:
// translators: displayed when a page has an empty title.
page.title?.rendered?.trim() !== '' ? page.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'),
link: page.url,
hasChildren
};
let item = null;
const children = getBlockList(page.id);
item = (0,external_wp_blocks_namespaceObject.createBlock)('core/page-list-item', pageProps, children);
template.push(item);
return template;
}, []);
}, [pagesByParentId, parentPageID]);
const {
isNested,
hasSelectedChild,
parentClientId,
hasDraggedChild,
isChildOfNavigation
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlockParentsByBlockName,
hasSelectedInnerBlock,
hasDraggedInnerBlock
} = select(external_wp_blockEditor_namespaceObject.store);
const blockParents = getBlockParentsByBlockName(clientId, 'core/navigation-submenu', true);
const navigationBlockParents = getBlockParentsByBlockName(clientId, 'core/navigation', true);
return {
isNested: blockParents.length > 0,
isChildOfNavigation: navigationBlockParents.length > 0,
hasSelectedChild: hasSelectedInnerBlock(clientId, true),
hasDraggedChild: hasDraggedInnerBlock(clientId, true),
parentClientId: navigationBlockParents[0]
};
}, [clientId]);
const convertToNavigationLinks = useConvertToNavigationLinks({
clientId,
pages,
parentClientId,
parentPageID
});
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
renderAppender: false,
__unstableDisableDropZone: true,
templateLock: isChildOfNavigation ? false : 'all',
onInput: NOOP,
onChange: NOOP,
value: blockList
});
const {
selectBlock
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasSelectedChild || hasDraggedChild) {
openModal();
selectBlock(parentClientId);
}
}, [hasSelectedChild, hasDraggedChild, parentClientId, selectBlock, openModal]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
setAttributes({
isNested
});
}, [isNested, setAttributes]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(pagesTree.length > 0 || allowConvertToLinks) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
parentPageID: 0
});
},
dropdownMenuProps: dropdownMenuProps,
children: [pagesTree.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Parent Page'),
hasValue: () => parentPageID !== 0,
onDeselect: () => setAttributes({
parentPageID: 0
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
className: "editor-page-attributes__parent",
label: (0,external_wp_i18n_namespaceObject.__)('Parent'),
value: parentPageID,
options: pagesTree,
onChange: value => setAttributes({
parentPageID: value !== null && value !== void 0 ? value : 0
}),
help: (0,external_wp_i18n_namespaceObject.__)('Choose a page to show only its subpages.')
})
}), allowConvertToLinks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
style: {
gridColumn: '1 / -1'
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: convertDescription
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "primary",
accessibleWhenDisabled: true,
disabled: !hasResolvedPages,
onClick: convertToNavigationLinks,
children: (0,external_wp_i18n_namespaceObject.__)('Edit')
})]
})]
})
}), allowConvertToLinks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__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, {
title: (0,external_wp_i18n_namespaceObject.__)('Edit'),
onClick: openModal,
children: (0,external_wp_i18n_namespaceObject.__)('Edit')
})
}), isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToLinksModal, {
onClick: convertToNavigationLinks,
onClose: closeModal,
disabled: !hasResolvedPages
})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContent, {
blockProps: blockProps,
innerBlocksProps: innerBlocksProps,
hasResolvedPages: hasResolvedPages,
blockList: blockList,
pages: pages,
parentPageID: parentPageID
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/page-list/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const page_list_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/page-list",
title: "Page List",
category: "widgets",
allowedBlocks: ["core/page-list-item"],
description: "Display a list of all pages.",
keywords: ["menu", "navigation"],
textdomain: "default",
attributes: {
parentPageID: {
type: "integer",
"default": 0
},
isNested: {
type: "boolean",
"default": false
}
},
usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"],
supports: {
reusable: false,
html: false,
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
color: {
text: true,
background: true,
link: true,
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
},
spacing: {
padding: true,
margin: true,
__experimentalDefaultControls: {
padding: false,
margin: false
}
}
},
editorStyle: "wp-block-page-list-editor",
style: "wp-block-page-list"
};
const {
name: page_list_name
} = page_list_metadata;
const page_list_settings = {
icon: library_pages,
example: {},
edit: PageListEdit
};
const page_list_init = () => initBlock({
name: page_list_name,
metadata: page_list_metadata,
settings: page_list_settings
});
;// ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js
/**
* WordPress dependencies
*/
const icons_ItemSubmenuIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
width: "12",
height: "12",
viewBox: "0 0 12 12",
fill: "none",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M1.50002 4L6.00002 8L10.5 4",
strokeWidth: "1.5"
})
});
;// ./node_modules/@wordpress/block-library/build-module/page-list-item/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function useFrontPageId() {
return (0,external_wp_data_namespaceObject.useSelect)(select => {
const canReadSettings = select(external_wp_coreData_namespaceObject.store).canUser('read', {
kind: 'root',
name: 'site'
});
if (!canReadSettings) {
return undefined;
}
const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site');
return site?.show_on_front === 'page' && site?.page_on_front;
}, []);
}
function PageListItemEdit({
context,
attributes
}) {
const {
id,
label,
link,
hasChildren,
title
} = attributes;
const isNavigationChild = 'showSubmenuIcon' in context;
const frontPageId = useFrontPageId();
const innerBlocksColors = getColors(context, true);
const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(navigationChildBlockProps, {
className: 'wp-block-pages-list__item'
});
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
className: dist_clsx('wp-block-pages-list__item', {
'has-child': hasChildren,
'wp-block-navigation-item': isNavigationChild,
'open-on-click': context.openSubmenusOnClick,
'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon,
'menu-item-home': id === frontPageId
}),
children: [hasChildren && context.openSubmenusOnClick ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
type: "button",
className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle",
"aria-expanded": "false",
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(label)
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_ItemSubmenuIcon, {})
})]
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
className: dist_clsx('wp-block-pages-list__item__link', {
'wp-block-navigation-item__content': isNavigationChild
}),
href: link,
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)
}), hasChildren && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [!context.openSubmenusOnClick && context.showSubmenuIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",
"aria-expanded": "false",
type: "button",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_ItemSubmenuIcon, {})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
...innerBlocksProps
})]
})]
}, id);
}
;// ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const page_list_item_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/page-list-item",
title: "Page List Item",
category: "widgets",
parent: ["core/page-list"],
description: "Displays a page inside a list of all pages.",
keywords: ["page", "menu", "navigation"],
textdomain: "default",
attributes: {
id: {
type: "number"
},
label: {
type: "string"
},
title: {
type: "string"
},
link: {
type: "string"
},
hasChildren: {
type: "boolean"
}
},
usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"],
supports: {
reusable: false,
html: false,
lock: false,
inserter: false,
__experimentalToolbar: false,
interactivity: {
clientNavigation: true
}
},
editorStyle: "wp-block-page-list-editor",
style: "wp-block-page-list"
};
const {
name: page_list_item_name
} = page_list_item_metadata;
const page_list_item_settings = {
__experimentalLabel: ({
label
}) => label,
icon: library_page,
example: {},
edit: PageListItemEdit
};
const page_list_item_init = () => initBlock({
name: page_list_item_name,
metadata: page_list_item_metadata,
settings: page_list_item_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/paragraph.js
/**
* WordPress dependencies
*/
const paragraph = /*#__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: "m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"
})
});
/* harmony default export */ const library_paragraph = (paragraph);
;// ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const deprecated_supports = {
className: false
};
const paragraph_deprecated_blockAttributes = {
align: {
type: 'string'
},
content: {
type: 'string',
source: 'html',
selector: 'p',
default: ''
},
dropCap: {
type: 'boolean',
default: false
},
placeholder: {
type: 'string'
},
textColor: {
type: 'string'
},
backgroundColor: {
type: 'string'
},
fontSize: {
type: 'string'
},
direction: {
type: 'string',
enum: ['ltr', 'rtl']
},
style: {
type: 'object'
}
};
const migrateCustomColorsAndFontSizes = attributes => {
if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) {
return attributes;
}
const style = {};
if (attributes.customTextColor || attributes.customBackgroundColor) {
style.color = {};
}
if (attributes.customTextColor) {
style.color.text = attributes.customTextColor;
}
if (attributes.customBackgroundColor) {
style.color.background = attributes.customBackgroundColor;
}
if (attributes.customFontSize) {
style.typography = {
fontSize: attributes.customFontSize
};
}
const {
customTextColor,
customBackgroundColor,
customFontSize,
...restAttributes
} = attributes;
return {
...restAttributes,
style
};
};
const {
style,
...restBlockAttributes
} = paragraph_deprecated_blockAttributes;
const paragraph_deprecated_deprecated = [
// Version without drop cap on aligned text.
{
supports: deprecated_supports,
attributes: {
...restBlockAttributes,
customTextColor: {
type: 'string'
},
customBackgroundColor: {
type: 'string'
},
customFontSize: {
type: 'number'
}
},
save({
attributes
}) {
const {
align,
content,
dropCap,
direction
} = attributes;
const className = dist_clsx({
'has-drop-cap': align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap,
[`has-text-align-${align}`]: align
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className,
dir: direction
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: content
})
});
}
}, {
supports: deprecated_supports,
attributes: {
...restBlockAttributes,
customTextColor: {
type: 'string'
},
customBackgroundColor: {
type: 'string'
},
customFontSize: {
type: 'number'
}
},
migrate: migrateCustomColorsAndFontSizes,
save({
attributes
}) {
const {
align,
content,
dropCap,
backgroundColor,
textColor,
customBackgroundColor,
customTextColor,
fontSize,
customFontSize,
direction
} = attributes;
const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
const className = dist_clsx({
'has-text-color': textColor || customTextColor,
'has-background': backgroundColor || customBackgroundColor,
'has-drop-cap': dropCap,
[`has-text-align-${align}`]: align,
[fontSizeClass]: fontSizeClass,
[textClass]: textClass,
[backgroundClass]: backgroundClass
});
const styles = {
backgroundColor: backgroundClass ? undefined : customBackgroundColor,
color: textClass ? undefined : customTextColor,
fontSize: fontSizeClass ? undefined : customFontSize
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "p",
style: styles,
className: className ? className : undefined,
value: content,
dir: direction
});
}
}, {
supports: deprecated_supports,
attributes: {
...restBlockAttributes,
customTextColor: {
type: 'string'
},
customBackgroundColor: {
type: 'string'
},
customFontSize: {
type: 'number'
}
},
migrate: migrateCustomColorsAndFontSizes,
save({
attributes
}) {
const {
align,
content,
dropCap,
backgroundColor,
textColor,
customBackgroundColor,
customTextColor,
fontSize,
customFontSize,
direction
} = attributes;
const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
const className = dist_clsx({
'has-text-color': textColor || customTextColor,
'has-background': backgroundColor || customBackgroundColor,
'has-drop-cap': dropCap,
[fontSizeClass]: fontSizeClass,
[textClass]: textClass,
[backgroundClass]: backgroundClass
});
const styles = {
backgroundColor: backgroundClass ? undefined : customBackgroundColor,
color: textClass ? undefined : customTextColor,
fontSize: fontSizeClass ? undefined : customFontSize,
textAlign: align
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "p",
style: styles,
className: className ? className : undefined,
value: content,
dir: direction
});
}
}, {
supports: deprecated_supports,
attributes: {
...restBlockAttributes,
customTextColor: {
type: 'string'
},
customBackgroundColor: {
type: 'string'
},
customFontSize: {
type: 'number'
},
width: {
type: 'string'
}
},
migrate: migrateCustomColorsAndFontSizes,
save({
attributes
}) {
const {
width,
align,
content,
dropCap,
backgroundColor,
textColor,
customBackgroundColor,
customTextColor,
fontSize,
customFontSize
} = attributes;
const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
const fontSizeClass = fontSize && `is-${fontSize}-text`;
const className = dist_clsx({
[`align${width}`]: width,
'has-background': backgroundColor || customBackgroundColor,
'has-drop-cap': dropCap,
[fontSizeClass]: fontSizeClass,
[textClass]: textClass,
[backgroundClass]: backgroundClass
});
const styles = {
backgroundColor: backgroundClass ? undefined : customBackgroundColor,
color: textClass ? undefined : customTextColor,
fontSize: fontSizeClass ? undefined : customFontSize,
textAlign: align
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "p",
style: styles,
className: className ? className : undefined,
value: content
});
}
}, {
supports: deprecated_supports,
attributes: {
...restBlockAttributes,
fontSize: {
type: 'number'
}
},
save({
attributes
}) {
const {
width,
align,
content,
dropCap,
backgroundColor,
textColor,
fontSize
} = attributes;
const className = dist_clsx({
[`align${width}`]: width,
'has-background': backgroundColor,
'has-drop-cap': dropCap
});
const styles = {
backgroundColor,
color: textColor,
fontSize,
textAlign: align
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
style: styles,
className: className ? className : undefined,
children: content
});
},
migrate(attributes) {
return migrateCustomColorsAndFontSizes({
...attributes,
customFontSize: Number.isFinite(attributes.fontSize) ? attributes.fontSize : undefined,
customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined
});
}
}, {
supports: deprecated_supports,
attributes: {
...paragraph_deprecated_blockAttributes,
content: {
type: 'string',
source: 'html',
default: ''
}
},
save({
attributes
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
children: attributes.content
});
},
migrate(attributes) {
return attributes;
}
}];
/* harmony default export */ const paragraph_deprecated = (paragraph_deprecated_deprecated);
;// ./node_modules/@wordpress/icons/build-module/library/format-ltr.js
/**
* WordPress dependencies
*/
const formatLtr = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"
})
});
/* harmony default export */ const format_ltr = (formatLtr);
;// ./node_modules/@wordpress/block-library/build-module/paragraph/use-enter.js
/**
* WordPress dependencies
*/
function useOnEnter(props) {
const {
batch
} = (0,external_wp_data_namespaceObject.useRegistry)();
const {
moveBlocksToPosition,
replaceInnerBlocks,
duplicateBlocks,
insertBlock
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const {
getBlockRootClientId,
getBlockIndex,
getBlockOrder,
getBlockName,
getBlock,
getNextBlockClientId,
canInsertBlockType
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const propsRef = (0,external_wp_element_namespaceObject.useRef)(props);
propsRef.current = props;
return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
function onKeyDown(event) {
if (event.defaultPrevented) {
return;
}
if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
return;
}
const {
content,
clientId
} = propsRef.current;
// The paragraph should be empty.
if (content.length) {
return;
}
const wrapperClientId = getBlockRootClientId(clientId);
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(wrapperClientId), '__experimentalOnEnter', false)) {
return;
}
const order = getBlockOrder(wrapperClientId);
const position = order.indexOf(clientId);
// If it is the last block, exit.
if (position === order.length - 1) {
let newWrapperClientId = wrapperClientId;
while (!canInsertBlockType(getBlockName(clientId), getBlockRootClientId(newWrapperClientId))) {
newWrapperClientId = getBlockRootClientId(newWrapperClientId);
}
if (typeof newWrapperClientId === 'string') {
event.preventDefault();
moveBlocksToPosition([clientId], wrapperClientId, getBlockRootClientId(newWrapperClientId), getBlockIndex(newWrapperClientId) + 1);
}
return;
}
const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
if (!canInsertBlockType(defaultBlockName, getBlockRootClientId(wrapperClientId))) {
return;
}
event.preventDefault();
// If it is in the middle, split the block in two.
const wrapperBlock = getBlock(wrapperClientId);
batch(() => {
duplicateBlocks([wrapperClientId]);
const blockIndex = getBlockIndex(wrapperClientId);
replaceInnerBlocks(wrapperClientId, wrapperBlock.innerBlocks.slice(0, position));
replaceInnerBlocks(getNextBlockClientId(wrapperClientId), wrapperBlock.innerBlocks.slice(position + 1));
insertBlock((0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName), blockIndex + 1, getBlockRootClientId(wrapperClientId), true);
});
}
element.addEventListener('keydown', onKeyDown);
return () => {
element.removeEventListener('keydown', onKeyDown);
};
}, []);
}
;// ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ParagraphRTLControl({
direction,
setDirection
}) {
return (0,external_wp_i18n_namespaceObject.isRTL)() && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
icon: format_ltr,
title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'),
isActive: direction === 'ltr',
onClick: () => {
setDirection(direction === 'ltr' ? undefined : 'ltr');
}
});
}
function hasDropCapDisabled(align) {
return align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center';
}
function DropCapControl({
clientId,
attributes,
setAttributes,
name
}) {
// Please do not add a useSelect call to the paragraph block unconditionally.
// Every useSelect added to a (frequently used) block will degrade load
// and type performance. By moving it within InspectorControls, the subscription is
// now only added for the selected block(s).
const [isDropCapFeatureEnabled] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.dropCap');
if (!isDropCapFeatureEnabled) {
return null;
}
const {
align,
dropCap
} = attributes;
let helpText;
if (hasDropCapDisabled(align)) {
helpText = (0,external_wp_i18n_namespaceObject.__)('Not available for aligned text.');
} else if (dropCap) {
helpText = (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.');
} else {
helpText = (0,external_wp_i18n_namespaceObject.__)('Show a large initial letter.');
}
const isDropCapControlEnabledByDefault = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'typography.defaultControls.dropCap', false);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "typography",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!dropCap,
label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
isShownByDefault: isDropCapControlEnabledByDefault,
onDeselect: () => setAttributes({
dropCap: undefined
}),
resetAllFilter: () => ({
dropCap: undefined
}),
panelId: clientId,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
checked: !!dropCap,
onChange: () => setAttributes({
dropCap: !dropCap
}),
help: helpText,
disabled: hasDropCapDisabled(align)
})
})
});
}
function ParagraphBlock({
attributes,
mergeBlocks,
onReplace,
onRemove,
setAttributes,
clientId,
isSelected: isSingleSelected,
name
}) {
const {
align,
content,
direction,
dropCap,
placeholder
} = attributes;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref: useOnEnter({
clientId,
content
}),
className: dist_clsx({
'has-drop-cap': hasDropCapDisabled(align) ? false : dropCap,
[`has-text-align-${align}`]: align
}),
style: {
direction
}
});
const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: align,
onChange: newAlign => setAttributes({
align: newAlign,
dropCap: hasDropCapDisabled(newAlign) ? false : dropCap
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ParagraphRTLControl, {
direction: direction,
setDirection: newDirection => setAttributes({
direction: newDirection
})
})]
}), isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropCapControl, {
name: name,
clientId: clientId,
attributes: attributes,
setAttributes: setAttributes
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "content",
tagName: "p",
...blockProps,
value: content,
onChange: newContent => setAttributes({
content: newContent
}),
onMerge: mergeBlocks,
onReplace: onReplace,
onRemove: onRemove,
"aria-label": external_wp_blockEditor_namespaceObject.RichText.isEmpty(content) ? (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block') : (0,external_wp_i18n_namespaceObject.__)('Block: Paragraph'),
"data-empty": external_wp_blockEditor_namespaceObject.RichText.isEmpty(content),
placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'),
"data-custom-placeholder": placeholder ? true : undefined,
__unstableEmbedURLOnPaste: true,
__unstableAllowPrefixTransformations: true
})]
});
}
/* harmony default export */ const paragraph_edit = (ParagraphBlock);
;// ./node_modules/@wordpress/block-library/build-module/paragraph/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function paragraph_save_save({
attributes
}) {
const {
align,
content,
dropCap,
direction
} = attributes;
const className = dist_clsx({
'has-drop-cap': align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap,
[`has-text-align-${align}`]: align
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className,
dir: direction
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: content
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
name: transforms_name
} = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/paragraph",
title: "Paragraph",
category: "text",
description: "Start with the basic building block of all narrative.",
keywords: ["text"],
textdomain: "default",
attributes: {
align: {
type: "string"
},
content: {
type: "rich-text",
source: "rich-text",
selector: "p",
role: "content"
},
dropCap: {
type: "boolean",
"default": false
},
placeholder: {
type: "string"
},
direction: {
type: "string",
"enum": ["ltr", "rtl"]
}
},
supports: {
splitting: true,
anchor: true,
className: false,
__experimentalBorder: {
color: true,
radius: true,
style: true,
width: true
},
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
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
}
},
__experimentalSelector: "p",
__unstablePasteTextInline: true,
interactivity: {
clientNavigation: true
}
},
editorStyle: "wp-block-paragraph-editor",
style: "wp-block-paragraph"
};
const paragraph_transforms_transforms = {
from: [{
type: 'raw',
// Paragraph is a fallback and should be matched last.
priority: 20,
selector: 'p',
schema: ({
phrasingContentSchema,
isPaste
}) => ({
p: {
children: phrasingContentSchema,
attributes: isPaste ? [] : ['style', 'id']
}
}),
transform(node) {
const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(transforms_name, node.outerHTML);
const {
textAlign
} = node.style || {};
if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
attributes.align = textAlign;
}
return (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, attributes);
}
}]
};
/* harmony default export */ const paragraph_transforms = (paragraph_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const paragraph_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/paragraph",
title: "Paragraph",
category: "text",
description: "Start with the basic building block of all narrative.",
keywords: ["text"],
textdomain: "default",
attributes: {
align: {
type: "string"
},
content: {
type: "rich-text",
source: "rich-text",
selector: "p",
role: "content"
},
dropCap: {
type: "boolean",
"default": false
},
placeholder: {
type: "string"
},
direction: {
type: "string",
"enum": ["ltr", "rtl"]
}
},
supports: {
splitting: true,
anchor: true,
className: false,
__experimentalBorder: {
color: true,
radius: true,
style: true,
width: true
},
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
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
}
},
__experimentalSelector: "p",
__unstablePasteTextInline: true,
interactivity: {
clientNavigation: true
}
},
editorStyle: "wp-block-paragraph-editor",
style: "wp-block-paragraph"
};
const {
name: paragraph_name
} = paragraph_metadata;
const paragraph_settings = {
icon: library_paragraph,
example: {
attributes: {
content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.')
}
},
__experimentalLabel(attributes, {
context
}) {
const customName = attributes?.metadata?.name;
if (context === 'list-view' && customName) {
return customName;
}
if (context === 'accessibility') {
if (customName) {
return customName;
}
const {
content
} = attributes;
return !content || content.length === 0 ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content;
}
},
transforms: paragraph_transforms,
deprecated: paragraph_deprecated,
merge(attributes, attributesToMerge) {
return {
content: (attributes.content || '') + (attributesToMerge.content || '')
};
},
edit: paragraph_edit,
save: paragraph_save_save
};
const paragraph_init = () => initBlock({
name: paragraph_name,
metadata: paragraph_metadata,
settings: paragraph_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/post-author.js
/**
* WordPress dependencies
*/
const postAuthor = /*#__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: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",
fillRule: "evenodd",
clipRule: "evenodd"
})
});
/* harmony default export */ const post_author = (postAuthor);
;// ./node_modules/@wordpress/block-library/build-module/post-author/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const minimumUsersForCombobox = 25;
const edit_AUTHORS_QUERY = {
who: 'authors',
per_page: 100
};
function PostAuthorEdit({
isSelected,
context: {
postType,
postId,
queryId
},
attributes,
setAttributes
}) {
const isDescendentOfQueryLoop = Number.isFinite(queryId);
const {
authorId,
authorDetails,
authors,
supportsAuthor
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getPostType$supports;
const {
getEditedEntityRecord,
getUser,
getUsers,
getPostType
} = select(external_wp_coreData_namespaceObject.store);
const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
return {
authorId: _authorId,
authorDetails: _authorId ? getUser(_authorId) : null,
authors: getUsers(edit_AUTHORS_QUERY),
supportsAuthor: (_getPostType$supports = getPostType(postType)?.supports?.author) !== null && _getPostType$supports !== void 0 ? _getPostType$supports : false
};
}, [postType, postId]);
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const {
textAlign,
showAvatar,
showBio,
byline,
isLink,
linkTarget
} = attributes;
const avatarSizes = [];
const authorName = authorDetails?.name || (0,external_wp_i18n_namespaceObject.__)('Post Author');
if (authorDetails?.avatar_urls) {
Object.keys(authorDetails.avatar_urls).forEach(size => {
avatarSizes.push({
value: size,
label: `${size} x ${size}`
});
});
}
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const authorOptions = authors?.length ? authors.map(({
id,
name
}) => {
return {
value: id,
label: name
};
}) : [];
const handleSelect = nextAuthorId => {
editEntityRecord('postType', postType, postId, {
author: nextAuthorId
});
};
const showCombobox = authorOptions.length >= minimumUsersForCombobox;
const showAuthorControl = !!postId && !isDescendentOfQueryLoop && authorOptions.length > 0;
if (!supportsAuthor && postType !== undefined) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "post".
(0,external_wp_i18n_namespaceObject.__)('This post type (%s) does not support the author.'), postType)
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
title: (0,external_wp_i18n_namespaceObject.__)('Settings'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 4,
className: "wp-block-post-author__inspector-settings",
children: [showAuthorControl && (showCombobox && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Author'),
options: authorOptions,
value: authorId,
onChange: handleSelect,
allowReset: false
}) || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Author'),
value: authorId,
options: authorOptions,
onChange: handleSelect
})), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'),
checked: showAvatar,
onChange: () => setAttributes({
showAvatar: !showAvatar
})
}), showAvatar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'),
value: attributes.avatarSize,
options: avatarSizes,
onChange: size => {
setAttributes({
avatarSize: Number(size)
});
}
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show bio'),
checked: showBio,
onChange: () => setAttributes({
showBio: !showBio
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Link author name to author page'),
checked: isLink,
onChange: () => setAttributes({
isLink: !isLink
})
}), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
onChange: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
})]
})
})
}), /*#__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.jsxs)("div", {
...blockProps,
children: [showAvatar && authorDetails?.avatar_urls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "wp-block-post-author__avatar",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
width: attributes.avatarSize,
src: authorDetails.avatar_urls[attributes.avatarSize],
alt: authorDetails.name
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "wp-block-post-author__content",
children: [(!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "byline",
className: "wp-block-post-author__byline",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'),
value: byline,
onChange: value => setAttributes({
byline: value
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "wp-block-post-author__name",
children: isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: "#post-author-pseudo-link",
onClick: event => event.preventDefault(),
children: authorName
}) : authorName
}), showBio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "wp-block-post-author__bio",
dangerouslySetInnerHTML: {
__html: authorDetails?.description
}
})]
})]
})]
});
}
/* harmony default export */ const post_author_edit = (PostAuthorEdit);
;// ./node_modules/@wordpress/block-library/build-module/post-author/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_author_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-author",
title: "Author",
category: "theme",
description: "Display post author details such as name, avatar, and bio.",
textdomain: "default",
attributes: {
textAlign: {
type: "string"
},
avatarSize: {
type: "number",
"default": 48
},
showAvatar: {
type: "boolean",
"default": true
},
showBio: {
type: "boolean"
},
byline: {
type: "string"
},
isLink: {
type: "boolean",
"default": false,
role: "content"
},
linkTarget: {
type: "string",
"default": "_self",
role: "content"
}
},
usesContext: ["postType", "postId", "queryId"],
supports: {
html: false,
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
color: {
gradients: true,
link: true,
__experimentalDuotone: ".wp-block-post-author__avatar img",
__experimentalDefaultControls: {
background: true,
text: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
editorStyle: "wp-block-post-author-editor",
style: "wp-block-post-author"
};
const {
name: post_author_name
} = post_author_metadata;
const post_author_settings = {
icon: post_author,
example: {
viewportWidth: 350,
attributes: {
showBio: true,
byline: (0,external_wp_i18n_namespaceObject.__)('Posted by')
}
},
edit: post_author_edit
};
const post_author_init = () => initBlock({
name: post_author_name,
metadata: post_author_metadata,
settings: post_author_settings
});
;// ./node_modules/@wordpress/block-library/build-module/post-author-name/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function PostAuthorNameEdit({
context: {
postType,
postId
},
attributes: {
textAlign,
isLink,
linkTarget
},
setAttributes
}) {
const {
authorName,
supportsAuthor
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getPostType$supports;
const {
getEditedEntityRecord,
getUser,
getPostType
} = select(external_wp_coreData_namespaceObject.store);
const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
return {
authorName: _authorId ? getUser(_authorId) : null,
supportsAuthor: (_getPostType$supports = getPostType(postType)?.supports?.author) !== null && _getPostType$supports !== void 0 ? _getPostType$supports : false
};
}, [postType, postId]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const displayName = authorName?.name || (0,external_wp_i18n_namespaceObject.__)('Author Name');
const displayAuthor = isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: "#author-pseudo-link",
onClick: event => event.preventDefault(),
className: "wp-block-post-author-name__link",
children: displayName
}) : displayName;
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
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)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
isLink: false,
linkTarget: '_self'
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Link to author archive'),
isShownByDefault: true,
hasValue: () => isLink,
onDeselect: () => setAttributes({
isLink: false
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Link to author archive'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
})
}), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
isShownByDefault: true,
hasValue: () => linkTarget !== '_self',
onDeselect: () => setAttributes({
linkTarget: '_self'
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
onChange: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
})
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: !supportsAuthor && postType !== undefined ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "post".
(0,external_wp_i18n_namespaceObject.__)('This post type (%s) does not support the author.'), postType) : displayAuthor
})]
});
}
/* harmony default export */ const post_author_name_edit = (PostAuthorNameEdit);
;// ./node_modules/@wordpress/block-library/build-module/post-author-name/transforms.js
/**
* WordPress dependencies
*/
const post_author_name_transforms_transforms = {
from: [{
type: 'block',
blocks: ['core/post-author'],
transform: ({
textAlign
}) => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author-name', {
textAlign
})
}],
to: [{
type: 'block',
blocks: ['core/post-author'],
transform: ({
textAlign
}) => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author', {
textAlign
})
}]
};
/* harmony default export */ const post_author_name_transforms = (post_author_name_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_author_name_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-author-name",
title: "Author Name",
category: "theme",
description: "The author name.",
textdomain: "default",
attributes: {
textAlign: {
type: "string"
},
isLink: {
type: "boolean",
"default": false,
role: "content"
},
linkTarget: {
type: "string",
"default": "_self",
role: "content"
}
},
usesContext: ["postType", "postId"],
example: {
viewportWidth: 350
},
supports: {
html: false,
spacing: {
margin: true,
padding: true
},
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-post-author-name"
};
const {
name: post_author_name_name
} = post_author_name_metadata;
const post_author_name_settings = {
icon: post_author,
transforms: post_author_name_transforms,
edit: post_author_name_edit
};
const post_author_name_init = () => initBlock({
name: post_author_name_name,
metadata: post_author_name_metadata,
settings: post_author_name_settings
});
;// ./node_modules/@wordpress/block-library/build-module/post-author-biography/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function PostAuthorBiographyEdit({
context: {
postType,
postId
},
attributes: {
textAlign
},
setAttributes
}) {
const {
authorDetails
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEditedEntityRecord,
getUser
} = select(external_wp_coreData_namespaceObject.store);
const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
return {
authorDetails: _authorId ? getUser(_authorId) : null
};
}, [postType, postId]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const displayAuthorBiography = authorDetails?.description || (0,external_wp_i18n_namespaceObject.__)('Author Biography');
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,
dangerouslySetInnerHTML: {
__html: displayAuthorBiography
}
})]
});
}
/* harmony default export */ const post_author_biography_edit = (PostAuthorBiographyEdit);
;// ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_author_biography_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-author-biography",
title: "Author Biography",
category: "theme",
description: "The author biography.",
textdomain: "default",
attributes: {
textAlign: {
type: "string"
}
},
usesContext: ["postType", "postId"],
example: {
viewportWidth: 350
},
supports: {
spacing: {
margin: true,
padding: true
},
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-post-author-biography"
};
const {
name: post_author_biography_name
} = post_author_biography_metadata;
const post_author_biography_settings = {
icon: post_author,
edit: post_author_biography_edit
};
const post_author_biography_init = () => initBlock({
name: post_author_biography_name,
metadata: post_author_biography_metadata,
settings: post_author_biography_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/block-default.js
/**
* WordPress dependencies
*/
const blockDefault = /*#__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: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
})
});
/* harmony default export */ const block_default = (blockDefault);
;// ./node_modules/@wordpress/block-library/build-module/post-comment/edit.js
/**
* WordPress dependencies
*/
const post_comment_edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']];
function post_comment_edit_Edit({
attributes: {
commentId
},
setAttributes
}) {
const [commentIdInput, setCommentIdInput] = (0,external_wp_element_namespaceObject.useState)(commentId);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: post_comment_edit_TEMPLATE
});
if (!commentId) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, {
icon: block_default,
label: (0,external_wp_i18n_namespaceObject._x)('Post Comment', 'block title'),
instructions: (0,external_wp_i18n_namespaceObject.__)('To show a comment, input the comment ID.'),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
value: commentId,
onChange: val => setCommentIdInput(parseInt(val))
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "primary",
onClick: () => {
setAttributes({
commentId: commentIdInput
});
},
children: (0,external_wp_i18n_namespaceObject.__)('Save')
})]
})
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...innerBlocksProps
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-comment/save.js
/**
* WordPress dependencies
*/
function post_comment_save_save() {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...innerBlocksProps
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-comment/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_comment_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
__experimental: "fse",
name: "core/post-comment",
title: "Comment (deprecated)",
category: "theme",
allowedBlocks: ["core/avatar", "core/comment-author-name", "core/comment-content", "core/comment-date", "core/comment-edit-link", "core/comment-reply-link"],
description: "This block is deprecated. Please use the Comments block instead.",
textdomain: "default",
attributes: {
commentId: {
type: "number"
}
},
providesContext: {
commentId: "commentId"
},
supports: {
html: false,
inserter: false,
interactivity: {
clientNavigation: true
}
}
};
const {
name: post_comment_name
} = post_comment_metadata;
const post_comment_settings = {
icon: library_comment,
edit: post_comment_edit_Edit,
save: post_comment_save_save
};
const post_comment_init = () => initBlock({
name: post_comment_name,
metadata: post_comment_metadata,
settings: post_comment_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/post-comments-count.js
/**
* WordPress dependencies
*/
const postCommentsCount = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z"
})
});
/* harmony default export */ const post_comments_count = (postCommentsCount);
;// ./node_modules/@wordpress/block-library/build-module/post-comments-count/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function PostCommentsCountEdit({
attributes,
context,
setAttributes
}) {
const {
textAlign
} = attributes;
const {
postId
} = context;
const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!postId) {
return;
}
const currentPostId = postId;
external_wp_apiFetch_default()({
path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
post: postId
}),
parse: false
}).then(res => {
// Stale requests will have the `currentPostId` of an older closure.
if (currentPostId === postId) {
setCommentsCount(res.headers.get('X-WP-Total'));
}
});
}, [postId]);
const hasPostAndComments = postId && commentsCount !== undefined;
const blockStyles = {
...blockProps.style,
textDecoration: hasPostAndComments ? blockProps.style?.textDecoration : undefined
};
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,
style: blockStyles,
children: hasPostAndComments ? commentsCount : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Count block: post not found.')
})
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_comments_count_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
__experimental: "fse",
name: "core/post-comments-count",
title: "Comments Count",
category: "theme",
description: "Display a post's comments count.",
textdomain: "default",
attributes: {
textAlign: {
type: "string"
}
},
usesContext: ["postId"],
supports: {
html: false,
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
},
interactivity: {
clientNavigation: true
}
},
style: "wp-block-post-comments-count"
};
const {
name: post_comments_count_name
} = post_comments_count_metadata;
const post_comments_count_settings = {
icon: post_comments_count,
edit: PostCommentsCountEdit
};
const post_comments_count_init = () => initBlock({
name: post_comments_count_name,
metadata: post_comments_count_metadata,
settings: post_comments_count_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/post-comments-form.js
/**
* WordPress dependencies
*/
const postCommentsForm = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"
})
});
/* harmony default export */ const post_comments_form = (postCommentsForm);
;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function PostCommentsFormEdit({
attributes,
context,
setAttributes
}) {
const {
textAlign
} = attributes;
const {
postId,
postType
} = context;
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostCommentsFormEdit);
const instanceIdDesc = (0,external_wp_i18n_namespaceObject.sprintf)('comments-form-edit-%d-desc', instanceId);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
}),
'aria-describedby': instanceIdDesc
});
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.jsxs)("div", {
...blockProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_comments_form_form, {
postId: postId,
postType: postType
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
id: instanceIdDesc,
children: (0,external_wp_i18n_namespaceObject.__)('Comments form disabled in editor.')
})]
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_comments_form_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-comments-form",
title: "Comments Form",
category: "theme",
description: "Display a post's comments form.",
textdomain: "default",
attributes: {
textAlign: {
type: "string"
}
},
usesContext: ["postId", "postType"],
supports: {
html: false,
color: {
gradients: true,
heading: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalTextTransform: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
editorStyle: "wp-block-post-comments-form-editor",
style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"],
example: {
attributes: {
textAlign: "center"
}
}
};
const {
name: post_comments_form_name
} = post_comments_form_metadata;
const post_comments_form_settings = {
icon: post_comments_form,
edit: PostCommentsFormEdit
};
const post_comments_form_init = () => initBlock({
name: post_comments_form_name,
metadata: post_comments_form_metadata,
settings: post_comments_form_settings
});
;// ./node_modules/@wordpress/block-library/build-module/post-comments-link/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function PostCommentsLinkEdit({
context,
attributes,
setAttributes
}) {
const {
textAlign
} = attributes;
const {
postType,
postId
} = context;
const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!postId) {
return;
}
const currentPostId = postId;
external_wp_apiFetch_default()({
path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
post: postId
}),
parse: false
}).then(res => {
// Stale requests will have the `currentPostId` of an older closure.
if (currentPostId === postId) {
setCommentsCount(res.headers.get('X-WP-Total'));
}
});
}, [postId]);
const post = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId), [postType, postId]);
if (!post) {
return null;
}
const {
link
} = post;
let commentsText;
if (commentsCount !== undefined) {
const commentsNumber = parseInt(commentsCount);
if (commentsNumber === 0) {
commentsText = (0,external_wp_i18n_namespaceObject.__)('No comments');
} else {
commentsText = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Number of comments */
(0,external_wp_i18n_namespaceObject._n)('%s comment', '%s comments', commentsNumber), commentsNumber.toLocaleString());
}
}
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: link && commentsText !== undefined ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: link + '#comments',
onClick: event => event.preventDefault(),
children: commentsText
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Link block: post not found.')
})
})]
});
}
/* harmony default export */ const post_comments_link_edit = (PostCommentsLinkEdit);
;// ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_comments_link_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
__experimental: "fse",
name: "core/post-comments-link",
title: "Comments Link",
category: "theme",
description: "Displays the link to the current post comments.",
textdomain: "default",
usesContext: ["postType", "postId"],
attributes: {
textAlign: {
type: "string"
}
},
supports: {
html: false,
color: {
link: true,
text: false,
__experimentalDefaultControls: {
background: true,
link: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-post-comments-link"
};
const {
name: post_comments_link_name
} = post_comments_link_metadata;
const post_comments_link_settings = {
edit: post_comments_link_edit,
icon: post_comments_count
};
const post_comments_link_init = () => initBlock({
name: post_comments_link_name,
metadata: post_comments_link_metadata,
settings: post_comments_link_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/post-content.js
/**
* WordPress dependencies
*/
const postContent = /*#__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: "M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z"
})
});
/* harmony default export */ const post_content = (postContent);
;// ./node_modules/@wordpress/block-library/build-module/post-content/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ReadOnlyContent({
parentLayout,
layoutClassNames,
userCanEdit,
postType,
postId
}) {
const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: layoutClassNames
});
const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
return content?.raw ? (0,external_wp_blocks_namespaceObject.parse)(content.raw) : [];
}, [content?.raw]);
const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
blocks,
props: blockProps,
layout: parentLayout
});
if (userCanEdit) {
/*
* Rendering the block preview using the raw content blocks allows for
* block support styles to be generated and applied by the editor.
*
* The preview using the raw blocks can only be presented to users with
* edit permissions for the post to prevent potential exposure of private
* block content.
*/
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockPreviewProps
});
}
return content?.protected ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
children: (0,external_wp_i18n_namespaceObject.__)('This content is password protected.')
})
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
dangerouslySetInnerHTML: {
__html: content?.rendered
}
});
}
function EditableContent({
context = {}
}) {
const {
postType,
postId
} = context;
const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
id: postId
});
const entityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => {
return select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId);
}, [postType, postId]);
const hasInnerBlocks = !!entityRecord?.content?.raw || blocks?.length;
const initialInnerBlocks = [['core/paragraph']];
const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: 'entry-content'
}), {
value: blocks,
onInput,
onChange,
template: !hasInnerBlocks ? initialInnerBlocks : undefined
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...props
});
}
function Content(props) {
const {
context: {
queryId,
postType,
postId
} = {},
layoutClassNames
} = props;
const userCanEdit = useCanEditEntity('postType', postType, postId);
if (userCanEdit === undefined) {
return null;
}
const isDescendentOfQueryLoop = Number.isFinite(queryId);
const isEditable = userCanEdit && !isDescendentOfQueryLoop;
return isEditable ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditableContent, {
...props
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReadOnlyContent, {
parentLayout: props.parentLayout,
layoutClassNames: layoutClassNames,
userCanEdit: userCanEdit,
postType: postType,
postId: postId
});
}
function edit_Placeholder({
layoutClassNames
}) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: layoutClassNames
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...blockProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('This is the Content block, it will display all the blocks in any single post or page.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.')
})]
});
}
function RecursionError() {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...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.')
})
});
}
function PostContentEdit({
context,
__unstableLayoutClassNames: layoutClassNames,
__unstableParentLayout: parentLayout
}) {
const {
postId: contextPostId,
postType: contextPostType
} = context;
const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(contextPostId);
if (contextPostId && contextPostType && hasAlreadyRendered) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RecursionError, {});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RecursionProvider, {
uniqueId: contextPostId,
children: contextPostId && contextPostType ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Content, {
context: context,
parentLayout: parentLayout,
layoutClassNames: layoutClassNames
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_Placeholder, {
layoutClassNames: layoutClassNames
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-content/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_content_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-content",
title: "Content",
category: "theme",
description: "Displays the contents of a post or page.",
textdomain: "default",
usesContext: ["postId", "postType", "queryId"],
example: {
viewportWidth: 350
},
supports: {
align: ["wide", "full"],
html: false,
layout: true,
background: {
backgroundImage: true,
backgroundSize: true,
__experimentalDefaultControls: {
backgroundImage: true
}
},
dimensions: {
minHeight: true
},
spacing: {
blockGap: true,
padding: true,
margin: true,
__experimentalDefaultControls: {
margin: false,
padding: false
}
},
color: {
gradients: true,
heading: true,
link: true,
__experimentalDefaultControls: {
background: false,
text: false
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-post-content",
editorStyle: "wp-block-post-content-editor"
};
const {
name: post_content_name
} = post_content_metadata;
const post_content_settings = {
icon: post_content,
edit: PostContentEdit
};
const post_content_init = () => initBlock({
name: post_content_name,
metadata: post_content_metadata,
settings: post_content_settings
});
;// ./node_modules/@wordpress/block-library/build-module/post-date/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function PostDateEdit({
attributes: {
textAlign,
format,
isLink,
displayType
},
context: {
postId,
postType: postTypeSlug,
queryId
},
setAttributes
}) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign,
[`wp-block-post-date__modified-date`]: displayType === 'modified'
})
});
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
// Memoize popoverProps to avoid returning a new object every time.
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
anchor: popoverAnchor
}), [popoverAnchor]);
const isDescendentOfQueryLoop = Number.isFinite(queryId);
const dateSettings = (0,external_wp_date_namespaceObject.getSettings)();
const [siteFormat = dateSettings.formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
const [siteTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format');
const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, displayType, postId);
const postType = (0,external_wp_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]);
const dateLabel = displayType === 'date' ? (0,external_wp_i18n_namespaceObject.__)('Post Date') : (0,external_wp_i18n_namespaceObject.__)('Post Modified Date');
let postDate = date ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {
dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date),
ref: setPopoverAnchor,
children: format === 'human-diff' ? (0,external_wp_date_namespaceObject.humanTimeDiff)(date) : (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)
}) : dateLabel;
if (isLink && date) {
postDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: "#post-date-pseudo-link",
onClick: event => event.preventDefault(),
children: postDate
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(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
});
}
}), date && displayType === 'date' && !isDescendentOfQueryLoop && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: popoverProps,
renderContent: ({
onClose
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalPublishDateTimePicker, {
currentDate: date,
onChange: setDate,
is12Hour: is12HourFormat(siteTimeFormat),
onClose: onClose,
dateOrder: /* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */
(0,external_wp_i18n_namespaceObject._x)('dmy', 'date order')
}),
renderToggle: ({
isOpen,
onToggle
}) => {
const openOnArrowDown = event => {
if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
event.preventDefault();
onToggle();
}
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
"aria-expanded": isOpen,
icon: library_edit,
title: (0,external_wp_i18n_namespaceObject.__)('Change Date'),
onClick: onToggle,
onKeyDown: openOnArrowDown
});
}
})
})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
format: undefined,
isLink: false,
displayType: 'date'
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!format,
label: (0,external_wp_i18n_namespaceObject.__)('Date Format'),
onDeselect: () => setAttributes({
format: undefined
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
format: format,
defaultFormat: siteFormat,
onChange: nextFormat => setAttributes({
format: nextFormat
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => isLink !== false,
label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "post".
(0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
onDeselect: () => setAttributes({
isLink: false
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "post".
(0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => displayType !== 'date',
label: (0,external_wp_i18n_namespaceObject.__)('Display last modified date'),
onDeselect: () => setAttributes({
displayType: 'date'
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Display last modified date'),
onChange: value => setAttributes({
displayType: value ? 'modified' : 'date'
}),
checked: displayType === 'modified',
help: (0,external_wp_i18n_namespaceObject.__)('Only shows if the post has been modified')
})
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: postDate
})]
});
}
function is12HourFormat(format) {
// To know if the time format is a 12 hour time, look for any of the 12 hour
// format characters: 'a', 'A', 'g', and 'h'. The character must be
// unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I
// feel when working with regular expressions.
// https://www.php.net/manual/en/datetime.format.php
return /(?:^|[^\\])[aAgh]/.test(format);
}
;// ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js
/**
* Internal dependencies
*/
const post_date_deprecated_v1 = {
attributes: {
textAlign: {
type: 'string'
},
format: {
type: 'string'
},
isLink: {
type: 'boolean',
default: false
}
},
supports: {
html: false,
color: {
gradients: true,
link: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalLetterSpacing: true
}
},
save() {
return null;
},
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 post_date_deprecated = ([post_date_deprecated_v1]);
;// ./node_modules/@wordpress/block-library/build-module/post-date/variations.js
/**
* WordPress dependencies
*/
const post_date_variations_variations = [{
name: 'post-date-modified',
title: (0,external_wp_i18n_namespaceObject.__)('Modified Date'),
description: (0,external_wp_i18n_namespaceObject.__)("Display a post's last updated date."),
attributes: {
displayType: 'modified'
},
scope: ['block', 'inserter'],
isActive: blockAttributes => blockAttributes.displayType === 'modified',
icon: post_date
}];
/* harmony default export */ const post_date_variations = (post_date_variations_variations);
;// ./node_modules/@wordpress/block-library/build-module/post-date/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_date_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-date",
title: "Date",
category: "theme",
description: "Display the publish date for an entry such as a post or page.",
textdomain: "default",
attributes: {
textAlign: {
type: "string"
},
format: {
type: "string"
},
isLink: {
type: "boolean",
"default": false,
role: "content"
},
displayType: {
type: "string",
"default": "date"
}
},
usesContext: ["postId", "postType", "queryId"],
example: {
viewportWidth: 350
},
supports: {
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
}
};
const {
name: post_date_name
} = post_date_metadata;
const post_date_settings = {
icon: post_date,
edit: PostDateEdit,
deprecated: post_date_deprecated,
variations: post_date_variations
};
const post_date_init = () => initBlock({
name: post_date_name,
metadata: post_date_metadata,
settings: post_date_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js
/**
* WordPress dependencies
*/
const postExcerpt = /*#__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: "M8.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H4v-3h4.001ZM4 20h9v-1.5H4V20Zm16-4H4v-1.5h16V16ZM13.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H9v-3h4.001Z"
})
});
/* harmony default export */ const post_excerpt = (postExcerpt);
;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const ELLIPSIS = '…';
function PostExcerptEditor({
attributes: {
textAlign,
moreText,
showMoreOnNewLine,
excerptLength
},
setAttributes,
isSelected,
context: {
postId,
postType,
queryId
}
}) {
const isDescendentOfQueryLoop = Number.isFinite(queryId);
const userCanEdit = useCanEditEntity('postType', postType, postId);
const [rawExcerpt, setExcerpt, {
rendered: renderedExcerpt,
protected: isProtected
} = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
/**
* Check if the post type supports excerpts.
* Add an exception and return early for the "page" post type,
* which is registered without support for the excerpt UI,
* but supports saving the excerpt to the database.
* See: https://core.trac.wordpress.org/browser/branches/6.1/src/wp-includes/post.php#L65
* Without this exception, users that have excerpts saved to the database will
* not be able to edit the excerpts.
*/
const postTypeSupportsExcerpts = (0,external_wp_data_namespaceObject.useSelect)(select => {
if (postType === 'page') {
return true;
}
return !!select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.supports?.excerpt;
}, [postType]);
/**
* The excerpt is editable if:
* - The user can edit the post
* - It is not a descendent of a Query Loop block
* - The post type supports excerpts
*/
const isEditable = userCanEdit && !isDescendentOfQueryLoop && postTypeSupportsExcerpts;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
/**
* translators: If your word count is based on single characters (e.g. East Asian characters),
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
* Do not translate into your own language.
*/
const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!');
/**
* When excerpt is editable, strip the html tags from
* rendered excerpt. This will be used if the entity's
* excerpt has been produced from the content.
*/
const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!renderedExcerpt) {
return '';
}
const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html');
return document.body.textContent || document.body.innerText || '';
}, [renderedExcerpt]);
if (!postType || !postId) {
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: newAlign => setAttributes({
textAlign: newAlign
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('This block will display the excerpt.')
})
})]
});
}
if (isProtected && !userCanEdit) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
children: (0,external_wp_i18n_namespaceObject.__)('The content is currently protected and does not have the available excerpt.')
})
});
}
const readMoreLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "moreText",
className: "wp-block-post-excerpt__more-link",
tagName: "a",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'),
value: moreText,
onChange: newMoreText => setAttributes({
moreText: newMoreText
}),
withoutInteractiveFormatting: true
});
const excerptClassName = dist_clsx('wp-block-post-excerpt__excerpt', {
'is-inline': !showMoreOnNewLine
});
/**
* The excerpt length setting needs to be applied to both
* the raw and the rendered excerpt depending on which is being used.
*/
const rawOrRenderedExcerpt = (rawExcerpt || strippedRenderedExcerpt).trim();
let trimmedExcerpt = '';
if (wordCountType === 'words') {
trimmedExcerpt = rawOrRenderedExcerpt.split(' ', excerptLength).join(' ');
} else if (wordCountType === 'characters_excluding_spaces') {
/*
* 1. Split the excerpt at the character limit,
* then join the substrings back into one string.
* 2. Count the number of spaces in the excerpt
* by comparing the lengths of the string with and without spaces.
* 3. Add the number to the length of the visible excerpt,
* so that the spaces are excluded from the word count.
*/
const excerptWithSpaces = rawOrRenderedExcerpt.split('', excerptLength).join('');
const numberOfSpaces = excerptWithSpaces.length - excerptWithSpaces.replaceAll(' ', '').length;
trimmedExcerpt = rawOrRenderedExcerpt.split('', excerptLength + numberOfSpaces).join('');
} else if (wordCountType === 'characters_including_spaces') {
trimmedExcerpt = rawOrRenderedExcerpt.split('', excerptLength).join('');
}
const isTrimmed = trimmedExcerpt !== rawOrRenderedExcerpt;
const excerptContent = isEditable ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
className: excerptClassName,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Excerpt text'),
value: isSelected ? rawOrRenderedExcerpt : (!isTrimmed ? rawOrRenderedExcerpt : trimmedExcerpt + ELLIPSIS) || (0,external_wp_i18n_namespaceObject.__)('No excerpt found'),
onChange: setExcerpt,
tagName: "p"
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: excerptClassName,
children: !isTrimmed ? rawOrRenderedExcerpt || (0,external_wp_i18n_namespaceObject.__)('No excerpt found') : trimmedExcerpt + ELLIPSIS
});
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: newAlign => setAttributes({
textAlign: newAlign
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
showMoreOnNewLine: true,
excerptLength: 55
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => showMoreOnNewLine !== true,
label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'),
onDeselect: () => setAttributes({
showMoreOnNewLine: true
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'),
checked: showMoreOnNewLine,
onChange: newShowMoreOnNewLine => setAttributes({
showMoreOnNewLine: newShowMoreOnNewLine
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => excerptLength !== 55,
label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'),
onDeselect: () => setAttributes({
excerptLength: 55
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'),
value: excerptLength,
onChange: value => {
setAttributes({
excerptLength: value
});
},
min: "10",
max: "100"
})
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...blockProps,
children: [excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "wp-block-post-excerpt__more-text",
children: readMoreLink
}) : readMoreLink]
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/transforms.js
/**
* WordPress dependencies
*/
const post_excerpt_transforms_transforms = {
from: [{
type: 'block',
blocks: ['core/post-content'],
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-excerpt')
}],
to: [{
type: 'block',
blocks: ['core/post-content'],
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content')
}]
};
/* harmony default export */ const post_excerpt_transforms = (post_excerpt_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_excerpt_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-excerpt",
title: "Excerpt",
category: "theme",
description: "Display the excerpt.",
textdomain: "default",
attributes: {
textAlign: {
type: "string"
},
moreText: {
type: "string"
},
showMoreOnNewLine: {
type: "boolean",
"default": true
},
excerptLength: {
type: "number",
"default": 55
}
},
usesContext: ["postId", "postType", "queryId"],
example: {
viewportWidth: 350
},
supports: {
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
editorStyle: "wp-block-post-excerpt-editor",
style: "wp-block-post-excerpt"
};
const {
name: post_excerpt_name
} = post_excerpt_metadata;
const post_excerpt_settings = {
icon: post_excerpt,
transforms: post_excerpt_transforms,
edit: PostExcerptEditor
};
const post_excerpt_init = () => initBlock({
name: post_excerpt_name,
metadata: post_excerpt_metadata,
settings: post_excerpt_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js
/**
* WordPress dependencies
*/
const postFeaturedImage = /*#__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: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"
})
});
/* harmony default export */ const post_featured_image = (postFeaturedImage);
;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js
/**
* WordPress dependencies
*/
const SCALE_OPTIONS = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "cover",
label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "contain",
label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "fill",
label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control')
})]
});
const DEFAULT_SCALE = 'cover';
const scaleHelp = {
cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'),
contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'),
fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.')
};
const DimensionControls = ({
clientId,
attributes: {
aspectRatio,
width,
height,
scale
},
setAttributes
}) => {
const [availableUnits, defaultRatios, themeRatios, showDefaultRatios] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units', 'dimensions.aspectRatios.default', 'dimensions.aspectRatios.theme', 'dimensions.defaultAspectRatios');
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || ['px', '%', 'vw', 'em', 'rem']
});
const onDimensionChange = (dimension, nextValue) => {
const parsedValue = parseFloat(nextValue);
/**
* If we have no value set and we change the unit,
* we don't want to set the attribute, as it would
* end up having the unit as value without any number.
*/
if (isNaN(parsedValue) && nextValue) {
return;
}
setAttributes({
[dimension]: parsedValue < 0 ? '0' : nextValue
});
};
const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options');
const showScaleControl = height || aspectRatio && aspectRatio !== 'auto';
const themeOptions = themeRatios?.map(({
name,
ratio
}) => ({
label: name,
value: ratio
}));
const defaultOptions = defaultRatios?.map(({
name,
ratio
}) => ({
label: name,
value: ratio
}));
const aspectRatioOptions = [{
label: (0,external_wp_i18n_namespaceObject._x)('Original', 'Aspect ratio option for dimensions control'),
value: 'auto'
}, ...(showDefaultRatios ? defaultOptions : []), ...(themeOptions ? themeOptions : [])];
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!aspectRatio,
label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'),
onDeselect: () => setAttributes({
aspectRatio: undefined
}),
resetAllFilter: () => ({
aspectRatio: undefined
}),
isShownByDefault: true,
panelId: clientId,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'),
value: aspectRatio,
options: aspectRatioOptions,
onChange: nextAspectRatio => setAttributes({
aspectRatio: nextAspectRatio
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
className: "single-column",
hasValue: () => !!height,
label: (0,external_wp_i18n_namespaceObject.__)('Height'),
onDeselect: () => setAttributes({
height: undefined
}),
resetAllFilter: () => ({
height: undefined
}),
isShownByDefault: true,
panelId: clientId,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Height'),
labelPosition: "top",
value: height || '',
min: 0,
onChange: nextHeight => onDimensionChange('height', nextHeight),
units: units
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
className: "single-column",
hasValue: () => !!width,
label: (0,external_wp_i18n_namespaceObject.__)('Width'),
onDeselect: () => setAttributes({
width: undefined
}),
resetAllFilter: () => ({
width: undefined
}),
isShownByDefault: true,
panelId: clientId,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Width'),
labelPosition: "top",
value: width || '',
min: 0,
onChange: nextWidth => onDimensionChange('width', nextWidth),
units: units
})
}), showScaleControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!scale && scale !== DEFAULT_SCALE,
label: scaleLabel,
onDeselect: () => setAttributes({
scale: DEFAULT_SCALE
}),
resetAllFilter: () => ({
scale: DEFAULT_SCALE
}),
isShownByDefault: true,
panelId: clientId,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: scaleLabel,
value: scale,
help: scaleHelp[scale],
onChange: value => setAttributes({
scale: value
}),
isBlock: true,
children: SCALE_OPTIONS
})
})]
});
};
/* harmony default export */ const dimension_controls = (DimensionControls);
;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/overlay-controls.js
/**
* WordPress dependencies
*/
const Overlay = ({
clientId,
attributes,
setAttributes,
overlayColor,
setOverlayColor
}) => {
const {
dimRatio
} = attributes;
const {
gradientValue,
setGradient
} = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
if (!colorGradientSettings.hasColorsOrGradients) {
return null;
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, {
__experimentalIsRenderedInSidebar: true,
settings: [{
colorValue: overlayColor.color,
gradientValue,
label: (0,external_wp_i18n_namespaceObject.__)('Overlay'),
onColorChange: setOverlayColor,
onGradientChange: setGradient,
isShownByDefault: true,
resetAllFilter: () => ({
overlayColor: undefined,
customOverlayColor: undefined,
gradient: undefined,
customGradient: undefined
}),
clearable: true
}],
panelId: clientId,
...colorGradientSettings
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => dimRatio !== undefined,
label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'),
onDeselect: () => setAttributes({
dimRatio: 0
}),
resetAllFilter: () => ({
dimRatio: 0
}),
isShownByDefault: true,
panelId: clientId,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'),
value: dimRatio,
onChange: newDimRatio => setAttributes({
dimRatio: newDimRatio
}),
min: 0,
max: 100,
step: 10,
required: true,
__next40pxDefaultSize: true
})
})]
});
};
/* harmony default export */ const overlay_controls = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({
overlayColor: 'background-color'
})])(Overlay));
;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/utils.js
/**
* Generates the opacity/dim class based on given number.
*
* @param {number} ratio Dim/opacity number.
*
* @return {string} Generated class.
*/
function utils_dimRatioToClass(ratio) {
return ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
}
;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/overlay.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const overlay_Overlay = ({
attributes,
overlayColor
}) => {
const {
dimRatio
} = attributes;
const {
gradientClass,
gradientValue
} = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
const overlayStyles = {
backgroundColor: overlayColor.color,
backgroundImage: gradientValue,
...borderProps.style
};
if (!colorGradientSettings.hasColorsOrGradients || !dimRatio) {
return null;
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
"aria-hidden": "true",
className: dist_clsx('wp-block-post-featured-image__overlay', utils_dimRatioToClass(dimRatio), {
[overlayColor.class]: overlayColor.class,
'has-background-dim': dimRatio !== undefined,
'has-background-gradient': gradientValue,
[gradientClass]: gradientClass
}, borderProps.className),
style: overlayStyles
});
};
/* harmony default export */ const overlay = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({
overlayColor: 'background-color'
})])(overlay_Overlay));
;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image'];
const {
ResolutionTool: post_featured_image_edit_ResolutionTool
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const edit_DEFAULT_MEDIA_SIZE_SLUG = 'full';
function FeaturedImageResolutionTool({
image,
value,
onChange
}) {
const {
imageSizes
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
return {
imageSizes: getSettings().imageSizes
};
}, []);
if (!imageSizes?.length) {
return null;
}
const imageSizeOptions = imageSizes.filter(({
slug
}) => image?.media_details?.sizes?.[slug]?.source_url).map(({
name,
slug
}) => ({
value: slug,
label: name
}));
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_edit_ResolutionTool, {
value: value,
defaultValue: edit_DEFAULT_MEDIA_SIZE_SLUG,
options: imageSizeOptions,
onChange: onChange
});
}
function PostFeaturedImageEdit({
clientId,
attributes,
setAttributes,
context: {
postId,
postType: postTypeSlug,
queryId
}
}) {
const isDescendentOfQueryLoop = Number.isFinite(queryId);
const {
isLink,
aspectRatio,
height,
width,
scale,
sizeSlug,
rel,
linkTarget,
useFirstImageFromPost
} = attributes;
const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)();
const [storedFeaturedImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId);
// Fallback to post content if no featured image is set.
// This is needed for the "Use first image from post" option.
const [postContent] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'content', postId);
const featuredImage = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (storedFeaturedImage) {
return storedFeaturedImage;
}
if (!useFirstImageFromPost) {
return;
}
const imageOpener = /).)*)?}\s+)?-->/.exec(postContent);
const imageId = imageOpener?.groups?.attrs && JSON.parse(imageOpener.groups.attrs)?.id;
return imageId;
}, [storedFeaturedImage, useFirstImageFromPost, postContent]);
const {
media,
postType,
postPermalink
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getMedia,
getPostType,
getEditedEntityRecord
} = select(external_wp_coreData_namespaceObject.store);
return {
media: featuredImage && getMedia(featuredImage, {
context: 'view'
}),
postType: postTypeSlug && getPostType(postTypeSlug),
postPermalink: getEditedEntityRecord('postType', postTypeSlug, postId)?.link
};
}, [featuredImage, postTypeSlug, postId]);
const mediaUrl = media?.media_details?.sizes?.[sizeSlug]?.source_url || media?.source_url;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
style: {
width,
height,
aspectRatio
},
className: dist_clsx({
'is-transient': temporaryURL
})
});
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes);
const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
const placeholder = content => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
className: dist_clsx('block-editor-media-placeholder', borderProps.className),
withIllustration: true,
style: {
height: !!aspectRatio && '100%',
width: !!aspectRatio && '100%',
...borderProps.style,
...shadowProps.style
},
children: content
});
};
const onSelectImage = value => {
if (value?.id) {
setFeaturedImage(value.id);
}
if (value?.url && (0,external_wp_blob_namespaceObject.isBlobURL)(value.url)) {
setTemporaryURL(value.url);
}
};
// Reset temporary url when media is available.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (mediaUrl && temporaryURL) {
setTemporaryURL();
}
}, [mediaUrl, temporaryURL]);
const {
createErrorNotice
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onUploadError = message => {
createErrorNotice(message, {
type: 'snackbar'
});
setTemporaryURL();
};
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const controls = blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "color",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay_controls, {
attributes: attributes,
setAttributes: setAttributes,
clientId: clientId
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "dimensions",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dimension_controls, {
clientId: clientId,
attributes: attributes,
setAttributes: setAttributes,
media: media
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
isLink: false,
linkTarget: '_self',
rel: ''
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "post".
(0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
isShownByDefault: true,
hasValue: () => !!isLink,
onDeselect: () => setAttributes({
isLink: false
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Name of the post type e.g: "post".
(0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
})
}), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
isShownByDefault: true,
hasValue: () => '_self' !== linkTarget,
onDeselect: () => setAttributes({
linkTarget: '_self'
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
onChange: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
})
}), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
isShownByDefault: true,
hasValue: () => !!rel,
onDeselect: () => setAttributes({
rel: ''
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
value: rel,
onChange: newRel => setAttributes({
rel: newRel
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FeaturedImageResolutionTool, {
image: media,
value: sizeSlug,
onChange: nextSizeSlug => setAttributes({
sizeSlug: nextSizeSlug
})
})]
})
})]
});
let image;
/**
* A Post Featured Image block should not have image replacement
* or upload options in the following cases:
* - Is placed in a Query Loop. This is a conscious decision to
* prevent content editing of different posts in Query Loop, and
* this could change in the future.
* - Is in a context where it does not have a postId (for example
* in a template or template part).
*/
if (!featuredImage && (isDescendentOfQueryLoop || !postId)) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...blockProps,
children: [!!isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: postPermalink,
target: linkTarget,
children: placeholder()
}) : placeholder(), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay, {
attributes: attributes,
setAttributes: setAttributes,
clientId: clientId
})]
})]
});
}
const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image');
const imageStyles = {
...borderProps.style,
...shadowProps.style,
height: aspectRatio ? '100%' : height,
width: !!aspectRatio && '100%',
objectFit: !!(height || aspectRatio) && scale
};
/**
* When the post featured image block is placed in a context where:
* - It has a postId (for example in a single post)
* - It is not inside a query loop
* - It has no image assigned yet
* Then display the placeholder with the image upload option.
*/
if (!featuredImage && !temporaryURL) {
image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
onSelect: onSelectImage,
accept: "image/*",
allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
onError: onUploadError,
placeholder: placeholder,
mediaLibraryButton: ({
open
}) => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
icon: library_upload,
variant: "primary",
label: label,
showTooltip: true,
tooltipPosition: "top center",
onClick: e => {
e.preventDefault();
open();
}
});
}
});
} else {
// We have a Featured image so show a Placeholder if is loading.
image = !media && !temporaryURL ? placeholder() : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
className: borderProps.className,
src: temporaryURL || mediaUrl,
alt: media && media?.alt_text ? (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: The image's alt text.
(0,external_wp_i18n_namespaceObject.__)('Featured image: %s'), media.alt_text) : (0,external_wp_i18n_namespaceObject.__)('Featured image'),
style: imageStyles
}), temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})]
});
}
/**
* When the post featured image block:
* - Has an image assigned
* - Is not inside a query loop
* Then display the image and the image replacement option.
*/
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [!temporaryURL && controls, !!media && !isDescendentOfQueryLoop && /*#__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: featuredImage,
mediaURL: mediaUrl,
allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
accept: "image/*",
onSelect: onSelectImage,
onError: onUploadError,
onReset: () => setFeaturedImage(0)
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", {
...blockProps,
children: [!!isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: postPermalink,
target: linkTarget,
children: image
}) : image, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay, {
attributes: attributes,
setAttributes: setAttributes,
clientId: clientId
})]
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_featured_image_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-featured-image",
title: "Featured Image",
category: "theme",
description: "Display a post's featured image.",
textdomain: "default",
attributes: {
isLink: {
type: "boolean",
"default": false,
role: "content"
},
aspectRatio: {
type: "string"
},
width: {
type: "string"
},
height: {
type: "string"
},
scale: {
type: "string",
"default": "cover"
},
sizeSlug: {
type: "string"
},
rel: {
type: "string",
attribute: "rel",
"default": "",
role: "content"
},
linkTarget: {
type: "string",
"default": "_self",
role: "content"
},
overlayColor: {
type: "string"
},
customOverlayColor: {
type: "string"
},
dimRatio: {
type: "number",
"default": 0
},
gradient: {
type: "string"
},
customGradient: {
type: "string"
},
useFirstImageFromPost: {
type: "boolean",
"default": false
}
},
usesContext: ["postId", "postType", "queryId"],
example: {
viewportWidth: 350
},
supports: {
align: ["left", "right", "center", "wide", "full"],
color: {
text: false,
background: false
},
__experimentalBorder: {
color: true,
radius: true,
width: true,
__experimentalSkipSerialization: true,
__experimentalDefaultControls: {
color: true,
radius: true,
width: true
}
},
filter: {
duotone: true
},
shadow: {
__experimentalSkipSerialization: true
},
html: false,
spacing: {
margin: true,
padding: true
},
interactivity: {
clientNavigation: true
}
},
selectors: {
border: ".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay",
shadow: ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder",
filter: {
duotone: ".wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before"
}
},
editorStyle: "wp-block-post-featured-image-editor",
style: "wp-block-post-featured-image"
};
const {
name: post_featured_image_name
} = post_featured_image_metadata;
const post_featured_image_settings = {
icon: post_featured_image,
edit: PostFeaturedImageEdit
};
const post_featured_image_init = () => initBlock({
name: post_featured_image_name,
metadata: post_featured_image_metadata,
settings: post_featured_image_settings
});
;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function PostNavigationLinkEdit({
context: {
postType
},
attributes: {
type,
label,
showTitle,
textAlign,
linkLabel,
arrow,
taxonomy
},
setAttributes
}) {
const isNext = type === 'next';
let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous');
const arrowMap = {
none: '',
arrow: isNext ? '→' : '←',
chevron: isNext ? '»' : '«'
};
const displayArrow = arrowMap[arrow];
if (showTitle) {
placeholder = isNext ? /* translators: Label before for next and previous post. There is a space after the colon. */
(0,external_wp_i18n_namespaceObject.__)('Next: ') // eslint-disable-line @wordpress/i18n-no-flanking-whitespace
: /* translators: Label before for next and previous post. There is a space after the colon. */
(0,external_wp_i18n_namespaceObject.__)('Previous: '); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace
}
const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post');
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getTaxonomies
} = select(external_wp_coreData_namespaceObject.store);
const filteredTaxonomies = getTaxonomies({
type: postType,
per_page: -1
});
return filteredTaxonomies;
}, [postType]);
const getTaxonomyOptions = () => {
const selectOption = {
label: (0,external_wp_i18n_namespaceObject.__)('Unfiltered'),
value: ''
};
const taxonomyOptions = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(({
visibility
}) => !!visibility?.publicly_queryable).map(item => {
return {
value: item.slug,
label: item.name
};
});
return [selectOption, ...taxonomyOptions];
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'),
help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'),
checked: !!showTitle,
onChange: () => setAttributes({
showTitle: !showTitle
})
}), showTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'),
checked: !!linkLabel,
onChange: () => setAttributes({
linkLabel: !linkLabel
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
value: arrow,
onChange: value => {
setAttributes({
arrow: value
});
},
help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow for the next and previous link.'),
isBlock: true,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "none",
label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Next/Previous link')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "arrow",
label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Next/Previous link')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "chevron",
label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Next/Previous link')
})]
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "advanced",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Filter by taxonomy'),
value: taxonomy,
options: getTaxonomyOptions(),
onChange: value => setAttributes({
taxonomy: value
}),
help: (0,external_wp_i18n_namespaceObject.__)('Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.')
})
}), /*#__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.jsxs)("div", {
...blockProps,
children: [!isNext && displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: `wp-block-post-navigation-link__arrow-previous is-arrow-${arrow}`,
children: displayArrow
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
tagName: "a",
identifier: "label",
"aria-label": ariaLabel,
placeholder: placeholder,
value: label,
withoutInteractiveFormatting: true,
onChange: newLabel => setAttributes({
label: newLabel
})
}), showTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: "#post-navigation-pseudo-link",
onClick: event => event.preventDefault(),
children: (0,external_wp_i18n_namespaceObject.__)('An example title')
}), isNext && displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: `wp-block-post-navigation-link__arrow-next is-arrow-${arrow}`,
"aria-hidden": true,
children: displayArrow
})]
})]
});
}
;// ./node_modules/@wordpress/icons/build-module/library/next.js
/**
* WordPress dependencies
*/
const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"
})
});
/* harmony default export */ const library_next = (next);
;// ./node_modules/@wordpress/icons/build-module/library/previous.js
/**
* WordPress dependencies
*/
const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"
})
});
/* harmony default export */ const library_previous = (previous);
;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js
/**
* WordPress dependencies
*/
const post_navigation_link_variations_variations = [{
isDefault: true,
name: 'post-next',
title: (0,external_wp_i18n_namespaceObject.__)('Next Post'),
description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'),
icon: library_next,
attributes: {
type: 'next'
},
scope: ['inserter', 'transform'],
example: {
attributes: {
label: (0,external_wp_i18n_namespaceObject.__)('Next post'),
arrow: 'arrow'
}
}
}, {
name: 'post-previous',
title: (0,external_wp_i18n_namespaceObject.__)('Previous Post'),
description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'),
icon: library_previous,
attributes: {
type: 'previous'
},
scope: ['inserter', 'transform'],
example: {
attributes: {
label: (0,external_wp_i18n_namespaceObject.__)('Previous post'),
arrow: 'arrow'
}
}
}];
/**
* Add `isActive` function to all `post-navigation-link` variations, if not defined.
* `isActive` function is used to find a variation match from a created
* Block by providing its attributes.
*/
post_navigation_link_variations_variations.forEach(variation => {
if (variation.isActive) {
return;
}
variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
});
/* harmony default export */ const post_navigation_link_variations = (post_navigation_link_variations_variations);
;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_navigation_link_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-navigation-link",
title: "Post Navigation Link",
category: "theme",
description: "Displays the next or previous post link that is adjacent to the current post.",
textdomain: "default",
attributes: {
textAlign: {
type: "string"
},
type: {
type: "string",
"default": "next"
},
label: {
type: "string"
},
showTitle: {
type: "boolean",
"default": false
},
linkLabel: {
type: "boolean",
"default": false
},
arrow: {
type: "string",
"default": "none"
},
taxonomy: {
type: "string",
"default": ""
}
},
usesContext: ["postType"],
supports: {
reusable: false,
html: false,
color: {
link: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalWritingMode: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
}
},
style: "wp-block-post-navigation-link"
};
const {
name: post_navigation_link_name
} = post_navigation_link_metadata;
const post_navigation_link_settings = {
edit: PostNavigationLinkEdit,
variations: post_navigation_link_variations,
example: {
attributes: {
label: (0,external_wp_i18n_namespaceObject.__)('Next post'),
arrow: 'arrow'
}
}
};
const post_navigation_link_init = () => initBlock({
name: post_navigation_link_name,
metadata: post_navigation_link_metadata,
settings: post_navigation_link_settings
});
;// ./node_modules/@wordpress/block-library/build-module/post-template/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']];
function PostTemplateInnerBlocks({
classList
}) {
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
className: dist_clsx('wp-block-post', classList)
}, {
template: post_template_edit_TEMPLATE,
__unstableDisableLayoutClassNames: true
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
...innerBlocksProps
});
}
function PostTemplateBlockPreview({
blocks,
blockContextId,
classList,
isHidden,
setActiveBlockContextId
}) {
const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
blocks,
props: {
className: dist_clsx('wp-block-post', classList)
}
});
const handleOnClick = () => {
setActiveBlockContextId(blockContextId);
};
const style = {
display: isHidden ? 'none' : undefined
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
...blockPreviewProps,
tabIndex: 0
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
,
role: "button",
onClick: handleOnClick,
onKeyPress: handleOnClick,
style: style
});
}
const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview);
function PostTemplateEdit({
setAttributes,
clientId,
context: {
query: {
perPage,
offset = 0,
postType,
order,
orderBy,
author,
search,
exclude,
sticky,
inherit,
taxQuery,
parents,
pages,
format,
// We gather extra query args to pass to the REST API call.
// This way extenders of Query Loop can add their own query args,
// and have accurate previews in the editor.
// Noting though that these args should either be supported by the
// REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`.
...restQueryArgs
} = {},
templateSlug,
previewPostType
},
attributes: {
layout
},
__unstableLayoutClassNames
}) {
const {
type: layoutType,
columnCount = 3
} = layout || {};
const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)();
const {
posts,
blocks
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords,
getTaxonomies
} = select(external_wp_coreData_namespaceObject.store);
const {
getBlocks
} = select(external_wp_blockEditor_namespaceObject.store);
const templateCategory = inherit && templateSlug?.startsWith('category-') && getEntityRecords('taxonomy', 'category', {
context: 'view',
per_page: 1,
_fields: ['id'],
slug: templateSlug.replace('category-', '')
});
const templateTag = inherit && templateSlug?.startsWith('tag-') && getEntityRecords('taxonomy', 'post_tag', {
context: 'view',
per_page: 1,
_fields: ['id'],
slug: templateSlug.replace('tag-', '')
});
const query = {
offset: offset || 0,
order,
orderby: orderBy
};
// There is no need to build the taxQuery if we inherit.
if (taxQuery && !inherit) {
const taxonomies = getTaxonomies({
type: postType,
per_page: -1,
context: 'view'
});
// We have to build the tax query for the REST API and use as
// keys the taxonomies `rest_base` with the `term ids` as values.
const builtTaxQuery = Object.entries(taxQuery).reduce((accumulator, [taxonomySlug, terms]) => {
const taxonomy = taxonomies?.find(({
slug
}) => slug === taxonomySlug);
if (taxonomy?.rest_base) {
accumulator[taxonomy?.rest_base] = terms;
}
return accumulator;
}, {});
if (!!Object.keys(builtTaxQuery).length) {
Object.assign(query, builtTaxQuery);
}
}
if (perPage) {
query.per_page = perPage;
}
if (author) {
query.author = author;
}
if (search) {
query.search = search;
}
if (exclude?.length) {
query.exclude = exclude;
}
if (parents?.length) {
query.parent = parents;
}
if (format?.length) {
query.format = format;
}
/*
* Handle cases where sticky is set to `exclude` or `only`.
* Which works as a `post__in/post__not_in` query for sticky posts.
*/
if (['exclude', 'only'].includes(sticky)) {
query.sticky = sticky === 'only';
}
// Empty string represents the default behavior of including sticky posts.
if (['', 'ignore'].includes(sticky)) {
// Remove any leftover sticky query parameter.
delete query.sticky;
query.ignore_sticky = sticky === 'ignore';
}
// If `inherit` is truthy, adjust conditionally the query to create a better preview.
let currentPostType = postType;
if (inherit) {
// Change the post-type if needed.
if (templateSlug?.startsWith('archive-')) {
query.postType = templateSlug.replace('archive-', '');
currentPostType = query.postType;
} else if (templateCategory) {
query.categories = templateCategory[0]?.id;
} else if (templateTag) {
query.tags = templateTag[0]?.id;
} else if (templateSlug?.startsWith('taxonomy-post_format')) {
// Get the post format slug from the template slug by removing the prefix.
query.format = templateSlug.replace('taxonomy-post_format-post-format-', '');
}
}
// When we preview Query Loop blocks we should prefer the current
// block's postType, which is passed through block context.
const usedPostType = previewPostType || currentPostType;
return {
posts: getEntityRecords('postType', usedPostType, {
...query,
...restQueryArgs
}),
blocks: getBlocks(clientId)
};
}, [perPage, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery, parents, format, restQueryArgs, previewPostType]);
const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts?.map(post => {
var _post$class_list;
return {
postType: post.type,
postId: post.id,
classList: (_post$class_list = post.class_list) !== null && _post$class_list !== void 0 ? _post$class_list : ''
};
}), [posts]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx(__unstableLayoutClassNames, {
[`columns-${columnCount}`]: layoutType === 'grid' && columnCount // Ensure column count is flagged via classname for backwards compatibility.
})
});
if (!posts) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
});
}
if (!posts.length) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", {
...blockProps,
children: [" ", (0,external_wp_i18n_namespaceObject.__)('No results found.')]
});
}
const setDisplayLayout = newDisplayLayout => setAttributes({
layout: {
...layout,
...newDisplayLayout
}
});
const displayLayoutControls = [{
icon: library_list,
title: (0,external_wp_i18n_namespaceObject._x)('List view', 'Post template block display setting'),
onClick: () => setDisplayLayout({
type: 'default'
}),
isActive: layoutType === 'default' || layoutType === 'constrained'
}, {
icon: library_grid,
title: (0,external_wp_i18n_namespaceObject._x)('Grid view', 'Post template block display setting'),
onClick: () => setDisplayLayout({
type: 'grid',
columnCount
}),
isActive: layoutType === 'grid'
}];
// To avoid flicker when switching active block contexts, a preview is rendered
// for each block context, but the preview for the active block context is hidden.
// This ensures that when it is displayed again, the cached rendering of the
// block preview is used, instead of having to re-render the preview from scratch.
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_components_namespaceObject.ToolbarGroup, {
controls: displayLayoutControls
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
...blockProps,
children: blockContexts && blockContexts.map(blockContext => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
value: blockContext,
children: [blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplateInnerBlocks, {
classList: blockContext.classList
}) : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedPostTemplateBlockPreview, {
blocks: blocks,
blockContextId: blockContext.postId,
classList: blockContext.classList,
setActiveBlockContextId: setActiveBlockContextId,
isHidden: blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId)
})]
}, blockContext.postId))
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-template/save.js
/**
* WordPress dependencies
*/
function PostTemplateSave() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {});
}
;// ./node_modules/@wordpress/block-library/build-module/post-template/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_template_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-template",
title: "Post Template",
category: "theme",
ancestor: ["core/query"],
description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",
textdomain: "default",
usesContext: ["queryId", "query", "displayLayout", "templateSlug", "previewPostType", "enhancedPagination", "postType"],
supports: {
reusable: false,
html: false,
align: ["wide", "full"],
layout: true,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
spacing: {
margin: true,
padding: true,
blockGap: {
__experimentalDefault: "1.25em"
},
__experimentalDefaultControls: {
blockGap: true,
padding: false,
margin: false
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
}
},
style: "wp-block-post-template",
editorStyle: "wp-block-post-template-editor"
};
const {
name: post_template_name
} = post_template_metadata;
const post_template_settings = {
icon: library_layout,
edit: PostTemplateEdit,
save: PostTemplateSave
};
const post_template_init = () => initBlock({
name: post_template_name,
metadata: post_template_metadata,
settings: post_template_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/post-categories.js
/**
* WordPress dependencies
*/
const postCategories = /*#__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: "M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",
fillRule: "evenodd",
clipRule: "evenodd"
})
});
/* harmony default export */ const post_categories = (postCategories);
;// ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js
/**
* WordPress dependencies
*/
const use_post_terms_EMPTY_ARRAY = [];
function usePostTerms({
postId,
term
}) {
const {
slug
} = term;
return (0,external_wp_data_namespaceObject.useSelect)(select => {
const visible = term?.visibility?.publicly_queryable;
if (!visible) {
return {
postTerms: use_post_terms_EMPTY_ARRAY,
isLoading: false,
hasPostTerms: false
};
}
const {
getEntityRecords,
isResolving
} = select(external_wp_coreData_namespaceObject.store);
const taxonomyArgs = ['taxonomy', slug, {
post: postId,
per_page: -1,
context: 'view'
}];
const terms = getEntityRecords(...taxonomyArgs);
return {
postTerms: terms,
isLoading: isResolving('getEntityRecords', taxonomyArgs),
hasPostTerms: !!terms?.length
};
}, [postId, term?.visibility?.publicly_queryable, slug]);
}
;// ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
// Allowed formats for the prefix and suffix fields.
const ALLOWED_FORMATS = ['core/bold', 'core/image', 'core/italic', 'core/link', 'core/strikethrough', 'core/text-color'];
function PostTermsEdit({
attributes,
clientId,
context,
isSelected,
setAttributes,
insertBlocksAfter
}) {
const {
term,
textAlign,
separator,
prefix,
suffix
} = attributes;
const {
postId,
postType
} = context;
const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => {
if (!term) {
return {};
}
const {
getTaxonomy
} = select(external_wp_coreData_namespaceObject.store);
const taxonomy = getTaxonomy(term);
return taxonomy?.visibility?.publicly_queryable ? taxonomy : {};
}, [term]);
const {
postTerms,
hasPostTerms,
isLoading
} = usePostTerms({
postId,
term: selectedTerm
});
const hasPost = postId && postType;
const blockInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign,
[`taxonomy-${term}`]: term
})
});
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.InspectorControls, {
group: "advanced",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
autoComplete: "off",
label: (0,external_wp_i18n_namespaceObject.__)('Separator'),
value: separator || '',
onChange: nextValue => {
setAttributes({
separator: nextValue
});
},
help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.')
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...blockProps,
children: [isLoading && hasPost && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !isLoading && (isSelected || prefix) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "prefix",
allowedFormats: ALLOWED_FORMATS,
className: "wp-block-post-terms__prefix",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Prefix'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Prefix') + ' ',
value: prefix,
onChange: value => setAttributes({
prefix: value
}),
tagName: "span"
}), (!hasPost || !term) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
children: blockInformation.title
}), hasPost && !isLoading && hasPostTerms && postTerms.map(postTerm => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: postTerm.link,
onClick: event => event.preventDefault(),
rel: "tag",
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postTerm.name)
}, postTerm.id)).reduce((prev, curr) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [prev, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "wp-block-post-terms__separator",
children: separator || ' '
}), curr]
})), hasPost && !isLoading && !hasPostTerms && (selectedTerm?.labels?.no_terms || (0,external_wp_i18n_namespaceObject.__)('Term items not found.')), !isLoading && (isSelected || suffix) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "suffix",
allowedFormats: ALLOWED_FORMATS,
className: "wp-block-post-terms__suffix",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Suffix'),
placeholder: ' ' + (0,external_wp_i18n_namespaceObject.__)('Suffix'),
value: suffix,
onChange: value => setAttributes({
suffix: value
}),
tagName: "span",
__unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
})]
})]
});
}
;// ./node_modules/@wordpress/icons/build-module/library/post-terms.js
/**
* WordPress dependencies
*/
const postTerms = /*#__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: "M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"
})
});
/* harmony default export */ const post_terms = (postTerms);
;// ./node_modules/@wordpress/block-library/build-module/post-terms/hooks.js
/**
* WordPress dependencies
*/
const variationIconMap = {
category: post_categories,
post_tag: post_terms
};
// We add `icons` to categories and tags. The remaining ones use
// the block's default icon.
function enhanceVariations(settings, name) {
if (name !== 'core/post-terms') {
return settings;
}
const variations = settings.variations.map(variation => {
var _variationIconMap$var;
return {
...variation,
...{
icon: (_variationIconMap$var = variationIconMap[variation.name]) !== null && _variationIconMap$var !== void 0 ? _variationIconMap$var : post_categories
}
};
});
return {
...settings,
variations
};
}
;// ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_terms_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-terms",
title: "Post Terms",
category: "theme",
description: "Post terms.",
textdomain: "default",
attributes: {
term: {
type: "string"
},
textAlign: {
type: "string"
},
separator: {
type: "string",
"default": ", "
},
prefix: {
type: "string",
"default": ""
},
suffix: {
type: "string",
"default": ""
}
},
usesContext: ["postId", "postType"],
example: {
viewportWidth: 350
},
supports: {
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-post-terms"
};
const {
name: post_terms_name
} = post_terms_metadata;
const post_terms_settings = {
icon: post_categories,
edit: PostTermsEdit
};
const post_terms_init = () => {
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceVariations);
return initBlock({
name: post_terms_name,
metadata: post_terms_metadata,
settings: post_terms_settings
});
};
;// external ["wp","wordcount"]
const external_wp_wordcount_namespaceObject = window["wp"]["wordcount"];
;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Average reading rate - based on average taken from
* https://irisreading.com/average-reading-speed-in-various-languages/
* (Characters/minute used for Chinese rather than words).
*/
const AVERAGE_READING_RATE = 189;
function PostTimeToReadEdit({
attributes,
setAttributes,
context
}) {
const {
textAlign
} = attributes;
const {
postId,
postType
} = context;
const [contentStructure] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
id: postId
});
const minutesToReadString = (0,external_wp_element_namespaceObject.useMemo)(() => {
// Replicates the logic found in getEditedPostContent().
let content;
if (contentStructure instanceof Function) {
content = contentStructure({
blocks
});
} else if (blocks) {
// If we have parsed blocks already, they should be our source of truth.
// Parsing applies block deprecations and legacy block conversions that
// unparsed content will not have.
content = (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocks);
} else {
content = contentStructure;
}
/*
* translators: If your word count is based on single characters (e.g. East Asian characters),
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
* Do not translate into your own language.
*/
const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!');
const minutesToRead = Math.max(1, Math.round((0,external_wp_wordcount_namespaceObject.count)(content || '', wordCountType) / AVERAGE_READING_RATE));
return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the number of minutes to read the post. */
(0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', minutesToRead), minutesToRead);
}, [contentStructure, blocks]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
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: minutesToReadString
})]
});
}
/* harmony default export */ const post_time_to_read_edit = (PostTimeToReadEdit);
;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/icon.js
/**
* WordPress dependencies
*/
/* harmony default export */ const icon = (/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z"
})
}));
;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js
/**
* Internal dependencies
*/
const post_time_to_read_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
__experimental: true,
name: "core/post-time-to-read",
title: "Time to Read",
category: "theme",
description: "Show minutes required to finish reading the post.",
textdomain: "default",
usesContext: ["postId", "postType"],
attributes: {
textAlign: {
type: "string"
}
},
supports: {
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
html: false,
spacing: {
margin: true,
padding: true,
__experimentalDefaultControls: {
margin: false,
padding: false
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
}
}
};
const {
name: post_time_to_read_name
} = post_time_to_read_metadata;
const post_time_to_read_settings = {
icon: icon,
edit: post_time_to_read_edit,
example: {}
};
const post_time_to_read_init = () => initBlock({
name: post_time_to_read_name,
metadata: post_time_to_read_metadata,
settings: post_time_to_read_settings
});
;// ./node_modules/@wordpress/block-library/build-module/post-title/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function PostTitleEdit({
attributes: {
level,
levelOptions,
textAlign,
isLink,
rel,
linkTarget
},
setAttributes,
context: {
postType,
postId,
queryId
},
insertBlocksAfter
}) {
const TagName = level === 0 ? 'p' : `h${level}`;
const isDescendentOfQueryLoop = Number.isFinite(queryId);
const userCanEdit = (0,external_wp_data_namespaceObject.useSelect)(select => {
/**
* useCanEditEntity may trigger an OPTIONS request to the REST API
* via the canUser resolver. However, when the Post Title is a
* descendant of a Query Loop block, the title cannot be edited. In
* order to avoid these unnecessary requests, we call the hook
* without the proper data, resulting in returning early without
* making them.
*/
if (isDescendentOfQueryLoop) {
return false;
}
return select(external_wp_coreData_namespaceObject.store).canUser('update', {
kind: 'postType',
name: postType,
id: postId
});
}, [isDescendentOfQueryLoop, postType, postId]);
const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId);
const onSplitAtEnd = () => {
insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()));
};
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
let titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
children: (0,external_wp_i18n_namespaceObject.__)('Title')
});
if (postType && postId) {
titleElement = userCanEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, {
tagName: TagName,
placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'),
value: rawTitle,
onChange: setTitle,
__experimentalVersion: 2,
__unstableOnSplitAtEnd: onSplitAtEnd,
...blockProps
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
dangerouslySetInnerHTML: {
__html: fullTitle?.rendered
}
});
}
if (isLink && postType && postId) {
titleElement = userCanEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, {
tagName: "a",
href: link,
target: linkTarget,
rel: rel,
placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No title') : null,
value: rawTitle,
onChange: setTitle,
__experimentalVersion: 2,
__unstableOnSplitAtEnd: onSplitAtEnd
})
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: link,
target: linkTarget,
rel: rel,
onClick: event => event.preventDefault(),
dangerouslySetInnerHTML: {
__html: fullTitle?.rendered
}
})
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, {
value: level,
options: levelOptions,
onChange: newLevel => setAttributes({
level: newLevel
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
})]
}), /*#__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)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
}), isLink && /*#__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.__)('Open in new tab'),
onChange: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
value: rel,
onChange: newRel => setAttributes({
rel: newRel
})
})]
})]
})
})]
}), titleElement]
});
}
;// ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js
/**
* Internal dependencies
*/
const post_title_deprecated_v1 = {
attributes: {
textAlign: {
type: 'string'
},
level: {
type: 'number',
default: 2
},
isLink: {
type: 'boolean',
default: false
},
rel: {
type: 'string',
attribute: 'rel',
default: ''
},
linkTarget: {
type: 'string',
default: '_self'
}
},
supports: {
align: ['wide', 'full'],
html: false,
color: {
gradients: true,
link: true
},
spacing: {
margin: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true
}
},
save() {
return null;
},
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 post_title_deprecated = ([post_title_deprecated_v1]);
;// ./node_modules/@wordpress/block-library/build-module/post-title/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const post_title_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/post-title",
title: "Title",
category: "theme",
description: "Displays the title of a post, page, or any other content-type.",
textdomain: "default",
usesContext: ["postId", "postType", "queryId"],
attributes: {
textAlign: {
type: "string"
},
level: {
type: "number",
"default": 2
},
levelOptions: {
type: "array"
},
isLink: {
type: "boolean",
"default": false,
role: "content"
},
rel: {
type: "string",
attribute: "rel",
"default": "",
role: "content"
},
linkTarget: {
type: "string",
"default": "_self",
role: "content"
}
},
example: {
viewportWidth: 350
},
supports: {
align: ["wide", "full"],
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-post-title"
};
const {
name: post_title_name
} = post_title_metadata;
const post_title_settings = {
icon: library_title,
edit: PostTitleEdit,
deprecated: post_title_deprecated
};
const post_title_init = () => initBlock({
name: post_title_name,
metadata: post_title_metadata,
settings: post_title_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/preformatted.js
/**
* WordPress dependencies
*/
const preformatted = /*#__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 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"
})
});
/* harmony default export */ const library_preformatted = (preformatted);
;// ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js
/**
* WordPress dependencies
*/
function PreformattedEdit({
attributes,
mergeBlocks,
setAttributes,
onRemove,
insertBlocksAfter,
style
}) {
const {
content
} = attributes;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
style
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
tagName: "pre",
identifier: "content",
preserveWhiteSpace: true,
value: content,
onChange: nextContent => {
setAttributes({
content: nextContent
});
},
onRemove: onRemove,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'),
onMerge: mergeBlocks,
...blockProps,
__unstablePastePlainText: true,
__unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
});
}
;// ./node_modules/@wordpress/block-library/build-module/preformatted/save.js
/**
* WordPress dependencies
*/
function preformatted_save_save({
attributes
}) {
const {
content
} = attributes;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save(),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: content
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js
/**
* WordPress dependencies
*/
const preformatted_transforms_transforms = {
from: [{
type: 'block',
blocks: ['core/code', 'core/paragraph'],
transform: ({
content,
anchor
}) => (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', {
content,
anchor
})
}, {
type: 'raw',
isMatch: node => node.nodeName === 'PRE' && !(node.children.length === 1 && node.firstChild.nodeName === 'CODE'),
schema: ({
phrasingContentSchema
}) => ({
pre: {
children: phrasingContentSchema
}
})
}],
to: [{
type: 'block',
blocks: ['core/paragraph'],
transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
}, {
type: 'block',
blocks: ['core/code'],
transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes)
}]
};
/* harmony default export */ const preformatted_transforms = (preformatted_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const preformatted_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/preformatted",
title: "Preformatted",
category: "text",
description: "Add text that respects your spacing and tabs, and also allows styling.",
textdomain: "default",
attributes: {
content: {
type: "rich-text",
source: "rich-text",
selector: "pre",
__unstablePreserveWhiteSpace: true,
role: "content"
}
},
supports: {
anchor: true,
color: {
gradients: 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
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-preformatted"
};
const {
name: preformatted_name
} = preformatted_metadata;
const preformatted_settings = {
icon: library_preformatted,
example: {
attributes: {
/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
// translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.
content: (0,external_wp_i18n_namespaceObject.__)('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;')
/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
}
},
transforms: preformatted_transforms,
edit: PreformattedEdit,
save: preformatted_save_save,
merge(attributes, attributesToMerge) {
return {
content: attributes.content + '\n\n' + attributesToMerge.content
};
}
};
const preformatted_init = () => initBlock({
name: preformatted_name,
metadata: preformatted_metadata,
settings: preformatted_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/pullquote.js
/**
* WordPress dependencies
*/
const pullquote = /*#__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 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"
})
});
/* harmony default export */ const library_pullquote = (pullquote);
;// ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js
const SOLID_COLOR_CLASS = `is-style-solid-color`;
;// ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const pullquote_deprecated_blockAttributes = {
value: {
type: 'string',
source: 'html',
selector: 'blockquote',
multiline: 'p'
},
citation: {
type: 'string',
source: 'html',
selector: 'cite',
default: ''
},
mainColor: {
type: 'string'
},
customMainColor: {
type: 'string'
},
textColor: {
type: 'string'
},
customTextColor: {
type: 'string'
}
};
function parseBorderColor(styleString) {
if (!styleString) {
return;
}
const matches = styleString.match(/border-color:([^;]+)[;]?/);
if (matches && matches[1]) {
return matches[1];
}
}
function multilineToInline(value) {
value = value || `
`;
const padded = `${value}`;
const values = padded.split(`
`);
values.shift();
values.pop();
return values.join(' ');
}
const pullquote_deprecated_v5 = {
attributes: {
value: {
type: 'string',
source: 'html',
selector: 'blockquote',
multiline: 'p',
role: 'content'
},
citation: {
type: 'string',
source: 'html',
selector: 'cite',
default: '',
role: 'content'
},
textAlign: {
type: 'string'
}
},
save({
attributes
}) {
const {
textAlign,
citation,
value
} = attributes;
const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
}), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
})
});
},
migrate({
value,
...attributes
}) {
return {
value: multilineToInline(value),
...attributes
};
}
};
// TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example
const pullquote_deprecated_v4 = {
attributes: {
...pullquote_deprecated_blockAttributes
},
save({
attributes
}) {
const {
mainColor,
customMainColor,
customTextColor,
textColor,
value,
citation,
className
} = attributes;
const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS);
let figureClasses, figureStyles;
// Is solid color style
if (isSolidColorStyle) {
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
figureClasses = dist_clsx({
'has-background': backgroundClass || customMainColor,
[backgroundClass]: backgroundClass
});
figureStyles = {
backgroundColor: backgroundClass ? undefined : customMainColor
};
// Is normal style and a custom color is being used ( we can set a style directly with its value)
} else if (customMainColor) {
figureStyles = {
borderColor: customMainColor
};
}
const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const blockquoteClasses = dist_clsx({
'has-text-color': textColor || customTextColor,
[blockquoteTextColorClass]: blockquoteTextColorClass
});
const blockquoteStyles = blockquoteTextColorClass ? undefined : {
color: customTextColor
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: figureClasses,
style: figureStyles
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
className: blockquoteClasses,
style: blockquoteStyles,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
})
});
},
migrate({
value,
className,
mainColor,
customMainColor,
customTextColor,
...attributes
}) {
const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS);
let style;
if (customMainColor) {
if (!isSolidColorStyle) {
// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
style = {
border: {
color: customMainColor
}
};
} else {
// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
style = {
color: {
background: customMainColor
}
};
}
}
// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
if (customTextColor && style) {
style.color = {
...style.color,
text: customTextColor
};
}
return {
value: multilineToInline(value),
className,
backgroundColor: isSolidColorStyle ? mainColor : undefined,
borderColor: isSolidColorStyle ? undefined : mainColor,
textAlign: isSolidColorStyle ? 'left' : undefined,
style,
...attributes
};
}
};
const pullquote_deprecated_v3 = {
attributes: {
...pullquote_deprecated_blockAttributes,
// figureStyle is an attribute that never existed.
// We are using it as a way to access the styles previously applied to the figure.
figureStyle: {
source: 'attribute',
selector: 'figure',
attribute: 'style'
}
},
save({
attributes
}) {
const {
mainColor,
customMainColor,
textColor,
customTextColor,
value,
citation,
className,
figureStyle
} = attributes;
const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS);
let figureClasses, figureStyles;
// Is solid color style
if (isSolidColorStyle) {
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
figureClasses = dist_clsx({
'has-background': backgroundClass || customMainColor,
[backgroundClass]: backgroundClass
});
figureStyles = {
backgroundColor: backgroundClass ? undefined : customMainColor
};
// Is normal style and a custom color is being used ( we can set a style directly with its value)
} else if (customMainColor) {
figureStyles = {
borderColor: customMainColor
};
// If normal style and a named color are being used, we need to retrieve the color value to set the style,
// as there is no expectation that themes create classes that set border colors.
} else if (mainColor) {
// Previously here we queried the color settings to know the color value
// of a named color. This made the save function impure and the block was refactored,
// because meanwhile a change in the editor made it impossible to query color settings in the save function.
// Here instead of querying the color settings to know the color value, we retrieve the value
// directly from the style previously serialized.
const borderColor = parseBorderColor(figureStyle);
figureStyles = {
borderColor
};
}
const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const blockquoteClasses = (textColor || customTextColor) && dist_clsx('has-text-color', {
[blockquoteTextColorClass]: blockquoteTextColorClass
});
const blockquoteStyles = blockquoteTextColorClass ? undefined : {
color: customTextColor
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", {
className: figureClasses,
style: figureStyles,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
className: blockquoteClasses,
style: blockquoteStyles,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
})
});
},
migrate({
value,
className,
figureStyle,
mainColor,
customMainColor,
customTextColor,
...attributes
}) {
const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS);
let style;
if (customMainColor) {
if (!isSolidColorStyle) {
// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
style = {
border: {
color: customMainColor
}
};
} else {
// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
style = {
color: {
background: customMainColor
}
};
}
}
// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
if (customTextColor && style) {
style.color = {
...style.color,
text: customTextColor
};
}
// If is the default style, and a main color is set,
// migrate the main color value into a custom border color.
// The custom border color value is retrieved by parsing the figure styles.
if (!isSolidColorStyle && mainColor && figureStyle) {
const borderColor = parseBorderColor(figureStyle);
if (borderColor) {
return {
value: multilineToInline(value),
...attributes,
className,
// Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style.
style: {
border: {
color: borderColor
}
}
};
}
}
return {
value: multilineToInline(value),
className,
backgroundColor: isSolidColorStyle ? mainColor : undefined,
borderColor: isSolidColorStyle ? undefined : mainColor,
textAlign: isSolidColorStyle ? 'left' : undefined,
style,
...attributes
};
}
};
const pullquote_deprecated_v2 = {
attributes: pullquote_deprecated_blockAttributes,
save({
attributes
}) {
const {
mainColor,
customMainColor,
textColor,
customTextColor,
value,
citation,
className
} = attributes;
const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS);
let figureClass, figureStyles;
// Is solid color style
if (isSolidColorStyle) {
figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
if (!figureClass) {
figureStyles = {
backgroundColor: customMainColor
};
}
// Is normal style and a custom color is being used ( we can set a style directly with its value)
} else if (customMainColor) {
figureStyles = {
borderColor: customMainColor
};
// Is normal style and a named color is being used, we need to retrieve the color value to set the style,
// as there is no expectation that themes create classes that set border colors.
} else if (mainColor) {
var _select$getSettings$c;
const colors = (_select$getSettings$c = (0,external_wp_data_namespaceObject.select)(external_wp_blockEditor_namespaceObject.store).getSettings().colors) !== null && _select$getSettings$c !== void 0 ? _select$getSettings$c : [];
const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor);
figureStyles = {
borderColor: colorObject.color
};
}
const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const blockquoteClasses = textColor || customTextColor ? dist_clsx('has-text-color', {
[blockquoteTextColorClass]: blockquoteTextColorClass
}) : undefined;
const blockquoteStyle = blockquoteTextColorClass ? undefined : {
color: customTextColor
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", {
className: figureClass,
style: figureStyles,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
className: blockquoteClasses,
style: blockquoteStyle,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
})
});
},
migrate({
value,
className,
mainColor,
customMainColor,
customTextColor,
...attributes
}) {
const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS);
let style = {};
if (customMainColor) {
if (!isSolidColorStyle) {
// Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
style = {
border: {
color: customMainColor
}
};
} else {
// Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
style = {
color: {
background: customMainColor
}
};
}
}
// Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
if (customTextColor && style) {
style.color = {
...style.color,
text: customTextColor
};
}
return {
value: multilineToInline(value),
className,
backgroundColor: isSolidColorStyle ? mainColor : undefined,
borderColor: isSolidColorStyle ? undefined : mainColor,
textAlign: isSolidColorStyle ? 'left' : undefined,
style,
...attributes
};
}
};
const pullquote_deprecated_v1 = {
attributes: {
...pullquote_deprecated_blockAttributes
},
save({
attributes
}) {
const {
value,
citation
} = attributes;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
});
},
migrate({
value,
...attributes
}) {
return {
value: multilineToInline(value),
...attributes
};
}
};
const deprecated_v0 = {
attributes: {
...pullquote_deprecated_blockAttributes,
citation: {
type: 'string',
source: 'html',
selector: 'footer'
},
align: {
type: 'string',
default: 'none'
}
},
save({
attributes
}) {
const {
value,
citation,
align
} = attributes;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
className: `align${align}`,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "footer",
value: citation
})]
});
},
migrate({
value,
...attributes
}) {
return {
value: multilineToInline(value),
...attributes
};
}
};
/**
* 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 pullquote_deprecated = ([pullquote_deprecated_v5, pullquote_deprecated_v4, pullquote_deprecated_v3, pullquote_deprecated_v2, pullquote_deprecated_v1, deprecated_v0]);
;// ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js
const Figure = 'figure';
;// ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js
const BlockQuote = 'blockquote';
;// ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
function PullQuoteEdit({
attributes,
setAttributes,
isSelected,
insertBlocksAfter
}) {
const {
textAlign,
citation,
value
} = attributes;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected;
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)(Figure, {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockQuote, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "value",
tagName: "p",
value: value,
onChange: nextValue => setAttributes({
value: nextValue
}),
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'),
placeholder:
// translators: placeholder text used for the quote
(0,external_wp_i18n_namespaceObject.__)('Add quote'),
textAlign: "center"
}), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "citation",
tagName: isWebPlatform ? 'cite' : undefined,
style: {
display: 'block'
},
value: citation,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'),
placeholder:
// translators: placeholder text used for the citation
(0,external_wp_i18n_namespaceObject.__)('Add citation'),
onChange: nextCitation => setAttributes({
citation: nextCitation
}),
className: "wp-block-pullquote__citation",
__unstableMobileNoFocusOnMount: true,
textAlign: "center",
__unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
})]
})
})]
});
}
/* harmony default export */ const pullquote_edit = (PullQuoteEdit);
;// ./node_modules/@wordpress/block-library/build-module/pullquote/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function pullquote_save_save({
attributes
}) {
const {
textAlign,
citation,
value
} = attributes;
const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "p",
value: value
}), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js
/**
* WordPress dependencies
*/
const pullquote_transforms_transforms = {
from: [{
type: 'block',
isMultiBlock: true,
blocks: ['core/paragraph'],
transform: attributes => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
value: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: (0,external_wp_richText_namespaceObject.join)(attributes.map(({
content
}) => (0,external_wp_richText_namespaceObject.create)({
html: content
})), '\n')
}),
anchor: attributes.anchor
});
}
}, {
type: 'block',
blocks: ['core/heading'],
transform: ({
content,
anchor
}) => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
value: content,
anchor
});
}
}],
to: [{
type: 'block',
blocks: ['core/paragraph'],
transform: ({
value,
citation
}) => {
const paragraphs = [];
if (value) {
paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: value
}));
}
if (citation) {
paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: citation
}));
}
if (paragraphs.length === 0) {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: ''
});
}
return paragraphs;
}
}, {
type: 'block',
blocks: ['core/heading'],
transform: ({
value,
citation
}) => {
// If there is no pullquote content, use the citation as the
// content of the resulting heading. A nonexistent citation
// will result in an empty heading.
if (!value) {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
content: citation
});
}
const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
content: value
});
if (!citation) {
return headingBlock;
}
return [headingBlock, (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
content: citation
})];
}
}]
};
/* harmony default export */ const pullquote_transforms = (pullquote_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const pullquote_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/pullquote",
title: "Pullquote",
category: "text",
description: "Give special visual emphasis to a quote from your text.",
textdomain: "default",
attributes: {
value: {
type: "rich-text",
source: "rich-text",
selector: "p",
role: "content"
},
citation: {
type: "rich-text",
source: "rich-text",
selector: "cite",
role: "content"
},
textAlign: {
type: "string"
}
},
supports: {
anchor: true,
align: ["left", "right", "wide", "full"],
background: {
backgroundImage: true,
backgroundSize: true,
__experimentalDefaultControls: {
backgroundImage: true
}
},
color: {
gradients: true,
background: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
dimensions: {
minHeight: true,
__experimentalDefaultControls: {
minHeight: false
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
color: true,
radius: true,
style: true,
width: true,
__experimentalDefaultControls: {
color: true,
radius: true,
style: true,
width: true
}
},
__experimentalStyle: {
typography: {
fontSize: "1.5em",
lineHeight: "1.6"
}
},
interactivity: {
clientNavigation: true
}
},
editorStyle: "wp-block-pullquote-editor",
style: "wp-block-pullquote"
};
const {
name: pullquote_name
} = pullquote_metadata;
const pullquote_settings = {
icon: library_pullquote,
example: {
attributes: {
value:
// translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.
(0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.'),
citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg')
}
},
transforms: pullquote_transforms,
edit: pullquote_edit,
save: pullquote_save_save,
deprecated: pullquote_deprecated
};
const pullquote_init = () => initBlock({
name: pullquote_name,
metadata: pullquote_metadata,
settings: pullquote_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/loop.js
/**
* WordPress dependencies
*/
const loop = /*#__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.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"
})
});
/* harmony default export */ const library_loop = (loop);
;// ./node_modules/@wordpress/block-library/build-module/query/utils.js
/**
* WordPress dependencies
*/
/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
/** @typedef {import('@wordpress/components/build-types/query-controls/types').OrderByOption} OrderByOption */
/**
* @typedef IHasNameAndId
* @property {string|number} id The entity's id.
* @property {string} name The entity's name.
*/
/**
* The object used in Query block that contains info and helper mappings
* from an array of IHasNameAndId objects.
*
* @typedef {Object} QueryEntitiesInfo
* @property {IHasNameAndId[]} entities The array of entities.
* @property {Object} mapById Object mapping with the id as key and the entity as value.
* @property {Object} mapByName Object mapping with the name as key and the entity as value.
* @property {string[]} names Array with the entities' names.
*/
/**
* Returns a helper object with mapping from Objects that implement
* the `IHasNameAndId` interface. The returned object is used for
* integration with `FormTokenField` component.
*
* @param {IHasNameAndId[]} entities The entities to extract of helper object.
* @return {QueryEntitiesInfo} The object with the entities information.
*/
const getEntitiesInfo = entities => {
const mapping = entities?.reduce((accumulator, entity) => {
const {
mapById,
mapByName,
names
} = accumulator;
mapById[entity.id] = entity;
mapByName[entity.name] = entity;
names.push(entity.name);
return accumulator;
}, {
mapById: {},
mapByName: {},
names: []
});
return {
entities,
...mapping
};
};
/**
* Helper util to return a value from a certain path of the object.
* Path is specified as a string of properties, separated by dots,
* for example: "parent.child".
*
* @param {Object} object Input object.
* @param {string} path Path to the object property.
* @return {*} Value of the object property at the specified path.
*/
const getValueFromObjectPath = (object, path) => {
const normalizedPath = path.split('.');
let value = object;
normalizedPath.forEach(fieldName => {
value = value?.[fieldName];
});
return value;
};
/**
* Helper util to map records to add a `name` prop from a
* provided path, in order to handle all entities in the same
* fashion(implementing`IHasNameAndId` interface).
*
* @param {Object[]} entities The array of entities.
* @param {string} path The path to map a `name` property from the entity.
* @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface.
*/
const mapToIHasNameAndId = (entities, path) => {
return (entities || []).map(entity => ({
...entity,
name: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getValueFromObjectPath(entity, path))
}));
};
/**
* Returns a helper object that contains:
* 1. An `options` object from the available post types, to be passed to a `SelectControl`.
* 2. A helper map with available taxonomies per post type.
* 3. A helper map with post format support per post type.
*
* @return {Object} The helper object related to post types.
*/
const usePostTypes = () => {
const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getPostTypes
} = select(external_wp_coreData_namespaceObject.store);
const excludedPostTypes = ['attachment'];
const filteredPostTypes = getPostTypes({
per_page: -1
})?.filter(({
viewable,
slug
}) => viewable && !excludedPostTypes.includes(slug));
return filteredPostTypes;
}, []);
const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!postTypes?.length) {
return;
}
return postTypes.reduce((accumulator, type) => {
accumulator[type.slug] = type.taxonomies;
return accumulator;
}, {});
}, [postTypes]);
const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(({
labels,
slug
}) => ({
label: labels.singular_name,
value: slug
})), [postTypes]);
const postTypeFormatSupportMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!postTypes?.length) {
return {};
}
return postTypes.reduce((accumulator, type) => {
accumulator[type.slug] = type.supports?.['post-formats'] || false;
return accumulator;
}, {});
}, [postTypes]);
return {
postTypesTaxonomiesMap,
postTypesSelectOptions,
postTypeFormatSupportMap
};
};
/**
* Hook that returns the taxonomies associated with a specific post type.
*
* @param {string} postType The post type from which to retrieve the associated taxonomies.
* @return {Object[]} An array of the associated taxonomies.
*/
const useTaxonomies = postType => {
const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getTaxonomies,
getPostType
} = select(external_wp_coreData_namespaceObject.store);
// Does the post type have taxonomies?
if (getPostType(postType)?.taxonomies?.length > 0) {
return getTaxonomies({
type: postType,
per_page: -1
});
}
return [];
}, [postType]);
return (0,external_wp_element_namespaceObject.useMemo)(() => {
return taxonomies?.filter(({
visibility
}) => !!visibility?.publicly_queryable);
}, [taxonomies]);
};
/**
* Hook that returns whether a specific post type is hierarchical.
*
* @param {string} postType The post type to check.
* @return {boolean} Whether a specific post type is hierarchical.
*/
function useIsPostTypeHierarchical(postType) {
return (0,external_wp_data_namespaceObject.useSelect)(select => {
const type = select(external_wp_coreData_namespaceObject.store).getPostType(postType);
return type?.viewable && type?.hierarchical;
}, [postType]);
}
/**
* List of avaiable options to order by.
*
* @param {string} postType The post type to check.
* @return {OrderByOption[]} List of order options.
*/
function useOrderByOptions(postType) {
const supportsCustomOrder = (0,external_wp_data_namespaceObject.useSelect)(select => {
const type = select(external_wp_coreData_namespaceObject.store).getPostType(postType);
return !!type?.supports?.['page-attributes'];
}, [postType]);
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const orderByOptions = [{
label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'),
value: 'date/desc'
}, {
label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'),
value: 'date/asc'
}, {
/* translators: Label for ordering posts by title in ascending order. */
label: (0,external_wp_i18n_namespaceObject.__)('A → Z'),
value: 'title/asc'
}, {
/* translators: Label for ordering posts by title in descending order. */
label: (0,external_wp_i18n_namespaceObject.__)('Z → A'),
value: 'title/desc'
}];
if (supportsCustomOrder) {
orderByOptions.push({
/* translators: Label for ordering posts by ascending menu order. */
label: (0,external_wp_i18n_namespaceObject.__)('Ascending by order'),
value: 'menu_order/asc'
}, {
/* translators: Label for ordering posts by descending menu order. */
label: (0,external_wp_i18n_namespaceObject.__)('Descending by order'),
value: 'menu_order/desc'
});
}
return orderByOptions;
}, [supportsCustomOrder]);
}
/**
* Hook that returns the query properties' names defined by the active
* block variation, to determine which block's filters to show.
*
* @param {Object} attributes Block attributes.
* @return {string[]} An array of the query attributes.
*/
function useAllowedControls(attributes) {
return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation('core/query', attributes)?.allowedControls, [attributes]);
}
function isControlAllowed(allowedControls, key) {
// Every controls is allowed if the list is not defined.
if (!allowedControls) {
return true;
}
return allowedControls.includes(key);
}
/**
* Clones a pattern's blocks and then recurses over that list of blocks,
* transforming them to retain some `query` attribute properties.
* For now we retain the `postType` and `inherit` properties as they are
* fundamental for the expected functionality of the block and don't affect
* its design and presentation.
*
* Returns the cloned/transformed blocks and array of existing Query Loop
* client ids for further manipulation, in order to avoid multiple recursions.
*
* @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).
* @param {Record} queryBlockAttributes The existing Query Loop's attributes.
* @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.
*/
const getTransformedBlocksFromPattern = (blocks, queryBlockAttributes) => {
const {
query: {
postType,
inherit
},
namespace
} = queryBlockAttributes;
const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
const queryClientIds = [];
const blocksQueue = [...clonedBlocks];
while (blocksQueue.length > 0) {
const block = blocksQueue.shift();
if (block.name === 'core/query') {
block.attributes.query = {
...block.attributes.query,
postType,
inherit
};
if (namespace) {
block.attributes.namespace = namespace;
}
queryClientIds.push(block.clientId);
}
block.innerBlocks?.forEach(innerBlock => {
blocksQueue.push(innerBlock);
});
}
return {
newBlocks: clonedBlocks,
queryClientIds
};
};
/**
* Helper hook that determines if there is an active variation of the block
* and if there are available specific patterns for this variation.
* If there are, these patterns are going to be the only ones suggested to
* the user in setup and replace flow, without including the default ones
* for Query Loop.
*
* If there are no such patterns, the default ones for Query Loop are going
* to be suggested.
*
* @param {string} clientId The block's client ID.
* @param {Object} attributes The block's attributes.
* @return {string} The block name to be used in the patterns suggestions.
*/
function useBlockNameForPatterns(clientId, attributes) {
return (0,external_wp_data_namespaceObject.useSelect)(select => {
const activeVariationName = select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation('core/query', attributes)?.name;
if (!activeVariationName) {
return 'core/query';
}
const {
getBlockRootClientId,
getPatternsByBlockTypes
} = select(external_wp_blockEditor_namespaceObject.store);
const rootClientId = getBlockRootClientId(clientId);
const activePatterns = getPatternsByBlockTypes(`core/query/${activeVariationName}`, rootClientId);
return activePatterns.length > 0 ? `core/query/${activeVariationName}` : 'core/query';
}, [clientId, attributes]);
}
/**
* Helper hook that determines if there is an active variation of the block
* and if there are available specific scoped `block` variations connected with
* this variation.
*
* If there are, these variations are going to be the only ones suggested
* to the user in setup flow when clicking to `start blank`, without including
* the default ones for Query Loop.
*
* If there are no such scoped `block` variations, the default ones for Query
* Loop are going to be suggested.
*
* The way we determine such variations is with the convention that they have the `namespace`
* attribute defined as an array. This array should contain the names(`name` property) of any
* variations they want to be connected to.
* For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,
* we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.
* If the user selects this variation, the `namespace` attribute will be overridden by the
* main `inserter` variation.
*
* @param {Object} attributes The block's attributes.
* @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.
*/
function useScopedBlockVariations(attributes) {
const {
activeVariationName,
blockVariations
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getActiveBlockVariation,
getBlockVariations
} = select(external_wp_blocks_namespaceObject.store);
return {
activeVariationName: getActiveBlockVariation('core/query', attributes)?.name,
blockVariations: getBlockVariations('core/query', 'block')
};
}, [attributes]);
const variations = (0,external_wp_element_namespaceObject.useMemo)(() => {
// Filter out the variations that have defined a `namespace` attribute,
// which means they are 'connected' to specific variations of the block.
const isNotConnected = variation => !variation.attributes?.namespace;
if (!activeVariationName) {
return blockVariations.filter(isNotConnected);
}
const connectedVariations = blockVariations.filter(variation => variation.attributes?.namespace?.includes(activeVariationName));
if (!!connectedVariations.length) {
return connectedVariations;
}
return blockVariations.filter(isNotConnected);
}, [activeVariationName, blockVariations]);
return variations;
}
/**
* Hook that returns the block patterns for a specific block type.
*
* @param {string} clientId The block's client ID.
* @param {string} name The block type name.
* @return {Object[]} An array of valid block patterns.
*/
const usePatterns = (clientId, name) => {
return (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlockRootClientId,
getPatternsByBlockTypes
} = select(external_wp_blockEditor_namespaceObject.store);
const rootClientId = getBlockRootClientId(clientId);
return getPatternsByBlockTypes(name, rootClientId);
}, [name, clientId]);
};
/**
* The object returned by useUnsupportedBlocks with info about the type of
* unsupported blocks present inside the Query block.
*
* @typedef {Object} UnsupportedBlocksInfo
* @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present.
* @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present.
* @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks.
*/
/**
* Hook that returns an object with information about the unsupported blocks
* present inside a Query Loop with the given `clientId`. The returned object
* contains props that are true when a certain type of unsupported block is
* present.
*
* @param {string} clientId The block's client ID.
* @return {UnsupportedBlocksInfo} The object containing the information.
*/
const useUnsupportedBlocks = clientId => {
return (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getClientIdsOfDescendants,
getBlockName
} = select(external_wp_blockEditor_namespaceObject.store);
const blocks = {};
getClientIdsOfDescendants(clientId).forEach(descendantClientId => {
const blockName = getBlockName(descendantClientId);
/*
* Client side navigation can be true in two states:
* - supports.interactivity = true;
* - supports.interactivity.clientNavigation = true;
*/
const blockSupportsInteractivity = Object.is((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity'), true);
const blockSupportsInteractivityClientNavigation = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity.clientNavigation');
const blockInteractivity = blockSupportsInteractivity || blockSupportsInteractivityClientNavigation;
if (!blockInteractivity) {
blocks.hasBlocksFromPlugins = true;
} else if (blockName === 'core/post-content') {
blocks.hasPostContentBlock = true;
}
});
blocks.hasUnsupportedBlocks = blocks.hasBlocksFromPlugins || blocks.hasPostContentBlock;
return blocks;
}, [clientId]);
};
/**
* Helper function that returns the query context from the editor based on the
* available template slug.
*
* @param {string} templateSlug Current template slug based on context.
* @return {Object} An object with isSingular and templateType properties.
*/
function getQueryContextFromTemplate(templateSlug) {
// In the Post Editor, the template slug is not available.
if (!templateSlug) {
return {
isSingular: true
};
}
let isSingular = false;
let templateType = templateSlug === 'wp' ? 'custom' : templateSlug;
const singularTemplates = ['404', 'blank', 'single', 'page', 'custom'];
const templateTypeFromSlug = templateSlug.includes('-') ? templateSlug.split('-', 1)[0] : templateSlug;
const queryFromTemplateSlug = templateSlug.includes('-') ? templateSlug.split('-').slice(1).join('-') : '';
if (queryFromTemplateSlug) {
templateType = templateTypeFromSlug;
}
isSingular = singularTemplates.includes(templateType);
return {
isSingular,
templateType
};
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/enhanced-pagination-control.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function EnhancedPaginationControl({
enhancedPagination,
setAttributes,
clientId
}) {
const {
hasUnsupportedBlocks
} = useUnsupportedBlocks(clientId);
const fullPageClientSideNavigation = window.__experimentalFullPageClientSideNavigation;
let help = (0,external_wp_i18n_namespaceObject.__)('Reload the full page—instead of just the posts list—when visitors navigate between pages.');
if (fullPageClientSideNavigation) {
help = (0,external_wp_i18n_namespaceObject.__)('Experimental full-page client-side navigation setting enabled.');
} else if (hasUnsupportedBlocks) {
help = (0,external_wp_i18n_namespaceObject.__)('Enhancement disabled because there are non-compatible blocks inside the Query block.');
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Reload full page'),
help: help,
checked: !enhancedPagination && !fullPageClientSideNavigation,
disabled: hasUnsupportedBlocks || fullPageClientSideNavigation,
onChange: value => {
setAttributes({
enhancedPagination: !value
});
}
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/order-control.js
/**
* WordPress dependencies
*/
const defaultOrderByOptions = [{
label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'),
value: 'date/desc'
}, {
label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'),
value: 'date/asc'
}, {
/* translators: Label for ordering posts by title in ascending order. */
label: (0,external_wp_i18n_namespaceObject.__)('A → Z'),
value: 'title/asc'
}, {
/* translators: Label for ordering posts by title in descending order. */
label: (0,external_wp_i18n_namespaceObject.__)('Z → A'),
value: 'title/desc'
}];
function OrderControl({
order,
orderBy,
orderByOptions = defaultOrderByOptions,
onChange
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Order by'),
value: `${orderBy}/${order}`,
options: orderByOptions,
onChange: value => {
const [newOrderBy, newOrder] = value.split('/');
onChange({
order: newOrder,
orderBy: newOrderBy
});
}
});
}
/* harmony default export */ const order_control = (OrderControl);
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/author-control.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const author_control_AUTHORS_QUERY = {
who: 'authors',
per_page: -1,
_fields: 'id,name',
context: 'view'
};
function AuthorControl({
value,
onChange
}) {
const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getUsers
} = select(external_wp_coreData_namespaceObject.store);
return getUsers(author_control_AUTHORS_QUERY);
}, []);
if (!authorsList) {
return null;
}
const authorsInfo = getEntitiesInfo(authorsList);
/**
* We need to normalize the value because the block operates on a
* comma(`,`) separated string value and `FormTokenField` needs an
* array.
*/
const normalizedValue = !value ? [] : value.toString().split(',');
// Returns only the existing authors ids. This prevents the component
// from crashing in the editor, when non existing ids are provided.
const sanitizedValue = normalizedValue.reduce((accumulator, authorId) => {
const author = authorsInfo.mapById[authorId];
if (author) {
accumulator.push({
id: authorId,
value: author.name
});
}
return accumulator;
}, []);
const getIdByValue = (entitiesMappedByName, authorValue) => {
const id = authorValue?.id || entitiesMappedByName[authorValue]?.id;
if (id) {
return id;
}
};
const onAuthorChange = newValue => {
const ids = Array.from(newValue.reduce((accumulator, author) => {
// Verify that new values point to existing entities.
const id = getIdByValue(authorsInfo.mapByName, author);
if (id) {
accumulator.add(id);
}
return accumulator;
}, new Set()));
onChange({
author: ids.join(',')
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, {
label: (0,external_wp_i18n_namespaceObject.__)('Authors'),
value: sanitizedValue,
suggestions: authorsInfo.names,
onChange: onAuthorChange,
__experimentalShowHowTo: false,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true
});
}
/* harmony default export */ const author_control = (AuthorControl);
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/parent-control.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const parent_control_EMPTY_ARRAY = [];
const BASE_QUERY = {
order: 'asc',
_fields: 'id,title',
context: 'view'
};
function ParentControl({
parents,
postType,
onChange
}) {
const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)('');
const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY);
const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY);
const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250);
const {
searchResults,
searchHasResolved
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
if (!search) {
return {
searchResults: parent_control_EMPTY_ARRAY,
searchHasResolved: true
};
}
const {
getEntityRecords,
hasFinishedResolution
} = select(external_wp_coreData_namespaceObject.store);
const selectorArgs = ['postType', postType, {
...BASE_QUERY,
search,
orderby: 'relevance',
exclude: parents,
per_page: 20
}];
return {
searchResults: getEntityRecords(...selectorArgs),
searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs)
};
}, [search, parents]);
const currentParents = (0,external_wp_data_namespaceObject.useSelect)(select => {
if (!parents?.length) {
return parent_control_EMPTY_ARRAY;
}
const {
getEntityRecords
} = select(external_wp_coreData_namespaceObject.store);
return getEntityRecords('postType', postType, {
...BASE_QUERY,
include: parents,
per_page: parents.length
});
}, [parents]);
// Update the `value` state only after the selectors are resolved
// to avoid emptying the input when we're changing parents.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!parents?.length) {
setValue(parent_control_EMPTY_ARRAY);
}
if (!currentParents?.length) {
return;
}
const currentParentsInfo = getEntitiesInfo(mapToIHasNameAndId(currentParents, 'title.rendered'));
// Returns only the existing entity ids. This prevents the component
// from crashing in the editor, when non existing ids are provided.
const sanitizedValue = parents.reduce((accumulator, id) => {
const entity = currentParentsInfo.mapById[id];
if (entity) {
accumulator.push({
id,
value: entity.name
});
}
return accumulator;
}, []);
setValue(sanitizedValue);
}, [parents, currentParents]);
const entitiesInfo = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!searchResults?.length) {
return parent_control_EMPTY_ARRAY;
}
return getEntitiesInfo(mapToIHasNameAndId(searchResults, 'title.rendered'));
}, [searchResults]);
// Update suggestions only when the query has resolved.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!searchHasResolved) {
return;
}
setSuggestions(entitiesInfo.names);
}, [entitiesInfo.names, searchHasResolved]);
const getIdByValue = (entitiesMappedByName, entity) => {
const id = entity?.id || entitiesMappedByName?.[entity]?.id;
if (id) {
return id;
}
};
const onParentChange = newValue => {
const ids = Array.from(newValue.reduce((accumulator, entity) => {
// Verify that new values point to existing entities.
const id = getIdByValue(entitiesInfo.mapByName, entity);
if (id) {
accumulator.add(id);
}
return accumulator;
}, new Set()));
setSuggestions(parent_control_EMPTY_ARRAY);
onChange({
parents: ids
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, {
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Parents'),
value: value,
onInputChange: debouncedSearch,
suggestions: suggestions,
onChange: onParentChange,
__experimentalShowHowTo: false,
__nextHasNoMarginBottom: true
});
}
/* harmony default export */ const parent_control = (ParentControl);
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const taxonomy_controls_EMPTY_ARRAY = [];
const taxonomy_controls_BASE_QUERY = {
order: 'asc',
_fields: 'id,name',
context: 'view'
};
// Helper function to get the term id based on user input in terms `FormTokenField`.
const getTermIdByTermValue = (terms, termValue) => {
// First we check for exact match by `term.id` or case sensitive `term.name` match.
const termId = termValue?.id || terms?.find(term => term.name === termValue)?.id;
if (termId) {
return termId;
}
/**
* Here we make an extra check for entered terms in a non case sensitive way,
* to match user expectations, due to `FormTokenField` behaviour that shows
* suggestions which are case insensitive.
*
* Although WP tries to discourage users to add terms with the same name (case insensitive),
* it's still possible if you manually change the name, as long as the terms have different slugs.
* In this edge case we always apply the first match from the terms list.
*/
const termValueLower = termValue.toLocaleLowerCase();
return terms?.find(term => term.name.toLocaleLowerCase() === termValueLower)?.id;
};
function TaxonomyControls({
onChange,
query
}) {
const {
postType,
taxQuery
} = query;
const taxonomies = useTaxonomies(postType);
if (!taxonomies || taxonomies.length === 0) {
return null;
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 4,
children: taxonomies.map(taxonomy => {
const termIds = taxQuery?.[taxonomy.slug] || [];
const handleChange = newTermIds => onChange({
taxQuery: {
...taxQuery,
[taxonomy.slug]: newTermIds
}
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyItem, {
taxonomy: taxonomy,
termIds: termIds,
onChange: handleChange
}, taxonomy.slug);
})
});
}
/**
* Renders a `FormTokenField` for a given taxonomy.
*
* @param {Object} props The props for the component.
* @param {Object} props.taxonomy The taxonomy object.
* @param {number[]} props.termIds An array with the block's term ids for the given taxonomy.
* @param {Function} props.onChange Callback `onChange` function.
* @return {JSX.Element} The rendered component.
*/
function TaxonomyItem({
taxonomy,
termIds,
onChange
}) {
const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)('');
const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY);
const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY);
const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250);
const {
searchResults,
searchHasResolved
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
if (!search) {
return {
searchResults: taxonomy_controls_EMPTY_ARRAY,
searchHasResolved: true
};
}
const {
getEntityRecords,
hasFinishedResolution
} = select(external_wp_coreData_namespaceObject.store);
const selectorArgs = ['taxonomy', taxonomy.slug, {
...taxonomy_controls_BASE_QUERY,
search,
orderby: 'name',
exclude: termIds,
per_page: 20
}];
return {
searchResults: getEntityRecords(...selectorArgs),
searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs)
};
}, [search, termIds]);
// `existingTerms` are the ones fetched from the API and their type is `{ id: number; name: string }`.
// They are used to extract the terms' names to populate the `FormTokenField` properly
// and to sanitize the provided `termIds`, by setting only the ones that exist.
const existingTerms = (0,external_wp_data_namespaceObject.useSelect)(select => {
if (!termIds?.length) {
return taxonomy_controls_EMPTY_ARRAY;
}
const {
getEntityRecords
} = select(external_wp_coreData_namespaceObject.store);
return getEntityRecords('taxonomy', taxonomy.slug, {
...taxonomy_controls_BASE_QUERY,
include: termIds,
per_page: termIds.length
});
}, [termIds]);
// Update the `value` state only after the selectors are resolved
// to avoid emptying the input when we're changing terms.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!termIds?.length) {
setValue(taxonomy_controls_EMPTY_ARRAY);
}
if (!existingTerms?.length) {
return;
}
// Returns only the existing entity ids. This prevents the component
// from crashing in the editor, when non existing ids are provided.
const sanitizedValue = termIds.reduce((accumulator, id) => {
const entity = existingTerms.find(term => term.id === id);
if (entity) {
accumulator.push({
id,
value: entity.name
});
}
return accumulator;
}, []);
setValue(sanitizedValue);
}, [termIds, existingTerms]);
// Update suggestions only when the query has resolved.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!searchHasResolved) {
return;
}
setSuggestions(searchResults.map(result => result.name));
}, [searchResults, searchHasResolved]);
const onTermsChange = newTermValues => {
const newTermIds = new Set();
for (const termValue of newTermValues) {
const termId = getTermIdByTermValue(searchResults, termValue);
if (termId) {
newTermIds.add(termId);
}
}
setSuggestions(taxonomy_controls_EMPTY_ARRAY);
onChange(Array.from(newTermIds));
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "block-library-query-inspector__taxonomy-control",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, {
label: taxonomy.name,
value: value,
onInputChange: debouncedSearch,
suggestions: suggestions,
displayTransform: external_wp_htmlEntities_namespaceObject.decodeEntities,
onChange: onTermsChange,
__experimentalShowHowTo: false,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/format-controls.js
/**
* WordPress dependencies
*/
// All WP post formats, sorted alphabetically by translated name.
// Value is the post format slug. Label is the name.
const POST_FORMATS = [{
value: 'aside',
label: (0,external_wp_i18n_namespaceObject.__)('Aside')
}, {
value: 'audio',
label: (0,external_wp_i18n_namespaceObject.__)('Audio')
}, {
value: 'chat',
label: (0,external_wp_i18n_namespaceObject.__)('Chat')
}, {
value: 'gallery',
label: (0,external_wp_i18n_namespaceObject.__)('Gallery')
}, {
value: 'image',
label: (0,external_wp_i18n_namespaceObject.__)('Image')
}, {
value: 'link',
label: (0,external_wp_i18n_namespaceObject.__)('Link')
}, {
value: 'quote',
label: (0,external_wp_i18n_namespaceObject.__)('Quote')
}, {
value: 'standard',
label: (0,external_wp_i18n_namespaceObject.__)('Standard')
}, {
value: 'status',
label: (0,external_wp_i18n_namespaceObject.__)('Status')
}, {
value: 'video',
label: (0,external_wp_i18n_namespaceObject.__)('Video')
}].sort((a, b) => {
const normalizedA = a.label.toUpperCase();
const normalizedB = b.label.toUpperCase();
if (normalizedA < normalizedB) {
return -1;
}
if (normalizedA > normalizedB) {
return 1;
}
return 0;
});
// A helper function to convert translatable post format names into their static values.
function formatNamesToValues(names, formats) {
return names.map(name => {
return formats.find(item => item.label.toLocaleLowerCase() === name.toLocaleLowerCase())?.value;
}).filter(Boolean);
}
function FormatControls({
onChange,
query: {
format
}
}) {
// 'format' is expected to be an array. If it is not an array, for example
// if a user has manually entered an invalid value in the block markup,
// convert it to an array to prevent JavaScript errors.
const normalizedFormats = Array.isArray(format) ? format : [format];
const {
supportedFormats
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports();
return {
supportedFormats: themeSupports.formats
};
}, []);
const formats = POST_FORMATS.filter(item => supportedFormats.includes(item.value));
const values = normalizedFormats.map(name => formats.find(item => item.value === name)?.label).filter(Boolean);
const suggestions = formats.filter(item => !normalizedFormats.includes(item.value)).map(item => item.label);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, {
label: (0,external_wp_i18n_namespaceObject.__)('Formats'),
value: values,
suggestions: suggestions,
onChange: newValues => {
onChange({
format: formatNamesToValues(newValues, formats)
});
},
__experimentalShowHowTo: false,
__experimentalExpandOnFocus: true,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/sticky-control.js
/**
* WordPress dependencies
*/
const stickyOptions = [{
label: (0,external_wp_i18n_namespaceObject.__)('Include'),
value: ''
}, {
label: (0,external_wp_i18n_namespaceObject.__)('Ignore'),
value: 'ignore'
}, {
label: (0,external_wp_i18n_namespaceObject.__)('Exclude'),
value: 'exclude'
}, {
label: (0,external_wp_i18n_namespaceObject.__)('Only'),
value: 'only'
}];
function StickyControl({
value,
onChange
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'),
options: stickyOptions,
value: value,
onChange: onChange,
help: (0,external_wp_i18n_namespaceObject.__)('Sticky posts always appear first, regardless of their publish date.')
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/per-page-control.js
/**
* WordPress dependencies
*/
const MIN_POSTS_PER_PAGE = 1;
const MAX_POSTS_PER_PAGE = 100;
const PerPageControl = ({
perPage,
offset = 0,
onChange
}) => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Items per page'),
min: MIN_POSTS_PER_PAGE,
max: MAX_POSTS_PER_PAGE,
onChange: newPerPage => {
if (isNaN(newPerPage) || newPerPage < MIN_POSTS_PER_PAGE || newPerPage > MAX_POSTS_PER_PAGE) {
return;
}
onChange({
perPage: newPerPage,
offset
});
},
value: parseInt(perPage, 10)
});
};
/* harmony default export */ const per_page_control = (PerPageControl);
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/offset-controls.js
/**
* WordPress dependencies
*/
const MIN_OFFSET = 0;
const MAX_OFFSET = 100;
const OffsetControl = ({
offset = 0,
onChange
}) => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, {
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Offset'),
value: offset,
min: MIN_OFFSET,
onChange: newOffset => {
if (isNaN(newOffset) || newOffset < MIN_OFFSET || newOffset > MAX_OFFSET) {
return;
}
onChange({
offset: newOffset
});
}
});
};
/* harmony default export */ const offset_controls = (OffsetControl);
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/pages-control.js
/**
* WordPress dependencies
*/
const PagesControl = ({
pages,
onChange
}) => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, {
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Max pages to show'),
value: pages,
min: 0,
onChange: newPages => {
if (isNaN(newPages) || newPages < 0) {
return;
}
onChange({
pages: newPages
});
},
help: (0,external_wp_i18n_namespaceObject.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
});
};
/* harmony default export */ const pages_control = (PagesControl);
;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function QueryInspectorControls(props) {
const {
attributes,
setQuery,
setDisplayLayout,
isSingular
} = props;
const {
query,
displayLayout
} = attributes;
const {
order,
orderBy,
author: authorIds,
pages,
postType,
perPage,
offset,
sticky,
inherit,
taxQuery,
parents,
format
} = query;
const allowedControls = useAllowedControls(attributes);
const showSticky = postType === 'post';
const {
postTypesTaxonomiesMap,
postTypesSelectOptions,
postTypeFormatSupportMap
} = usePostTypes();
const taxonomies = useTaxonomies(postType);
const isPostTypeHierarchical = useIsPostTypeHierarchical(postType);
const onPostTypeChange = newValue => {
const updateQuery = {
postType: newValue
};
// We need to dynamically update the `taxQuery` property,
// by removing any not supported taxonomy from the query.
const supportedTaxonomies = postTypesTaxonomiesMap[newValue];
const updatedTaxQuery = Object.entries(taxQuery || {}).reduce((accumulator, [taxonomySlug, terms]) => {
if (supportedTaxonomies.includes(taxonomySlug)) {
accumulator[taxonomySlug] = terms;
}
return accumulator;
}, {});
updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : undefined;
if (newValue !== 'post') {
updateQuery.sticky = '';
}
// We need to reset `parents` because they are tied to each post type.
updateQuery.parents = [];
// Post types can register post format support with `add_post_type_support`.
// But we need to reset the `format` property when switching to post types
// that do not support post formats.
const hasFormatSupport = postTypeFormatSupportMap[newValue];
if (!hasFormatSupport) {
updateQuery.format = [];
}
setQuery(updateQuery);
};
const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search);
const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_wp_compose_namespaceObject.debounce)(() => {
if (query.search !== querySearch) {
setQuery({
search: querySearch
});
}
}, 250), [querySearch, query.search]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
onChangeDebounced();
return onChangeDebounced.cancel;
}, [querySearch, onChangeDebounced]);
const orderByOptions = useOrderByOptions(postType);
const showInheritControl = isControlAllowed(allowedControls, 'inherit');
const showPostTypeControl = !inherit && isControlAllowed(allowedControls, 'postType');
const postTypeControlLabel = (0,external_wp_i18n_namespaceObject.__)('Post type');
const postTypeControlHelp = (0,external_wp_i18n_namespaceObject.__)('Select the type of content to display: posts, pages, or custom post types.');
const showColumnsControl = false;
const showOrderControl = !inherit && isControlAllowed(allowedControls, 'order');
const showStickyControl = !inherit && showSticky && isControlAllowed(allowedControls, 'sticky');
const showSettingsPanel = showInheritControl || showPostTypeControl || showColumnsControl || showOrderControl || showStickyControl;
const showTaxControl = !!taxonomies?.length && isControlAllowed(allowedControls, 'taxQuery');
const showAuthorControl = isControlAllowed(allowedControls, 'author');
const showSearchControl = isControlAllowed(allowedControls, 'search');
const showParentControl = isControlAllowed(allowedControls, 'parents') && isPostTypeHierarchical;
const postTypeHasFormatSupport = postTypeFormatSupportMap[postType];
const showFormatControl = (0,external_wp_data_namespaceObject.useSelect)(select => {
// Check if the post type supports post formats and if the control is allowed.
if (!postTypeHasFormatSupport || !isControlAllowed(allowedControls, 'format')) {
return false;
}
const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports();
// If there are no supported formats, getThemeSupports still includes the default 'standard' format,
// and in this case the control should not be shown since the user has no other formats to choose from.
return themeSupports.formats && themeSupports.formats.length > 0 && themeSupports.formats.some(type => type !== 'standard');
}, [allowedControls, postTypeHasFormatSupport]);
const showFiltersPanel = showTaxControl || showAuthorControl || showSearchControl || showParentControl || showFormatControl;
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const showPostCountControl = isControlAllowed(allowedControls, 'postCount');
const showOffSetControl = isControlAllowed(allowedControls, 'offset');
const showPagesControl = isControlAllowed(allowedControls, 'pages');
const showDisplayPanel = showPostCountControl || showOffSetControl || showPagesControl;
// The block cannot inherit a default WordPress query in singular content (e.g., post, page, 404, blank).
// Warn users but still permit this type of query for exceptional cases in Classic and Hybrid themes.
const hasInheritanceWarning = isSingular && inherit;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [showSettingsPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setQuery({
postType: 'post',
order: 'desc',
orderBy: 'date',
sticky: '',
inherit: true
});
},
dropdownMenuProps: dropdownMenuProps,
children: [showInheritControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !inherit,
label: (0,external_wp_i18n_namespaceObject.__)('Query type'),
onDeselect: () => setQuery({
inherit: true
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 4,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Query type'),
isBlock: true,
onChange: value => {
setQuery({
inherit: value === 'default'
});
},
help: inherit ? (0,external_wp_i18n_namespaceObject.__)('Display a list of posts or custom post types based on the current template.') : (0,external_wp_i18n_namespaceObject.__)('Display a list of posts or custom post types based on specific criteria.'),
value: !!inherit ? 'default' : 'custom',
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "default",
label: (0,external_wp_i18n_namespaceObject.__)('Default')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "custom",
label: (0,external_wp_i18n_namespaceObject.__)('Custom')
})]
}), hasInheritanceWarning && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
status: "warning",
isDismissible: false,
children: (0,external_wp_i18n_namespaceObject.__)('Cannot inherit the current template query when placed inside the singular content (e.g., post, page, 404, blank).')
})]
})
}), showPostTypeControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => postType !== 'post',
label: postTypeControlLabel,
onDeselect: () => onPostTypeChange('post'),
isShownByDefault: true,
children: postTypesSelectOptions.length > 2 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
options: postTypesSelectOptions,
value: postType,
label: postTypeControlLabel,
onChange: onPostTypeChange,
help: postTypeControlHelp
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
isBlock: true,
value: postType,
label: postTypeControlLabel,
onChange: onPostTypeChange,
help: postTypeControlHelp,
children: postTypesSelectOptions.map(option => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: option.value,
label: option.label
}, option.value))
})
}), showColumnsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => displayLayout?.columns !== 2,
label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
onDeselect: () => setDisplayLayout({
columns: 2
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
value: displayLayout.columns,
onChange: value => setDisplayLayout({
columns: value
}),
min: 2,
max: Math.max(6, displayLayout.columns)
}), displayLayout.columns > 6 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
status: "warning",
isDismissible: false,
children: (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.')
})]
})
}), showOrderControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => order !== 'desc' || orderBy !== 'date',
label: (0,external_wp_i18n_namespaceObject.__)('Order by'),
onDeselect: () => setQuery({
order: 'desc',
orderBy: 'date'
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(order_control, {
order,
orderBy,
orderByOptions,
onChange: setQuery
})
}), showStickyControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!sticky,
label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'),
onDeselect: () => setQuery({
sticky: ''
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StickyControl, {
value: sticky,
onChange: value => setQuery({
sticky: value
})
})
})]
}), !inherit && showDisplayPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
className: "block-library-query-toolspanel__display",
label: (0,external_wp_i18n_namespaceObject.__)('Display'),
resetAll: () => {
setQuery({
offset: 0,
pages: 0
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Items per page'),
hasValue: () => perPage > 0,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(per_page_control, {
perPage: perPage,
offset: offset,
onChange: setQuery
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Offset'),
hasValue: () => offset > 0,
onDeselect: () => setQuery({
offset: 0
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(offset_controls, {
offset: offset,
onChange: setQuery
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Max pages to show'),
hasValue: () => pages > 0,
onDeselect: () => setQuery({
pages: 0
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pages_control, {
pages: pages,
onChange: setQuery
})
})]
}), !inherit && showFiltersPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
className: "block-library-query-toolspanel__filters" // unused but kept for backward compatibility
,
label: (0,external_wp_i18n_namespaceObject.__)('Filters'),
resetAll: () => {
setQuery({
author: '',
parents: [],
search: '',
taxQuery: null,
format: []
});
setQuerySearch('');
},
dropdownMenuProps: dropdownMenuProps,
children: [showTaxControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Taxonomies'),
hasValue: () => Object.values(taxQuery || {}).some(terms => !!terms.length),
onDeselect: () => setQuery({
taxQuery: null
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyControls, {
onChange: setQuery,
query: query
})
}), showAuthorControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!authorIds,
label: (0,external_wp_i18n_namespaceObject.__)('Authors'),
onDeselect: () => setQuery({
author: ''
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(author_control, {
value: authorIds,
onChange: setQuery
})
}), showSearchControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!querySearch,
label: (0,external_wp_i18n_namespaceObject.__)('Keyword'),
onDeselect: () => setQuerySearch(''),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Keyword'),
value: querySearch,
onChange: setQuerySearch
})
}), showParentControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!parents?.length,
label: (0,external_wp_i18n_namespaceObject.__)('Parents'),
onDeselect: () => setQuery({
parents: []
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(parent_control, {
parents: parents,
postType: postType,
onChange: setQuery
})
}), showFormatControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!format?.length,
label: (0,external_wp_i18n_namespaceObject.__)('Formats'),
onDeselect: () => setQuery({
format: []
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormatControls, {
onChange: setQuery,
query: query
})
})]
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/enhanced-pagination-modal.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const modalDescriptionId = 'wp-block-query-enhanced-pagination-modal__description';
function EnhancedPaginationModal({
clientId,
attributes: {
enhancedPagination
},
setAttributes
}) {
const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const {
hasBlocksFromPlugins,
hasPostContentBlock,
hasUnsupportedBlocks
} = useUnsupportedBlocks(clientId);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (enhancedPagination && hasUnsupportedBlocks && !window.__experimentalFullPageClientSideNavigation) {
setAttributes({
enhancedPagination: false
});
setOpen(true);
}
}, [enhancedPagination, hasUnsupportedBlocks, setAttributes]);
const closeModal = () => {
setOpen(false);
};
let notice = (0,external_wp_i18n_namespaceObject.__)('If you still want to prevent full page reloads, remove that block, then disable "Reload full page" again in the Query Block settings.');
if (hasBlocksFromPlugins) {
notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when non-interactive or non-client Navigation compatible blocks from plugins are present inside the Query block.') + ' ' + notice;
} else if (hasPostContentBlock) {
notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.') + ' ' + notice;
}
return isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.__)('Query block: Reload full page enabled'),
className: "wp-block-query__enhanced-pagination-modal",
aria: {
describedby: modalDescriptionId
},
role: "alertdialog",
focusOnMount: "firstElement",
isDismissible: false,
onRequestClose: closeModal,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
alignment: "right",
spacing: 5,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
id: modalDescriptionId,
children: notice
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "primary",
onClick: closeModal,
children: (0,external_wp_i18n_namespaceObject.__)('OK')
})]
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/utils/search-patterns.js
/**
* External dependencies
*/
/**
* Sanitizes the search input string.
*
* @param {string} input The search input to normalize.
*
* @return {string} The normalized search input.
*/
function normalizeSearchInput(input = '') {
// Disregard diacritics.
input = remove_accents_default()(input);
// Trim & Lowercase.
input = input.trim().toLowerCase();
return input;
}
/**
* Get the search rank for a given pattern and a specific search term.
*
* @param {Object} pattern Pattern to rank
* @param {string} searchValue Search term
* @return {number} A pattern search rank
*/
function getPatternSearchRank(pattern, searchValue) {
const normalizedSearchValue = normalizeSearchInput(searchValue);
const normalizedTitle = normalizeSearchInput(pattern.title);
let rank = 0;
if (normalizedSearchValue === normalizedTitle) {
rank += 30;
} else if (normalizedTitle.startsWith(normalizedSearchValue)) {
rank += 20;
} else {
const searchTerms = normalizedSearchValue.split(' ');
const hasMatchedTerms = searchTerms.every(searchTerm => normalizedTitle.includes(searchTerm));
// Prefer pattern with every search word in the title.
if (hasMatchedTerms) {
rank += 10;
}
}
return rank;
}
/**
* Filters an pattern list given a search term.
*
* @param {Array} patterns Item list
* @param {string} searchValue Search input.
*
* @return {Array} Filtered pattern list.
*/
function searchPatterns(patterns = [], searchValue = '') {
if (!searchValue) {
return patterns;
}
const rankedPatterns = patterns.map(pattern => {
return [pattern, getPatternSearchRank(pattern, searchValue)];
}).filter(([, rank]) => rank > 0);
rankedPatterns.sort(([, rank1], [, rank2]) => rank2 - rank1);
return rankedPatterns.map(([pattern]) => pattern);
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/pattern-selection.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function PatternSelectionModal({
clientId,
attributes,
setIsPatternSelectionModalOpen
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
overlayClassName: "block-library-query-pattern__selection-modal",
title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'),
onRequestClose: () => setIsPatternSelectionModalOpen(false),
isFullScreen: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, {
clientId: clientId,
attributes: attributes
})
});
}
function useBlockPatterns(clientId, attributes) {
const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes);
return usePatterns(clientId, blockNameForPatterns);
}
function PatternSelection({
clientId,
attributes,
showTitlesAsTooltip = false,
showSearch = true
}) {
const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)('');
const {
replaceBlock,
selectBlock
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const blockPatterns = useBlockPatterns(clientId, attributes);
/*
* When we preview Query Loop blocks we should prefer the current
* block's postType, which is passed through block context.
*/
const blockPreviewContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({
previewPostType: attributes.query.postType
}), [attributes.query.postType]);
const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
return searchPatterns(blockPatterns, searchValue);
}, [blockPatterns, searchValue]);
const onBlockPatternSelect = (pattern, blocks) => {
const {
newBlocks,
queryClientIds
} = getTransformedBlocksFromPattern(blocks, attributes);
replaceBlock(clientId, newBlocks);
if (queryClientIds[0]) {
selectBlock(queryClientIds[0]);
}
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "block-library-query-pattern__selection-content",
children: [showSearch && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "block-library-query-pattern__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'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Search')
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
value: blockPreviewContext,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
blockPatterns: filteredBlockPatterns,
onClickPattern: onBlockPatternSelect,
showTitlesAsTooltip: showTitlesAsTooltip
})
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function QueryToolbar({
clientId,
attributes
}) {
const hasPatterns = useBlockPatterns(clientId, attributes).length;
if (!hasPatterns) {
return null;
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
className: "wp-block-template-part__block-control-group",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
contentClassName: "block-editor-block-settings-menu__popover",
focusOnMount: "firstElement",
expandOnMobile: true,
renderToggle: ({
isOpen,
onToggle
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
"aria-haspopup": "true",
"aria-expanded": isOpen,
onClick: onToggle,
children: (0,external_wp_i18n_namespaceObject.__)('Change design')
}),
renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, {
clientId: clientId,
attributes: attributes,
showSearch: false,
showTitlesAsTooltip: true
})
})
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-content.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const DEFAULTS_POSTS_PER_PAGE = 3;
const query_content_TEMPLATE = [['core/post-template']];
function QueryContent({
attributes,
setAttributes,
clientId,
context,
name
}) {
const {
queryId,
query,
displayLayout,
enhancedPagination,
tagName: TagName = 'div',
query: {
inherit
} = {}
} = attributes;
const {
templateSlug
} = context;
const {
isSingular
} = getQueryContextFromTemplate(templateSlug);
const {
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: query_content_TEMPLATE
});
const {
postsPerPage
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
const {
getEntityRecord,
getEntityRecordEdits,
canUser
} = select(external_wp_coreData_namespaceObject.store);
const settingPerPage = canUser('read', {
kind: 'root',
name: 'site'
}) ? +getEntityRecord('root', 'site')?.posts_per_page : +getSettings().postsPerPage;
// Gets changes made via the template area posts per page setting. These won't be saved
// until the page is saved, but we should reflect this setting within the query loops
// that inherit it.
const editedSettingPerPage = +getEntityRecordEdits('root', 'site')?.posts_per_page;
return {
postsPerPage: editedSettingPerPage || settingPerPage || DEFAULTS_POSTS_PER_PAGE
};
}, []);
// There are some effects running where some initialization logic is
// happening and setting some values to some attributes (ex. queryId).
// These updates can cause an `undo trap` where undoing will result in
// resetting again, so we need to mark these changes as not persistent
// with `__unstableMarkNextChangeAsNotPersistent`.
// Changes in query property (which is an object) need to be in the same callback,
// because updates are batched after the render and changes in different query properties
// would cause to override previous wanted changes.
const updateQuery = (0,external_wp_element_namespaceObject.useCallback)(newQuery => setAttributes({
query: {
...query,
...newQuery
}
}), [query, setAttributes]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const newQuery = {};
// When we inherit from global query always need to set the `perPage`
// based on the reading settings.
if (inherit && query.perPage !== postsPerPage) {
newQuery.perPage = postsPerPage;
} else if (!query.perPage && postsPerPage) {
newQuery.perPage = postsPerPage;
}
if (!!Object.keys(newQuery).length) {
__unstableMarkNextChangeAsNotPersistent();
updateQuery(newQuery);
}
}, [query.perPage, inherit, postsPerPage, __unstableMarkNextChangeAsNotPersistent, updateQuery]);
// We need this for multi-query block pagination.
// Query parameters for each block are scoped to their ID.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!Number.isFinite(queryId)) {
__unstableMarkNextChangeAsNotPersistent();
setAttributes({
queryId: instanceId
});
}
}, [queryId, instanceId, __unstableMarkNextChangeAsNotPersistent, setAttributes]);
const updateDisplayLayout = newDisplayLayout => setAttributes({
displayLayout: {
...displayLayout,
...newDisplayLayout
}
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnhancedPaginationModal, {
attributes: attributes,
setAttributes: setAttributes,
clientId: clientId
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryInspectorControls, {
name: name,
attributes: attributes,
setQuery: updateQuery,
setDisplayLayout: updateDisplayLayout,
setAttributes: setAttributes,
clientId: clientId,
isSingular: isSingular
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryToolbar, {
attributes: attributes,
clientId: clientId
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "advanced",
children: [/*#__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.__)('Default ()'),
value: 'div'
}, {
label: '
',
value: 'main'
}, {
label: '',
value: 'section'
}, {
label: '',
value: 'aside'
}],
value: TagName,
onChange: value => setAttributes({
tagName: value
}),
help: htmlElementMessages[TagName]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnhancedPaginationControl, {
enhancedPagination: enhancedPagination,
setAttributes: setAttributes,
clientId: clientId
})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...innerBlocksProps
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function QueryPlaceholder({
attributes,
clientId,
name,
openPatternSelectionModal
}) {
const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const {
blockType,
activeBlockVariation
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getActiveBlockVariation,
getBlockType
} = select(external_wp_blocks_namespaceObject.store);
return {
blockType: getBlockType(name),
activeBlockVariation: getActiveBlockVariation(name, attributes)
};
}, [name, attributes]);
const hasPatterns = !!useBlockPatterns(clientId, attributes).length;
const icon = activeBlockVariation?.icon?.src || activeBlockVariation?.icon || blockType?.icon?.src;
const label = activeBlockVariation?.title || blockType?.title;
if (isStartingBlank) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryVariationPicker, {
clientId: clientId,
attributes: attributes,
icon: icon,
label: label
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, {
icon: icon,
label: label,
instructions: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern for the query loop or start blank.'),
children: [!!hasPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "primary",
onClick: openPatternSelectionModal,
children: (0,external_wp_i18n_namespaceObject.__)('Choose')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "secondary",
onClick: () => {
setIsStartingBlank(true);
},
children: (0,external_wp_i18n_namespaceObject.__)('Start blank')
})]
})
});
}
function QueryVariationPicker({
clientId,
attributes,
icon,
label
}) {
const scopeVariations = useScopedBlockVariations(attributes);
const {
replaceInnerBlocks
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
icon: icon,
label: label,
variations: scopeVariations,
onSelect: variation => {
if (variation.innerBlocks) {
replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(variation.innerBlocks), false);
}
}
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/edit/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const QueryEdit = props => {
const {
clientId,
attributes
} = props;
const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]);
const Component = hasInnerBlocks ? QueryContent : QueryPlaceholder;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
...props,
openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true)
}), isPatternSelectionModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelectionModal, {
clientId: clientId,
attributes: attributes,
setIsPatternSelectionModalOpen: setIsPatternSelectionModalOpen
})]
});
};
/* harmony default export */ const query_edit = (QueryEdit);
;// ./node_modules/@wordpress/block-library/build-module/query/save.js
/**
* WordPress dependencies
*/
function query_save_save({
attributes: {
tagName: Tag = 'div'
}
}) {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
...innerBlocksProps
});
}
;// ./node_modules/@wordpress/block-library/build-module/query/icons.js
/**
* WordPress dependencies
*/
const titleDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 48 48",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"
})
});
const titleExcerpt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 48 48",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"
})
});
const titleDateExcerpt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 48 48",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"
})
});
const imageDateTitle = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 48 48",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/query/variations.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_variations_variations = [{
name: 'title-date',
title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'),
icon: titleDate,
attributes: {},
innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']],
scope: ['block']
}, {
name: 'title-excerpt',
title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'),
icon: titleExcerpt,
attributes: {},
innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
scope: ['block']
}, {
name: 'title-date-excerpt',
title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'),
icon: titleDateExcerpt,
attributes: {},
innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
scope: ['block']
}, {
name: 'image-date-title',
title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'),
icon: imageDateTitle,
attributes: {},
innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']],
scope: ['block']
}];
/* harmony default export */ const query_variations = (query_variations_variations);
;// ./node_modules/@wordpress/block-library/build-module/query/deprecated.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
cleanEmptyObject: deprecated_cleanEmptyObject
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const migrateToTaxQuery = attributes => {
const {
query
} = attributes;
const {
categoryIds,
tagIds,
...newQuery
} = query;
if (query.categoryIds?.length || query.tagIds?.length) {
newQuery.taxQuery = {
category: !!query.categoryIds?.length ? query.categoryIds : undefined,
post_tag: !!query.tagIds?.length ? query.tagIds : undefined
};
}
return {
...attributes,
query: newQuery
};
};
const migrateColors = (attributes, innerBlocks) => {
// Remove color style attributes from the Query block.
const {
style,
backgroundColor,
gradient,
textColor,
...newAttributes
} = attributes;
const hasColorStyles = backgroundColor || gradient || textColor || style?.color || style?.elements?.link;
// If the query block doesn't currently have any color styles,
// nothing needs migrating.
if (!hasColorStyles) {
return [attributes, innerBlocks];
}
// Clean color values from style attribute object.
if (style) {
newAttributes.style = deprecated_cleanEmptyObject({
...style,
color: undefined,
elements: {
...style.elements,
link: undefined
}
});
}
// If the inner blocks are already wrapped in a single group
// block, add the color support styles to that group block.
if (hasSingleInnerGroupBlock(innerBlocks)) {
const groupBlock = innerBlocks[0];
// Create new styles for the group block.
const hasStyles = style?.color || style?.elements?.link || groupBlock.attributes.style;
const newStyles = hasStyles ? deprecated_cleanEmptyObject({
...groupBlock.attributes.style,
color: style?.color,
elements: style?.elements?.link ? {
link: style?.elements?.link
} : undefined
}) : undefined;
// Create a new Group block from the original.
const updatedGroupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
...groupBlock.attributes,
backgroundColor,
gradient,
textColor,
style: newStyles
}, groupBlock.innerBlocks);
return [newAttributes, [updatedGroupBlock]];
}
// When we don't have a single wrapping group block for the inner
// blocks, wrap the current inner blocks in a group applying the
// color styles to that.
const newGroupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
backgroundColor,
gradient,
textColor,
style: deprecated_cleanEmptyObject({
color: style?.color,
elements: style?.elements?.link ? {
link: style?.elements?.link
} : undefined
})
}, innerBlocks);
return [newAttributes, [newGroupBlock]];
};
const hasSingleInnerGroupBlock = (innerBlocks = []) => innerBlocks.length === 1 && innerBlocks[0].name === 'core/group';
const migrateToConstrainedLayout = attributes => {
const {
layout = null
} = attributes;
if (!layout) {
return attributes;
}
const {
inherit = null,
contentSize = null,
...newLayout
} = layout;
if (inherit || contentSize) {
return {
...attributes,
layout: {
...newLayout,
contentSize,
type: 'constrained'
}
};
}
return attributes;
};
const findPostTemplateBlock = (innerBlocks = []) => {
let foundBlock = null;
for (const block of innerBlocks) {
if (block.name === 'core/post-template') {
foundBlock = block;
break;
} else if (block.innerBlocks.length) {
foundBlock = findPostTemplateBlock(block.innerBlocks);
}
}
return foundBlock;
};
const replacePostTemplateBlock = (innerBlocks = [], replacementBlock) => {
innerBlocks.forEach((block, index) => {
if (block.name === 'core/post-template') {
innerBlocks.splice(index, 1, replacementBlock);
} else if (block.innerBlocks.length) {
block.innerBlocks = replacePostTemplateBlock(block.innerBlocks, replacementBlock);
}
});
return innerBlocks;
};
const migrateDisplayLayout = (attributes, innerBlocks) => {
const {
displayLayout = null,
...newAttributes
} = attributes;
if (!displayLayout) {
return [attributes, innerBlocks];
}
const postTemplateBlock = findPostTemplateBlock(innerBlocks);
if (!postTemplateBlock) {
return [attributes, innerBlocks];
}
const {
type,
columns
} = displayLayout;
// Convert custom displayLayout values to canonical layout types.
const updatedLayoutType = type === 'flex' ? 'grid' : 'default';
const newPostTemplateBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/post-template', {
...postTemplateBlock.attributes,
layout: {
type: updatedLayoutType,
...(columns && {
columnCount: columns
})
}
}, postTemplateBlock.innerBlocks);
return [newAttributes, replacePostTemplateBlock(innerBlocks, newPostTemplateBlock)];
};
// Version with NO wrapper `div` element.
const query_deprecated_v1 = {
attributes: {
queryId: {
type: 'number'
},
query: {
type: 'object',
default: {
perPage: null,
pages: 0,
offset: 0,
postType: 'post',
categoryIds: [],
tagIds: [],
order: 'desc',
orderBy: 'date',
author: '',
search: '',
exclude: [],
sticky: '',
inherit: true
}
},
layout: {
type: 'object',
default: {
type: 'list'
}
}
},
supports: {
html: false
},
migrate(attributes, innerBlocks) {
const withTaxQuery = migrateToTaxQuery(attributes);
const {
layout,
...restWithTaxQuery
} = withTaxQuery;
const newAttributes = {
...restWithTaxQuery,
displayLayout: withTaxQuery.layout
};
return migrateDisplayLayout(newAttributes, innerBlocks);
},
save() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {});
}
};
// Version with `categoryIds and tagIds`.
const query_deprecated_v2 = {
attributes: {
queryId: {
type: 'number'
},
query: {
type: 'object',
default: {
perPage: null,
pages: 0,
offset: 0,
postType: 'post',
categoryIds: [],
tagIds: [],
order: 'desc',
orderBy: 'date',
author: '',
search: '',
exclude: [],
sticky: '',
inherit: true
}
},
tagName: {
type: 'string',
default: 'div'
},
displayLayout: {
type: 'object',
default: {
type: 'list'
}
}
},
supports: {
align: ['wide', 'full'],
html: false,
color: {
gradients: true,
link: true
},
layout: true
},
isEligible: ({
query: {
categoryIds,
tagIds
} = {}
}) => categoryIds || tagIds,
migrate(attributes, innerBlocks) {
const withTaxQuery = migrateToTaxQuery(attributes);
const [withColorAttributes, withColorInnerBlocks] = migrateColors(withTaxQuery, innerBlocks);
const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes);
return migrateDisplayLayout(withConstrainedLayoutAttributes, withColorInnerBlocks);
},
save({
attributes: {
tagName: Tag = 'div'
}
}) {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
...innerBlocksProps
});
}
};
// Version with color support prior to moving it to the PostTemplate block.
const query_deprecated_v3 = {
attributes: {
queryId: {
type: 'number'
},
query: {
type: 'object',
default: {
perPage: null,
pages: 0,
offset: 0,
postType: 'post',
order: 'desc',
orderBy: 'date',
author: '',
search: '',
exclude: [],
sticky: '',
inherit: true,
taxQuery: null,
parents: []
}
},
tagName: {
type: 'string',
default: 'div'
},
displayLayout: {
type: 'object',
default: {
type: 'list'
}
},
namespace: {
type: 'string'
}
},
supports: {
align: ['wide', 'full'],
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
layout: true
},
isEligible(attributes) {
const {
style,
backgroundColor,
gradient,
textColor
} = attributes;
return backgroundColor || gradient || textColor || style?.color || style?.elements?.link;
},
migrate(attributes, innerBlocks) {
const [withColorAttributes, withColorInnerBlocks] = migrateColors(attributes, innerBlocks);
const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes);
return migrateDisplayLayout(withConstrainedLayoutAttributes, withColorInnerBlocks);
},
save({
attributes: {
tagName: Tag = 'div'
}
}) {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
...innerBlocksProps
});
}
};
const query_deprecated_v4 = {
attributes: {
queryId: {
type: 'number'
},
query: {
type: 'object',
default: {
perPage: null,
pages: 0,
offset: 0,
postType: 'post',
order: 'desc',
orderBy: 'date',
author: '',
search: '',
exclude: [],
sticky: '',
inherit: true,
taxQuery: null,
parents: []
}
},
tagName: {
type: 'string',
default: 'div'
},
displayLayout: {
type: 'object',
default: {
type: 'list'
}
},
namespace: {
type: 'string'
}
},
supports: {
align: ['wide', 'full'],
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
layout: true
},
save({
attributes: {
tagName: Tag = 'div'
}
}) {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
...innerBlocksProps
});
},
isEligible: ({
layout
}) => layout?.inherit || layout?.contentSize && layout?.type !== 'constrained',
migrate(attributes, innerBlocks) {
const withConstrainedLayoutAttributes = migrateToConstrainedLayout(attributes);
return migrateDisplayLayout(withConstrainedLayoutAttributes, innerBlocks);
}
};
const query_deprecated_v5 = {
attributes: {
queryId: {
type: 'number'
},
query: {
type: 'object',
default: {
perPage: null,
pages: 0,
offset: 0,
postType: 'post',
order: 'desc',
orderBy: 'date',
author: '',
search: '',
exclude: [],
sticky: '',
inherit: true,
taxQuery: null,
parents: []
}
},
tagName: {
type: 'string',
default: 'div'
},
displayLayout: {
type: 'object',
default: {
type: 'list'
}
},
namespace: {
type: 'string'
}
},
supports: {
align: ['wide', 'full'],
anchor: true,
html: false,
layout: true
},
save({
attributes: {
tagName: Tag = 'div'
}
}) {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
...innerBlocksProps
});
},
isEligible: ({
displayLayout
}) => {
return !!displayLayout;
},
migrate: migrateDisplayLayout
};
const query_deprecated_deprecated = [query_deprecated_v5, query_deprecated_v4, query_deprecated_v3, query_deprecated_v2, query_deprecated_v1];
/* harmony default export */ const query_deprecated = (query_deprecated_deprecated);
;// ./node_modules/@wordpress/block-library/build-module/query/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/query",
title: "Query Loop",
category: "theme",
description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
keywords: ["posts", "list", "blog", "blogs", "custom post types"],
textdomain: "default",
attributes: {
queryId: {
type: "number"
},
query: {
type: "object",
"default": {
perPage: null,
pages: 0,
offset: 0,
postType: "post",
order: "desc",
orderBy: "date",
author: "",
search: "",
exclude: [],
sticky: "",
inherit: true,
taxQuery: null,
parents: [],
format: []
}
},
tagName: {
type: "string",
"default": "div"
},
namespace: {
type: "string"
},
enhancedPagination: {
type: "boolean",
"default": false
}
},
usesContext: ["templateSlug"],
providesContext: {
queryId: "queryId",
query: "query",
displayLayout: "displayLayout",
enhancedPagination: "enhancedPagination"
},
supports: {
align: ["wide", "full"],
html: false,
layout: true,
interactivity: true
},
editorStyle: "wp-block-query-editor"
};
const {
name: query_name
} = query_metadata;
const query_settings = {
icon: library_loop,
edit: query_edit,
example: {
viewportWidth: 650,
attributes: {
namespace: 'core/posts-list',
query: {
perPage: 4,
pages: 1,
offset: 0,
postType: 'post',
order: 'desc',
orderBy: 'date',
author: '',
search: '',
sticky: 'exclude',
inherit: false
}
},
innerBlocks: [{
name: 'core/post-template',
attributes: {
layout: {
type: 'grid',
columnCount: 2
}
},
innerBlocks: [{
name: 'core/post-title'
}, {
name: 'core/post-date'
}, {
name: 'core/post-excerpt'
}]
}]
},
save: query_save_save,
variations: query_variations,
deprecated: query_deprecated
};
const query_init = () => initBlock({
name: query_name,
metadata: query_metadata,
settings: query_settings
});
;// ./node_modules/@wordpress/block-library/build-module/query-no-results/edit.js
/**
* WordPress dependencies
*/
const query_no_results_edit_TEMPLATE = [['core/paragraph', {
placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text or blocks that will display when a query returns no results.')
}]];
function QueryNoResultsEdit() {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: query_no_results_edit_TEMPLATE
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...innerBlocksProps
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-no-results/save.js
/**
* WordPress dependencies
*/
function query_no_results_save_save() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {});
}
;// ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_no_results_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/query-no-results",
title: "No Results",
category: "theme",
description: "Contains the block elements used to render content when no query results are found.",
ancestor: ["core/query"],
textdomain: "default",
usesContext: ["queryId", "query"],
supports: {
align: true,
reusable: false,
html: false,
color: {
gradients: true,
link: 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: query_no_results_name
} = query_no_results_metadata;
const query_no_results_settings = {
icon: library_loop,
edit: QueryNoResultsEdit,
save: query_no_results_save_save,
example: {
innerBlocks: [{
name: 'core/paragraph',
attributes: {
content: (0,external_wp_i18n_namespaceObject.__)('No posts were found.')
}
}]
}
};
const query_no_results_init = () => initBlock({
name: query_no_results_name,
metadata: query_no_results_metadata,
settings: query_no_results_settings
});
;// ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js
/**
* WordPress dependencies
*/
function QueryPaginationArrowControls({
value,
onChange
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
value: value,
onChange: onChange,
help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'),
isBlock: true,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "none",
label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "arrow",
label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "chevron",
label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks')
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-label-control.js
/**
* WordPress dependencies
*/
function QueryPaginationLabelControl({
value,
onChange
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show label text'),
help: (0,external_wp_i18n_namespaceObject.__)('Make label text visible, e.g. "Next Page".'),
onChange: onChange,
checked: value === true
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']];
function edit_QueryPaginationEdit({
attributes: {
paginationArrow,
showLabel
},
setAttributes,
clientId
}) {
const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlocks
} = select(external_wp_blockEditor_namespaceObject.store);
const innerBlocks = getBlocks(clientId);
/**
* Show the `paginationArrow` and `showLabel` controls only if a
* `QueryPaginationNext/Previous` block exists.
*/
return innerBlocks?.find(innerBlock => {
return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name);
});
}, [clientId]);
const {
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: query_pagination_edit_TEMPLATE
});
// Always show label text if paginationArrow is set to 'none'.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (paginationArrow === 'none' && !showLabel) {
__unstableMarkNextChangeAsNotPersistent();
setAttributes({
showLabel: true
});
}
}, [paginationArrow, setAttributes, showLabel, __unstableMarkNextChangeAsNotPersistent]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [hasNextPreviousBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
paginationArrow: 'none',
showLabel: true
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => paginationArrow !== 'none',
label: (0,external_wp_i18n_namespaceObject.__)('Pagination arrow'),
onDeselect: () => setAttributes({
paginationArrow: 'none'
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryPaginationArrowControls, {
value: paginationArrow,
onChange: value => {
setAttributes({
paginationArrow: value
});
}
})
}), paginationArrow !== 'none' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !showLabel,
label: (0,external_wp_i18n_namespaceObject.__)('Show text'),
onDeselect: () => setAttributes({
showLabel: true
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryPaginationLabelControl, {
value: showLabel,
onChange: value => {
setAttributes({
showLabel: value
});
}
})
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", {
...innerBlocksProps
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js
/**
* WordPress dependencies
*/
function query_pagination_save_save() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {});
}
;// ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js
/**
* WordPress dependencies
*/
const query_pagination_deprecated_deprecated = [
// Version with wrapper `div` element.
{
save() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save(),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})
});
}
}];
/* harmony default export */ const query_pagination_deprecated = (query_pagination_deprecated_deprecated);
;// ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_pagination_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/query-pagination",
title: "Pagination",
category: "theme",
ancestor: ["core/query"],
allowedBlocks: ["core/query-pagination-previous", "core/query-pagination-numbers", "core/query-pagination-next"],
description: "Displays a paginated navigation to next/previous set of posts, when applicable.",
textdomain: "default",
attributes: {
paginationArrow: {
type: "string",
"default": "none"
},
showLabel: {
type: "boolean",
"default": true
}
},
usesContext: ["queryId", "query"],
providesContext: {
paginationArrow: "paginationArrow",
showLabel: "showLabel"
},
supports: {
align: true,
reusable: false,
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
layout: {
allowSwitching: false,
allowInheriting: false,
"default": {
type: "flex"
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
}
},
editorStyle: "wp-block-query-pagination-editor",
style: "wp-block-query-pagination"
};
const {
name: query_pagination_name
} = query_pagination_metadata;
const query_pagination_settings = {
icon: query_pagination,
edit: edit_QueryPaginationEdit,
save: query_pagination_save_save,
deprecated: query_pagination_deprecated
};
const query_pagination_init = () => initBlock({
name: query_pagination_name,
metadata: query_pagination_metadata,
settings: query_pagination_settings
});
;// ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js
/**
* WordPress dependencies
*/
const query_pagination_next_edit_arrowMap = {
none: '',
arrow: '→',
chevron: '»'
};
function QueryPaginationNextEdit({
attributes: {
label
},
setAttributes,
context: {
paginationArrow,
showLabel
}
}) {
const displayArrow = query_pagination_next_edit_arrowMap[paginationArrow];
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", {
href: "#pagination-next-pseudo-link",
onClick: event => event.preventDefault(),
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(),
children: [showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'),
value: label,
onChange: newLabel => setAttributes({
label: newLabel
})
}), displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: `wp-block-query-pagination-next-arrow is-arrow-${paginationArrow}`,
"aria-hidden": true,
children: displayArrow
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_pagination_next_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/query-pagination-next",
title: "Next Page",
category: "theme",
parent: ["core/query-pagination"],
description: "Displays the next posts page link.",
textdomain: "default",
attributes: {
label: {
type: "string"
}
},
usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"],
supports: {
reusable: false,
html: false,
color: {
gradients: true,
text: false,
__experimentalDefaultControls: {
background: 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: query_pagination_next_name
} = query_pagination_next_metadata;
const query_pagination_next_settings = {
icon: query_pagination_next,
edit: QueryPaginationNextEdit
};
const query_pagination_next_init = () => initBlock({
name: query_pagination_next_name,
metadata: query_pagination_next_metadata,
settings: query_pagination_next_settings
});
;// ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const createPaginationItem = (content, Tag = 'a', extraClass = '') => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
className: `page-numbers ${extraClass}`,
children: content
}, content);
const previewPaginationNumbers = midSize => {
const paginationItems = [];
// First set of pagination items.
for (let i = 1; i <= midSize; i++) {
paginationItems.push(createPaginationItem(i));
}
// Current pagination item.
paginationItems.push(createPaginationItem(midSize + 1, 'span', 'current'));
// Second set of pagination items.
for (let i = 1; i <= midSize; i++) {
paginationItems.push(createPaginationItem(midSize + 1 + i));
}
// Dots.
paginationItems.push(createPaginationItem('...', 'span', 'dots'));
// Last pagination item.
paginationItems.push(createPaginationItem(midSize * 2 + 3));
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: paginationItems
});
};
function QueryPaginationNumbersEdit({
attributes,
setAttributes
}) {
const {
midSize
} = attributes;
const paginationNumbers = previewPaginationNumbers(parseInt(midSize, 10));
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => setAttributes({
midSize: 2
}),
dropdownMenuProps: dropdownMenuProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Number of links'),
hasValue: () => midSize !== 2,
onDeselect: () => setAttributes({
midSize: 2
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Number of links'),
help: (0,external_wp_i18n_namespaceObject.__)('Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'),
value: midSize,
onChange: value => {
setAttributes({
midSize: parseInt(value, 10)
});
},
min: 0,
max: 5,
withInputField: false
})
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(),
children: paginationNumbers
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_pagination_numbers_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/query-pagination-numbers",
title: "Page Numbers",
category: "theme",
parent: ["core/query-pagination"],
description: "Displays a list of page numbers for pagination.",
textdomain: "default",
attributes: {
midSize: {
type: "number",
"default": 2
}
},
usesContext: ["queryId", "query", "enhancedPagination"],
supports: {
reusable: false,
html: false,
color: {
gradients: true,
text: false,
__experimentalDefaultControls: {
background: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
}
},
editorStyle: "wp-block-query-pagination-numbers-editor"
};
const {
name: query_pagination_numbers_name
} = query_pagination_numbers_metadata;
const query_pagination_numbers_settings = {
icon: query_pagination_numbers,
edit: QueryPaginationNumbersEdit,
example: {}
};
const query_pagination_numbers_init = () => initBlock({
name: query_pagination_numbers_name,
metadata: query_pagination_numbers_metadata,
settings: query_pagination_numbers_settings
});
;// ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js
/**
* WordPress dependencies
*/
const query_pagination_previous_edit_arrowMap = {
none: '',
arrow: '←',
chevron: '«'
};
function QueryPaginationPreviousEdit({
attributes: {
label
},
setAttributes,
context: {
paginationArrow,
showLabel
}
}) {
const displayArrow = query_pagination_previous_edit_arrowMap[paginationArrow];
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", {
href: "#pagination-previous-pseudo-link",
onClick: event => event.preventDefault(),
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(),
children: [displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`,
"aria-hidden": true,
children: displayArrow
}), showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'),
value: label,
onChange: newLabel => setAttributes({
label: newLabel
})
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_pagination_previous_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/query-pagination-previous",
title: "Previous Page",
category: "theme",
parent: ["core/query-pagination"],
description: "Displays the previous posts page link.",
textdomain: "default",
attributes: {
label: {
type: "string"
}
},
usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"],
supports: {
reusable: false,
html: false,
color: {
gradients: true,
text: false,
__experimentalDefaultControls: {
background: 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: query_pagination_previous_name
} = query_pagination_previous_metadata;
const query_pagination_previous_settings = {
icon: query_pagination_previous,
edit: QueryPaginationPreviousEdit
};
const query_pagination_previous_init = () => initBlock({
name: query_pagination_previous_name,
metadata: query_pagination_previous_metadata,
settings: query_pagination_previous_settings
});
;// ./node_modules/@wordpress/block-library/build-module/query-title/use-archive-label.js
/**
* WordPress dependencies
*/
function useArchiveLabel() {
const templateSlug = (0,external_wp_data_namespaceObject.useSelect)(select => {
// @wordpress/block-library should not depend on @wordpress/editor.
// Blocks can be loaded into a *non-post* block editor, so to avoid
// declaring @wordpress/editor as a dependency, we must access its
// store by string.
// The solution here is to split WP specific blocks from generic blocks.
// eslint-disable-next-line @wordpress/data-no-store-string-literals
const {
getCurrentPostId,
getCurrentPostType,
getCurrentTemplateId
} = select('core/editor');
const currentPostType = getCurrentPostType();
const templateId = getCurrentTemplateId() || (currentPostType === 'wp_template' ? getCurrentPostId() : null);
return templateId ? select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_template', templateId)?.slug : null;
}, []);
const taxonomyMatches = templateSlug?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/);
let taxonomy;
let term;
let isAuthor = false;
let authorSlug;
if (taxonomyMatches) {
// If is for a all taxonomies of a type
if (taxonomyMatches[1]) {
taxonomy = taxonomyMatches[2] ? taxonomyMatches[2] : taxonomyMatches[1];
}
// If is for a all taxonomies of a type
else if (taxonomyMatches[3]) {
taxonomy = taxonomyMatches[6] ? taxonomyMatches[6] : taxonomyMatches[4];
term = taxonomyMatches[7];
}
taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;
//getTaxonomy( 'category' );
//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );
} else {
const authorMatches = templateSlug?.match(/^(author)$|^author-(.+)$/);
if (authorMatches) {
isAuthor = true;
if (authorMatches[2]) {
authorSlug = authorMatches[2];
}
}
}
return (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords,
getTaxonomy,
getAuthors
} = select(external_wp_coreData_namespaceObject.store);
let archiveTypeLabel;
let archiveNameLabel;
if (taxonomy) {
archiveTypeLabel = getTaxonomy(taxonomy)?.labels?.singular_name;
}
if (term) {
const records = getEntityRecords('taxonomy', taxonomy, {
slug: term,
per_page: 1
});
if (records && records[0]) {
archiveNameLabel = records[0].name;
}
}
if (isAuthor) {
archiveTypeLabel = 'Author';
if (authorSlug) {
const authorRecords = getAuthors({
slug: authorSlug
});
if (authorRecords && authorRecords[0]) {
archiveNameLabel = authorRecords[0].name;
}
}
}
return {
archiveTypeLabel,
archiveNameLabel
};
}, [authorSlug, isAuthor, taxonomy, term]);
}
;// ./node_modules/@wordpress/block-library/build-module/query-title/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const SUPPORTED_TYPES = ['archive', 'search'];
function QueryTitleEdit({
attributes: {
type,
level,
levelOptions,
textAlign,
showPrefix,
showSearchTerm
},
setAttributes
}) {
const {
archiveTypeLabel,
archiveNameLabel
} = useArchiveLabel();
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const TagName = `h${level}`;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx('wp-block-query-title__placeholder', {
[`has-text-align-${textAlign}`]: textAlign
})
});
if (!SUPPORTED_TYPES.includes(type)) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
children: (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.')
})
});
}
let titleElement;
if (type === 'archive') {
let title;
if (archiveTypeLabel) {
if (showPrefix) {
if (archiveNameLabel) {
title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */
(0,external_wp_i18n_namespaceObject._x)('%1$s: %2$s', 'archive label'), archiveTypeLabel, archiveNameLabel);
} else {
title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Archive type title e.g: "Category", "Tag"... */
(0,external_wp_i18n_namespaceObject.__)('%s: Name'), archiveTypeLabel);
}
} else if (archiveNameLabel) {
title = archiveNameLabel;
} else {
title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Archive type title e.g: "Category", "Tag"... */
(0,external_wp_i18n_namespaceObject.__)('%s name'), archiveTypeLabel);
}
} else {
title = showPrefix ? (0,external_wp_i18n_namespaceObject.__)('Archive type: Name') : (0,external_wp_i18n_namespaceObject.__)('Archive title');
}
titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => setAttributes({
showPrefix: true
}),
dropdownMenuProps: dropdownMenuProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !showPrefix,
label: (0,external_wp_i18n_namespaceObject.__)('Show archive type in title'),
onDeselect: () => setAttributes({
showPrefix: true
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show archive type in title'),
onChange: () => setAttributes({
showPrefix: !showPrefix
}),
checked: showPrefix
})
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
children: title
})]
});
}
if (type === 'search') {
titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => setAttributes({
showSearchTerm: true
}),
dropdownMenuProps: dropdownMenuProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !showSearchTerm,
label: (0,external_wp_i18n_namespaceObject.__)('Show search term in title'),
onDeselect: () => setAttributes({
showSearchTerm: true
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show search term in title'),
onChange: () => setAttributes({
showSearchTerm: !showSearchTerm
}),
checked: showSearchTerm
})
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
children: showSearchTerm ? (0,external_wp_i18n_namespaceObject.__)('Search results for: “search term”') : (0,external_wp_i18n_namespaceObject.__)('Search results')
})]
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, {
value: level,
options: levelOptions,
onChange: newLevel => setAttributes({
level: newLevel
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
})]
}), titleElement]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-title/variations.js
/**
* WordPress dependencies
*/
const query_title_variations_variations = [{
isDefault: true,
name: 'archive-title',
title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'),
description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'),
icon: library_title,
attributes: {
type: 'archive'
},
scope: ['inserter']
}, {
isDefault: false,
name: 'search-title',
title: (0,external_wp_i18n_namespaceObject.__)('Search Results Title'),
description: (0,external_wp_i18n_namespaceObject.__)('Display the search results title based on the queried object.'),
icon: library_title,
attributes: {
type: 'search'
},
scope: ['inserter']
}];
/**
* Add `isActive` function to all `query-title` variations, if not defined.
* `isActive` function is used to find a variation match from a created
* Block by providing its attributes.
*/
query_title_variations_variations.forEach(variation => {
if (variation.isActive) {
return;
}
variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
});
/* harmony default export */ const query_title_variations = (query_title_variations_variations);
;// ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js
/**
* Internal dependencies
*/
const query_title_deprecated_v1 = {
attributes: {
type: {
type: 'string'
},
textAlign: {
type: 'string'
},
level: {
type: 'number',
default: 1
}
},
supports: {
align: ['wide', 'full'],
html: false,
color: {
gradients: true
},
spacing: {
margin: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true
}
},
save() {
return null;
},
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 query_title_deprecated = ([query_title_deprecated_v1]);
;// ./node_modules/@wordpress/block-library/build-module/query-title/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const query_title_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/query-title",
title: "Query Title",
category: "theme",
description: "Display the query title.",
textdomain: "default",
attributes: {
type: {
type: "string"
},
textAlign: {
type: "string"
},
level: {
type: "number",
"default": 1
},
levelOptions: {
type: "array"
},
showPrefix: {
type: "boolean",
"default": true
},
showSearchTerm: {
type: "boolean",
"default": true
}
},
example: {
attributes: {
type: "search"
}
},
supports: {
align: ["wide", "full"],
html: false,
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-query-title"
};
const {
name: query_title_name
} = query_title_metadata;
const query_title_settings = {
icon: library_title,
edit: QueryTitleEdit,
variations: query_title_variations,
deprecated: query_title_deprecated
};
const query_title_init = () => initBlock({
name: query_title_name,
metadata: query_title_metadata,
settings: query_title_settings
});
;// ./node_modules/@wordpress/block-library/build-module/query-total/icons.js
/**
* WordPress dependencies
*/
const resultsFound = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
"aria-hidden": "true",
focusable: "false",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M4 11h4v2H4v-2zm6 0h6v2h-6v-2zm8 0h2v2h-2v-2z"
})
});
const displayingResults = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
"aria-hidden": "true",
focusable: "false",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M4 13h2v-2H4v2zm4 0h10v-2H8v2zm12 0h2v-2h-2v2z"
})
});
const queryTotal = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
"aria-hidden": "true",
focusable: "false",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2Zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12Zm-7-6-4.1 5h8.8v-3h-1.5v1.5h-4.2l2.9-3.5-2.9-3.5h4.2V10h1.5V7H7.4l4.1 5Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/query-total/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function QueryTotalEdit({
attributes,
setAttributes
}) {
const {
displayType
} = attributes;
// Block properties and classes.
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const getButtonPositionIcon = () => {
switch (displayType) {
case 'total-results':
return resultsFound;
case 'range-display':
return displayingResults;
}
};
const buttonPositionControls = [{
role: 'menuitemradio',
title: (0,external_wp_i18n_namespaceObject.__)('Total results'),
isActive: displayType === 'total-results',
icon: resultsFound,
onClick: () => {
setAttributes({
displayType: 'total-results'
});
}
}, {
role: 'menuitemradio',
title: (0,external_wp_i18n_namespaceObject.__)('Range display'),
isActive: displayType === 'range-display',
icon: displayingResults,
onClick: () => {
setAttributes({
displayType: 'range-display'
});
}
}];
// Controls for the block.
const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
icon: getButtonPositionIcon(),
label: (0,external_wp_i18n_namespaceObject.__)('Change display type'),
controls: buttonPositionControls
})
})
});
// Render output based on the selected display type.
const renderDisplay = () => {
if (displayType === 'total-results') {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: (0,external_wp_i18n_namespaceObject.__)('12 results found')
});
}
if (displayType === 'range-display') {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: (0,external_wp_i18n_namespaceObject.__)('Displaying 1 – 10 of 12')
});
}
return null;
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...blockProps,
children: [controls, renderDisplay()]
});
}
;// ./node_modules/@wordpress/block-library/build-module/query-total/index.js
/**
* Internal dependencies
*/
const query_total_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/query-total",
title: "Query Total",
category: "theme",
ancestor: ["core/query"],
description: "Display the total number of results in a query.",
textdomain: "default",
attributes: {
displayType: {
type: "string",
"default": "total-results"
}
},
usesContext: ["queryId", "query"],
supports: {
align: ["wide", "full"],
html: false,
spacing: {
margin: true,
padding: true
},
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
},
interactivity: {
clientNavigation: true
}
},
style: "wp-block-query-total"
};
/* Block settings */
const {
name: query_total_name
} = query_total_metadata;
const query_total_settings = {
icon: queryTotal,
edit: QueryTotalEdit
};
const query_total_init = () => initBlock({
name: query_total_name,
metadata: query_total_metadata,
settings: query_total_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/quote.js
/**
* WordPress dependencies
*/
const quote = /*#__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: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"
})
});
/* harmony default export */ const library_quote = (quote);
;// ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const migrateToQuoteV2 = attributes => {
const {
value,
...restAttributes
} = attributes;
return [{
...restAttributes
}, value ? (0,external_wp_blocks_namespaceObject.parseWithAttributeSchema)(value, {
type: 'array',
source: 'query',
selector: 'p',
query: {
content: {
type: 'string',
source: 'html'
}
}
}).map(({
content
}) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content
})) : (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')];
};
const deprecated_TEXT_ALIGN_OPTIONS = ['left', 'right', 'center'];
// Migrate existing text alignment settings to the renamed attribute.
const deprecated_migrateTextAlign = (attributes, innerBlocks) => {
const {
align,
...rest
} = attributes;
// Check if there are valid alignments stored in the old attribute
// and assign them to the new attribute name.
const migratedAttributes = deprecated_TEXT_ALIGN_OPTIONS.includes(align) ? {
...rest,
textAlign: align
} : attributes;
return [migratedAttributes, innerBlocks];
};
// Migrate the v2 blocks with style === `2`;
const migrateLargeStyle = (attributes, innerBlocks) => {
return [{
...attributes,
className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
}, innerBlocks];
};
// Version before the 'align' attribute was replaced with 'textAlign'.
const quote_deprecated_v4 = {
attributes: {
value: {
type: 'string',
source: 'html',
selector: 'blockquote',
multiline: 'p',
default: '',
role: 'content'
},
citation: {
type: 'string',
source: 'html',
selector: 'cite',
default: '',
role: 'content'
},
align: {
type: 'string'
}
},
supports: {
anchor: true,
html: false,
__experimentalOnEnter: true,
__experimentalOnMerge: true,
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true,
fontAppearance: true
}
},
color: {
gradients: true,
heading: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
}
},
isEligible: ({
align
}) => deprecated_TEXT_ALIGN_OPTIONS.includes(align),
save({
attributes
}) {
const {
align,
citation
} = attributes;
const className = dist_clsx({
[`has-text-align-${align}`]: align
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
}),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
});
},
migrate: deprecated_migrateTextAlign
};
const quote_deprecated_v3 = {
attributes: {
value: {
type: 'string',
source: 'html',
selector: 'blockquote',
multiline: 'p',
default: '',
role: 'content'
},
citation: {
type: 'string',
source: 'html',
selector: 'cite',
default: '',
role: 'content'
},
align: {
type: 'string'
}
},
supports: {
anchor: true,
__experimentalSlashInserter: true,
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalTextTransform: true,
__experimentalDefaultControls: {
fontSize: true,
fontAppearance: true
}
}
},
save({
attributes
}) {
const {
align,
value,
citation
} = attributes;
const className = dist_clsx({
[`has-text-align-${align}`]: align
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
}),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
multiline: true,
value: value
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
});
},
migrate(attributes) {
return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes));
}
};
const quote_deprecated_v2 = {
attributes: {
value: {
type: 'string',
source: 'html',
selector: 'blockquote',
multiline: 'p',
default: ''
},
citation: {
type: 'string',
source: 'html',
selector: 'cite',
default: ''
},
align: {
type: 'string'
}
},
migrate(attributes) {
return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes));
},
save({
attributes
}) {
const {
align,
value,
citation
} = attributes;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
style: {
textAlign: align ? align : null
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
multiline: true,
value: value
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
});
}
};
const quote_deprecated_v1 = {
attributes: {
value: {
type: 'string',
source: 'html',
selector: 'blockquote',
multiline: 'p',
default: ''
},
citation: {
type: 'string',
source: 'html',
selector: 'cite',
default: ''
},
align: {
type: 'string'
},
style: {
type: 'number',
default: 1
}
},
migrate(attributes) {
if (attributes.style === 2) {
const {
style,
...restAttributes
} = attributes;
return deprecated_migrateTextAlign(...migrateLargeStyle(...migrateToQuoteV2(restAttributes)));
}
return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes));
},
save({
attributes
}) {
const {
align,
value,
citation,
style
} = attributes;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
className: style === 2 ? 'is-large' : '',
style: {
textAlign: align ? align : null
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
multiline: true,
value: value
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
});
}
};
const quote_deprecated_v0 = {
attributes: {
value: {
type: 'string',
source: 'html',
selector: 'blockquote',
multiline: 'p',
default: ''
},
citation: {
type: 'string',
source: 'html',
selector: 'footer',
default: ''
},
align: {
type: 'string'
},
style: {
type: 'number',
default: 1
}
},
migrate(attributes) {
if (!isNaN(parseInt(attributes.style))) {
const {
style,
...restAttributes
} = attributes;
return deprecated_migrateTextAlign(...migrateToQuoteV2(restAttributes));
}
return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes));
},
save({
attributes
}) {
const {
align,
value,
citation,
style
} = attributes;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
className: `blocks-quote-style-${style}`,
style: {
textAlign: align ? align : null
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
multiline: true,
value: value
}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "footer",
value: citation
})]
});
}
};
/**
* 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 quote_deprecated = ([quote_deprecated_v4, quote_deprecated_v3, quote_deprecated_v2, quote_deprecated_v1, quote_deprecated_v0]);
;// ./node_modules/@wordpress/icons/build-module/library/verse.js
/**
* WordPress dependencies
*/
const verse = /*#__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: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"
})
});
/* harmony default export */ const library_verse = (verse);
;// ./node_modules/@wordpress/block-library/build-module/quote/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const edit_isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
const quote_edit_TEMPLATE = [['core/paragraph', {}]];
/**
* At the moment, deprecations don't handle create blocks from attributes
* (like when using CPT templates). For this reason, this hook is necessary
* to avoid breaking templates using the old quote block format.
*
* @param {Object} attributes Block attributes.
* @param {string} clientId Block client ID.
*/
const edit_useMigrateOnLoad = (attributes, clientId) => {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const {
updateBlockAttributes,
replaceInnerBlocks
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
// As soon as the block is loaded, migrate it to the new version.
if (!attributes.value) {
// No need to migrate if it doesn't have the value attribute.
return;
}
const [newAttributes, newInnerBlocks] = migrateToQuoteV2(attributes);
external_wp_deprecated_default()('Value attribute on the quote block', {
since: '6.0',
version: '6.5',
alternative: 'inner blocks'
});
registry.batch(() => {
updateBlockAttributes(clientId, newAttributes);
replaceInnerBlocks(clientId, newInnerBlocks);
});
}, [attributes.value]);
};
function QuoteEdit({
attributes,
setAttributes,
insertBlocksAfter,
clientId,
className,
style,
isSelected
}) {
const {
textAlign
} = attributes;
edit_useMigrateOnLoad(attributes, clientId);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx(className, {
[`has-text-align-${textAlign}`]: textAlign
}),
...(!edit_isWebPlatform && {
style
})
});
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: quote_edit_TEMPLATE,
templateInsertUpdatesSelection: true,
__experimentalCaptureToolbars: true,
renderAppender: false
});
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.jsxs)(external_wp_components_namespaceObject.BlockQuotation, {
...innerBlocksProps,
children: [innerBlocksProps.children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, {
attributeKey: "citation",
tagName: edit_isWebPlatform ? 'cite' : 'p',
style: edit_isWebPlatform && {
display: 'block'
},
isSelected: isSelected,
attributes: attributes,
setAttributes: setAttributes,
__unstableMobileNoFocusOnMount: true,
icon: library_verse,
label: (0,external_wp_i18n_namespaceObject.__)('Quote citation'),
placeholder:
// translators: placeholder text used for the
// citation
(0,external_wp_i18n_namespaceObject.__)('Add citation'),
addLabel: (0,external_wp_i18n_namespaceObject.__)('Add citation'),
removeLabel: (0,external_wp_i18n_namespaceObject.__)('Remove citation'),
excludeElementClassName: true,
className: "wp-block-quote__citation",
insertBlocksAfter: insertBlocksAfter,
...(!edit_isWebPlatform ? {
textAlign
} : {})
})]
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/quote/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function quote_save_save({
attributes
}) {
const {
textAlign,
citation
} = attributes;
const className = dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
}),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/quote/transforms.js
/**
* WordPress dependencies
*/
const quote_transforms_transforms = {
from: [{
type: 'block',
blocks: ['core/pullquote'],
transform: ({
value,
align,
citation,
anchor,
fontSize,
style
}) => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
align,
citation,
anchor,
fontSize,
style
}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: value
})]);
}
}, {
type: 'prefix',
prefix: '>',
transform: content => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content
})])
}, {
type: 'raw',
schema: () => ({
blockquote: {
children: '*'
}
}),
selector: 'blockquote',
transform: (node, handler) => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote',
// Don't try to parse any `cite` out of this content.
// * There may be more than one cite.
// * There may be more attribution text than just the cite.
// * If the cite is nested in the quoted text, it's wrong to
// remove it.
{}, handler({
HTML: node.innerHTML,
mode: 'BLOCKS'
}));
}
}, {
type: 'block',
isMultiBlock: true,
blocks: ['*'],
isMatch: ({}, blocks) => {
// When a single block is selected make the transformation
// available only to specific blocks that make sense.
if (blocks.length === 1) {
return ['core/paragraph', 'core/heading', 'core/list', 'core/pullquote'].includes(blocks[0].name);
}
return !blocks.some(({
name
}) => name === 'core/quote');
},
__experimentalConvert: blocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, blocks.map(block => (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks)))
}],
to: [{
type: 'block',
blocks: ['core/pullquote'],
isMatch: ({}, block) => {
return block.innerBlocks.every(({
name
}) => name === 'core/paragraph');
},
transform: ({
align,
citation,
anchor,
fontSize,
style
}, innerBlocks) => {
const value = innerBlocks.map(({
attributes
}) => `${attributes.content}`).join(' ');
return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
value,
align,
citation,
anchor,
fontSize,
style
});
}
}, {
type: 'block',
blocks: ['core/paragraph'],
transform: ({
citation
}, innerBlocks) => external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: citation
})]
}, {
type: 'block',
blocks: ['core/group'],
transform: ({
citation,
anchor
}, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
anchor
}, external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: citation
})])
}],
ungroup: ({
citation
}, innerBlocks) => external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: citation
})]
};
/* harmony default export */ const quote_transforms = (quote_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/quote/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const quote_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/quote",
title: "Quote",
category: "text",
description: "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" \u2014 Julio Cort\xE1zar",
keywords: ["blockquote", "cite"],
textdomain: "default",
attributes: {
value: {
type: "string",
source: "html",
selector: "blockquote",
multiline: "p",
"default": "",
role: "content"
},
citation: {
type: "rich-text",
source: "rich-text",
selector: "cite",
role: "content"
},
textAlign: {
type: "string"
}
},
supports: {
anchor: true,
align: ["left", "right", "wide", "full"],
html: false,
background: {
backgroundImage: true,
backgroundSize: true,
__experimentalDefaultControls: {
backgroundImage: true
}
},
__experimentalBorder: {
color: true,
radius: true,
style: true,
width: true,
__experimentalDefaultControls: {
color: true,
radius: true,
style: true,
width: true
}
},
dimensions: {
minHeight: true,
__experimentalDefaultControls: {
minHeight: false
}
},
__experimentalOnEnter: true,
__experimentalOnMerge: true,
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
color: {
gradients: true,
heading: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
layout: {
allowEditing: false
},
spacing: {
blockGap: true,
padding: true,
margin: true
},
interactivity: {
clientNavigation: true
}
},
styles: [{
name: "default",
label: "Default",
isDefault: true
}, {
name: "plain",
label: "Plain"
}],
editorStyle: "wp-block-quote-editor",
style: "wp-block-quote"
};
const {
name: quote_name
} = quote_metadata;
const quote_settings = {
icon: library_quote,
example: {
attributes: {
citation: 'Julio Cortázar'
},
innerBlocks: [{
name: 'core/paragraph',
attributes: {
content: (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.')
}
}]
},
transforms: quote_transforms,
edit: QuoteEdit,
save: quote_save_save,
deprecated: quote_deprecated
};
const quote_init = () => initBlock({
name: quote_name,
metadata: quote_metadata,
settings: quote_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/symbol.js
/**
* WordPress dependencies
*/
const symbol = /*#__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-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 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 library_symbol = (symbol);
;// external ["wp","patterns"]
const external_wp_patterns_namespaceObject = window["wp"]["patterns"];
;// ./node_modules/@wordpress/block-library/build-module/block/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
useLayoutClasses
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const {
hasOverridableBlocks
} = unlock(external_wp_patterns_namespaceObject.privateApis);
const fullAlignments = ['full', 'wide', 'left', 'right'];
const useInferredLayout = (blocks, parentLayout) => {
const initialInferredAlignmentRef = (0,external_wp_element_namespaceObject.useRef)();
return (0,external_wp_element_namespaceObject.useMemo)(() => {
// Exit early if the pattern's blocks haven't loaded yet.
if (!blocks?.length) {
return {};
}
let alignment = initialInferredAlignmentRef.current;
// Only track the initial alignment so that temporarily removed
// alignments can be reapplied.
if (alignment === undefined) {
const isConstrained = parentLayout?.type === 'constrained';
const hasFullAlignment = blocks.some(block => fullAlignments.includes(block.attributes.align));
alignment = isConstrained && hasFullAlignment ? 'full' : null;
initialInferredAlignmentRef.current = alignment;
}
const layout = alignment ? parentLayout : undefined;
return {
alignment,
layout
};
}, [blocks, parentLayout]);
};
function RecursionWarning() {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...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.')
})
});
}
const edit_NOOP = () => {};
// Wrap the main Edit function for the pattern block with a recursion wrapper
// that allows short-circuiting rendering as early as possible, before any
// of the other effects in the block edit have run.
function ReusableBlockEditRecursionWrapper(props) {
const {
ref
} = props.attributes;
const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(ref);
if (hasAlreadyRendered) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RecursionWarning, {});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RecursionProvider, {
uniqueId: ref,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlockEdit, {
...props
})
});
}
function ReusableBlockControl({
recordId,
canOverrideBlocks,
hasContent,
handleEditOriginal,
resetContent
}) {
const canUserEdit = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_coreData_namespaceObject.store).canUser('update', {
kind: 'postType',
name: 'wp_block',
id: recordId
}), [recordId]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [canUserEdit && !!handleEditOriginal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: handleEditOriginal,
children: (0,external_wp_i18n_namespaceObject.__)('Edit original')
})
})
}), canOverrideBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: resetContent,
disabled: !hasContent,
children: (0,external_wp_i18n_namespaceObject.__)('Reset')
})
})
})]
});
}
function ReusableBlockEdit({
name,
attributes: {
ref,
content
},
__unstableParentLayout: parentLayout,
setAttributes
}) {
const {
record,
hasResolved
} = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_block', ref);
const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_block', {
id: ref
});
const isMissing = hasResolved && !record;
const {
__unstableMarkLastChangeAsPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const {
onNavigateToEntityRecord,
hasPatternOverridesSource
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
// For editing link to the site editor if the theme and user permissions support it.
return {
onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord,
hasPatternOverridesSource: !!(0,external_wp_blocks_namespaceObject.getBlockBindingsSource)('core/pattern-overrides')
};
}, []);
const canOverrideBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => hasPatternOverridesSource && hasOverridableBlocks(blocks), [hasPatternOverridesSource, blocks]);
const {
alignment,
layout
} = useInferredLayout(blocks, parentLayout);
const layoutClasses = useLayoutClasses({
layout
}, name);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx('block-library-block__reusable-block-container', layout && layoutClasses, {
[`align${alignment}`]: alignment
})
});
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
layout,
value: blocks,
onInput: edit_NOOP,
onChange: edit_NOOP,
renderAppender: blocks?.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
});
const handleEditOriginal = () => {
onNavigateToEntityRecord({
postId: ref,
postType: 'wp_block'
});
};
const resetContent = () => {
if (content) {
// Make sure any previous changes are persisted before resetting.
__unstableMarkLastChangeAsPersistent();
setAttributes({
content: undefined
});
}
};
let children = null;
if (isMissing) {
children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
children: (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.')
});
}
if (!hasResolved) {
children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [hasResolved && !isMissing && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlockControl, {
recordId: ref,
canOverrideBlocks: canOverrideBlocks,
hasContent: !!content,
handleEditOriginal: onNavigateToEntityRecord ? handleEditOriginal : undefined,
resetContent: resetContent
}), children === null ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...innerBlocksProps
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: children
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/block/deprecated.js
const isObject = obj => typeof obj === 'object' && !Array.isArray(obj) && obj !== null;
// v2: Migrate to a more condensed version of the 'content' attribute attribute.
const block_deprecated_v2 = {
attributes: {
ref: {
type: 'number'
},
content: {
type: 'object'
}
},
supports: {
customClassName: false,
html: false,
inserter: false,
renaming: false
},
// Force this deprecation to run whenever there's a values sub-property that's an object.
//
// This could fail in the future if a block ever has binding to a `values` attribute.
// Some extra protection is added to ensure `values` is an object, but this only reduces
// the likelihood, it doesn't solve it completely.
isEligible({
content
}) {
return !!content && Object.keys(content).every(contentKey => content[contentKey].values && isObject(content[contentKey].values));
},
/*
* Old attribute format:
* content: {
* "V98q_x": {
* // The attribute values are now stored as a 'values' sub-property.
* values: { content: 'My content value' },
* // ... additional metadata, like the block name can be stored here.
* }
* }
*
* New attribute format:
* content: {
* "V98q_x": {
* content: 'My content value',
* }
* }
*/
migrate(attributes) {
const {
content,
...retainedAttributes
} = attributes;
if (content && Object.keys(content).length) {
const updatedContent = {
...content
};
for (const contentKey in content) {
updatedContent[contentKey] = content[contentKey].values;
}
return {
...retainedAttributes,
content: updatedContent
};
}
return attributes;
}
};
// v1: Rename the `overrides` attribute to the `content` attribute.
const block_deprecated_v1 = {
attributes: {
ref: {
type: 'number'
},
overrides: {
type: 'object'
}
},
supports: {
customClassName: false,
html: false,
inserter: false,
renaming: false
},
// Force this deprecation to run whenever there's an `overrides` object.
isEligible({
overrides
}) {
return !!overrides;
},
/*
* Old attribute format:
* overrides: {
* // An key is an id that represents a block.
* // The values are the attribute values of the block.
* "V98q_x": { content: 'My content value' }
* }
*
* New attribute format:
* content: {
* "V98q_x": { content: 'My content value' }
* }
*
*/
migrate(attributes) {
const {
overrides,
...retainedAttributes
} = attributes;
const content = {};
Object.keys(overrides).forEach(id => {
content[id] = overrides[id];
});
return {
...retainedAttributes,
content
};
}
};
/* harmony default export */ const block_deprecated = ([block_deprecated_v2, block_deprecated_v1]);
;// ./node_modules/@wordpress/block-library/build-module/block/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const block_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/block",
title: "Pattern",
category: "reusable",
description: "Reuse this design across your site.",
keywords: ["reusable"],
textdomain: "default",
attributes: {
ref: {
type: "number"
},
content: {
type: "object",
"default": {}
}
},
providesContext: {
"pattern/overrides": "content"
},
supports: {
customClassName: false,
html: false,
inserter: false,
renaming: false,
interactivity: {
clientNavigation: true
}
}
};
const {
name: block_name
} = block_metadata;
const block_settings = {
deprecated: block_deprecated,
edit: ReusableBlockEditRecursionWrapper,
icon: library_symbol,
__experimentalLabel: ({
ref
}) => {
if (!ref) {
return;
}
const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_block', ref);
if (!entity?.title) {
return;
}
return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entity.title);
}
};
const block_init = () => initBlock({
name: block_name,
metadata: block_metadata,
settings: block_settings
});
;// ./node_modules/@wordpress/block-library/build-module/read-more/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ReadMore({
attributes: {
content,
linkTarget
},
setAttributes,
insertBlocksAfter
}) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => setAttributes({
linkTarget: '_self'
}),
dropdownMenuProps: dropdownMenuProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
isShownByDefault: true,
hasValue: () => linkTarget !== '_self',
onDeselect: () => setAttributes({
linkTarget: '_self'
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
onChange: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
})
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "content",
tagName: "a",
"aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Read more'),
value: content,
onChange: newValue => setAttributes({
content: newValue
}),
__unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())),
withoutInteractiveFormatting: true,
...blockProps
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/read-more/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const read_more_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/read-more",
title: "Read More",
category: "theme",
description: "Displays the link of a post, page, or any other content-type.",
textdomain: "default",
attributes: {
content: {
type: "string"
},
linkTarget: {
type: "string",
"default": "_self"
}
},
usesContext: ["postId"],
supports: {
html: false,
color: {
gradients: true,
text: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalLetterSpacing: true,
__experimentalTextDecoration: true,
__experimentalDefaultControls: {
fontSize: true,
textDecoration: true
}
},
spacing: {
margin: ["top", "bottom"],
padding: true,
__experimentalDefaultControls: {
padding: true
}
},
__experimentalBorder: {
color: true,
radius: true,
width: true,
__experimentalDefaultControls: {
width: true
}
},
interactivity: {
clientNavigation: true
}
},
style: "wp-block-read-more"
};
const {
name: read_more_name
} = read_more_metadata;
const read_more_settings = {
icon: library_link,
edit: ReadMore,
example: {
attributes: {
content: (0,external_wp_i18n_namespaceObject.__)('Read more')
}
}
};
const read_more_init = () => initBlock({
name: read_more_name,
metadata: read_more_metadata,
settings: read_more_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/rss.js
/**
* WordPress dependencies
*/
const rss = /*#__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: "M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"
})
});
/* harmony default export */ const library_rss = (rss);
;// ./node_modules/@wordpress/block-library/build-module/rss/edit.js
/**
* WordPress dependencies
*/
const DEFAULT_MIN_ITEMS = 1;
const DEFAULT_MAX_ITEMS = 20;
function RSSEdit({
attributes,
setAttributes
}) {
const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL);
const {
blockLayout,
columns,
displayAuthor,
displayDate,
displayExcerpt,
excerptLength,
feedURL,
itemsToShow
} = attributes;
function toggleAttribute(propName) {
return () => {
const value = attributes[propName];
setAttributes({
[propName]: !value
});
};
}
function onSubmitURL(event) {
event.preventDefault();
if (feedURL) {
setAttributes({
feedURL: (0,external_wp_url_namespaceObject.prependHTTP)(feedURL)
});
setIsEditing(false);
}
}
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const label = (0,external_wp_i18n_namespaceObject.__)('RSS URL');
if (isEditing) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
icon: library_rss,
label: label,
instructions: (0,external_wp_i18n_namespaceObject.__)('Display entries from any RSS or Atom feed.'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", {
onSubmit: onSubmitURL,
className: "wp-block-rss__placeholder-form",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, {
__next40pxDefaultSize: true,
label: label,
type: "url",
hideLabelFromVision: true,
placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'),
value: feedURL,
onChange: value => setAttributes({
feedURL: value
}),
className: "wp-block-rss__placeholder-input"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
children: (0,external_wp_i18n_namespaceObject.__)('Apply')
})]
})
})
});
}
const toolbarControls = [{
icon: library_edit,
title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'),
onClick: () => setIsEditing(true)
}, {
icon: library_list,
title: (0,external_wp_i18n_namespaceObject._x)('List view', 'RSS block display setting'),
onClick: () => setAttributes({
blockLayout: 'list'
}),
isActive: blockLayout === 'list'
}, {
icon: library_grid,
title: (0,external_wp_i18n_namespaceObject._x)('Grid view', 'RSS block display setting'),
onClick: () => setAttributes({
blockLayout: 'grid'
}),
isActive: blockLayout === 'grid'
}];
/*
* This function merges the existing attributes with additional style properties.
* The `border` and `spacing` properties are set to `undefined` to ensure that
* these styles are reset and not applied on the server side.
*/
const serverSideAttributes = {
...attributes,
style: {
...attributes?.style,
border: undefined,
spacing: undefined
}
};
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_components_namespaceObject.ToolbarGroup, {
controls: toolbarControls
})
}), /*#__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)(external_wp_components_namespaceObject.RangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Number of items'),
value: itemsToShow,
onChange: value => setAttributes({
itemsToShow: value
}),
min: DEFAULT_MIN_ITEMS,
max: DEFAULT_MAX_ITEMS,
required: true
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Display author'),
checked: displayAuthor,
onChange: toggleAttribute('displayAuthor')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
checked: displayDate,
onChange: toggleAttribute('displayDate')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
checked: displayExcerpt,
onChange: toggleAttribute('displayExcerpt')
}), displayExcerpt && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
value: excerptLength,
onChange: value => setAttributes({
excerptLength: value
}),
min: 10,
max: 100,
required: true
}), blockLayout === 'grid' && /*#__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: 6,
required: true
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), {
block: "core/rss",
attributes: serverSideAttributes
})
})
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/rss/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const rss_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/rss",
title: "RSS",
category: "widgets",
description: "Display entries from any RSS or Atom feed.",
keywords: ["atom", "feed"],
textdomain: "default",
attributes: {
columns: {
type: "number",
"default": 2
},
blockLayout: {
type: "string",
"default": "list"
},
feedURL: {
type: "string",
"default": ""
},
itemsToShow: {
type: "number",
"default": 5
},
displayExcerpt: {
type: "boolean",
"default": false
},
displayAuthor: {
type: "boolean",
"default": false
},
displayDate: {
type: "boolean",
"default": false
},
excerptLength: {
type: "number",
"default": 55
}
},
supports: {
align: true,
html: false,
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
},
spacing: {
margin: true,
padding: true,
__experimentalDefaultControls: {
padding: false,
margin: false
}
},
color: {
background: true,
text: true,
gradients: true,
link: true
}
},
editorStyle: "wp-block-rss-editor",
style: "wp-block-rss"
};
const {
name: rss_name
} = rss_metadata;
const rss_settings = {
icon: library_rss,
example: {
attributes: {
feedURL: 'https://wordpress.org'
}
},
edit: RSSEdit
};
const rss_init = () => initBlock({
name: rss_name,
metadata: rss_metadata,
settings: rss_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/search.js
/**
* WordPress dependencies
*/
const search = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"
})
});
/* harmony default export */ const library_search = (search);
;// ./node_modules/@wordpress/block-library/build-module/search/icons.js
/**
* WordPress dependencies
*/
const buttonOnly = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "7",
y: "10",
width: "10",
height: "4",
rx: "1",
fill: "currentColor"
})
});
const buttonOutside = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "15.25",
width: "6.5",
height: "9.5",
transform: "rotate(-90 4.75 15.25)",
stroke: "currentColor",
strokeWidth: "1.5",
fill: "none"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "16",
y: "10",
width: "4",
height: "4",
rx: "1",
fill: "currentColor"
})]
});
const buttonInside = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "15.25",
width: "6.5",
height: "14.5",
transform: "rotate(-90 4.75 15.25)",
stroke: "currentColor",
strokeWidth: "1.5",
fill: "none"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "14",
y: "10",
width: "4",
height: "4",
rx: "1",
fill: "currentColor"
})]
});
const noButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "15.25",
width: "6.5",
height: "14.5",
transform: "rotate(-90 4.75 15.25)",
stroke: "currentColor",
fill: "none",
strokeWidth: "1.5"
})
});
const buttonWithIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "7.75",
width: "14.5",
height: "8.5",
rx: "1.25",
stroke: "currentColor",
fill: "none",
strokeWidth: "1.5"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "8",
y: "11",
width: "8",
height: "2",
fill: "currentColor"
})]
});
const toggleLabel = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "17.25",
width: "5.5",
height: "14.5",
transform: "rotate(-90 4.75 17.25)",
stroke: "currentColor",
fill: "none",
strokeWidth: "1.5"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
x: "4",
y: "7",
width: "10",
height: "2",
fill: "currentColor"
})]
});
;// ./node_modules/@wordpress/block-library/build-module/search/utils.js
/**
* Constants
*/
const PC_WIDTH_DEFAULT = 50;
const PX_WIDTH_DEFAULT = 350;
const MIN_WIDTH = 220;
/**
* Returns a boolean whether passed unit is percentage
*
* @param {string} unit Block width unit.
*
* @return {boolean} Whether unit is '%'.
*/
function utils_isPercentageUnit(unit) {
return unit === '%';
}
;// ./node_modules/@wordpress/block-library/build-module/search/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
// Used to calculate border radius adjustment to avoid "fat" corners when
// button is placed inside wrapper.
const DEFAULT_INNER_PADDING = '4px';
const PERCENTAGE_WIDTHS = [25, 50, 75, 100];
function SearchEdit({
className,
attributes,
setAttributes,
toggleSelection,
isSelected,
clientId
}) {
const {
label,
showLabel,
placeholder,
width,
widthUnit,
align,
buttonText,
buttonPosition,
buttonUseIcon,
isSearchFieldHidden,
style
} = attributes;
const wasJustInsertedIntoNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlockParentsByBlockName,
wasBlockJustInserted
} = select(external_wp_blockEditor_namespaceObject.store);
return !!getBlockParentsByBlockName(clientId, 'core/navigation')?.length && wasBlockJustInserted(clientId);
}, [clientId]);
const {
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (wasJustInsertedIntoNavigationBlock) {
// This side-effect should not create an undo level.
__unstableMarkNextChangeAsNotPersistent();
setAttributes({
showLabel: false,
buttonUseIcon: true,
buttonPosition: 'button-inside'
});
}
}, [__unstableMarkNextChangeAsNotPersistent, wasJustInsertedIntoNavigationBlock, setAttributes]);
const borderRadius = style?.border?.radius;
let borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
// Check for old deprecated numerical border radius. Done as a separate
// check so that a borderRadius style won't overwrite the longhand
// per-corner styles.
if (typeof borderRadius === 'number') {
borderProps = {
...borderProps,
style: {
...borderProps.style,
borderRadius: `${borderRadius}px`
}
};
}
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fluid', 'layout');
const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, {
typography: {
fluid: fluidTypographySettings
},
layout: {
wideSize: layout?.wideSize
}
});
const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`;
const isButtonPositionInside = 'button-inside' === buttonPosition;
const isButtonPositionOutside = 'button-outside' === buttonPosition;
const hasNoButton = 'no-button' === buttonPosition;
const hasOnlyButton = 'button-only' === buttonPosition;
const searchFieldRef = (0,external_wp_element_namespaceObject.useRef)();
const buttonRef = (0,external_wp_element_namespaceObject.useRef)();
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: ['%', 'px'],
defaultValues: {
'%': PC_WIDTH_DEFAULT,
px: PX_WIDTH_DEFAULT
}
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasOnlyButton && !isSelected) {
setAttributes({
isSearchFieldHidden: true
});
}
}, [hasOnlyButton, isSelected, setAttributes]);
// Show the search field when width changes.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!hasOnlyButton || !isSelected) {
return;
}
setAttributes({
isSearchFieldHidden: false
});
}, [hasOnlyButton, isSelected, setAttributes, width]);
const getBlockClassNames = () => {
return dist_clsx(className, isButtonPositionInside ? 'wp-block-search__button-inside' : undefined, isButtonPositionOutside ? 'wp-block-search__button-outside' : undefined, hasNoButton ? 'wp-block-search__no-button' : undefined, hasOnlyButton ? 'wp-block-search__button-only' : undefined, !buttonUseIcon && !hasNoButton ? 'wp-block-search__text-button' : undefined, buttonUseIcon && !hasNoButton ? 'wp-block-search__icon-button' : undefined, hasOnlyButton && isSearchFieldHidden ? 'wp-block-search__searchfield-hidden' : undefined);
};
const buttonPositionControls = [{
role: 'menuitemradio',
title: (0,external_wp_i18n_namespaceObject.__)('Button outside'),
isActive: buttonPosition === 'button-outside',
icon: buttonOutside,
onClick: () => {
setAttributes({
buttonPosition: 'button-outside',
isSearchFieldHidden: false
});
}
}, {
role: 'menuitemradio',
title: (0,external_wp_i18n_namespaceObject.__)('Button inside'),
isActive: buttonPosition === 'button-inside',
icon: buttonInside,
onClick: () => {
setAttributes({
buttonPosition: 'button-inside',
isSearchFieldHidden: false
});
}
}, {
role: 'menuitemradio',
title: (0,external_wp_i18n_namespaceObject.__)('No button'),
isActive: buttonPosition === 'no-button',
icon: noButton,
onClick: () => {
setAttributes({
buttonPosition: 'no-button',
isSearchFieldHidden: false
});
}
}, {
role: 'menuitemradio',
title: (0,external_wp_i18n_namespaceObject.__)('Button only'),
isActive: buttonPosition === 'button-only',
icon: buttonOnly,
onClick: () => {
setAttributes({
buttonPosition: 'button-only',
isSearchFieldHidden: true
});
}
}];
const getButtonPositionIcon = () => {
switch (buttonPosition) {
case 'button-inside':
return buttonInside;
case 'button-outside':
return buttonOutside;
case 'no-button':
return noButton;
case 'button-only':
return buttonOnly;
}
};
const getResizableSides = () => {
if (hasOnlyButton) {
return {};
}
return {
right: align !== 'right',
left: align === 'right'
};
};
const renderTextField = () => {
// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.
const textFieldClasses = dist_clsx('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className, typographyProps.className);
const textFieldStyles = {
...(isButtonPositionInside ? {
borderRadius
} : borderProps.style),
...typographyProps.style,
textDecoration: undefined
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
type: "search",
className: textFieldClasses,
style: textFieldStyles,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text')
// We hide the placeholder field's placeholder when there is a value. This
// stops screen readers from reading the placeholder field's placeholder
// which is confusing.
,
placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'),
value: placeholder,
onChange: event => setAttributes({
placeholder: event.target.value
}),
ref: searchFieldRef
});
};
const renderButton = () => {
// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.
const buttonClasses = dist_clsx('wp-block-search__button', colorProps.className, typographyProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button'));
const buttonStyles = {
...colorProps.style,
...typographyProps.style,
...(isButtonPositionInside ? {
borderRadius
} : borderProps.style)
};
const handleButtonClick = () => {
if (hasOnlyButton) {
setAttributes({
isSearchFieldHidden: !isSearchFieldHidden
});
}
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [buttonUseIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
type: "button",
className: buttonClasses,
style: buttonStyles,
"aria-label": buttonText ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_wp_i18n_namespaceObject.__)('Search'),
onClick: handleButtonClick,
ref: buttonRef,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
icon: library_search
})
}), !buttonUseIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "buttonText",
className: buttonClasses,
style: buttonStyles,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'),
withoutInteractiveFormatting: true,
value: buttonText,
onChange: html => setAttributes({
buttonText: html
}),
onClick: handleButtonClick
})]
});
};
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const controls = /*#__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.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
title: (0,external_wp_i18n_namespaceObject.__)('Show search label'),
icon: toggleLabel,
onClick: () => {
setAttributes({
showLabel: !showLabel
});
},
className: showLabel ? 'is-pressed' : undefined
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
icon: getButtonPositionIcon(),
label: (0,external_wp_i18n_namespaceObject.__)('Change button position'),
controls: buttonPositionControls
}), !hasNoButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'),
icon: buttonWithIcon,
onClick: () => {
setAttributes({
buttonUseIcon: !buttonUseIcon
});
},
className: buttonUseIcon ? 'is-pressed' : undefined
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
width: undefined,
widthUnit: undefined
});
},
dropdownMenuProps: dropdownMenuProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!width,
label: (0,external_wp_i18n_namespaceObject.__)('Width'),
onDeselect: () => {
setAttributes({
width: undefined,
widthUnit: undefined
});
},
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Width'),
id: unitControlInputId // Unused, kept for backwards compatibility
,
min: utils_isPercentageUnit(widthUnit) ? 0 : MIN_WIDTH,
max: utils_isPercentageUnit(widthUnit) ? 100 : undefined,
step: 1,
onChange: newWidth => {
const parsedNewWidth = newWidth === '' ? undefined : parseInt(newWidth, 10);
setAttributes({
width: parsedNewWidth
});
},
onUnitChange: newUnit => {
setAttributes({
width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT,
widthUnit: newUnit
});
},
__unstableInputWidth: "80px",
value: `${width}${widthUnit}`,
units: units
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Percentage Width'),
value: PERCENTAGE_WIDTHS.includes(width) && widthUnit === '%' ? width : undefined,
hideLabelFromVision: true,
onChange: newWidth => {
setAttributes({
width: newWidth,
widthUnit: '%'
});
},
isBlock: true,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
children: PERCENTAGE_WIDTHS.map(widthValue => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: widthValue,
label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Percentage value. */
(0,external_wp_i18n_namespaceObject.__)('%d%%'), widthValue)
}, widthValue);
})
})]
})
})
})
})]
});
const padBorderRadius = radius => radius ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined;
const getWrapperStyles = () => {
const styles = isButtonPositionInside ? borderProps.style : {
borderRadius: borderProps.style?.borderRadius,
borderTopLeftRadius: borderProps.style?.borderTopLeftRadius,
borderTopRightRadius: borderProps.style?.borderTopRightRadius,
borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius,
borderBottomRightRadius: borderProps.style?.borderBottomRightRadius
};
const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0;
if (isButtonPositionInside && isNonZeroBorderRadius) {
// We have button inside wrapper and a border radius value to apply.
// Add default padding so we don't get "fat" corners.
//
// CSS calc() is used here to support non-pixel units. The inline
// style using calc() will only apply if both values have units.
if (typeof borderRadius === 'object') {
// Individual corner border radii present.
const {
topLeft,
topRight,
bottomLeft,
bottomRight
} = borderRadius;
return {
...styles,
borderTopLeftRadius: padBorderRadius(topLeft),
borderTopRightRadius: padBorderRadius(topRight),
borderBottomLeftRadius: padBorderRadius(bottomLeft),
borderBottomRightRadius: padBorderRadius(bottomRight)
};
}
// The inline style using calc() will only apply if both values
// supplied to calc() have units. Deprecated block's may have
// unitless integer.
const radius = Number.isInteger(borderRadius) ? `${borderRadius}px` : borderRadius;
styles.borderRadius = `calc(${radius} + ${DEFAULT_INNER_PADDING})`;
}
return styles;
};
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: getBlockClassNames(),
style: {
...typographyProps.style,
// Input opts out of text decoration.
textDecoration: undefined
}
});
const labelClassnames = dist_clsx('wp-block-search__label', typographyProps.className);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...blockProps,
children: [controls, showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "label",
className: labelClassnames,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'),
withoutInteractiveFormatting: true,
value: label,
onChange: html => setAttributes({
label: html
}),
style: typographyProps.style
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ResizableBox, {
size: {
width: width === undefined ? 'auto' : `${width}${widthUnit}`,
height: 'auto'
},
className: dist_clsx('wp-block-search__inside-wrapper', isButtonPositionInside ? borderProps.className : undefined),
style: getWrapperStyles(),
minWidth: MIN_WIDTH,
enable: getResizableSides(),
onResizeStart: (event, direction, elt) => {
setAttributes({
width: parseInt(elt.offsetWidth, 10),
widthUnit: 'px'
});
toggleSelection(false);
},
onResizeStop: (event, direction, elt, delta) => {
setAttributes({
width: parseInt(width + delta.width, 10)
});
toggleSelection(true);
},
showHandle: isSelected,
children: [(isButtonPositionInside || isButtonPositionOutside || hasOnlyButton) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [renderTextField(), renderButton()]
}), hasNoButton && renderTextField()]
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/search/variations.js
/**
* WordPress dependencies
*/
const search_variations_variations = [{
name: 'default',
isDefault: true,
attributes: {
buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'),
label: (0,external_wp_i18n_namespaceObject.__)('Search')
}
}];
/* harmony default export */ const search_variations = (search_variations_variations);
;// ./node_modules/@wordpress/block-library/build-module/search/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const search_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/search",
title: "Search",
category: "widgets",
description: "Help visitors find your content.",
keywords: ["find"],
textdomain: "default",
attributes: {
label: {
type: "string",
role: "content"
},
showLabel: {
type: "boolean",
"default": true
},
placeholder: {
type: "string",
"default": "",
role: "content"
},
width: {
type: "number"
},
widthUnit: {
type: "string"
},
buttonText: {
type: "string",
role: "content"
},
buttonPosition: {
type: "string",
"default": "button-outside"
},
buttonUseIcon: {
type: "boolean",
"default": false
},
query: {
type: "object",
"default": {}
},
isSearchFieldHidden: {
type: "boolean",
"default": false
}
},
supports: {
align: ["left", "center", "right"],
color: {
gradients: true,
__experimentalSkipSerialization: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
interactivity: true,
typography: {
__experimentalSkipSerialization: true,
__experimentalSelector: ".wp-block-search__label, .wp-block-search__input, .wp-block-search__button",
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
color: true,
radius: true,
width: true,
__experimentalSkipSerialization: true,
__experimentalDefaultControls: {
color: true,
radius: true,
width: true
}
},
spacing: {
margin: true
},
html: false
},
editorStyle: "wp-block-search-editor",
style: "wp-block-search"
};
const {
name: search_name
} = search_metadata;
const search_settings = {
icon: library_search,
example: {
attributes: {
buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'),
label: (0,external_wp_i18n_namespaceObject.__)('Search')
},
viewportWidth: 400
},
variations: search_variations,
edit: SearchEdit
};
const search_init = () => initBlock({
name: search_name,
metadata: search_metadata,
settings: search_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/separator.js
/**
* WordPress dependencies
*/
const separator = /*#__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: "M4.5 12.5v4H3V7h1.5v3.987h15V7H21v9.5h-1.5v-4h-15Z"
})
});
/* harmony default export */ const library_separator = (separator);
;// ./node_modules/@wordpress/block-library/build-module/separator/use-deprecated-opacity.js
/**
* WordPress dependencies
*/
function useDeprecatedOpacity(opacity, currentColor, setAttributes) {
const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_wp_element_namespaceObject.useState)(false);
const previousColor = (0,external_wp_compose_namespaceObject.usePrevious)(currentColor);
// A separator with no color set will always have previousColor set to undefined,
// and we need to differentiate these from those with color set that will return
// previousColor as undefined on the first render.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (opacity === 'css' && !currentColor && !previousColor) {
setDeprecatedOpacityWithNoColor(true);
}
}, [currentColor, previousColor, opacity]);
// For deprecated blocks, that have a default 0.4 css opacity set, we
// need to remove this if the current color is changed, or a color is added.
// In these instances the opacity attribute is set back to the default of
// alpha-channel which allows a new custom opacity to be set via the color picker.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) {
setAttributes({
opacity: 'alpha-channel'
});
setDeprecatedOpacityWithNoColor(false);
}
}, [deprecatedOpacityWithNoColor, currentColor, previousColor]);
}
;// ./node_modules/@wordpress/block-library/build-module/separator/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function SeparatorEdit({
attributes,
setAttributes
}) {
const {
backgroundColor,
opacity,
style,
tagName
} = attributes;
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
const currentColor = colorProps?.style?.backgroundColor;
const hasCustomColor = !!style?.color?.background;
useDeprecatedOpacity(opacity, currentColor, setAttributes);
// The dots styles uses text for the dots, to change those dots color is
// using color, not backgroundColor.
const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
const className = dist_clsx({
'has-text-color': backgroundColor || currentColor,
[colorClass]: colorClass,
'has-css-opacity': opacity === 'css',
'has-alpha-channel-opacity': opacity === 'alpha-channel'
}, colorProps.className);
const styles = {
color: currentColor,
backgroundColor: currentColor
};
const Wrapper = tagName === 'hr' ? external_wp_components_namespaceObject.HorizontalRule : tagName;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "advanced",
children: /*#__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.__)('Default ( )'),
value: 'hr'
}, {
label: '',
value: 'div'
}],
value: tagName,
onChange: value => setAttributes({
tagName: value
}),
help: htmlElementMessages[tagName]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, {
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className,
style: hasCustomColor ? styles : undefined
})
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/separator/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function separatorSave({
attributes
}) {
const {
backgroundColor,
style,
opacity,
tagName: Tag
} = attributes;
const customColor = style?.color?.background;
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
// The hr support changing color using border-color, since border-color
// is not yet supported in the color palette, we use background-color.
// The dots styles uses text for the dots, to change those dots color is
// using color, not backgroundColor.
const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
const className = dist_clsx({
'has-text-color': backgroundColor || customColor,
[colorClass]: colorClass,
'has-css-opacity': opacity === 'css',
'has-alpha-channel-opacity': opacity === 'alpha-channel'
}, colorProps.className);
const styles = {
backgroundColor: colorProps?.style?.backgroundColor,
color: colorClass ? undefined : customColor
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className,
style: styles
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/separator/transforms.js
/**
* WordPress dependencies
*/
const separator_transforms_transforms = {
from: [{
type: 'enter',
regExp: /^-{3,}$/,
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator')
}, {
type: 'raw',
selector: 'hr',
schema: {
hr: {}
}
}],
to: [{
type: 'block',
blocks: ['core/spacer'],
// Transform to Spacer.
transform: ({
anchor
}) => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer', {
anchor: anchor || ''
});
}
}]
};
/* harmony default export */ const separator_transforms = (separator_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/separator/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const separator_deprecated_v1 = {
attributes: {
color: {
type: 'string'
},
customColor: {
type: 'string'
}
},
save({
attributes
}) {
const {
color,
customColor
} = attributes;
// the hr support changing color using border-color, since border-color
// is not yet supported in the color palette, we use background-color
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color);
// the dots styles uses text for the dots, to change those dots color is
// using color, not backgroundColor
const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color);
const className = dist_clsx({
'has-text-color has-background': color || customColor,
[backgroundClass]: backgroundClass,
[colorClass]: colorClass
});
const style = {
backgroundColor: backgroundClass ? undefined : customColor,
color: colorClass ? undefined : customColor
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className,
style
})
});
},
migrate(attributes) {
const {
color,
customColor,
...restAttributes
} = attributes;
return {
...restAttributes,
backgroundColor: color ? color : undefined,
opacity: 'css',
style: customColor ? {
color: {
background: customColor
}
} : undefined,
tagName: 'hr'
};
}
};
/* harmony default export */ const separator_deprecated = ([separator_deprecated_v1]);
;// ./node_modules/@wordpress/block-library/build-module/separator/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const separator_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/separator",
title: "Separator",
category: "design",
description: "Create a break between ideas or sections with a horizontal separator.",
keywords: ["horizontal-line", "hr", "divider"],
textdomain: "default",
attributes: {
opacity: {
type: "string",
"default": "alpha-channel"
},
tagName: {
type: "string",
"enum": ["hr", "div"],
"default": "hr"
}
},
supports: {
anchor: true,
align: ["center", "wide", "full"],
color: {
enableContrastChecker: false,
__experimentalSkipSerialization: true,
gradients: true,
background: true,
text: false,
__experimentalDefaultControls: {
background: true
}
},
spacing: {
margin: ["top", "bottom"]
},
interactivity: {
clientNavigation: true
}
},
styles: [{
name: "default",
label: "Default",
isDefault: true
}, {
name: "wide",
label: "Wide Line"
}, {
name: "dots",
label: "Dots"
}],
editorStyle: "wp-block-separator-editor",
style: "wp-block-separator"
};
const {
name: separator_name
} = separator_metadata;
const separator_settings = {
icon: library_separator,
example: {
attributes: {
customColor: '#065174',
className: 'is-style-wide'
}
},
transforms: separator_transforms,
edit: SeparatorEdit,
save: separatorSave,
deprecated: separator_deprecated
};
const separator_init = () => initBlock({
name: separator_name,
metadata: separator_metadata,
settings: separator_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/shortcode.js
/**
* WordPress dependencies
*/
const shortcode = /*#__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: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"
})
});
/* harmony default export */ const library_shortcode = (shortcode);
;// ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js
/**
* WordPress dependencies
*/
function ShortcodeEdit({
attributes,
setAttributes
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit);
const inputId = `blocks-shortcode-input-${instanceId}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
icon: library_shortcode,
label: (0,external_wp_i18n_namespaceObject.__)('Shortcode'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, {
className: "blocks-shortcode__textarea",
id: inputId,
value: attributes.text,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'),
onChange: text => setAttributes({
text
})
})
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/shortcode/save.js
/**
* WordPress dependencies
*/
function shortcode_save_save({
attributes
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
children: attributes.text
});
}
;// external ["wp","autop"]
const external_wp_autop_namespaceObject = window["wp"]["autop"];
;// ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js
/**
* WordPress dependencies
*/
const shortcode_transforms_transforms = {
from: [{
type: 'shortcode',
// Per "Shortcode names should be all lowercase and use all
// letters, but numbers and underscores should work fine too.
// Be wary of using hyphens (dashes), you'll be better off not
// using them." in https://codex.wordpress.org/Shortcode_API
// Require that the first character be a letter. This notably
// prevents footnote markings ([1]) from being caught as
// shortcodes.
tag: '[a-z][a-z0-9_-]*',
attributes: {
text: {
type: 'string',
shortcode: (attrs, {
content
}) => {
return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content));
}
}
},
priority: 20
}]
};
/* harmony default export */ const shortcode_transforms = (shortcode_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const shortcode_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/shortcode",
title: "Shortcode",
category: "widgets",
description: "Insert additional custom elements with a WordPress shortcode.",
textdomain: "default",
attributes: {
text: {
type: "string",
source: "raw"
}
},
supports: {
className: false,
customClassName: false,
html: false
},
editorStyle: "wp-block-shortcode-editor"
};
const {
name: shortcode_name
} = shortcode_metadata;
const shortcode_settings = {
icon: library_shortcode,
transforms: shortcode_transforms,
edit: ShortcodeEdit,
save: shortcode_save_save
};
const shortcode_init = () => initBlock({
name: shortcode_name,
metadata: shortcode_metadata,
settings: shortcode_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/site-logo.js
/**
* WordPress dependencies
*/
const siteLogo = /*#__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: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"
})
});
/* harmony default export */ const site_logo = (siteLogo);
;// ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image'];
const ACCEPT_MEDIA_STRING = 'image/*';
const SiteLogo = ({
alt,
attributes: {
align,
width,
height,
isLink,
linkTarget,
shouldSyncIcon
},
isSelected,
setAttributes,
setLogo,
logoUrl,
siteUrl,
logoId,
iconId,
setIcon,
canUserEdit
}) => {
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
const isWideAligned = ['wide', 'full'].includes(align);
const isResizable = !isWideAligned && isLargeViewport;
const [{
naturalWidth,
naturalHeight
}, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
const {
toggleSelection
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const {
imageEditing,
maxWidth,
title
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
const siteEntities = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase');
return {
title: siteEntities?.name,
imageEditing: settings.imageEditing,
maxWidth: settings.maxWidth
};
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
// Turn the `Use as site icon` toggle off if it is on but the logo and icon have
// fallen out of sync. This can happen if the toggle is saved in the `on` position,
// but changes are later made to the site icon in the Customizer.
if (shouldSyncIcon && logoId !== iconId) {
setAttributes({
shouldSyncIcon: false
});
}
}, []);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected) {
setIsEditingImage(false);
}
}, [isSelected]);
function onResizeStart() {
toggleSelection(false);
}
function onResizeStop() {
toggleSelection(true);
}
const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
className: "custom-logo",
src: logoUrl,
alt: alt,
onLoad: event => {
setNaturalSize({
naturalWidth: event.target.naturalWidth,
naturalHeight: event.target.naturalHeight
});
}
}), (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})]
});
let imgWrapper = img;
// Disable reason: Image itself is not meant to be interactive, but
// should direct focus to block.
if (isLink) {
imgWrapper =
/*#__PURE__*/
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: siteUrl,
className: "custom-logo-link",
rel: "home",
title: title,
onClick: event => event.preventDefault(),
children: img
})
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */;
}
if (!isResizable || !naturalWidth || !naturalHeight) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
style: {
width,
height
},
children: imgWrapper
});
}
// Set the default width to a responsible size.
// Note that this width is also set in the attached frontend CSS file.
const defaultWidth = 120;
const currentWidth = width || defaultWidth;
const ratio = naturalWidth / naturalHeight;
const currentHeight = currentWidth / ratio;
const minWidth = naturalWidth < naturalHeight ? constants_MIN_SIZE : Math.ceil(constants_MIN_SIZE * ratio);
const minHeight = naturalHeight < naturalWidth ? constants_MIN_SIZE : Math.ceil(constants_MIN_SIZE / ratio);
// With the current implementation of ResizableBox, an image needs an
// explicit pixel value for the max-width. In absence of being able to
// set the content-width, this max-width is currently dictated by the
// vanilla editor style. The following variable adds a buffer to this
// vanilla style, so 3rd party themes have some wiggleroom. This does,
// in most cases, allow you to scale the image beyond the width of the
// main column, though not infinitely.
// @todo It would be good to revisit this once a content-width variable
// becomes available.
const maxWidthBuffer = maxWidth * 2.5;
let showRightHandle = false;
let showLeftHandle = false;
/* eslint-disable no-lonely-if */
// See https://github.com/WordPress/gutenberg/issues/7584.
if (align === 'center') {
// When the image is centered, show both handles.
showRightHandle = true;
showLeftHandle = true;
} else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
// In RTL mode the image is on the right by default.
// Show the right handle and hide the left handle only when it is
// aligned left. Otherwise always show the left handle.
if (align === 'left') {
showRightHandle = true;
} else {
showLeftHandle = true;
}
} else {
// Show the left handle and hide the right handle only when the
// image is aligned right. Otherwise always show the right handle.
if (align === 'right') {
showLeftHandle = true;
} else {
showRightHandle = true;
}
}
/* eslint-enable no-lonely-if */
const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing;
const imgEdit = canEditImage && isEditingImage ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
id: logoId,
url: logoUrl,
width: currentWidth,
height: currentHeight,
naturalHeight: naturalHeight,
naturalWidth: naturalWidth,
onSaveImage: imageAttributes => {
setLogo(imageAttributes.id);
},
onFinishEditing: () => {
setIsEditingImage(false);
}
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, {
size: {
width: currentWidth,
height: currentHeight
},
showHandle: isSelected,
minWidth: minWidth,
maxWidth: maxWidthBuffer,
minHeight: minHeight,
maxHeight: maxWidthBuffer / ratio,
lockAspectRatio: true,
enable: {
top: false,
right: showRightHandle,
bottom: true,
left: showLeftHandle
},
onResizeStart: onResizeStart,
onResizeStop: (event, direction, elt, delta) => {
onResizeStop();
setAttributes({
width: parseInt(currentWidth + delta.width, 10),
height: parseInt(currentHeight + delta.height, 10)
});
},
children: imgWrapper
});
// Support the previous location for the Site Icon settings. To be removed
// when the required WP core version for Gutenberg is >= 6.5.0.
const shouldUseNewUrl = !window?.__experimentalUseCustomizerSiteLogoUrl;
const siteIconSettingsUrl = shouldUseNewUrl ? siteUrl + '/wp-admin/options-general.php' : siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline';
const syncSiteIconHelpText = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the
Site Icon settings .'), {
a:
/*#__PURE__*/
// eslint-disable-next-line jsx-a11y/anchor-has-content
(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: siteIconSettingsUrl,
target: "_blank",
rel: "noopener noreferrer"
})
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__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)(external_wp_components_namespaceObject.RangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Image width'),
onChange: newWidth => setAttributes({
width: newWidth
}),
min: minWidth,
max: maxWidthBuffer,
initialPosition: Math.min(defaultWidth, maxWidthBuffer),
value: width || '',
disabled: !isResizable
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
}), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
onChange: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
})
}), canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Use as Site Icon'),
onChange: value => {
setAttributes({
shouldSyncIcon: value
});
setIcon(value ? logoId : undefined);
},
checked: !!shouldSyncIcon,
help: syncSiteIconHelpText
})
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block",
children: canEditImage && !isEditingImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: () => setIsEditingImage(true),
icon: library_crop,
label: (0,external_wp_i18n_namespaceObject.__)('Crop')
})
}), imgEdit]
});
};
// This is a light wrapper around MediaReplaceFlow because the block has two
// different MediaReplaceFlows, one for the inspector and one for the toolbar.
function SiteLogoReplaceFlow({
mediaURL,
...mediaReplaceProps
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
...mediaReplaceProps,
mediaURL: mediaURL,
allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
accept: ACCEPT_MEDIA_STRING
});
}
const InspectorLogoPreview = ({
media,
itemGroupProps
}) => {
const {
alt_text: alt,
source_url: logoUrl,
slug: logoSlug,
media_details: logoMediaDetails
} = media !== null && media !== void 0 ? media : {};
const logoLabel = logoMediaDetails?.sizes?.full?.file || logoSlug;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, {
...itemGroupProps,
as: "span",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "flex-start",
as: "span",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
src: logoUrl,
alt: alt
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
as: "span",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, {
numberOfLines: 1,
className: "block-library-site-logo__inspector-media-replace-title",
children: logoLabel
})
})]
})
});
};
function LogoEdit({
attributes,
className,
setAttributes,
isSelected
}) {
const {
width,
shouldSyncIcon
} = attributes;
const {
siteLogoId,
canUserEdit,
url,
siteIconId,
mediaItemData,
isRequestingMediaItem
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
canUser,
getEntityRecord,
getEditedEntityRecord
} = select(external_wp_coreData_namespaceObject.store);
const _canUserEdit = canUser('update', {
kind: 'root',
name: 'site'
});
const siteSettings = _canUserEdit ? getEditedEntityRecord('root', 'site') : undefined;
const siteData = getEntityRecord('root', '__unstableBase');
const _siteLogoId = _canUserEdit ? siteSettings?.site_logo : siteData?.site_logo;
const _siteIconId = siteSettings?.site_icon;
const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, {
context: 'view'
});
const _isRequestingMediaItem = !!_siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, {
context: 'view'
}]);
return {
siteLogoId: _siteLogoId,
canUserEdit: _canUserEdit,
url: siteData?.home,
mediaItemData: mediaItem,
isRequestingMediaItem: _isRequestingMediaItem,
siteIconId: _siteIconId
};
}, []);
const {
getSettings
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)();
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const setLogo = (newValue, shouldForceSync = false) => {
// `shouldForceSync` is used to force syncing when the attribute
// may not have updated yet.
if (shouldSyncIcon || shouldForceSync) {
setIcon(newValue);
}
editEntityRecord('root', 'site', undefined, {
site_logo: newValue
});
};
const setIcon = newValue =>
// The new value needs to be `null` to reset the Site Icon.
editEntityRecord('root', 'site', undefined, {
site_icon: newValue !== null && newValue !== void 0 ? newValue : null
});
const {
alt_text: alt,
source_url: logoUrl
} = mediaItemData !== null && mediaItemData !== void 0 ? mediaItemData : {};
const onInitialSelectLogo = media => {
// Initialize the syncSiteIcon toggle. If we currently have no Site logo and no
// site icon, automatically sync the logo to the icon.
if (shouldSyncIcon === undefined) {
const shouldForceSync = !siteIconId;
setAttributes({
shouldSyncIcon: shouldForceSync
});
// Because we cannot rely on the `shouldSyncIcon` attribute to have updated by
// the time `setLogo` is called, pass an argument to force the syncing.
onSelectLogo(media, shouldForceSync);
return;
}
onSelectLogo(media);
};
const onSelectLogo = (media, shouldForceSync = false) => {
if (!media) {
return;
}
if (!media.id && media.url) {
// This is a temporary blob image.
setTemporaryURL(media.url);
setLogo(undefined);
return;
}
setLogo(media.id, shouldForceSync);
};
const onRemoveLogo = () => {
setLogo(null);
setAttributes({
width: undefined
});
};
const {
createErrorNotice
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onUploadError = message => {
createErrorNotice(message, {
type: 'snackbar'
});
setTemporaryURL();
};
const onFilesDrop = filesList => {
getSettings().mediaUpload({
allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
filesList,
onFileChange([image]) {
if ((0,external_wp_blob_namespaceObject.isBlobURL)(image?.url)) {
setTemporaryURL(image.url);
return;
}
onInitialSelectLogo(image);
},
onError: onUploadError,
multiple: false
});
};
const mediaReplaceFlowProps = {
mediaURL: logoUrl,
name: !logoUrl ? (0,external_wp_i18n_namespaceObject.__)('Choose logo') : (0,external_wp_i18n_namespaceObject.__)('Replace'),
onSelect: onSelectLogo,
onError: onUploadError,
onReset: onRemoveLogo
};
const controls = canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "other",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogoReplaceFlow, {
...mediaReplaceFlowProps
})
});
let logoImage;
const isLoading = siteLogoId === undefined || isRequestingMediaItem;
if (isLoading) {
logoImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {});
}
// Reset temporary url when logoUrl is available.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (logoUrl && temporaryURL) {
setTemporaryURL();
}
}, [logoUrl, temporaryURL]);
if (!!logoUrl || !!temporaryURL) {
logoImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogo, {
alt: alt,
attributes: attributes,
className: className,
isSelected: isSelected,
setAttributes: setAttributes,
logoUrl: temporaryURL || logoUrl,
setLogo: setLogo,
logoId: mediaItemData?.id || siteLogoId,
siteUrl: url,
setIcon: setIcon,
iconId: siteIconId,
canUserEdit: canUserEdit
}), canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, {
onFilesDrop: onFilesDrop
})]
});
}
const placeholder = content => {
const placeholderClassName = dist_clsx('block-editor-media-placeholder', className);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
className: placeholderClassName,
preview: logoImage,
withIllustration: true,
style: {
width
},
children: content
});
};
const classes = dist_clsx(className, {
'is-default-size': !width,
'is-transient': temporaryURL
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes
});
const mediaInspectorPanel = (canUserEdit || logoUrl) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
title: (0,external_wp_i18n_namespaceObject.__)('Media'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "block-library-site-logo__inspector-media-replace-container",
children: !canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorLogoPreview, {
media: mediaItemData,
itemGroupProps: {
isBordered: true,
className: 'block-library-site-logo__inspector-readonly-logo-preview'
}
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogoReplaceFlow, {
...mediaReplaceFlowProps,
name: !!logoUrl ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorLogoPreview, {
media: mediaItemData
}) : (0,external_wp_i18n_namespaceObject.__)('Choose logo'),
renderToggle: props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
...props,
__next40pxDefaultSize: true,
children: temporaryURL ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : props.children
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, {
onFilesDrop: onFilesDrop
})]
})
})
})
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
...blockProps,
children: [controls, mediaInspectorPanel, (!!logoUrl || !!temporaryURL) && logoImage, (isLoading || !temporaryURL && !logoUrl && !canUserEdit) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
className: "site-logo_placeholder",
withIllustration: true,
children: isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-placeholder__preview",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
})
}), !isLoading && !temporaryURL && !logoUrl && canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
onSelect: onInitialSelectLogo,
accept: ACCEPT_MEDIA_STRING,
allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
onError: onUploadError,
placeholder: placeholder,
mediaLibraryButton: ({
open
}) => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
icon: library_upload,
variant: "primary",
label: (0,external_wp_i18n_namespaceObject.__)('Choose logo'),
showTooltip: true,
tooltipPosition: "middle right",
onClick: () => {
open();
}
});
}
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/site-logo/transforms.js
/**
* WordPress dependencies
*/
const site_logo_transforms_transforms = {
to: [{
type: 'block',
blocks: ['core/site-title'],
transform: ({
isLink,
linkTarget
}) => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-title', {
isLink,
linkTarget
});
}
}]
};
/* harmony default export */ const site_logo_transforms = (site_logo_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const site_logo_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/site-logo",
title: "Site Logo",
category: "theme",
description: "Display an image to represent this site. Update this block and the changes apply everywhere.",
textdomain: "default",
attributes: {
width: {
type: "number"
},
isLink: {
type: "boolean",
"default": true,
role: "content"
},
linkTarget: {
type: "string",
"default": "_self",
role: "content"
},
shouldSyncIcon: {
type: "boolean"
}
},
example: {
viewportWidth: 500,
attributes: {
width: 350,
className: "block-editor-block-types-list__site-logo-example"
}
},
supports: {
html: false,
align: true,
alignWide: false,
color: {
__experimentalDuotone: "img, .components-placeholder__illustration, .components-placeholder::before",
text: false,
background: false
},
spacing: {
margin: true,
padding: true,
__experimentalDefaultControls: {
margin: false,
padding: false
}
},
interactivity: {
clientNavigation: true
}
},
styles: [{
name: "default",
label: "Default",
isDefault: true
}, {
name: "rounded",
label: "Rounded"
}],
editorStyle: "wp-block-site-logo-editor",
style: "wp-block-site-logo"
};
const {
name: site_logo_name
} = site_logo_metadata;
const site_logo_settings = {
icon: site_logo,
example: {},
edit: LogoEdit,
transforms: site_logo_transforms
};
const site_logo_init = () => initBlock({
name: site_logo_name,
metadata: site_logo_metadata,
settings: site_logo_settings
});
;// ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function SiteTaglineEdit({
attributes,
setAttributes,
insertBlocksAfter
}) {
const {
textAlign,
level,
levelOptions
} = attributes;
const {
canUserEdit,
tagline
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
canUser,
getEntityRecord,
getEditedEntityRecord
} = select(external_wp_coreData_namespaceObject.store);
const canEdit = canUser('update', {
kind: 'root',
name: 'site'
});
const settings = canEdit ? getEditedEntityRecord('root', 'site') : {};
const readOnlySettings = getEntityRecord('root', '__unstableBase');
return {
canUserEdit: canEdit,
tagline: canEdit ? settings?.description : readOnlySettings?.description
};
}, []);
const TagName = level === 0 ? 'p' : `h${level}`;
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
function setTagline(newTagline) {
editEntityRecord('root', 'site', undefined, {
description: newTagline
});
}
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign,
'wp-block-site-tagline__placeholder': !canUserEdit && !tagline
})
});
const siteTaglineContent = canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
allowedFormats: [],
onChange: setTagline,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'),
tagName: TagName,
value: tagline,
disableLineBreaks: true,
__unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())),
...blockProps
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
children: tagline || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder')
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, {
value: level,
options: levelOptions,
onChange: newLevel => setAttributes({
level: newLevel
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
onChange: newAlign => setAttributes({
textAlign: newAlign
}),
value: textAlign
})]
}), siteTaglineContent]
});
}
;// ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js
/**
* WordPress dependencies
*/
/* harmony default export */ const site_tagline_icon = (/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z"
})
}));
;// ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js
/**
* Internal dependencies
*/
const site_tagline_deprecated_v1 = {
attributes: {
textAlign: {
type: 'string'
}
},
supports: {
align: ['wide', 'full'],
html: false,
color: {
gradients: true
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalTextTransform: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true
}
},
save() {
return null;
},
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 site_tagline_deprecated = ([site_tagline_deprecated_v1]);
;// ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
/**
* Internal dependencies
*/
const site_tagline_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/site-tagline",
title: "Site Tagline",
category: "theme",
description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it\u2019s not displayed in the theme design.",
keywords: ["description"],
textdomain: "default",
attributes: {
textAlign: {
type: "string"
},
level: {
type: "number",
"default": 0
},
levelOptions: {
type: "array",
"default": [0, 1, 2, 3, 4, 5, 6]
}
},
example: {
viewportWidth: 350,
attributes: {
textAlign: "center"
}
},
supports: {
align: ["wide", "full"],
html: false,
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true,
__experimentalDefaultControls: {
margin: false,
padding: false
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalWritingMode: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
}
},
editorStyle: "wp-block-site-tagline-editor",
style: "wp-block-site-tagline"
};
const {
name: site_tagline_name
} = site_tagline_metadata;
const site_tagline_settings = {
icon: site_tagline_icon,
edit: SiteTaglineEdit,
deprecated: site_tagline_deprecated
};
const site_tagline_init = () => initBlock({
name: site_tagline_name,
metadata: site_tagline_metadata,
settings: site_tagline_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/map-marker.js
/**
* WordPress dependencies
*/
const mapMarker = /*#__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: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"
})
});
/* harmony default export */ const map_marker = (mapMarker);
;// ./node_modules/@wordpress/block-library/build-module/site-title/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function SiteTitleEdit({
attributes,
setAttributes,
insertBlocksAfter
}) {
const {
level,
levelOptions,
textAlign,
isLink,
linkTarget
} = attributes;
const {
canUserEdit,
title
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
canUser,
getEntityRecord,
getEditedEntityRecord
} = select(external_wp_coreData_namespaceObject.store);
const canEdit = canUser('update', {
kind: 'root',
name: 'site'
});
const settings = canEdit ? getEditedEntityRecord('root', 'site') : {};
const readOnlySettings = getEntityRecord('root', '__unstableBase');
return {
canUserEdit: canEdit,
title: canEdit ? settings?.title : readOnlySettings?.name
};
}, []);
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
function setTitle(newTitle) {
editEntityRecord('root', 'site', undefined, {
title: newTitle
});
}
const TagName = level === 0 ? 'p' : `h${level}`;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign,
'wp-block-site-title__placeholder': !canUserEdit && !title
})
});
const siteTitleContent = canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
tagName: isLink ? 'a' : 'span',
href: isLink ? '#site-title-pseudo-link' : undefined,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'),
value: title,
onChange: setTitle,
allowedFormats: [],
disableLineBreaks: true,
__unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
})
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...blockProps,
children: isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
href: "#site-title-pseudo-link",
onClick: event => event.preventDefault(),
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder')
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder')
})
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, {
value: level,
options: levelOptions,
onChange: newLevel => setAttributes({
level: newLevel
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
isLink: true,
linkTarget: '_self'
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !isLink,
label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'),
onDeselect: () => setAttributes({
isLink: true
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
})
}), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => linkTarget !== '_self',
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
onDeselect: () => setAttributes({
linkTarget: '_self'
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
onChange: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
})
})]
})
}), siteTitleContent]
});
}
;// ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js
/**
* Internal dependencies
*/
const site_title_deprecated_v1 = {
attributes: {
level: {
type: 'number',
default: 1
},
textAlign: {
type: 'string'
},
isLink: {
type: 'boolean',
default: true
},
linkTarget: {
type: 'string',
default: '_self'
}
},
supports: {
align: ['wide', 'full'],
html: false,
color: {
gradients: true,
link: true
},
spacing: {
padding: true,
margin: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalTextTransform: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true
}
},
save() {
return null;
},
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 site_title_deprecated = ([site_title_deprecated_v1]);
;// ./node_modules/@wordpress/block-library/build-module/site-title/transforms.js
/**
* WordPress dependencies
*/
const site_title_transforms_transforms = {
to: [{
type: 'block',
blocks: ['core/site-logo'],
transform: ({
isLink,
linkTarget
}) => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo', {
isLink,
linkTarget
});
}
}]
};
/* harmony default export */ const site_title_transforms = (site_title_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/site-title/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const site_title_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/site-title",
title: "Site Title",
category: "theme",
description: "Displays the name of this site. Update the block, and the changes apply everywhere it\u2019s used. This will also appear in the browser title bar and in search results.",
textdomain: "default",
attributes: {
level: {
type: "number",
"default": 1
},
levelOptions: {
type: "array",
"default": [0, 1, 2, 3, 4, 5, 6]
},
textAlign: {
type: "string"
},
isLink: {
type: "boolean",
"default": true,
role: "content"
},
linkTarget: {
type: "string",
"default": "_self",
role: "content"
}
},
example: {
viewportWidth: 500
},
supports: {
align: ["wide", "full"],
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
},
spacing: {
padding: true,
margin: true,
__experimentalDefaultControls: {
margin: false,
padding: false
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalWritingMode: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
}
},
editorStyle: "wp-block-site-title-editor",
style: "wp-block-site-title"
};
const {
name: site_title_name
} = site_title_metadata;
const site_title_settings = {
icon: map_marker,
example: {
viewportWidth: 350,
attributes: {
textAlign: 'center'
}
},
edit: SiteTitleEdit,
transforms: site_title_transforms,
deprecated: site_title_deprecated
};
const site_title_init = () => initBlock({
name: site_title_name,
metadata: site_title_metadata,
settings: site_title_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/share.js
/**
* WordPress dependencies
*/
const share = /*#__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: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"
})
});
/* harmony default export */ const library_share = (share);
;// ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
/**
* WordPress dependencies
*/
const keyboardReturn = /*#__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.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z"
})
});
/* harmony default export */ const keyboard_return = (keyboardReturn);
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.js
/**
* WordPress dependencies
*/
const WordPressIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js
/**
* WordPress dependencies
*/
const FivehundredpxIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js
/**
* WordPress dependencies
*/
const AmazonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js
/**
* WordPress dependencies
*/
const BandcampIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js
/**
* WordPress dependencies
*/
const BehanceIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/bluesky.js
/**
* WordPress dependencies
*/
const BlueskyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js
/**
* WordPress dependencies
*/
const ChainIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js
/**
* WordPress dependencies
*/
const CodepenIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js
/**
* WordPress dependencies
*/
const DeviantArtIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/discord.js
/**
* WordPress dependencies
*/
const DiscordIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M20.317 4.369A19.88 19.88 0 0 0 15.894 3a14.145 14.145 0 0 0-.719 1.518 19.205 19.205 0 0 0-5.351 0A14.183 14.183 0 0 0 9.104 3 19.896 19.896 0 0 0 4.682 4.369a18.921 18.921 0 0 0-3.012 12.52 19.929 19.929 0 0 0 6.081 3.097c.487-.65.922-1.339 1.3-2.061a12.445 12.445 0 0 1-1.958-.896c.165-.12.326-.246.483-.374a12.445 12.445 0 0 0 8.946 0c.157.128.318.253.483.374-.627.371-1.281.683-1.958.896.379.722.813 1.41 1.3 2.061a19.94 19.94 0 0 0 6.081-3.097 18.921 18.921 0 0 0-3.012-12.52ZM8.12 15.233c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Zm7.757 0c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js
/**
* WordPress dependencies
*/
const DribbbleIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js
/**
* WordPress dependencies
*/
const DropboxIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js
/**
* WordPress dependencies
*/
const EtsyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js
/**
* WordPress dependencies
*/
const FacebookIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js
/**
* WordPress dependencies
*/
const FeedIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js
/**
* WordPress dependencies
*/
const FlickrIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js
/**
* WordPress dependencies
*/
const FoursquareIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js
/**
* WordPress dependencies
*/
const GoodreadsIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js
/**
* WordPress dependencies
*/
const GoogleIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js
/**
* WordPress dependencies
*/
const GitHubIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/gravatar.js
/**
* WordPress dependencies
*/
const GravatarIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M10.8001 4.69937V10.6494C10.8001 11.1001 10.9791 11.5323 11.2978 11.851C11.6165 12.1697 12.0487 12.3487 12.4994 12.3487C12.9501 12.3487 13.3824 12.1697 13.7011 11.851C14.0198 11.5323 14.1988 11.1001 14.1988 10.6494V6.69089C15.2418 7.05861 16.1371 7.75537 16.7496 8.67617C17.3622 9.59698 17.6589 10.6919 17.595 11.796C17.5311 12.9001 17.1101 13.9535 16.3954 14.7975C15.6807 15.6415 14.711 16.2303 13.6325 16.4753C12.5541 16.7202 11.4252 16.608 10.4161 16.1555C9.40691 15.703 8.57217 14.9348 8.03763 13.9667C7.50308 12.9985 7.29769 11.8828 7.45242 10.7877C7.60714 9.69266 8.11359 8.67755 8.89545 7.89537C9.20904 7.57521 9.38364 7.14426 9.38132 6.69611C9.37899 6.24797 9.19994 5.81884 8.88305 5.50195C8.56616 5.18506 8.13704 5.00601 7.68889 5.00369C7.24075 5.00137 6.80979 5.17597 6.48964 5.48956C5.09907 6.8801 4.23369 8.7098 4.04094 10.6669C3.84819 12.624 4.34 14.5873 5.43257 16.2224C6.52515 17.8575 8.15088 19.0632 10.0328 19.634C11.9146 20.2049 13.9362 20.1055 15.753 19.3529C17.5699 18.6003 19.0695 17.241 19.9965 15.5066C20.9234 13.7722 21.2203 11.7701 20.8366 9.84133C20.4528 7.91259 19.4122 6.17658 17.892 4.92911C16.3717 3.68163 14.466 2.99987 12.4994 3C12.0487 3 11.6165 3.17904 11.2978 3.49773C10.9791 3.81643 10.8001 4.24867 10.8001 4.69937Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js
/**
* WordPress dependencies
*/
const InstagramIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js
/**
* WordPress dependencies
*/
const LastfmIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js
/**
* WordPress dependencies
*/
const LinkedInIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js
/**
* WordPress dependencies
*/
const MailIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l7.5 5.6 7.5-5.6V17zm0-9.1L12 13.6 4.5 7.9V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v.9z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js
/**
* WordPress dependencies
*/
const MastodonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js
/**
* WordPress dependencies
*/
const MeetupIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js
/**
* WordPress dependencies
*/
const MediumIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13.2,12c0,3-2.4,5.4-5.3,5.4S2.6,15,2.6,12s2.4-5.4,5.3-5.4S13.2,9,13.2,12 M19.1,12c0,2.8-1.2,5-2.7,5s-2.7-2.3-2.7-5s1.2-5,2.7-5C17.9,7,19.1,9.2,19.1,12 M21.4,12c0,2.5-0.4,4.5-0.9,4.5c-0.5,0-0.9-2-0.9-4.5s0.4-4.5,0.9-4.5C21,7.5,21.4,9.5,21.4,12"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js
/**
* WordPress dependencies
*/
const PatreonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M20 8.40755C19.9969 6.10922 18.2543 4.22555 16.2097 3.54588C13.6708 2.70188 10.3222 2.82421 7.89775 3.99921C4.95932 5.42355 4.03626 8.54355 4.00186 11.6552C3.97363 14.2136 4.2222 20.9517 7.92225 20.9997C10.6715 21.0356 11.0809 17.3967 12.3529 15.6442C13.258 14.3974 14.4233 14.0452 15.8578 13.6806C18.3233 13.0537 20.0036 11.0551 20 8.40755Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js
/**
* WordPress dependencies
*/
const PinterestIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js
/**
* WordPress dependencies
*/
const PocketIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js
/**
* WordPress dependencies
*/
const RedditIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M5.27 9.221A2.775 2.775 0 0 0 2.498 11.993a2.785 2.785 0 0 0 1.6 2.511 5.337 5.337 0 0 0 2.374 4.11 9.386 9.386 0 0 0 5.539 1.7 9.386 9.386 0 0 0 5.541-1.7 5.331 5.331 0 0 0 2.372-4.114 2.787 2.787 0 0 0 1.583-2.5 2.775 2.775 0 0 0-2.772-2.772 2.742 2.742 0 0 0-1.688.574 9.482 9.482 0 0 0-4.637-1.348v-.008a2.349 2.349 0 0 1 2.011-2.316 1.97 1.97 0 0 0 1.926 1.521 1.98 1.98 0 0 0 1.978-1.978 1.98 1.98 0 0 0-1.978-1.978 1.985 1.985 0 0 0-1.938 1.578 3.183 3.183 0 0 0-2.849 3.172v.011a9.463 9.463 0 0 0-4.59 1.35 2.741 2.741 0 0 0-1.688-.574Zm6.736 9.1a3.162 3.162 0 0 1-2.921-1.944.215.215 0 0 1 .014-.2.219.219 0 0 1 .168-.106 27.327 27.327 0 0 1 2.74-.133 27.357 27.357 0 0 1 2.74.133.219.219 0 0 1 .168.106.215.215 0 0 1 .014.2 3.158 3.158 0 0 1-2.921 1.944Zm3.743-3.157a1.265 1.265 0 0 1-1.4-1.371 1.954 1.954 0 0 1 .482-1.442 1.15 1.15 0 0 1 .842-.379 1.7 1.7 0 0 1 1.49 1.777 1.323 1.323 0 0 1-.325 1.015 1.476 1.476 0 0 1-1.089.4Zm-7.485 0a1.476 1.476 0 0 1-1.086-.4 1.323 1.323 0 0 1-.325-1.016 1.7 1.7 0 0 1 1.49-1.777 1.151 1.151 0 0 1 .843.379 1.951 1.951 0 0 1 .481 1.441 1.276 1.276 0 0 1-1.403 1.373Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js
/**
* WordPress dependencies
*/
const SkypeIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js
/**
* WordPress dependencies
*/
const SnapchatIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js
/**
* WordPress dependencies
*/
const SoundCloudIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M23.994 14.552a3.36 3.36 0 01-3.401 3.171h-8.176a.685.685 0 01-.679-.681V8.238a.749.749 0 01.452-.716S12.942 7 14.526 7a5.357 5.357 0 012.748.755 5.44 5.44 0 012.56 3.546c.282-.08.574-.12.868-.119a3.273 3.273 0 013.292 3.37zM10.718 8.795a.266.266 0 10-.528 0c-.224 2.96-.397 5.735 0 8.685a.265.265 0 00.528 0c.425-2.976.246-5.7 0-8.685zM9.066 9.82a.278.278 0 00-.553 0 33.183 33.183 0 000 7.663.278.278 0 00.55 0c.33-2.544.332-5.12.003-7.664zM7.406 9.56a.269.269 0 00-.535 0c-.253 2.7-.38 5.222 0 7.917a.266.266 0 10.531 0c.394-2.73.272-5.181.004-7.917zM5.754 10.331a.275.275 0 10-.55 0 28.035 28.035 0 000 7.155.272.272 0 00.54 0c.332-2.373.335-4.78.01-7.155zM4.087 12.12a.272.272 0 00-.544 0c-.393 1.843-.208 3.52.016 5.386a.26.26 0 00.512 0c.247-1.892.435-3.53.016-5.386zM2.433 11.838a.282.282 0 00-.56 0c-.349 1.882-.234 3.54.01 5.418.025.285.508.282.54 0 .269-1.907.394-3.517.01-5.418zM.762 12.76a.282.282 0 00-.56 0c-.32 1.264-.22 2.31.023 3.578a.262.262 0 00.521 0c.282-1.293.42-2.317.016-3.578z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js
/**
* WordPress dependencies
*/
const SpotifyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js
/**
* WordPress dependencies
*/
const TelegramIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 128 128",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/threads.js
/**
* WordPress dependencies
*/
const ThreadsIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M16.3 11.3c-.1 0-.2-.1-.2-.1-.1-2.6-1.5-4-3.9-4-1.4 0-2.6.6-3.3 1.7l1.3.9c.5-.8 1.4-1 2-1 .8 0 1.4.2 1.7.7.3.3.5.8.5 1.3-.7-.1-1.4-.2-2.2-.1-2.2.1-3.7 1.4-3.6 3.2 0 .9.5 1.7 1.3 2.2.7.4 1.5.6 2.4.6 1.2-.1 2.1-.5 2.7-1.3.5-.6.8-1.4.9-2.4.6.3 1 .8 1.2 1.3.4.9.4 2.4-.8 3.6-1.1 1.1-2.3 1.5-4.3 1.5-2.1 0-3.8-.7-4.8-2S5.7 14.3 5.7 12c0-2.3.5-4.1 1.5-5.4 1.1-1.3 2.7-2 4.8-2 2.2 0 3.8.7 4.9 2 .5.7.9 1.5 1.2 2.5l1.5-.4c-.3-1.2-.8-2.2-1.5-3.1-1.3-1.7-3.3-2.6-6-2.6-2.6 0-4.7.9-6 2.6C4.9 7.2 4.3 9.3 4.3 12s.6 4.8 1.9 6.4c1.4 1.7 3.4 2.6 6 2.6 2.3 0 4-.6 5.3-2 1.8-1.8 1.7-4 1.1-5.4-.4-.9-1.2-1.7-2.3-2.3zm-4 3.8c-1 .1-2-.4-2-1.3 0-.7.5-1.5 2.1-1.6h.5c.6 0 1.1.1 1.6.2-.2 2.3-1.3 2.7-2.2 2.7z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js
/**
* WordPress dependencies
*/
const TiktokIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 32 32",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js
/**
* WordPress dependencies
*/
const TumblrIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js
/**
* WordPress dependencies
*/
const TwitchIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js
/**
* WordPress dependencies
*/
const TwitterIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js
/**
* WordPress dependencies
*/
const VimeoIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js
/**
* WordPress dependencies
*/
const VkIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/whatsapp.js
/**
* WordPress dependencies
*/
const WhatsAppIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M 12.011719 2 C 6.5057187 2 2.0234844 6.478375 2.0214844 11.984375 C 2.0204844 13.744375 2.4814687 15.462563 3.3554688 16.976562 L 2 22 L 7.2324219 20.763672 C 8.6914219 21.559672 10.333859 21.977516 12.005859 21.978516 L 12.009766 21.978516 C 17.514766 21.978516 21.995047 17.499141 21.998047 11.994141 C 22.000047 9.3251406 20.962172 6.8157344 19.076172 4.9277344 C 17.190172 3.0407344 14.683719 2.001 12.011719 2 z M 12.009766 4 C 14.145766 4.001 16.153109 4.8337969 17.662109 6.3417969 C 19.171109 7.8517969 20.000047 9.8581875 19.998047 11.992188 C 19.996047 16.396187 16.413812 19.978516 12.007812 19.978516 C 10.674812 19.977516 9.3544062 19.642812 8.1914062 19.007812 L 7.5175781 18.640625 L 6.7734375 18.816406 L 4.8046875 19.28125 L 5.2851562 17.496094 L 5.5019531 16.695312 L 5.0878906 15.976562 C 4.3898906 14.768562 4.0204844 13.387375 4.0214844 11.984375 C 4.0234844 7.582375 7.6067656 4 12.009766 4 z M 8.4765625 7.375 C 8.3095625 7.375 8.0395469 7.4375 7.8105469 7.6875 C 7.5815469 7.9365 6.9355469 8.5395781 6.9355469 9.7675781 C 6.9355469 10.995578 7.8300781 12.182609 7.9550781 12.349609 C 8.0790781 12.515609 9.68175 15.115234 12.21875 16.115234 C 14.32675 16.946234 14.754891 16.782234 15.212891 16.740234 C 15.670891 16.699234 16.690438 16.137687 16.898438 15.554688 C 17.106437 14.971687 17.106922 14.470187 17.044922 14.367188 C 16.982922 14.263188 16.816406 14.201172 16.566406 14.076172 C 16.317406 13.951172 15.090328 13.348625 14.861328 13.265625 C 14.632328 13.182625 14.464828 13.140625 14.298828 13.390625 C 14.132828 13.640625 13.655766 14.201187 13.509766 14.367188 C 13.363766 14.534188 13.21875 14.556641 12.96875 14.431641 C 12.71875 14.305641 11.914938 14.041406 10.960938 13.191406 C 10.218937 12.530406 9.7182656 11.714844 9.5722656 11.464844 C 9.4272656 11.215844 9.5585938 11.079078 9.6835938 10.955078 C 9.7955938 10.843078 9.9316406 10.663578 10.056641 10.517578 C 10.180641 10.371578 10.223641 10.267562 10.306641 10.101562 C 10.389641 9.9355625 10.347156 9.7890625 10.285156 9.6640625 C 10.223156 9.5390625 9.737625 8.3065 9.515625 7.8125 C 9.328625 7.3975 9.131125 7.3878594 8.953125 7.3808594 C 8.808125 7.3748594 8.6425625 7.375 8.4765625 7.375 z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/x.js
/**
* WordPress dependencies
*/
const XIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js
/**
* WordPress dependencies
*/
const YelpIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js
/**
* WordPress dependencies
*/
const YouTubeIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"
})
});
;// ./node_modules/@wordpress/block-library/build-module/social-link/variations.js
/**
* Internal dependencies
*/
const social_link_variations_variations = [{
isDefault: true,
name: 'wordpress',
attributes: {
service: 'wordpress'
},
title: 'WordPress',
icon: WordPressIcon
}, {
name: 'fivehundredpx',
attributes: {
service: 'fivehundredpx'
},
title: '500px',
icon: FivehundredpxIcon
}, {
name: 'amazon',
attributes: {
service: 'amazon'
},
title: 'Amazon',
icon: AmazonIcon
}, {
name: 'bandcamp',
attributes: {
service: 'bandcamp'
},
title: 'Bandcamp',
icon: BandcampIcon
}, {
name: 'behance',
attributes: {
service: 'behance'
},
title: 'Behance',
icon: BehanceIcon
}, {
name: 'bluesky',
attributes: {
service: 'bluesky'
},
title: 'Bluesky',
icon: BlueskyIcon
}, {
name: 'chain',
attributes: {
service: 'chain'
},
title: 'Link',
icon: ChainIcon
}, {
name: 'codepen',
attributes: {
service: 'codepen'
},
title: 'CodePen',
icon: CodepenIcon
}, {
name: 'deviantart',
attributes: {
service: 'deviantart'
},
title: 'DeviantArt',
icon: DeviantArtIcon
}, {
name: 'discord',
attributes: {
service: 'discord'
},
title: 'Discord',
icon: DiscordIcon
}, {
name: 'dribbble',
attributes: {
service: 'dribbble'
},
title: 'Dribbble',
icon: DribbbleIcon
}, {
name: 'dropbox',
attributes: {
service: 'dropbox'
},
title: 'Dropbox',
icon: DropboxIcon
}, {
name: 'etsy',
attributes: {
service: 'etsy'
},
title: 'Etsy',
icon: EtsyIcon
}, {
name: 'facebook',
attributes: {
service: 'facebook'
},
title: 'Facebook',
icon: FacebookIcon
}, {
name: 'feed',
attributes: {
service: 'feed'
},
title: 'RSS Feed',
icon: FeedIcon
}, {
name: 'flickr',
attributes: {
service: 'flickr'
},
title: 'Flickr',
icon: FlickrIcon
}, {
name: 'foursquare',
attributes: {
service: 'foursquare'
},
title: 'Foursquare',
icon: FoursquareIcon
}, {
name: 'goodreads',
attributes: {
service: 'goodreads'
},
title: 'Goodreads',
icon: GoodreadsIcon
}, {
name: 'google',
attributes: {
service: 'google'
},
title: 'Google',
icon: GoogleIcon
}, {
name: 'github',
attributes: {
service: 'github'
},
title: 'GitHub',
icon: GitHubIcon
}, {
name: 'gravatar',
attributes: {
service: 'gravatar'
},
title: 'Gravatar',
icon: GravatarIcon
}, {
name: 'instagram',
attributes: {
service: 'instagram'
},
title: 'Instagram',
icon: InstagramIcon
}, {
name: 'lastfm',
attributes: {
service: 'lastfm'
},
title: 'Last.fm',
icon: LastfmIcon
}, {
name: 'linkedin',
attributes: {
service: 'linkedin'
},
title: 'LinkedIn',
icon: LinkedInIcon
}, {
name: 'mail',
attributes: {
service: 'mail'
},
title: 'Mail',
keywords: ['email', 'e-mail'],
icon: MailIcon
}, {
name: 'mastodon',
attributes: {
service: 'mastodon'
},
title: 'Mastodon',
icon: MastodonIcon
}, {
name: 'meetup',
attributes: {
service: 'meetup'
},
title: 'Meetup',
icon: MeetupIcon
}, {
name: 'medium',
attributes: {
service: 'medium'
},
title: 'Medium',
icon: MediumIcon
}, {
name: 'patreon',
attributes: {
service: 'patreon'
},
title: 'Patreon',
icon: PatreonIcon
}, {
name: 'pinterest',
attributes: {
service: 'pinterest'
},
title: 'Pinterest',
icon: PinterestIcon
}, {
name: 'pocket',
attributes: {
service: 'pocket'
},
title: 'Pocket',
icon: PocketIcon
}, {
name: 'reddit',
attributes: {
service: 'reddit'
},
title: 'Reddit',
icon: RedditIcon
}, {
name: 'skype',
attributes: {
service: 'skype'
},
title: 'Skype',
icon: SkypeIcon
}, {
name: 'snapchat',
attributes: {
service: 'snapchat'
},
title: 'Snapchat',
icon: SnapchatIcon
}, {
name: 'soundcloud',
attributes: {
service: 'soundcloud'
},
title: 'SoundCloud',
icon: SoundCloudIcon
}, {
name: 'spotify',
attributes: {
service: 'spotify'
},
title: 'Spotify',
icon: SpotifyIcon
}, {
name: 'telegram',
attributes: {
service: 'telegram'
},
title: 'Telegram',
icon: TelegramIcon
}, {
name: 'threads',
attributes: {
service: 'threads'
},
title: 'Threads',
icon: ThreadsIcon
}, {
name: 'tiktok',
attributes: {
service: 'tiktok'
},
title: 'TikTok',
icon: TiktokIcon
}, {
name: 'tumblr',
attributes: {
service: 'tumblr'
},
title: 'Tumblr',
icon: TumblrIcon
}, {
name: 'twitch',
attributes: {
service: 'twitch'
},
title: 'Twitch',
icon: TwitchIcon
}, {
name: 'twitter',
attributes: {
service: 'twitter'
},
title: 'Twitter',
icon: TwitterIcon
}, {
name: 'vimeo',
attributes: {
service: 'vimeo'
},
title: 'Vimeo',
icon: VimeoIcon
}, {
name: 'vk',
attributes: {
service: 'vk'
},
title: 'VK',
icon: VkIcon
}, {
name: 'whatsapp',
attributes: {
service: 'whatsapp'
},
title: 'WhatsApp',
icon: WhatsAppIcon
}, {
name: 'x',
attributes: {
service: 'x'
},
keywords: ['twitter'],
title: 'X',
icon: XIcon
}, {
name: 'yelp',
attributes: {
service: 'yelp'
},
title: 'Yelp',
icon: YelpIcon
}, {
name: 'youtube',
attributes: {
service: 'youtube'
},
title: 'YouTube',
icon: YouTubeIcon
}];
/**
* Add `isActive` function to all `social link` variations, if not defined.
* `isActive` function is used to find a variation match from a created
* Block by providing its attributes.
*/
social_link_variations_variations.forEach(variation => {
if (variation.isActive) {
return;
}
variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.service === variationAttributes.service;
});
/* harmony default export */ const social_link_variations = (social_link_variations_variations);
;// ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Retrieves the social service's icon component.
*
* @param {string} name key for a social service (lowercase slug)
*
* @return {Component} Icon component for social service.
*/
const getIconBySite = name => {
const variation = social_link_variations.find(v => v.name === name);
return variation ? variation.icon : ChainIcon;
};
/**
* Retrieves the display name for the social service.
*
* @param {string} name key for a social service (lowercase slug)
*
* @return {string} Display name for social service
*/
const getNameBySite = name => {
const variation = social_link_variations.find(v => v.name === name);
return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon');
};
;// ./node_modules/@wordpress/block-library/build-module/social-link/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const SocialLinkURLPopover = ({
url,
setAttributes,
setPopover,
popoverAnchor,
clientId
}) => {
const {
removeBlock
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.URLPopover, {
anchor: popoverAnchor,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Edit social link'),
onClose: () => {
setPopover(false);
popoverAnchor?.focus();
},
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
className: "block-editor-url-popover__link-editor",
onSubmit: event => {
event.preventDefault();
setPopover(false);
popoverAnchor?.focus();
},
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "block-editor-url-input",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.URLInput, {
value: url,
onChange: nextURL => setAttributes({
url: nextURL
}),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter social link'),
label: (0,external_wp_i18n_namespaceObject.__)('Enter social link'),
hideLabelFromVision: true,
disableSuggestions: true,
onKeyDown: event => {
if (!!url || event.defaultPrevented || ![external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].includes(event.keyCode)) {
return;
}
removeBlock(clientId);
},
suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, {
variant: "control",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
icon: keyboard_return,
label: (0,external_wp_i18n_namespaceObject.__)('Apply'),
type: "submit",
size: "small"
})
})
})
})
})
});
};
const SocialLinkEdit = ({
attributes,
context,
isSelected,
setAttributes,
clientId
}) => {
const {
url,
service,
label = '',
rel
} = attributes;
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const {
showLabels,
iconColor,
iconColorValue,
iconBackgroundColor,
iconBackgroundColorValue
} = context;
const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false);
const wrapperClasses = dist_clsx('wp-social-link',
// Manually adding this class for backwards compatibility of CSS when moving the
// blockProps from the li to the button: https://github.com/WordPress/gutenberg/pull/64883
'wp-block-social-link', 'wp-social-link-' + service, {
'wp-social-link__is-incomplete': !url,
[`has-${iconColor}-color`]: iconColor,
[`has-${iconBackgroundColor}-background-color`]: iconBackgroundColor
});
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const isContentOnlyMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)() === 'contentOnly';
const IconComponent = getIconBySite(service);
const socialLinkName = getNameBySite(service);
// The initial label (ie. the link text) is an empty string.
// We want to prevent empty links so that the link text always fallbacks to
// the social name, even when users enter and save an empty string or only
// spaces. The PHP render callback fallbacks to the social name as well.
const socialLinkText = label.trim() === '' ? socialLinkName : label;
const ref = (0,external_wp_element_namespaceObject.useRef)();
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: 'wp-block-social-link-anchor',
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]),
onClick: () => setPopover(true),
onKeyDown: event => {
if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
event.preventDefault();
setPopover(true);
}
}
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [isContentOnlyMode && showLabels &&
/*#__PURE__*/
// Add an extra control to modify the label attribute when content only mode is active.
// With content only mode active, the inspector is hidden, so users need another way
// to edit this attribute.
(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "other",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: {
position: 'bottom right'
},
renderToggle: ({
isOpen,
onToggle
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: onToggle,
"aria-haspopup": "true",
"aria-expanded": isOpen,
children: (0,external_wp_i18n_namespaceObject.__)('Text')
}),
renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
className: "wp-block-social-link__toolbar_content_text",
label: (0,external_wp_i18n_namespaceObject.__)('Text'),
help: (0,external_wp_i18n_namespaceObject.__)('Provide a text label or use the default.'),
value: label,
onChange: value => setAttributes({
label: value
}),
placeholder: socialLinkName
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
label: undefined
});
},
dropdownMenuProps: dropdownMenuProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
isShownByDefault: true,
label: (0,external_wp_i18n_namespaceObject.__)('Text'),
hasValue: () => !!label,
onDeselect: () => {
setAttributes({
label: undefined
});
},
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Text'),
help: (0,external_wp_i18n_namespaceObject.__)('The text is visible when enabled from the parent Social Icons block.'),
value: label,
onChange: value => setAttributes({
label: value
}),
placeholder: socialLinkName
})
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "advanced",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
value: rel || '',
onChange: value => setAttributes({
rel: value
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
role: "presentation",
className: wrapperClasses,
style: {
color: iconColorValue,
backgroundColor: iconBackgroundColorValue
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("button", {
"aria-haspopup": "dialog",
...blockProps,
role: "button",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(IconComponent, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: dist_clsx('wp-block-social-link-label', {
'screen-reader-text': !showLabels
}),
children: socialLinkText
})]
}), isSelected && showURLPopover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SocialLinkURLPopover, {
url: url,
setAttributes: setAttributes,
setPopover: setPopover,
popoverAnchor: popoverAnchor,
clientId: clientId
})]
})]
});
};
/* harmony default export */ const social_link_edit = (SocialLinkEdit);
;// ./node_modules/@wordpress/block-library/build-module/social-link/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const social_link_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/social-link",
title: "Social Icon",
category: "widgets",
parent: ["core/social-links"],
description: "Display an icon linking to a social profile or site.",
textdomain: "default",
attributes: {
url: {
type: "string",
role: "content"
},
service: {
type: "string"
},
label: {
type: "string",
role: "content"
},
rel: {
type: "string"
}
},
usesContext: ["openInNewTab", "showLabels", "iconColor", "iconColorValue", "iconBackgroundColor", "iconBackgroundColorValue"],
supports: {
reusable: false,
html: false,
interactivity: {
clientNavigation: true
}
},
editorStyle: "wp-block-social-link-editor"
};
const {
name: social_link_name
} = social_link_metadata;
const social_link_settings = {
icon: library_share,
edit: social_link_edit,
variations: social_link_variations
};
const social_link_init = () => initBlock({
name: social_link_name,
metadata: social_link_metadata,
settings: social_link_settings
});
;// ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* The specific handling by `className` below is needed because `itemsJustification`
* was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't
* declared in block.json.
*
* @param {Object} attributes Block's attributes.
*/
const social_links_deprecated_migrateWithLayout = attributes => {
if (!!attributes.layout) {
return attributes;
}
const {
className
} = attributes;
// Matches classes with `items-justified-` prefix.
const prefix = `items-justified-`;
const justifiedItemsRegex = new RegExp(`\\b${prefix}[^ ]*[ ]?\\b`, 'g');
const newAttributes = {
...attributes,
className: className?.replace(justifiedItemsRegex, '').trim()
};
/**
* Add `layout` prop only if `justifyContent` is defined, for backwards
* compatibility. In other cases the block's default layout will be used.
* Also noting that due to the missing attribute, it's possible for a block
* to have more than one of `justified` classes.
*/
const justifyContent = className?.match(justifiedItemsRegex)?.[0]?.trim();
if (justifyContent) {
Object.assign(newAttributes, {
layout: {
type: 'flex',
justifyContent: justifyContent.slice(prefix.length)
}
});
}
return newAttributes;
};
// Social Links block deprecations.
const social_links_deprecated_deprecated = [
// V1. Remove CSS variable use for colors.
{
attributes: {
iconColor: {
type: 'string'
},
customIconColor: {
type: 'string'
},
iconColorValue: {
type: 'string'
},
iconBackgroundColor: {
type: 'string'
},
customIconBackgroundColor: {
type: 'string'
},
iconBackgroundColorValue: {
type: 'string'
},
openInNewTab: {
type: 'boolean',
default: false
},
size: {
type: 'string'
}
},
providesContext: {
openInNewTab: 'openInNewTab'
},
supports: {
align: ['left', 'center', 'right'],
anchor: true
},
migrate: social_links_deprecated_migrateWithLayout,
save: props => {
const {
attributes: {
iconBackgroundColorValue,
iconColorValue,
itemsJustification,
size
}
} = props;
const className = dist_clsx(size, {
'has-icon-color': iconColorValue,
'has-icon-background-color': iconBackgroundColorValue,
[`items-justified-${itemsJustification}`]: itemsJustification
});
const style = {
'--wp--social-links--icon-color': iconColorValue,
'--wp--social-links--icon-background-color': iconBackgroundColorValue
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className,
style
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})
});
}
}];
/* harmony default export */ const social_links_deprecated = (social_links_deprecated_deprecated);
;// ./node_modules/@wordpress/icons/build-module/library/check.js
/**
* WordPress dependencies
*/
const check = /*#__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: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
})
});
/* harmony default export */ const library_check = (check);
;// ./node_modules/@wordpress/block-library/build-module/social-links/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const sizeOptions = [{
name: (0,external_wp_i18n_namespaceObject.__)('Small'),
value: 'has-small-icon-size'
}, {
name: (0,external_wp_i18n_namespaceObject.__)('Normal'),
value: 'has-normal-icon-size'
}, {
name: (0,external_wp_i18n_namespaceObject.__)('Large'),
value: 'has-large-icon-size'
}, {
name: (0,external_wp_i18n_namespaceObject.__)('Huge'),
value: 'has-huge-icon-size'
}];
function SocialLinksEdit(props) {
var _attributes$layout$or;
const {
clientId,
attributes,
iconBackgroundColor,
iconColor,
isSelected,
setAttributes,
setIconBackgroundColor,
setIconColor
} = props;
const {
iconBackgroundColorValue,
customIconBackgroundColor,
iconColorValue,
openInNewTab,
showLabels,
size
} = attributes;
const hasSelectedChild = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).hasSelectedInnerBlock(clientId), [clientId]);
const hasAnySelected = isSelected || hasSelectedChild;
const logosOnly = attributes.className?.includes('is-style-logos-only');
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
// Remove icon background color when logos only style is selected or
// restore it when any other style is selected.
const backgroundBackupRef = (0,external_wp_element_namespaceObject.useRef)({});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (logosOnly) {
backgroundBackupRef.current = {
iconBackgroundColor,
iconBackgroundColorValue,
customIconBackgroundColor
};
setAttributes({
iconBackgroundColor: undefined,
customIconBackgroundColor: undefined,
iconBackgroundColorValue: undefined
});
} else {
setAttributes({
...backgroundBackupRef.current
});
}
}, [logosOnly]);
const SocialPlaceholder = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
className: "wp-block-social-links__social-placeholder",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "wp-block-social-links__social-placeholder-icons",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "wp-social-link wp-social-link-twitter"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "wp-social-link wp-social-link-facebook"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "wp-social-link wp-social-link-instagram"
})]
})
});
// Fallback color values are used maintain selections in case switching
// themes and named colors in palette do not match.
const className = dist_clsx(size, {
'has-visible-labels': showLabels,
'has-icon-color': iconColor.color || iconColorValue,
'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className
});
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
placeholder: !isSelected && SocialPlaceholder,
templateLock: false,
orientation: (_attributes$layout$or = attributes.layout?.orientation) !== null && _attributes$layout$or !== void 0 ? _attributes$layout$or : 'horizontal',
__experimentalAppenderTagName: 'li',
renderAppender: hasAnySelected && external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
});
const POPOVER_PROPS = {
position: 'bottom right'
};
const colorSettings = [{
// Use custom attribute as fallback to prevent loss of named color selection when
// switching themes to a new theme that does not have a matching named color.
value: iconColor.color || iconColorValue,
onChange: colorValue => {
setIconColor(colorValue);
setAttributes({
iconColorValue: colorValue
});
},
label: (0,external_wp_i18n_namespaceObject.__)('Icon color'),
resetAllFilter: () => {
setIconColor(undefined);
setAttributes({
iconColorValue: undefined
});
}
}];
if (!logosOnly) {
colorSettings.push({
// Use custom attribute as fallback to prevent loss of named color selection when
// switching themes to a new theme that does not have a matching named color.
value: iconBackgroundColor.color || iconBackgroundColorValue,
onChange: colorValue => {
setIconBackgroundColor(colorValue);
setAttributes({
iconBackgroundColorValue: colorValue
});
},
label: (0,external_wp_i18n_namespaceObject.__)('Icon background'),
resetAllFilter: () => {
setIconBackgroundColor(undefined);
setAttributes({
iconBackgroundColorValue: undefined
});
}
});
}
const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "other",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
label: (0,external_wp_i18n_namespaceObject.__)('Size'),
text: (0,external_wp_i18n_namespaceObject.__)('Size'),
icon: null,
popoverProps: POPOVER_PROPS,
children: ({
onClose
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
children: sizeOptions.map(entry => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check,
isSelected: size === entry.value,
onClick: () => {
setAttributes({
size: entry.value
});
},
onClose: onClose,
role: "menuitemradio",
children: entry.name
}, entry.value);
})
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
openInNewTab: false,
showLabels: false
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
isShownByDefault: true,
label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'),
hasValue: () => !!openInNewTab,
onDeselect: () => setAttributes({
openInNewTab: false
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'),
checked: openInNewTab,
onChange: () => setAttributes({
openInNewTab: !openInNewTab
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
isShownByDefault: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show text'),
hasValue: () => !!showLabels,
onDeselect: () => setAttributes({
showLabels: false
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show text'),
checked: showLabels,
onChange: () => setAttributes({
showLabels: !showLabels
})
})
})]
})
}), colorGradientSettings.hasColorsOrGradients && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, {
group: "color",
children: [colorSettings.map(({
onChange,
label,
value,
resetAllFilter
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, {
__experimentalIsRenderedInSidebar: true,
settings: [{
colorValue: value,
label,
onColorChange: onChange,
isShownByDefault: true,
resetAllFilter,
enableAlpha: true,
clearable: true
}],
panelId: clientId,
...colorGradientSettings
}, `social-links-color-${label}`)), !logosOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
textColor: iconColorValue,
backgroundColor: iconBackgroundColorValue,
isLargeText: false
})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
...innerBlocksProps
})]
});
}
const iconColorAttributes = {
iconColor: 'icon-color',
iconBackgroundColor: 'icon-background-color'
};
/* harmony default export */ const social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit));
;// ./node_modules/@wordpress/block-library/build-module/social-links/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function social_links_save_save(props) {
const {
attributes: {
iconBackgroundColorValue,
iconColorValue,
showLabels,
size
}
} = props;
const className = dist_clsx(size, {
'has-visible-labels': showLabels,
'has-icon-color': iconColorValue,
'has-icon-background-color': iconBackgroundColorValue
});
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
});
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
...innerBlocksProps
});
}
;// ./node_modules/@wordpress/block-library/build-module/social-links/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const social_links_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/social-links",
title: "Social Icons",
category: "widgets",
allowedBlocks: ["core/social-link"],
description: "Display icons linking to your social profiles or sites.",
keywords: ["links"],
textdomain: "default",
attributes: {
iconColor: {
type: "string"
},
customIconColor: {
type: "string"
},
iconColorValue: {
type: "string"
},
iconBackgroundColor: {
type: "string"
},
customIconBackgroundColor: {
type: "string"
},
iconBackgroundColorValue: {
type: "string"
},
openInNewTab: {
type: "boolean",
"default": false
},
showLabels: {
type: "boolean",
"default": false
},
size: {
type: "string"
}
},
providesContext: {
openInNewTab: "openInNewTab",
showLabels: "showLabels",
iconColor: "iconColor",
iconColorValue: "iconColorValue",
iconBackgroundColor: "iconBackgroundColor",
iconBackgroundColorValue: "iconBackgroundColorValue"
},
supports: {
align: ["left", "center", "right"],
anchor: true,
__experimentalExposeControlsToChildren: true,
layout: {
allowSwitching: false,
allowInheriting: false,
allowVerticalAlignment: false,
"default": {
type: "flex"
}
},
color: {
enableContrastChecker: false,
background: true,
gradients: true,
text: false,
__experimentalDefaultControls: {
background: false
}
},
spacing: {
blockGap: ["horizontal", "vertical"],
margin: true,
padding: true,
units: ["px", "em", "rem", "vh", "vw"],
__experimentalDefaultControls: {
blockGap: true,
margin: true,
padding: false
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
styles: [{
name: "default",
label: "Default",
isDefault: true
}, {
name: "logos-only",
label: "Logos Only"
}, {
name: "pill-shape",
label: "Pill Shape"
}],
editorStyle: "wp-block-social-links-editor",
style: "wp-block-social-links"
};
const {
name: social_links_name
} = social_links_metadata;
const social_links_settings = {
example: {
innerBlocks: [{
name: 'core/social-link',
attributes: {
service: 'wordpress',
url: 'https://wordpress.org'
}
}, {
name: 'core/social-link',
attributes: {
service: 'facebook',
url: 'https://www.facebook.com/WordPress/'
}
}, {
name: 'core/social-link',
attributes: {
service: 'twitter',
url: 'https://twitter.com/WordPress'
}
}]
},
icon: library_share,
edit: social_links_edit,
save: social_links_save_save,
deprecated: social_links_deprecated
};
const social_links_init = () => initBlock({
name: social_links_name,
metadata: social_links_metadata,
settings: social_links_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js
/**
* WordPress dependencies
*/
const resizeCornerNE = /*#__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: "M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z"
})
});
/* harmony default export */ const resize_corner_n_e = (resizeCornerNE);
;// ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js
/**
* WordPress dependencies
*/
const spacer_deprecated_deprecated = [{
attributes: {
height: {
type: 'number',
default: 100
},
width: {
type: 'number'
}
},
migrate(attributes) {
const {
height,
width
} = attributes;
return {
...attributes,
width: width !== undefined ? `${width}px` : undefined,
height: height !== undefined ? `${height}px` : undefined
};
},
save({
attributes
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
style: {
height: attributes.height,
width: attributes.width
},
'aria-hidden': true
})
});
}
}];
/* harmony default export */ const spacer_deprecated = (spacer_deprecated_deprecated);
;// ./node_modules/@wordpress/block-library/build-module/spacer/constants.js
const MIN_SPACER_SIZE = 0;
;// ./node_modules/@wordpress/block-library/build-module/spacer/controls.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
useSpacingSizes
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function DimensionInput({
label,
onChange,
isResizing,
value = ''
}) {
const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input');
const spacingSizes = useSpacingSizes();
const [spacingUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units');
// In most contexts the spacer size cannot meaningfully be set to a
// percentage, since this is relative to the parent container. This
// unit is disabled from the UI.
const availableUnits = spacingUnits ? spacingUnits.filter(unit => unit !== '%') : ['px', 'em', 'rem', 'vw', 'vh'];
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits,
defaultValues: {
px: 100,
em: 10,
rem: 10,
vw: 10,
vh: 25
}
});
// Force the unit to update to `px` when the Spacer is being resized.
const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
const computedValue = (0,external_wp_blockEditor_namespaceObject.isValueSpacingPreset)(value) ? value : [parsedQuantity, isResizing ? 'px' : parsedUnit].join('');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: spacingSizes?.length < 2 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
id: inputId,
isResetValueOnUnitChange: true,
min: MIN_SPACER_SIZE,
onChange: onChange,
value: computedValue,
units: units,
label: label,
__next40pxDefaultSize: true
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, {
className: "tools-panel-item-spacing",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalSpacingSizesControl, {
values: {
all: computedValue
},
onChange: ({
all
}) => {
onChange(all);
},
label: label,
sides: ['all'],
units: units,
allowReset: false,
splitOnAxis: false,
showSideInLabel: false
})
})
});
}
function SpacerControls({
setAttributes,
orientation,
height,
width,
isResizing
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
width: undefined,
height: '100px'
});
},
dropdownMenuProps: dropdownMenuProps,
children: [orientation === 'horizontal' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Width'),
isShownByDefault: true,
hasValue: () => width !== undefined,
onDeselect: () => setAttributes({
width: undefined
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionInput, {
label: (0,external_wp_i18n_namespaceObject.__)('Width'),
value: width,
onChange: nextWidth => setAttributes({
width: nextWidth
}),
isResizing: isResizing
})
}), orientation !== 'horizontal' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Height'),
isShownByDefault: true,
hasValue: () => height !== '100px',
onDeselect: () => setAttributes({
height: '100px'
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionInput, {
label: (0,external_wp_i18n_namespaceObject.__)('Height'),
value: height,
onChange: nextHeight => setAttributes({
height: nextHeight
}),
isResizing: isResizing
})
})]
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/spacer/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
useSpacingSizes: edit_useSpacingSizes
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const ResizableSpacer = ({
orientation,
onResizeStart,
onResize,
onResizeStop,
isSelected,
isResizing,
setIsResizing,
...props
}) => {
const getCurrentSize = elt => {
return orientation === 'horizontal' ? elt.clientWidth : elt.clientHeight;
};
const getNextVal = elt => {
return `${getCurrentSize(elt)}px`;
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, {
className: dist_clsx('block-library-spacer__resize-container', {
'resize-horizontal': orientation === 'horizontal',
'is-resizing': isResizing,
'is-selected': isSelected
}),
onResizeStart: (_event, _direction, elt) => {
const nextVal = getNextVal(elt);
onResizeStart(nextVal);
onResize(nextVal);
},
onResize: (_event, _direction, elt) => {
onResize(getNextVal(elt));
if (!isResizing) {
setIsResizing(true);
}
},
onResizeStop: (_event, _direction, elt) => {
const nextVal = getCurrentSize(elt);
onResizeStop(`${nextVal}px`);
setIsResizing(false);
},
__experimentalShowTooltip: true,
__experimentalTooltipProps: {
axis: orientation === 'horizontal' ? 'x' : 'y',
position: 'corner',
isVisible: isResizing
},
showHandle: isSelected,
...props
});
};
const SpacerEdit = ({
attributes,
isSelected,
setAttributes,
toggleSelection,
context,
__unstableParentLayout: parentLayout,
className
}) => {
const disableCustomSpacingSizes = (0,external_wp_data_namespaceObject.useSelect)(select => {
const editorSettings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
return editorSettings?.disableCustomSpacingSizes;
});
const {
orientation
} = context;
const {
orientation: parentOrientation,
type,
default: {
type: defaultType
} = {}
} = parentLayout || {};
// Check if the spacer is inside a flex container.
const isFlexLayout = type === 'flex' || !type && defaultType === 'flex';
// If the spacer is inside a flex container, it should either inherit the orientation
// of the parent or use the flex default orientation.
const inheritedOrientation = !parentOrientation && isFlexLayout ? 'horizontal' : parentOrientation || orientation;
const {
height,
width,
style: blockStyle = {}
} = attributes;
const {
layout = {}
} = blockStyle;
const {
selfStretch,
flexSize
} = layout;
const spacingSizes = edit_useSpacingSizes();
const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null);
const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null);
const onResizeStart = () => toggleSelection(false);
const onResizeStop = () => toggleSelection(true);
const {
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const handleOnVerticalResizeStop = newHeight => {
onResizeStop();
if (isFlexLayout) {
setAttributes({
style: {
...blockStyle,
layout: {
...layout,
flexSize: newHeight,
selfStretch: 'fixed'
}
}
});
}
setAttributes({
height: newHeight
});
setTemporaryHeight(null);
};
const handleOnHorizontalResizeStop = newWidth => {
onResizeStop();
if (isFlexLayout) {
setAttributes({
style: {
...blockStyle,
layout: {
...layout,
flexSize: newWidth,
selfStretch: 'fixed'
}
}
});
}
setAttributes({
width: newWidth
});
setTemporaryWidth(null);
};
const getHeightForVerticalBlocks = () => {
if (isFlexLayout) {
return undefined;
}
return temporaryHeight || (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(height) || undefined;
};
const getWidthForHorizontalBlocks = () => {
if (isFlexLayout) {
return undefined;
}
return temporaryWidth || (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(width) || undefined;
};
const sizeConditionalOnOrientation = inheritedOrientation === 'horizontal' ? temporaryWidth || flexSize : temporaryHeight || flexSize;
const style = {
height: inheritedOrientation === 'horizontal' ? 24 : getHeightForVerticalBlocks(),
width: inheritedOrientation === 'horizontal' ? getWidthForHorizontalBlocks() : undefined,
// In vertical flex containers, the spacer shrinks to nothing without a minimum width.
minWidth: inheritedOrientation === 'vertical' && isFlexLayout ? 48 : undefined,
// Add flex-basis so temporary sizes are respected.
flexBasis: isFlexLayout ? sizeConditionalOnOrientation : undefined,
// Remove flex-grow when resizing.
flexGrow: isFlexLayout && isResizing ? 0 : undefined
};
const resizableBoxWithOrientation = blockOrientation => {
if (blockOrientation === 'horizontal') {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableSpacer, {
minWidth: MIN_SPACER_SIZE,
enable: {
top: false,
right: true,
bottom: false,
left: false,
topRight: false,
bottomRight: false,
bottomLeft: false,
topLeft: false
},
orientation: blockOrientation,
onResizeStart: onResizeStart,
onResize: setTemporaryWidth,
onResizeStop: handleOnHorizontalResizeStop,
isSelected: isSelected,
isResizing: isResizing,
setIsResizing: setIsResizing
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableSpacer, {
minHeight: MIN_SPACER_SIZE,
enable: {
top: false,
right: false,
bottom: true,
left: false,
topRight: false,
bottomRight: false,
bottomLeft: false,
topLeft: false
},
orientation: blockOrientation,
onResizeStart: onResizeStart,
onResize: setTemporaryHeight,
onResizeStop: handleOnVerticalResizeStop,
isSelected: isSelected,
isResizing: isResizing,
setIsResizing: setIsResizing
})
});
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
// To avoid interfering with undo/redo operations any changes in this
// effect must not make history and should be preceded by
// `__unstableMarkNextChangeAsNotPersistent()`.
const setAttributesCovertly = nextAttributes => {
__unstableMarkNextChangeAsNotPersistent();
setAttributes(nextAttributes);
};
if (isFlexLayout && selfStretch !== 'fill' && selfStretch !== 'fit' && flexSize === undefined) {
if (inheritedOrientation === 'horizontal') {
// If spacer is moving from a vertical container to a horizontal container,
// it might not have width but have height instead.
const newSize = (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || '100px';
setAttributesCovertly({
width: '0px',
style: {
...blockStyle,
layout: {
...layout,
flexSize: newSize,
selfStretch: 'fixed'
}
}
});
} else {
const newSize = (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || '100px';
setAttributesCovertly({
height: '0px',
style: {
...blockStyle,
layout: {
...layout,
flexSize: newSize,
selfStretch: 'fixed'
}
}
});
}
} else if (isFlexLayout && (selfStretch === 'fill' || selfStretch === 'fit')) {
setAttributesCovertly(inheritedOrientation === 'horizontal' ? {
width: undefined
} : {
height: undefined
});
} else if (!isFlexLayout && (selfStretch || flexSize)) {
setAttributesCovertly({
...(inheritedOrientation === 'horizontal' ? {
width: flexSize
} : {
height: flexSize
}),
style: {
...blockStyle,
layout: {
...layout,
flexSize: undefined,
selfStretch: undefined
}
}
});
}
}, [blockStyle, flexSize, height, inheritedOrientation, isFlexLayout, layout, selfStretch, setAttributes, spacingSizes, width, __unstableMarkNextChangeAsNotPersistent]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, {
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({
style,
className: dist_clsx(className, {
'custom-sizes-disabled': disableCustomSpacingSizes
})
}),
children: resizableBoxWithOrientation(inheritedOrientation)
}), !isFlexLayout && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacerControls, {
setAttributes: setAttributes,
height: temporaryHeight || height,
width: temporaryWidth || width,
orientation: inheritedOrientation,
isResizing: isResizing
})]
});
};
/* harmony default export */ const spacer_edit = (SpacerEdit);
;// ./node_modules/@wordpress/block-library/build-module/spacer/transforms.js
/**
* WordPress dependencies
*/
const spacer_transforms_transforms = {
to: [{
type: 'block',
blocks: ['core/separator'],
// Transform to Separator.
transform: ({
anchor
}) => {
return (0,external_wp_blocks_namespaceObject.createBlock)('core/separator', {
anchor: anchor || ''
});
}
}]
};
/* harmony default export */ const spacer_transforms = (spacer_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/spacer/save.js
/**
* WordPress dependencies
*/
function spacer_save_save({
attributes
}) {
const {
height,
width,
style
} = attributes;
const {
layout: {
selfStretch
} = {}
} = style || {};
// If selfStretch is set to 'fill' or 'fit', don't set default height.
const finalHeight = selfStretch === 'fill' || selfStretch === 'fit' ? undefined : height;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
style: {
height: (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(finalHeight),
width: (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(width)
},
'aria-hidden': true
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/spacer/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const spacer_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/spacer",
title: "Spacer",
category: "design",
description: "Add white space between blocks and customize its height.",
textdomain: "default",
attributes: {
height: {
type: "string",
"default": "100px"
},
width: {
type: "string"
}
},
usesContext: ["orientation"],
supports: {
anchor: true,
spacing: {
margin: ["top", "bottom"],
__experimentalDefaultControls: {
margin: true
}
},
interactivity: {
clientNavigation: true
}
},
editorStyle: "wp-block-spacer-editor",
style: "wp-block-spacer"
};
const {
name: spacer_name
} = spacer_metadata;
const spacer_settings = {
icon: resize_corner_n_e,
transforms: spacer_transforms,
edit: spacer_edit,
save: spacer_save_save,
deprecated: spacer_deprecated
};
const spacer_init = () => initBlock({
name: spacer_name,
metadata: spacer_metadata,
settings: spacer_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/block-table.js
/**
* WordPress dependencies
*/
const blockTable = /*#__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: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"
})
});
/* harmony default export */ const block_table = (blockTable);
;// ./node_modules/@wordpress/block-library/build-module/table/deprecated.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
// As the previous arbitrary colors won't match theme color palettes, the hex
// value will be mapped to the style.color.background attribute as if it was
// a custom color selection.
const oldColors = {
'subtle-light-gray': '#f3f4f5',
'subtle-pale-green': '#e9fbe5',
'subtle-pale-blue': '#e7f5fe',
'subtle-pale-pink': '#fcf0ef'
};
// Fixed width table cells on by default.
const v4Query = {
content: {
type: 'rich-text',
source: 'rich-text'
},
tag: {
type: 'string',
default: 'td',
source: 'tag'
},
scope: {
type: 'string',
source: 'attribute',
attribute: 'scope'
},
align: {
type: 'string',
source: 'attribute',
attribute: 'data-align'
},
colspan: {
type: 'string',
source: 'attribute',
attribute: 'colspan'
},
rowspan: {
type: 'string',
source: 'attribute',
attribute: 'rowspan'
}
};
const table_deprecated_v4 = {
attributes: {
hasFixedLayout: {
type: 'boolean',
default: false
},
caption: {
type: 'rich-text',
source: 'rich-text',
selector: 'figcaption'
},
head: {
type: 'array',
default: [],
source: 'query',
selector: 'thead tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v4Query
}
}
},
body: {
type: 'array',
default: [],
source: 'query',
selector: 'tbody tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v4Query
}
}
},
foot: {
type: 'array',
default: [],
source: 'query',
selector: 'tfoot tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v4Query
}
}
}
},
supports: {
anchor: true,
align: true,
color: {
__experimentalSkipSerialization: true,
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true,
__experimentalDefaultControls: {
margin: false,
padding: false
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
__experimentalSkipSerialization: true,
color: true,
style: true,
width: true,
__experimentalDefaultControls: {
color: true,
style: true,
width: true
}
},
__experimentalSelector: '.wp-block-table > table',
interactivity: {
clientNavigation: true
}
},
save({
attributes
}) {
const {
hasFixedLayout,
head,
body,
foot,
caption
} = attributes;
const isEmpty = !head.length && !body.length && !foot.length;
if (isEmpty) {
return null;
}
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
const classes = dist_clsx(colorProps.className, borderProps.className, {
'has-fixed-layout': hasFixedLayout
});
const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
const Section = ({
type,
rows
}) => {
if (!rows.length) {
return null;
}
const Tag = `t${type}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
children: rows.map(({
cells
}, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
children: cells.map(({
content,
tag,
scope,
align,
colspan,
rowspan
}, cellIndex) => {
const cellClasses = dist_clsx({
[`has-text-align-${align}`]: align
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: cellClasses ? cellClasses : undefined,
"data-align": align,
tagName: tag,
value: content,
scope: tag === 'th' ? scope : undefined,
colSpan: colspan,
rowSpan: rowspan
}, cellIndex);
})
}, rowIndex))
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save(),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", {
className: classes === '' ? undefined : classes,
style: {
...colorProps.style,
...borderProps.style
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "head",
rows: head
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "body",
rows: body
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "foot",
rows: foot
})]
}), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption,
className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')
})]
});
}
};
// In #41140 support was added to global styles for caption elements which
// added a `wp-element-caption` classname to the embed figcaption element.
const v3Query = {
content: {
type: 'string',
source: 'html'
},
tag: {
type: 'string',
default: 'td',
source: 'tag'
},
scope: {
type: 'string',
source: 'attribute',
attribute: 'scope'
},
align: {
type: 'string',
source: 'attribute',
attribute: 'data-align'
}
};
const table_deprecated_v3 = {
attributes: {
hasFixedLayout: {
type: 'boolean',
default: false
},
caption: {
type: 'string',
source: 'html',
selector: 'figcaption',
default: ''
},
head: {
type: 'array',
default: [],
source: 'query',
selector: 'thead tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v3Query
}
}
},
body: {
type: 'array',
default: [],
source: 'query',
selector: 'tbody tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v3Query
}
}
},
foot: {
type: 'array',
default: [],
source: 'query',
selector: 'tfoot tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v3Query
}
}
}
},
supports: {
anchor: true,
align: true,
color: {
__experimentalSkipSerialization: true,
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
__experimentalSkipSerialization: true,
color: true,
style: true,
width: true,
__experimentalDefaultControls: {
color: true,
style: true,
width: true
}
},
__experimentalSelector: '.wp-block-table > table'
},
save({
attributes
}) {
const {
hasFixedLayout,
head,
body,
foot,
caption
} = attributes;
const isEmpty = !head.length && !body.length && !foot.length;
if (isEmpty) {
return null;
}
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
const classes = dist_clsx(colorProps.className, borderProps.className, {
'has-fixed-layout': hasFixedLayout
});
const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
const Section = ({
type,
rows
}) => {
if (!rows.length) {
return null;
}
const Tag = `t${type}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
children: rows.map(({
cells
}, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
children: cells.map(({
content,
tag,
scope,
align
}, cellIndex) => {
const cellClasses = dist_clsx({
[`has-text-align-${align}`]: align
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: cellClasses ? cellClasses : undefined,
"data-align": align,
tagName: tag,
value: content,
scope: tag === 'th' ? scope : undefined
}, cellIndex);
})
}, rowIndex))
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save(),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", {
className: classes === '' ? undefined : classes,
style: {
...colorProps.style,
...borderProps.style
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "head",
rows: head
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "body",
rows: body
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "foot",
rows: foot
})]
}), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption
})]
});
}
};
// Deprecation migrating table block to use colors block support feature.
const v2Query = {
content: {
type: 'string',
source: 'html'
},
tag: {
type: 'string',
default: 'td',
source: 'tag'
},
scope: {
type: 'string',
source: 'attribute',
attribute: 'scope'
},
align: {
type: 'string',
source: 'attribute',
attribute: 'data-align'
}
};
const table_deprecated_v2 = {
attributes: {
hasFixedLayout: {
type: 'boolean',
default: false
},
backgroundColor: {
type: 'string'
},
caption: {
type: 'string',
source: 'html',
selector: 'figcaption',
default: ''
},
head: {
type: 'array',
default: [],
source: 'query',
selector: 'thead tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v2Query
}
}
},
body: {
type: 'array',
default: [],
source: 'query',
selector: 'tbody tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v2Query
}
}
},
foot: {
type: 'array',
default: [],
source: 'query',
selector: 'tfoot tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v2Query
}
}
}
},
supports: {
anchor: true,
align: true,
__experimentalSelector: '.wp-block-table > table'
},
save: ({
attributes
}) => {
const {
hasFixedLayout,
head,
body,
foot,
backgroundColor,
caption
} = attributes;
const isEmpty = !head.length && !body.length && !foot.length;
if (isEmpty) {
return null;
}
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
const classes = dist_clsx(backgroundClass, {
'has-fixed-layout': hasFixedLayout,
'has-background': !!backgroundClass
});
const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
const Section = ({
type,
rows
}) => {
if (!rows.length) {
return null;
}
const Tag = `t${type}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
children: rows.map(({
cells
}, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
children: cells.map(({
content,
tag,
scope,
align
}, cellIndex) => {
const cellClasses = dist_clsx({
[`has-text-align-${align}`]: align
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: cellClasses ? cellClasses : undefined,
"data-align": align,
tagName: tag,
value: content,
scope: tag === 'th' ? scope : undefined
}, cellIndex);
})
}, rowIndex))
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save(),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", {
className: classes === '' ? undefined : classes,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "head",
rows: head
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "body",
rows: body
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "foot",
rows: foot
})]
}), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption
})]
});
},
isEligible: attributes => {
return attributes.backgroundColor && attributes.backgroundColor in oldColors && !attributes.style;
},
// This version is the first to introduce the style attribute to the
// table block. As a result, we'll explicitly override that.
migrate: attributes => {
return {
...attributes,
backgroundColor: undefined,
style: {
color: {
background: oldColors[attributes.backgroundColor]
}
}
};
}
};
const v1Query = {
content: {
type: 'string',
source: 'html'
},
tag: {
type: 'string',
default: 'td',
source: 'tag'
},
scope: {
type: 'string',
source: 'attribute',
attribute: 'scope'
}
};
const table_deprecated_v1 = {
attributes: {
hasFixedLayout: {
type: 'boolean',
default: false
},
backgroundColor: {
type: 'string'
},
head: {
type: 'array',
default: [],
source: 'query',
selector: 'thead tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v1Query
}
}
},
body: {
type: 'array',
default: [],
source: 'query',
selector: 'tbody tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v1Query
}
}
},
foot: {
type: 'array',
default: [],
source: 'query',
selector: 'tfoot tr',
query: {
cells: {
type: 'array',
default: [],
source: 'query',
selector: 'td,th',
query: v1Query
}
}
}
},
supports: {
align: true
},
save({
attributes
}) {
const {
hasFixedLayout,
head,
body,
foot,
backgroundColor
} = attributes;
const isEmpty = !head.length && !body.length && !foot.length;
if (isEmpty) {
return null;
}
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
const classes = dist_clsx(backgroundClass, {
'has-fixed-layout': hasFixedLayout,
'has-background': !!backgroundClass
});
const Section = ({
type,
rows
}) => {
if (!rows.length) {
return null;
}
const Tag = `t${type}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
children: rows.map(({
cells
}, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
children: cells.map(({
content,
tag,
scope
}, cellIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: tag,
value: content,
scope: tag === 'th' ? scope : undefined
}, cellIndex))
}, rowIndex))
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", {
className: classes,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "head",
rows: head
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "body",
rows: body
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "foot",
rows: foot
})]
});
}
};
/**
* 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 table_deprecated = ([table_deprecated_v4, table_deprecated_v3, table_deprecated_v2, table_deprecated_v1]);
;// ./node_modules/@wordpress/icons/build-module/library/align-left.js
/**
* WordPress dependencies
*/
const alignLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"
})
});
/* harmony default export */ const align_left = (alignLeft);
;// ./node_modules/@wordpress/icons/build-module/library/align-center.js
/**
* WordPress dependencies
*/
const alignCenter = /*#__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: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"
})
});
/* harmony default export */ const align_center = (alignCenter);
;// ./node_modules/@wordpress/icons/build-module/library/align-right.js
/**
* WordPress dependencies
*/
const alignRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"
})
});
/* harmony default export */ const align_right = (alignRight);
;// ./node_modules/@wordpress/icons/build-module/library/table-row-before.js
/**
* WordPress dependencies
*/
const tableRowBefore = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"
})
});
/* harmony default export */ const table_row_before = (tableRowBefore);
;// ./node_modules/@wordpress/icons/build-module/library/table-row-after.js
/**
* WordPress dependencies
*/
const tableRowAfter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"
})
});
/* harmony default export */ const table_row_after = (tableRowAfter);
;// ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js
/**
* WordPress dependencies
*/
const tableRowDelete = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"
})
});
/* harmony default export */ const table_row_delete = (tableRowDelete);
;// ./node_modules/@wordpress/icons/build-module/library/table-column-before.js
/**
* WordPress dependencies
*/
const tableColumnBefore = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"
})
});
/* harmony default export */ const table_column_before = (tableColumnBefore);
;// ./node_modules/@wordpress/icons/build-module/library/table-column-after.js
/**
* WordPress dependencies
*/
const tableColumnAfter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"
})
});
/* harmony default export */ const table_column_after = (tableColumnAfter);
;// ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js
/**
* WordPress dependencies
*/
const tableColumnDelete = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "-2 -2 24 24",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"
})
});
/* harmony default export */ const table_column_delete = (tableColumnDelete);
;// ./node_modules/@wordpress/icons/build-module/library/table.js
/**
* WordPress dependencies
*/
const table = /*#__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: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"
})
});
/* harmony default export */ const library_table = (table);
;// ./node_modules/@wordpress/block-library/build-module/table/state.js
const INHERITED_COLUMN_ATTRIBUTES = ['align'];
/**
* Creates a table state.
*
* @param {Object} options
* @param {number} options.rowCount Row count for the table to create.
* @param {number} options.columnCount Column count for the table to create.
*
* @return {Object} New table state.
*/
function createTable({
rowCount,
columnCount
}) {
return {
body: Array.from({
length: rowCount
}).map(() => ({
cells: Array.from({
length: columnCount
}).map(() => ({
content: '',
tag: 'td'
}))
}))
};
}
/**
* Returns the first row in the table.
*
* @param {Object} state Current table state.
*
* @return {Object | undefined} The first table row.
*/
function getFirstRow(state) {
if (!isEmptyTableSection(state.head)) {
return state.head[0];
}
if (!isEmptyTableSection(state.body)) {
return state.body[0];
}
if (!isEmptyTableSection(state.foot)) {
return state.foot[0];
}
}
/**
* Gets an attribute for a cell.
*
* @param {Object} state Current table state.
* @param {Object} cellLocation The location of the cell
* @param {string} attributeName The name of the attribute to get the value of.
*
* @return {*} The attribute value.
*/
function getCellAttribute(state, cellLocation, attributeName) {
const {
sectionName,
rowIndex,
columnIndex
} = cellLocation;
return state[sectionName]?.[rowIndex]?.cells?.[columnIndex]?.[attributeName];
}
/**
* Returns updated cell attributes after applying the `updateCell` function to the selection.
*
* @param {Object} state The block attributes.
* @param {Object} selection The selection of cells to update.
* @param {Function} updateCell A function to update the selected cell attributes.
*
* @return {Object} New table state including the updated cells.
*/
function updateSelectedCell(state, selection, updateCell) {
if (!selection) {
return state;
}
const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key)));
const {
sectionName: selectionSectionName,
rowIndex: selectionRowIndex
} = selection;
return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => {
if (selectionSectionName && selectionSectionName !== sectionName) {
return [sectionName, section];
}
return [sectionName, section.map((row, rowIndex) => {
if (selectionRowIndex && selectionRowIndex !== rowIndex) {
return row;
}
return {
cells: row.cells.map((cellAttributes, columnIndex) => {
const cellLocation = {
sectionName,
columnIndex,
rowIndex
};
if (!isCellSelected(cellLocation, selection)) {
return cellAttributes;
}
return updateCell(cellAttributes);
})
};
})];
}));
}
/**
* Returns whether the cell at `cellLocation` is included in the selection `selection`.
*
* @param {Object} cellLocation An object containing cell location properties.
* @param {Object} selection An object containing selection properties.
*
* @return {boolean} True if the cell is selected, false otherwise.
*/
function isCellSelected(cellLocation, selection) {
if (!cellLocation || !selection) {
return false;
}
switch (selection.type) {
case 'column':
return selection.type === 'column' && cellLocation.columnIndex === selection.columnIndex;
case 'cell':
return selection.type === 'cell' && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex;
}
}
/**
* Inserts a row in the table state.
*
* @param {Object} state Current table state.
* @param {Object} options
* @param {string} options.sectionName Section in which to insert the row.
* @param {number} options.rowIndex Row index at which to insert the row.
* @param {number} options.columnCount Column count for the table to create.
*
* @return {Object} New table state.
*/
function insertRow(state, {
sectionName,
rowIndex,
columnCount
}) {
const firstRow = getFirstRow(state);
const cellCount = columnCount === undefined ? firstRow?.cells?.length : columnCount;
// Bail early if the function cannot determine how many cells to add.
if (!cellCount) {
return state;
}
return {
[sectionName]: [...state[sectionName].slice(0, rowIndex), {
cells: Array.from({
length: cellCount
}).map((_, index) => {
var _firstRow$cells$index;
const firstCellInColumn = (_firstRow$cells$index = firstRow?.cells?.[index]) !== null && _firstRow$cells$index !== void 0 ? _firstRow$cells$index : {};
const inheritedAttributes = Object.fromEntries(Object.entries(firstCellInColumn).filter(([key]) => INHERITED_COLUMN_ATTRIBUTES.includes(key)));
return {
...inheritedAttributes,
content: '',
tag: sectionName === 'head' ? 'th' : 'td'
};
})
}, ...state[sectionName].slice(rowIndex)]
};
}
/**
* Deletes a row from the table state.
*
* @param {Object} state Current table state.
* @param {Object} options
* @param {string} options.sectionName Section in which to delete the row.
* @param {number} options.rowIndex Row index to delete.
*
* @return {Object} New table state.
*/
function deleteRow(state, {
sectionName,
rowIndex
}) {
return {
[sectionName]: state[sectionName].filter((row, index) => index !== rowIndex)
};
}
/**
* Inserts a column in the table state.
*
* @param {Object} state Current table state.
* @param {Object} options
* @param {number} options.columnIndex Column index at which to insert the column.
*
* @return {Object} New table state.
*/
function insertColumn(state, {
columnIndex
}) {
const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key)));
return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => {
// Bail early if the table section is empty.
if (isEmptyTableSection(section)) {
return [sectionName, section];
}
return [sectionName, section.map(row => {
// Bail early if the row is empty or it's an attempt to insert past
// the last possible index of the array.
if (isEmptyRow(row) || row.cells.length < columnIndex) {
return row;
}
return {
cells: [...row.cells.slice(0, columnIndex), {
content: '',
tag: sectionName === 'head' ? 'th' : 'td'
}, ...row.cells.slice(columnIndex)]
};
})];
}));
}
/**
* Deletes a column from the table state.
*
* @param {Object} state Current table state.
* @param {Object} options
* @param {number} options.columnIndex Column index to delete.
*
* @return {Object} New table state.
*/
function deleteColumn(state, {
columnIndex
}) {
const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key)));
return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => {
// Bail early if the table section is empty.
if (isEmptyTableSection(section)) {
return [sectionName, section];
}
return [sectionName, section.map(row => ({
cells: row.cells.length >= columnIndex ? row.cells.filter((cell, index) => index !== columnIndex) : row.cells
})).filter(row => row.cells.length)];
}));
}
/**
* Toggles the existence of a section.
*
* @param {Object} state Current table state.
* @param {string} sectionName Name of the section to toggle.
*
* @return {Object} New table state.
*/
function toggleSection(state, sectionName) {
var _state$body$0$cells$l;
// Section exists, replace it with an empty row to remove it.
if (!isEmptyTableSection(state[sectionName])) {
return {
[sectionName]: []
};
}
// Get the length of the first row of the body to use when creating the header.
const columnCount = (_state$body$0$cells$l = state.body?.[0]?.cells?.length) !== null && _state$body$0$cells$l !== void 0 ? _state$body$0$cells$l : 1;
// Section doesn't exist, insert an empty row to create the section.
return insertRow(state, {
sectionName,
rowIndex: 0,
columnCount
});
}
/**
* Determines whether a table section is empty.
*
* @param {Object} section Table section state.
*
* @return {boolean} True if the table section is empty, false otherwise.
*/
function isEmptyTableSection(section) {
return !section || !section.length || section.every(isEmptyRow);
}
/**
* Determines whether a table row is empty.
*
* @param {Object} row Table row state.
*
* @return {boolean} True if the table section is empty, false otherwise.
*/
function isEmptyRow(row) {
return !(row.cells && row.cells.length);
}
;// ./node_modules/@wordpress/block-library/build-module/table/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const ALIGNMENT_CONTROLS = [{
icon: align_left,
title: (0,external_wp_i18n_namespaceObject.__)('Align column left'),
align: 'left'
}, {
icon: align_center,
title: (0,external_wp_i18n_namespaceObject.__)('Align column center'),
align: 'center'
}, {
icon: align_right,
title: (0,external_wp_i18n_namespaceObject.__)('Align column right'),
align: 'right'
}];
const cellAriaLabel = {
head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'),
body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'),
foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text')
};
const edit_placeholder = {
head: (0,external_wp_i18n_namespaceObject.__)('Header label'),
foot: (0,external_wp_i18n_namespaceObject.__)('Footer label')
};
function TSection({
name,
...props
}) {
const TagName = `t${name}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...props
});
}
function TableEdit({
attributes,
setAttributes,
insertBlocksAfter,
isSelected: isSingleSelected
}) {
const {
hasFixedLayout,
head,
foot
} = attributes;
const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2);
const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2);
const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)();
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
const tableRef = (0,external_wp_element_namespaceObject.useRef)();
const [hasTableCreated, setHasTableCreated] = (0,external_wp_element_namespaceObject.useState)(false);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
/**
* Updates the initial column count used for table creation.
*
* @param {number} count New initial column count.
*/
function onChangeInitialColumnCount(count) {
setInitialColumnCount(count);
}
/**
* Updates the initial row count used for table creation.
*
* @param {number} count New initial row count.
*/
function onChangeInitialRowCount(count) {
setInitialRowCount(count);
}
/**
* Creates a table based on dimensions in local state.
*
* @param {Object} event Form submit event.
*/
function onCreateTable(event) {
event.preventDefault();
setAttributes(createTable({
rowCount: parseInt(initialRowCount, 10) || 2,
columnCount: parseInt(initialColumnCount, 10) || 2
}));
setHasTableCreated(true);
}
/**
* Toggles whether the table has a fixed layout or not.
*/
function onChangeFixedLayout() {
setAttributes({
hasFixedLayout: !hasFixedLayout
});
}
/**
* Changes the content of the currently selected cell.
*
* @param {Array} content A RichText content value.
*/
function onChange(content) {
if (!selectedCell) {
return;
}
setAttributes(updateSelectedCell(attributes, selectedCell, cellAttributes => ({
...cellAttributes,
content
})));
}
/**
* Align text within the a column.
*
* @param {string} align The new alignment to apply to the column.
*/
function onChangeColumnAlignment(align) {
if (!selectedCell) {
return;
}
// Convert the cell selection to a column selection so that alignment
// is applied to the entire column.
const columnSelection = {
type: 'column',
columnIndex: selectedCell.columnIndex
};
const newAttributes = updateSelectedCell(attributes, columnSelection, cellAttributes => ({
...cellAttributes,
align
}));
setAttributes(newAttributes);
}
/**
* Get the alignment of the currently selected cell.
*
* @return {string | undefined} The new alignment to apply to the column.
*/
function getCellAlignment() {
if (!selectedCell) {
return;
}
return getCellAttribute(attributes, selectedCell, 'align');
}
/**
* Add or remove a `head` table section.
*/
function onToggleHeaderSection() {
setAttributes(toggleSection(attributes, 'head'));
}
/**
* Add or remove a `foot` table section.
*/
function onToggleFooterSection() {
setAttributes(toggleSection(attributes, 'foot'));
}
/**
* Inserts a row at the currently selected row index, plus `delta`.
*
* @param {number} delta Offset for selected row index at which to insert.
*/
function onInsertRow(delta) {
if (!selectedCell) {
return;
}
const {
sectionName,
rowIndex
} = selectedCell;
const newRowIndex = rowIndex + delta;
setAttributes(insertRow(attributes, {
sectionName,
rowIndex: newRowIndex
}));
// Select the first cell of the new row.
setSelectedCell({
sectionName,
rowIndex: newRowIndex,
columnIndex: 0,
type: 'cell'
});
}
/**
* Inserts a row before the currently selected row.
*/
function onInsertRowBefore() {
onInsertRow(0);
}
/**
* Inserts a row after the currently selected row.
*/
function onInsertRowAfter() {
onInsertRow(1);
}
/**
* Deletes the currently selected row.
*/
function onDeleteRow() {
if (!selectedCell) {
return;
}
const {
sectionName,
rowIndex
} = selectedCell;
setSelectedCell();
setAttributes(deleteRow(attributes, {
sectionName,
rowIndex
}));
}
/**
* Inserts a column at the currently selected column index, plus `delta`.
*
* @param {number} delta Offset for selected column index at which to insert.
*/
function onInsertColumn(delta = 0) {
if (!selectedCell) {
return;
}
const {
columnIndex
} = selectedCell;
const newColumnIndex = columnIndex + delta;
setAttributes(insertColumn(attributes, {
columnIndex: newColumnIndex
}));
// Select the first cell of the new column.
setSelectedCell({
rowIndex: 0,
columnIndex: newColumnIndex,
type: 'cell'
});
}
/**
* Inserts a column before the currently selected column.
*/
function onInsertColumnBefore() {
onInsertColumn(0);
}
/**
* Inserts a column after the currently selected column.
*/
function onInsertColumnAfter() {
onInsertColumn(1);
}
/**
* Deletes the currently selected column.
*/
function onDeleteColumn() {
if (!selectedCell) {
return;
}
const {
sectionName,
columnIndex
} = selectedCell;
setSelectedCell();
setAttributes(deleteColumn(attributes, {
sectionName,
columnIndex
}));
}
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSingleSelected) {
setSelectedCell();
}
}, [isSingleSelected]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasTableCreated) {
tableRef?.current?.querySelector('td div[contentEditable="true"]')?.focus();
setHasTableCreated(false);
}
}, [hasTableCreated]);
const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name]));
const tableControls = [{
icon: table_row_before,
title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'),
isDisabled: !selectedCell,
onClick: onInsertRowBefore
}, {
icon: table_row_after,
title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'),
isDisabled: !selectedCell,
onClick: onInsertRowAfter
}, {
icon: table_row_delete,
title: (0,external_wp_i18n_namespaceObject.__)('Delete row'),
isDisabled: !selectedCell,
onClick: onDeleteRow
}, {
icon: table_column_before,
title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'),
isDisabled: !selectedCell,
onClick: onInsertColumnBefore
}, {
icon: table_column_after,
title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'),
isDisabled: !selectedCell,
onClick: onInsertColumnAfter
}, {
icon: table_column_delete,
title: (0,external_wp_i18n_namespaceObject.__)('Delete column'),
isDisabled: !selectedCell,
onClick: onDeleteColumn
}];
const renderedSections = sections.map(name => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TSection, {
name: name,
children: attributes[name].map(({
cells
}, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
children: cells.map(({
content,
tag: CellTag,
scope,
align,
colspan,
rowspan
}, columnIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CellTag, {
scope: CellTag === 'th' ? scope : undefined,
colSpan: colspan,
rowSpan: rowspan,
className: dist_clsx({
[`has-text-align-${align}`]: align
}, 'wp-block-table__cell-content'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
value: content,
onChange: onChange,
onFocus: () => {
setSelectedCell({
sectionName: name,
rowIndex,
columnIndex,
type: 'cell'
});
},
"aria-label": cellAriaLabel[name],
placeholder: edit_placeholder[name]
})
}, columnIndex))
}, rowIndex))
}, name));
const isEmpty = !sections.length;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", {
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref: tableRef
}),
children: [!isEmpty && /*#__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, {
label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'),
alignmentControls: ALIGNMENT_CONTROLS,
value: getCellAlignment(),
onChange: nextAlign => onChangeColumnAlignment(nextAlign)
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "other",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
icon: library_table,
label: (0,external_wp_i18n_namespaceObject.__)('Edit table'),
controls: tableControls
})
})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
hasFixedLayout: true,
head: [],
foot: []
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => hasFixedLayout !== true,
label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'),
onDeselect: () => setAttributes({
hasFixedLayout: true
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'),
checked: !!hasFixedLayout,
onChange: onChangeFixedLayout
})
}), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => head && head.length,
label: (0,external_wp_i18n_namespaceObject.__)('Header section'),
onDeselect: () => setAttributes({
head: []
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Header section'),
checked: !!(head && head.length),
onChange: onToggleHeaderSection
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => foot && foot.length,
label: (0,external_wp_i18n_namespaceObject.__)('Footer section'),
onDeselect: () => setAttributes({
foot: []
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Footer section'),
checked: !!(foot && foot.length),
onChange: onToggleFooterSection
})
})]
})]
})
}), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("table", {
className: dist_clsx(colorProps.className, borderProps.className, {
'has-fixed-layout': hasFixedLayout,
// This is required in the editor only to overcome
// the fact the editor rewrites individual border
// widths into a shorthand format.
'has-individual-borders': (0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(attributes?.style?.border)
}),
style: {
...colorProps.style,
...borderProps.style
},
children: renderedSections
}), isEmpty ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
label: (0,external_wp_i18n_namespaceObject.__)('Table'),
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
icon: block_table,
showColors: true
}),
instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", {
className: "blocks-table__placeholder-form",
onSubmit: onCreateTable,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
type: "number",
label: (0,external_wp_i18n_namespaceObject.__)('Column count'),
value: initialColumnCount,
onChange: onChangeInitialColumnCount,
min: "1",
className: "blocks-table__placeholder-input"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
type: "number",
label: (0,external_wp_i18n_namespaceObject.__)('Row count'),
value: initialRowCount,
onChange: onChangeInitialRowCount,
min: "1",
className: "blocks-table__placeholder-input"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "primary",
type: "submit",
children: (0,external_wp_i18n_namespaceObject.__)('Create Table')
})]
})
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, {
attributes: attributes,
setAttributes: setAttributes,
isSelected: isSingleSelected,
insertBlocksAfter: insertBlocksAfter,
label: (0,external_wp_i18n_namespaceObject.__)('Table caption text'),
showToolbarButton: isSingleSelected
})]
});
}
/* harmony default export */ const table_edit = (TableEdit);
;// ./node_modules/@wordpress/block-library/build-module/table/save.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function table_save_save({
attributes
}) {
const {
hasFixedLayout,
head,
body,
foot,
caption
} = attributes;
const isEmpty = !head.length && !body.length && !foot.length;
if (isEmpty) {
return null;
}
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
const classes = dist_clsx(colorProps.className, borderProps.className, {
'has-fixed-layout': hasFixedLayout
});
const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
const Section = ({
type,
rows
}) => {
if (!rows.length) {
return null;
}
const Tag = `t${type}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
children: rows.map(({
cells
}, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
children: cells.map(({
content,
tag,
scope,
align,
colspan,
rowspan
}, cellIndex) => {
const cellClasses = dist_clsx({
[`has-text-align-${align}`]: align
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: cellClasses ? cellClasses : undefined,
"data-align": align,
tagName: tag,
value: content,
scope: tag === 'th' ? scope : undefined,
colSpan: colspan,
rowSpan: rowspan
}, cellIndex);
})
}, rowIndex))
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save(),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", {
className: classes === '' ? undefined : classes,
style: {
...colorProps.style,
...borderProps.style
},
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "head",
rows: head
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "body",
rows: body
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, {
type: "foot",
rows: foot
})]
}), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption,
className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/table/utils.js
/**
* Normalize the rowspan/colspan value.
* Returns undefined if the parameter is not a positive number
* or the default value (1) for rowspan/colspan.
*
* @param {number|undefined} rowColSpan rowspan/colspan value.
*
* @return {string|undefined} normalized rowspan/colspan value.
*/
function normalizeRowColSpan(rowColSpan) {
const parsedValue = parseInt(rowColSpan, 10);
if (!Number.isInteger(parsedValue)) {
return undefined;
}
return parsedValue < 0 || parsedValue === 1 ? undefined : parsedValue.toString();
}
;// ./node_modules/@wordpress/block-library/build-module/table/transforms.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const tableContentPasteSchema = ({
phrasingContentSchema
}) => ({
tr: {
allowEmpty: true,
children: {
th: {
allowEmpty: true,
children: phrasingContentSchema,
attributes: ['scope', 'colspan', 'rowspan']
},
td: {
allowEmpty: true,
children: phrasingContentSchema,
attributes: ['colspan', 'rowspan']
}
}
}
});
const tablePasteSchema = args => ({
table: {
children: {
thead: {
allowEmpty: true,
children: tableContentPasteSchema(args)
},
tfoot: {
allowEmpty: true,
children: tableContentPasteSchema(args)
},
tbody: {
allowEmpty: true,
children: tableContentPasteSchema(args)
}
}
}
});
const table_transforms_transforms = {
from: [{
type: 'raw',
selector: 'table',
schema: tablePasteSchema,
transform: node => {
const attributes = Array.from(node.children).reduce((sectionAcc, section) => {
if (!section.children.length) {
return sectionAcc;
}
const sectionName = section.nodeName.toLowerCase().slice(1);
const sectionAttributes = Array.from(section.children).reduce((rowAcc, row) => {
if (!row.children.length) {
return rowAcc;
}
const rowAttributes = Array.from(row.children).reduce((colAcc, col) => {
const rowspan = normalizeRowColSpan(col.getAttribute('rowspan'));
const colspan = normalizeRowColSpan(col.getAttribute('colspan'));
colAcc.push({
tag: col.nodeName.toLowerCase(),
content: col.innerHTML,
rowspan,
colspan
});
return colAcc;
}, []);
rowAcc.push({
cells: rowAttributes
});
return rowAcc;
}, []);
sectionAcc[sectionName] = sectionAttributes;
return sectionAcc;
}, {});
return (0,external_wp_blocks_namespaceObject.createBlock)('core/table', attributes);
}
}]
};
/* harmony default export */ const table_transforms = (table_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/table/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const table_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/table",
title: "Table",
category: "text",
description: "Create structured content in rows and columns to display information.",
textdomain: "default",
attributes: {
hasFixedLayout: {
type: "boolean",
"default": true
},
caption: {
type: "rich-text",
source: "rich-text",
selector: "figcaption"
},
head: {
type: "array",
"default": [],
source: "query",
selector: "thead tr",
query: {
cells: {
type: "array",
"default": [],
source: "query",
selector: "td,th",
query: {
content: {
type: "rich-text",
source: "rich-text"
},
tag: {
type: "string",
"default": "td",
source: "tag"
},
scope: {
type: "string",
source: "attribute",
attribute: "scope"
},
align: {
type: "string",
source: "attribute",
attribute: "data-align"
},
colspan: {
type: "string",
source: "attribute",
attribute: "colspan"
},
rowspan: {
type: "string",
source: "attribute",
attribute: "rowspan"
}
}
}
}
},
body: {
type: "array",
"default": [],
source: "query",
selector: "tbody tr",
query: {
cells: {
type: "array",
"default": [],
source: "query",
selector: "td,th",
query: {
content: {
type: "rich-text",
source: "rich-text"
},
tag: {
type: "string",
"default": "td",
source: "tag"
},
scope: {
type: "string",
source: "attribute",
attribute: "scope"
},
align: {
type: "string",
source: "attribute",
attribute: "data-align"
},
colspan: {
type: "string",
source: "attribute",
attribute: "colspan"
},
rowspan: {
type: "string",
source: "attribute",
attribute: "rowspan"
}
}
}
}
},
foot: {
type: "array",
"default": [],
source: "query",
selector: "tfoot tr",
query: {
cells: {
type: "array",
"default": [],
source: "query",
selector: "td,th",
query: {
content: {
type: "rich-text",
source: "rich-text"
},
tag: {
type: "string",
"default": "td",
source: "tag"
},
scope: {
type: "string",
source: "attribute",
attribute: "scope"
},
align: {
type: "string",
source: "attribute",
attribute: "data-align"
},
colspan: {
type: "string",
source: "attribute",
attribute: "colspan"
},
rowspan: {
type: "string",
source: "attribute",
attribute: "rowspan"
}
}
}
}
}
},
supports: {
anchor: true,
align: true,
color: {
__experimentalSkipSerialization: true,
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true,
__experimentalDefaultControls: {
margin: false,
padding: false
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalDefaultControls: {
fontSize: true
}
},
__experimentalBorder: {
__experimentalSkipSerialization: true,
color: true,
style: true,
width: true,
__experimentalDefaultControls: {
color: true,
style: true,
width: true
}
},
interactivity: {
clientNavigation: true
}
},
selectors: {
root: ".wp-block-table > table",
spacing: ".wp-block-table"
},
styles: [{
name: "regular",
label: "Default",
isDefault: true
}, {
name: "stripes",
label: "Stripes"
}],
editorStyle: "wp-block-table-editor",
style: "wp-block-table"
};
const {
name: table_name
} = table_metadata;
const table_settings = {
icon: block_table,
example: {
attributes: {
head: [{
cells: [{
content: (0,external_wp_i18n_namespaceObject.__)('Version'),
tag: 'th'
}, {
content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'),
tag: 'th'
}, {
content: (0,external_wp_i18n_namespaceObject.__)('Release Date'),
tag: 'th'
}]
}],
body: [{
cells: [{
content: '5.2',
tag: 'td'
}, {
content: 'Jaco Pastorius',
tag: 'td'
}, {
content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'),
tag: 'td'
}]
}, {
cells: [{
content: '5.1',
tag: 'td'
}, {
content: 'Betty Carter',
tag: 'td'
}, {
content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'),
tag: 'td'
}]
}, {
cells: [{
content: '5.0',
tag: 'td'
}, {
content: 'Bebo Valdés',
tag: 'td'
}, {
content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'),
tag: 'td'
}]
}]
},
viewportWidth: 450
},
transforms: table_transforms,
edit: table_edit,
save: table_save_save,
deprecated: table_deprecated
};
const table_init = () => initBlock({
name: table_name,
metadata: table_metadata,
settings: table_settings
});
;// ./node_modules/@wordpress/icons/build-module/library/table-of-contents.js
/**
* WordPress dependencies
*/
const tableOfContents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M20 9.484h-8.889v-1.5H20v1.5Zm0 7h-4.889v-1.5H20v1.5Zm-14 .032a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13 15.516a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 8.484a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"
})]
});
/* harmony default export */ const table_of_contents = (tableOfContents);
;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/list.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
const ENTRY_CLASS_NAME = 'wp-block-table-of-contents__entry';
function TableOfContentsList({
nestedHeadingList,
disableLinkActivation,
onClick
}) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: nestedHeadingList.map((node, index) => {
const {
content,
link
} = node.heading;
const entry = link ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
className: ENTRY_CLASS_NAME,
href: link,
"aria-disabled": disableLinkActivation || undefined,
onClick: disableLinkActivation && 'function' === typeof onClick ? onClick : undefined,
children: content
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: ENTRY_CLASS_NAME,
children: content
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
children: [entry, node.children ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, {
nestedHeadingList: node.children,
disableLinkActivation: disableLinkActivation,
onClick: disableLinkActivation && 'function' === typeof onClick ? onClick : undefined
})
}) : null]
}, index);
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/utils.js
/**
* Takes a flat list of heading parameters and nests them based on each header's
* immediate parent's level.
*
* @param headingList The flat list of headings to nest.
*
* @return The nested list of headings.
*/
function linearToNestedHeadingList(headingList) {
const nestedHeadingList = [];
headingList.forEach((heading, key) => {
if (heading.content === '') {
return;
}
// Make sure we are only working with the same level as the first iteration in our set.
if (heading.level === headingList[0].level) {
// Check that the next iteration will return a value.
// If it does and the next level is greater than the current level,
// the next iteration becomes a child of the current iteration.
if (headingList[key + 1]?.level > heading.level) {
// We must calculate the last index before the next iteration that
// has the same level (siblings). We then use this index to slice
// the array for use in recursion. This prevents duplicate nodes.
let endOfSlice = headingList.length;
for (let i = key + 1; i < headingList.length; i++) {
if (headingList[i].level === heading.level) {
endOfSlice = i;
break;
}
}
// We found a child node: Push a new node onto the return array
// with children.
nestedHeadingList.push({
heading,
children: linearToNestedHeadingList(headingList.slice(key + 1, endOfSlice))
});
} else {
// No child node: Push a new node onto the return array.
nestedHeadingList.push({
heading,
children: null
});
}
}
});
return nestedHeadingList;
}
// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
var es6 = __webpack_require__(7734);
var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/hooks.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function getLatestHeadings(select, clientId) {
var _select$getPermalink, _getBlockAttributes;
const {
getBlockAttributes,
getBlockName,
getClientIdsWithDescendants,
getBlocksByName
} = select(external_wp_blockEditor_namespaceObject.store);
// FIXME: @wordpress/block-library should not depend on @wordpress/editor.
// Blocks can be loaded into a *non-post* block editor, so to avoid
// declaring @wordpress/editor as a dependency, we must access its
// store by string. When the store is not available, editorSelectors
// will be null, and the block's saved markup will lack permalinks.
// eslint-disable-next-line @wordpress/data-no-store-string-literals
const permalink = (_select$getPermalink = select('core/editor').getPermalink()) !== null && _select$getPermalink !== void 0 ? _select$getPermalink : null;
const isPaginated = getBlocksByName('core/nextpage').length !== 0;
const {
onlyIncludeCurrentPage
} = (_getBlockAttributes = getBlockAttributes(clientId)) !== null && _getBlockAttributes !== void 0 ? _getBlockAttributes : {};
// Get the client ids of all blocks in the editor.
const allBlockClientIds = getClientIdsWithDescendants();
// If onlyIncludeCurrentPage is true, calculate the page (of a paginated post) this block is part of, so we know which headings to include; otherwise, skip the calculation.
let tocPage = 1;
if (isPaginated && onlyIncludeCurrentPage) {
// We can't use getBlockIndex because it only returns the index
// relative to sibling blocks.
const tocIndex = allBlockClientIds.indexOf(clientId);
for (const [blockIndex, blockClientId] of allBlockClientIds.entries()) {
// If we've reached blocks after the Table of Contents, we've
// finished calculating which page the block is on.
if (blockIndex >= tocIndex) {
break;
}
if (getBlockName(blockClientId) === 'core/nextpage') {
tocPage++;
}
}
}
const latestHeadings = [];
/** The page (of a paginated post) a heading will be part of. */
let headingPage = 1;
let headingPageLink = null;
// If the core/editor store is available, we can add permalinks to the
// generated table of contents.
if (typeof permalink === 'string') {
headingPageLink = isPaginated ? (0,external_wp_url_namespaceObject.addQueryArgs)(permalink, {
page: headingPage
}) : permalink;
}
for (const blockClientId of allBlockClientIds) {
const blockName = getBlockName(blockClientId);
if (blockName === 'core/nextpage') {
headingPage++;
// If we're only including headings from the current page (of
// a paginated post), then exit the loop if we've reached the
// pages after the one with the Table of Contents block.
if (onlyIncludeCurrentPage && headingPage > tocPage) {
break;
}
if (typeof permalink === 'string') {
headingPageLink = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(permalink, ['page']), {
page: headingPage
});
}
}
// If we're including all headings or we've reached headings on
// the same page as the Table of Contents block, add them to the
// list.
else if (!onlyIncludeCurrentPage || headingPage === tocPage) {
if (blockName === 'core/heading') {
const headingAttributes = getBlockAttributes(blockClientId);
const canBeLinked = typeof headingPageLink === 'string' && typeof headingAttributes.anchor === 'string' && headingAttributes.anchor !== '';
latestHeadings.push({
// Convert line breaks to spaces, and get rid of HTML tags in the headings.
content: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(headingAttributes.content.replace(/(
)+/g, ' ')),
level: headingAttributes.level,
link: canBeLinked ? `${headingPageLink}#${headingAttributes.anchor}` : null
});
}
}
}
return latestHeadings;
}
function observeCallback(select, dispatch, clientId) {
const {
getBlockAttributes
} = select(external_wp_blockEditor_namespaceObject.store);
const {
updateBlockAttributes,
__unstableMarkNextChangeAsNotPersistent
} = dispatch(external_wp_blockEditor_namespaceObject.store);
/**
* If the block no longer exists in the store, skip the update.
* The "undo" action recreates the block and provides a new `clientId`.
* The hook still might be observing the changes while the old block unmounts.
*/
const attributes = getBlockAttributes(clientId);
if (attributes === null) {
return;
}
const headings = getLatestHeadings(select, clientId);
if (!es6_default()(headings, attributes.headings)) {
__unstableMarkNextChangeAsNotPersistent();
updateBlockAttributes(clientId, {
headings
});
}
}
function useObserveHeadings(clientId) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
// Todo: Limit subscription to block editor store when data no longer depends on `getPermalink`.
// See: https://github.com/WordPress/gutenberg/pull/45513
return registry.subscribe(() => observeCallback(registry.select, registry.dispatch, clientId));
}, [registry, clientId]);
}
;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/** @typedef {import('./utils').HeadingData} HeadingData */
/**
* Table of Contents block edit component.
*
* @param {Object} props The props.
* @param {Object} props.attributes The block attributes.
* @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post.
* @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).
* @param {string} props.clientId
* @param {(attributes: Object) => void} props.setAttributes
*
* @return {Component} The component.
*/
function TableOfContentsEdit({
attributes: {
headings = [],
onlyIncludeCurrentPage
},
clientId,
setAttributes
}) {
useObserveHeadings(clientId);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(TableOfContentsEdit, 'table-of-contents');
// If a user clicks to a link prevent redirection and show a warning.
const {
createWarningNotice
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const showRedirectionPreventedNotice = event => {
event.preventDefault();
createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), {
id: `block-library/core/table-of-contents/redirection-prevented/${instanceId}`,
type: 'snackbar'
});
};
const canInsertList = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlockRootClientId,
canInsertBlockType
} = select(external_wp_blockEditor_namespaceObject.store);
const rootClientId = getBlockRootClientId(clientId);
return canInsertBlockType('core/list', rootClientId);
}, [clientId]);
const {
replaceBlocks
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const headingTree = linearToNestedHeadingList(headings);
const toolbarControls = canInsertList && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: () => replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
ordered: true,
values: (0,external_wp_element_namespaceObject.renderToString)(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, {
nestedHeadingList: headingTree
}))
})),
children: (0,external_wp_i18n_namespaceObject.__)('Convert to static list')
})
})
});
const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
onlyIncludeCurrentPage: false
});
},
dropdownMenuProps: dropdownMenuProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!onlyIncludeCurrentPage,
label: (0,external_wp_i18n_namespaceObject.__)('Only include current page'),
onDeselect: () => setAttributes({
onlyIncludeCurrentPage: false
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Only include current page'),
checked: onlyIncludeCurrentPage,
onChange: value => setAttributes({
onlyIncludeCurrentPage: value
}),
help: onlyIncludeCurrentPage ? (0,external_wp_i18n_namespaceObject.__)('Only including headings from the current page (if the post is paginated).') : (0,external_wp_i18n_namespaceObject.__)('Include headings from all pages (if the post is paginated).')
})
})
})
});
// If there are no headings or the only heading is empty.
// Note that the toolbar controls are intentionally omitted since the
// "Convert to static list" option is useless to the placeholder state.
if (headings.length === 0) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__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: table_of_contents
}),
label: (0,external_wp_i18n_namespaceObject.__)('Table of Contents'),
instructions: (0,external_wp_i18n_namespaceObject.__)('Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.')
})
}), inspectorControls]
});
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", {
...blockProps,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, {
nestedHeadingList: headingTree,
disableLinkActivation: true,
onClick: showRedirectionPreventedNotice
})
})
}), toolbarControls, inspectorControls]
});
}
;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/save.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function table_of_contents_save_save({
attributes: {
headings = []
}
}) {
if (headings.length === 0) {
return null;
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", {
...external_wp_blockEditor_namespaceObject.useBlockProps.save(),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, {
nestedHeadingList: linearToNestedHeadingList(headings)
})
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const table_of_contents_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
__experimental: true,
name: "core/table-of-contents",
title: "Table of Contents",
category: "design",
description: "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.",
keywords: ["document outline", "summary"],
textdomain: "default",
attributes: {
headings: {
type: "array",
items: {
type: "object"
},
"default": []
},
onlyIncludeCurrentPage: {
type: "boolean",
"default": false
}
},
supports: {
html: false,
color: {
text: true,
background: true,
gradients: true,
link: true
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
style: "wp-block-table-of-contents"
};
const {
name: table_of_contents_name
} = table_of_contents_metadata;
const table_of_contents_settings = {
icon: table_of_contents,
edit: TableOfContentsEdit,
save: table_of_contents_save_save,
example: {
innerBlocks: [{
name: 'core/heading',
attributes: {
level: 2,
content: (0,external_wp_i18n_namespaceObject.__)('Heading')
}
}, {
name: 'core/heading',
attributes: {
level: 3,
content: (0,external_wp_i18n_namespaceObject.__)('Subheading')
}
}, {
name: 'core/heading',
attributes: {
level: 2,
content: (0,external_wp_i18n_namespaceObject.__)('Heading')
}
}, {
name: 'core/heading',
attributes: {
level: 3,
content: (0,external_wp_i18n_namespaceObject.__)('Subheading')
}
}],
attributes: {
headings: [{
content: (0,external_wp_i18n_namespaceObject.__)('Heading'),
level: 2
}, {
content: (0,external_wp_i18n_namespaceObject.__)('Subheading'),
level: 3
}, {
content: (0,external_wp_i18n_namespaceObject.__)('Heading'),
level: 2
}, {
content: (0,external_wp_i18n_namespaceObject.__)('Subheading'),
level: 3
}]
}
}
};
const table_of_contents_init = () => initBlock({
name: table_of_contents_name,
metadata: table_of_contents_metadata,
settings: table_of_contents_settings
});
;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/transforms.js
/**
* WordPress dependencies
*/
const tag_cloud_transforms_transforms = {
from: [{
type: 'block',
blocks: ['core/categories'],
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/tag-cloud')
}],
to: [{
type: 'block',
blocks: ['core/categories'],
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/categories')
}]
};
/* harmony default export */ const tag_cloud_transforms = (tag_cloud_transforms_transforms);
;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Minimum number of tags a user can show using this block.
*
* @type {number}
*/
const MIN_TAGS = 1;
/**
* Maximum number of tags a user can show using this block.
*
* @type {number}
*/
const MAX_TAGS = 100;
const MIN_FONT_SIZE = 0.1;
const MAX_FONT_SIZE = 100;
function TagCloudEdit({
attributes,
setAttributes
}) {
const {
taxonomy,
showTagCounts,
numberOfTags,
smallestFontSize,
largestFontSize
} = attributes;
const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units');
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
// The `pt` unit is used as the default value and is therefore
// always considered an available unit.
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits ? [...availableUnits, 'pt'] : ['%', 'px', 'em', 'rem', 'pt']
});
const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getTaxonomies({
per_page: -1
}), []);
const getTaxonomyOptions = () => {
const selectOption = {
label: (0,external_wp_i18n_namespaceObject.__)('- Select -'),
value: '',
disabled: true
};
const taxonomyOptions = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(tax => !!tax.show_cloud).map(item => {
return {
value: item.slug,
label: item.name
};
});
return [selectOption, ...taxonomyOptions];
};
const onFontSizeChange = (fontSizeLabel, newValue) => {
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
const [quantity, newUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(newValue);
if (!Number.isFinite(quantity)) {
return;
}
const updateObj = {
[fontSizeLabel]: newValue
};
// We need to keep in sync the `unit` changes to both `smallestFontSize`
// and `largestFontSize` attributes.
Object.entries({
smallestFontSize,
largestFontSize
}).forEach(([attribute, currentValue]) => {
const [currentQuantity, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue);
// Only add an update if the other font size attribute has a different unit.
if (attribute !== fontSizeLabel && currentUnit !== newUnit) {
updateObj[attribute] = `${currentQuantity}${newUnit}`;
}
});
setAttributes(updateObj);
};
// Remove border styles from the server-side attributes to prevent duplicate border.
const serverSideAttributes = {
...attributes,
style: {
...attributes?.style,
border: undefined
}
};
const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
taxonomy: 'post_tag',
showTagCounts: false,
numberOfTags: 45,
smallestFontSize: '8pt',
largestFontSize: '22pt'
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => taxonomy !== 'post_tag',
label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'),
onDeselect: () => setAttributes({
taxonomy: 'post_tag'
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'),
options: getTaxonomyOptions(),
value: taxonomy,
onChange: selectedTaxonomy => setAttributes({
taxonomy: selectedTaxonomy
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => smallestFontSize !== '8pt' || largestFontSize !== '22pt',
label: (0,external_wp_i18n_namespaceObject.__)('Font size'),
onDeselect: () => setAttributes({
smallestFontSize: '8pt',
largestFontSize: '22pt'
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
gap: 4,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
isBlock: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Smallest size'),
value: smallestFontSize,
onChange: value => {
onFontSizeChange('smallestFontSize', value);
},
units: units,
min: MIN_FONT_SIZE,
max: MAX_FONT_SIZE,
size: "__unstable-large"
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
isBlock: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Largest size'),
value: largestFontSize,
onChange: value => {
onFontSizeChange('largestFontSize', value);
},
units: units,
min: MIN_FONT_SIZE,
max: MAX_FONT_SIZE,
size: "__unstable-large"
})
})]
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => numberOfTags !== 45,
label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'),
onDeselect: () => setAttributes({
numberOfTags: 45
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'),
value: numberOfTags,
onChange: value => setAttributes({
numberOfTags: value
}),
min: MIN_TAGS,
max: MAX_TAGS,
required: true
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => showTagCounts !== false,
label: (0,external_wp_i18n_namespaceObject.__)('Show tag counts'),
onDeselect: () => setAttributes({
showTagCounts: false
}),
isShownByDefault: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Show tag counts'),
checked: showTagCounts,
onChange: () => setAttributes({
showTagCounts: !showTagCounts
})
})
})]
})
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), {
skipBlockSupportAttributes: true,
block: "core/tag-cloud",
attributes: serverSideAttributes
})
})
})]
});
}
/* harmony default export */ const tag_cloud_edit = (TagCloudEdit);
;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const tag_cloud_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 3,
name: "core/tag-cloud",
title: "Tag Cloud",
category: "widgets",
description: "A cloud of popular keywords, each sized by how often it appears.",
textdomain: "default",
attributes: {
numberOfTags: {
type: "number",
"default": 45,
minimum: 1,
maximum: 100
},
taxonomy: {
type: "string",
"default": "post_tag"
},
showTagCounts: {
type: "boolean",
"default": false
},
smallestFontSize: {
type: "string",
"default": "8pt"
},
largestFontSize: {
type: "string",
"default": "22pt"
}
},
styles: [{
name: "default",
label: "Default",
isDefault: true
}, {
name: "outline",
label: "Outline"
}],
supports: {
html: false,
align: true,
spacing: {
margin: true,
padding: true
},
typography: {
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalLetterSpacing: true
},
interactivity: {
clientNavigation: true
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
},
editorStyle: "wp-block-tag-cloud-editor"
};
const {
name: tag_cloud_name
} = tag_cloud_metadata;
const tag_cloud_settings = {
icon: library_tag,
example: {},
edit: tag_cloud_edit,
transforms: tag_cloud_transforms
};
const tag_cloud_init = () => initBlock({
name: tag_cloud_name,
metadata: tag_cloud_metadata,
settings: tag_cloud_settings
});
;// ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
function __rewriteRelativeImportExtension(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
});
}
return path;
}
/* harmony default export */ const tslib_es6 = ({
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
__rewriteRelativeImportExtension,
});
;// ./node_modules/lower-case/dist.es2015/index.js
/**
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*/
var SUPPORTED_LOCALE = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
az: {
regexp: /\u0130/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
lt: {
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
map: {
I: "\u0069\u0307",
J: "\u006A\u0307",
Į: "\u012F\u0307",
Ì: "\u0069\u0307\u0300",
Í: "\u0069\u0307\u0301",
Ĩ: "\u0069\u0307\u0303",
},
},
};
/**
* Localized lower case.
*/
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
if (lang)
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
return lowerCase(str);
}
/**
* Lower case as a function.
*/
function lowerCase(str) {
return str.toLowerCase();
}
;// ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
/**
* Normalize the string into something other libraries can manipulate easier.
*/
function noCase(input, options) {
if (options === void 0) { options = {}; }
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
var start = 0;
var end = result.length;
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
start++;
while (result.charAt(end - 1) === "\0")
end--;
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
}
/**
* Replace `re` in the input string with the replacement value.
*/
function replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
}
;// ./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);
}
;// ./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));
}
;// ./node_modules/dot-case/dist.es2015/index.js
function dotCase(input, options) {
if (options === void 0) { options = {}; }
return noCase(input, __assign({ delimiter: "." }, options));
}
;// ./node_modules/param-case/dist.es2015/index.js
function paramCase(input, options) {
if (options === void 0) { options = {}; }
return dotCase(input, __assign({ delimiter: "-" }, options));
}
;// ./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;
const definedAreas = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [];
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]);
}
;// ./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)('');
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.__)('Create new %s'), areaLabel.toLowerCase()),
onRequestClose: onClose,
focusOnMount: "firstContentElement",
size: "small",
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, {
label: (0,external_wp_i18n_namespaceObject.__)('Name'),
value: title,
onChange: setTitle,
placeholder: (0,external_wp_i18n_namespaceObject.__)('Custom Template Part'),
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "right",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: () => {
onClose();
setTitle('');
},
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
variant: "primary",
type: "submit",
accessibleWhenDisabled: true,
disabled: !title.length,
__next40pxDefaultSize: true,
children: (0,external_wp_i18n_namespaceObject.__)('Create')
})]
})]
})
})
});
}
;// ./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 {
isBlockBasedTheme,
canCreateTemplatePart
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getCurrentTheme,
canUser
} = select(external_wp_coreData_namespaceObject.store);
return {
isBlockBasedTheme: getCurrentTheme()?.is_block_theme,
canCreateTemplatePart: canUser('create', {
kind: 'postType',
name: 'wp_template_part'
})
};
}, []);
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: isBlockBasedTheme ? (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()) : (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.'), 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, {
__next40pxDefaultSize: true,
variant: "primary",
onClick: onOpenSelectionModal,
children: (0,external_wp_i18n_namespaceObject.__)('Choose')
}), !isResolving && isBlockBasedTheme && canCreateTemplatePart && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
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);
}
})]
});
}
;// ./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
};
}
;// ./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 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'),
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,
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.')
})
})]
});
}
;// ./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);
}
;// ./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')
})
})]
})
});
}
;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
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 defaultTemplatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [], []);
const areaOptions = defaultTemplatePartAreas.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, {
__next40pxDefaultSize: true,
__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, {
__next40pxDefaultSize: true,
__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: '
',
value: 'header'
}, {
label: '',
value: 'main'
}, {
label: '',
value: 'section'
}, {
label: '',
value: 'article'
}, {
label: '',
value: 'aside'
}, {
label: '',
value: 'footer'
}, {
label: '',
value: 'div'
}],
value: tagName || '',
onChange: value => setAttributes({
tagName: value
}),
help: htmlElementMessages[tagName]
}), !hasInnerBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartImportControls, {
area: area,
setAttributes: setAttributes
})]
});
}
;// ./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 onNavigateToEntityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().onNavigateToEntityRecord, []);
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)
});
const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
const customProps = blockEditingMode === 'contentOnly' && onNavigateToEntityRecord ? {
onDoubleClick: () => onNavigateToEntityRecord({
postId: id,
postType: 'wp_template_part'
})
} : {};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
...innerBlocksProps,
...customProps
});
}
function TemplatePartInnerBlocks({
postId: id,
hasInnerBlocks,
layout,
tagName: TagName,
blockProps
}) {
const {
canViewTemplatePart,
canEditTemplatePart
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
return {
canViewTemplatePart: !!select(external_wp_coreData_namespaceObject.store).canUser('read', {
kind: 'postType',
name: 'wp_template_part',
id
}),
canEditTemplatePart: !!select(external_wp_coreData_namespaceObject.store).canUser('update', {
kind: 'postType',
name: 'wp_template_part',
id
})
};
}, [id]);
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
});
}
;// ./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');
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,
onClickPattern: onSelect,
showTitlesAsTooltip: true
})
});
}
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,
canUserEdit
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
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 _canUserEdit = hasResolvedEntity ? select(external_wp_coreData_namespaceObject.store).canUser('update', {
kind: 'postType',
name: 'wp_template_part',
id: templatePartId
}) : false;
return {
hasInnerBlocks: getBlockCount(clientId) > 0,
isResolved: hasResolvedEntity,
isMissing: hasResolvedEntity && (!entityRecord || Object.keys(entityRecord).length === 0),
area: _area,
onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord,
title: entityRecord?.title,
canUserEdit: !!_canUserEdit
};
}, [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 && canUserEdit && /*#__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')
})
}), canUserEdit && /*#__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)
})
})]
});
}
;// ./node_modules/@wordpress/block-library/build-module/template-part/variations.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
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;
}
;// ./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
});
};
;// ./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);
;// ./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')
})
})
})]
});
}
;// ./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
},
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true,
__experimentalDefaultControls: {
radius: true,
color: true,
width: true,
style: true
}
}
}
};
const {
name: term_description_name
} = term_description_metadata;
const term_description_settings = {
icon: term_description,
edit: TermDescriptionEdit,
example: {}
};
const term_description_init = () => initBlock({
name: term_description_name,
metadata: term_description_metadata,
settings: term_description_settings
});
;// ./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}`);
})
})]
});
}
;// ./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}`))
});
}
;// ./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);
;// ./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
});
;// ./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,
role: '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]);
;// ./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)()))
})]
});
}
;// ./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
})
});
}
;// ./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);
;// ./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,
role: "content"
},
textAlign: {
type: "string"
}
},
supports: {
anchor: true,
background: {
backgroundImage: true,
backgroundSize: true,
__experimentalDefaultControls: {
backgroundImage: true
}
},
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
dimensions: {
minHeight: true,
__experimentalDefaultControls: {
minHeight: false
}
},
typography: {
fontSize: true,
__experimentalFontFamily: true,
lineHeight: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalLetterSpacing: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalWritingMode: 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
});
;// ./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);
;// ./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);
});
}
;// ./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",
role: "content"
},
controls: {
type: "boolean",
source: "attribute",
selector: "video",
attribute: "controls",
"default": true
},
id: {
type: "number",
role: "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"
},
blob: {
type: "string",
role: "local"
},
src: {
type: "string",
source: "attribute",
selector: "video",
attribute: "src",
role: "content"
},
playsInline: {
type: "boolean",
source: "attribute",
selector: "video",
attribute: "playsinline"
},
tracks: {
role: "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);
;// ./node_modules/@wordpress/block-library/build-module/video/poster-image.js
/**
* WordPress dependencies
*/
function PosterImage({
poster,
setAttributes,
instanceId
}) {
const posterImageButton = (0,external_wp_element_namespaceObject.useRef)();
const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image'];
const videoPosterDescription = `video-block__poster-image-description-${instanceId}`;
function onSelectPoster(image) {
setAttributes({
poster: image.url
});
}
function onRemovePoster() {
setAttributes({
poster: undefined
});
// Move focus back to the Media Upload button.
posterImageButton.current.focus();
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Poster image'),
isShownByDefault: true,
hasValue: () => !!poster,
onDeselect: () => {
setAttributes({
poster: ''
});
},
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
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, {
__next40pxDefaultSize: true,
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, {
__next40pxDefaultSize: true,
onClick: onRemovePoster,
variant: "tertiary",
children: (0,external_wp_i18n_namespaceObject.__)('Remove')
})]
})
})
});
}
/* harmony default export */ const poster_image = (PosterImage);
;// ./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,
// Set muted when autoplay changes
...(attribute === 'autoplay' && {
muted: 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.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
isShownByDefault: true,
hasValue: () => !!autoplay,
onDeselect: () => {
setAttributes({
autoplay: false,
muted: false
});
},
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.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
isShownByDefault: true,
hasValue: () => !!loop,
onDeselect: () => {
setAttributes({
loop: false
});
},
children: /*#__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.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Muted'),
isShownByDefault: true,
hasValue: () => !!muted,
onDeselect: () => {
setAttributes({
muted: false
});
},
children: /*#__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,
disabled: autoplay,
help: autoplay ? (0,external_wp_i18n_namespaceObject.__)('Muted because of Autoplay.') : null
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'),
isShownByDefault: true,
hasValue: () => !controls,
onDeselect: () => {
setAttributes({
controls: true
});
},
children: /*#__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.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Play inline'),
isShownByDefault: true,
hasValue: () => !!playsInline,
onDeselect: () => {
setAttributes({
playsInline: false
});
},
children: /*#__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.__experimentalToolsPanelItem, {
label: (0,external_wp_i18n_namespaceObject.__)('Preload'),
isShownByDefault: true,
hasValue: () => preload !== 'metadata',
onDeselect: () => {
setAttributes({
preload: 'metadata'
});
},
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__next40pxDefaultSize: true,
__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);
;// ./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
}) {
const 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.jsx)("span", {
children: track.label
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
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._x)('Edit %s', 'text tracks'), 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.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, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
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, {
__next40pxDefaultSize: true,
__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, {
__next40pxDefaultSize: true,
__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, {
__next40pxDefaultSize: true,
isDestructive: true,
variant: "link",
onClick: onRemove,
children: (0,external_wp_i18n_namespaceObject.__)('Remove track')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
variant: "primary",
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.__)('Apply')
})]
})]
})]
});
}
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);
const dropdownPopoverRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
dropdownPopoverRef.current?.focus();
}, [trackBeingEdited]);
if (!mediaUpload) {
return null;
}
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
contentClassName: "block-library-video-tracks-editor",
focusOnMount: true,
popoverProps: {
ref: dropdownPopoverRef
},
renderToggle: ({
isOpen,
onToggle
}) => {
const handleOnToggle = () => {
if (!isOpen) {
// When the Popover opens make sure the initial view is
// always the track list rather than the edit track UI.
setTrackBeingEdited(null);
}
onToggle();
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
"aria-expanded": isOpen,
"aria-haspopup": "true",
onClick: handleOnToggle,
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.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [tracks.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "block-library-video-tracks-editor__tracks-informative-message",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
className: "block-library-video-tracks-editor__tracks-informative-message-title",
children: (0,external_wp_i18n_namespaceObject.__)('Text tracks')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "block-library-video-tracks-editor__tracks-informative-message-description",
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.')
})]
}), /*#__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._x)('Upload', 'verb')
});
}
})
})]
})]
})]
});
}
});
}
;// ./node_modules/@wordpress/block-library/build-module/video/edit.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const video_edit_ALLOWED_MEDIA_TYPES = ['video'];
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 {
id,
controls,
poster,
src,
tracks
} = attributes;
const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
useUploadMediaFromBlobURL({
url: temporaryURL,
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,
blob: undefined
});
setTemporaryURL();
return;
}
if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
setTemporaryURL(media.url);
return;
}
// Sets the block's attribute and updates the edit component from the
// selected media.
setAttributes({
blob: undefined,
src: media.url,
id: media.id,
poster: media.image?.src !== media.icon ? media.image?.src : undefined,
caption: media.caption
});
setTemporaryURL();
}
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({
blob: undefined,
src: newSrc,
id: undefined,
poster: undefined
});
setTemporaryURL();
}
}
const {
createErrorNotice
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
function onUploadError(message) {
createErrorNotice(message, {
type: 'snackbar'
});
}
// Much of this description is duplicated from MediaPlaceholder.
const placeholder = content => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
className: "block-editor-media-placeholder",
withIllustration: !isSingleSelected,
icon: library_video,
label: (0,external_wp_i18n_namespaceObject.__)('Video'),
instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop a video, upload, or choose from your library.'),
children: content
});
};
const classes = dist_clsx(className, {
'is-transient': !!temporaryURL
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes
});
if (!src && !temporaryURL) {
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: placeholder
})
});
}
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,
onReset: () => onSelectVideo(undefined)
})
})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
label: (0,external_wp_i18n_namespaceObject.__)('Settings'),
resetAll: () => {
setAttributes({
autoplay: false,
controls: true,
loop: false,
muted: false,
playsInline: false,
preload: 'metadata',
poster: ''
});
},
dropdownMenuProps: dropdownMenuProps,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_common_settings, {
setAttributes: setAttributes,
attributes: attributes
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(poster_image, {
poster: poster,
setAttributes: setAttributes,
instanceId: instanceId
})]
})
}), /*#__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 || temporaryURL,
ref: videoPlayer,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tracks, {
tracks: tracks
})
})
}), !!temporaryURL && /*#__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);
;// ./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
})]
});
}
;// ./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', {
blob: (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
};
if ((0,external_wp_blob_namespaceObject.isBlobURL)(attributes.src)) {
attributes.blob = attributes.src;
delete attributes.src;
}
return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', attributes);
}
}]
};
/* harmony default export */ const video_transforms = (video_transforms_transforms);
;// ./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",
role: "content"
},
controls: {
type: "boolean",
source: "attribute",
selector: "video",
attribute: "controls",
"default": true
},
id: {
type: "number",
role: "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"
},
blob: {
type: "string",
role: "local"
},
src: {
type: "string",
source: "attribute",
selector: "video",
attribute: "src",
role: "content"
},
playsInline: {
type: "boolean",
source: "attribute",
selector: "video",
attribute: "playsinline"
},
tracks: {
role: "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
});
;// ./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))
});
}
;// ./node_modules/@wordpress/block-library/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
});
;// ./node_modules/@wordpress/block-library/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);
}
;// ./node_modules/@wordpress/block-library/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)));
;// ./node_modules/@wordpress/block-library/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);
;// ./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: `
* `
}, 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
});
}
};
;// ./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
};
const footnotes_init = () => {
(0,external_wp_richText_namespaceObject.registerFormatType)(formatName, format);
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);
;// external ["wp","keyboardShortcuts"]
const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
;// ./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}`
}
});
});
}, [registerShortcut]);
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-heading-to-paragraph', event => handleTransformHeadingAndParagraph(event, 0));
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-1', event => handleTransformHeadingAndParagraph(event, 1));
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-2', event => handleTransformHeadingAndParagraph(event, 2));
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-3', event => handleTransformHeadingAndParagraph(event, 3));
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-4', event => handleTransformHeadingAndParagraph(event, 4));
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-5', event => handleTransformHeadingAndParagraph(event, 5));
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/transform-paragraph-to-heading-6', event => handleTransformHeadingAndParagraph(event, 6));
return null;
}
/* harmony default export */ const block_keyboard_shortcuts = (BlockKeyboardShortcuts);
;// ./node_modules/@wordpress/block-library/build-module/private-apis.js
/**
* Internal dependencies
*/
/**
* @private
*/
const privateApis = {};
lock(privateApis, {
BlockKeyboardShortcuts: block_keyboard_shortcuts
});
;// ./node_modules/@wordpress/block-library/build-module/index.js
/* wp:polyfill */
/**
* 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, query_total_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__;
/******/ })()
;