@wordpress/block-editor 15.2.1-next.f34ab90e9.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 (125) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-actions/index.js +3 -1
  3. package/build/components/block-actions/index.js.map +1 -1
  4. package/build/components/block-context/index.js +1 -0
  5. package/build/components/block-context/index.js.map +1 -1
  6. package/build/components/block-edit/context.js +1 -0
  7. package/build/components/block-edit/context.js.map +1 -1
  8. package/build/components/block-list/index.js +1 -0
  9. package/build/components/block-list/index.js.map +1 -1
  10. package/build/components/block-list/layout.js +1 -0
  11. package/build/components/block-list/layout.js.map +1 -1
  12. package/build/components/block-list/private-block-context.js +1 -0
  13. package/build/components/block-list/private-block-context.js.map +1 -1
  14. package/build/components/block-popover/inbetween.js +1 -2
  15. package/build/components/block-popover/inbetween.js.map +1 -1
  16. package/build/components/block-popover/use-popover-scroll.js +11 -2
  17. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  18. package/build/components/block-toolbar/block-name-context.js +1 -0
  19. package/build/components/block-toolbar/block-name-context.js.map +1 -1
  20. package/build/components/block-tools/insertion-point.js +1 -0
  21. package/build/components/block-tools/insertion-point.js.map +1 -1
  22. package/build/components/block-tools/use-show-block-tools.js +1 -1
  23. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  24. package/build/components/global-styles/context.js +1 -0
  25. package/build/components/global-styles/context.js.map +1 -1
  26. package/build/components/image-editor/context.js +1 -0
  27. package/build/components/image-editor/context.js.map +1 -1
  28. package/build/components/inserter/hooks/use-insertion-point.js +1 -1
  29. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  30. package/build/components/inserter/index.js +1 -3
  31. package/build/components/inserter/index.js.map +1 -1
  32. package/build/components/inserter-listbox/context.js +1 -0
  33. package/build/components/inserter-listbox/context.js.map +1 -1
  34. package/build/components/inserter-listbox/index.js +11 -2
  35. package/build/components/inserter-listbox/index.js.map +1 -1
  36. package/build/components/list-view/appender.js +13 -3
  37. package/build/components/list-view/appender.js.map +1 -1
  38. package/build/components/list-view/context.js +1 -0
  39. package/build/components/list-view/context.js.map +1 -1
  40. package/build/components/provider/block-refs-provider.js +1 -0
  41. package/build/components/provider/block-refs-provider.js.map +1 -1
  42. package/build/components/recursion-provider/index.js +1 -0
  43. package/build/components/recursion-provider/index.js.map +1 -1
  44. package/build/components/rich-text/index.js +2 -0
  45. package/build/components/rich-text/index.js.map +1 -1
  46. package/build/store/private-selectors.js +25 -0
  47. package/build/store/private-selectors.js.map +1 -1
  48. package/build/store/selectors.js +25 -5
  49. package/build/store/selectors.js.map +1 -1
  50. package/build-module/components/block-actions/index.js +3 -1
  51. package/build-module/components/block-actions/index.js.map +1 -1
  52. package/build-module/components/block-context/index.js +1 -0
  53. package/build-module/components/block-context/index.js.map +1 -1
  54. package/build-module/components/block-edit/context.js +1 -0
  55. package/build-module/components/block-edit/context.js.map +1 -1
  56. package/build-module/components/block-list/index.js +1 -0
  57. package/build-module/components/block-list/index.js.map +1 -1
  58. package/build-module/components/block-list/layout.js +1 -0
  59. package/build-module/components/block-list/layout.js.map +1 -1
  60. package/build-module/components/block-list/private-block-context.js +1 -0
  61. package/build-module/components/block-list/private-block-context.js.map +1 -1
  62. package/build-module/components/block-popover/inbetween.js +1 -2
  63. package/build-module/components/block-popover/inbetween.js.map +1 -1
  64. package/build-module/components/block-popover/use-popover-scroll.js +11 -2
  65. package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
  66. package/build-module/components/block-toolbar/block-name-context.js +1 -0
  67. package/build-module/components/block-toolbar/block-name-context.js.map +1 -1
  68. package/build-module/components/block-tools/insertion-point.js +1 -0
  69. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  70. package/build-module/components/block-tools/use-show-block-tools.js +1 -1
  71. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  72. package/build-module/components/global-styles/context.js +1 -0
  73. package/build-module/components/global-styles/context.js.map +1 -1
  74. package/build-module/components/image-editor/context.js +1 -0
  75. package/build-module/components/image-editor/context.js.map +1 -1
  76. package/build-module/components/inserter/hooks/use-insertion-point.js +1 -1
  77. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  78. package/build-module/components/inserter/index.js +1 -3
  79. package/build-module/components/inserter/index.js.map +1 -1
  80. package/build-module/components/inserter-listbox/context.js +1 -0
  81. package/build-module/components/inserter-listbox/context.js.map +1 -1
  82. package/build-module/components/inserter-listbox/index.js +11 -2
  83. package/build-module/components/inserter-listbox/index.js.map +1 -1
  84. package/build-module/components/list-view/appender.js +13 -3
  85. package/build-module/components/list-view/appender.js.map +1 -1
  86. package/build-module/components/list-view/context.js +1 -0
  87. package/build-module/components/list-view/context.js.map +1 -1
  88. package/build-module/components/provider/block-refs-provider.js +1 -0
  89. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  90. package/build-module/components/recursion-provider/index.js +1 -0
  91. package/build-module/components/recursion-provider/index.js.map +1 -1
  92. package/build-module/components/rich-text/index.js +2 -0
  93. package/build-module/components/rich-text/index.js.map +1 -1
  94. package/build-module/store/private-selectors.js +24 -0
  95. package/build-module/store/private-selectors.js.map +1 -1
  96. package/build-module/store/selectors.js +26 -7
  97. package/build-module/store/selectors.js.map +1 -1
  98. package/build-types/components/block-context/index.d.ts.map +1 -1
  99. package/package.json +34 -34
  100. package/src/components/block-actions/index.js +6 -1
  101. package/src/components/block-context/index.js +1 -0
  102. package/src/components/block-draggable/test/helpers.native.js +8 -8
  103. package/src/components/block-edit/context.js +2 -0
  104. package/src/components/block-list/index.js +2 -0
  105. package/src/components/block-list/layout.js +1 -0
  106. package/src/components/block-list/private-block-context.js +1 -0
  107. package/src/components/block-popover/inbetween.js +1 -8
  108. package/src/components/block-popover/use-popover-scroll.js +10 -2
  109. package/src/components/block-toolbar/block-name-context.js +1 -0
  110. package/src/components/block-tools/insertion-point.js +1 -0
  111. package/src/components/block-tools/use-show-block-tools.js +1 -1
  112. package/src/components/global-styles/context.js +1 -0
  113. package/src/components/image-editor/context.js +1 -0
  114. package/src/components/inserter/hooks/use-insertion-point.js +1 -1
  115. package/src/components/inserter/index.js +1 -3
  116. package/src/components/inserter-listbox/context.js +1 -0
  117. package/src/components/inserter-listbox/index.js +10 -1
  118. package/src/components/list-view/appender.js +13 -6
  119. package/src/components/list-view/context.js +1 -0
  120. package/src/components/provider/block-refs-provider.js +1 -0
  121. package/src/components/recursion-provider/index.js +1 -0
  122. package/src/components/rich-text/index.js +3 -0
  123. package/src/store/private-selectors.js +29 -0
  124. package/src/store/selectors.js +42 -6
  125. package/tsconfig.tsbuildinfo +1 -1
