@wordpress/block-editor 15.3.0 → 15.3.1-next.6870dfe5b.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.
Files changed (27) hide show
  1. package/build/components/block-popover/use-popover-scroll.js +11 -2
  2. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  3. package/build/components/block-tools/use-show-block-tools.js +1 -1
  4. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  5. package/build/components/inserter/hooks/use-insertion-point.js +1 -1
  6. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  7. package/build/components/inserter/index.js +1 -3
  8. package/build/components/inserter/index.js.map +1 -1
  9. package/build/components/list-view/appender.js +13 -3
  10. package/build/components/list-view/appender.js.map +1 -1
  11. package/build-module/components/block-popover/use-popover-scroll.js +11 -2
  12. package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
  13. package/build-module/components/block-tools/use-show-block-tools.js +1 -1
  14. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  15. package/build-module/components/inserter/hooks/use-insertion-point.js +1 -1
  16. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  17. package/build-module/components/inserter/index.js +1 -3
  18. package/build-module/components/inserter/index.js.map +1 -1
  19. package/build-module/components/list-view/appender.js +13 -3
  20. package/build-module/components/list-view/appender.js.map +1 -1
  21. package/package.json +34 -34
  22. package/src/components/block-popover/use-popover-scroll.js +10 -2
  23. package/src/components/block-tools/use-show-block-tools.js +1 -1
  24. package/src/components/inserter/hooks/use-insertion-point.js +1 -1
  25. package/src/components/inserter/index.js +1 -3
  26. package/src/components/list-view/appender.js +13 -6
  27. package/tsconfig.tsbuildinfo +1 -1
