@wordpress/block-editor 15.17.0 → 15.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/components/autocomplete/index.cjs.map +3 -3
- package/build/components/background-image-control/index.cjs +2 -1
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-allowed-blocks/modal.cjs.map +2 -2
- package/build/components/block-bindings/attribute-control.cjs.map +3 -3
- package/build/components/block-card/index.cjs +2 -2
- package/build/components/block-card/index.cjs.map +3 -3
- package/build/components/block-mover/button.cjs +9 -3
- package/build/components/block-mover/button.cjs.map +2 -2
- package/build/components/block-pattern-setup/index.cjs +3 -2
- package/build/components/block-pattern-setup/index.cjs.map +2 -2
- package/build/components/block-patterns-list/index.cjs +2 -1
- package/build/components/block-patterns-list/index.cjs.map +2 -2
- package/build/components/block-patterns-paging/index.cjs.map +3 -3
- package/build/components/block-settings-menu/block-settings-dropdown.cjs +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +3 -3
- package/build/components/block-settings-menu/index.cjs +2 -2
- package/build/components/block-settings-menu/index.cjs.map +3 -3
- package/build/components/block-styles/menu-items.cjs.map +3 -3
- package/build/components/block-switcher/index.cjs.map +3 -3
- package/build/components/block-switcher/pattern-transformations-menu.cjs +2 -1
- package/build/components/block-switcher/pattern-transformations-menu.cjs.map +2 -2
- package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +3 -3
- package/build/components/block-variation-transforms/index.cjs +2 -1
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +4 -4
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +3 -3
- package/build/components/collab/{block-comment-icon-slot.cjs → note-icon-slot.cjs} +8 -8
- package/build/components/collab/note-icon-slot.cjs.map +7 -0
- package/build/components/collab/{block-comment-icon-toolbar-slot.cjs → note-icon-toolbar-slot.cjs} +9 -9
- package/build/components/collab/note-icon-toolbar-slot.cjs.map +7 -0
- package/build/components/date-format-picker/index.cjs +2 -1
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/global-styles/color-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +87 -62
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/filters-panel.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +9 -7
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/grid/grid-item-movers.cjs +2 -1
- package/build/components/grid/grid-item-movers.cjs.map +2 -2
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.cjs.map +2 -2
- package/build/components/inserter/menu.cjs +2 -1
- package/build/components/inserter/menu.cjs.map +2 -2
- package/build/components/inserter/search-results.cjs +3 -3
- package/build/components/inserter/search-results.cjs.map +2 -2
- package/build/components/inspector-popover-header/index.cjs.map +3 -3
- package/build/components/link-control/link-preview.cjs +2 -2
- package/build/components/link-control/link-preview.cjs.map +2 -2
- package/build/components/link-control/settings.cjs +2 -1
- package/build/components/link-control/settings.cjs.map +2 -2
- package/build/components/link-picker/link-picker.cjs +3 -2
- package/build/components/link-picker/link-picker.cjs.map +2 -2
- package/build/components/link-picker/link-preview.cjs +2 -2
- package/build/components/link-picker/link-preview.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +2 -2
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/index.cjs +2 -1
- package/build/components/list-view/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +80 -7
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/responsive-block-control/label.cjs +9 -2
- package/build/components/responsive-block-control/label.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/paste-handler.cjs +12 -5
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
- package/build/components/url-popover/image-url-input-ui.cjs +1 -1
- package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
- package/build/components/writing-flow/use-arrow-nav.cjs +1 -1
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/hooks/block-bindings.cjs.map +3 -3
- package/build/hooks/block-fields/link/index.cjs +1 -1
- package/build/hooks/block-fields/link/index.cjs.map +1 -1
- package/build/hooks/custom-css.cjs +21 -0
- package/build/hooks/custom-css.cjs.map +3 -3
- package/build/hooks/dimensions.cjs +5 -1
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +1 -1
- package/build/hooks/grid-visualizer.cjs.map +1 -1
- package/build/hooks/layout-child.cjs +1 -1
- package/build/hooks/layout-child.cjs.map +1 -1
- package/build/hooks/utils.cjs +4 -0
- package/build/hooks/utils.cjs.map +2 -2
- package/build/layouts/flex.cjs +5 -8
- package/build/layouts/flex.cjs.map +3 -3
- package/build/layouts/grid.cjs +5 -5
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +5 -4
- package/build/private-apis.cjs.map +3 -3
- package/build/store/private-keys.cjs +3 -0
- package/build/store/private-keys.cjs.map +2 -2
- package/build/utils/dom.cjs +3 -1
- package/build/utils/dom.cjs.map +2 -2
- package/build-module/components/autocomplete/index.mjs +2 -2
- package/build-module/components/autocomplete/index.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +2 -2
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-allowed-blocks/modal.mjs +2 -2
- package/build-module/components/block-allowed-blocks/modal.mjs.map +2 -2
- package/build-module/components/block-bindings/attribute-control.mjs +3 -3
- package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
- package/build-module/components/block-card/index.mjs +4 -4
- package/build-module/components/block-card/index.mjs.map +2 -2
- package/build-module/components/block-mover/button.mjs +11 -5
- package/build-module/components/block-mover/button.mjs.map +2 -2
- package/build-module/components/block-pattern-setup/index.mjs +2 -1
- package/build-module/components/block-pattern-setup/index.mjs.map +2 -2
- package/build-module/components/block-patterns-list/index.mjs +1 -1
- package/build-module/components/block-patterns-list/index.mjs.map +2 -2
- package/build-module/components/block-patterns-paging/index.mjs +3 -3
- package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
- package/build-module/components/block-settings-menu/index.mjs +2 -2
- package/build-module/components/block-settings-menu/index.mjs.map +2 -2
- package/build-module/components/block-styles/menu-items.mjs +2 -2
- package/build-module/components/block-styles/menu-items.mjs.map +2 -2
- package/build-module/components/block-switcher/index.mjs +2 -2
- package/build-module/components/block-switcher/index.mjs.map +2 -2
- package/build-module/components/block-switcher/pattern-transformations-menu.mjs +2 -7
- package/build-module/components/block-switcher/pattern-transformations-menu.mjs.map +2 -2
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs +2 -2
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +2 -2
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +6 -6
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
- package/build-module/components/collab/note-icon-slot.mjs +8 -0
- package/build-module/components/collab/note-icon-slot.mjs.map +7 -0
- package/build-module/components/collab/note-icon-toolbar-slot.mjs +10 -0
- package/build-module/components/collab/note-icon-toolbar-slot.mjs.map +7 -0
- package/build-module/components/date-format-picker/index.mjs +2 -2
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/global-styles/color-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +87 -62
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +9 -7
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/grid/grid-item-movers.mjs +2 -5
- package/build-module/components/grid/grid-item-movers.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs +3 -3
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs.map +1 -1
- package/build-module/components/inserter/menu.mjs +3 -2
- package/build-module/components/inserter/menu.mjs.map +2 -2
- package/build-module/components/inserter/search-results.mjs +1 -1
- package/build-module/components/inserter/search-results.mjs.map +1 -1
- package/build-module/components/inspector-popover-header/index.mjs +2 -2
- package/build-module/components/inspector-popover-header/index.mjs.map +2 -2
- package/build-module/components/link-control/link-preview.mjs +2 -2
- package/build-module/components/link-control/link-preview.mjs.map +2 -2
- package/build-module/components/link-control/settings.mjs +3 -2
- package/build-module/components/link-control/settings.mjs.map +2 -2
- package/build-module/components/link-picker/link-picker.mjs +1 -1
- package/build-module/components/link-picker/link-picker.mjs.map +2 -2
- package/build-module/components/link-picker/link-preview.mjs +2 -2
- package/build-module/components/link-picker/link-preview.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +2 -2
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/index.mjs +2 -4
- package/build-module/components/list-view/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +82 -8
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/responsive-block-control/label.mjs +9 -2
- package/build-module/components/responsive-block-control/label.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs +12 -5
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs +1 -1
- package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/hooks/block-bindings.mjs +2 -2
- package/build-module/hooks/block-bindings.mjs.map +2 -2
- package/build-module/hooks/block-fields/link/index.mjs +1 -1
- package/build-module/hooks/block-fields/link/index.mjs.map +1 -1
- package/build-module/hooks/custom-css.mjs +23 -2
- package/build-module/hooks/custom-css.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +5 -1
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +1 -1
- package/build-module/hooks/grid-visualizer.mjs.map +1 -1
- package/build-module/hooks/layout-child.mjs +1 -1
- package/build-module/hooks/layout-child.mjs.map +1 -1
- package/build-module/hooks/utils.mjs +4 -0
- package/build-module/hooks/utils.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +4 -7
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +4 -4
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/private-apis.mjs +7 -5
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +2 -0
- package/build-module/store/private-keys.mjs.map +2 -2
- package/build-module/utils/dom.mjs +2 -1
- package/build-module/utils/dom.mjs.map +2 -2
- package/build-style/content-rtl.css +1 -4
- package/build-style/content.css +1 -4
- package/build-style/style-rtl.css +12 -12
- package/build-style/style.css +12 -12
- package/build-types/utils/dom.d.ts +7 -0
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +39 -38
- package/src/components/autocomplete/index.js +4 -2
- package/src/components/background-image-control/index.js +2 -2
- package/src/components/background-image-control/style.scss +1 -1
- package/src/components/block-allowed-blocks/modal.js +3 -3
- package/src/components/block-bindings/attribute-control.js +4 -4
- package/src/components/block-card/index.js +5 -5
- package/src/components/block-list/content.scss +0 -4
- package/src/components/block-mover/button.js +17 -7
- package/src/components/block-pattern-setup/index.js +2 -1
- package/src/components/block-pattern-setup/style.scss +2 -2
- package/src/components/block-patterns-list/index.js +1 -1
- package/src/components/block-patterns-list/style.scss +1 -1
- package/src/components/block-patterns-paging/index.js +5 -6
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-styles/menu-items.js +3 -3
- package/src/components/block-switcher/index.js +3 -3
- package/src/components/block-switcher/pattern-transformations-menu.js +2 -7
- package/src/components/block-switcher/style.scss +2 -2
- package/src/components/block-toolbar/pattern-overrides-dropdown.js +2 -2
- package/src/components/block-variation-transforms/index.js +2 -2
- package/src/components/block-visibility/viewport-visibility-info.js +7 -7
- package/src/components/collab/note-icon-slot.js +8 -0
- package/src/components/collab/note-icon-toolbar-slot.js +10 -0
- package/src/components/date-format-picker/index.js +4 -2
- package/src/components/global-styles/color-panel.js +0 -2
- package/src/components/global-styles/dimensions-panel.js +100 -73
- package/src/components/global-styles/filters-panel.js +0 -2
- package/src/components/global-styles/hooks.js +9 -7
- package/src/components/global-styles/style.scss +1 -1
- package/src/components/grid/grid-item-movers.js +2 -5
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -5
- package/src/components/inserter/menu.js +3 -2
- package/src/components/inserter/search-results.js +1 -1
- package/src/components/inserter/style.scss +2 -2
- package/src/components/inserter-list-item/style.scss +1 -1
- package/src/components/inspector-popover-header/index.js +2 -2
- package/src/components/link-control/link-preview.js +3 -3
- package/src/components/link-control/settings.js +3 -2
- package/src/components/link-picker/link-picker.js +1 -1
- package/src/components/link-picker/link-preview.js +3 -3
- package/src/components/list-view/block-select-button.js +3 -3
- package/src/components/list-view/index.js +2 -4
- package/src/components/list-view/style.scss +1 -1
- package/src/components/media-placeholder/content.scss +1 -1
- package/src/components/provider/index.js +149 -8
- package/src/components/responsive-block-control/label.js +5 -2
- package/src/components/rich-text/event-listeners/paste-handler.js +18 -4
- package/src/components/url-input/style.scss +1 -1
- package/src/components/url-popover/image-url-input-ui.js +1 -1
- package/src/components/writing-flow/use-arrow-nav.js +9 -2
- package/src/hooks/block-bindings.js +3 -3
- package/src/hooks/block-fields/link/index.js +1 -1
- package/src/hooks/custom-css.js +30 -9
- package/src/hooks/dimensions.js +6 -1
- package/src/hooks/grid-visualizer.js +1 -1
- package/src/hooks/layout-child.js +1 -1
- package/src/hooks/test/dimensions.js +16 -0
- package/src/hooks/test/style.js +2 -0
- package/src/hooks/utils.js +4 -0
- package/src/layouts/flex.js +7 -9
- package/src/layouts/grid.js +7 -4
- package/src/private-apis.js +6 -4
- package/src/store/private-keys.js +1 -0
- package/src/utils/dom.js +3 -3
- package/src/utils/test/dom.js +47 -4
- package/build/components/collab/block-comment-icon-slot.cjs.map +0 -7
- package/build/components/collab/block-comment-icon-toolbar-slot.cjs.map +0 -7
- package/build-module/components/collab/block-comment-icon-slot.mjs +0 -8
- package/build-module/components/collab/block-comment-icon-slot.mjs.map +0 -7
- package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs +0 -10
- package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs.map +0 -7
- package/src/components/collab/block-comment-icon-slot.js +0 -8
- package/src/components/collab/block-comment-icon-toolbar-slot.js +0 -10
|
@@ -35,7 +35,7 @@ __export(search_results_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(search_results_exports);
|
|
36
36
|
var import_element = require("@wordpress/element");
|
|
37
37
|
var import_i18n = require("@wordpress/i18n");
|
|
38
|
-
var
|
|
38
|
+
var import_ui = require("@wordpress/ui");
|
|
39
39
|
var import_compose = require("@wordpress/compose");
|
|
40
40
|
var import_a11y = require("@wordpress/a11y");
|
|
41
41
|
var import_data = require("@wordpress/data");
|
|
@@ -168,7 +168,7 @@ function InserterSearchResults({
|
|
|
168
168
|
const blocksUI = !!filteredBlockTypes.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
169
169
|
import_panel.default,
|
|
170
170
|
{
|
|
171
|
-
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
171
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, { children: (0, import_i18n.__)("Blocks") }),
|
|
172
172
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
173
|
import_block_types_list.default,
|
|
174
174
|
{
|
|
@@ -184,7 +184,7 @@ function InserterSearchResults({
|
|
|
184
184
|
const patternsUI = !!filteredBlockPatterns.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
185
185
|
import_panel.default,
|
|
186
186
|
{
|
|
187
|
-
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
187
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, { children: (0, import_i18n.__)("Block patterns") }),
|
|
188
188
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-editor-inserter__quick-inserter-patterns", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
189
189
|
import_block_patterns_list.default,
|
|
190
190
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/inserter/search-results.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { VisuallyHidden } from '@wordpress/
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAmC;AACnC,kBAAgC;AAChC,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport { useDebounce, useAsyncList } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport BlockPatternsList from '../block-patterns-list';\nimport __unstableInserterMenuExtension from '../inserter-menu-extension';\nimport InserterPanel from './panel';\nimport InserterNoResults from './no-results';\nimport useInsertionPoint from './hooks/use-insertion-point';\nimport usePatternsState from './hooks/use-patterns-state';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport { searchBlockItems, searchItems } from './search-items';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\nimport { orderInserterBlockItems } from '../../utils/order-inserter-block-items';\nimport { store as blockEditorStore } from '../../store';\n\nconst INITIAL_INSERTER_RESULTS = 9;\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation and rerendering the component.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nfunction InserterSearchResults( {\n\tfilterValue,\n\tonSelect,\n\tonHover,\n\tonHoverPattern,\n\trootClientId,\n\tclientId,\n\tisAppender,\n\t__experimentalInsertionIndex,\n\tmaxBlockPatterns,\n\tmaxBlockTypes,\n\tshowBlockDirectory = false,\n\tisDraggable = true,\n\tshouldFocusBlock = true,\n\tprioritizePatterns,\n\tselectBlockOnInsert,\n\tisQuick,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\tconst { prioritizedBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst blockListSettings =\n\t\t\t\tselect( blockEditorStore ).getBlockListSettings( rootClientId );\n\n\t\t\treturn {\n\t\t\t\tprioritizedBlocks:\n\t\t\t\t\tblockListSettings?.prioritizedInserterBlocks || EMPTY_ARRAY,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\tconst [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {\n\t\tonSelect,\n\t\trootClientId,\n\t\tclientId,\n\t\tisAppender,\n\t\tinsertionIndex: __experimentalInsertionIndex,\n\t\tshouldFocusBlock,\n\t\tselectBlockOnInsert,\n\t} );\n\tconst [\n\t\tblockTypes,\n\t\tblockTypeCategories,\n\t\tblockTypeCollections,\n\t\tonSelectBlockType,\n\t] = useBlockTypesState( destinationRootClientId, onInsertBlocks, isQuick );\n\tconst [ patterns, , onClickPattern ] = usePatternsState(\n\t\tonInsertBlocks,\n\t\tdestinationRootClientId,\n\t\tundefined,\n\t\tisQuick\n\t);\n\n\tconst filteredBlockPatterns = useMemo( () => {\n\t\tif ( maxBlockPatterns === 0 ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst results = searchItems( patterns, filterValue );\n\t\treturn maxBlockPatterns !== undefined\n\t\t\t? results.slice( 0, maxBlockPatterns )\n\t\t\t: results;\n\t}, [ filterValue, patterns, maxBlockPatterns ] );\n\n\tlet maxBlockTypesToShow = maxBlockTypes;\n\tif ( prioritizePatterns && filteredBlockPatterns.length > 2 ) {\n\t\tmaxBlockTypesToShow = 0;\n\t}\n\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( maxBlockTypesToShow === 0 ) {\n\t\t\treturn [];\n\t\t}\n\t\tconst nonPatternBlockTypes = blockTypes.filter(\n\t\t\t( blockType ) => blockType.name !== 'core/block'\n\t\t);\n\t\tlet orderedItems = orderBy( nonPatternBlockTypes, 'frecency', 'desc' );\n\n\t\tif ( ! filterValue && prioritizedBlocks.length ) {\n\t\t\torderedItems = orderInserterBlockItems(\n\t\t\t\torderedItems,\n\t\t\t\tprioritizedBlocks\n\t\t\t);\n\t\t}\n\n\t\tconst results = searchBlockItems(\n\t\t\torderedItems,\n\t\t\tblockTypeCategories,\n\t\t\tblockTypeCollections,\n\t\t\tfilterValue\n\t\t);\n\n\t\treturn maxBlockTypesToShow !== undefined\n\t\t\t? results.slice( 0, maxBlockTypesToShow )\n\t\t\t: results;\n\t}, [\n\t\tfilterValue,\n\t\tblockTypes,\n\t\tblockTypeCategories,\n\t\tblockTypeCollections,\n\t\tmaxBlockTypesToShow,\n\t\tprioritizedBlocks,\n\t] );\n\n\t// Announce search results on change.\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = filteredBlockTypes.length + filteredBlockPatterns.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [\n\t\tfilterValue,\n\t\tdebouncedSpeak,\n\t\tfilteredBlockTypes,\n\t\tfilteredBlockPatterns,\n\t] );\n\n\tconst currentShownBlockTypes = useAsyncList( filteredBlockTypes, {\n\t\tstep: INITIAL_INSERTER_RESULTS,\n\t} );\n\n\tconst hasItems =\n\t\tfilteredBlockTypes.length > 0 || filteredBlockPatterns.length > 0;\n\n\tconst blocksUI = !! filteredBlockTypes.length && (\n\t\t<InserterPanel\n\t\t\ttitle={ <VisuallyHidden>{ __( 'Blocks' ) }</VisuallyHidden> }\n\t\t>\n\t\t\t<BlockTypesList\n\t\t\t\titems={ currentShownBlockTypes }\n\t\t\t\tonSelect={ onSelectBlockType }\n\t\t\t\tonHover={ onHover }\n\t\t\t\tlabel={ __( 'Blocks' ) }\n\t\t\t\tisDraggable={ isDraggable }\n\t\t\t/>\n\t\t</InserterPanel>\n\t);\n\n\tconst patternsUI = !! filteredBlockPatterns.length && (\n\t\t<InserterPanel\n\t\t\ttitle={\n\t\t\t\t<VisuallyHidden>{ __( 'Block patterns' ) }</VisuallyHidden>\n\t\t\t}\n\t\t>\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-patterns\">\n\t\t\t\t<BlockPatternsList\n\t\t\t\t\tblockPatterns={ filteredBlockPatterns }\n\t\t\t\t\tonClickPattern={ onClickPattern }\n\t\t\t\t\tonHover={ onHoverPattern }\n\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</InserterPanel>\n\t);\n\n\treturn (\n\t\t<InserterListbox>\n\t\t\t{ ! showBlockDirectory && ! hasItems && <InserterNoResults /> }\n\n\t\t\t{ prioritizePatterns ? patternsUI : blocksUI }\n\n\t\t\t{ !! filteredBlockTypes.length &&\n\t\t\t\t!! filteredBlockPatterns.length && (\n\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t) }\n\n\t\t\t{ prioritizePatterns ? blocksUI : patternsUI }\n\n\t\t\t{ showBlockDirectory && (\n\t\t\t\t<__unstableInserterMenuExtension.Slot\n\t\t\t\t\tfillProps={ {\n\t\t\t\t\t\tonSelect: onSelectBlockType,\n\t\t\t\t\t\tonHover,\n\t\t\t\t\t\tfilterValue,\n\t\t\t\t\t\thasItems,\n\t\t\t\t\t\trootClientId: destinationRootClientId,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ ( fills ) => {\n\t\t\t\t\t\tif ( fills.length ) {\n\t\t\t\t\t\t\treturn fills;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! hasItems ) {\n\t\t\t\t\t\t\treturn <InserterNoResults />;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} }\n\t\t\t\t</__unstableInserterMenuExtension.Slot>\n\t\t\t) }\n\t\t</InserterListbox>\n\t);\n}\n\nexport default InserterSearchResults;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAmC;AACnC,kBAAgC;AAChC,gBAA+B;AAC/B,qBAA0C;AAC1C,kBAAsB;AACtB,kBAA0B;AAK1B,8BAA2B;AAC3B,iCAA8B;AAC9B,qCAA4C;AAC5C,mBAA0B;AAC1B,wBAA8B;AAC9B,iCAA8B;AAC9B,gCAA6B;AAC7B,mCAA+B;AAC/B,0BAA8C;AAC9C,8BAA4B;AAC5B,qBAAwB;AACxB,wCAAwC;AACxC,mBAA0C;AAgJ/B;AA9IX,IAAM,2BAA2B;AAOjC,IAAM,cAAc,CAAC;AAErB,SAAS,sBAAuB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,qBAAiB,4BAAa,mBAAO,GAAI;AAE/C,QAA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AAGD,SACC,6CAAC,wBAAAC,SAAA,EACE;AAAA,KAAE,sBAAsB,CAAE,YAAY,4CAAC,kBAAAC,SAAA,EAAkB;AAAA,IAEzD,qBAAqB,aAAa;AAAA,IAElC,CAAC,CAAE,mBAAmB,UACvB,CAAC,CAAE,sBAAsB,UACxB,4CAAC,SAAI,WAAU,mDAAkD;AAAA,IAGjE,qBAAqB,WAAW;AAAA,IAEhC,sBACD;AAAA,MAAC,+BAAAC,QAAgC;AAAA,MAAhC;AAAA,QACA,WAAY;AAAA,UACX,UAAU;AAAA,UACV;AAAA,UACA;AAAA,UACA;AAAA,UACA,cAAc;AAAA,QACf;AAAA,QAEE,WAAE,UAAW;AACd,cAAK,MAAM,QAAS;AACnB,mBAAO;AAAA,UACR;AACA,cAAK,CAAE,UAAW;AACjB,mBAAO,4CAAC,kBAAAD,SAAA,EAAkB;AAAA,UAC3B;AACA,iBAAO;AAAA,QACR;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
6
|
"names": ["blockEditorStore", "useInsertionPoint", "useBlockTypesState", "usePatternsState", "InserterPanel", "BlockTypesList", "BlockPatternsList", "InserterListbox", "InserterNoResults", "__unstableInserterMenuExtension"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/inspector-popover-header/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalSpacer as Spacer,\n\tButton,\n\t__experimentalText as
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAOO;AACP,mBAA2B;AAC3B,kBAAmB;AAUhB;AARY,SAAR,uBAAyC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AACD,GAAI;AACH,SACC,6CAAC,kBAAAA,sBAAA,EAAO,WAAU,yCAAwC,SAAU,GACnE;AAAA,iDAAC,kBAAAC,sBAAA,EAAO,WAAU,UACjB;AAAA;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA,WAAU;AAAA,UACV,OAAQ;AAAA,UACR,MAAO;AAAA,UAEL;AAAA;AAAA,MACH;AAAA,MACA,4CAAC,kBAAAC,sBAAA,EAAO;AAAA,MACN,QAAQ,IAAK,CAAE,EAAE,OAAO,MAAM,QAAQ,MACvC;AAAA,QAAC;AAAA;AAAA,UACA,MAAK;AAAA,UAEL,WAAU;AAAA,UACV;AAAA,UACA;AAAA,UACA,SAAU,CAAE,QAAQ;AAAA,UACpB;AAAA,UAEE,WAAE,QAAQ;AAAA;AAAA,QAPN;AAAA,MAQP,CACC;AAAA,MACA,WACD;AAAA,QAAC;AAAA;AAAA,UACA,MAAK;AAAA,UACL,WAAU;AAAA,UACV,WAAQ,gBAAI,OAAQ;AAAA,UACpB,MAAO;AAAA,UACP,SAAU;AAAA;AAAA,MACX;AAAA,OAEF;AAAA,IACE,QAAQ,4CAAC,kBAAAC,oBAAA,
|
|
6
|
-
"names": ["VStack", "HStack", "Heading", "Spacer", "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalSpacer as Spacer,\n\tButton,\n\t__experimentalText as WCText,\n} from '@wordpress/components';\nimport { closeSmall } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\nexport default function InspectorPopoverHeader( {\n\ttitle,\n\thelp,\n\tactions = [],\n\tonClose,\n} ) {\n\treturn (\n\t\t<VStack className=\"block-editor-inspector-popover-header\" spacing={ 4 }>\n\t\t\t<HStack alignment=\"center\">\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__heading\"\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\tsize={ 13 }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\t\t\t\t<Spacer />\n\t\t\t\t{ actions.map( ( { label, icon, onClick } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__action\"\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tvariant={ ! icon && 'tertiary' }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! icon && label }\n\t\t\t\t\t</Button>\n\t\t\t\t) ) }\n\t\t\t\t{ onClose && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__action\"\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ help && <WCText>{ help }</WCText> }\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAOO;AACP,mBAA2B;AAC3B,kBAAmB;AAUhB;AARY,SAAR,uBAAyC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AACD,GAAI;AACH,SACC,6CAAC,kBAAAA,sBAAA,EAAO,WAAU,yCAAwC,SAAU,GACnE;AAAA,iDAAC,kBAAAC,sBAAA,EAAO,WAAU,UACjB;AAAA;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA,WAAU;AAAA,UACV,OAAQ;AAAA,UACR,MAAO;AAAA,UAEL;AAAA;AAAA,MACH;AAAA,MACA,4CAAC,kBAAAC,sBAAA,EAAO;AAAA,MACN,QAAQ,IAAK,CAAE,EAAE,OAAO,MAAM,QAAQ,MACvC;AAAA,QAAC;AAAA;AAAA,UACA,MAAK;AAAA,UAEL,WAAU;AAAA,UACV;AAAA,UACA;AAAA,UACA,SAAU,CAAE,QAAQ;AAAA,UACpB;AAAA,UAEE,WAAE,QAAQ;AAAA;AAAA,QAPN;AAAA,MAQP,CACC;AAAA,MACA,WACD;AAAA,QAAC;AAAA;AAAA,UACA,MAAK;AAAA,UACL,WAAU;AAAA,UACV,WAAQ,gBAAI,OAAQ;AAAA,UACpB,MAAO;AAAA,UACP,SAAU;AAAA;AAAA,MACX;AAAA,OAEF;AAAA,IACE,QAAQ,4CAAC,kBAAAC,oBAAA,EAAS,gBAAM;AAAA,KAC3B;AAEF;",
|
|
6
|
+
"names": ["VStack", "HStack", "Heading", "Spacer", "WCText"]
|
|
7
7
|
}
|
|
@@ -47,7 +47,7 @@ var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
|
47
47
|
var import_viewer_slot = require("./viewer-slot.cjs");
|
|
48
48
|
var import_use_rich_url_data = __toESM(require("./use-rich-url-data.cjs"));
|
|
49
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
-
var { Badge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
50
|
+
var { Badge: WCBadge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
51
51
|
function LinkPreview({
|
|
52
52
|
value,
|
|
53
53
|
onEditClick,
|
|
@@ -152,7 +152,7 @@ function LinkPreview({
|
|
|
152
152
|
gap: 1,
|
|
153
153
|
children: value.badges.map(
|
|
154
154
|
(badge, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
155
|
-
|
|
155
|
+
WCBadge,
|
|
156
156
|
{
|
|
157
157
|
intent: badge.intent,
|
|
158
158
|
children: badge.label
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/link-control/link-preview.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n\t__experimentalHStack as HStack,\n\tFlex,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { filterURLForDisplay, safeDecodeURI } from '@wordpress/url';\nimport {\n\tIcon,\n\tglobe,\n\tinfo,\n\tlinkOff,\n\tpencil,\n\tcopySmall,\n} from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { ViewerSlot } from './viewer-slot';\n\nconst { Badge } = unlock( componentsPrivateApis );\n\nimport useRichUrlData from './use-rich-url-data';\n\nexport default function LinkPreview( {\n\tvalue,\n\tonEditClick,\n\thasRichPreviews = false,\n\thasUnlinkControl = false,\n\tonRemove,\n} ) {\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\t// Avoid fetching if rich previews are not desired.\n\tconst showRichPreviews = hasRichPreviews ? value?.url : null;\n\n\tconst { richData, isFetching } = useRichUrlData( showRichPreviews );\n\n\t// Rich data may be an empty object so test for that.\n\tconst hasRichData = richData && Object.keys( richData ).length;\n\n\tconst displayURL =\n\t\t( value && filterURLForDisplay( safeDecodeURI( value.url ), 24 ) ) ||\n\t\t'';\n\n\t// url can be undefined if the href attribute is unset\n\tconst isEmptyURL = ! value?.url?.length;\n\n\tconst displayTitle =\n\t\t! isEmptyURL &&\n\t\tstripHTML(\n\t\t\tvalue?.entityTitle || richData?.title || value?.title || displayURL\n\t\t);\n\n\tlet icon;\n\n\tif ( richData?.icon ) {\n\t\ticon = <img src={ richData?.icon } alt=\"\" />;\n\t} else if ( isEmptyURL ) {\n\t\ticon = <Icon icon={ info } size={ 32 } />;\n\t} else {\n\t\ticon = <Icon icon={ globe } />;\n\t}\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( value.url, () => {\n\t\tcreateNotice( 'info', __( 'Link copied to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<Flex\n\t\t\trole=\"group\"\n\t\t\taria-label={ __( 'Manage link' ) }\n\t\t\tclassName={ clsx( 'block-editor-link-control__preview', {\n\t\t\t\t'is-current': true,\n\t\t\t\t'is-rich': hasRichData,\n\t\t\t\t'is-fetching': !! isFetching,\n\t\t\t\t'is-preview': true,\n\t\t\t\t'is-error': isEmptyURL,\n\t\t\t\t'is-url-title': displayTitle === displayURL,\n\t\t\t} ) }\n\t\t>\n\t\t\t<Flex gap={ 0 } align=\"flex-start\">\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"block-editor-link-control__link-information\"\n\t\t\t\t\trole=\"figure\"\n\t\t\t\t\taria-label={\n\t\t\t\t\t\t/* translators: Accessibility text for the link preview when editing a link. */\n\t\t\t\t\t\t__( 'Link information' )\n\t\t\t\t\t}\n\t\t\t\t\tjustify=\"start\"\n\t\t\t\t\talign=\"flex-start\"\n\t\t\t\t>\n\t\t\t\t\t{ value?.image ? (\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__preview-image\"\n\t\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<img src={ value?.image } alt=\"\" />\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-link-control__preview-icon',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-image': richData?.icon,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ icon }\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t) }\n\t\t\t\t\t<Flex\n\t\t\t\t\t\tclassName=\"block-editor-link-control__preview-details\"\n\t\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\t\tgap={ 2 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isEmptyURL ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__preview-title\"\n\t\t\t\t\t\t\t\t\thref={ value.url }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t{ displayTitle }\n\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t<span className=\"block-editor-link-control__preview-info\">\n\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t{ displayURL }\n\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t{ value?.badges?.length > 0 && (\n\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__preview-badges\"\n\t\t\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t\t\t\tgap={ 1 }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ value.badges.map(\n\t\t\t\t\t\t\t\t\t\t\t( badge, index ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAmB;AACnB,wBAOO;AACP,qBAAmC;AACnC,iBAAmD;AACnD,mBAOO;AACP,iBAAiD;AACjD,kBAAuC;AACvC,qBAAsC;AACtC,yBAA0C;AAK1C,yBAAuB;AACvB,yBAA2B;AAI3B,+BAA2B;AAuClB;AAzCT,IAAM,EAAE,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n\t__experimentalHStack as HStack,\n\tFlex,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { filterURLForDisplay, safeDecodeURI } from '@wordpress/url';\nimport {\n\tIcon,\n\tglobe,\n\tinfo,\n\tlinkOff,\n\tpencil,\n\tcopySmall,\n} from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { ViewerSlot } from './viewer-slot';\n\nconst { Badge: WCBadge } = unlock( componentsPrivateApis );\n\nimport useRichUrlData from './use-rich-url-data';\n\nexport default function LinkPreview( {\n\tvalue,\n\tonEditClick,\n\thasRichPreviews = false,\n\thasUnlinkControl = false,\n\tonRemove,\n} ) {\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\t// Avoid fetching if rich previews are not desired.\n\tconst showRichPreviews = hasRichPreviews ? value?.url : null;\n\n\tconst { richData, isFetching } = useRichUrlData( showRichPreviews );\n\n\t// Rich data may be an empty object so test for that.\n\tconst hasRichData = richData && Object.keys( richData ).length;\n\n\tconst displayURL =\n\t\t( value && filterURLForDisplay( safeDecodeURI( value.url ), 24 ) ) ||\n\t\t'';\n\n\t// url can be undefined if the href attribute is unset\n\tconst isEmptyURL = ! value?.url?.length;\n\n\tconst displayTitle =\n\t\t! isEmptyURL &&\n\t\tstripHTML(\n\t\t\tvalue?.entityTitle || richData?.title || value?.title || displayURL\n\t\t);\n\n\tlet icon;\n\n\tif ( richData?.icon ) {\n\t\ticon = <img src={ richData?.icon } alt=\"\" />;\n\t} else if ( isEmptyURL ) {\n\t\ticon = <Icon icon={ info } size={ 32 } />;\n\t} else {\n\t\ticon = <Icon icon={ globe } />;\n\t}\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( value.url, () => {\n\t\tcreateNotice( 'info', __( 'Link copied to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<Flex\n\t\t\trole=\"group\"\n\t\t\taria-label={ __( 'Manage link' ) }\n\t\t\tclassName={ clsx( 'block-editor-link-control__preview', {\n\t\t\t\t'is-current': true,\n\t\t\t\t'is-rich': hasRichData,\n\t\t\t\t'is-fetching': !! isFetching,\n\t\t\t\t'is-preview': true,\n\t\t\t\t'is-error': isEmptyURL,\n\t\t\t\t'is-url-title': displayTitle === displayURL,\n\t\t\t} ) }\n\t\t>\n\t\t\t<Flex gap={ 0 } align=\"flex-start\">\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"block-editor-link-control__link-information\"\n\t\t\t\t\trole=\"figure\"\n\t\t\t\t\taria-label={\n\t\t\t\t\t\t/* translators: Accessibility text for the link preview when editing a link. */\n\t\t\t\t\t\t__( 'Link information' )\n\t\t\t\t\t}\n\t\t\t\t\tjustify=\"start\"\n\t\t\t\t\talign=\"flex-start\"\n\t\t\t\t>\n\t\t\t\t\t{ value?.image ? (\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__preview-image\"\n\t\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<img src={ value?.image } alt=\"\" />\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-link-control__preview-icon',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-image': richData?.icon,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ icon }\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t) }\n\t\t\t\t\t<Flex\n\t\t\t\t\t\tclassName=\"block-editor-link-control__preview-details\"\n\t\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\t\tgap={ 2 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isEmptyURL ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__preview-title\"\n\t\t\t\t\t\t\t\t\thref={ value.url }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t{ displayTitle }\n\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t<span className=\"block-editor-link-control__preview-info\">\n\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t{ displayURL }\n\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t{ value?.badges?.length > 0 && (\n\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__preview-badges\"\n\t\t\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t\t\t\tgap={ 1 }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ value.badges.map(\n\t\t\t\t\t\t\t\t\t\t\t( badge, index ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<WCBadge\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ `${ badge.label }|${ badge.intent }|${ index }` }\n\t\t\t\t\t\t\t\t\t\t\t\t\tintent={ badge.intent }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ badge.label }\n\t\t\t\t\t\t\t\t\t\t\t\t</WCBadge>\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className=\"block-editor-link-control__preview-error-notice\">\n\t\t\t\t\t\t\t\t{ __( 'Link is empty' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t</Flex>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t\tlabel={ __( 'Edit link' ) }\n\t\t\t\t\tonClick={ onEditClick }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t/>\n\t\t\t\t{ hasUnlinkControl && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<Button\n\t\t\t\t\ticon={ copySmall }\n\t\t\t\t\tlabel={ __( 'Copy link' ) }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ isEmptyURL }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t/>\n\t\t\t\t<ViewerSlot fillProps={ value } />\n\t\t\t</Flex>\n\t\t</Flex>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAmB;AACnB,wBAOO;AACP,qBAAmC;AACnC,iBAAmD;AACnD,mBAOO;AACP,iBAAiD;AACjD,kBAAuC;AACvC,qBAAsC;AACtC,yBAA0C;AAK1C,yBAAuB;AACvB,yBAA2B;AAI3B,+BAA2B;AAuClB;AAzCT,IAAM,EAAE,OAAO,QAAQ,QAAI,2BAAQ,kBAAAA,WAAsB;AAI1C,SAAR,YAA8B;AAAA,EACpC;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB;AACD,GAAI;AACH,QAAM,qBAAiB;AAAA,IACtB,CAAE,WACD,OAAQ,mBAAAC,KAAiB,EAAE,IAAK,QAAQ,gBAAiB;AAAA,IAC1D,CAAC;AAAA,EACF;AAGA,QAAM,mBAAmB,kBAAkB,OAAO,MAAM;AAExD,QAAM,EAAE,UAAU,WAAW,QAAI,yBAAAC,SAAgB,gBAAiB;AAGlE,QAAM,cAAc,YAAY,OAAO,KAAM,QAAS,EAAE;AAExD,QAAM,aACH,aAAS,oCAAqB,0BAAe,MAAM,GAAI,GAAG,EAAG,KAC/D;AAGD,QAAM,aAAa,CAAE,OAAO,KAAK;AAEjC,QAAM,eACL,CAAE,kBACF,WAAAC;AAAA,IACC,OAAO,eAAe,UAAU,SAAS,OAAO,SAAS;AAAA,EAC1D;AAED,MAAI;AA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sB;AAAA,YACtB,UAAW;AAAA,YACX,MAAK;AAAA,YACL,aAAc,CAAE;AAAA;AAAA,QACjB;AAAA,QACA,4CAAC,iCAAW,WAAY,OAAQ;AAAA,SACjC;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["componentsPrivateApis", "preferencesStore", "useRichUrlData", "stripHTML", "noticesStore", "clsx", "Truncate", "HStack"]
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ __export(settings_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(settings_exports);
|
|
26
26
|
var import_i18n = require("@wordpress/i18n");
|
|
27
27
|
var import_components = require("@wordpress/components");
|
|
28
|
+
var import_ui = require("@wordpress/ui");
|
|
28
29
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
30
|
var noop = () => {
|
|
30
31
|
};
|
|
@@ -70,7 +71,7 @@ var LinkControlSettings = ({ value, onChange = noop, settings }) => {
|
|
|
70
71
|
);
|
|
71
72
|
}).filter(Boolean);
|
|
72
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("fieldset", { className: "block-editor-link-control__settings", children: [
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("legend", {}), children: (0, import_i18n.__)("Currently selected link settings") }),
|
|
74
75
|
theSettings
|
|
75
76
|
] });
|
|
76
77
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/link-control/settings.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { VisuallyHidden } from '@wordpress/ui';\n\nconst noop = () => {};\n\nconst LinkControlSettings = ( { value, onChange = noop, settings } ) => {\n\tif ( ! settings || ! settings.length ) {\n\t\treturn null;\n\t}\n\n\tconst handleSettingChange = ( setting ) => ( newValue ) => {\n\t\tonChange( {\n\t\t\t...value,\n\t\t\t[ setting.id ]: newValue,\n\t\t} );\n\t};\n\n\tconst theSettings = settings\n\t\t.map( ( setting ) => {\n\t\t\t// If render property is provided\n\t\t\tif ( 'render' in setting ) {\n\t\t\t\t// If it's a valid function, use it\n\t\t\t\tif ( typeof setting.render === 'function' ) {\n\t\t\t\t\tconst renderedContent = setting.render(\n\t\t\t\t\t\tsetting,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonChange\n\t\t\t\t\t);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={ setting.id }\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__setting\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ renderedContent }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// If render is provided but invalid, return null\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// If render property is not provided, use CheckboxControl\n\t\t\treturn (\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tclassName=\"block-editor-link-control__setting\"\n\t\t\t\t\tkey={ setting.id }\n\t\t\t\t\tlabel={ setting.title }\n\t\t\t\t\tonChange={ handleSettingChange( setting ) }\n\t\t\t\t\tchecked={ value ? !! value[ setting.id ] : false }\n\t\t\t\t\thelp={ setting?.help }\n\t\t\t\t/>\n\t\t\t);\n\t\t} )\n\t\t.filter( Boolean ); // Remove null entries\n\n\treturn (\n\t\t<fieldset className=\"block-editor-link-control__settings\">\n\t\t\t<VisuallyHidden render={ <legend /> }>\n\t\t\t\t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AAA,KACH;AAEF;AAEA,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -34,6 +34,7 @@ __export(link_picker_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(link_picker_exports);
|
|
36
36
|
var import_components = require("@wordpress/components");
|
|
37
|
+
var import_ui = require("@wordpress/ui");
|
|
37
38
|
var import_element = require("@wordpress/element");
|
|
38
39
|
var import_i18n = require("@wordpress/i18n");
|
|
39
40
|
var import_link_control = __toESM(require("../link-control/index.cjs"));
|
|
@@ -81,7 +82,7 @@ function LinkPicker({
|
|
|
81
82
|
__next40pxDefaultSize: true,
|
|
82
83
|
className: "link-preview-button",
|
|
83
84
|
children: [
|
|
84
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
85
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.VisuallyHidden, { children: [
|
|
85
86
|
label,
|
|
86
87
|
":"
|
|
87
88
|
] }),
|
|
@@ -112,7 +113,7 @@ function LinkPicker({
|
|
|
112
113
|
"aria-labelledby": dialogTitleId,
|
|
113
114
|
"aria-describedby": dialogDescriptionId,
|
|
114
115
|
children: [
|
|
115
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.VisuallyHidden, { children: [
|
|
116
117
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { id: dialogTitleId, children: (0, import_i18n.__)("Select a link") }),
|
|
117
118
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { id: dialogDescriptionId, children: (0, import_i18n.__)(
|
|
118
119
|
"Search for and add a link to the navigation item."
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/link-picker/link-picker.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tButton,\n\tPopover,\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tButton,\n\tPopover,\n\tuseBaseControlProps,\n} from '@wordpress/components';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport { useState, useId, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport LinkControl from '../link-control';\nimport { LinkPreview } from './link-preview';\n\n/**\n * @typedef {Object} LinkPickerPreview\n * @property {string} title - Display title for the link\n * @property {string} url - Display URL for the link\n * @property {string} [image] - Optional image URL for the link preview\n * @property {Array<Object>} [badges] - Optional array of badge objects with label and intent\n * @property {string} badges[].label - Badge label text\n * @property {string} badges[].intent - Badge intent/style\n */\n\n/**\n * LinkPicker component that combines the preview button and search input.\n * Shows a preview button as a trigger, and opens a popover with search input when clicked.\n *\n * @param {Object} props - Component props\n * @param {LinkPickerPreview} props.preview - Preview data object\n * @param {Function} props.onSelect - Callback when a suggestion is selected\n * @param {Object} props.suggestionsQuery - Query parameters for suggestions\n * @param {string} props.label - Label for the control\n * @param {string} props.help - Help text for the control\n */\nexport function LinkPicker( {\n\tpreview,\n\tonSelect,\n\tsuggestionsQuery,\n\tlabel,\n\thelp,\n} ) {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\tconst instanceId = useId();\n\tconst dialogTitleId = `link-picker-title-${ instanceId }`;\n\tconst dialogDescriptionId = `link-picker-description-${ instanceId }`;\n\tconst anchorRef = useRef( null );\n\n\t// Use the proper BaseControl pattern for associating help text\n\tconst { baseControlProps, controlProps } = useBaseControlProps( {\n\t\thelp,\n\t} );\n\n\tconst handleChange = ( newValue ) => {\n\t\t// Close the popover immediately\n\t\tsetIsOpen( false );\n\n\t\t// When a link is selected in LinkControl\n\t\tif ( newValue ) {\n\t\t\tconst suggestion = {\n\t\t\t\turl: newValue.url,\n\t\t\t\tkind: newValue.kind,\n\t\t\t\ttype: newValue.type,\n\t\t\t\tid: newValue.id,\n\t\t\t\ttitle: newValue.title,\n\t\t\t};\n\t\t\tonSelect( suggestion );\n\t\t}\n\t};\n\n\treturn (\n\t\t<BaseControl { ...baseControlProps }>\n\t\t\t<BaseControl.VisualLabel>{ label }</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\tref={ anchorRef }\n\t\t\t\tonClick={ () => setIsOpen( ! isOpen ) }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\taria-describedby={ controlProps[ 'aria-describedby' ] }\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName=\"link-preview-button\"\n\t\t\t>\n\t\t\t\t{ label && <VisuallyHidden>{ label }:</VisuallyHidden> }\n\t\t\t\t<LinkPreview\n\t\t\t\t\ttitle={ preview.title || __( 'Add link' ) }\n\t\t\t\t\turl={ preview.url }\n\t\t\t\t\timage={ preview.image }\n\t\t\t\t\tbadges={ preview.badges }\n\t\t\t\t/>\n\t\t\t</Button>\n\t\t\t{ isOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tanchor={ anchorRef.current }\n\t\t\t\t\tonClose={ () => setIsOpen( false ) }\n\t\t\t\t\tplacement=\"left-start\"\n\t\t\t\t\toffset={ 36 }\n\t\t\t\t\tshift\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\taria-labelledby={ dialogTitleId }\n\t\t\t\t\t\taria-describedby={ dialogDescriptionId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t<h2 id={ dialogTitleId }>\n\t\t\t\t\t\t\t\t{ __( 'Select a link' ) }\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<p id={ dialogDescriptionId }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Search for and add a link to the navigation item.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\tvalue={ null }\n\t\t\t\t\t\t\tonChange={ handleChange }\n\t\t\t\t\t\t\tsuggestionsQuery={ suggestionsQuery }\n\t\t\t\t\t\t\tshowInitialSuggestions\n\t\t\t\t\t\t\tforceIsEditingLink\n\t\t\t\t\t\t\tsettings={ [] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</BaseControl>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAKO;AACP,gBAA+B;AAC/B,qBAAwC;AACxC,kBAAmB;AAKnB,0BAAwB;AACxB,0BAA4B;AA4DzB;AArCI,SAAS,WAAY;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,CAAE,QAAQ,SAAU,QAAI,yBAAU,KAAM;AAC9C,QAAM,iBAAa,sBAAM;AACzB,QAAM,gBAAgB,qBAAsB,UAAW;AACvD,QAAM,sBAAsB,2BAA4B,UAAW;AACnE,QAAM,gBAAY,uBAAQ,IAAK;AAG/B,QAAM,EAAE,kBAAkB,aAAa,QAAI,uCAAqB;AAAA,IAC/D;AAAA,EACD,CAAE;AAEF,QAAM,eAAe,CAAE,aAAc;AAEpC,cAAW,KAAM;AAGjB,QAAK,UAAW;AACf,YAAM,aAAa;AAAA,QAClB,KAAK,SAAS;AAAA,QACd,MAAM,SAAS;AAAA,QACf,MAAM,SAAS;AAAA,QACf,IAAI,SAAS;AAAA,QACb,OAAO,SAAS;AAAA,MACjB;AACA,eAAU,UAAW;AAAA,IACtB;AAAA,EACD;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
|
|
@@ -28,7 +28,7 @@ var import_icons = require("@wordpress/icons");
|
|
|
28
28
|
var import_dom = require("@wordpress/dom");
|
|
29
29
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
30
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
-
var { Badge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
31
|
+
var { Badge: WCBadge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
32
32
|
function LinkPreview({ title, url, image, badges }) {
|
|
33
33
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", alignment: "top", children: [
|
|
34
34
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { className: "link-preview-button__content", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { alignment: "top", children: [
|
|
@@ -68,7 +68,7 @@ function LinkPreview({ title, url, image, badges }) {
|
|
|
68
68
|
className: "link-preview-button__badges",
|
|
69
69
|
alignment: "left",
|
|
70
70
|
children: badges.map((badge) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
-
|
|
71
|
+
WCBadge,
|
|
72
72
|
{
|
|
73
73
|
intent: badge.intent,
|
|
74
74
|
children: badge.label
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/link-picker/link-preview.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalTruncate as Truncate,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { Icon, chevronDown } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { Badge } = unlock( componentsPrivateApis );\n\n/**\n * Link preview component that displays the current link information.\n * This is a presentational component meant to be wrapped in a button.\n *\n * @param {Object} props - Component props\n * @param {string} props.title - Display title for the link\n * @param {string} props.url - Display URL for the link\n * @param {string} props.image - Optional image URL for the link preview\n * @param {Array<Object>} props.badges - Optional array of badge objects with label and intent\n */\nexport function LinkPreview( { title, url, image, badges } ) {\n\treturn (\n\t\t<HStack justify=\"space-between\" alignment=\"top\">\n\t\t\t<FlexItem className=\"link-preview-button__content\">\n\t\t\t\t<HStack alignment=\"top\">\n\t\t\t\t\t{ image && (\n\t\t\t\t\t\t<FlexItem className=\"link-preview-button__image-container\">\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tclassName=\"link-preview-button__image\"\n\t\t\t\t\t\t\t\tsrc={ image }\n\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tclassName=\"link-preview-button__details\"\n\t\t\t\t\t\talignment=\"topLeft\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\t\tclassName=\"link-preview-button__title\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ stripHTML( title ) }\n\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t{ url && (\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\t\t\tclassName=\"link-preview-button__hint\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ url }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ badges && badges.length > 0 && (\n\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\tclassName=\"link-preview-button__badges\"\n\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ badges.map( ( badge ) => (\n\t\t\t\t\t\t\t\t\t<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAMO;AACP,mBAAkC;AAClC,iBAAiD;AAKjD,yBAAuB;AAqBhB;AAnBP,IAAM,EAAE,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalTruncate as Truncate,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { Icon, chevronDown } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { Badge: WCBadge } = unlock( componentsPrivateApis );\n\n/**\n * Link preview component that displays the current link information.\n * This is a presentational component meant to be wrapped in a button.\n *\n * @param {Object} props - Component props\n * @param {string} props.title - Display title for the link\n * @param {string} props.url - Display URL for the link\n * @param {string} props.image - Optional image URL for the link preview\n * @param {Array<Object>} props.badges - Optional array of badge objects with label and intent\n */\nexport function LinkPreview( { title, url, image, badges } ) {\n\treturn (\n\t\t<HStack justify=\"space-between\" alignment=\"top\">\n\t\t\t<FlexItem className=\"link-preview-button__content\">\n\t\t\t\t<HStack alignment=\"top\">\n\t\t\t\t\t{ image && (\n\t\t\t\t\t\t<FlexItem className=\"link-preview-button__image-container\">\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tclassName=\"link-preview-button__image\"\n\t\t\t\t\t\t\t\tsrc={ image }\n\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tclassName=\"link-preview-button__details\"\n\t\t\t\t\t\talignment=\"topLeft\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\t\tclassName=\"link-preview-button__title\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ stripHTML( title ) }\n\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t{ url && (\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\t\t\tclassName=\"link-preview-button__hint\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ url }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ badges && badges.length > 0 && (\n\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\tclassName=\"link-preview-button__badges\"\n\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ badges.map( ( badge ) => (\n\t\t\t\t\t\t\t\t\t<WCBadge\n\t\t\t\t\t\t\t\t\t\tkey={ `${ badge.label }|${ badge.intent }` }\n\t\t\t\t\t\t\t\t\t\tintent={ badge.intent }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ badge.label }\n\t\t\t\t\t\t\t\t\t</WCBadge>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</HStack>\n\t\t\t</FlexItem>\n\t\t\t<Icon icon={ chevronDown } className=\"link-preview-button__icon\" />\n\t\t</HStack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAMO;AACP,mBAAkC;AAClC,iBAAiD;AAKjD,yBAAuB;AAqBhB;AAnBP,IAAM,EAAE,OAAO,QAAQ,QAAI,2BAAQ,kBAAAA,WAAsB;AAYlD,SAAS,YAAa,EAAE,OAAO,KAAK,OAAO,OAAO,GAAI;AAC5D,SACC,6CAAC,kBAAAC,sBAAA,EAAO,SAAQ,iBAAgB,WAAU,OACzC;AAAA,gDAAC,8BAAS,WAAU,gCACnB,uDAAC,kBAAAA,sBAAA,EAAO,WAAU,OACf;AAAA,eACD,4CAAC,8BAAS,WAAU,wCACnB;AAAA,QAAC;AAAA;AAAA,UACA,WAAU;AAAA,UACV,KAAM;AAAA,UACN,KAAI;AAAA;AAAA,MACL,GACD;AAAA,MAGD;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA,WAAU;AAAA,UACV,WAAU;AAAA,UAEV;AAAA;AAAA,cAAC,kBAAAC;AAAA,cAAA;AAAA,gBACA,eAAgB;AAAA,gBAChB,WAAU;AAAA,gBAER,yBAAAC,qBAAW,KAAM;AAAA;AAAA,YACpB;AAAA,YACE,OACD;AAAA,cAAC,kBAAAD;AAAA,cAAA;AAAA,gBACA,eAAgB;AAAA,gBAChB,WAAU;AAAA,gBAER;AAAA;AAAA,YACH;AAAA,YAEC,UAAU,OAAO,SAAS,KAC3B;AAAA,cAAC,kBAAAF;AAAA,cAAA;AAAA,gBACA,WAAU;AAAA,gBACV,WAAU;AAAA,gBAER,iBAAO,IAAK,CAAE,UACf;AAAA,kBAAC;AAAA;AAAA,oBAEA,QAAS,MAAM;AAAA,oBAEb,gBAAM;AAAA;AAAA,kBAHF,GAAI,MAAM,KAAM,IAAK,MAAM,MAAO;AAAA,gBAIzC,CACC;AAAA;AAAA,YACH;AAAA;AAAA;AAAA,MAEF;AAAA,OACD,GACD;AAAA,IACA,4CAAC,qBAAK,MAAO,0BAAc,WAAU,6BAA4B;AAAA,KAClE;AAEF;",
|
|
6
6
|
"names": ["componentsPrivateApis", "HStack", "VStack", "Truncate", "stripHTML"]
|
|
7
7
|
}
|
|
@@ -49,7 +49,7 @@ var import_store = require("../../store/index.cjs");
|
|
|
49
49
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
50
50
|
var import_block_visibility = require("../block-visibility/index.cjs");
|
|
51
51
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
|
-
var { Badge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
52
|
+
var { Badge: WCBadge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
53
53
|
function ListViewBlockSelectButton({
|
|
54
54
|
className,
|
|
55
55
|
block: { clientId },
|
|
@@ -134,7 +134,7 @@ function ListViewBlockSelectButton({
|
|
|
134
134
|
spacing: 1,
|
|
135
135
|
children: [
|
|
136
136
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block-editor-list-view-block-select-button__title", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalTruncate, { ellipsizeMode: "auto", children: blockTitle }) }),
|
|
137
|
-
blockInformation?.anchor && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block-editor-list-view-block-select-button__anchor-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
blockInformation?.anchor && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block-editor-list-view-block-select-button__anchor-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WCBadge, { className: "block-editor-list-view-block-select-button__anchor", children: blockInformation.anchor }) }),
|
|
138
138
|
isSticky && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block-editor-list-view-block-select-button__sticky", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, { icon: import_icons.pinSmall }) }),
|
|
139
139
|
images.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
140
|
"span",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/list-view/block-select-button.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tTooltip,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\tIcon,\n\tlockSmall as lock,\n\tpinSmall,\n\tunseen,\n\tsymbol,\n} from '@wordpress/icons';\nimport { SPACE, ENTER } from '@wordpress/keycodes';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\nimport { useBlockLock } from '../block-lock';\nimport useListViewImages from './use-list-view-images';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { getBlockVisibilityLabel } from '../block-visibility';\n\nconst { Badge } = unlock( componentsPrivateApis );\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonContextMenu,\n\t\tonMouseDown,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaDescribedBy,\n\t},\n\tref\n) {\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\tconst { hasPatternName, blockVisibility } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes } = unlock( select( blockEditorStore ) );\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\treturn {\n\t\t\t\thasPatternName: !! attributes?.metadata?.patternName,\n\t\t\t\tblockVisibility: attributes?.metadata?.blockVisibility,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst shouldShowLockIcon = isLocked;\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\n\n\t// Determine visibility label from blockVisibility metadata\n\tconst visibilityLabel = getBlockVisibilityLabel( blockVisibility );\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<a\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t\tonContextMenu={ onContextMenu }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseDown={ onMouseDown }\n\t\t\tref={ ref }\n\t\t\ttabIndex={ tabIndex }\n\t\t\tonFocus={ onFocus }\n\t\t\tonDragStart={ onDragStartHandler }\n\t\t\tonDragEnd={ onDragEnd }\n\t\t\tdraggable={ draggable }\n\t\t\thref={ `#block-${ clientId }` }\n\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\taria-expanded={ isExpanded }\n\t\t>\n\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t<BlockIcon\n\t\t\t\ticon={ hasPatternName ? symbol : blockInformation?.icon }\n\t\t\t\tshowColors\n\t\t\t\tcontext=\"list-view\"\n\t\t\t/>\n\t\t\t<HStack\n\t\t\t\talignment=\"center\"\n\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tspacing={ 1 }\n\t\t\t>\n\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t</span>\n\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAKO;AACP,qBAA2B;AAC3B,mBAMO;AACP,sBAA6B;AAC7B,kBAA0B;AAK1B,wBAAsB;AACtB,2CAAuC;AACvC,qCAAiC;AACjC,sBAA6B;AAC7B,wBAA6B;AAC7B,kCAA8B;AAC9B,mBAA0C;AAC1C,yBAAuB;AACvB,8BAAwC;AAqFrC;AAnFH,IAAM,EAAE,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tTooltip,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\tIcon,\n\tlockSmall as lock,\n\tpinSmall,\n\tunseen,\n\tsymbol,\n} from '@wordpress/icons';\nimport { SPACE, ENTER } from '@wordpress/keycodes';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\nimport { useBlockLock } from '../block-lock';\nimport useListViewImages from './use-list-view-images';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { getBlockVisibilityLabel } from '../block-visibility';\n\nconst { Badge: WCBadge } = unlock( componentsPrivateApis );\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonContextMenu,\n\t\tonMouseDown,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaDescribedBy,\n\t},\n\tref\n) {\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\tconst { hasPatternName, blockVisibility } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes } = unlock( select( blockEditorStore ) );\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\treturn {\n\t\t\t\thasPatternName: !! attributes?.metadata?.patternName,\n\t\t\t\tblockVisibility: attributes?.metadata?.blockVisibility,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst shouldShowLockIcon = isLocked;\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\n\n\t// Determine visibility label from blockVisibility metadata\n\tconst visibilityLabel = getBlockVisibilityLabel( blockVisibility );\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<a\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t\tonContextMenu={ onContextMenu }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseDown={ onMouseDown }\n\t\t\tref={ ref }\n\t\t\ttabIndex={ tabIndex }\n\t\t\tonFocus={ onFocus }\n\t\t\tonDragStart={ onDragStartHandler }\n\t\t\tonDragEnd={ onDragEnd }\n\t\t\tdraggable={ draggable }\n\t\t\thref={ `#block-${ clientId }` }\n\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\taria-expanded={ isExpanded }\n\t\t>\n\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t<BlockIcon\n\t\t\t\ticon={ hasPatternName ? symbol : blockInformation?.icon }\n\t\t\t\tshowColors\n\t\t\t\tcontext=\"list-view\"\n\t\t\t/>\n\t\t\t<HStack\n\t\t\t\talignment=\"center\"\n\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tspacing={ 1 }\n\t\t\t>\n\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t</span>\n\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t<WCBadge className=\"block-editor-list-view-block-select-button__anchor\">\n\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t</WCBadge>\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ isSticky && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__sticky\">\n\t\t\t\t\t\t<Icon icon={ pinSmall } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ images.length ? (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__images\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t{ images.map( ( image, index ) => (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__image\"\n\t\t\t\t\t\t\t\tkey={ image.clientId }\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tbackgroundImage: `url(${ image.url })`,\n\t\t\t\t\t\t\t\t\tzIndex: images.length - index, // Ensure the first image is on top, and subsequent images are behind.\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</span>\n\t\t\t\t) : null }\n\t\t\t\t{ !! visibilityLabel && (\n\t\t\t\t\t<Tooltip text={ visibilityLabel }>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__block-visibility\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon icon={ unseen } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) }\n\t\t\t\t{ shouldShowLockIcon && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</a>\n\t);\n}\n\nexport default forwardRef( ListViewBlockSelectButton );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAKO;AACP,qBAA2B;AAC3B,mBAMO;AACP,sBAA6B;AAC7B,kBAA0B;AAK1B,wBAAsB;AACtB,2CAAuC;AACvC,qCAAiC;AACjC,sBAA6B;AAC7B,wBAA6B;AAC7B,kCAA8B;AAC9B,mBAA0C;AAC1C,yBAAuB;AACvB,8BAAwC;AAqFrC;AAnFH,IAAM,EAAE,OAAO,QAAQ,QAAI,2BAAQ,kBAAAA,WAAsB;AAEzD,SAAS,0BACR;AAAA,EACC;AAAA,EACA,OAAO,EAAE,SAAS;AAAA,EAClB;AAAA,EACA;AAA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,kCAAQ,2BAAY,yBAA0B;",
|
|
6
6
|
"names": ["componentsPrivateApis", "useBlockDisplayInformation", "useBlockDisplayTitle", "blockEditorStore", "useListViewImages", "clsx", "ListViewExpander", "BlockIcon", "HStack", "Truncate", "lock"]
|
|
7
7
|
}
|
|
@@ -38,6 +38,7 @@ module.exports = __toCommonJS(list_view_exports);
|
|
|
38
38
|
var import_clsx = __toESM(require("clsx"));
|
|
39
39
|
var import_compose = require("@wordpress/compose");
|
|
40
40
|
var import_components = require("@wordpress/components");
|
|
41
|
+
var import_ui = require("@wordpress/ui");
|
|
41
42
|
var import_data = require("@wordpress/data");
|
|
42
43
|
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
43
44
|
var import_element = require("@wordpress/element");
|
|
@@ -292,7 +293,7 @@ function ListViewComponent({
|
|
|
292
293
|
blockDropTarget
|
|
293
294
|
}
|
|
294
295
|
),
|
|
295
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
296
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, { id: describedById, children: description }),
|
|
296
297
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
297
298
|
import_components.__experimentalTreeGrid,
|
|
298
299
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/list-view/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport {\n\t__experimentalTreeGrid as TreeGrid,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseReducer,\n\tforwardRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewBranch from './branch';\nimport { ListViewContext } from './context';\nimport ListViewDropIndicatorPreview from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewBlockIndexes from './use-list-view-block-indexes';\nimport useListViewClientIds from './use-list-view-client-ids';\nimport useListViewCollapseItems from './use-list-view-collapse-items';\nimport useListViewDropZone from './use-list-view-drop-zone';\nimport useListViewExpandSelectedItem from './use-list-view-expand-selected-item';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';\nimport { focusListItem } from './utils';\nimport useClipboardHandler from './use-clipboard-handler';\n\nconst expanded = ( state, action ) => {\n\tif ( action.type === 'clear' ) {\n\t\treturn {};\n\t}\n\tif ( Array.isArray( action.clientIds ) ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t...action.clientIds.reduce(\n\t\t\t\t( newState, id ) => ( {\n\t\t\t\t\t...newState,\n\t\t\t\t\t[ id ]: action.type === 'expand',\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t),\n\t\t};\n\t}\n\treturn state;\n};\n\nexport const BLOCK_LIST_ITEM_HEIGHT = 32;\n\n/** @typedef {React.ComponentType} ComponentType */\n/** @typedef {React.Ref<HTMLElement>} Ref */\n\n/**\n * Show a hierarchical list of blocks.\n *\n * @param {Object} props Components props.\n * @param {string} props.id An HTML element id for the root element of ListView.\n * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.\n * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.\n * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.\n * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.\n * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.\n * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.\n * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.\n * @param {string} props.description Optional accessible description for the tree grid component.\n * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.\n * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.\n * @param {Ref} ref Forwarded ref\n */\nfunction ListViewComponent(\n\t{\n\t\tid,\n\t\tblocks,\n\t\tdropZoneElement,\n\t\tshowBlockMovers = false,\n\t\tisExpanded = false,\n\t\tshowAppender = false,\n\t\tblockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,\n\t\trootClientId,\n\t\tdescription,\n\t\tonSelect,\n\t\tadditionalBlockContent: AdditionalBlockContent,\n\t},\n\tref\n) {\n\t// This can be removed once we no longer need to support the blocks prop.\n\tif ( blocks ) {\n\t\tdeprecated(\n\t\t\t'`blocks` property in `wp.blockEditor.__experimentalListView`',\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\talternative: '`rootClientId` property',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst instanceId = useInstanceId( ListViewComponent );\n\tconst { clientIdsTree, draggedClientIds, selectedClientIds } =\n\t\tuseListViewClientIds( { blocks, rootClientId } );\n\tconst blockIndexes = useListViewBlockIndexes( clientIdsTree );\n\n\tconst { getBlock, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\tconst { visibleBlockCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount, getClientIdsOfDescendants } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst draggedBlockCount =\n\t\t\t\tdraggedClientIds?.length > 0\n\t\t\t\t\t? getClientIdsOfDescendants( draggedClientIds ).length + 1\n\t\t\t\t\t: 0;\n\t\t\treturn {\n\t\t\t\tvisibleBlockCount: getGlobalBlockCount() - draggedBlockCount,\n\t\t\t};\n\t\t},\n\t\t[ draggedClientIds ]\n\t);\n\n\tconst { updateBlockSelection } = useBlockSelection();\n\n\tconst [ expandedState, setExpandedState ] = useReducer( expanded, {} );\n\n\tconst [ insertedBlock, setInsertedBlock ] = useState( null );\n\n\tconst { setSelectedTreeId } = useListViewExpandSelectedItem( {\n\t\tfirstSelectedBlockClientId: selectedClientIds[ 0 ],\n\t\tsetExpandedState,\n\t} );\n\tconst selectEditorBlock = useCallback(\n\t\t/**\n\t\t * @param {MouseEvent | KeyboardEvent | undefined} event\n\t\t * @param {string} blockClientId\n\t\t * @param {null | undefined | -1 | 1} focusPosition\n\t\t */\n\t\t( event, blockClientId, focusPosition ) => {\n\t\t\tupdateBlockSelection( event, blockClientId, null, focusPosition );\n\t\t\tsetSelectedTreeId( blockClientId );\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( getBlock( blockClientId ) );\n\t\t\t}\n\t\t},\n\t\t[ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ]\n\t);\n\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t\texpandedState,\n\t\tsetExpandedState,\n\t} );\n\tconst elementRef = useRef();\n\n\t// Allow handling of copy, cut, and paste events.\n\tconst clipBoardRef = useClipboardHandler( {\n\t\tselectBlock: selectEditorBlock,\n\t} );\n\n\tconst focusSelectedBlock = useCallback(\n\t\t( node ) => {\n\t\t\tconst [ firstSelectedClientId ] = getSelectedBlockClientIds();\n\t\t\t// If a blocks are already selected when the list view is initially\n\t\t\t// mounted, shift focus to the first selected block.\n\t\t\tif ( firstSelectedClientId && node ) {\n\t\t\t\tfocusListItem( firstSelectedClientId, node );\n\t\t\t}\n\t\t},\n\t\t[ getSelectedBlockClientIds ]\n\t);\n\n\tconst treeGridRef = useMergeRefs( [\n\t\tclipBoardRef,\n\t\tfocusSelectedBlock,\n\t\telementRef,\n\t\tdropZoneRef,\n\t\tref,\n\t] );\n\n\tconst expand = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst clientIds = Array.isArray( clientId )\n\t\t\t\t? clientId\n\t\t\t\t: [ clientId ];\n\t\t\tsetExpandedState( { type: 'expand', clientIds } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapse = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'collapse', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapseAll = useCallback( () => {\n\t\tsetExpandedState( { type: 'clear' } );\n\t}, [ setExpandedState ] );\n\tconst expandRow = useCallback(\n\t\t( row ) => {\n\t\t\texpand( row?.dataset?.block );\n\t\t},\n\t\t[ expand ]\n\t);\n\tconst collapseRow = useCallback(\n\t\t( row ) => {\n\t\t\tcollapse( row?.dataset?.block );\n\t\t},\n\t\t[ collapse ]\n\t);\n\tconst focusRow = useCallback(\n\t\t( event, startRow, endRow ) => {\n\t\t\tif ( event.shiftKey ) {\n\t\t\t\tupdateBlockSelection(\n\t\t\t\t\tevent,\n\t\t\t\t\tstartRow?.dataset?.block,\n\t\t\t\t\tendRow?.dataset?.block\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ updateBlockSelection ]\n\t);\n\n\tuseListViewCollapseItems( {\n\t\tcollapseAll,\n\t\texpand,\n\t} );\n\n\tconst firstDraggedBlockClientId = draggedClientIds?.[ 0 ];\n\n\t// Convert a blockDropTarget into indexes relative to the blocks in the list view.\n\t// These values are used to determine which blocks should be displaced to make room\n\t// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.\n\tconst { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } =\n\t\tuseMemo( () => {\n\t\t\tlet _blockDropTargetIndex, _firstDraggedBlockIndex;\n\n\t\t\tif ( blockDropTarget?.clientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ blockDropTarget.clientId ];\n\t\t\t\t// If dragging below or inside the block, treat the drop target as the next block.\n\t\t\t\t_blockDropTargetIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t} else if ( blockDropTarget === null ) {\n\t\t\t\t// A `null` value is used to indicate that the user is dragging outside of the list view.\n\t\t\t\t_blockDropTargetIndex = null;\n\t\t\t}\n\n\t\t\tif ( firstDraggedBlockClientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ firstDraggedBlockClientId ];\n\t\t\t\t_firstDraggedBlockIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockDropTargetIndex: _blockDropTargetIndex,\n\t\t\t\tblockDropPosition: blockDropTarget?.dropPosition,\n\t\t\t\tfirstDraggedBlockIndex: _firstDraggedBlockIndex,\n\t\t\t};\n\t\t}, [ blockDropTarget, blockIndexes, firstDraggedBlockClientId ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tlistViewInstanceId: instanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\ttreeGridElementRef: elementRef,\n\t\t\trootClientId,\n\t\t} ),\n\t\t[\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tinstanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\trootClientId,\n\t\t]\n\t);\n\n\t// List View renders a fixed number of items and relies on each having a fixed item height of 36px.\n\t// If this value changes, we should also change the itemHeight value set in useFixedWindowList.\n\t// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.\n\tconst [ fixedListWindow ] = useFixedWindowList(\n\t\telementRef,\n\t\tBLOCK_LIST_ITEM_HEIGHT,\n\t\tvisibleBlockCount,\n\t\t{\n\t\t\t// Ensure that the windowing logic is recalculated when the expanded state changes.\n\t\t\t// This is necessary because expanding a collapsed block in a short list view can\n\t\t\t// switch the list view to a tall list view with a scrollbar, and vice versa.\n\t\t\t// When this happens, the windowing logic needs to be recalculated to ensure that\n\t\t\t// the correct number of blocks are rendered, by rechecking for a scroll container.\n\t\t\texpandedState,\n\t\t\tuseWindowing: true,\n\t\t\twindowOverscan: 40,\n\t\t}\n\t);\n\n\t// If there are no blocks to show and we're not showing the appender, do not render the list view.\n\tif ( ! clientIdsTree.length && ! showAppender ) {\n\t\treturn null;\n\t}\n\n\tconst describedById =\n\t\tdescription && `block-editor-list-view-description-${ instanceId }`;\n\n\treturn (\n\t\t<AsyncModeProvider value>\n\t\t\t<ListViewDropIndicatorPreview\n\t\t\t\tdraggedBlockClientId={ firstDraggedBlockClientId }\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t{ description && (\n\t\t\t\t<VisuallyHidden id={ describedById }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName={ clsx( 'block-editor-list-view-tree', {\n\t\t\t\t\t'is-dragging':\n\t\t\t\t\t\tdraggedClientIds?.length > 0 &&\n\t\t\t\t\t\tblockDropTargetIndex !== undefined,\n\t\t\t\t} ) }\n\t\t\t\taria-label={ __( 'Block navigation structure' ) }\n\t\t\t\tref={ treeGridRef }\n\t\t\t\tonCollapseRow={ collapseRow }\n\t\t\t\tonExpandRow={ expandRow }\n\t\t\t\tonFocusRow={ focusRow }\n\t\t\t\tapplicationAriaLabel={ __( 'Block navigation structure' ) }\n\t\t\t\taria-describedby={ describedById }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-admin--list-view-dragged-items-height':\n\t\t\t\t\t\tdraggedClientIds?.length\n\t\t\t\t\t\t\t? `${\n\t\t\t\t\t\t\t\t\tBLOCK_LIST_ITEM_HEIGHT *\n\t\t\t\t\t\t\t\t\t( draggedClientIds.length - 1 )\n\t\t\t\t\t\t\t }px`\n\t\t\t\t\t\t\t: null,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ListViewContext.Provider value={ contextValue }>\n\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\t\t\tparentId={ rootClientId }\n\t\t\t\t\t\tselectBlock={ selectEditorBlock }\n\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\tshowAppender={ showAppender }\n\t\t\t\t\t/>\n\t\t\t\t</ListViewContext.Provider>\n\t\t\t</TreeGrid>\n\t\t</AsyncModeProvider>\n\t);\n}\n\n// This is the private API for the ListView component.\n// It allows access to all props, not just the public ones.\nexport const PrivateListView = forwardRef( ListViewComponent );\n\n// This is the public API for the ListView component.\n// We wrap the PrivateListView component to hide some props from the public API.\nexport default forwardRef( ( props, ref ) => {\n\treturn (\n\t\t<PrivateListView\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tshowAppender={ false }\n\t\t\trootClientId={ null }\n\t\t\tonSelect={ null }\n\t\t\tadditionalBlockContent={ null }\n\t\t\tblockSettingsMenu={ undefined }\n\t\t/>\n\t);\n} );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAIO;AACP,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport { __experimentalTreeGrid as TreeGrid } from '@wordpress/components';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseReducer,\n\tforwardRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewBranch from './branch';\nimport { ListViewContext } from './context';\nimport ListViewDropIndicatorPreview from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewBlockIndexes from './use-list-view-block-indexes';\nimport useListViewClientIds from './use-list-view-client-ids';\nimport useListViewCollapseItems from './use-list-view-collapse-items';\nimport useListViewDropZone from './use-list-view-drop-zone';\nimport useListViewExpandSelectedItem from './use-list-view-expand-selected-item';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';\nimport { focusListItem } from './utils';\nimport useClipboardHandler from './use-clipboard-handler';\n\nconst expanded = ( state, action ) => {\n\tif ( action.type === 'clear' ) {\n\t\treturn {};\n\t}\n\tif ( Array.isArray( action.clientIds ) ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t...action.clientIds.reduce(\n\t\t\t\t( newState, id ) => ( {\n\t\t\t\t\t...newState,\n\t\t\t\t\t[ id ]: action.type === 'expand',\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t),\n\t\t};\n\t}\n\treturn state;\n};\n\nexport const BLOCK_LIST_ITEM_HEIGHT = 32;\n\n/** @typedef {React.ComponentType} ComponentType */\n/** @typedef {React.Ref<HTMLElement>} Ref */\n\n/**\n * Show a hierarchical list of blocks.\n *\n * @param {Object} props Components props.\n * @param {string} props.id An HTML element id for the root element of ListView.\n * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.\n * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.\n * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.\n * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.\n * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.\n * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.\n * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.\n * @param {string} props.description Optional accessible description for the tree grid component.\n * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.\n * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.\n * @param {Ref} ref Forwarded ref\n */\nfunction ListViewComponent(\n\t{\n\t\tid,\n\t\tblocks,\n\t\tdropZoneElement,\n\t\tshowBlockMovers = false,\n\t\tisExpanded = false,\n\t\tshowAppender = false,\n\t\tblockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,\n\t\trootClientId,\n\t\tdescription,\n\t\tonSelect,\n\t\tadditionalBlockContent: AdditionalBlockContent,\n\t},\n\tref\n) {\n\t// This can be removed once we no longer need to support the blocks prop.\n\tif ( blocks ) {\n\t\tdeprecated(\n\t\t\t'`blocks` property in `wp.blockEditor.__experimentalListView`',\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\talternative: '`rootClientId` property',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst instanceId = useInstanceId( ListViewComponent );\n\tconst { clientIdsTree, draggedClientIds, selectedClientIds } =\n\t\tuseListViewClientIds( { blocks, rootClientId } );\n\tconst blockIndexes = useListViewBlockIndexes( clientIdsTree );\n\n\tconst { getBlock, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\tconst { visibleBlockCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount, getClientIdsOfDescendants } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst draggedBlockCount =\n\t\t\t\tdraggedClientIds?.length > 0\n\t\t\t\t\t? getClientIdsOfDescendants( draggedClientIds ).length + 1\n\t\t\t\t\t: 0;\n\t\t\treturn {\n\t\t\t\tvisibleBlockCount: getGlobalBlockCount() - draggedBlockCount,\n\t\t\t};\n\t\t},\n\t\t[ draggedClientIds ]\n\t);\n\n\tconst { updateBlockSelection } = useBlockSelection();\n\n\tconst [ expandedState, setExpandedState ] = useReducer( expanded, {} );\n\n\tconst [ insertedBlock, setInsertedBlock ] = useState( null );\n\n\tconst { setSelectedTreeId } = useListViewExpandSelectedItem( {\n\t\tfirstSelectedBlockClientId: selectedClientIds[ 0 ],\n\t\tsetExpandedState,\n\t} );\n\tconst selectEditorBlock = useCallback(\n\t\t/**\n\t\t * @param {MouseEvent | KeyboardEvent | undefined} event\n\t\t * @param {string} blockClientId\n\t\t * @param {null | undefined | -1 | 1} focusPosition\n\t\t */\n\t\t( event, blockClientId, focusPosition ) => {\n\t\t\tupdateBlockSelection( event, blockClientId, null, focusPosition );\n\t\t\tsetSelectedTreeId( blockClientId );\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( getBlock( blockClientId ) );\n\t\t\t}\n\t\t},\n\t\t[ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ]\n\t);\n\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t\texpandedState,\n\t\tsetExpandedState,\n\t} );\n\tconst elementRef = useRef();\n\n\t// Allow handling of copy, cut, and paste events.\n\tconst clipBoardRef = useClipboardHandler( {\n\t\tselectBlock: selectEditorBlock,\n\t} );\n\n\tconst focusSelectedBlock = useCallback(\n\t\t( node ) => {\n\t\t\tconst [ firstSelectedClientId ] = getSelectedBlockClientIds();\n\t\t\t// If a blocks are already selected when the list view is initially\n\t\t\t// mounted, shift focus to the first selected block.\n\t\t\tif ( firstSelectedClientId && node ) {\n\t\t\t\tfocusListItem( firstSelectedClientId, node );\n\t\t\t}\n\t\t},\n\t\t[ getSelectedBlockClientIds ]\n\t);\n\n\tconst treeGridRef = useMergeRefs( [\n\t\tclipBoardRef,\n\t\tfocusSelectedBlock,\n\t\telementRef,\n\t\tdropZoneRef,\n\t\tref,\n\t] );\n\n\tconst expand = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst clientIds = Array.isArray( clientId )\n\t\t\t\t? clientId\n\t\t\t\t: [ clientId ];\n\t\t\tsetExpandedState( { type: 'expand', clientIds } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapse = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'collapse', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapseAll = useCallback( () => {\n\t\tsetExpandedState( { type: 'clear' } );\n\t}, [ setExpandedState ] );\n\tconst expandRow = useCallback(\n\t\t( row ) => {\n\t\t\texpand( row?.dataset?.block );\n\t\t},\n\t\t[ expand ]\n\t);\n\tconst collapseRow = useCallback(\n\t\t( row ) => {\n\t\t\tcollapse( row?.dataset?.block );\n\t\t},\n\t\t[ collapse ]\n\t);\n\tconst focusRow = useCallback(\n\t\t( event, startRow, endRow ) => {\n\t\t\tif ( event.shiftKey ) {\n\t\t\t\tupdateBlockSelection(\n\t\t\t\t\tevent,\n\t\t\t\t\tstartRow?.dataset?.block,\n\t\t\t\t\tendRow?.dataset?.block\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ updateBlockSelection ]\n\t);\n\n\tuseListViewCollapseItems( {\n\t\tcollapseAll,\n\t\texpand,\n\t} );\n\n\tconst firstDraggedBlockClientId = draggedClientIds?.[ 0 ];\n\n\t// Convert a blockDropTarget into indexes relative to the blocks in the list view.\n\t// These values are used to determine which blocks should be displaced to make room\n\t// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.\n\tconst { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } =\n\t\tuseMemo( () => {\n\t\t\tlet _blockDropTargetIndex, _firstDraggedBlockIndex;\n\n\t\t\tif ( blockDropTarget?.clientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ blockDropTarget.clientId ];\n\t\t\t\t// If dragging below or inside the block, treat the drop target as the next block.\n\t\t\t\t_blockDropTargetIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t} else if ( blockDropTarget === null ) {\n\t\t\t\t// A `null` value is used to indicate that the user is dragging outside of the list view.\n\t\t\t\t_blockDropTargetIndex = null;\n\t\t\t}\n\n\t\t\tif ( firstDraggedBlockClientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ firstDraggedBlockClientId ];\n\t\t\t\t_firstDraggedBlockIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockDropTargetIndex: _blockDropTargetIndex,\n\t\t\t\tblockDropPosition: blockDropTarget?.dropPosition,\n\t\t\t\tfirstDraggedBlockIndex: _firstDraggedBlockIndex,\n\t\t\t};\n\t\t}, [ blockDropTarget, blockIndexes, firstDraggedBlockClientId ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tlistViewInstanceId: instanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\ttreeGridElementRef: elementRef,\n\t\t\trootClientId,\n\t\t} ),\n\t\t[\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tinstanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\trootClientId,\n\t\t]\n\t);\n\n\t// List View renders a fixed number of items and relies on each having a fixed item height of 36px.\n\t// If this value changes, we should also change the itemHeight value set in useFixedWindowList.\n\t// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.\n\tconst [ fixedListWindow ] = useFixedWindowList(\n\t\telementRef,\n\t\tBLOCK_LIST_ITEM_HEIGHT,\n\t\tvisibleBlockCount,\n\t\t{\n\t\t\t// Ensure that the windowing logic is recalculated when the expanded state changes.\n\t\t\t// This is necessary because expanding a collapsed block in a short list view can\n\t\t\t// switch the list view to a tall list view with a scrollbar, and vice versa.\n\t\t\t// When this happens, the windowing logic needs to be recalculated to ensure that\n\t\t\t// the correct number of blocks are rendered, by rechecking for a scroll container.\n\t\t\texpandedState,\n\t\t\tuseWindowing: true,\n\t\t\twindowOverscan: 40,\n\t\t}\n\t);\n\n\t// If there are no blocks to show and we're not showing the appender, do not render the list view.\n\tif ( ! clientIdsTree.length && ! showAppender ) {\n\t\treturn null;\n\t}\n\n\tconst describedById =\n\t\tdescription && `block-editor-list-view-description-${ instanceId }`;\n\n\treturn (\n\t\t<AsyncModeProvider value>\n\t\t\t<ListViewDropIndicatorPreview\n\t\t\t\tdraggedBlockClientId={ firstDraggedBlockClientId }\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t{ description && (\n\t\t\t\t<VisuallyHidden id={ describedById }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName={ clsx( 'block-editor-list-view-tree', {\n\t\t\t\t\t'is-dragging':\n\t\t\t\t\t\tdraggedClientIds?.length > 0 &&\n\t\t\t\t\t\tblockDropTargetIndex !== undefined,\n\t\t\t\t} ) }\n\t\t\t\taria-label={ __( 'Block navigation structure' ) }\n\t\t\t\tref={ treeGridRef }\n\t\t\t\tonCollapseRow={ collapseRow }\n\t\t\t\tonExpandRow={ expandRow }\n\t\t\t\tonFocusRow={ focusRow }\n\t\t\t\tapplicationAriaLabel={ __( 'Block navigation structure' ) }\n\t\t\t\taria-describedby={ describedById }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-admin--list-view-dragged-items-height':\n\t\t\t\t\t\tdraggedClientIds?.length\n\t\t\t\t\t\t\t? `${\n\t\t\t\t\t\t\t\t\tBLOCK_LIST_ITEM_HEIGHT *\n\t\t\t\t\t\t\t\t\t( draggedClientIds.length - 1 )\n\t\t\t\t\t\t\t }px`\n\t\t\t\t\t\t\t: null,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ListViewContext.Provider value={ contextValue }>\n\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\t\t\tparentId={ rootClientId }\n\t\t\t\t\t\tselectBlock={ selectEditorBlock }\n\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\tshowAppender={ showAppender }\n\t\t\t\t\t/>\n\t\t\t\t</ListViewContext.Provider>\n\t\t\t</TreeGrid>\n\t\t</AsyncModeProvider>\n\t);\n}\n\n// This is the private API for the ListView component.\n// It allows access to all props, not just the public ones.\nexport const PrivateListView = forwardRef( ListViewComponent );\n\n// This is the public API for the ListView component.\n// We wrap the PrivateListView component to hide some props from the public API.\nexport default forwardRef( ( props, ref ) => {\n\treturn (\n\t\t<PrivateListView\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tshowAppender={ false }\n\t\t\trootClientId={ null }\n\t\t\tonSelect={ null }\n\t\t\tadditionalBlockContent={ null }\n\t\t\tblockSettingsMenu={ undefined }\n\t\t/>\n\t);\n} );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAIO;AACP,wBAAmD;AACnD,gBAA+B;AAC/B,kBAA6C;AAC7C,wBAAuB;AACvB,qBAOO;AACP,kBAAmB;AAKnB,oBAA2B;AAC3B,qBAAgC;AAChC,4BAAyC;AACzC,iCAA8B;AAC9B,yCAAoC;AACpC,sCAAiC;AACjC,0CAAqC;AACrC,qCAAgC;AAChC,gDAA0C;AAC1C,mBAA0C;AAC1C,qCAAsC;AACtC,mBAA8B;AAC9B,mCAAgC;AAsT9B;AApTF,IAAM,WAAW,CAAE,OAAO,WAAY;AACrC,MAAK,OAAO,SAAS,SAAU;AAC9B,WAAO,CAAC;AAAA,EACT;AACA,MAAK,MAAM,QAAS,OAAO,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,QAC9C,KAAM;AAAA,QACN,eAAgB;AAAA,QAChB,aAAc;AAAA,QACd,YAAa;AAAA,QACb,0BAAuB,gBAAI,4BAA6B;AAAA,QACxD,oBAAmB;AAAA,QACnB,OAAQ;AAAA,UACP,8CACC,kBAAkB,SACf,GACA,0BACE,iBAAiB,SAAS,EAC5B,OACA;AAAA,QACL;AAAA,QAEA,sDAAC,+BAAgB,UAAhB,EAAyB,OAAQ,cACjC;AAAA,UAAC,cAAAC;AAAA,UAAA;AAAA,YACA,QAAS;AAAA,YACT,UAAW;AAAA,YACX,aAAc;AAAA,YACd;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACD,GACD;AAAA;AAAA,IACD;AAAA,KACD;AAEF;AAIO,IAAM,sBAAkB,2BAAY,iBAAkB;AAI7D,IAAO,wBAAQ,2BAAY,CAAE,OAAO,QAAS;AAC5C,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACE,GAAG;AAAA,MACL,cAAe;AAAA,MACf,cAAe;AAAA,MACf,UAAW;AAAA,MACX,wBAAyB;AAAA,MACzB,mBAAoB;AAAA;AAAA,EACrB;AAEF,CAAE;",
|
|
6
6
|
"names": ["deprecated", "useListViewClientIds", "useListViewBlockIndexes", "blockEditorStore", "useBlockSelection", "useListViewExpandSelectedItem", "useListViewDropZone", "useClipboardHandler", "useListViewCollapseItems", "useFixedWindowList", "ListViewDropIndicatorPreview", "TreeGrid", "clsx", "ListViewBranch"]
|
|
7
7
|
}
|