@@ -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,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9B,QAAQ,EAAG;MACfA,QAAQ,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":[]}
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,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,YAAa,CAAC;EACnD,IAAKK,WAAW,KAAK,CAAC,CAAC,EAAG;IACzB,OACCJ,QAAQ,CACNE,MAAM,CAAER,gBAAiB,CAAC,CAC1BY,aAAa,CAAEL,OAAO,CAAEG,WAAW,GAAG,CAAC,CAAG,CAAC,GAAG,CAAC;EAEnD;EACA,OAAOJ,QAAQ,CAACE,MAAM,CAAER,gBAAiB,CAAC,CAACa,aAA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AuB,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,SA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;;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,CAAE;UAChBL,QAAQ,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,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;AAChB,CAAC,KAAM;EACN,MAAM;IACLC,EAAE,EAAEC,OAAO,GAAGvB,MAAM;IACpBwB,KAAK,EAAEC,SAAS;IAChBC,OAAO;IACP,GAAGC;EACJ,CAAC,GAAGN,WAAW;EAEf,IAAIG,KAAK,GAAGC,SAAS;EACrB,IAAK,CAAED,KAAK,IAAIJ,k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;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":[]}
@@ -3,5 +3,6 @@
3
3
  */
4
4
  import { createContext } from '@wordpress/element';
5
5
  const InserterListboxContext = createContext();
6
+ InserterListboxContext.displayName = 'InserterListboxContext';
6
7
  export default InserterListboxContext;
7
8
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","InserterListboxContext"],"sources":["@wordpress/block-editor/src/components/inserter-listbox/context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nconst InserterListboxContext = createContext();\n\nexport default InserterListboxContext;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAElD,MAAMC,sBAAsB,GAAGD,aAAa,CAAC,CAAC;AAE9C,eAAeC,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["createContext","InserterListboxContext","displayName"],"sources":["@wordpress/block-editor/src/components/inserter-listbox/context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nconst InserterListboxContext = createContext();\nInserterListboxContext.displayName = 'InserterListboxContext';\n\nexport default InserterListboxContext;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAElD,MAAMC,sBAAsB,GAAGD,aAAa,CAAC,CAAC;AAC9CC,sBAAsB,CAACC,WAAW,GAAG,wBAAwB;AAE7D,eAAeD,sBAAsB","ignoreList":[]}
@@ -2,21 +2,30 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { Composite } from '@wordpress/components';
5
+ import { Fragment } from '@wordpress/element';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
8
9
  */
9
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
10
11
  export { default as InserterListboxGroup } from './group';
11
12
  export { default as InserterListboxRow } from './row';
12
13
  export { default as InserterListboxItem } from './item';
14
+ function InserterListBoxWrapper({
15
+ key,
16
+ children
17
+ }) {
18
+ return /*#__PURE__*/_jsx(Fragment, {
19
+ children: children
20
+ }, key);
21
+ }
13
22
  function InserterListbox({
14
23
  children
15
24
  }) {
16
25
  return /*#__PURE__*/_jsx(Composite, {
17
26
  focusShift: true,
18
27
  focusWrap: "horizontal",
19
- render: /*#__PURE__*/_jsx(_Fragment, {}),
28
+ render: InserterListBoxWrapper,
20
29
  children: children
21
30
  });
22
31
  }