@@ -24,7 +24,8 @@ function usePopoverScroll(contentRef) {
24
24
  function onWheel(event) {
25
25
  const {
26
26
  deltaX,
27
- deltaY
27
+ deltaY,
28
+ target
28
29
  } = event;
29
30
  const contentEl = contentRef.current;
30
31
  let scrollContainer = scrollContainerCache.get(contentEl);
@@ -32,7 +33,15 @@ function usePopoverScroll(contentRef) {
32
33
  scrollContainer = (0, _dom.getScrollContainer)(contentEl);
33
34
  scrollContainerCache.set(contentEl, scrollContainer);
34
35
  }
35
- scrollContainer.scrollBy(deltaX, deltaY);
36
+ // Finds a scrollable ancestor of the event’s target. It's not cached because the
37
+ // it may not remain scrollable due to popover position changes. The cache is also
38
+ // less likely to be utilized because the target may be different every event.
39
+ const eventScrollContainer = (0, _dom.getScrollContainer)(target);
40
+ // Scrolls “through” the popover only if another contained scrollable area isn’t
41
+ // in front of it. This is to avoid scrolling both containers simultaneously.
42
+ if (!node.contains(eventScrollContainer)) {
43
+ scrollContainer.scrollBy(deltaX, deltaY);
44
+ }
36
45
  }
37
46
  // Tell the browser that we do not call event.preventDefault
38
47
  // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_dom","scrollContainerCache","WeakMap","usePopoverScroll","contentRef","effect","useRefEffect","node","onWheel","event","deltaX","deltaY","contentEl","current","scrollContainer","get","getScrollContainer","set","scrollBy","options","passive","addEventListener","removeEventListener","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-popover/use-popover-scroll.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\nconst scrollContainerCache = new WeakMap();\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} contentRef\n */\nfunction usePopoverScroll( contentRef ) {\n\tconst effect = useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onWheel( event ) {\n\t\t\t\tconst { deltaX, deltaY } = event;\n\t\t\t\tconst contentEl = contentRef.current;\n\t\t\t\tlet scrollContainer = scrollContainerCache.get( contentEl );\n\t\t\t\tif ( ! scrollContainer ) {\n\t\t\t\t\tscrollContainer = getScrollContainer( contentEl );\n\t\t\t\t\tscrollContainerCache.set( contentEl, scrollContainer );\n\t\t\t\t}\n\t\t\t\tscrollContainer.scrollBy( deltaX, deltaY );\n\t\t\t}\n\t\t\t// Tell the browser that we do not call event.preventDefault\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners\n\t\t\tconst options = { passive: true };\n\t\t\tnode.addEventListener( 'wheel', onWheel, options );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'wheel', onWheel, options );\n\t\t\t};\n\t\t},\n\t\t[ contentRef ]\n\t);\n\treturn contentRef ? effect : null;\n}\n\nexport default usePopoverScroll;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,oBAAoB,GAAG,IAAIC,OAAO,CAAC,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAEC,UAAU,EAAG;EACvC,MAAMC,MAAM,GAAG,IAAAC,qBAAY,EACxBC,IAAI,IAAM;IACX,SAASC,OAAOA,CAAEC,KAAK,EAAG;MACzB,MAAM;QAAEC,MAAM;QAAEC;MAAO,CAAC,GAAGF,KAAK;MAChC,MAAMG,SAAS,GAAGR,UAAU,CAACS,OAAO;MACpC,IAAIC,eAAe,GAAGb,oBAAoB,CAACc,GAAG,CAAEH,SAAU,CAAC;MAC3D,IAAK,CAAEE,eAAe,EAAG;QACxBA,eAAe,GAAG,IAAAE,uBAAkB,EAAEJ,SAAU,CAAC;QACjDX,oBAAoB,CAACgB,GAAG,CAAEL,SAAS,EAAEE,eAAgB,CAAC;MACvD;MACAA,eAAe,CAACI,QAAQ,CAAER,MAAM,EAAEC,MAAO,CAAC;IAC3C;IACA;IACA;IACA,MAAMQ,OAAO,GAAG;MAAEC,OAAO,EAAE;IAAK,CAAC;IACjCb,IAAI,CAACc,gBAAgB,CAAE,OAAO,EAAEb,OAAO,EAAEW,OAAQ,CAAC;IAClD,OAAO,MAAM;MACZZ,IAAI,CAACe,mBAAmB,CAAE,OAAO,EAAEd,OAAO,EAAEW,OAAQ,CAAC;IACtD,CAAC;EACF,CAAC,EACD,CAAEf,UAAU,CACb,CAAC;EACD,OAAOA,UAAU,GAAGC,MAAM,GAAG,IAAI;AAClC;AAAC,IAAAkB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctB,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_dom","scrollContainerCache","WeakMap","usePopoverScroll","contentRef","effect","useRefEffect","node","onWheel","event","deltaX","deltaY","target","contentEl","current","scrollContainer","get","getScrollContainer","set","eventScrollContainer","contains","scrollBy","options","passive","addEventListener","removeEventListener","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-popover/use-popover-scroll.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\nconst scrollContainerCache = new WeakMap();\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} contentRef\n */\nfunction usePopoverScroll( contentRef ) {\n\tconst effect = useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onWheel( event ) {\n\t\t\t\tconst { deltaX, deltaY, target } = event;\n\t\t\t\tconst contentEl = contentRef.current;\n\t\t\t\tlet scrollContainer = scrollContainerCache.get( contentEl );\n\t\t\t\tif ( ! scrollContainer ) {\n\t\t\t\t\tscrollContainer = getScrollContainer( contentEl );\n\t\t\t\t\tscrollContainerCache.set( contentEl, scrollContainer );\n\t\t\t\t}\n\t\t\t\t// Finds a scrollable ancestor of the event’s target. It's not cached because the\n\t\t\t\t// it may not remain scrollable due to popover position changes. The cache is also\n\t\t\t\t// less likely to be utilized because the target may be different every event.\n\t\t\t\tconst eventScrollContainer = getScrollContainer( target );\n\t\t\t\t// Scrolls “through” the popover only if another contained scrollable area isn’t\n\t\t\t\t// in front of it. This is to avoid scrolling both containers simultaneously.\n\t\t\t\tif ( ! node.contains( eventScrollContainer ) ) {\n\t\t\t\t\tscrollContainer.scrollBy( deltaX, deltaY );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Tell the browser that we do not call event.preventDefault\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners\n\t\t\tconst options = { passive: true };\n\t\t\tnode.addEventListener( 'wheel', onWheel, options );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'wheel', onWheel, options );\n\t\t\t};\n\t\t},\n\t\t[ contentRef ]\n\t);\n\treturn contentRef ? effect : null;\n}\n\nexport default usePopoverScroll;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,oBAAoB,GAAG,IAAIC,OAAO,CAAC,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAEC,UAAU,EAAG;EACvC,MAAMC,MAAM,GAAG,IAAAC,qBAAY,EACxBC,IAAI,IAAM;IACX,SAASC,OAAOA,CAAEC,KAAK,EAAG;MACzB,MAAM;QAAEC,MAAM;QAAEC,MAAM;QAAEC;MAAO,CAAC,GAAGH,KAAK;MACxC,MAAMI,SAAS,GAAGT,UAAU,CAACU,OAAO;MACpC,IAAIC,eAAe,GAAGd,oBAAoB,CAACe,GAAG,CAAEH,SAAU,CAAC;MAC3D,IAAK,CAAEE,eAAe,EAAG;QACxBA,eAAe,GAAG,IAAAE,uBAAkB,EAAEJ,SAAU,CAAC;QACjDZ,oBAAoB,CAACiB,GAAG,CAAEL,SAAS,EAAEE,eAAgB,CAAC;MACvD;MACA;MACA;MACA;MACA,MAAMI,oBAAoB,GAAG,IAAAF,uBAAkB,EAAEL,MAAO,CAAC;MACzD;MACA;MACA,IAAK,CAAEL,IAAI,CAACa,QAAQ,CAAED,oBAAqB,CAAC,EAAG;QAC9CJ,eAAe,CAACM,QAAQ,CAAEX,MAAM,EAAEC,MAAO,CAAC;MAC3C;IACD;IACA;IACA;IACA,MAAMW,OAAO,GAAG;MAAEC,OAAO,EAAE;IAAK,CAAC;IACjChB,IAAI,CAACiB,gBAAgB,CAAE,OAAO,EAAEhB,OAAO,EAAEc,OAAQ,CAAC;IAClD,OAAO,MAAM;MACZf,IAAI,CAACkB,mBAAmB,CAAE,OAAO,EAAEjB,OAAO,EAAEc,OAAQ,CAAC;IACtD,CAAC;EACF,CAAC,EACD,CAAElB,UAAU,CACb,CAAC;EACD,OAAOA,UAAU,GAAGC,MAAM,GAAG,IAAI;AAClC;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczB,gBAAgB","ignoreList":[]}
@@ -37,7 +37,7 @@ function useShowBlockTools() {
37
37
  const block = getBlock(clientId);
38
38
  const editorMode = __unstableGetEditorMode();
39
39
  const hasSelectedBlock = !!clientId && !!block;
40
- const isEmptyDefaultBlock = hasSelectedBlock && (0, _blocks.isUnmodifiedDefaultBlock)(block) && getBlockMode(clientId) !== 'html';
40
+ const isEmptyDefaultBlock = hasSelectedBlock && (0, _blocks.isUnmodifiedDefaultBlock)(block, 'content') && getBlockMode(clientId) !== 'html';
41
41
  const _showEmptyBlockSideInserter = clientId && !isTyping() &&
42
42
  // Hide the block inserter on the navigation mode.
43
43
  // See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_blocks","_store","_lockUnlock","useShowBlockTools","useSelect","select","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlock","getBlockMode","getSettings","__unstableGetEditorMode","isTyping","isBlockInterfaceHidden","unlock","blockEditorStore","clientId","block","editorMode","hasSelectedBlock","isEmptyDefaultBlock","isUnmodifiedDefaultBlock","_showEmptyBlockSideInserter","_showBlockToolbarPopover","hasFixedToolbar","showEmptyBlockSideInserter","showBlockToolbarPopover"],"sources":["@wordpress/block-editor/src/components/block-tools/use-show-block-tools.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Source of truth for which block tools are showing in the block editor.\n *\n * @return {Object} Object of which block tools will be shown.\n */\nexport function useShowBlockTools() {\n\treturn useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetFirstMultiSelectedBlockClientId,\n\t\t\tgetBlock,\n\t\t\tgetBlockMode,\n\t\t\tgetSettings,\n\t\t\t__unstableGetEditorMode,\n\t\t\tisTyping,\n\t\t\tisBlockInterfaceHidden,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst clientId =\n\t\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\t\tconst block = getBlock( clientId );\n\t\tconst editorMode = __unstableGetEditorMode();\n\t\tconst hasSelectedBlock = !! clientId && !! block;\n\t\tconst isEmptyDefaultBlock =\n\t\t\thasSelectedBlock &&\n\t\t\tisUnmodifiedDefaultBlock( block ) &&\n\t\t\tgetBlockMode( clientId ) !== 'html';\n\t\tconst _showEmptyBlockSideInserter =\n\t\t\tclientId &&\n\t\t\t! isTyping() &&\n\t\t\t// Hide the block inserter on the navigation mode.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.\n\t\t\teditorMode !== 'navigation' &&\n\t\t\tisEmptyDefaultBlock;\n\t\tconst _showBlockToolbarPopover =\n\t\t\t! isBlockInterfaceHidden() &&\n\t\t\t! getSettings().hasFixedToolbar &&\n\t\t\t! _showEmptyBlockSideInserter &&\n\t\t\thasSelectedBlock &&\n\t\t\t! isEm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BAAgB,IAChB,CAAEC,mBAAmB;IAEtB,OAAO;MACNK,0BAA0B,EAAEH,2BAA2B;MACvDI,uBAAuB,EAAEH;IAC1B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_blocks","_store","_lockUnlock","useShowBlockTools","useSelect","select","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlock","getBlockMode","getSettings","__unstableGetEditorMode","isTyping","isBlockInterfaceHidden","unlock","blockEditorStore","clientId","block","editorMode","hasSelectedBlock","isEmptyDefaultBlock","isUnmodifiedDefaultBlock","_showEmptyBlockSideInserter","_showBlockToolbarPopover","hasFixedToolbar","showEmptyBlockSideInserter","showBlockToolbarPopover"],"sources":["@wordpress/block-editor/src/components/block-tools/use-show-block-tools.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Source of truth for which block tools are showing in the block editor.\n *\n * @return {Object} Object of which block tools will be shown.\n */\nexport function useShowBlockTools() {\n\treturn useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetFirstMultiSelectedBlockClientId,\n\t\t\tgetBlock,\n\t\t\tgetBlockMode,\n\t\t\tgetSettings,\n\t\t\t__unstableGetEditorMode,\n\t\t\tisTyping,\n\t\t\tisBlockInterfaceHidden,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst clientId =\n\t\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\t\tconst block = getBlock( clientId );\n\t\tconst editorMode = __unstableGetEditorMode();\n\t\tconst hasSelectedBlock = !! clientId && !! block;\n\t\tconst isEmptyDefaultBlock =\n\t\t\thasSelectedBlock &&\n\t\t\tisUnmodifiedDefaultBlock( block, 'content' ) &&\n\t\t\tgetBlockMode( clientId ) !== 'html';\n\t\tconst _showEmptyBlockSideInserter =\n\t\t\tclientId &&\n\t\t\t! isTyping() &&\n\t\t\t// Hide the block inserter on the navigation mode.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.\n\t\t\teditorMode !== 'navigation' &&\n\t\t\tisEmptyDefaultBlock;\n\t\tconst _showBlockToolbarPopover =\n\t\t\t! isBlockInterfaceHidden() &&\n\t\t\t! getSettings().hasFixedToolbar &&\n\t\t\t! _showEmptyBlockSideInserter &&\n\t\t\thasSelectedBlock &&\n\t\t\t! isEmptyDefaultBlock;\n\n\t\treturn {\n\t\t\tshowEmptyBlockSideInserter: _showEmptyBlockSideInserter,\n\t\t\tshowBlockToolbarPopover: _showBlockToolbarPopover,\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASI,iBAAiBA,CAAA,EAAG;EACnC,OAAO,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC/B,MAAM;MACLC,wBAAwB;MACxBC,kCAAkC;MAClCC,QAAQ;MACRC,YAAY;MACZC,WAAW;MACXC,uBAAuB;MACvBC,QAAQ;MACRC;IACD,CAAC,GAAG,IAAAC,kBAAM,EAAET,MAAM,CAAEU,YAAiB,CAAE,CAAC;IAExC,MAAMC,QAAQ,GACbV,wBAAwB,CAAC,CAAC,IAAIC,kCAAkC,CAAC,CAAC;IAEnE,MAAMU,KAAK,GAAGT,QAAQ,CAAEQ,QAAS,CAAC;IAClC,MAAME,UAAU,GAAGP,uBAAuB,CAAC,CAAC;IAC5C,MAAMQ,gBAAgB,GAAG,CAAC,CAAEH,QAAQ,IAAI,CAAC,CAAEC,KAAK;IAChD,MAAMG,mBAAmB,GACxBD,gBAAgB,IAChB,IAAAE,gCAAwB,EAAEJ,KAAK,EAAE,SAAU,CAAC,IAC5CR,YAAY,CAAEO,QAAS,CAAC,KAAK,MAAM;IACpC,MAAMM,2BAA2B,GAChCN,QAAQ,IACR,CAAEJ,QAAQ,CAAC,CAAC;IACZ;IACA;IACAM,UAAU,KAAK,YAAY,IAC3BE,mBAAmB;IACpB,MAAMG,wBAAwB,GAC7B,CAAEV,sBAAsB,CAAC,CAAC,IAC1B,CAAEH,WAAW,CAAC,CAAC,CAACc,eAAe,IAC/B,CAAEF,2BAA2B,IAC7BH,gBAAgB,IAChB,CAAEC,mBAAmB;IAEtB,OAAO;MACNK,0BAA0B,EAAEH,2BAA2B;MACvDI,uBAAuB,EAAEH;IAC1B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -123,7 +123,7 @@ function useInsertionPoint({
123
123
  setLastFocus(null);
124
124
  }
125
125
  const selectedBlock = getSelectedBlock();
126
- if (!isAppender && selectedBlock && (0, _blocks.isUnmodifiedDefaultBlock)(selectedBlock)) {
126
+ if (!isAppender && selectedBlock && (0, _blocks.isUnmodifiedDefaultBlock)(selectedBlock, 'content')) {
127
127
  replaceBlocks(selectedBlock.clientId, blocks, null, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta);
128
128
  } else {
129
129
  insertBlocks(blocks, isAppender || _rootClientId === undefined ? destinationIndex : getIndex({
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_blocks","_i18n","_a11y","_element","_store","_lockUnlock","getIndex","destinationRootClientId","destinationIndex","rootClientId","registry","parents","select","blockEditorStore","getBlockParents","parentIndex","indexOf","getBlockIndex","getBlockOrder","length","useInsertionPoint","insertionIndex","clientId","isAppender","onSelect","shouldFocusBlock","selectBlockOnInsert","useRegistry","getSelectedBlock","getClosestAllowedInsertionPoint","isBlockInsertionPointVisible","unlock","useSelect","getSelectedBlockClientId","getBlockRootClientId","getInsertionPoint","selectedBlockClientId","_destinationRootClientId","_destinationIndex","insertionPoint","undefined","hasOwnProperty","index","replaceBlocks","insertBlocks","showInsertionPoint","hideInsertionPoint","setLastFocus","useDispatch","onInsertBlocks","useCallback","blocks","meta","shouldForceFocusBlock","_rootClientId","selectedBlock","isUnmodifiedDefaultBlock","blockLength","Array","isArray","message","sprintf","_n","speak","onToggleInsertionPoint","item","allowedDestinationRootClientId","name","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-insertion-point.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction getIndex( {\n\tdestinationRootClientId,\n\tdestinationIndex,\n\trootClientId,\n\tregistry,\n} ) {\n\tif ( rootClientId === destinationRootClientId ) {\n\t\treturn destinationIndex;\n\t}\n\tconst parents = [\n\t\t'',\n\t\t...registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockParents( destinationRootClientId ),\n\t\tdestinationRootClientId,\n\t];\n\tconst parentIndex = parents.indexOf( rootClientId );\n\tif ( parentIndex !== -1 ) {\n\t\treturn (\n\t\t\tregistry\n\t\t\t\t.select( blockEditorStore )\n\t\t\t\t.getBlockIndex( parents[ parentIndex + 1 ] ) + 1\n\t\t);\n\t}\n\treturn registry.select( blockEditorStore ).getBlockOrder( rootClientId )\n\t\t.length;\n}\n\n/**\n * @typedef WPInserterConfig\n *\n * @property {string=} rootClientId If set, insertion will be into the\n * block with this ID.\n * @property {number=} insertionIndex If set, insertion will be into this\n * explicit position.\n * @property {string=} clientId If set, insertion will be after the\n * block with this ID.\n * @property {boolean=} isAppender Whether the inserter is an appender\n * or not.\n * @property {Function=} onSelect Called after insertion.\n */\n\n/**\n * Returns the insertion point state given the inserter config.\n *\n * @param {WPInserterConfig} config Inserter Config.\n * @return {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle).\n */\nfunction useInsertionPoint( {\n\trootClientId = '',\n\tinsertionIndex,\n\tclientId,\n\tisAppender,\n\tonSelect,\n\tshouldFocusBlock = true,\n\tselectBlockOnInsert = true,\n} ) {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetSelectedBlock,\n\t\tgetClosestAllowedInsertionPoint,\n\t\tisBlockInsertionPointVisible,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { destinationRootClientId, destinationIndex } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetInsertionPoint,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tlet _destinationRootClientId = rootClientId;\n\t\t\tlet _destinationIndex;\n\t\t\tconst insertionPoint = getInsertionPoint();\n\n\t\t\tif ( insertionIndex !== undefined ) {\n\t\t\t\t// Insert into a specific index.\n\t\t\t\t_destinationIndex = insertionIndex;\n\t\t\t} else if (\n\t\t\t\tinsertionPoint &&\n\t\t\t\tinsertionPoint.hasOwnProperty( 'index' )\n\t\t\t) {\n\t\t\t\t_destinationRootClientId = insertionPoint?.rootClientId\n\t\t\t\t\t? insertionPoint.rootClientId\n\t\t\t\t\t: rootClientId;\n\t\t\t\t_destinationIndex = insertionPoint.index;\n\t\t\t} else if ( clientId ) {\n\t\t\t\t// Insert after a specific client ID.\n\t\t\t\t_destinationIndex = getBlockIndex( clientId );\n\t\t\t} else if ( ! isAppender && selectedBlockClientId ) {\n\t\t\t\t_destinationRootClientId = getBlockRootClientId(\n\t\t\t\t\tselectedBlockClientId\n\t\t\t\t);\n\t\t\t\t_destinationIndex = getBlockIndex( selectedBlockClientId ) + 1;\n\t\t\t} else {\n\t\t\t\t// Insert at the end of the list.\n\t\t\t\t_destinationIndex = getBlockOrder(\n\t\t\t\t\t_destinationRootClientId\n\t\t\t\t).length;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdestinationRootClientId: _destinationRootClientId,\n\t\t\t\tdestinationIndex: _destinationIndex,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, insertionIndex, clientId, isAppender ]\n\t);\n\n\tconst {\n\t\treplaceBlocks,\n\t\tinsertBlocks,\n\t\tshowInsertionPoint,\n\t\thideInsertionPoint,\n\t\tsetLastFocus,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tconst onInsertBlocks = useCallback(\n\t\t( blocks, meta, shouldForceFocusBlock = false, _rootClientId ) => {\n\t\t\t// When we are trying to move focus or select a new block on insert, we also\n\t\t\t// need to clear the last focus to avoid the focus being set to the wrong block\n\t\t\t// when tabbing back into the canvas if the block was added from outside the\n\t\t\t// editor canvas.\n\t\t\tif (\n\t\t\t\tshouldForceFocusBlock ||\n\t\t\t\tshouldFocusBlock ||\n\t\t\t\tselectBlockOnInsert\n\t\t\t) {\n\t\t\t\tsetLastFocus( null );\n\t\t\t}\n\n\t\t\tconst selectedBlock = getSelectedBlock();\n\n\t\t\tif (\n\t\t\t\t! isAppender &&\n\t\t\t\tselectedBlock &&\n\t\t\t\tisUnmodifiedDefaultBlock( selectedBlock )\n\t\t\t) {\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\tblocks,\n\t\t\t\t\tnull,\n\t\t\t\t\tshouldFocusBlock || shouldForceFocusBlock ? 0 : null,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tinsertBlocks(\n\t\t\t\t\tblocks,\n\t\t\t\t\tisAppender || _rootClientId === undefined\n\t\t\t\t\t\t? destinationIndex\n\t\t\t\t\t\t: getIndex( {\n\t\t\t\t\t\t\t\tdestinationRootClientId,\n\t\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\t\trootClientId: _rootClientId,\n\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t } ),\n\t\t\t\t\tisAppender || _rootClientId === undefined\n\t\t\t\t\t\t? destinationRootClientId\n\t\t\t\t\t\t: _rootClientId,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t\tshouldFocusBlock || shouldForceFocusBlock ? 0 : null,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst blockLength = Array.isArray( blocks ) ? blocks.length : 1;\n\t\t\tconst message = sprintf(\n\t\t\t\t// translators: %d: the name of the block that has been added\n\t\t\t\t_n( '%d block added.', '%d blocks added.', blockLength ),\n\t\t\t\tblockLength\n\t\t\t);\n\t\t\tspeak( message );\n\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( blocks );\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tisAppender,\n\t\t\tgetSelectedBlock,\n\t\t\treplaceBlocks,\n\t\t\tinsertBlocks,\n\t\t\tdestinationRootClientId,\n\t\t\tdestinationIndex,\n\t\t\tonSelect,\n\t\t\tshouldFocusBlock,\n\t\t\tselectBlockOnInsert,\n\t\t]\n\t);\n\n\tconst onToggleInsertionPoint = useCallback(\n\t\t( item ) => {\n\t\t\tif ( item && ! isBlockInsertionPointVisible() ) {\n\t\t\t\tconst allowedDestinationRootClientId =\n\t\t\t\t\tgetClosestAllowedInsertionPoint(\n\t\t\t\t\t\titem.name,\n\t\t\t\t\t\tdestinationRootClientId\n\t\t\t\t\t);\n\t\t\t\tif ( allowedDestinationRootClientId !== null ) {\n\t\t\t\t\tshowInsertionPoint(\n\t\t\t\t\t\tallowedDestinationRootClientId,\n\t\t\t\t\t\tgetIndex( {\n\t\t\t\t\t\t\tdestinationRootClientId,\n\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\trootClientId: allowedDestinationRootClientId,\n\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thideInsertionPoint();\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tgetClosestAllowedInsertionPoint,\n\t\t\tisBlockInsertionPointVisible,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tdestinationRootClientId,\n\t\t\tdestinationIndex,\n\t\t]\n\t);\n\n\treturn [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ];\n}\n\nexport default useInsertionPoint;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,SAASO,QAAQA,CAAE;EAClBC,uBAAuB;EACvBC,gBAAgB;EAChBC,YAAY;EACZC;AACD,CAAC,EAAG;EACH,IAAKD,YAAY,KAAKF,uBAAuB,EAAG;IAC/C,OAAOC,gBAAgB;EACxB;EACA,MAAMG,OAAO,GAAG,CACf,EAAE,EACF,GAAGD,QAAQ,CACTE,MAAM,CAAEC,YAAiB,CAAC,CAC1BC,eAAe,CAAEP,uBAAwB,CAAC,EAC5CA,uBAAuB,CACvB;EACD,MAAMQ,WAAW,GAAGJ,OAAO,CAACK,OAAO,CAAEP,YAAa,CAAC;EACnD,IAAKM,WAAW,KAAK,CAAC,CAAC,EAAG;IACzB,OACCL,QAAQ,CACNE,MAAM,CAAEC,YAAiB,CAAC,CAC1BI,aAAa,CAAEN,OAAO,CAAEI,WAAW,GAAG,CAAC,CAAG,CAAC,GAAG,CAAC;EAEnD;EACA,OAAOL,QAAQ,CAACE,MAAM,CAAEC,YAAiB,CAA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,CAAC,EACD,CACCjB,+BAA+B,EAC/BC,4BAA4B,EAC5Be,kBAAkB,EAClBC,kBAAkB,EAClBvC,uBAAuB,EACvBC,gBAAgB,CAElB,CAAC;EAED,OAAO,CAAED,uBAAuB,EAAE0C,cAAc,EAAEe,sBAAsB,CAAE;AAC3E;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclD,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_blocks","_i18n","_a11y","_element","_store","_lockUnlock","getIndex","destinationRootClientId","destinationIndex","rootClientId","registry","parents","select","blockEditorStore","getBlockParents","parentIndex","indexOf","getBlockIndex","getBlockOrder","length","useInsertionPoint","insertionIndex","clientId","isAppender","onSelect","shouldFocusBlock","selectBlockOnInsert","useRegistry","getSelectedBlock","getClosestAllowedInsertionPoint","isBlockInsertionPointVisible","unlock","useSelect","getSelectedBlockClientId","getBlockRootClientId","getInsertionPoint","selectedBlockClientId","_destinationRootClientId","_destinationIndex","insertionPoint","undefined","hasOwnProperty","index","replaceBlocks","insertBlocks","showInsertionPoint","hideInsertionPoint","setLastFocus","useDispatch","onInsertBlocks","useCallback","blocks","meta","shouldForceFocusBlock","_rootClientId","selectedBlock","isUnmodifiedDefaultBlock","blockLength","Array","isArray","message","sprintf","_n","speak","onToggleInsertionPoint","item","allowedDestinationRootClientId","name","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-insertion-point.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction getIndex( {\n\tdestinationRootClientId,\n\tdestinationIndex,\n\trootClientId,\n\tregistry,\n} ) {\n\tif ( rootClientId === destinationRootClientId ) {\n\t\treturn destinationIndex;\n\t}\n\tconst parents = [\n\t\t'',\n\t\t...registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockParents( destinationRootClientId ),\n\t\tdestinationRootClientId,\n\t];\n\tconst parentIndex = parents.indexOf( rootClientId );\n\tif ( parentIndex !== -1 ) {\n\t\treturn (\n\t\t\tregistry\n\t\t\t\t.select( blockEditorStore )\n\t\t\t\t.getBlockIndex( parents[ parentIndex + 1 ] ) + 1\n\t\t);\n\t}\n\treturn registry.select( blockEditorStore ).getBlockOrder( rootClientId )\n\t\t.length;\n}\n\n/**\n * @typedef WPInserterConfig\n *\n * @property {string=} rootClientId If set, insertion will be into the\n * block with this ID.\n * @property {number=} insertionIndex If set, insertion will be into this\n * explicit position.\n * @property {string=} clientId If set, insertion will be after the\n * block with this ID.\n * @property {boolean=} isAppender Whether the inserter is an appender\n * or not.\n * @property {Function=} onSelect Called after insertion.\n */\n\n/**\n * Returns the insertion point state given the inserter config.\n *\n * @param {WPInserterConfig} config Inserter Config.\n * @return {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle).\n */\nfunction useInsertionPoint( {\n\trootClientId = '',\n\tinsertionIndex,\n\tclientId,\n\tisAppender,\n\tonSelect,\n\tshouldFocusBlock = true,\n\tselectBlockOnInsert = true,\n} ) {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetSelectedBlock,\n\t\tgetClosestAllowedInsertionPoint,\n\t\tisBlockInsertionPointVisible,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { destinationRootClientId, destinationIndex } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetInsertionPoint,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tlet _destinationRootClientId = rootClientId;\n\t\t\tlet _destinationIndex;\n\t\t\tconst insertionPoint = getInsertionPoint();\n\n\t\t\tif ( insertionIndex !== undefined ) {\n\t\t\t\t// Insert into a specific index.\n\t\t\t\t_destinationIndex = insertionIndex;\n\t\t\t} else if (\n\t\t\t\tinsertionPoint &&\n\t\t\t\tinsertionPoint.hasOwnProperty( 'index' )\n\t\t\t) {\n\t\t\t\t_destinationRootClientId = insertionPoint?.rootClientId\n\t\t\t\t\t? insertionPoint.rootClientId\n\t\t\t\t\t: rootClientId;\n\t\t\t\t_destinationIndex = insertionPoint.index;\n\t\t\t} else if ( clientId ) {\n\t\t\t\t// Insert after a specific client ID.\n\t\t\t\t_destinationIndex = getBlockIndex( clientId );\n\t\t\t} else if ( ! isAppender && selectedBlockClientId ) {\n\t\t\t\t_destinationRootClientId = getBlockRootClientId(\n\t\t\t\t\tselectedBlockClientId\n\t\t\t\t);\n\t\t\t\t_destinationIndex = getBlockIndex( selectedBlockClientId ) + 1;\n\t\t\t} else {\n\t\t\t\t// Insert at the end of the list.\n\t\t\t\t_destinationIndex = getBlockOrder(\n\t\t\t\t\t_destinationRootClientId\n\t\t\t\t).length;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdestinationRootClientId: _destinationRootClientId,\n\t\t\t\tdestinationIndex: _destinationIndex,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, insertionIndex, clientId, isAppender ]\n\t);\n\n\tconst {\n\t\treplaceBlocks,\n\t\tinsertBlocks,\n\t\tshowInsertionPoint,\n\t\thideInsertionPoint,\n\t\tsetLastFocus,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tconst onInsertBlocks = useCallback(\n\t\t( blocks, meta, shouldForceFocusBlock = false, _rootClientId ) => {\n\t\t\t// When we are trying to move focus or select a new block on insert, we also\n\t\t\t// need to clear the last focus to avoid the focus being set to the wrong block\n\t\t\t// when tabbing back into the canvas if the block was added from outside the\n\t\t\t// editor canvas.\n\t\t\tif (\n\t\t\t\tshouldForceFocusBlock ||\n\t\t\t\tshouldFocusBlock ||\n\t\t\t\tselectBlockOnInsert\n\t\t\t) {\n\t\t\t\tsetLastFocus( null );\n\t\t\t}\n\n\t\t\tconst selectedBlock = getSelectedBlock();\n\n\t\t\tif (\n\t\t\t\t! isAppender &&\n\t\t\t\tselectedBlock &&\n\t\t\t\tisUnmodifiedDefaultBlock( selectedBlock, 'content' )\n\t\t\t) {\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\tblocks,\n\t\t\t\t\tnull,\n\t\t\t\t\tshouldFocusBlock || shouldForceFocusBlock ? 0 : null,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tinsertBlocks(\n\t\t\t\t\tblocks,\n\t\t\t\t\tisAppender || _rootClientId === undefined\n\t\t\t\t\t\t? destinationIndex\n\t\t\t\t\t\t: getIndex( {\n\t\t\t\t\t\t\t\tdestinationRootClientId,\n\t\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\t\trootClientId: _rootClientId,\n\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t } ),\n\t\t\t\t\tisAppender || _rootClientId === undefined\n\t\t\t\t\t\t? destinationRootClientId\n\t\t\t\t\t\t: _rootClientId,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t\tshouldFocusBlock || shouldForceFocusBlock ? 0 : null,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst blockLength = Array.isArray( blocks ) ? blocks.length : 1;\n\t\t\tconst message = sprintf(\n\t\t\t\t// translators: %d: the name of the block that has been added\n\t\t\t\t_n( '%d block added.', '%d blocks added.', blockLength ),\n\t\t\t\tblockLength\n\t\t\t);\n\t\t\tspeak( message );\n\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( blocks );\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tisAppender,\n\t\t\tgetSelectedBlock,\n\t\t\treplaceBlocks,\n\t\t\tinsertBlocks,\n\t\t\tdestinationRootClientId,\n\t\t\tdestinationIndex,\n\t\t\tonSelect,\n\t\t\tshouldFocusBlock,\n\t\t\tselectBlockOnInsert,\n\t\t]\n\t);\n\n\tconst onToggleInsertionPoint = useCallback(\n\t\t( item ) => {\n\t\t\tif ( item && ! isBlockInsertionPointVisible() ) {\n\t\t\t\tconst allowedDestinationRootClientId =\n\t\t\t\t\tgetClosestAllowedInsertionPoint(\n\t\t\t\t\t\titem.name,\n\t\t\t\t\t\tdestinationRootClientId\n\t\t\t\t\t);\n\t\t\t\tif ( allowedDestinationRootClientId !== null ) {\n\t\t\t\t\tshowInsertionPoint(\n\t\t\t\t\t\tallowedDestinationRootClientId,\n\t\t\t\t\t\tgetIndex( {\n\t\t\t\t\t\t\tdestinationRootClientId,\n\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\trootClientId: allowedDestinationRootClientId,\n\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thideInsertionPoint();\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tgetClosestAllowedInsertionPoint,\n\t\t\tisBlockInsertionPointVisible,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tdestinationRootClientId,\n\t\t\tdestinationIndex,\n\t\t]\n\t);\n\n\treturn [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ];\n}\n\nexport default useInsertionPoint;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,SAASO,QAAQA,CAA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AAU,EACVK,gBAAgB,EAChBe,aAAa,EACbC,YAAY,EACZrC,uBAAuB,EACvBC,gBAAgB,EAChBgB,QAAQ,EACRC,gBAAgB,EAChBC,mBAAmB,CAErB,CAAC;EAED,MAAMsC,sBAAsB,GAAG,IAAAd,oBAAW,EACvCe,IAAI,IAAM;IACX,IAAKA,IAAI,IAAI,CAAEnC,4BAA4B,CAAC,CAAC,EAAG;MAC/C,MAAMoC,8BAA8B,GACnCrC,+BAA+B,CAC9BoC,IAAI,CAACE,IAAI,EACT5D,uBACD,CAAC;MACF,IAAK2D,8BAA8B,KAAK,IAAI,EAAG;QAC9CrB,kBAAkB,CACjBqB,8BAA8B,EAC9B5D,QAAQ,CAAE;UACTC,uBAAuB;UACvBC,gBAAgB;UAChBC,YAAY,EAAEyD,8BAA8B;UAC5CxD;QACD,CAAE,CACH,CAAC;MACF;IACD,CAAC,MAAM;MACNoC,kBAAkB,CAAC,CAAC;IACrB;EACD,CAAC,EACD,CACCjB,+BAA+B,EAC/BC,4BAA4B,EAC5Be,kBAAkB,EAClBC,kBAAkB,EAClBvC,uBAAuB,EACvBC,gBAAgB,CAElB,CAAC;EAED,OAAO,CAAED,uBAAuB,EAAE0C,cAAc,EAAEe,sBAAsB,CAAE;AAC3E;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclD,iBAAiB","ignoreList":[]}
@@ -335,9 +335,7 @@ var _default = exports.default = (0, _compose.compose)([(0, _data.withSelect)((s
335
335
  }
336
336
  insertBlock(blockToInsert, getInsertionIndex(), rootClientId, selectBlockOnInsert);
337
337
  if (onSelectOrClose) {
338
- onSelectOrClose({
339
- clientId: blockToInsert?.clientId
340
- });
338
+ onSelectOrClose(blockToInsert);
341
339
  }
342
340
  const message = (0, _i18n.sprintf)(
343
341
  // translators: %s: the name of the block that has been added
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_a11y","_i18n","_components","_element","_data","_compose","_blocks","_icons","_menu","_quickInserter","_store","_jsxRuntime","defaultRenderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","toggleProps","as","Wrapper","Button","label","labelProp","onClick","rest","sprintf","_x","handleClick","event","jsx","__next40pxDefaultSize","undefined","icon","plus","tooltipPosition","className","Inserter","Component","constructor","arguments","bind","renderToggle","renderContent","props","directInsertBlock","hasItems","onClose","rootClientId","clientId","isAppender","showInserterHelpPanel","__experimentalIsQuick","isQuick","onSelectOrClose","selectBlockOnInsert","default","onSelect","blocks","firstBlock","Array","isArray","length","render","position","insertOnlyAllowedBlock","Dropdown","contentClassName","clsx","popoverProps","shift","expandOnMobile","headerTitle","__","_default","exports","compose","withSelect","select","shouldDirectInsert","getBlockRootClientId","hasInserterItems","getAllowedBlocks","getDirectInsertBlock","blockEditorStore","getBlockVariations","blocksStore","allowedBlocks","name","allowedBlockType","title","withDispatch","dispatch","ownProps","getAdjacentBlockAttributes","attributesToCopy","getBlock","getPreviousBlockClientId","result","adjacentAttributes","parentBlock","innerBlocks","lastInnerBlock","attributes","currentBlock","previousBlock","forEach","attribute","hasOwnProperty","getInsertionIndex","getBlockIndex","getBlockSelectionEnd","getBlockOrder","end","insertBlock","blockToInsert","newAttributes","createBlock","message","speak","ifCondition"],"sources":["@wordpress/block-editor/src/components/inserter/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport InserterMenu from './menu';\nimport QuickInserter from './quick-inserter';\nimport { store as blockEditorStore } from '../../store';\n\nconst defaultRenderToggle = ( {\n\tonToggle,\n\tdisabled,\n\tisOpen,\n\tblockTitle,\n\thasSingleBlockType,\n\ttoggleProps = {},\n} ) => {\n\tconst {\n\t\tas: Wrapper = Button,\n\t\tlabel: labelProp,\n\t\tonClick,\n\t\t...rest\n\t} = toggleProps;\n\n\tlet label = labelProp;\n\tif ( ! label && hasSingleBlockType ) {\n\t\tlabel = sprintf(\n\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t_x( 'Add %s', 'directly add the only allowed block' ),\n\t\t\tblockTitle\n\t\t);\n\t} else if ( ! label ) {\n\t\tlabel = _x( 'Add block', 'Generic label for block inserter button' );\n\t}\n\n\t// Handle both onClick functions from the toggle and the parent component.\n\tfunction handleClick( event ) {\n\t\tif ( onToggle ) {\n\t\t\tonToggle( event );\n\t\t}\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Wrapper\n\t\t\t__next40pxDefaultSize={ toggleProps.as ? undefined : true }\n\t\t\ticon={ plus }\n\t\t\tlabel={ label }\n\t\t\ttooltipPosition=\"bottom\"\n\t\t\tonClick={ handleClick }\n\t\t\tclassName=\"block-editor-inserter__toggle\"\n\t\t\taria-haspopup={ ! hasSingleBlockType ? 'true' : false }\n\t\t\taria-expanded={ ! hasSingleBlockType ? isOpen : false }\n\t\t\tdisabled={ disabled }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n};\n\nclass Inserter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onToggle = this.onToggle.bind( this );\n\t\tthis.renderToggle = this.renderToggle.bind( this );\n\t\tthis.renderContent = this.renderContent.bind( this );\n\t}\n\n\tonToggle( isOpen ) {\n\t\tconst { onToggle } = this.props;\n\n\t\t// Surface toggle callback to parent component.\n\t\tif ( onToggle ) {\n\t\t\tonToggle( isOpen );\n\t\t}\n\t}\n\n\t/**\n\t * Render callback to display Dropdown toggle element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onToggle Callback to invoke when toggle is\n\t * pressed.\n\t * @param {boolean} options.isOpen Whether dropdown is currently open.\n\t *\n\t * @return {Element} Dropdown toggle element.\n\t */\n\trenderToggle( { onToggle, isOpen } ) {\n\t\tconst {\n\t\t\tdisabled,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\ttoggleProps,\n\t\t\thasItems,\n\t\t\trenderToggle = defaultRenderToggle,\n\t\t} = this.props;\n\n\t\treturn renderToggle( {\n\t\t\tonToggle,\n\t\t\tisOpen,\n\t\t\tdisabled: disabled || ! hasItems,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\ttoggleProps,\n\t\t} );\n\t}\n\n\t/**\n\t * Render callback to display Dropdown content element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onClose Callback to invoke when dropdown is\n\t * closed.\n\t *\n\t * @return {Element} Dropdown content element.\n\t */\n\trenderContent( { onClose } ) {\n\t\tconst {\n\t\t\trootClientId,\n\t\t\tclientId,\n\t\t\tisAppender,\n\t\t\tshowInserterHelpPanel,\n\n\t\t\t// This prop is experimental to give some time for the quick inserter to mature\n\t\t\t// Feel free to make them stable after a few releases.\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t\tselectBlockOnInsert,\n\t\t} = this.props;\n\n\t\tif ( isQuick ) {\n\t\t\treturn (\n\t\t\t\t<QuickInserter\n\t\t\t\t\tonSelect={ ( blocks ) => {\n\t\t\t\t\t\tconst firstBlock =\n\t\t\t\t\t\t\tArray.isArray( blocks ) && blocks?.length\n\t\t\t\t\t\t\t\t? blocks[ 0 ]\n\t\t\t\t\t\t\t\t: blocks;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tonSelectOrClose &&\n\t\t\t\t\t\t\ttypeof onSelectOrClose === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonSelectOrClose( firstBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisAppender={ isAppender }\n\t\t\t\t\tselectBlockOnInsert={ selectBlockOnInsert }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<InserterMenu\n\t\t\t\tonSelect={ () => {\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisAppender={ isAppender }\n\t\t\t\tshowInserterHelpPanel={ showInserterHelpPanel }\n\t\t\t/>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tposition,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\tinsertOnlyAllowedBlock,\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t} = this.props;\n\n\t\tif ( hasSingleBlockType || directInsertBlock ) {\n\t\t\treturn this.renderToggle( { onToggle: insertOnlyAllowedBlock } );\n\t\t}\n\n\t\treturn (\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"block-editor-inserter\"\n\t\t\t\tcontentClassName={ clsx( 'block-editor-inserter__popover', {\n\t\t\t\t\t'is-quick': isQuick,\n\t\t\t\t} ) }\n\t\t\t\tpopoverProps={ { position, shift: true } }\n\t\t\t\tonToggle={ this.onToggle }\n\t\t\t\texpandOnMobile\n\t\t\t\theaderTitle={ __( 'Add a block' ) }\n\t\t\t\trenderToggle={ this.renderToggle }\n\t\t\t\trenderContent={ this.renderContent }\n\t\t\t\tonClose={ onSelectOrClose }\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect(\n\t\t( select, { clientId, rootClientId, shouldDirectInsert = true } ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasInserterItems,\n\t\t\t\tgetAllowedBlocks,\n\t\t\t\tgetDirectInsertBlock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst { getBlockVariations } = select( blocksStore );\n\n\t\t\trootClientId =\n\t\t\t\trootClientId || getBlockRootClientId( clientId ) || undefined;\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( rootClientId );\n\n\t\t\tconst directInsertBlock =\n\t\t\t\tshouldDirectInsert && getDirectInsertBlock( rootClientId );\n\n\t\t\tconst hasSingleBlockType =\n\t\t\t\tallowedBlocks?.length === 1 &&\n\t\t\t\tgetBlockVariations( allowedBlocks[ 0 ].name, 'inserter' )\n\t\t\t\t\t?.length === 0;\n\n\t\t\tlet allowedBlockType = false;\n\t\t\tif ( hasSingleBlockType ) {\n\t\t\t\tallowedBlockType = allowedBlocks[ 0 ];\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasItems: hasInserterItems( rootClientId ),\n\t\t\t\thasSingleBlockType,\n\t\t\t\tblockTitle: allowedBlockType ? allowedBlockType.title : '',\n\t\t\t\tallowedBlockType,\n\t\t\t\tdirectInsertBlock,\n\t\t\t\trootClientId,\n\t\t\t};\n\t\t}\n\t),\n\twithDispatch( ( dispatch, ownProps, { select } ) => {\n\t\treturn {\n\t\t\tinsertOnlyAllowedBlock() {\n\t\t\t\tconst {\n\t\t\t\t\trootClientId,\n\t\t\t\t\tclientId,\n\t\t\t\t\tisAppender,\n\t\t\t\t\thasSingleBlockType,\n\t\t\t\t\tallowedBlockType,\n\t\t\t\t\tdirectInsertBlock,\n\t\t\t\t\tonSelectOrClose,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t} = ownProps;\n\n\t\t\t\tif ( ! hasSingleBlockType && ! directInsertBlock ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfunction getAdjacentBlockAttributes( attributesToCopy ) {\n\t\t\t\t\tconst { getBlock, getPreviousBlockClientId } =\n\t\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! attributesToCopy ||\n\t\t\t\t\t\t( ! clientId && ! rootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = {};\n\t\t\t\t\tlet adjacentAttributes = {};\n\n\t\t\t\t\t// If there is no clientId, then attempt to get attributes\n\t\t\t\t\t// from the last block within innerBlocks of the root block.\n\t\t\t\t\tif ( ! clientId ) {\n\t\t\t\t\t\tconst parentBlock = getBlock( rootClientId );\n\n\t\t\t\t\t\tif ( parentBlock?.innerBlocks?.length ) {\n\t\t\t\t\t\t\tconst lastInnerBlock =\n\t\t\t\t\t\t\t\tparentBlock.innerBlocks[\n\t\t\t\t\t\t\t\t\tparentBlock.innerBlocks.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdirectInsertBlock &&\n\t\t\t\t\t\t\t\tdirectInsertBlock?.name === lastInnerBlock.name\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tadjacentAttributes = lastInnerBlock.attributes;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Otherwise, attempt to get attributes from the\n\t\t\t\t\t\t// previous block relative to the current clientId.\n\t\t\t\t\t\tconst currentBlock = getBlock( clientId );\n\t\t\t\t\t\tconst previousBlock = getBlock(\n\t\t\t\t\t\t\tgetPreviousBlockClientId( clientId )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( currentBlock?.name === previousBlock?.name ) {\n\t\t\t\t\t\t\tadjacentAttributes =\n\t\t\t\t\t\t\t\tpreviousBlock?.attributes || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Copy over only those attributes flagged to be copied.\n\t\t\t\t\tattributesToCopy.forEach( ( attribute ) => {\n\t\t\t\t\t\tif ( adjacentAttributes.hasOwnProperty( attribute ) ) {\n\t\t\t\t\t\t\tresult[ attribute ] =\n\t\t\t\t\t\t\t\tadjacentAttributes[ attribute ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tfunction getInsertionIndex() {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\t} = select( blockEditorStore );\n\n\t\t\t\t\t// If the clientId is defined, we insert at the position of the block.\n\t\t\t\t\tif ( clientId ) {\n\t\t\t\t\t\treturn getBlockIndex( clientId );\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there a selected block, we insert after the selected block.\n\t\t\t\t\tconst end = getBlockSelectionEnd();\n\t\t\t\t\tif (\n\t\t\t\t\t\t! isAppender &&\n\t\t\t\t\t\tend &&\n\t\t\t\t\t\tgetBlockRootClientId( end ) === rootClientId\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn getBlockIndex( end ) + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise, we insert at the end of the current rootClientId.\n\t\t\t\t\treturn getBlockOrder( rootClientId ).length;\n\t\t\t\t}\n\n\t\t\t\tconst { insertBlock } = dispatch( blockEditorStore );\n\n\t\t\t\tlet blockToInsert;\n\n\t\t\t\t// Attempt to augment the directInsertBlock with attributes from an adjacent block.\n\t\t\t\t// This ensures styling from nearby blocks is preserved in the newly inserted block.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/37904\n\t\t\t\tif ( directInsertBlock ) {\n\t\t\t\t\tconst newAttributes = getAdjacentBlockAttributes(\n\t\t\t\t\t\tdirectInsertBlock.attributesToCopy\n\t\t\t\t\t);\n\n\t\t\t\t\tblockToInsert = createBlock( directInsertBlock.name, {\n\t\t\t\t\t\t...( directInsertBlock.attributes || {} ),\n\t\t\t\t\t\t...newAttributes,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tblockToInsert = createBlock( allowedBlockType.name );\n\t\t\t\t}\n\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblockToInsert,\n\t\t\t\t\tgetInsertionIndex(),\n\t\t\t\t\trootClientId,\n\t\t\t\t\tselectBlockOnInsert\n\t\t\t\t);\n\n\t\t\t\tif ( onSelectOrClose ) {\n\t\t\t\t\tonSelectOrClose( {\n\t\t\t\t\t\tclientId: blockToInsert?.clientId,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tconst message = sprintf(\n\t\t\t\t\t// translators: %s: the name of the block that has been added\n\t\t\t\t\t__( '%s block added' ),\n\t\t\t\t\tallowedBlockType.title\n\t\t\t\t);\n\t\t\t\tspeak( message );\n\t\t\t},\n\t\t};\n\t} ),\n\t// The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as\n\t// a way to detect the global Inserter.\n\tifCondition(\n\t\t( { hasItems, isAppender, rootClientId, clientId } ) =>\n\t\t\thasItems || ( ! isAppender && ! rootClientId && ! clientId )\n\t),\n] )( Inserter );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAKA,IAAAS,KAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAwD,IAAAY,WAAA,GAAAZ,OAAA;AAtBxD;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAKA,MAAMa,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,kBAAkB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,CAAE,CAAC;MACJ,CAAC,MAAM;QACND,aAAa,GAAG,IAAAE,mBAAW,EAAE5B,gBAAgB,CAACD,IAAK,CAAC;MACrD;MAEA0B,WAAW,CACVC,aAAa,EACbN,iBAAiB,CAAC,CAAC,EACnB7D,YAAY,EACZO,mBACD,CAAC;MAED,IAAKD,eAAe,EAAG;QACtBA,eAAe,CAAE;UAChBL,QAAQ,EAAEkE,aAAa,EAAElE;QAC1B,CAAE,CAAC;MACJ;MAEA,MAAMqE,OAAO,GAAG,IAAA5F,aAAO;MACtB;MACA,IAAA+C,QAAE,EAAE,gBAAiB,CAAC,EACtBgB,gBAAgB,CAACC,KAClB,CAAC;MACD,IAAA6B,WAAK,EAAED,OAAQ,CAAC;IACjB;EACD,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACA,IAAAE,oBAAW,EACV,CAAE;EAAE1E,QAAQ;EAAEI,UAAU;EAAEF,YAAY;EAAEC;AAAS,CAAC,KACjDH,QAAQ,IAAM,CAAEI,UAAU,IAAI,CAAEF,YAAY,IAAI,CAAEC,QACpD,CAAC,CACA,CAAC,CAAEZ,QAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_a11y","_i18n","_components","_element","_data","_compose","_blocks","_icons","_menu","_quickInserter","_store","_jsxRuntime","defaultRenderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","toggleProps","as","Wrapper","Button","label","labelProp","onClick","rest","sprintf","_x","handleClick","event","jsx","__next40pxDefaultSize","undefined","icon","plus","tooltipPosition","className","Inserter","Component","constructor","arguments","bind","renderToggle","renderContent","props","directInsertBlock","hasItems","onClose","rootClientId","clientId","isAppender","showInserterHelpPanel","__experimentalIsQuick","isQuick","onSelectOrClose","selectBlockOnInsert","default","onSelect","blocks","firstBlock","Array","isArray","length","render","position","insertOnlyAllowedBlock","Dropdown","contentClassName","clsx","popoverProps","shift","expandOnMobile","headerTitle","__","_default","exports","compose","withSelect","select","shouldDirectInsert","getBlockRootClientId","hasInserterItems","getAllowedBlocks","getDirectInsertBlock","blockEditorStore","getBlockVariations","blocksStore","allowedBlocks","name","allowedBlockType","title","withDispatch","dispatch","ownProps","getAdjacentBlockAttributes","attributesToCopy","getBlock","getPreviousBlockClientId","result","adjacentAttributes","parentBlock","innerBlocks","lastInnerBlock","attributes","currentBlock","previousBlock","forEach","attribute","hasOwnProperty","getInsertionIndex","getBlockIndex","getBlockSelectionEnd","getBlockOrder","end","insertBlock","blockToInsert","newAttributes","createBlock","message","speak","ifCondition"],"sources":["@wordpress/block-editor/src/components/inserter/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport InserterMenu from './menu';\nimport QuickInserter from './quick-inserter';\nimport { store as blockEditorStore } from '../../store';\n\nconst defaultRenderToggle = ( {\n\tonToggle,\n\tdisabled,\n\tisOpen,\n\tblockTitle,\n\thasSingleBlockType,\n\ttoggleProps = {},\n} ) => {\n\tconst {\n\t\tas: Wrapper = Button,\n\t\tlabel: labelProp,\n\t\tonClick,\n\t\t...rest\n\t} = toggleProps;\n\n\tlet label = labelProp;\n\tif ( ! label && hasSingleBlockType ) {\n\t\tlabel = sprintf(\n\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t_x( 'Add %s', 'directly add the only allowed block' ),\n\t\t\tblockTitle\n\t\t);\n\t} else if ( ! label ) {\n\t\tlabel = _x( 'Add block', 'Generic label for block inserter button' );\n\t}\n\n\t// Handle both onClick functions from the toggle and the parent component.\n\tfunction handleClick( event ) {\n\t\tif ( onToggle ) {\n\t\t\tonToggle( event );\n\t\t}\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Wrapper\n\t\t\t__next40pxDefaultSize={ toggleProps.as ? undefined : true }\n\t\t\ticon={ plus }\n\t\t\tlabel={ label }\n\t\t\ttooltipPosition=\"bottom\"\n\t\t\tonClick={ handleClick }\n\t\t\tclassName=\"block-editor-inserter__toggle\"\n\t\t\taria-haspopup={ ! hasSingleBlockType ? 'true' : false }\n\t\t\taria-expanded={ ! hasSingleBlockType ? isOpen : false }\n\t\t\tdisabled={ disabled }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n};\n\nclass Inserter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onToggle = this.onToggle.bind( this );\n\t\tthis.renderToggle = this.renderToggle.bind( this );\n\t\tthis.renderContent = this.renderContent.bind( this );\n\t}\n\n\tonToggle( isOpen ) {\n\t\tconst { onToggle } = this.props;\n\n\t\t// Surface toggle callback to parent component.\n\t\tif ( onToggle ) {\n\t\t\tonToggle( isOpen );\n\t\t}\n\t}\n\n\t/**\n\t * Render callback to display Dropdown toggle element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onToggle Callback to invoke when toggle is\n\t * pressed.\n\t * @param {boolean} options.isOpen Whether dropdown is currently open.\n\t *\n\t * @return {Element} Dropdown toggle element.\n\t */\n\trenderToggle( { onToggle, isOpen } ) {\n\t\tconst {\n\t\t\tdisabled,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\ttoggleProps,\n\t\t\thasItems,\n\t\t\trenderToggle = defaultRenderToggle,\n\t\t} = this.props;\n\n\t\treturn renderToggle( {\n\t\t\tonToggle,\n\t\t\tisOpen,\n\t\t\tdisabled: disabled || ! hasItems,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\ttoggleProps,\n\t\t} );\n\t}\n\n\t/**\n\t * Render callback to display Dropdown content element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onClose Callback to invoke when dropdown is\n\t * closed.\n\t *\n\t * @return {Element} Dropdown content element.\n\t */\n\trenderContent( { onClose } ) {\n\t\tconst {\n\t\t\trootClientId,\n\t\t\tclientId,\n\t\t\tisAppender,\n\t\t\tshowInserterHelpPanel,\n\n\t\t\t// This prop is experimental to give some time for the quick inserter to mature\n\t\t\t// Feel free to make them stable after a few releases.\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t\tselectBlockOnInsert,\n\t\t} = this.props;\n\n\t\tif ( isQuick ) {\n\t\t\treturn (\n\t\t\t\t<QuickInserter\n\t\t\t\t\tonSelect={ ( blocks ) => {\n\t\t\t\t\t\tconst firstBlock =\n\t\t\t\t\t\t\tArray.isArray( blocks ) && blocks?.length\n\t\t\t\t\t\t\t\t? blocks[ 0 ]\n\t\t\t\t\t\t\t\t: blocks;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tonSelectOrClose &&\n\t\t\t\t\t\t\ttypeof onSelectOrClose === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonSelectOrClose( firstBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisAppender={ isAppender }\n\t\t\t\t\tselectBlockOnInsert={ selectBlockOnInsert }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<InserterMenu\n\t\t\t\tonSelect={ () => {\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisAppender={ isAppender }\n\t\t\t\tshowInserterHelpPanel={ showInserterHelpPanel }\n\t\t\t/>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tposition,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\tinsertOnlyAllowedBlock,\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t} = this.props;\n\n\t\tif ( hasSingleBlockType || directInsertBlock ) {\n\t\t\treturn this.renderToggle( { onToggle: insertOnlyAllowedBlock } );\n\t\t}\n\n\t\treturn (\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"block-editor-inserter\"\n\t\t\t\tcontentClassName={ clsx( 'block-editor-inserter__popover', {\n\t\t\t\t\t'is-quick': isQuick,\n\t\t\t\t} ) }\n\t\t\t\tpopoverProps={ { position, shift: true } }\n\t\t\t\tonToggle={ this.onToggle }\n\t\t\t\texpandOnMobile\n\t\t\t\theaderTitle={ __( 'Add a block' ) }\n\t\t\t\trenderToggle={ this.renderToggle }\n\t\t\t\trenderContent={ this.renderContent }\n\t\t\t\tonClose={ onSelectOrClose }\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect(\n\t\t( select, { clientId, rootClientId, shouldDirectInsert = true } ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasInserterItems,\n\t\t\t\tgetAllowedBlocks,\n\t\t\t\tgetDirectInsertBlock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst { getBlockVariations } = select( blocksStore );\n\n\t\t\trootClientId =\n\t\t\t\trootClientId || getBlockRootClientId( clientId ) || undefined;\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( rootClientId );\n\n\t\t\tconst directInsertBlock =\n\t\t\t\tshouldDirectInsert && getDirectInsertBlock( rootClientId );\n\n\t\t\tconst hasSingleBlockType =\n\t\t\t\tallowedBlocks?.length === 1 &&\n\t\t\t\tgetBlockVariations( allowedBlocks[ 0 ].name, 'inserter' )\n\t\t\t\t\t?.length === 0;\n\n\t\t\tlet allowedBlockType = false;\n\t\t\tif ( hasSingleBlockType ) {\n\t\t\t\tallowedBlockType = allowedBlocks[ 0 ];\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasItems: hasInserterItems( rootClientId ),\n\t\t\t\thasSingleBlockType,\n\t\t\t\tblockTitle: allowedBlockType ? allowedBlockType.title : '',\n\t\t\t\tallowedBlockType,\n\t\t\t\tdirectInsertBlock,\n\t\t\t\trootClientId,\n\t\t\t};\n\t\t}\n\t),\n\twithDispatch( ( dispatch, ownProps, { select } ) => {\n\t\treturn {\n\t\t\tinsertOnlyAllowedBlock() {\n\t\t\t\tconst {\n\t\t\t\t\trootClientId,\n\t\t\t\t\tclientId,\n\t\t\t\t\tisAppender,\n\t\t\t\t\thasSingleBlockType,\n\t\t\t\t\tallowedBlockType,\n\t\t\t\t\tdirectInsertBlock,\n\t\t\t\t\tonSelectOrClose,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t} = ownProps;\n\n\t\t\t\tif ( ! hasSingleBlockType && ! directInsertBlock ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfunction getAdjacentBlockAttributes( attributesToCopy ) {\n\t\t\t\t\tconst { getBlock, getPreviousBlockClientId } =\n\t\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! attributesToCopy ||\n\t\t\t\t\t\t( ! clientId && ! rootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = {};\n\t\t\t\t\tlet adjacentAttributes = {};\n\n\t\t\t\t\t// If there is no clientId, then attempt to get attributes\n\t\t\t\t\t// from the last block within innerBlocks of the root block.\n\t\t\t\t\tif ( ! clientId ) {\n\t\t\t\t\t\tconst parentBlock = getBlock( rootClientId );\n\n\t\t\t\t\t\tif ( parentBlock?.innerBlocks?.length ) {\n\t\t\t\t\t\t\tconst lastInnerBlock =\n\t\t\t\t\t\t\t\tparentBlock.innerBlocks[\n\t\t\t\t\t\t\t\t\tparentBlock.innerBlocks.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdirectInsertBlock &&\n\t\t\t\t\t\t\t\tdirectInsertBlock?.name === lastInnerBlock.name\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tadjacentAttributes = lastInnerBlock.attributes;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Otherwise, attempt to get attributes from the\n\t\t\t\t\t\t// previous block relative to the current clientId.\n\t\t\t\t\t\tconst currentBlock = getBlock( clientId );\n\t\t\t\t\t\tconst previousBlock = getBlock(\n\t\t\t\t\t\t\tgetPreviousBlockClientId( clientId )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( currentBlock?.name === previousBlock?.name ) {\n\t\t\t\t\t\t\tadjacentAttributes =\n\t\t\t\t\t\t\t\tpreviousBlock?.attributes || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Copy over only those attributes flagged to be copied.\n\t\t\t\t\tattributesToCopy.forEach( ( attribute ) => {\n\t\t\t\t\t\tif ( adjacentAttributes.hasOwnProperty( attribute ) ) {\n\t\t\t\t\t\t\tresult[ attribute ] =\n\t\t\t\t\t\t\t\tadjacentAttributes[ attribute ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tfunction getInsertionIndex() {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\t} = select( blockEditorStore );\n\n\t\t\t\t\t// If the clientId is defined, we insert at the position of the block.\n\t\t\t\t\tif ( clientId ) {\n\t\t\t\t\t\treturn getBlockIndex( clientId );\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there a selected block, we insert after the selected block.\n\t\t\t\t\tconst end = getBlockSelectionEnd();\n\t\t\t\t\tif (\n\t\t\t\t\t\t! isAppender &&\n\t\t\t\t\t\tend &&\n\t\t\t\t\t\tgetBlockRootClientId( end ) === rootClientId\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn getBlockIndex( end ) + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise, we insert at the end of the current rootClientId.\n\t\t\t\t\treturn getBlockOrder( rootClientId ).length;\n\t\t\t\t}\n\n\t\t\t\tconst { insertBlock } = dispatch( blockEditorStore );\n\n\t\t\t\tlet blockToInsert;\n\n\t\t\t\t// Attempt to augment the directInsertBlock with attributes from an adjacent block.\n\t\t\t\t// This ensures styling from nearby blocks is preserved in the newly inserted block.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/37904\n\t\t\t\tif ( directInsertBlock ) {\n\t\t\t\t\tconst newAttributes = getAdjacentBlockAttributes(\n\t\t\t\t\t\tdirectInsertBlock.attributesToCopy\n\t\t\t\t\t);\n\n\t\t\t\t\tblockToInsert = createBlock( directInsertBlock.name, {\n\t\t\t\t\t\t...( directInsertBlock.attributes || {} ),\n\t\t\t\t\t\t...newAttributes,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tblockToInsert = createBlock( allowedBlockType.name );\n\t\t\t\t}\n\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblockToInsert,\n\t\t\t\t\tgetInsertionIndex(),\n\t\t\t\t\trootClientId,\n\t\t\t\t\tselectBlockOnInsert\n\t\t\t\t);\n\n\t\t\t\tif ( onSelectOrClose ) {\n\t\t\t\t\tonSelectOrClose( blockToInsert );\n\t\t\t\t}\n\n\t\t\t\tconst message = sprintf(\n\t\t\t\t\t// translators: %s: the name of the block that has been added\n\t\t\t\t\t__( '%s block added' ),\n\t\t\t\t\tallowedBlockType.title\n\t\t\t\t);\n\t\t\t\tspeak( message );\n\t\t\t},\n\t\t};\n\t} ),\n\t// The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as\n\t// a way to detect the global Inserter.\n\tifCondition(\n\t\t( { hasItems, isAppender, rootClientId, clientId } ) =>\n\t\t\thasItems || ( ! isAppender && ! rootClientId && ! clientId )\n\t),\n] )( Inserter );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAKA,IAAAS,KAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAwD,IAAAY,WAAA,GAAAZ,OAAA;AAtBxD;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAKA,MAAMa,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,kBAAkB;EAClBC,WAAW,GAAG,CAAC;AAChB,CAAC,KAAM;EACN,MAAM;IACLC,EAAE,EAAEC,OAAO,GAAGC,kBAAM;IACpBC,KAAK,EAAEC,SAAS;IAChBC,OAAO;IACP,GAAGC;EACJ,CAAC,GAAGP,WAAW;EAEf,IAAII,KAAK,GAAGC,SAAS;EACrB,IAAK,CAAED,KAAK,IAAIL,kBAAkB,EAAG;IACpCK,KAAK,GAAG,IAAAI,aAAO;IACd;IACA,IAAAC,QAAE,EAAE,QAAQ,EAAE,qCAAsC,CAAC,EACrDX,UACD,CAAC;EACF,CAAC,MAAM,IAAK,CAAEM,KAAK,EAAG;IACrBA,KAAK,GAAG,IAAAK,QAAE,EAAE,WAAW,EAAE,yCAA0C,CAAC;EACrE;;EAEA;EACA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AAE;EAAE1E,QAAQ;EAAEI,UAAU;EAAEF,YAAY;EAAEC;AAAS,CAAC,KACjDH,QAAQ,IAAM,CAAEI,UAAU,IAAI,CAAEF,YAAY,IAAI,CAAEC,QACpD,CAAC,CACA,CAAC,CAAEZ,QAAS,CAAC","ignoreList":[]}
@@ -36,12 +36,22 @@ const Appender = exports.Appender = (0, _element.forwardRef)(({
36
36
  setInsertedBlock
37
37
  } = (0, _context.useListViewContext)();
38
38
  const instanceId = (0, _compose.useInstanceId)(Appender);
39
- const hideInserter = (0, _data.useSelect)(select => {
39
+ const {
40
+ directInsert,
41
+ hideInserter
42
+ } = (0, _data.useSelect)(select => {
40
43
  const {
44
+ getBlockListSettings,
41
45
  getTemplateLock,
42
46
  isZoomOut
43
47
  } = (0, _lockUnlock.unlock)(select(_store.store));
44
- return !!getTemplateLock(clientId) || isZoomOut();
48
+ const settings = getBlockListSettings(clientId);
49
+ const directInsertValue = settings?.directInsert || false;
50
+ const hideInserterValue = !!getTemplateLock(clientId) || isZoomOut();
51
+ return {
52
+ directInsert: directInsertValue,
53
+ hideInserter: hideInserterValue
54
+ };
45
55
  }, [clientId]);
46
56
  const blockTitle = (0, _useBlockDisplayTitle.default)({
47
57
  clientId,
@@ -73,7 +83,7 @@ const Appender = exports.Appender = (0, _element.forwardRef)(({
73
83
  position: "bottom right",
74
84
  isAppender: true,
75
85
  selectBlockOnInsert: false,
76
- shouldDirectInsert: false,
86
+ shouldDirectInsert: directInsert,
77
87
  __experimentalIsQuick: true,
78
88
  ...props,
79
89
  toggleProps: {
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_a11y","_data","_element","_i18n","_store","_useBlockDisplayTitle","_interopRequireDefault","_context","_inserter","_ariaReferencedText","_lockUnlock","_jsxRuntime","Appender","exports","forwardRef","nestingLevel","blockCount","clientId","props","ref","insertedBlock","setInsertedBlock","useListViewContext","instanceId","useInstanceId","hideInserter","useSelect","select","getTemplateLock","isZoomOut","unlock","blockEditorStore","blockTitle","useBlockDisplayTitle","context","insertedBlockTitle","useEffect","length","speak","sprintf","__","descriptionId","description","jsxs","className","children","jsx","default","rootClientId","position","isAppender","selectBlockOnInsert","shouldDirectInsert","__experimentalIsQuick","toggleProps","onSelectOrClose","maybeInsertedBlock","id"],"sources":["@wordpress/block-editor/src/components/list-view/appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { useListViewContext } from './context';\nimport Inserter from '../inserter';\nimport AriaReferencedText from './aria-referenced-text';\nimport { unlock } from '../../lock-unlock';\n\nexport const Appender = forwardRef(\n\t( { nestingLevel, blockCount, clientId, ...props }, ref ) => {\n\t\tconst { insertedBlock, setInsertedBlock } = useListViewContext();\n\n\t\tconst instanceId = useInstanceId( Appender );\n\t\tconst hideInserter = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getTemplateLock, isZoomOut } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\n\t\t\t\treturn !! getTemplateLock( clientId ) || isZoomOut();\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\t\tconst blockTitle = useBlockDisplayTitle( {\n\t\t\tclientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tconst insertedBlockTitle = useBlockDisplayTitle( {\n\t\t\tclientId: insertedBlock?.clientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! insertedBlockTitle?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)\n\t\t\t\t\t__( '%s block inserted' ),\n\t\t\t\t\tinsertedBlockTitle\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}, [ insertedBlockTitle ] );\n\n\t\tif ( hideInserter ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst descriptionId = `list-view-appender__${ instanceId }`;\n\t\tconst description = sprintf(\n\t\t\t/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */\n\t\t\t__( 'Append to %1$s block at position %2$d, Level %3$d' ),\n\t\t\tblockTitle,\n\t\t\tblockCount + 1,\n\t\t\tnestingLevel\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"list-view-appender\">\n\t\t\t\t<Inserter\n\t\t\t\t\tref={ ref }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\tisAppender\n\t\t\t\t\tselectBlockOnInsert={ false }\n\t\t\t\t\tshouldDirectInsert={ false }\n\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t{ ...props }\n\t\t\t\t\ttoggleProps={ { 'aria-describedby': descriptionId } }\n\t\t\t\t\tonSelectOrClose={ ( maybeInsertedBlock ) => {\n\t\t\t\t\t\tif ( maybeInsertedBlock?.clientId ) {\n\t\t\t\t\t\t\tsetInsertedBlock( maybeInsertedBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</AriaReferencedText>\n\t\t\t</div>\n\t\t);\n\t}\n);\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAC,sBAAA,CAAAP,O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,CAAC,EACD,WACD,CAAC;EACF,CAAC,EAAE,CAAEA,kBAAkB,CAAG,CAAC;EAE3B,IAAKV,YAAY,EAAG;IACnB,OAAO,IAAI;EACZ;EAEA,MAAMgB,aAAa,GAAG,uBAAwBlB,UAAU,EAAG;EAC3D,MAAMmB,WAAW,GAAG,IAAAH,aAAO,EAC1B;EACA,IAAAC,QAAE,EAAE,mDAAoD,CAAC,EACzDR,UAAU,EACVhB,UAAU,GAAG,CAAC,EACdD,YACD,CAAC;EAED,oBACC,IAAAJ,WAAA,CAAAgC,IAAA;IAAKC,SAAS,EAAC,oBAAoB;IAAAC,QAAA,gBAClC,IAAAlC,WAAA,CAAAmC,GAAA,EAACtC,SAAA,CAAAuC,OAAQ;MACR5B,GAAG,EAAGA,GAAK;MACX6B,YAAY,EAAG/B,QAAU;MACzBgC,QAAQ,EAAC,cAAc;MACvBC,UAAU;MACVC,mBAAmB,EAAG,KAAO;MAC7BC,kBAAkB,EAAG,KAAO;MAC5BC,qBAAqB;MAAA,GAChBnC,KAAK;MACVoC,WAAW,EAAG;QAAE,kBAAkB,EAAEb;MAAc,CAAG;MACrDc,eAAe,EAAKC,kBAAkB,IAAM;QAC3C,IAAKA,kBAAkB,EAAEvC,QAAQ,EAAG;UACnCI,gBAAgB,CAAEmC,kBAAmB,CAAC;QACvC;MACD;IAAG,CACH,CAAC,eACF,IAAA7C,WAAA,CAAAmC,GAAA,EAACrC,mBAAA,CAAAsC,OAAkB;MAACU,EAAE,EAAGhB,aAAe;MAAAI,QAAA,EACrCH;IAAW,CACM,CAAC;EAAA,CACjB,CAAC;AAER,CACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_a11y","_data","_element","_i18n","_store","_useBlockDisplayTitle","_interopRequireDefault","_context","_inserter","_ariaReferencedText","_lockUnlock","_jsxRuntime","Appender","exports","forwardRef","nestingLevel","blockCount","clientId","props","ref","insertedBlock","setInsertedBlock","useListViewContext","instanceId","useInstanceId","directInsert","hideInserter","useSelect","select","getBlockListSettings","getTemplateLock","isZoomOut","unlock","blockEditorStore","settings","directInsertValue","hideInserterValue","blockTitle","useBlockDisplayTitle","context","insertedBlockTitle","useEffect","length","speak","sprintf","__","descriptionId","description","jsxs","className","children","jsx","default","rootClientId","position","isAppender","selectBlockOnInsert","shouldDirectInsert","__experimentalIsQuick","toggleProps","onSelectOrClose","maybeInsertedBlock","id"],"sources":["@wordpress/block-editor/src/components/list-view/appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { useListViewContext } from './context';\nimport Inserter from '../inserter';\nimport AriaReferencedText from './aria-referenced-text';\nimport { unlock } from '../../lock-unlock';\n\nexport const Appender = forwardRef(\n\t( { nestingLevel, blockCount, clientId, ...props }, ref ) => {\n\t\tconst { insertedBlock, setInsertedBlock } = useListViewContext();\n\n\t\tconst instanceId = useInstanceId( Appender );\n\t\tconst { directInsert, hideInserter } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getBlockListSettings, getTemplateLock, isZoomOut } =\n\t\t\t\t\tunlock( select( blockEditorStore ) );\n\n\t\t\t\tconst settings = getBlockListSettings( clientId );\n\t\t\t\tconst directInsertValue = settings?.directInsert || false;\n\t\t\t\tconst hideInserterValue =\n\t\t\t\t\t!! getTemplateLock( clientId ) || isZoomOut();\n\n\t\t\t\treturn {\n\t\t\t\t\tdirectInsert: directInsertValue,\n\t\t\t\t\thideInserter: hideInserterValue,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\t\tconst blockTitle = useBlockDisplayTitle( {\n\t\t\tclientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tconst insertedBlockTitle = useBlockDisplayTitle( {\n\t\t\tclientId: insertedBlock?.clientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! insertedBlockTitle?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)\n\t\t\t\t\t__( '%s block inserted' ),\n\t\t\t\t\tinsertedBlockTitle\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}, [ insertedBlockTitle ] );\n\n\t\tif ( hideInserter ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst descriptionId = `list-view-appender__${ instanceId }`;\n\t\tconst description = sprintf(\n\t\t\t/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */\n\t\t\t__( 'Append to %1$s block at position %2$d, Level %3$d' ),\n\t\t\tblockTitle,\n\t\t\tblockCount + 1,\n\t\t\tnestingLevel\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"list-view-appender\">\n\t\t\t\t<Inserter\n\t\t\t\t\tref={ ref }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\tisAppender\n\t\t\t\t\tselectBlockOnInsert={ false }\n\t\t\t\t\tshouldDirectInsert={ directInsert }\n\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t{ ...props }\n\t\t\t\t\ttoggleProps={ { 'aria-describedby': descriptionId } }\n\t\t\t\t\tonSelectOrClose={ ( maybeInsertedBlock ) => {\n\t\t\t\t\t\tif ( maybeInsertedBlock?.clientId ) {\n\t\t\t\t\t\t\tsetInsertedBlock( maybeInsertedBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</AriaReferencedText>\n\t\t\t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Ae,EAAKC,kBAAkB,IAAM;QAC3C,IAAKA,kBAAkB,EAAE5C,QAAQ,EAAG;UACnCI,gBAAgB,CAAEwC,kBAAmB,CAAC;QACvC;MACD;IAAG,CACH,CAAC,eACF,IAAAlD,WAAA,CAAAwC,GAAA,EAAC1C,mBAAA,CAAA2C,OAAkB;MAACU,EAAE,EAAGhB,aAAe;MAAAI,QAAA,EACrCH;IAAW,CACM,CAAC;EAAA,CACjB,CAAC;AAER,CACD,CAAC","ignoreList":[]}
@@ -17,7 +17,8 @@ function usePopoverScroll(contentRef) {
17
17
  function onWheel(event) {
18
18
  const {
19
19
  deltaX,
20
- deltaY
20
+ deltaY,
21
+ target
21
22
  } = event;
22
23
  const contentEl = contentRef.current;
23
24
  let scrollContainer = scrollContainerCache.get(contentEl);
@@ -25,7 +26,15 @@ function usePopoverScroll(contentRef) {
25
26
  scrollContainer = getScrollContainer(contentEl);
26
27
  scrollContainerCache.set(contentEl, scrollContainer);
27
28
  }
28
- scrollContainer.scrollBy(deltaX, deltaY);
29
+ // Finds a scrollable ancestor of the event’s target. It's not cached because the
30
+ // it may not remain scrollable due to popover position changes. The cache is also
31
+ // less likely to be utilized because the target may be different every event.
32
+ const eventScrollContainer = getScrollContainer(target);
33
+ // Scrolls “through” the popover only if another contained scrollable area isn’t
34
+ // in front of it. This is to avoid scrolling both containers simultaneously.
35
+ if (!node.contains(eventScrollContainer)) {
36
+ scrollContainer.scrollBy(deltaX, deltaY);
37
+ }
29
38
  }
30
39
  // Tell the browser that we do not call event.preventDefault
31
40
  // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
@@ -1 +1 @@
1
- {"version":3,"names":["useRefEffect","getScrollContainer","scrollContainerCache","WeakMap","usePopoverScroll","contentRef","effect","node","onWheel","event","deltaX","deltaY","contentEl","current","scrollContainer","get","set","scrollBy","options","passive","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-popover/use-popover-scroll.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\nconst scrollContainerCache = new WeakMap();\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} contentRef\n */\nfunction usePopoverScroll( contentRef ) {\n\tconst effect = useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onWheel( event ) {\n\t\t\t\tconst { deltaX, deltaY } = event;\n\t\t\t\tconst contentEl = contentRef.current;\n\t\t\t\tlet scrollContainer = scrollContainerCache.get( contentEl );\n\t\t\t\tif ( ! scrollContainer ) {\n\t\t\t\t\tscrollContainer = getScrollContainer( contentEl );\n\t\t\t\t\tscrollContainerCache.set( contentEl, scrollContainer );\n\t\t\t\t}\n\t\t\t\tscrollContainer.scrollBy( deltaX, deltaY );\n\t\t\t}\n\t\t\t// Tell the browser that we do not call event.preventDefault\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners\n\t\t\tconst options = { passive: true };\n\t\t\tnode.addEventListener( 'wheel', onWheel, options );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'wheel', onWheel, options );\n\t\t\t};\n\t\t},\n\t\t[ contentRef ]\n\t);\n\treturn contentRef ? effect : null;\n}\n\nexport default usePopoverScroll;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,kBAAkB,QAAQ,gBAAgB;AAEnD,MAAMC,oBAAoB,GAAG,IAAIC,OAAO,CAAC,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAEC,UAAU,EAAG;EACvC,MAAMC,MAAM,GAAGN,YAAY,CACxBO,IAAI,IAAM;IACX,SAASC,OAAOA,CAAEC,KAAK,EAAG;MACzB,MAAM;QAAEC,MAAM;QAAEC;MAAO,CAAC,GAAGF,KAAK;MAChC,MAAMG,SAAS,GAAGP,UAAU,CAACQ,OAAO;MACpC,IAAIC,eAAe,GAAGZ,oBAAoB,CAACa,GAAG,CAAEH,SAAU,CAAC;MAC3D,IAAK,CAAEE,eAAe,EAAG;QACxBA,eAAe,GAAGb,kBAAkB,CAAEW,SAAU,CAAC;QACjDV,oBAAoB,CAACc,GAAG,CAAEJ,SAAS,EAAEE,eAAgB,CAAC;MACvD;MACAA,eAAe,CAACG,QAAQ,CAAEP,MAAM,EAAEC,MAAO,CAAC;IAC3C;IACA;IACA;IACA,MAAMO,OAAO,GAAG;MAAEC,OAAO,EAAE;IAAK,CAAC;IACjCZ,IAAI,CAACa,gBAAgB,CAAE,OAAO,EAAEZ,OAAO,EAAEU,OAAQ,CAAC;IAClD,OAAO,MAAM;MACZX,IAAI,CAACc,mBAAmB,CAAE,OAAO,EAAEb,OAAO,EAAEU,OAAQ,CAAC;IACtD,CAAC;EACF,CAAC,EACD,CAAEb,UAAU,CACb,CAAC;EACD,OAAOA,UAAU,GAAGC,MAAM,GAAG,IAAI;AAClC;AAEA,eAAeF,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["useRefEffect","getScrollContainer","scrollContainerCache","WeakMap","usePopoverScroll","contentRef","effect","node","onWheel","event","deltaX","deltaY","target","contentEl","current","scrollContainer","get","set","eventScrollContainer","contains","scrollBy","options","passive","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-popover/use-popover-scroll.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\nconst scrollContainerCache = new WeakMap();\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} contentRef\n */\nfunction usePopoverScroll( contentRef ) {\n\tconst effect = useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onWheel( event ) {\n\t\t\t\tconst { deltaX, deltaY, target } = event;\n\t\t\t\tconst contentEl = contentRef.current;\n\t\t\t\tlet scrollContainer = scrollContainerCache.get( contentEl );\n\t\t\t\tif ( ! scrollContainer ) {\n\t\t\t\t\tscrollContainer = getScrollContainer( contentEl );\n\t\t\t\t\tscrollContainerCache.set( contentEl, scrollContainer );\n\t\t\t\t}\n\t\t\t\t// Finds a scrollable ancestor of the event’s target. It's not cached because the\n\t\t\t\t// it may not remain scrollable due to popover position changes. The cache is also\n\t\t\t\t// less likely to be utilized because the target may be different every event.\n\t\t\t\tconst eventScrollContainer = getScrollContainer( target );\n\t\t\t\t// Scrolls “through” the popover only if another contained scrollable area isn’t\n\t\t\t\t// in front of it. This is to avoid scrolling both containers simultaneously.\n\t\t\t\tif ( ! node.contains( eventScrollContainer ) ) {\n\t\t\t\t\tscrollContainer.scrollBy( deltaX, deltaY );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Tell the browser that we do not call event.preventDefault\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners\n\t\t\tconst options = { passive: true };\n\t\t\tnode.addEventListener( 'wheel', onWheel, options );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'wheel', onWheel, options );\n\t\t\t};\n\t\t},\n\t\t[ contentRef ]\n\t);\n\treturn contentRef ? effect : null;\n}\n\nexport default usePopoverScroll;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,kBAAkB,QAAQ,gBAAgB;AAEnD,MAAMC,oBAAoB,GAAG,IAAIC,OAAO,CAAC,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAEC,UAAU,EAAG;EACvC,MAAMC,MAAM,GAAGN,YAAY,CACxBO,IAAI,IAAM;IACX,SAASC,OAAOA,CAAEC,KAAK,EAAG;MACzB,MAAM;QAAEC,MAAM;QAAEC,MAAM;QAAEC;MAAO,CAAC,GAAGH,KAAK;MACxC,MAAMI,SAAS,GAAGR,UAAU,CAACS,OAAO;MACpC,IAAIC,eAAe,GAAGb,oBAAoB,CAACc,GAAG,CAAEH,SAAU,CAAC;MAC3D,IAAK,CAAEE,eAAe,EAAG;QACxBA,eAAe,GAAGd,kBAAkB,CAAEY,SAAU,CAAC;QACjDX,oBAAoB,CAACe,GAAG,CAAEJ,SAAS,EAAEE,eAAgB,CAAC;MACvD;MACA;MACA;MACA;MACA,MAAMG,oBAAoB,GAAGjB,kBAAkB,CAAEW,MAAO,CAAC;MACzD;MACA;MACA,IAAK,CAAEL,IAAI,CAACY,QAAQ,CAAED,oBAAqB,CAAC,EAAG;QAC9CH,eAAe,CAACK,QAAQ,CAAEV,MAAM,EAAEC,MAAO,CAAC;MAC3C;IACD;IACA;IACA;IACA,MAAMU,OAAO,GAAG;MAAEC,OAAO,EAAE;IAAK,CAAC;IACjCf,IAAI,CAACgB,gBAAgB,CAAE,OAAO,EAAEf,OAAO,EAAEa,OAAQ,CAAC;IAClD,OAAO,MAAM;MACZd,IAAI,CAACiB,mBAAmB,CAAE,OAAO,EAAEhB,OAAO,EAAEa,OAAQ,CAAC;IACtD,CAAC;EACF,CAAC,EACD,CAAEhB,UAAU,CACb,CAAC;EACD,OAAOA,UAAU,GAAGC,MAAM,GAAG,IAAI;AAClC;AAEA,eAAeF,gBAAgB","ignoreList":[]}
@@ -31,7 +31,7 @@ export function useShowBlockTools() {
31
31
  const block = getBlock(clientId);
32
32
  const editorMode = __unstableGetEditorMode();
33
33
  const hasSelectedBlock = !!clientId && !!block;
34
- const isEmptyDefaultBlock = hasSelectedBlock && isUnmodifiedDefaultBlock(block) && getBlockMode(clientId) !== 'html';
34
+ const isEmptyDefaultBlock = hasSelectedBlock && isUnmodifiedDefaultBlock(block, 'content') && getBlockMode(clientId) !== 'html';
35
35
  const _showEmptyBlockSideInserter = clientId && !isTyping() &&
36
36
  // Hide the block inserter on the navigation mode.
37
37
  // See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","isUnmodifiedDefaultBlock","store","blockEditorStore","unlock","useShowBlockTools","select","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlock","getBlockMode","getSettings","__unstableGetEditorMode","isTyping","isBlockInterfaceHidden","clientId","block","editorMode","hasSelectedBlock","isEmptyDefaultBlock","_showEmptyBlockSideInserter","_showBlockToolbarPopover","hasFixedToolbar","showEmptyBlockSideInserter","showBlockToolbarPopover"],"sources":["@wordpress/block-editor/src/components/block-tools/use-show-block-tools.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Source of truth for which block tools are showing in the block editor.\n *\n * @return {Object} Object of which block tools will be shown.\n */\nexport function useShowBlockTools() {\n\treturn useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetFirstMultiSelectedBlockClientId,\n\t\t\tgetBlock,\n\t\t\tgetBlockMode,\n\t\t\tgetSettings,\n\t\t\t__unstableGetEditorMode,\n\t\t\tisTyping,\n\t\t\tisBlockInterfaceHidden,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst clientId =\n\t\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\t\tconst block = getBlock( clientId );\n\t\tconst editorMode = __unstableGetEditorMode();\n\t\tconst hasSelectedBlock = !! clientId && !! block;\n\t\tconst isEmptyDefaultBlock =\n\t\t\thasSelectedBlock &&\n\t\t\tisUnmodifiedDefaultBlock( block ) &&\n\t\t\tgetBlockMode( clientId ) !== 'html';\n\t\tconst _showEmptyBlockSideInserter =\n\t\t\tclientId &&\n\t\t\t! isTyping() &&\n\t\t\t// Hide the block inserter on the navigation mode.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.\n\t\t\teditorMode !== 'navigation' &&\n\t\t\tisEmptyDefaultBlock;\n\t\tconst _showBlockToolbarPopover =\n\t\t\t! isBlockInterfaceHidden() &&\n\t\t\t! getSettings().hasFixedToolbar &&\n\t\t\t! _showEmptyBlockSideInserter &&\n\t\t\thasSelectedBlock &&\n\t\t\t! isEmptyDefaultBlock;\n\n\t\treturn {\n\t\t\tshowEmptyBlockSideInserter: _showEmptyBlockSideInserter,\n\t\t\tshowBlockToolbarPopover: _showBlockToolbarPopover,\n\t\t};\n\t}, [] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,wBAAwB,QAAQ,mBAAmB;;AAE5D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;;AAE1C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,OAAOL,SAAS,CAAIM,MAAM,IAAM;IAC/B,MAAM;MACLC,wBAAwB;MACxBC,kCAAkC;MAClCC,QAAQ;MACRC,YAAY;MACZC,WAAW;MACXC,uBAAuB;MACvBC,QAAQ;MACRC;IACD,CAAC,GAAGV,MAAM,CAAEE,MAAM,CAAEH,gBAAiB,CAAE,CAAC;IAExC,MAAMY,QAAQ,GACbR,wBAAwB,CAAC,CAAC,IAAIC,kCAAkC,CAAC,CAAC;IAEnE,MAAMQ,KAAK,GAAGP,QAAQ,CAAEM,QAAS,CAAC;IAClC,MAAME,UAAU,GAAGL,uBAAuB,CAAC,CAAC;IAC5C,MAAMM,gBAAgB,GAAG,CAAC,CAAEH,QAAQ,IAAI,CAAC,CAAEC,KAAK;IAChD,MAAMG,mBAAmB,GACxBD,gBAAgB,IAChBjB,wBAAwB,CAAEe,KAAM,CAAC,IACjCN,YAAY,CAAEK,QAAS,CAAC,KAAK,MAAM;IACpC,MAAMK,2BAA2B,GAChCL,QAAQ,IACR,CAAEF,QAAQ,CAAC,CAAC;IACZ;IACA;IACAI,UAAU,KAAK,YAAY,IAC3BE,mBAAmB;IACpB,MAAME,wBAAwB,GAC7B,CAAEP,sBAAsB,CAAC,CAAC,IAC1B,CAAEH,WAAW,CAAC,CAAC,CAACW,eAAe,IAC/B,CAAEF,2BAA2B,IAC7BF,gBAAgB,IAChB,CAAEC,mBAAmB;IAEtB,OAAO;MACNI,0BAA0B,EAAEH,2BAA2B;MACvDI,uBAAuB,EAAEH;IAC1B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","isUnmodifiedDefaultBlock","store","blockEditorStore","unlock","useShowBlockTools","select","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlock","getBlockMode","getSettings","__unstableGetEditorMode","isTyping","isBlockInterfaceHidden","clientId","block","editorMode","hasSelectedBlock","isEmptyDefaultBlock","_showEmptyBlockSideInserter","_showBlockToolbarPopover","hasFixedToolbar","showEmptyBlockSideInserter","showBlockToolbarPopover"],"sources":["@wordpress/block-editor/src/components/block-tools/use-show-block-tools.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Source of truth for which block tools are showing in the block editor.\n *\n * @return {Object} Object of which block tools will be shown.\n */\nexport function useShowBlockTools() {\n\treturn useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetFirstMultiSelectedBlockClientId,\n\t\t\tgetBlock,\n\t\t\tgetBlockMode,\n\t\t\tgetSettings,\n\t\t\t__unstableGetEditorMode,\n\t\t\tisTyping,\n\t\t\tisBlockInterfaceHidden,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst clientId =\n\t\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\t\tconst block = getBlock( clientId );\n\t\tconst editorMode = __unstableGetEditorMode();\n\t\tconst hasSelectedBlock = !! clientId && !! block;\n\t\tconst isEmptyDefaultBlock =\n\t\t\thasSelectedBlock &&\n\t\t\tisUnmodifiedDefaultBlock( block, 'content' ) &&\n\t\t\tgetBlockMode( clientId ) !== 'html';\n\t\tconst _showEmptyBlockSideInserter =\n\t\t\tclientId &&\n\t\t\t! isTyping() &&\n\t\t\t// Hide the block inserter on the navigation mode.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.\n\t\t\teditorMode !== 'navigation' &&\n\t\t\tisEmptyDefaultBlock;\n\t\tconst _showBlockToolbarPopover =\n\t\t\t! isBlockInterfaceHidden() &&\n\t\t\t! getSettings().hasFixedToolbar &&\n\t\t\t! _showEmptyBlockSideInserter &&\n\t\t\thasSelectedBlock &&\n\t\t\t! isEmptyDefaultBlock;\n\n\t\treturn {\n\t\t\tshowEmptyBlockSideInserter: _showEmptyBlockSideInserter,\n\t\t\tshowBlockToolbarPopover: _showBlockToolbarPopover,\n\t\t};\n\t}, [] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,wBAAwB,QAAQ,mBAAmB;;AAE5D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;;AAE1C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,OAAOL,SAAS,CAAIM,MAAM,IAAM;IAC/B,MAAM;MACLC,wBAAwB;MACxBC,kCAAkC;MAClCC,QAAQ;MACRC,YAAY;MACZC,WAAW;MACXC,uBAAuB;MACvBC,QAAQ;MACRC;IACD,CAAC,GAAGV,MAAM,CAAEE,MAAM,CAAEH,gBAAiB,CAAE,CAAC;IAExC,MAAMY,QAAQ,GACbR,wBAAwB,CAAC,CAAC,IAAIC,kCAAkC,CAAC,CAAC;IAEnE,MAAMQ,KAAK,GAAGP,QAAQ,CAAEM,QAAS,CAAC;IAClC,MAAME,UAAU,GAAGL,uBAAuB,CAAC,CAAC;IAC5C,MAAMM,gBAAgB,GAAG,CAAC,CAAEH,QAAQ,IAAI,CAAC,CAAEC,KAAK;IAChD,MAAMG,mBAAmB,GACxBD,gBAAgB,IAChBjB,wBAAwB,CAAEe,KAAK,EAAE,SAAU,CAAC,IAC5CN,YAAY,CAAEK,QAAS,CAAC,KAAK,MAAM;IACpC,MAAMK,2BAA2B,GAChCL,QAAQ,IACR,CAAEF,QAAQ,CAAC,CAAC;IACZ;IACA;IACAI,UAAU,KAAK,YAAY,IAC3BE,mBAAmB;IACpB,MAAME,wBAAwB,GAC7B,CAAEP,sBAAsB,CAAC,CAAC,IAC1B,CAAEH,WAAW,CAAC,CAAC,CAACW,eAAe,IAC/B,CAAEF,2BAA2B,IAC7BF,gBAAgB,IAChB,CAAEC,mBAAmB;IAEtB,OAAO;MACNI,0BAA0B,EAAEH,2BAA2B;MACvDI,uBAAuB,EAAEH;IAC1B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -116,7 +116,7 @@ function useInsertionPoint({
116
116
  setLastFocus(null);
117
117
  }
118
118
  const selectedBlock = getSelectedBlock();
119
- if (!isAppender && selectedBlock && isUnmodifiedDefaultBlock(selectedBlock)) {
119
+ if (!isAppender && selectedBlock && isUnmodifiedDefaultBlock(selectedBlock, 'content')) {
120
120
  replaceBlocks(selectedBlock.clientId, blocks, null, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta);
121
121
  } else {
122
122
  insertBlocks(blocks, isAppender || _rootClientId === undefined ? destinationIndex : getIndex({
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useRegistry","useSelect","isUnmodifiedDefaultBlock","_n","sprintf","speak","useCallback","store","blockEditorStore","unlock","getIndex","destinationRootClientId","destinationIndex","rootClientId","registry","parents","select","getBlockParents","parentIndex","indexOf","getBlockIndex","getBlockOrder","length","useInsertionPoint","insertionIndex","clientId","isAppender","onSelect","shouldFocusBlock","selectBlockOnInsert","getSelectedBlock","getClosestAllowedInsertionPoint","isBlockInsertionPointVisible","getSelectedBlockClientId","getBlockRootClientId","getInsertionPoint","selectedBlockClientId","_destinationRootClientId","_destinationIndex","insertionPoint","undefined","hasOwnProperty","index","replaceBlocks","insertBlocks","showInsertionPoint","hideInsertionPoint","setLastFocus","onInsertBlocks","blocks","meta","shouldForceFocusBlock","_rootClientId","selectedBlock","blockLength","Array","isArray","message","onToggleInsertionPoint","item","allowedDestinationRootClientId","name"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-insertion-point.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction getIndex( {\n\tdestinationRootClientId,\n\tdestinationIndex,\n\trootClientId,\n\tregistry,\n} ) {\n\tif ( rootClientId === destinationRootClientId ) {\n\t\treturn destinationIndex;\n\t}\n\tconst parents = [\n\t\t'',\n\t\t...registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockParents( destinationRootClientId ),\n\t\tdestinationRootClientId,\n\t];\n\tconst parentIndex = parents.indexOf( rootClientId );\n\tif ( parentIndex !== -1 ) {\n\t\treturn (\n\t\t\tregistry\n\t\t\t\t.select( blockEditorStore )\n\t\t\t\t.getBlockIndex( parents[ parentIndex + 1 ] ) + 1\n\t\t);\n\t}\n\treturn registry.select( blockEditorStore ).getBlockOrder( rootClientId )\n\t\t.length;\n}\n\n/**\n * @typedef WPInserterConfig\n *\n * @property {string=} rootClientId If set, insertion will be into the\n * block with this ID.\n * @property {number=} insertionIndex If set, insertion will be into this\n * explicit position.\n * @property {string=} clientId If set, insertion will be after the\n * block with this ID.\n * @property {boolean=} isAppender Whether the inserter is an appender\n * or not.\n * @property {Function=} onSelect Called after insertion.\n */\n\n/**\n * Returns the insertion point state given the inserter config.\n *\n * @param {WPInserterConfig} config Inserter Config.\n * @return {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle).\n */\nfunction useInsertionPoint( {\n\trootClientId = '',\n\tinsertionIndex,\n\tclientId,\n\tisAppender,\n\tonSelect,\n\tshouldFocusBlock = true,\n\tselectBlockOnInsert = true,\n} ) {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetSelectedBlock,\n\t\tgetClosestAllowedInsertionPoint,\n\t\tisBlockInsertionPointVisible,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { destinationRootClientId, destinationIndex } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetInsertionPoint,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tlet _destinationRootClientId = rootClientId;\n\t\t\tlet _destinationIndex;\n\t\t\tconst insertionPoint = getInsertionPoint();\n\n\t\t\tif ( insertionIndex !== undefined ) {\n\t\t\t\t// Insert into a specific index.\n\t\t\t\t_destinationIndex = insertionIndex;\n\t\t\t} else if (\n\t\t\t\tinsertionPoint &&\n\t\t\t\tinsertionPoint.hasOwnProperty( 'index' )\n\t\t\t) {\n\t\t\t\t_destinationRootClientId = insertionPoint?.rootClientId\n\t\t\t\t\t? insertionPoint.rootClientId\n\t\t\t\t\t: rootClientId;\n\t\t\t\t_destinationIndex = insertionPoint.index;\n\t\t\t} else if ( clientId ) {\n\t\t\t\t// Insert after a specific client ID.\n\t\t\t\t_destinationIndex = getBlockIndex( clientId );\n\t\t\t} else if ( ! isAppender && selectedBlockClientId ) {\n\t\t\t\t_destinationRootClientId = getBlockRootClientId(\n\t\t\t\t\tselectedBlockClientId\n\t\t\t\t);\n\t\t\t\t_destinationIndex = getBlockIndex( selectedBlockClientId ) + 1;\n\t\t\t} else {\n\t\t\t\t// Insert at the end of the list.\n\t\t\t\t_destinationIndex = getBlockOrder(\n\t\t\t\t\t_destinationRootClientId\n\t\t\t\t).length;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdestinationRootClientId: _destinationRootClientId,\n\t\t\t\tdestinationIndex: _destinationIndex,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, insertionIndex, clientId, isAppender ]\n\t);\n\n\tconst {\n\t\treplaceBlocks,\n\t\tinsertBlocks,\n\t\tshowInsertionPoint,\n\t\thideInsertionPoint,\n\t\tsetLastFocus,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tconst onInsertBlocks = useCallback(\n\t\t( blocks, meta, shouldForceFocusBlock = false, _rootClientId ) => {\n\t\t\t// When we are trying to move focus or select a new block on insert, we also\n\t\t\t// need to clear the last focus to avoid the focus being set to the wrong block\n\t\t\t// when tabbing back into the canvas if the block was added from outside the\n\t\t\t// editor canvas.\n\t\t\tif (\n\t\t\t\tshouldForceFocusBlock ||\n\t\t\t\tshouldFocusBlock ||\n\t\t\t\tselectBlockOnInsert\n\t\t\t) {\n\t\t\t\tsetLastFocus( null );\n\t\t\t}\n\n\t\t\tconst selectedBlock = getSelectedBlock();\n\n\t\t\tif (\n\t\t\t\t! isAppender &&\n\t\t\t\tselectedBlock &&\n\t\t\t\tisUnmodifiedDefaultBlock( selectedBlock )\n\t\t\t) {\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\tblocks,\n\t\t\t\t\tnull,\n\t\t\t\t\tshouldFocusBlock || shouldForceFocusBlock ? 0 : null,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tinsertBlocks(\n\t\t\t\t\tblocks,\n\t\t\t\t\tisAppender || _rootClientId === undefined\n\t\t\t\t\t\t? destinationIndex\n\t\t\t\t\t\t: getIndex( {\n\t\t\t\t\t\t\t\tdestinationRootClientId,\n\t\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\t\trootClientId: _rootClientId,\n\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t } ),\n\t\t\t\t\tisAppender || _rootClientId === undefined\n\t\t\t\t\t\t? destinationRootClientId\n\t\t\t\t\t\t: _rootClientId,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t\tshouldFocusBlock || shouldForceFocusBlock ? 0 : null,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst blockLength = Array.isArray( blocks ) ? blocks.length : 1;\n\t\t\tconst message = sprintf(\n\t\t\t\t// translators: %d: the name of the block that has been added\n\t\t\t\t_n( '%d block added.', '%d blocks added.', blockLength ),\n\t\t\t\tblockLength\n\t\t\t);\n\t\t\tspeak( message );\n\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( blocks );\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tisAppender,\n\t\t\tgetSelectedBlock,\n\t\t\treplaceBlocks,\n\t\t\tinsertBlocks,\n\t\t\tdestinationRootClientId,\n\t\t\tdestinationIndex,\n\t\t\tonSelect,\n\t\t\tshouldFocusBlock,\n\t\t\tselectBlockOnInsert,\n\t\t]\n\t);\n\n\tconst onToggleInsertionPoint = useCallback(\n\t\t( item ) => {\n\t\t\tif ( item && ! isBlockInsertionPointVisible() ) {\n\t\t\t\tconst allowedDestinationRootClientId =\n\t\t\t\t\tgetClosestAllowedInsertionPoint(\n\t\t\t\t\t\titem.name,\n\t\t\t\t\t\tdestinationRootClientId\n\t\t\t\t\t);\n\t\t\t\tif ( allowedDestinationRootClientId !== null ) {\n\t\t\t\t\tshowInsertionPoint(\n\t\t\t\t\t\tallowedDestinationRootClientId,\n\t\t\t\t\t\tgetIndex( {\n\t\t\t\t\t\t\tdestinationRootClientId,\n\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\trootClientId: allowedDestinationRootClientId,\n\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thideInsertionPoint();\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tgetClosestAllowedInsertionPoint,\n\t\t\tisBlockInsertionPointVisible,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tdestinationRootClientId,\n\t\t\tdestinationIndex,\n\t\t]\n\t);\n\n\treturn [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ];\n}\n\nexport default useInsertionPoint;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACrE,SAASC,wBAAwB,QAAQ,mBAAmB;AAC5D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;AAC1D,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SAASC,QAAQA,CAAE;EAClBC,uBAAuB;EACvBC,gBAAgB;EAChBC,YAAY;EACZC;AACD,CAAC,EAAG;EACH,IAAKD,YAAY,KAAKF,uBAAuB,EAAG;IAC/C,OAAOC,gBAAgB;EACxB;EACA,MAAMG,OAAO,GAAG,CACf,EAAE,EACF,GAAGD,QAAQ,CACTE,MAAM,CAAER,gBAAiB,CAAC,CAC1BS,eAAe,CAAEN,uBAAwB,CAAC,EAC5CA,uBAAuB,CACvB;EACD,MAAMO,WAAW,GAAGH,OAAO,CAACI,OAAO,CAAEN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AAE;UACTC,uBAAuB;UACvBC,gBAAgB;UAChBC,YAAY,EAAE+C,8BAA8B;UAC5C9C;QACD,CAAE,CACH,CAAC;MACF;IACD,CAAC,MAAM;MACNgC,kBAAkB,CAAC,CAAC;IACrB;EACD,CAAC,EACD,CACCf,+BAA+B,EAC/BC,4BAA4B,EAC5Ba,kBAAkB,EAClBC,kBAAkB,EAClBnC,uBAAuB,EACvBC,gBAAgB,CAElB,CAAC;EAED,OAAO,CAAED,uBAAuB,EAAEqC,cAAc,EAAEU,sBAAsB,CAAE;AAC3E;AAEA,eAAenC,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["useDispatch","useRegistry","useSelect","isUnmodifiedDefaultBlock","_n","sprintf","speak","useCallback","store","blockEditorStore","unlock","getIndex","destinationRootClientId","destinationIndex","rootClientId","registry","parents","select","getBlockParents","parentIndex","indexOf","getBlockIndex","getBlockOrder","length","useInsertionPoint","insertionIndex","clientId","isAppender","onSelect","shouldFocusBlock","selectBlockOnInsert","getSelectedBlock","getClosestAllowedInsertionPoint","isBlockInsertionPointVisible","getSelectedBlockClientId","getBlockRootClientId","getInsertionPoint","selectedBlockClientId","_destinationRootClientId","_destinationIndex","insertionPoint","undefined","hasOwnProperty","index","replaceBlocks","insertBlocks","showInsertionPoint","hideInsertionPoint","setLastFocus","onInsertBlocks","blocks","meta","shouldForceFocusBlock","_rootClientId","selectedBlock","blockLength","Array","isArray","message","onToggleInsertionPoint","item","allowedDestinationRootClientId","name"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-insertion-point.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction getIndex( {\n\tdestinationRootClientId,\n\tdestinationIndex,\n\trootClientId,\n\tregistry,\n} ) {\n\tif ( rootClientId === destinationRootClientId ) {\n\t\treturn destinationIndex;\n\t}\n\tconst parents = [\n\t\t'',\n\t\t...registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockParents( destinationRootClientId ),\n\t\tdestinationRootClientId,\n\t];\n\tconst parentIndex = parents.indexOf( rootClientId );\n\tif ( parentIndex !== -1 ) {\n\t\treturn (\n\t\t\tregistry\n\t\t\t\t.select( blockEditorStore )\n\t\t\t\t.getBlockIndex( parents[ parentIndex + 1 ] ) + 1\n\t\t);\n\t}\n\treturn registry.select( blockEditorStore ).getBlockOrder( rootClientId )\n\t\t.length;\n}\n\n/**\n * @typedef WPInserterConfig\n *\n * @property {string=} rootClientId If set, insertion will be into the\n * block with this ID.\n * @property {number=} insertionIndex If set, insertion will be into this\n * explicit position.\n * @property {string=} clientId If set, insertion will be after the\n * block with this ID.\n * @property {boolean=} isAppender Whether the inserter is an appender\n * or not.\n * @property {Function=} onSelect Called after insertion.\n */\n\n/**\n * Returns the insertion point state given the inserter config.\n *\n * @param {WPInserterConfig} config Inserter Config.\n * @return {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle).\n */\nfunction useInsertionPoint( {\n\trootClientId = '',\n\tinsertionIndex,\n\tclientId,\n\tisAppender,\n\tonSelect,\n\tshouldFocusBlock = true,\n\tselectBlockOnInsert = true,\n} ) {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetSelectedBlock,\n\t\tgetClosestAllowedInsertionPoint,\n\t\tisBlockInsertionPointVisible,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { destinationRootClientId, destinationIndex } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetInsertionPoint,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tlet _destinationRootClientId = rootClientId;\n\t\t\tlet _destinationIndex;\n\t\t\tconst insertionPoint = getInsertionPoint();\n\n\t\t\tif ( insertionIndex !== undefined ) {\n\t\t\t\t// Insert into a specific index.\n\t\t\t\t_destinationIndex = insertionIndex;\n\t\t\t} else if (\n\t\t\t\tinsertionPoint &&\n\t\t\t\tinsertionPoint.hasOwnProperty( 'index' )\n\t\t\t) {\n\t\t\t\t_destinationRootClientId = insertionPoint?.rootClientId\n\t\t\t\t\t? insertionPoint.rootClientId\n\t\t\t\t\t: rootClientId;\n\t\t\t\t_destinationIndex = insertionPoint.index;\n\t\t\t} else if ( clientId ) {\n\t\t\t\t// Insert after a specific client ID.\n\t\t\t\t_destinationIndex = getBlockIndex( clientId );\n\t\t\t} else if ( ! isAppender && selectedBlockClientId ) {\n\t\t\t\t_destinationRootClientId = getBlockRootClientId(\n\t\t\t\t\tselectedBlockClientId\n\t\t\t\t);\n\t\t\t\t_destinationIndex = getBlockIndex( selectedBlockClientId ) + 1;\n\t\t\t} else {\n\t\t\t\t// Insert at the end of the list.\n\t\t\t\t_destinationIndex = getBlockOrder(\n\t\t\t\t\t_destinationRootClientId\n\t\t\t\t).length;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdestinationRootClientId: _destinationRootClientId,\n\t\t\t\tdestinationIndex: _destinationIndex,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId, insertionIndex, clientId, isAppender ]\n\t);\n\n\tconst {\n\t\treplaceBlocks,\n\t\tinsertBlocks,\n\t\tshowInsertionPoint,\n\t\thideInsertionPoint,\n\t\tsetLastFocus,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tconst onInsertBlocks = useCallback(\n\t\t( blocks, meta, shouldForceFocusBlock = false, _rootClientId ) => {\n\t\t\t// When we are trying to move focus or select a new block on insert, we also\n\t\t\t// need to clear the last focus to avoid the focus being set to the wrong block\n\t\t\t// when tabbing back into the canvas if the block was added from outside the\n\t\t\t// editor canvas.\n\t\t\tif (\n\t\t\t\tshouldForceFocusBlock ||\n\t\t\t\tshouldFocusBlock ||\n\t\t\t\tselectBlockOnInsert\n\t\t\t) {\n\t\t\t\tsetLastFocus( null );\n\t\t\t}\n\n\t\t\tconst selectedBlock = getSelectedBlock();\n\n\t\t\tif (\n\t\t\t\t! isAppender &&\n\t\t\t\tselectedBlock &&\n\t\t\t\tisUnmodifiedDefaultBlock( selectedBlock, 'content' )\n\t\t\t) {\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\tblocks,\n\t\t\t\t\tnull,\n\t\t\t\t\tshouldFocusBlock || shouldForceFocusBlock ? 0 : null,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tinsertBlocks(\n\t\t\t\t\tblocks,\n\t\t\t\t\tisAppender || _rootClientId === undefined\n\t\t\t\t\t\t? destinationIndex\n\t\t\t\t\t\t: getIndex( {\n\t\t\t\t\t\t\t\tdestinationRootClientId,\n\t\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\t\trootClientId: _rootClientId,\n\t\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t } ),\n\t\t\t\t\tisAppender || _rootClientId === undefined\n\t\t\t\t\t\t? destinationRootClientId\n\t\t\t\t\t\t: _rootClientId,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t\tshouldFocusBlock || shouldForceFocusBlock ? 0 : null,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst blockLength = Array.isArray( blocks ) ? blocks.length : 1;\n\t\t\tconst message = sprintf(\n\t\t\t\t// translators: %d: the name of the block that has been added\n\t\t\t\t_n( '%d block added.', '%d blocks added.', blockLength ),\n\t\t\t\tblockLength\n\t\t\t);\n\t\t\tspeak( message );\n\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( blocks );\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tisAppender,\n\t\t\tgetSelectedBlock,\n\t\t\treplaceBlocks,\n\t\t\tinsertBlocks,\n\t\t\tdestinationRootClientId,\n\t\t\tdestinationIndex,\n\t\t\tonSelect,\n\t\t\tshouldFocusBlock,\n\t\t\tselectBlockOnInsert,\n\t\t]\n\t);\n\n\tconst onToggleInsertionPoint = useCallback(\n\t\t( item ) => {\n\t\t\tif ( item && ! isBlockInsertionPointVisible() ) {\n\t\t\t\tconst allowedDestinationRootClientId =\n\t\t\t\t\tgetClosestAllowedInsertionPoint(\n\t\t\t\t\t\titem.name,\n\t\t\t\t\t\tdestinationRootClientId\n\t\t\t\t\t);\n\t\t\t\tif ( allowedDestinationRootClientId !== null ) {\n\t\t\t\t\tshowInsertionPoint(\n\t\t\t\t\t\tallowedDestinationRootClientId,\n\t\t\t\t\t\tgetIndex( {\n\t\t\t\t\t\t\tdestinationRootClientId,\n\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\trootClientId: allowedDestinationRootClientId,\n\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thideInsertionPoint();\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tgetClosestAllowedInsertionPoint,\n\t\t\tisBlockInsertionPointVisible,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tdestinationRootClientId,\n\t\t\tdestinationIndex,\n\t\t]\n\t);\n\n\treturn [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ];\n}\n\nexport default useInsertionPoint;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACrE,SAASC,wBAAwB,QAAQ,mBAAmB;AAC5D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,WAAW,QAAQ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,CAAEsB,MAAO,CAAC;IACnB;EACD,CAAC,EACD,CACCvB,UAAU,EACVI,gBAAgB,EAChBa,aAAa,EACbC,YAAY,EACZjC,uBAAuB,EACvBC,gBAAgB,EAChBe,QAAQ,EACRC,gBAAgB,EAChBC,mBAAmB,CAErB,CAAC;EAED,MAAM6B,sBAAsB,GAAGpD,WAAW,CACvCqD,IAAI,IAAM;IACX,IAAKA,IAAI,IAAI,CAAE3B,4BAA4B,CAAC,CAAC,EAAG;MAC/C,MAAM4B,8BAA8B,GACnC7B,+BAA+B,CAC9B4B,IAAI,CAACE,IAAI,EACTlD,uBACD,CAAC;MACF,IAAKiD,8BAA8B,KAAK,IAAI,EAAG;QAC9Cf,kBAAkB,CACjBe,8BAA8B,EAC9BlD,QAAQ,CAAE;UACTC,uBAAuB;UACvBC,gBAAgB;UAChBC,YAAY,EAAE+C,8BAA8B;UAC5C9C;QACD,CAAE,CACH,CAAC;MACF;IACD,CAAC,MAAM;MACNgC,kBAAkB,CAAC,CAAC;IACrB;EACD,CAAC,EACD,CACCf,+BAA+B,EAC/BC,4BAA4B,EAC5Ba,kBAAkB,EAClBC,kBAAkB,EAClBnC,uBAAuB,EACvBC,gBAAgB,CAElB,CAAC;EAED,OAAO,CAAED,uBAAuB,EAAEqC,cAAc,EAAEU,sBAAsB,CAAE;AAC3E;AAEA,eAAenC,iBAAiB","ignoreList":[]}
@@ -327,9 +327,7 @@ export default compose([withSelect((select, {
327
327
  }
328
328
  insertBlock(blockToInsert, getInsertionIndex(), rootClientId, selectBlockOnInsert);
329
329
  if (onSelectOrClose) {
330
- onSelectOrClose({
331
- clientId: blockToInsert?.clientId
332
- });
330
+ onSelectOrClose(blockToInsert);
333
331
  }
334
332
  const message = sprintf(
335
333
  // translators: %s: the name of the block that has been added
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","speak","__","_x","sprintf","Dropdown","Button","Component","withDispatch","withSelect","compose","ifCondition","createBlock","store","blocksStore","plus","InserterMenu","QuickInserter","blockEditorStore","jsx","_jsx","defaultRenderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","toggleProps","as","Wrapper","label","labelProp","onClick","rest","handleClick","event","__next40pxDefaultSize","undefined","icon","tooltipPosition","className","Inserter","constructor","arguments","bind","renderToggle","renderContent","props","directInsertBlock","hasItems","onClose","rootClientId","clientId","isAppender","showInserterHelpPanel","__experimentalIsQuick","isQuick","onSelectOrClose","selectBlockOnInsert","onSelect","blocks","firstBlock","Array","isArray","length","render","position","insertOnlyAllowedBlock","contentClassName","popoverProps","shift","expandOnMobile","headerTitle","select","shouldDirectInsert","getBlockRootClientId","hasInserterItems","getAllowedBlocks","getDirectInsertBlock","getBlockVariations","allowedBlocks","name","allowedBlockType","title","dispatch","ownProps","getAdjacentBlockAttributes","attributesToCopy","getBlock","getPreviousBlockClientId","result","adjacentAttributes","parentBlock","innerBlocks","lastInnerBlock","attributes","currentBlock","previousBlock","forEach","attribute","hasOwnProperty","getInsertionIndex","getBlockIndex","getBlockSelectionEnd","getBlockOrder","end","insertBlock","blockToInsert","newAttributes","message"],"sources":["@wordpress/block-editor/src/components/inserter/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport InserterMenu from './menu';\nimport QuickInserter from './quick-inserter';\nimport { store as blockEditorStore } from '../../store';\n\nconst defaultRenderToggle = ( {\n\tonToggle,\n\tdisabled,\n\tisOpen,\n\tblockTitle,\n\thasSingleBlockType,\n\ttoggleProps = {},\n} ) => {\n\tconst {\n\t\tas: Wrapper = Button,\n\t\tlabel: labelProp,\n\t\tonClick,\n\t\t...rest\n\t} = toggleProps;\n\n\tlet label = labelProp;\n\tif ( ! label && hasSingleBlockType ) {\n\t\tlabel = sprintf(\n\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t_x( 'Add %s', 'directly add the only allowed block' ),\n\t\t\tblockTitle\n\t\t);\n\t} else if ( ! label ) {\n\t\tlabel = _x( 'Add block', 'Generic label for block inserter button' );\n\t}\n\n\t// Handle both onClick functions from the toggle and the parent component.\n\tfunction handleClick( event ) {\n\t\tif ( onToggle ) {\n\t\t\tonToggle( event );\n\t\t}\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Wrapper\n\t\t\t__next40pxDefaultSize={ toggleProps.as ? undefined : true }\n\t\t\ticon={ plus }\n\t\t\tlabel={ label }\n\t\t\ttooltipPosition=\"bottom\"\n\t\t\tonClick={ handleClick }\n\t\t\tclassName=\"block-editor-inserter__toggle\"\n\t\t\taria-haspopup={ ! hasSingleBlockType ? 'true' : false }\n\t\t\taria-expanded={ ! hasSingleBlockType ? isOpen : false }\n\t\t\tdisabled={ disabled }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n};\n\nclass Inserter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onToggle = this.onToggle.bind( this );\n\t\tthis.renderToggle = this.renderToggle.bind( this );\n\t\tthis.renderContent = this.renderContent.bind( this );\n\t}\n\n\tonToggle( isOpen ) {\n\t\tconst { onToggle } = this.props;\n\n\t\t// Surface toggle callback to parent component.\n\t\tif ( onToggle ) {\n\t\t\tonToggle( isOpen );\n\t\t}\n\t}\n\n\t/**\n\t * Render callback to display Dropdown toggle element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onToggle Callback to invoke when toggle is\n\t * pressed.\n\t * @param {boolean} options.isOpen Whether dropdown is currently open.\n\t *\n\t * @return {Element} Dropdown toggle element.\n\t */\n\trenderToggle( { onToggle, isOpen } ) {\n\t\tconst {\n\t\t\tdisabled,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\ttoggleProps,\n\t\t\thasItems,\n\t\t\trenderToggle = defaultRenderToggle,\n\t\t} = this.props;\n\n\t\treturn renderToggle( {\n\t\t\tonToggle,\n\t\t\tisOpen,\n\t\t\tdisabled: disabled || ! hasItems,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\ttoggleProps,\n\t\t} );\n\t}\n\n\t/**\n\t * Render callback to display Dropdown content element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onClose Callback to invoke when dropdown is\n\t * closed.\n\t *\n\t * @return {Element} Dropdown content element.\n\t */\n\trenderContent( { onClose } ) {\n\t\tconst {\n\t\t\trootClientId,\n\t\t\tclientId,\n\t\t\tisAppender,\n\t\t\tshowInserterHelpPanel,\n\n\t\t\t// This prop is experimental to give some time for the quick inserter to mature\n\t\t\t// Feel free to make them stable after a few releases.\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t\tselectBlockOnInsert,\n\t\t} = this.props;\n\n\t\tif ( isQuick ) {\n\t\t\treturn (\n\t\t\t\t<QuickInserter\n\t\t\t\t\tonSelect={ ( blocks ) => {\n\t\t\t\t\t\tconst firstBlock =\n\t\t\t\t\t\t\tArray.isArray( blocks ) && blocks?.length\n\t\t\t\t\t\t\t\t? blocks[ 0 ]\n\t\t\t\t\t\t\t\t: blocks;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tonSelectOrClose &&\n\t\t\t\t\t\t\ttypeof onSelectOrClose === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonSelectOrClose( firstBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisAppender={ isAppender }\n\t\t\t\t\tselectBlockOnInsert={ selectBlockOnInsert }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<InserterMenu\n\t\t\t\tonSelect={ () => {\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisAppender={ isAppender }\n\t\t\t\tshowInserterHelpPanel={ showInserterHelpPanel }\n\t\t\t/>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tposition,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\tinsertOnlyAllowedBlock,\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t} = this.props;\n\n\t\tif ( hasSingleBlockType || directInsertBlock ) {\n\t\t\treturn this.renderToggle( { onToggle: insertOnlyAllowedBlock } );\n\t\t}\n\n\t\treturn (\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"block-editor-inserter\"\n\t\t\t\tcontentClassName={ clsx( 'block-editor-inserter__popover', {\n\t\t\t\t\t'is-quick': isQuick,\n\t\t\t\t} ) }\n\t\t\t\tpopoverProps={ { position, shift: true } }\n\t\t\t\tonToggle={ this.onToggle }\n\t\t\t\texpandOnMobile\n\t\t\t\theaderTitle={ __( 'Add a block' ) }\n\t\t\t\trenderToggle={ this.renderToggle }\n\t\t\t\trenderContent={ this.renderContent }\n\t\t\t\tonClose={ onSelectOrClose }\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect(\n\t\t( select, { clientId, rootClientId, shouldDirectInsert = true } ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasInserterItems,\n\t\t\t\tgetAllowedBlocks,\n\t\t\t\tgetDirectInsertBlock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst { getBlockVariations } = select( blocksStore );\n\n\t\t\trootClientId =\n\t\t\t\trootClientId || getBlockRootClientId( clientId ) || undefined;\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( rootClientId );\n\n\t\t\tconst directInsertBlock =\n\t\t\t\tshouldDirectInsert && getDirectInsertBlock( rootClientId );\n\n\t\t\tconst hasSingleBlockType =\n\t\t\t\tallowedBlocks?.length === 1 &&\n\t\t\t\tgetBlockVariations( allowedBlocks[ 0 ].name, 'inserter' )\n\t\t\t\t\t?.length === 0;\n\n\t\t\tlet allowedBlockType = false;\n\t\t\tif ( hasSingleBlockType ) {\n\t\t\t\tallowedBlockType = allowedBlocks[ 0 ];\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasItems: hasInserterItems( rootClientId ),\n\t\t\t\thasSingleBlockType,\n\t\t\t\tblockTitle: allowedBlockType ? allowedBlockType.title : '',\n\t\t\t\tallowedBlockType,\n\t\t\t\tdirectInsertBlock,\n\t\t\t\trootClientId,\n\t\t\t};\n\t\t}\n\t),\n\twithDispatch( ( dispatch, ownProps, { select } ) => {\n\t\treturn {\n\t\t\tinsertOnlyAllowedBlock() {\n\t\t\t\tconst {\n\t\t\t\t\trootClientId,\n\t\t\t\t\tclientId,\n\t\t\t\t\tisAppender,\n\t\t\t\t\thasSingleBlockType,\n\t\t\t\t\tallowedBlockType,\n\t\t\t\t\tdirectInsertBlock,\n\t\t\t\t\tonSelectOrClose,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t} = ownProps;\n\n\t\t\t\tif ( ! hasSingleBlockType && ! directInsertBlock ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfunction getAdjacentBlockAttributes( attributesToCopy ) {\n\t\t\t\t\tconst { getBlock, getPreviousBlockClientId } =\n\t\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! attributesToCopy ||\n\t\t\t\t\t\t( ! clientId && ! rootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = {};\n\t\t\t\t\tlet adjacentAttributes = {};\n\n\t\t\t\t\t// If there is no clientId, then attempt to get attributes\n\t\t\t\t\t// from the last block within innerBlocks of the root block.\n\t\t\t\t\tif ( ! clientId ) {\n\t\t\t\t\t\tconst parentBlock = getBlock( rootClientId );\n\n\t\t\t\t\t\tif ( parentBlock?.innerBlocks?.length ) {\n\t\t\t\t\t\t\tconst lastInnerBlock =\n\t\t\t\t\t\t\t\tparentBlock.innerBlocks[\n\t\t\t\t\t\t\t\t\tparentBlock.innerBlocks.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdirectInsertBlock &&\n\t\t\t\t\t\t\t\tdirectInsertBlock?.name === lastInnerBlock.name\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tadjacentAttributes = lastInnerBlock.attributes;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Otherwise, attempt to get attributes from the\n\t\t\t\t\t\t// previous block relative to the current clientId.\n\t\t\t\t\t\tconst currentBlock = getBlock( clientId );\n\t\t\t\t\t\tconst previousBlock = getBlock(\n\t\t\t\t\t\t\tgetPreviousBlockClientId( clientId )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( currentBlock?.name === previousBlock?.name ) {\n\t\t\t\t\t\t\tadjacentAttributes =\n\t\t\t\t\t\t\t\tpreviousBlock?.attributes || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Copy over only those attributes flagged to be copied.\n\t\t\t\t\tattributesToCopy.forEach( ( attribute ) => {\n\t\t\t\t\t\tif ( adjacentAttributes.hasOwnProperty( attribute ) ) {\n\t\t\t\t\t\t\tresult[ attribute ] =\n\t\t\t\t\t\t\t\tadjacentAttributes[ attribute ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tfunction getInsertionIndex() {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\t} = select( blockEditorStore );\n\n\t\t\t\t\t// If the clientId is defined, we insert at the position of the block.\n\t\t\t\t\tif ( clientId ) {\n\t\t\t\t\t\treturn getBlockIndex( clientId );\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there a selected block, we insert after the selected block.\n\t\t\t\t\tconst end = getBlockSelectionEnd();\n\t\t\t\t\tif (\n\t\t\t\t\t\t! isAppender &&\n\t\t\t\t\t\tend &&\n\t\t\t\t\t\tgetBlockRootClientId( end ) === rootClientId\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn getBlockIndex( end ) + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise, we insert at the end of the current rootClientId.\n\t\t\t\t\treturn getBlockOrder( rootClientId ).length;\n\t\t\t\t}\n\n\t\t\t\tconst { insertBlock } = dispatch( blockEditorStore );\n\n\t\t\t\tlet blockToInsert;\n\n\t\t\t\t// Attempt to augment the directInsertBlock with attributes from an adjacent block.\n\t\t\t\t// This ensures styling from nearby blocks is preserved in the newly inserted block.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/37904\n\t\t\t\tif ( directInsertBlock ) {\n\t\t\t\t\tconst newAttributes = getAdjacentBlockAttributes(\n\t\t\t\t\t\tdirectInsertBlock.attributesToCopy\n\t\t\t\t\t);\n\n\t\t\t\t\tblockToInsert = createBlock( directInsertBlock.name, {\n\t\t\t\t\t\t...( directInsertBlock.attributes || {} ),\n\t\t\t\t\t\t...newAttributes,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tblockToInsert = createBlock( allowedBlockType.name );\n\t\t\t\t}\n\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblockToInsert,\n\t\t\t\t\tgetInsertionIndex(),\n\t\t\t\t\trootClientId,\n\t\t\t\t\tselectBlockOnInsert\n\t\t\t\t);\n\n\t\t\t\tif ( onSelectOrClose ) {\n\t\t\t\t\tonSelectOrClose( {\n\t\t\t\t\t\tclientId: blockToInsert?.clientId,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tconst message = sprintf(\n\t\t\t\t\t// translators: %s: the name of the block that has been added\n\t\t\t\t\t__( '%s block added' ),\n\t\t\t\t\tallowedBlockType.title\n\t\t\t\t);\n\t\t\t\tspeak( message );\n\t\t\t},\n\t\t};\n\t} ),\n\t// The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as\n\t// a way to detect the global Inserter.\n\tifCondition(\n\t\t( { hasItems, isAppender, rootClientId, clientId } ) =>\n\t\t\thasItems || ( ! isAppender && ! rootClientId && ! clientId )\n\t),\n] )( Inserter );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,WAAW,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACrE,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;AACA;AACA;AACA,OAAOC,YAAY,MAAM,QAAQ;AACjC,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExD,MAAMC,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,kBAAkB;EAClBC,WAAW,GAAG,CAAC;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EAAEuD,aAAa,EAAEvD;QAC1B,CAAE,CAAC;MACJ;MAEA,MAAMyD,OAAO,GAAGzG,OAAO;MACtB;MACAF,EAAE,CAAE,gBAAiB,CAAC,EACtBgF,gBAAgB,CAACC,KAClB,CAAC;MACDlF,KAAK,CAAE4G,OAAQ,CAAC;IACjB;EACD,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACAlG,WAAW,CACV,CAAE;EAAEsC,QAAQ;EAAEI,UAAU;EAAEF,YAAY;EAAEC;AAAS,CAAC,KACjDH,QAAQ,IAAM,CAAEI,UAAU,IAAI,CAAEF,YAAY,IAAI,CAAEC,QACpD,CAAC,CACA,CAAC,CAAEX,QAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","speak","__","_x","sprintf","Dropdown","Button","Component","withDispatch","withSelect","compose","ifCondition","createBlock","store","blocksStore","plus","InserterMenu","QuickInserter","blockEditorStore","jsx","_jsx","defaultRenderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","toggleProps","as","Wrapper","label","labelProp","onClick","rest","handleClick","event","__next40pxDefaultSize","undefined","icon","tooltipPosition","className","Inserter","constructor","arguments","bind","renderToggle","renderContent","props","directInsertBlock","hasItems","onClose","rootClientId","clientId","isAppender","showInserterHelpPanel","__experimentalIsQuick","isQuick","onSelectOrClose","selectBlockOnInsert","onSelect","blocks","firstBlock","Array","isArray","length","render","position","insertOnlyAllowedBlock","contentClassName","popoverProps","shift","expandOnMobile","headerTitle","select","shouldDirectInsert","getBlockRootClientId","hasInserterItems","getAllowedBlocks","getDirectInsertBlock","getBlockVariations","allowedBlocks","name","allowedBlockType","title","dispatch","ownProps","getAdjacentBlockAttributes","attributesToCopy","getBlock","getPreviousBlockClientId","result","adjacentAttributes","parentBlock","innerBlocks","lastInnerBlock","attributes","currentBlock","previousBlock","forEach","attribute","hasOwnProperty","getInsertionIndex","getBlockIndex","getBlockSelectionEnd","getBlockOrder","end","insertBlock","blockToInsert","newAttributes","message"],"sources":["@wordpress/block-editor/src/components/inserter/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport InserterMenu from './menu';\nimport QuickInserter from './quick-inserter';\nimport { store as blockEditorStore } from '../../store';\n\nconst defaultRenderToggle = ( {\n\tonToggle,\n\tdisabled,\n\tisOpen,\n\tblockTitle,\n\thasSingleBlockType,\n\ttoggleProps = {},\n} ) => {\n\tconst {\n\t\tas: Wrapper = Button,\n\t\tlabel: labelProp,\n\t\tonClick,\n\t\t...rest\n\t} = toggleProps;\n\n\tlet label = labelProp;\n\tif ( ! label && hasSingleBlockType ) {\n\t\tlabel = sprintf(\n\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t_x( 'Add %s', 'directly add the only allowed block' ),\n\t\t\tblockTitle\n\t\t);\n\t} else if ( ! label ) {\n\t\tlabel = _x( 'Add block', 'Generic label for block inserter button' );\n\t}\n\n\t// Handle both onClick functions from the toggle and the parent component.\n\tfunction handleClick( event ) {\n\t\tif ( onToggle ) {\n\t\t\tonToggle( event );\n\t\t}\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Wrapper\n\t\t\t__next40pxDefaultSize={ toggleProps.as ? undefined : true }\n\t\t\ticon={ plus }\n\t\t\tlabel={ label }\n\t\t\ttooltipPosition=\"bottom\"\n\t\t\tonClick={ handleClick }\n\t\t\tclassName=\"block-editor-inserter__toggle\"\n\t\t\taria-haspopup={ ! hasSingleBlockType ? 'true' : false }\n\t\t\taria-expanded={ ! hasSingleBlockType ? isOpen : false }\n\t\t\tdisabled={ disabled }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n};\n\nclass Inserter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onToggle = this.onToggle.bind( this );\n\t\tthis.renderToggle = this.renderToggle.bind( this );\n\t\tthis.renderContent = this.renderContent.bind( this );\n\t}\n\n\tonToggle( isOpen ) {\n\t\tconst { onToggle } = this.props;\n\n\t\t// Surface toggle callback to parent component.\n\t\tif ( onToggle ) {\n\t\t\tonToggle( isOpen );\n\t\t}\n\t}\n\n\t/**\n\t * Render callback to display Dropdown toggle element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onToggle Callback to invoke when toggle is\n\t * pressed.\n\t * @param {boolean} options.isOpen Whether dropdown is currently open.\n\t *\n\t * @return {Element} Dropdown toggle element.\n\t */\n\trenderToggle( { onToggle, isOpen } ) {\n\t\tconst {\n\t\t\tdisabled,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\ttoggleProps,\n\t\t\thasItems,\n\t\t\trenderToggle = defaultRenderToggle,\n\t\t} = this.props;\n\n\t\treturn renderToggle( {\n\t\t\tonToggle,\n\t\t\tisOpen,\n\t\t\tdisabled: disabled || ! hasItems,\n\t\t\tblockTitle,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\ttoggleProps,\n\t\t} );\n\t}\n\n\t/**\n\t * Render callback to display Dropdown content element.\n\t *\n\t * @param {Object} options\n\t * @param {Function} options.onClose Callback to invoke when dropdown is\n\t * closed.\n\t *\n\t * @return {Element} Dropdown content element.\n\t */\n\trenderContent( { onClose } ) {\n\t\tconst {\n\t\t\trootClientId,\n\t\t\tclientId,\n\t\t\tisAppender,\n\t\t\tshowInserterHelpPanel,\n\n\t\t\t// This prop is experimental to give some time for the quick inserter to mature\n\t\t\t// Feel free to make them stable after a few releases.\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t\tselectBlockOnInsert,\n\t\t} = this.props;\n\n\t\tif ( isQuick ) {\n\t\t\treturn (\n\t\t\t\t<QuickInserter\n\t\t\t\t\tonSelect={ ( blocks ) => {\n\t\t\t\t\t\tconst firstBlock =\n\t\t\t\t\t\t\tArray.isArray( blocks ) && blocks?.length\n\t\t\t\t\t\t\t\t? blocks[ 0 ]\n\t\t\t\t\t\t\t\t: blocks;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tonSelectOrClose &&\n\t\t\t\t\t\t\ttypeof onSelectOrClose === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonSelectOrClose( firstBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisAppender={ isAppender }\n\t\t\t\t\tselectBlockOnInsert={ selectBlockOnInsert }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<InserterMenu\n\t\t\t\tonSelect={ () => {\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisAppender={ isAppender }\n\t\t\t\tshowInserterHelpPanel={ showInserterHelpPanel }\n\t\t\t/>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tposition,\n\t\t\thasSingleBlockType,\n\t\t\tdirectInsertBlock,\n\t\t\tinsertOnlyAllowedBlock,\n\t\t\t__experimentalIsQuick: isQuick,\n\t\t\tonSelectOrClose,\n\t\t} = this.props;\n\n\t\tif ( hasSingleBlockType || directInsertBlock ) {\n\t\t\treturn this.renderToggle( { onToggle: insertOnlyAllowedBlock } );\n\t\t}\n\n\t\treturn (\n\t\t\t<Dropdown\n\t\t\t\tclassName=\"block-editor-inserter\"\n\t\t\t\tcontentClassName={ clsx( 'block-editor-inserter__popover', {\n\t\t\t\t\t'is-quick': isQuick,\n\t\t\t\t} ) }\n\t\t\t\tpopoverProps={ { position, shift: true } }\n\t\t\t\tonToggle={ this.onToggle }\n\t\t\t\texpandOnMobile\n\t\t\t\theaderTitle={ __( 'Add a block' ) }\n\t\t\t\trenderToggle={ this.renderToggle }\n\t\t\t\trenderContent={ this.renderContent }\n\t\t\t\tonClose={ onSelectOrClose }\n\t\t\t/>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect(\n\t\t( select, { clientId, rootClientId, shouldDirectInsert = true } ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasInserterItems,\n\t\t\t\tgetAllowedBlocks,\n\t\t\t\tgetDirectInsertBlock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst { getBlockVariations } = select( blocksStore );\n\n\t\t\trootClientId =\n\t\t\t\trootClientId || getBlockRootClientId( clientId ) || undefined;\n\n\t\t\tconst allowedBlocks = getAllowedBlocks( rootClientId );\n\n\t\t\tconst directInsertBlock =\n\t\t\t\tshouldDirectInsert && getDirectInsertBlock( rootClientId );\n\n\t\t\tconst hasSingleBlockType =\n\t\t\t\tallowedBlocks?.length === 1 &&\n\t\t\t\tgetBlockVariations( allowedBlocks[ 0 ].name, 'inserter' )\n\t\t\t\t\t?.length === 0;\n\n\t\t\tlet allowedBlockType = false;\n\t\t\tif ( hasSingleBlockType ) {\n\t\t\t\tallowedBlockType = allowedBlocks[ 0 ];\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasItems: hasInserterItems( rootClientId ),\n\t\t\t\thasSingleBlockType,\n\t\t\t\tblockTitle: allowedBlockType ? allowedBlockType.title : '',\n\t\t\t\tallowedBlockType,\n\t\t\t\tdirectInsertBlock,\n\t\t\t\trootClientId,\n\t\t\t};\n\t\t}\n\t),\n\twithDispatch( ( dispatch, ownProps, { select } ) => {\n\t\treturn {\n\t\t\tinsertOnlyAllowedBlock() {\n\t\t\t\tconst {\n\t\t\t\t\trootClientId,\n\t\t\t\t\tclientId,\n\t\t\t\t\tisAppender,\n\t\t\t\t\thasSingleBlockType,\n\t\t\t\t\tallowedBlockType,\n\t\t\t\t\tdirectInsertBlock,\n\t\t\t\t\tonSelectOrClose,\n\t\t\t\t\tselectBlockOnInsert,\n\t\t\t\t} = ownProps;\n\n\t\t\t\tif ( ! hasSingleBlockType && ! directInsertBlock ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfunction getAdjacentBlockAttributes( attributesToCopy ) {\n\t\t\t\t\tconst { getBlock, getPreviousBlockClientId } =\n\t\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! attributesToCopy ||\n\t\t\t\t\t\t( ! clientId && ! rootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = {};\n\t\t\t\t\tlet adjacentAttributes = {};\n\n\t\t\t\t\t// If there is no clientId, then attempt to get attributes\n\t\t\t\t\t// from the last block within innerBlocks of the root block.\n\t\t\t\t\tif ( ! clientId ) {\n\t\t\t\t\t\tconst parentBlock = getBlock( rootClientId );\n\n\t\t\t\t\t\tif ( parentBlock?.innerBlocks?.length ) {\n\t\t\t\t\t\t\tconst lastInnerBlock =\n\t\t\t\t\t\t\t\tparentBlock.innerBlocks[\n\t\t\t\t\t\t\t\t\tparentBlock.innerBlocks.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdirectInsertBlock &&\n\t\t\t\t\t\t\t\tdirectInsertBlock?.name === lastInnerBlock.name\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tadjacentAttributes = lastInnerBlock.attributes;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Otherwise, attempt to get attributes from the\n\t\t\t\t\t\t// previous block relative to the current clientId.\n\t\t\t\t\t\tconst currentBlock = getBlock( clientId );\n\t\t\t\t\t\tconst previousBlock = getBlock(\n\t\t\t\t\t\t\tgetPreviousBlockClientId( clientId )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( currentBlock?.name === previousBlock?.name ) {\n\t\t\t\t\t\t\tadjacentAttributes =\n\t\t\t\t\t\t\t\tpreviousBlock?.attributes || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Copy over only those attributes flagged to be copied.\n\t\t\t\t\tattributesToCopy.forEach( ( attribute ) => {\n\t\t\t\t\t\tif ( adjacentAttributes.hasOwnProperty( attribute ) ) {\n\t\t\t\t\t\t\tresult[ attribute ] =\n\t\t\t\t\t\t\t\tadjacentAttributes[ attribute ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tfunction getInsertionIndex() {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\t} = select( blockEditorStore );\n\n\t\t\t\t\t// If the clientId is defined, we insert at the position of the block.\n\t\t\t\t\tif ( clientId ) {\n\t\t\t\t\t\treturn getBlockIndex( clientId );\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there a selected block, we insert after the selected block.\n\t\t\t\t\tconst end = getBlockSelectionEnd();\n\t\t\t\t\tif (\n\t\t\t\t\t\t! isAppender &&\n\t\t\t\t\t\tend &&\n\t\t\t\t\t\tgetBlockRootClientId( end ) === rootClientId\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn getBlockIndex( end ) + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise, we insert at the end of the current rootClientId.\n\t\t\t\t\treturn getBlockOrder( rootClientId ).length;\n\t\t\t\t}\n\n\t\t\t\tconst { insertBlock } = dispatch( blockEditorStore );\n\n\t\t\t\tlet blockToInsert;\n\n\t\t\t\t// Attempt to augment the directInsertBlock with attributes from an adjacent block.\n\t\t\t\t// This ensures styling from nearby blocks is preserved in the newly inserted block.\n\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/37904\n\t\t\t\tif ( directInsertBlock ) {\n\t\t\t\t\tconst newAttributes = getAdjacentBlockAttributes(\n\t\t\t\t\t\tdirectInsertBlock.attributesToCopy\n\t\t\t\t\t);\n\n\t\t\t\t\tblockToInsert = createBlock( directInsertBlock.name, {\n\t\t\t\t\t\t...( directInsertBlock.attributes || {} ),\n\t\t\t\t\t\t...newAttributes,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tblockToInsert = createBlock( allowedBlockType.name );\n\t\t\t\t}\n\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblockToInsert,\n\t\t\t\t\tgetInsertionIndex(),\n\t\t\t\t\trootClientId,\n\t\t\t\t\tselectBlockOnInsert\n\t\t\t\t);\n\n\t\t\t\tif ( onSelectOrClose ) {\n\t\t\t\t\tonSelectOrClose( blockToInsert );\n\t\t\t\t}\n\n\t\t\t\tconst message = sprintf(\n\t\t\t\t\t// translators: %s: the name of the block that has been added\n\t\t\t\t\t__( '%s block added' ),\n\t\t\t\t\tallowedBlockType.title\n\t\t\t\t);\n\t\t\t\tspeak( message );\n\t\t\t},\n\t\t};\n\t} ),\n\t// The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as\n\t// a way to detect the global Inserter.\n\tifCondition(\n\t\t( { hasItems, isAppender, rootClientId, clientId } ) =>\n\t\t\thasItems || ( ! isAppender && ! rootClientId && ! clientId )\n\t),\n] )( Inserter );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD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AAa;;MAEjB;MACA;MACA;MACA,IAAK3D,iBAAiB,EAAG;QACxB,MAAM4D,aAAa,GAAGtB,0BAA0B,CAC/CtC,iBAAiB,CAACuC,gBACnB,CAAC;QAEDoB,aAAa,GAAG/F,WAAW,CAAEoC,iBAAiB,CAACiC,IAAI,EAAE;UACpD,IAAKjC,iBAAiB,CAAC+C,UAAU,IAAI,CAAC,CAAC,CAAE;UACzC,GAAGa;QACJ,CAAE,CAAC;MACJ,CAAC,MAAM;QACND,aAAa,GAAG/F,WAAW,CAAEsE,gBAAgB,CAACD,IAAK,CAAC;MACrD;MAEAyB,WAAW,CACVC,aAAa,EACbN,iBAAiB,CAAC,CAAC,EACnBlD,YAAY,EACZO,mBACD,CAAC;MAED,IAAKD,eAAe,EAAG;QACtBA,eAAe,CAAEkD,aAAc,CAAC;MACjC;MAEA,MAAME,OAAO,GAAGzG,OAAO;MACtB;MACAF,EAAE,CAAE,gBAAiB,CAAC,EACtBgF,gBAAgB,CAACC,KAClB,CAAC;MACDlF,KAAK,CAAE4G,OAAQ,CAAC;IACjB;EACD,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACAlG,WAAW,CACV,CAAE;EAAEsC,QAAQ;EAAEI,UAAU;EAAEF,YAAY;EAAEC;AAAS,CAAC,KACjDH,QAAQ,IAAM,CAAEI,UAAU,IAAI,CAAEF,YAAY,IAAI,CAAEC,QACpD,CAAC,CACA,CAAC,CAAEX,QAAS,CAAC","ignoreList":[]}
@@ -28,12 +28,22 @@ export const Appender = forwardRef(({
28
28
  setInsertedBlock
29
29
  } = useListViewContext();
30
30
  const instanceId = useInstanceId(Appender);
31
- const hideInserter = useSelect(select => {
31
+ const {
32
+ directInsert,
33
+ hideInserter
34
+ } = useSelect(select => {
32
35
  const {
36
+ getBlockListSettings,
33
37
  getTemplateLock,
34
38
  isZoomOut
35
39
  } = unlock(select(blockEditorStore));
36
- return !!getTemplateLock(clientId) || isZoomOut();
40
+ const settings = getBlockListSettings(clientId);
41
+ const directInsertValue = settings?.directInsert || false;
42
+ const hideInserterValue = !!getTemplateLock(clientId) || isZoomOut();
43
+ return {
44
+ directInsert: directInsertValue,
45
+ hideInserter: hideInserterValue
46
+ };
37
47
  }, [clientId]);
38
48
  const blockTitle = useBlockDisplayTitle({
39
49
  clientId,
@@ -65,7 +75,7 @@ export const Appender = forwardRef(({
65
75
  position: "bottom right",
66
76
  isAppender: true,
67
77
  selectBlockOnInsert: false,
68
- shouldDirectInsert: false,
78
+ shouldDirectInsert: directInsert,
69
79
  __experimentalIsQuick: true,
70
80
  ...props,
71
81
  toggleProps: {
@@ -1 +1 @@
1
- {"version":3,"names":["useInstanceId","speak","useSelect","forwardRef","useEffect","__","sprintf","store","blockEditorStore","useBlockDisplayTitle","useListViewContext","Inserter","AriaReferencedText","unlock","jsx","_jsx","jsxs","_jsxs","Appender","nestingLevel","blockCount","clientId","props","ref","insertedBlock","setInsertedBlock","instanceId","hideInserter","select","getTemplateLock","isZoomOut","blockTitle","context","insertedBlockTitle","length","descriptionId","description","className","children","rootClientId","position","isAppender","selectBlockOnInsert","shouldDirectInsert","__experimentalIsQuick","toggleProps","onSelectOrClose","maybeInsertedBlock","id"],"sources":["@wordpress/block-editor/src/components/list-view/appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { useListViewContext } from './context';\nimport Inserter from '../inserter';\nimport AriaReferencedText from './aria-referenced-text';\nimport { unlock } from '../../lock-unlock';\n\nexport const Appender = forwardRef(\n\t( { nestingLevel, blockCount, clientId, ...props }, ref ) => {\n\t\tconst { insertedBlock, setInsertedBlock } = useListViewContext();\n\n\t\tconst instanceId = useInstanceId( Appender );\n\t\tconst hideInserter = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getTemplateLock, isZoomOut } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\n\t\t\t\treturn !! getTemplateLock( clientId ) || isZoomOut();\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\t\tconst blockTitle = useBlockDisplayTitle( {\n\t\t\tclientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tconst insertedBlockTitle = useBlockDisplayTitle( {\n\t\t\tclientId: insertedBlock?.clientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! insertedBlockTitle?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)\n\t\t\t\t\t__( '%s block inserted' ),\n\t\t\t\t\tinsertedBlockTitle\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}, [ insertedBlockTitle ] );\n\n\t\tif ( hideInserter ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst descriptionId = `list-view-appender__${ instanceId }`;\n\t\tconst description = sprintf(\n\t\t\t/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */\n\t\t\t__( 'Append to %1$s block at position %2$d, Level %3$d' ),\n\t\t\tblockTitle,\n\t\t\tblockCount + 1,\n\t\t\tnestingLevel\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"list-view-appender\">\n\t\t\t\t<Inserter\n\t\t\t\t\tref={ ref }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\tisAppender\n\t\t\t\t\tselectBlockOnInsert={ false }\n\t\t\t\t\tshouldDirectInsert={ false }\n\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t{ ...props }\n\t\t\t\t\ttoggleProps={ { 'aria-describedby': descriptionId } }\n\t\t\t\t\tonSelectOrClose={ ( maybeInsertedBlock ) => {\n\t\t\t\t\t\tif ( maybeInsertedBlock?.clientId ) {\n\t\t\t\t\t\t\tsetInsertedBlock( maybeInsertedBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</AriaReferencedText>\n\t\t\t</div>\n\t\t);\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,SAAS,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,oBAAoB,MAAM,wCAAwC;AACzE,SAASC,kBAAkB,QAAQ,WAAW;AAC9C,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,OAAO,MAAMC,QAAQ,GAAGf,UAAU,CACjC,CAAE;EAAEgB,YAAY;EAAEC,UAAU;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAM;EAC5D,MAAM;IAAEC,aAAa;IAAEC;EAAiB,CAAC,GAAGf,kBAAkB,CAAC,CAAC;EAEhE,MAAMgB,UAAU,GAAG1B,aAAa,CAAEkB,QAAS,CAAC;EAC5C,MAAMS,YAAY,GAAGzB,SAAS,CAC3B0B,MAAM,IAAM;IACb,MAAM;MAAEC,eAAe;MAAEC;IAAU,CAAC,GAAGjB,MAAM,CAC5Ce,MAAM,CAA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AAgB,CAAEsB,kBAAmB,CAAC;QACvC;MACD;IAAG,CACH,CAAC,eACFhC,IAAA,CAACH,kBAAkB;MAACoC,EAAE,EAAGb,aAAe;MAAAG,QAAA,EACrCF;IAAW,CACM,CAAC;EAAA,CACjB,CAAC;AAER,CACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useInstanceId","speak","useSelect","forwardRef","useEffect","__","sprintf","store","blockEditorStore","useBlockDisplayTitle","useListViewContext","Inserter","AriaReferencedText","unlock","jsx","_jsx","jsxs","_jsxs","Appender","nestingLevel","blockCount","clientId","props","ref","insertedBlock","setInsertedBlock","instanceId","directInsert","hideInserter","select","getBlockListSettings","getTemplateLock","isZoomOut","settings","directInsertValue","hideInserterValue","blockTitle","context","insertedBlockTitle","length","descriptionId","description","className","children","rootClientId","position","isAppender","selectBlockOnInsert","shouldDirectInsert","__experimentalIsQuick","toggleProps","onSelectOrClose","maybeInsertedBlock","id"],"sources":["@wordpress/block-editor/src/components/list-view/appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { useListViewContext } from './context';\nimport Inserter from '../inserter';\nimport AriaReferencedText from './aria-referenced-text';\nimport { unlock } from '../../lock-unlock';\n\nexport const Appender = forwardRef(\n\t( { nestingLevel, blockCount, clientId, ...props }, ref ) => {\n\t\tconst { insertedBlock, setInsertedBlock } = useListViewContext();\n\n\t\tconst instanceId = useInstanceId( Appender );\n\t\tconst { directInsert, hideInserter } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getBlockListSettings, getTemplateLock, isZoomOut } =\n\t\t\t\t\tunlock( select( blockEditorStore ) );\n\n\t\t\t\tconst settings = getBlockListSettings( clientId );\n\t\t\t\tconst directInsertValue = settings?.directInsert || false;\n\t\t\t\tconst hideInserterValue =\n\t\t\t\t\t!! getTemplateLock( clientId ) || isZoomOut();\n\n\t\t\t\treturn {\n\t\t\t\t\tdirectInsert: directInsertValue,\n\t\t\t\t\thideInserter: hideInserterValue,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\t\tconst blockTitle = useBlockDisplayTitle( {\n\t\t\tclientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tconst insertedBlockTitle = useBlockDisplayTitle( {\n\t\t\tclientId: insertedBlock?.clientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! insertedBlockTitle?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)\n\t\t\t\t\t__( '%s block inserted' ),\n\t\t\t\t\tinsertedBlockTitle\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}, [ insertedBlockTitle ] );\n\n\t\tif ( hideInserter ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst descriptionId = `list-view-appender__${ instanceId }`;\n\t\tconst description = sprintf(\n\t\t\t/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */\n\t\t\t__( 'Append to %1$s block at position %2$d, Level %3$d' ),\n\t\t\tblockTitle,\n\t\t\tblockCount + 1,\n\t\t\tnestingLevel\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"list-view-appender\">\n\t\t\t\t<Inserter\n\t\t\t\t\tref={ ref }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\tisAppender\n\t\t\t\t\tselectBlockOnInsert={ false }\n\t\t\t\t\tshouldDirectInsert={ directInsert }\n\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t{ ...props }\n\t\t\t\t\ttoggleProps={ { 'aria-describedby': descriptionId } }\n\t\t\t\t\tonSelectOrClose={ ( maybeInsertedBlock ) => {\n\t\t\t\t\t\tif ( maybeInsertedBlock?.clientId ) {\n\t\t\t\t\t\t\tsetInsertedBlock( maybeInsertedBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</AriaReferencedText>\n\t\t\t</div>\n\t\t);\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,SAAS,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,oBAAoB,MAAM,wCAAwC;AACzE,SAASC,kBAAkB,QAAQ,WAAW;AAC9C,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,OAAO,MAAMC,QAAQ,GAAGf,UAAU,CACjC,CAAE;EAAEgB,YAAY;EAAEC,UAAU;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAM;EAC5D,MAAM;IAAEC,aAAa;IAAEC;EAAiB,CAAC,GAAGf,kBAAkB,CAAC,CAAC;EAEhE,MAAMgB,UAAU,GAAG1B,aAAa,CAAEkB,QAAS,CAAC;EAC5C,MAAM;IAAES,YAAY;IAAEC;EAAa,CAAC,GAAG1B,SAAS,CAC7C2B,MAAM,IAAM;I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qB,YAAY,EAAGvB,QAAU;MACzBwB,QAAQ,EAAC,cAAc;MACvBC,UAAU;MACVC,mBAAmB,EAAG,KAAO;MAC7BC,kBAAkB,EAAGrB,YAAc;MACnCsB,qBAAqB;MAAA,GAChB3B,KAAK;MACV4B,WAAW,EAAG;QAAE,kBAAkB,EAAEV;MAAc,CAAG;MACrDW,eAAe,EAAKC,kBAAkB,IAAM;QAC3C,IAAKA,kBAAkB,EAAE/B,QAAQ,EAAG;UACnCI,gBAAgB,CAAE2B,kBAAmB,CAAC;QACvC;MACD;IAAG,CACH,CAAC,eACFrC,IAAA,CAACH,kBAAkB;MAACyC,EAAE,EAAGb,aAAe;MAAAG,QAAA,EACrCF;IAAW,CACM,CAAC;EAAA,CACjB,CAAC;AAER,CACD,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "15.3.0",
3
+ "version": "15.3.1-next.6870dfe5b.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,38 +37,38 @@
37
37
  "@emotion/react": "^11.7.1",
38
38
  "@emotion/styled": "^11.6.0",
39
39
  "@react-spring/web": "^9.4.5",
40
- "@wordpress/a11y": "^4.30.0",
41
- "@wordpress/api-fetch": "^7.30.0",
42
- "@wordpress/blob": "^4.30.0",
43
- "@wordpress/block-serialization-default-parser": "^5.30.0",
44
- "@wordpress/blocks": "^15.3.0",
45
- "@wordpress/commands": "^1.30.0",
46
- "@wordpress/components": "^30.3.0",
47
- "@wordpress/compose": "^7.30.0",
48
- "@wordpress/data": "^10.30.0",
49
- "@wordpress/date": "^5.30.0",
50
- "@wordpress/deprecated": "^4.30.0",
51
- "@wordpress/dom": "^4.30.0",
52
- "@wordpress/element": "^6.30.0",
53
- "@wordpress/escape-html": "^3.30.0",
54
- "@wordpress/hooks": "^4.30.0",
55
- "@wordpress/html-entities": "^4.30.0",
56
- "@wordpress/i18n": "^6.3.0",
57
- "@wordpress/icons": "^10.30.0",
58
- "@wordpress/is-shallow-equal": "^5.30.0",
59
- "@wordpress/keyboard-shortcuts": "^5.30.0",
60
- "@wordpress/keycodes": "^4.30.0",
61
- "@wordpress/notices": "^5.30.0",
62
- "@wordpress/preferences": "^4.30.0",
63
- "@wordpress/priority-queue": "^3.30.0",
64
- "@wordpress/private-apis": "^1.30.0",
65
- "@wordpress/rich-text": "^7.30.0",
66
- "@wordpress/style-engine": "^2.30.0",
67
- "@wordpress/token-list": "^3.30.0",
68
- "@wordpress/upload-media": "^0.15.0",
69
- "@wordpress/url": "^4.30.0",
70
- "@wordpress/warning": "^3.30.0",
71
- "@wordpress/wordcount": "^4.30.0",
40
+ "@wordpress/a11y": "^4.30.1-next.6870dfe5b.0",
41
+ "@wordpress/api-fetch": "^7.30.1-next.6870dfe5b.0",
42
+ "@wordpress/blob": "^4.30.1-next.6870dfe5b.0",
43
+ "@wordpress/block-serialization-default-parser": "^5.30.1-next.6870dfe5b.0",
44
+ "@wordpress/blocks": "^15.3.1-next.6870dfe5b.0",
45
+ "@wordpress/commands": "^1.30.1-next.6870dfe5b.0",
46
+ "@wordpress/components": "^30.3.2-next.6870dfe5b.0",
47
+ "@wordpress/compose": "^7.30.1-next.6870dfe5b.0",
48
+ "@wordpress/data": "^10.30.1-next.6870dfe5b.0",
49
+ "@wordpress/date": "^5.30.1-next.6870dfe5b.0",
50
+ "@wordpress/deprecated": "^4.30.1-next.6870dfe5b.0",
51
+ "@wordpress/dom": "^4.30.1-next.6870dfe5b.0",
52
+ "@wordpress/element": "^6.30.1-next.6870dfe5b.0",
53
+ "@wordpress/escape-html": "^3.30.1-next.6870dfe5b.0",
54
+ "@wordpress/hooks": "^4.30.1-next.6870dfe5b.0",
55
+ "@wordpress/html-entities": "^4.30.1-next.6870dfe5b.0",
56
+ "@wordpress/i18n": "^6.3.1-next.6870dfe5b.0",
57
+ "@wordpress/icons": "^10.30.1-next.6870dfe5b.0",
58
+ "@wordpress/is-shallow-equal": "^5.30.1-next.6870dfe5b.0",
59
+ "@wordpress/keyboard-shortcuts": "^5.30.1-next.6870dfe5b.0",
60
+ "@wordpress/keycodes": "^4.30.1-next.6870dfe5b.0",
61
+ "@wordpress/notices": "^5.30.1-next.6870dfe5b.0",
62
+ "@wordpress/preferences": "^4.30.1-next.6870dfe5b.0",
63
+ "@wordpress/priority-queue": "^3.30.1-next.6870dfe5b.0",
64
+ "@wordpress/private-apis": "^1.30.1-next.6870dfe5b.0",
65
+ "@wordpress/rich-text": "^7.30.1-next.6870dfe5b.0",
66
+ "@wordpress/style-engine": "^2.30.1-next.6870dfe5b.0",
67
+ "@wordpress/token-list": "^3.30.1-next.6870dfe5b.0",
68
+ "@wordpress/upload-media": "^0.15.1-next.6870dfe5b.0",
69
+ "@wordpress/url": "^4.30.1-next.6870dfe5b.0",
70
+ "@wordpress/warning": "^3.30.1-next.6870dfe5b.0",
71
+ "@wordpress/wordcount": "^4.30.1-next.6870dfe5b.0",
72
72
  "change-case": "^4.1.2",
73
73
  "clsx": "^2.1.1",
74
74
  "colord": "^2.7.0",
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "c66cb089eed19d4f4956962fa7b4c81abe6dd513"
94
+ "gitHead": "c8637da9df499cd7b6b07c9fad918f6d45f4de3d"
95
95
  }
@@ -17,14 +17,22 @@ function usePopoverScroll( contentRef ) {
17
17
  const effect = useRefEffect(
18
18
  ( node ) => {
19
19
  function onWheel( event ) {
20
- const { deltaX, deltaY } = event;
20
+ const { deltaX, deltaY, target } = event;
21
21
  const contentEl = contentRef.current;
22
22
  let scrollContainer = scrollContainerCache.get( contentEl );
23
23
  if ( ! scrollContainer ) {
24
24
  scrollContainer = getScrollContainer( contentEl );
25
25
  scrollContainerCache.set( contentEl, scrollContainer );
26
26
  }
27
- scrollContainer.scrollBy( deltaX, deltaY );
27
+ // Finds a scrollable ancestor of the event’s target. It's not cached because the
28
+ // it may not remain scrollable due to popover position changes. The cache is also
29
+ // less likely to be utilized because the target may be different every event.
30
+ const eventScrollContainer = getScrollContainer( target );
31
+ // Scrolls “through” the popover only if another contained scrollable area isn’t
32
+ // in front of it. This is to avoid scrolling both containers simultaneously.
33
+ if ( ! node.contains( eventScrollContainer ) ) {
34
+ scrollContainer.scrollBy( deltaX, deltaY );
35
+ }
28
36
  }
29
37
  // Tell the browser that we do not call event.preventDefault
30
38
  // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
@@ -36,7 +36,7 @@ export function useShowBlockTools() {
36
36
  const hasSelectedBlock = !! clientId && !! block;
37
37
  const isEmptyDefaultBlock =
38
38
  hasSelectedBlock &&
39
- isUnmodifiedDefaultBlock( block ) &&
39
+ isUnmodifiedDefaultBlock( block, 'content' ) &&
40
40
  getBlockMode( clientId ) !== 'html';
41
41
  const _showEmptyBlockSideInserter =
42
42
  clientId &&
@@ -151,7 +151,7 @@ function useInsertionPoint( {
151
151
  if (
152
152
  ! isAppender &&
153
153
  selectedBlock &&
154
- isUnmodifiedDefaultBlock( selectedBlock )
154
+ isUnmodifiedDefaultBlock( selectedBlock, 'content' )
155
155
  ) {
156
156
  replaceBlocks(
157
157
  selectedBlock.clientId,
@@ -386,9 +386,7 @@ export default compose( [
386
386
  );
387
387
 
388
388
  if ( onSelectOrClose ) {
389
- onSelectOrClose( {
390
- clientId: blockToInsert?.clientId,
391
- } );
389
+ onSelectOrClose( blockToInsert );
392
390
  }
393
391
 
394
392
  const message = sprintf(
@@ -22,13 +22,20 @@ export const Appender = forwardRef(
22
22
  const { insertedBlock, setInsertedBlock } = useListViewContext();
23
23
 
24
24
  const instanceId = useInstanceId( Appender );
25
- const hideInserter = useSelect(
25
+ const { directInsert, hideInserter } = useSelect(
26
26
  ( select ) => {
27
- const { getTemplateLock, isZoomOut } = unlock(
28
- select( blockEditorStore )
29
- );
27
+ const { getBlockListSettings, getTemplateLock, isZoomOut } =
28
+ unlock( select( blockEditorStore ) );
30
29
 
31
- return !! getTemplateLock( clientId ) || isZoomOut();
30
+ const settings = getBlockListSettings( clientId );
31
+ const directInsertValue = settings?.directInsert || false;
32
+ const hideInserterValue =
33
+ !! getTemplateLock( clientId ) || isZoomOut();
34
+
35
+ return {
36
+ directInsert: directInsertValue,
37
+ hideInserter: hideInserterValue,
38
+ };
32
39
  },
33
40
  [ clientId ]
34
41
  );
@@ -79,7 +86,7 @@ export const Appender = forwardRef(
79
86
  position="bottom right"
80
87
  isAppender
81
88
  selectBlockOnInsert={ false }
82
- shouldDirectInsert={ false }
89
+ shouldDirectInsert={ directInsert }
83
90
  __experimentalIsQuick
84
91
  { ...props }
85
92
  toggleProps={ { 'aria-describedby': descriptionId } }
@@ -1 +1 @@
1
- {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/create-interpolate-element.d.ts","../element/build-types/react.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/components/block-context/index.js","./src/utils/dom.js"],"fileIdsList":[[82],[79,80,81],[82,92],[83,84,87,88,89,90,91],[85,86]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","impliedFormat":1},{"version":"f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","impliedFormat":1},{"version":"8ca4709dbd22a34bcc1ebf93e1877645bdb02ebd3f3d9a211a299a8db2ee4ba1","affectsGlobalScope":true,"impliedFormat":1},"4c506b14512049dfe6f4ceb172b13c6af03663f85ba61fc57efbe6c2e7be9f44","4405cd67ec5f7f748fd793be0ce5842fa0808955b8e37518c011abfa5ab63ba5",{"version":"adb17fea4d847e1267ae1241fa1ac3917c7e332999ebdab388a24d82d4f58240","impliedFormat":1},{"version":"05321b823dd3781d0b6aac8700bfdc0c9181d56479fe52ba6a40c9196fd661a8","impliedFormat":1},"472c14cdec534a465e866b6e1feee2d4e0d89c15fdc33ba80ff034fa0e80f3c1","4d807d55c784b72f71c092c34c84d09b95c29500c30252538fd5cf9a0a788c0e","df43a3968118d4b16618d7a0ac8ba89337fcce3c39e39984087ac34bf0cf250c","4714d89e7ea47b8f79a4d448a11674b2a724f93ab03cfa6879dafbab0f0c5a15","0477d6f95592fb84f29cf39d28ed5c77050940365cdc9841f0b94b216dee22a9","af88a0b0f808a6721401550621bfe67c46c6fd55000305058e7c73600d119a9b",{"version":"d26d45d20aee511113ff57b6aa8c82196dddb017554ecb9ee7be812840c4cf9b","signature":"3dd80666c91b4c1ddb04cbf93038f90420af9bc18d7978acb4b9d7a302238f19"},{"version":"e757e00105e7eb8c10520c9033ae8005c04725113f26893732184904ae75b6db","signature":"6144eb6dda3faf523032f1a739fbfa47f4aea6605695f1e1d698fad2d737f080"}],"root":[93,94],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"referencedMap":[[86,1],[85,1],[82,2],[93,3],[83,1],[92,4],[91,1],[87,5],[84,1],[90,1]],"latestChangedDtsFile":"./build-types/utils/dom.d.ts","version":"5.7.2"}
1
+ {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/components/block-context/index.js","./src/utils/dom.js"],"fileIdsList":[[82],[79,80,81],[82,92],[83],[83,84,87,88,89,90,91],[85,86]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","impliedFormat":1},{"version":"f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","impliedFormat":1},{"version":"8ca4709dbd22a34bcc1ebf93e1877645bdb02ebd3f3d9a211a299a8db2ee4ba1","affectsGlobalScope":true,"impliedFormat":1},"8edfedbbfbc673f4013427909a3129dd67823d8818026a1aa7bb9848633c0e06","95b7b0a5e159ca43e65b4f73d04ad52543f9a9ce1992de2cd4ba9dedfb4e9a89",{"version":"adb17fea4d847e1267ae1241fa1ac3917c7e332999ebdab388a24d82d4f58240","impliedFormat":1},{"version":"05321b823dd3781d0b6aac8700bfdc0c9181d56479fe52ba6a40c9196fd661a8","impliedFormat":1},"b3a0bb08302863aec642c6c07f5acce250c3feef596e29ddac6852627d81f5f3","a20f5aad5792eefce9e444a634a6187fe29c1aa38e4b4e04d2b258eaf31438da","724dea542a8ce824d92eacad1dc5981aa4545407a0f026bc453a65dad69b92ea","b14cb61bd7e8a1bf3abfdeaf26d869afae03c8ca4cdb855510348b2e75337170","4ea75827e64f83b36d56a1d632fb8f28eec70bdf90eff351002a880690e3fd42","e2877cc0e5f7bb33c7751b0e66c102d26cb2423e65908fde2ed3093d571ee264",{"version":"d26d45d20aee511113ff57b6aa8c82196dddb017554ecb9ee7be812840c4cf9b","signature":"3dd80666c91b4c1ddb04cbf93038f90420af9bc18d7978acb4b9d7a302238f19"},{"version":"e757e00105e7eb8c10520c9033ae8005c04725113f26893732184904ae75b6db","signature":"6144eb6dda3faf523032f1a739fbfa47f4aea6605695f1e1d698fad2d737f080"}],"root":[93,94],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"referencedMap":[[86,1],[85,1],[82,2],[93,3],[84,4],[92,5],[87,6],[83,1]],"latestChangedDtsFile":"./build-types/utils/dom.d.ts","version":"5.7.2"}