@@ -1 +1 @@
1
- {"version":3,"names":["Composite","Fragment","_Fragment","jsx","_jsx","default","InserterListboxGroup","InserterListboxRow","InserterListboxItem","InserterListbox","children","focusShift","focusWrap","render"],"sources":["@wordpress/block-editor/src/components/inserter-listbox/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Composite } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\n\nexport { default as InserterListboxGroup } from './group';\nexport { default as InserterListboxRow } from './row';\nexport { default as InserterListboxItem } from './item';\n\nfunction InserterListbox( { children } ) {\n\treturn (\n\t\t<Composite focusShift focusWrap=\"horizontal\" render={ <></> }>\n\t\t\t{ children }\n\t\t</Composite>\n\t);\n}\n\nexport default InserterListbox;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;;AAEjD;AACA;AACA;AAFA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAIA,SAASC,OAAO,IAAIC,oBAAoB,QAAQ,SAAS;AACzD,SAASD,OAAO,IAAIE,kBAAkB,QAAQ,OAAO;AACrD,SAASF,OAAO,IAAIG,mBAAmB,QAAQ,QAAQ;AAEvD,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACxC,oBACCN,IAAA,CAACJ,SAAS;IAACW,UAAU;IAACC,SAAS,EAAC,YAAY;IAACC,MAAM,eAAGT,IAAA,CAAAF,SAAA,IAAI,CAAG;IAAAQ,QAAA,EAC1DA;EAAQ,CACA,CAAC;AAEd;AAEA,eAAeD,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["Composite","Fragment","jsx","_jsx","default","InserterListboxGroup","InserterListboxRow","InserterListboxItem","InserterListBoxWrapper","key","children","InserterListbox","focusShift","focusWrap","render"],"sources":["@wordpress/block-editor/src/components/inserter-listbox/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Composite } from '@wordpress/components';\nimport { Fragment } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nexport { default as InserterListboxGroup } from './group';\nexport { default as InserterListboxRow } from './row';\nexport { default as InserterListboxItem } from './item';\n\nfunction InserterListBoxWrapper( { key, children } ) {\n\treturn <Fragment key={ key }>{ children }</Fragment>;\n}\n\nfunction InserterListbox( { children } ) {\n\treturn (\n\t\t<Composite\n\t\t\tfocusShift\n\t\t\tfocusWrap=\"horizontal\"\n\t\t\trender={ InserterListBoxWrapper }\n\t\t>\n\t\t\t{ children }\n\t\t</Composite>\n\t);\n}\n\nexport default InserterListbox;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;AACjD,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAIA,SAASC,OAAO,IAAIC,oBAAoB,QAAQ,SAAS;AACzD,SAASD,OAAO,IAAIE,kBAAkB,QAAQ,OAAO;AACrD,SAASF,OAAO,IAAIG,mBAAmB,QAAQ,QAAQ;AAEvD,SAASC,sBAAsBA,CAAE;EAAEC,GAAG;EAAEC;AAAS,CAAC,EAAG;EACpD,oBAAOP,IAAA,CAACF,QAAQ;IAAAS,QAAA,EAAeA;EAAQ,GAAhBD,GAA4B,CAAC;AACrD;AAEA,SAASE,eAAeA,CAAE;EAAED;AAAS,CAAC,EAAG;EACxC,oBACCP,IAAA,CAACH,SAAS;IACTY,UAAU;IACVC,SAAS,EAAC,YAAY;IACtBC,MAAM,EAAGN,sBAAwB;IAAAE,QAAA,EAE/BA;EAAQ,CACA,CAAC;AAEd;AAEA,eAAeC,eAAe","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,M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1B;EACAD,EAAE,CAAE,mDAAoD,CAAC,EACzD0B,UAAU,EACVX,UAAU,GAAG,CAAC,EACdD,YACD,CAAC;EAED,oBACCF,KAAA;IAAKoB,SAAS,EAAC,oBAAoB;IAAAC,QAAA,gBAClCvB,IAAA,CAACJ,QAAQ;MACRY,GAAG,EAAGA,GAAK;MACXgB,YAAY,EAAGlB,QAAU;MACzBmB,QAAQ,EAAC,cAAc;MACvBC,UAAU;MACVC,mBAAmB,EAAG,KAAO;MAC7BC,kBAAkB,EAAG,KAAO;MAC5BC,qBAAqB;MAAA,GAChBtB,KAAK;MACVuB,WAAW,EAAG;QAAE,kBAAkB,EAAEV;MAAc,CAAG;MACrDW,eAAe,EAAKC,kBAAkB,IAAM;QAC3C,IAAKA,kBAAkB,EAAE1B,QAAQ,EAAG;UACnCI,gBAAgB,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;AAC9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,EAAG;MACnC;IACD;IAEAtC,KAAK,CACJK,OAAO;IACN;IACAD,EAAE,CAAE,mBAAoB,CAAC,EACzBiC,kBACD,CAAC,EACD,WACD,CAAC;EACF,CAAC,EAAE,CAAEA,kBAAkB,CAAG,CAAC;EAE3B,IAAKV,YAAY,EAAG;IACnB,OAAO,IAAI;EACZ;EAEA,MAAMY,aAAa,GAAG,uBAAwBd,UAAU,EAAG;EAC3D,MAAMe,WAAW,GAAGnC,OAAO,CAC1B;EACAD,EAAE,CAAE,mDAAoD,CAAC,EACzD+B,UAAU,EACVhB,UAAU,GAAG,CAAC,EACdD,YACD,CAAC;EAED,oBACCF,KAAA;IAAKyB,SAAS,EAAC,oBAAoB;IAAAC,QAAA,gBAClC5B,IAAA,CAACJ,QAAQ;MACRY,GAAG,EAAGA,GAAK;MACXqB,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":[]}
@@ -3,5 +3,6 @@
3
3
  */
4
4
  import { createContext, useContext } from '@wordpress/element';
5
5
  export const ListViewContext = createContext({});
6
+ ListViewContext.displayName = 'ListViewContext';
6
7
  export const useListViewContext = () => useContext(ListViewContext);
7
8
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContext","ListViewContext","useListViewContext"],"sources":["@wordpress/block-editor/src/components/list-view/context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\nexport const ListViewContext = createContext( {} );\n\nexport const useListViewContext = () => useContext( ListViewContext );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,oBAAoB;AAE9D,OAAO,MAAMC,eAAe,GAAGF,aAAa,CAAE,CAAC,CAAE,CAAC;AAElD,OAAO,MAAMG,kBAAkB,GAAGA,CAAA,KAAMF,UAAU,CAAEC,eAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createContext","useContext","ListViewContext","displayName","useListViewContext"],"sources":["@wordpress/block-editor/src/components/list-view/context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\nexport const ListViewContext = createContext( {} );\nListViewContext.displayName = 'ListViewContext';\n\nexport const useListViewContext = () => useContext( ListViewContext );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,oBAAoB;AAE9D,OAAO,MAAMC,eAAe,GAAGF,aAAa,CAAE,CAAC,CAAE,CAAC;AAClDE,eAAe,CAACC,WAAW,GAAG,iBAAiB;AAE/C,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAMH,UAAU,CAAEC,eAAgB,CAAC","ignoreList":[]}
@@ -7,6 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
7
7
  export const BlockRefs = createContext({
8
8
  refsMap: observableMap()
9
9
  });
10
+ BlockRefs.displayName = 'BlockRefsContext';
10
11
  export function BlockRefsProvider({
11
12
  children
12
13
  }) {
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useMemo","observableMap","jsx","_jsx","BlockRefs","refsMap","BlockRefsProvider","children","value","Provider"],"sources":["@wordpress/block-editor/src/components/provider/block-refs-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useMemo } from '@wordpress/element';\nimport { observableMap } from '@wordpress/compose';\n\nexport const BlockRefs = createContext( { refsMap: observableMap() } );\n\nexport function BlockRefsProvider( { children } ) {\n\tconst value = useMemo( () => ( { refsMap: observableMap() } ), [] );\n\treturn (\n\t\t<BlockRefs.Provider value={ value }>{ children }</BlockRefs.Provider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,OAAO,QAAQ,oBAAoB;AAC3D,SAASC,aAAa,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,OAAO,MAAMC,SAAS,GAAGL,aAAa,CAAE;EAAEM,OAAO,EAAEJ,aAAa,CAAC;AAAE,CAAE,CAAC;AAEtE,OAAO,SAASK,iBAAiBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,KAAK,GAAGR,OAAO,CAAE,OAAQ;IAAEK,OAAO,EAAEJ,aAAa,CAAC;EAAE,CAAC,CAAE,EAAE,EAAG,CAAC;EACnE,oBACCE,IAAA,CAACC,SAAS,CAACK,QAAQ;IAACD,KAAK,EAAGA,KAAO;IAAAD,QAAA,EAAGA;EAAQ,CAAsB,CAAC;AAEvE","ignoreList":[]}
1
+ {"version":3,"names":["createContext","useMemo","observableMap","jsx","_jsx","BlockRefs","refsMap","displayName","BlockRefsProvider","children","value","Provider"],"sources":["@wordpress/block-editor/src/components/provider/block-refs-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useMemo } from '@wordpress/element';\nimport { observableMap } from '@wordpress/compose';\n\nexport const BlockRefs = createContext( { refsMap: observableMap() } );\nBlockRefs.displayName = 'BlockRefsContext';\n\nexport function BlockRefsProvider( { children } ) {\n\tconst value = useMemo( () => ( { refsMap: observableMap() } ), [] );\n\treturn (\n\t\t<BlockRefs.Provider value={ value }>{ children }</BlockRefs.Provider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,OAAO,QAAQ,oBAAoB;AAC3D,SAASC,aAAa,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,OAAO,MAAMC,SAAS,GAAGL,aAAa,CAAE;EAAEM,OAAO,EAAEJ,aAAa,CAAC;AAAE,CAAE,CAAC;AACtEG,SAAS,CAACE,WAAW,GAAG,kBAAkB;AAE1C,OAAO,SAASC,iBAAiBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,KAAK,GAAGT,OAAO,CAAE,OAAQ;IAAEK,OAAO,EAAEJ,aAAa,CAAC;EAAE,CAAC,CAAE,EAAE,EAAG,CAAC;EACnE,oBACCE,IAAA,CAACC,SAAS,CAACM,QAAQ;IAACD,KAAK,EAAGA,KAAO;IAAAD,QAAA,EAAGA;EAAQ,CAAsB,CAAC;AAEvE","ignoreList":[]}
@@ -10,6 +10,7 @@ import deprecated from '@wordpress/deprecated';
10
10
  import { useBlockEditContext } from '../block-edit/context';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  const RenderedRefsContext = createContext({});
13
+ RenderedRefsContext.displayName = 'RenderedRefsContext';
13
14
 
14
15
  /**
15
16
  * Immutably adds an unique identifier to a set scoped for a given block type.
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContext","useMemo","deprecated","useBlockEditContext","jsx","_jsx","RenderedRefsContext","addToBlockType","renderedBlocks","blockName","uniqueId","result","Set","add","RecursionProvider","children","previouslyRenderedBlocks","name","newRenderedBlocks","Provider","value","useHasRecursion","Boolean","has","DeprecatedExperimentalRecursionProvider","props","since","alternative","DeprecatedExperimentalUseHasRecursion","args"],"sources":["@wordpress/block-editor/src/components/recursion-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\n\nconst RenderedRefsContext = createContext( {} );\n\n/**\n * Immutably adds an unique identifier to a set scoped for a given block type.\n *\n * @param {Object} renderedBlocks Rendered blocks grouped by block name\n * @param {string} blockName Name of the block.\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n *\n * @return {Object} The list of rendered blocks grouped by block name.\n */\nfunction addToBlockType( renderedBlocks, blockName, uniqueId ) {\n\tconst result = {\n\t\t...renderedBlocks,\n\t\t[ blockName ]: renderedBlocks[ blockName ]\n\t\t\t? new Set( renderedBlocks[ blockName ] )\n\t\t\t: new Set(),\n\t};\n\tresult[ blockName ].add( uniqueId );\n\n\treturn result;\n}\n\n/**\n * A React context provider for use with the `useHasRecursion` hook to prevent recursive\n * renders.\n *\n * Wrap block content with this provider and provide the same `uniqueId` prop as used\n * with `useHasRecursion`.\n *\n * @param {Object} props\n * @param {*} props.uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} props.blockName Optional block name.\n * @param {JSX.Element} props.children React children.\n *\n * @return {JSX.Element} A React element.\n */\nexport function RecursionProvider( { children, uniqueId, blockName = '' } ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\n\tblockName = blockName || name;\n\n\tconst newRenderedBlocks = useMemo(\n\t\t() => addToBlockType( previouslyRenderedBlocks, blockName, uniqueId ),\n\t\t[ previouslyRenderedBlocks, blockName, uniqueId ]\n\t);\n\n\treturn (\n\t\t<RenderedRefsContext.Provider value={ newRenderedBlocks }>\n\t\t\t{ children }\n\t\t</RenderedRefsContext.Provider>\n\t);\n}\n\n/**\n * A React hook for keeping track of blocks previously rendered up in the block\n * tree. Blocks susceptible to recursion can use this hook in their `Edit`\n * function to prevent said recursion.\n *\n * Use this with the `RecursionProvider` component, using the same `uniqueId` value\n * for both the hook and the provider.\n *\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} blockName Optional block name.\n *\n * @return {boolean} A boolean describing whether the provided id has already been rendered.\n */\nexport function useHasRecursion( uniqueId, blockName = '' ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\tblockName = blockName || name;\n\treturn Boolean( previouslyRenderedBlocks[ blockName ]?.has( uniqueId ) );\n}\n\nexport const DeprecatedExperimentalRecursionProvider = ( props ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalRecursionProvider', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.RecursionProvider',\n\t} );\n\treturn <RecursionProvider { ...props } />;\n};\n\nexport const DeprecatedExperimentalUseHasRecursion = ( ...args ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalUseHasRecursion', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.useHasRecursion',\n\t} );\n\treturn useHasRecursion( ...args );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACvE,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,MAAMC,mBAAmB,GAAGP,aAAa,CAAE,CAAC,CAAE,CAAC;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASQ,cAAcA,CAAEC,cAAc,EAAEC,SAAS,EAAEC,QAAQ,EAAG;EAC9D,MAAMC,MAAM,GAAG;IACd,GAAGH,cAAc;IACjB,CAAEC,SAAS,GAAID,cAAc,CAAEC,SAAS,CAAE,GACvC,IAAIG,GAAG,CAAEJ,cAAc,CAAEC,SAAS,CAAG,CAAC,GACtC,IAAIG,GAAG,CAAC;EACZ,CAAC;EACDD,MAAM,CAAEF,SAAS,CAAE,CAACI,GAAG,CAAEH,QAAS,CAAC;EAEnC,OAAOC,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEL,QAAQ;EAAED,SAAS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AAE,CAAC;EACH,OAAON,eAAe,CAAE,GAAGQ,IAAK,CAAC;AAClC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createContext","useContext","useMemo","deprecated","useBlockEditContext","jsx","_jsx","RenderedRefsContext","displayName","addToBlockType","renderedBlocks","blockName","uniqueId","result","Set","add","RecursionProvider","children","previouslyRenderedBlocks","name","newRenderedBlocks","Provider","value","useHasRecursion","Boolean","has","DeprecatedExperimentalRecursionProvider","props","since","alternative","DeprecatedExperimentalUseHasRecursion","args"],"sources":["@wordpress/block-editor/src/components/recursion-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\n\nconst RenderedRefsContext = createContext( {} );\nRenderedRefsContext.displayName = 'RenderedRefsContext';\n\n/**\n * Immutably adds an unique identifier to a set scoped for a given block type.\n *\n * @param {Object} renderedBlocks Rendered blocks grouped by block name\n * @param {string} blockName Name of the block.\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n *\n * @return {Object} The list of rendered blocks grouped by block name.\n */\nfunction addToBlockType( renderedBlocks, blockName, uniqueId ) {\n\tconst result = {\n\t\t...renderedBlocks,\n\t\t[ blockName ]: renderedBlocks[ blockName ]\n\t\t\t? new Set( renderedBlocks[ blockName ] )\n\t\t\t: new Set(),\n\t};\n\tresult[ blockName ].add( uniqueId );\n\n\treturn result;\n}\n\n/**\n * A React context provider for use with the `useHasRecursion` hook to prevent recursive\n * renders.\n *\n * Wrap block content with this provider and provide the same `uniqueId` prop as used\n * with `useHasRecursion`.\n *\n * @param {Object} props\n * @param {*} props.uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} props.blockName Optional block name.\n * @param {JSX.Element} props.children React children.\n *\n * @return {JSX.Element} A React element.\n */\nexport function RecursionProvider( { children, uniqueId, blockName = '' } ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\n\tblockName = blockName || name;\n\n\tconst newRenderedBlocks = useMemo(\n\t\t() => addToBlockType( previouslyRenderedBlocks, blockName, uniqueId ),\n\t\t[ previouslyRenderedBlocks, blockName, uniqueId ]\n\t);\n\n\treturn (\n\t\t<RenderedRefsContext.Provider value={ newRenderedBlocks }>\n\t\t\t{ children }\n\t\t</RenderedRefsContext.Provider>\n\t);\n}\n\n/**\n * A React hook for keeping track of blocks previously rendered up in the block\n * tree. Blocks susceptible to recursion can use this hook in their `Edit`\n * function to prevent said recursion.\n *\n * Use this with the `RecursionProvider` component, using the same `uniqueId` value\n * for both the hook and the provider.\n *\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} blockName Optional block name.\n *\n * @return {boolean} A boolean describing whether the provided id has already been rendered.\n */\nexport function useHasRecursion( uniqueId, blockName = '' ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\tblockName = blockName || name;\n\treturn Boolean( previouslyRenderedBlocks[ blockName ]?.has( uniqueId ) );\n}\n\nexport const DeprecatedExperimentalRecursionProvider = ( props ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalRecursionProvider', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.RecursionProvider',\n\t} );\n\treturn <RecursionProvider { ...props } />;\n};\n\nexport const DeprecatedExperimentalUseHasRecursion = ( ...args ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalUseHasRecursion', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.useHasRecursion',\n\t} );\n\treturn useHasRecursion( ...args );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACvE,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC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AG,EAAE,EAAG;EAC3D,MAAMO,wBAAwB,GAAGjB,UAAU,CAAEM,mBAAoB,CAAC;EAClE,MAAM;IAAEY;EAAK,CAAC,GAAGf,mBAAmB,CAAC,CAAC;EACtCO,SAAS,GAAGA,SAAS,IAAIQ,IAAI;EAC7B,OAAOK,OAAO,CAAEN,wBAAwB,CAAEP,SAAS,CAAE,EAAEc,GAAG,CAAEb,QAAS,CAAE,CAAC;AACzE;AAEA,OAAO,MAAMc,uCAAuC,GAAKC,KAAK,IAAM;EACnExB,UAAU,CAAE,gDAAgD,EAAE;IAC7DyB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,oBAAOvB,IAAA,CAACU,iBAAiB;IAAA,GAAMW;EAAK,CAAI,CAAC;AAC1C,CAAC;AAED,OAAO,MAAMG,qCAAqC,GAAGA,CAAE,GAAGC,IAAI,KAAM;EACnE5B,UAAU,CAAE,8CAA8C,EAAE;IAC3DyB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAAON,eAAe,CAAE,GAAGQ,IAAK,CAAC;AAClC,CAAC","ignoreList":[]}
@@ -34,7 +34,9 @@ import { canBindBlock } from '../../utils/block-bindings';
34
34
  import BlockContext from '../block-context';
35
35
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
36
36
  export const keyboardShortcutContext = createContext();
37
+ keyboardShortcutContext.displayName = 'keyboardShortcutContext';
37
38
  export const inputEventContext = createContext();
39
+ inputEventContext.displayName = 'inputEventContext';
38
40
  const instanceIdKey = Symbol('instanceId');
39
41
 
40
42
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useRef","useCallback","forwardRef","createContext","useContext","useDispatch","useRegistry","useSelect","useMergeRefs","useInstanceId","__unstableUseRichText","useRichText","removeFormat","Popover","getBlockBindingsSource","deprecated","__","sprintf","useBlockEditorAutocompleteProps","useBlockEditContext","blockBindingsKey","isPreviewModeKey","FormatToolbarContainer","store","blockEditorStore","useMarkPersistent","useFormatTypes","useEventListeners","FormatEdit","getAllowedFormats","Content","valueToHTMLString","withDeprecations","canBindBlock","BlockContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","keyboardShortcutContext","inputEventContext","instanceIdKey","Symbol","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","readOnly","forwardedRef","since","alternative","instanceId","anchorRef","context","clientId","isBlockSelected","name","blockName","blockBindings","blockContext","registry","selector","select","getSelectionStart","getSelectionEnd","getBlockEditingMode","isNavigationMode","selectionStart","selectionEnd","undefined","attributeKey","offset","isContentOnlyWriteMode","disableBoundBlock","bindingsPlaceholder","bindingsLabel","_fieldsList$relatedBi","relatedBinding","blockBindingsSource","source","blockBindingsContext","usesContext","length","key","_disableBoundBlock","canUserEditValue","args","getBlockAttributes","blockAttributes","fieldsList","getFieldsList","bindingKey","label","_bindingsPlaceholder","_bindingsLabel","shouldDisableEditing","getBlockRootClientId","selectionChange","adjustedAllowedFormats","hasFormats","onSelectionChange","start","end","selection","unset","baseSelection","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","disableNoneEssentialFormatting","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","addInvisibleFormats","getValue","ref","richTextRef","html","__unstableFormats","__unstableText","Object","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","completers","record","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","Provider","__unstableSlotNameProvider","inline","editableContentElement","role","draggable","contentEditable","suppressContentEditableWarning","className","tabIndex","PrivateRichText","isEmpty","PublicForwardedRichTextContainer","isPreviewMode","Tag","contentProps","dangerouslySetInnerHTML","__html","RichTextShortcut","RichTextToolbarButton","__unstableRichTextInputEvent"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { useMergeRefs, useInstanceId } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport { Popover } from '@wordpress/components';\nimport { getBlockBindingsSource } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport { blockBindingsKey, isPreviewModeKey } from '../block-edit/context';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { useFormatTypes } from './use-format-types';\nimport { useEventListeners } from './event-listeners';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content, valueToHTMLString } from './content';\nimport { withDeprecations } from './with-deprecations';\nimport { canBindBlock } from '../../utils/block-bindings';\nimport BlockContext from '../block-context';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\nconst instanceIdKey = Symbol( 'instanceId' );\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\treadOnly,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tif ( onSplit ) {\n\t\tdeprecated( 'wp.blockEditor.RichText onSplit prop', {\n\t\t\tsince: '6.4',\n\t\t\talternative: 'block.json support key: \"splitting\"',\n\t\t} );\n\t}\n\n\tconst instanceId = useInstanceId( RichTextWrapper );\n\tconst anchorRef = useRef();\n\tconst context = useBlockEditContext();\n\tconst { clientId, isSelected: isBlockSelected, name: blockName } = context;\n\tconst blockBindings = context[ blockBindingsKey ];\n\tconst blockContext = useContext( BlockContext );\n\tconst registry = useRegistry();\n\tconst selector = ( select ) => {\n\t\t// Avoid subscribing to the block editor store if the block is not\n\t\t// selected.\n\t\tif ( ! isBlockSelected ) {\n\t\t\treturn { isSelected: false };\n\t\t}\n\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectionEnd,\n\t\t\tgetBlockEditingMode,\n\t\t\tisNavigationMode,\n\t\t} = select( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\t( identifier\n\t\t\t\t\t? selectionStart.attributeKey === identifier\n\t\t\t\t\t: selectionStart[ instanceIdKey ] === instanceId );\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t\tisContentOnlyWriteMode:\n\t\t\t\tisNavigationMode() &&\n\t\t\t\tgetBlockEditingMode( clientId ) === 'contentOnly',\n\t\t};\n\t};\n\tconst { selectionStart, selectionEnd, isSelected, isContentOnlyWriteMode } =\n\t\tuseSelect( selector, [\n\t\t\tclientId,\n\t\t\tidentifier,\n\t\t\tinstanceId,\n\t\t\toriginalIsSelected,\n\t\t\tisBlockSelected,\n\t\t] );\n\n\tconst { disableBoundBlock, bindingsPlaceholder, bindingsLabel } = useSelect(\n\t\t( select ) => {\n\t\t\tif (\n\t\t\t\t! blockBindings?.[ identifier ] ||\n\t\t\t\t! canBindBlock( blockName )\n\t\t\t) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst relatedBinding = blockBindings[ identifier ];\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\trelatedBinding.source\n\t\t\t);\n\t\t\tconst blockBindingsContext = {};\n\t\t\tif ( blockBindingsSource?.usesContext?.length ) {\n\t\t\t\tfor ( const key of blockBindingsSource.usesContext ) {\n\t\t\t\t\tblockBindingsContext[ key ] = blockContext[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst _disableBoundBlock =\n\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\tselect,\n\t\t\t\t\tcontext: blockBindingsContext,\n\t\t\t\t\targs: relatedBinding.args,\n\t\t\t\t} );\n\n\t\t\t// Don't modify placeholders if value is not empty.\n\t\t\tif ( adjustedValue.length > 0 ) {\n\t\t\t\treturn {\n\t\t\t\t\tdisableBoundBlock: _disableBoundBlock,\n\t\t\t\t\t// Null values will make them fall back to the default behavior.\n\t\t\t\t\tbindingsPlaceholder: null,\n\t\t\t\t\tbindingsLabel: null,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\t\tconst blockAttributes = getBlockAttributes( clientId );\n\t\t\tconst fieldsList = blockBindingsSource?.getFieldsList?.( {\n\t\t\t\tselect,\n\t\t\t\tcontext: blockBindingsContext,\n\t\t\t} );\n\t\t\tconst bindingKey =\n\t\t\t\tfieldsList?.[ relatedBinding?.args?.key ]?.label ??\n\t\t\t\tblockBindingsSource?.label;\n\n\t\t\tconst _bindingsPlaceholder = _disableBoundBlock\n\t\t\t\t? bindingKey\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: connected field label or source label */\n\t\t\t\t\t\t__( 'Add %s' ),\n\t\t\t\t\t\tbindingKey\n\t\t\t\t );\n\t\t\tconst _bindingsLabel = _disableBoundBlock\n\t\t\t\t? relatedBinding?.args?.key || blockBindingsSource?.label\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: source label or key */\n\t\t\t\t\t\t__( 'Empty %s; start writing to edit its value' ),\n\t\t\t\t\t\trelatedBinding?.args?.key || blockBindingsSource?.label\n\t\t\t\t );\n\n\t\t\treturn {\n\t\t\t\tdisableBoundBlock: _disableBoundBlock,\n\t\t\t\tbindingsPlaceholder:\n\t\t\t\t\tblockAttributes?.placeholder || _bindingsPlaceholder,\n\t\t\t\tbindingsLabel: _bindingsLabel,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tblockBindings,\n\t\t\tidentifier,\n\t\t\tblockName,\n\t\t\tadjustedValue,\n\t\t\tclientId,\n\t\t\tblockContext,\n\t\t]\n\t);\n\n\tconst shouldDisableEditing = readOnly || disableBoundBlock;\n\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tconst baseSelection = {\n\t\t\t\tclientId,\n\t\t\t\t[ identifier ? 'attributeKey' : instanceIdKey ]: identifier\n\t\t\t\t\t? identifier\n\t\t\t\t\t: instanceId,\n\t\t\t};\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\t...baseSelection,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\t...baseSelection,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[\n\t\t\tclientId,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSelectionEnd,\n\t\t\tgetSelectionStart,\n\t\t\tidentifier,\n\t\t\tinstanceId,\n\t\t\tselectionChange,\n\t\t]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tdisableNoneEssentialFormatting: isContentOnlyWriteMode,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder: bindingsPlaceholder || placeholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-readonly={ shouldDisableEditing }\n\t\t\t\t{ ...props }\n\t\t\t\t// Unset draggable (coming from block props) for contentEditable\n\t\t\t\t// elements because it will interfere with multi block selection\n\t\t\t\t// when the contentEditable and draggable elements are the same\n\t\t\t\t// element.\n\t\t\t\tdraggable={ undefined }\n\t\t\t\taria-label={\n\t\t\t\t\tbindingsLabel || props[ 'aria-label' ] || placeholder\n\t\t\t\t}\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t// Rich text ref must be first because its focus listener\n\t\t\t\t\t// must be set up before any other ref calls .focus() on\n\t\t\t\t\t// mount.\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\tuseEventListeners( {\n\t\t\t\t\t\tregistry,\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t\tkeyboardShortcuts,\n\t\t\t\t\t\tinputEvents,\n\t\t\t\t\t} ),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ ! shouldDisableEditing }\n\t\t\t\tsuppressContentEditableWarning\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={\n\t\t\t\t\tprops.tabIndex === 0 && ! shouldDisableEditing\n\t\t\t\t\t\t? null\n\t\t\t\t\t\t: props.tabIndex\n\t\t\t\t}\n\t\t\t\tdata-wp-block-attribute-key={ identifier }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\n// This is the private API for the RichText component.\n// It allows access to all props, not just the public ones.\nexport const PrivateRichText = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nPrivateRichText.Content = Content;\nPrivateRichText.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n// This is the public API for the RichText component.\n// We wrap the PrivateRichText component to hide some props from the public API.\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nconst PublicForwardedRichTextContainer = forwardRef( ( props, ref ) => {\n\tconst context = useBlockEditContext();\n\tconst isPreviewMode = context[ isPreviewModeKey ];\n\n\tif ( isPreviewMode ) {\n\t\t// Remove all non-content props.\n\t\tconst {\n\t\t\tchildren,\n\t\t\ttagName: Tag = 'div',\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tisSelected,\n\t\t\tmultiline,\n\t\t\tinlineToolbar,\n\t\t\twrapperClassName,\n\t\t\tautocompleters,\n\t\t\tonReplace,\n\t\t\tplaceholder,\n\t\t\tallowedFormats,\n\t\t\twithoutInteractiveFormatting,\n\t\t\tonRemove,\n\t\t\tonMerge,\n\t\t\tonSplit,\n\t\t\t__unstableOnSplitAtEnd,\n\t\t\t__unstableOnSplitAtDoubleLineEnd,\n\t\t\tidentifier,\n\t\t\tpreserveWhiteSpace,\n\t\t\t__unstablePastePlainText,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t__unstableDisableFormats,\n\t\t\tdisableLineBreaks,\n\t\t\t__unstableAllowPrefixTransformations,\n\t\t\treadOnly,\n\t\t\t...contentProps\n\t\t} = removeNativeProps( props );\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{ ...contentProps }\n\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t__html: valueToHTMLString( value, multiline ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <PrivateRichText ref={ ref } { ...props } readOnly={ false } />;\n} );\n\nPublicForwardedRichTextContainer.Content = Content;\nPublicForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\nexport default PublicForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __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xBE,iBAAiB;MACjBC,oCAAoC;MACpCC,QAAQ;MACR,GAAGmH;IACJ,CAAC,GAAGtK,iBAAiB,CAAEC,KAAM,CAAC;IAC9B,oBACCV,IAAA,CAAC8K,GAAG;MAAA,GACEC,YAAY;MACjBC,uBAAuB,EAAG;QACzBC,MAAM,EAAEtL,iBAAiB,CAAEmC,KAAK,EAAEM,SAAU;MAC7C;IAAG,CACH,CAAC;EAEJ;EAEA,oBAAOpC,IAAA,CAAC0K,eAAe;IAACjC,GAAG,EAAGA,GAAK;IAAA,GAAM/H,KAAK;IAAGkD,QAAQ,EAAG;EAAO,CAAE,CAAC;AACvE,CAAE,CAAC;AAEHgH,gCAAgC,CAAClL,OAAO,GAAGA,OAAO;AAClDkL,gCAAgC,CAACD,OAAO,GAAK7I,KAAK,IAAM;EACvD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAACiE,MAAM,KAAK,CAAC;AACrC,CAAC;AAED,eAAe6E,gCAAgC;AAC/C,SAASM,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,4BAA4B,QAAQ,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useRef","useCallback","forwardRef","createContext","useContext","useDispatch","useRegistry","useSelect","useMergeRefs","useInstanceId","__unstableUseRichText","useRichText","removeFormat","Popover","getBlockBindingsSource","deprecated","__","sprintf","useBlockEditorAutocompleteProps","useBlockEditContext","blockBindingsKey","isPreviewModeKey","FormatToolbarContainer","store","blockEditorStore","useMarkPersistent","useFormatTypes","useEventListeners","FormatEdit","getAllowedFormats","Content","valueToHTMLString","withDeprecations","canBindBlock","BlockContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","keyboardShortcutContext","displayName","inputEventContext","instanceIdKey","Symbol","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","readOnly","forwardedRef","since","alternative","instanceId","anchorRef","context","clientId","isBlockSelected","name","blockName","blockBindings","blockContext","registry","selector","select","getSelectionStart","getSelectionEnd","getBlockEditingMode","isNavigationMode","selectionStart","selectionEnd","undefined","attributeKey","offset","isContentOnlyWriteMode","disableBoundBlock","bindingsPlaceholder","bindingsLabel","_fieldsList$relatedBi","relatedBinding","blockBindingsSource","source","blockBindingsContext","usesContext","length","key","_disableBoundBlock","canUserEditValue","args","getBlockAttributes","blockAttributes","fieldsList","getFieldsList","bindingKey","label","_bindingsPlaceholder","_bindingsLabel","shouldDisableEditing","getBlockRootClientId","selectionChange","adjustedAllowedFormats","hasFormats","onSelectionChange","start","end","selection","unset","baseSelection","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","disableNoneEssentialFormatting","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","addInvisibleFormats","getValue","ref","richTextRef","html","__unstableFormats","__unstableText","Object","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","completers","record","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","Provider","__unstableSlotNameProvider","inline","editableContentElement","role","draggable","contentEditable","suppressContentEditableWarning","className","tabIndex","PrivateRichText","isEmpty","PublicForwardedRichTextContainer","isPreviewMode","Tag","contentProps","dangerouslySetInnerHTML","__html","RichTextShortcut","RichTextToolbarButton","__unstableRichTextInputEvent"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { useMergeRefs, useInstanceId } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport { Popover } from '@wordpress/components';\nimport { getBlockBindingsSource } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport { blockBindingsKey, isPreviewModeKey } from '../block-edit/context';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { useFormatTypes } from './use-format-types';\nimport { useEventListeners } from './event-listeners';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content, valueToHTMLString } from './content';\nimport { withDeprecations } from './with-deprecations';\nimport { canBindBlock } from '../../utils/block-bindings';\nimport BlockContext from '../block-context';\n\nexport const keyboardShortcutContext = createContext();\nkeyboardShortcutContext.displayName = 'keyboardShortcutContext';\n\nexport const inputEventContext = createContext();\ninputEventContext.displayName = 'inputEventContext';\n\nconst instanceIdKey = Symbol( 'instanceId' );\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\treadOnly,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tif ( onSplit ) {\n\t\tdeprecated( 'wp.blockEditor.RichText onSplit prop', {\n\t\t\tsince: '6.4',\n\t\t\talternative: 'block.json support key: \"splitting\"',\n\t\t} );\n\t}\n\n\tconst instanceId = useInstanceId( RichTextWrapper );\n\tconst anchorRef = useRef();\n\tconst context = useBlockEditContext();\n\tconst { clientId, isSelected: isBlockSelected, name: blockName } = context;\n\tconst blockBindings = context[ blockBindingsKey ];\n\tconst blockContext = useContext( BlockContext );\n\tconst registry = useRegistry();\n\tconst selector = ( select ) => {\n\t\t// Avoid subscribing to the block editor store if the block is not\n\t\t// selected.\n\t\tif ( ! isBlockSelected ) {\n\t\t\treturn { isSelected: false };\n\t\t}\n\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectionEnd,\n\t\t\tgetBlockEditingMode,\n\t\t\tisNavigationMode,\n\t\t} = select( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\t( identifier\n\t\t\t\t\t? selectionStart.attributeKey === identifier\n\t\t\t\t\t: selectionStart[ instanceIdKey ] === instanceId );\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t\tisContentOnlyWriteMode:\n\t\t\t\tisNavigationMode() &&\n\t\t\t\tgetBlockEditingMode( clientId ) === 'contentOnly',\n\t\t};\n\t};\n\tconst { selectionStart, selectionEnd, isSelected, isContentOnlyWriteMode } =\n\t\tuseSelect( selector, [\n\t\t\tclientId,\n\t\t\tidentifier,\n\t\t\tinstanceId,\n\t\t\toriginalIsSelected,\n\t\t\tisBlockSelected,\n\t\t] );\n\n\tconst { disableBoundBlock, bindingsPlaceholder, bindingsLabel } = useSelect(\n\t\t( select ) => {\n\t\t\tif (\n\t\t\t\t! blockBindings?.[ identifier ] ||\n\t\t\t\t! canBindBlock( blockName )\n\t\t\t) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst relatedBinding = blockBindings[ identifier ];\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\trelatedBinding.source\n\t\t\t);\n\t\t\tconst blockBindingsContext = {};\n\t\t\tif ( blockBindingsSource?.usesContext?.length ) {\n\t\t\t\tfor ( const key of blockBindingsSource.usesContext ) {\n\t\t\t\t\tblockBindingsContext[ key ] = blockContext[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst _disableBoundBlock =\n\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\tselect,\n\t\t\t\t\tcontext: blockBindingsContext,\n\t\t\t\t\targs: relatedBinding.args,\n\t\t\t\t} );\n\n\t\t\t// Don't modify placeholders if value is not empty.\n\t\t\tif ( adjustedValue.length > 0 ) {\n\t\t\t\treturn {\n\t\t\t\t\tdisableBoundBlock: _disableBoundBlock,\n\t\t\t\t\t// Null values will make them fall back to the default behavior.\n\t\t\t\t\tbindingsPlaceholder: null,\n\t\t\t\t\tbindingsLabel: null,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\t\tconst blockAttributes = getBlockAttributes( clientId );\n\t\t\tconst fieldsList = blockBindingsSource?.getFieldsList?.( {\n\t\t\t\tselect,\n\t\t\t\tcontext: blockBindingsContext,\n\t\t\t} );\n\t\t\tconst bindingKey =\n\t\t\t\tfieldsList?.[ relatedBinding?.args?.key ]?.label ??\n\t\t\t\tblockBindingsSource?.label;\n\n\t\t\tconst _bindingsPlaceholder = _disableBoundBlock\n\t\t\t\t? bindingKey\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: connected field label or source label */\n\t\t\t\t\t\t__( 'Add %s' ),\n\t\t\t\t\t\tbindingKey\n\t\t\t\t );\n\t\t\tconst _bindingsLabel = _disableBoundBlock\n\t\t\t\t? relatedBinding?.args?.key || blockBindingsSource?.label\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: source label or key */\n\t\t\t\t\t\t__( 'Empty %s; start writing to edit its value' ),\n\t\t\t\t\t\trelatedBinding?.args?.key || blockBindingsSource?.label\n\t\t\t\t );\n\n\t\t\treturn {\n\t\t\t\tdisableBoundBlock: _disableBoundBlock,\n\t\t\t\tbindingsPlaceholder:\n\t\t\t\t\tblockAttributes?.placeholder || _bindingsPlaceholder,\n\t\t\t\tbindingsLabel: _bindingsLabel,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tblockBindings,\n\t\t\tidentifier,\n\t\t\tblockName,\n\t\t\tadjustedValue,\n\t\t\tclientId,\n\t\t\tblockContext,\n\t\t]\n\t);\n\n\tconst shouldDisableEditing = readOnly || disableBoundBlock;\n\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tconst baseSelection = {\n\t\t\t\tclientId,\n\t\t\t\t[ identifier ? 'attributeKey' : instanceIdKey ]: identifier\n\t\t\t\t\t? identifier\n\t\t\t\t\t: instanceId,\n\t\t\t};\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\t...baseSelection,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\t...baseSelection,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[\n\t\t\tclientId,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSelectionEnd,\n\t\t\tgetSelectionStart,\n\t\t\tidentifier,\n\t\t\tinstanceId,\n\t\t\tselectionChange,\n\t\t]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tdisableNoneEssentialFormatting: isContentOnlyWriteMode,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder: bindingsPlaceholder || placeholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-readonly={ shouldDisableEditing }\n\t\t\t\t{ ...props }\n\t\t\t\t// Unset draggable (coming from block props) for contentEditable\n\t\t\t\t// elements because it will interfere with multi block selection\n\t\t\t\t// when the contentEditable and draggable elements are the same\n\t\t\t\t// element.\n\t\t\t\tdraggable={ undefined }\n\t\t\t\taria-label={\n\t\t\t\t\tbindingsLabel || props[ 'aria-label' ] || placeholder\n\t\t\t\t}\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t// Rich text ref must be first because its focus listener\n\t\t\t\t\t// must be set up before any other ref calls .focus() on\n\t\t\t\t\t// mount.\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\tuseEventListeners( {\n\t\t\t\t\t\tregistry,\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t\tkeyboardShortcuts,\n\t\t\t\t\t\tinputEvents,\n\t\t\t\t\t} ),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ ! shouldDisableEditing }\n\t\t\t\tsuppressContentEditableWarning\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={\n\t\t\t\t\tprops.tabIndex === 0 && ! shouldDisableEditing\n\t\t\t\t\t\t? null\n\t\t\t\t\t\t: props.tabIndex\n\t\t\t\t}\n\t\t\t\tdata-wp-block-attribute-key={ identifier }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\n// This is the private API for the RichText component.\n// It allows access to all props, not just the public ones.\nexport const PrivateRichText = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nPrivateRichText.Content = Content;\nPrivateRichText.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n// This is the public API for the RichText component.\n// We wrap the PrivateRichText component to hide some props from the public API.\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nconst PublicForwardedRichTextContainer = forwardRef( ( props, ref ) => {\n\tconst context = useBlockEditContext();\n\tconst isPreviewMode = context[ isPreviewModeKey ];\n\n\tif ( isPreviewMode ) {\n\t\t// Remove all non-content props.\n\t\tconst {\n\t\t\tchildren,\n\t\t\ttagName: Tag = 'div',\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tisSelected,\n\t\t\tmultiline,\n\t\t\tinlineToolbar,\n\t\t\twrapperClassName,\n\t\t\tautocompleters,\n\t\t\tonReplace,\n\t\t\tplaceholder,\n\t\t\tallowedFormats,\n\t\t\twithoutInteractiveFormatting,\n\t\t\tonRemove,\n\t\t\tonMerge,\n\t\t\tonSplit,\n\t\t\t__unstableOnSplitAtEnd,\n\t\t\t__unstableOnSplitAtDoubleLineEnd,\n\t\t\tidentifier,\n\t\t\tpreserveWhiteSpace,\n\t\t\t__unstablePastePlainText,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t__unstableDisableFormats,\n\t\t\tdisableLineBreaks,\n\t\t\t__unstableAllowPrefixTransformations,\n\t\t\treadOnly,\n\t\t\t...contentProps\n\t\t} = removeNativeProps( props );\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{ ...contentProps }\n\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t__html: valueToHTMLString( value, multiline ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <PrivateRichText ref={ ref } { ...props } readOnly={ false } />;\n} );\n\nPublicForwardedRichTextContainer.Content = Content;\nPublicForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\nexport default PublicForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,UAAU,QACJ,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACrE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