@payloadcms/richtext-lexical 4.0.0-internal.314c594 → 4.0.0-internal.31ba7ee

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 (241) hide show
  1. package/dist/exports/client/Field-TCOK744G.js +2 -0
  2. package/dist/exports/client/Field-TCOK744G.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  5. package/dist/exports/client/{chunk-LN6VX25I.js.map → chunk-3LRZDIIG.js.map} +2 -2
  6. package/dist/exports/client/{chunk-ESITTE3C.js → chunk-ZFGDYZDE.js} +2 -2
  7. package/dist/exports/client/{chunk-ESITTE3C.js.map → chunk-ZFGDYZDE.js.map} +2 -2
  8. package/dist/exports/client/componentInline-55HZXGUS.js +2 -0
  9. package/dist/exports/client/index.js +23 -23
  10. package/dist/exports/client/index.js.map +4 -4
  11. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  12. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  13. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  14. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  15. package/dist/features/blocks/client/component/index.d.ts +0 -6
  16. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  17. package/dist/features/blocks/client/component/index.js +133 -76
  18. package/dist/features/blocks/client/component/index.js.map +1 -1
  19. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  20. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  21. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  22. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  23. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  24. package/dist/features/blocks/client/componentInline/index.js +2 -2
  25. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  26. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  27. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  28. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  29. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  30. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  31. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  32. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  33. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  34. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  35. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  36. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  37. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  38. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  39. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  40. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  41. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  42. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  43. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  44. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  45. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  46. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  47. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  48. package/dist/features/heading/constants.d.ts +2 -0
  49. package/dist/features/heading/constants.d.ts.map +1 -0
  50. package/dist/features/heading/constants.js +2 -0
  51. package/dist/features/heading/constants.js.map +1 -0
  52. package/dist/features/heading/server/index.d.ts.map +1 -1
  53. package/dist/features/heading/server/index.js +5 -1
  54. package/dist/features/heading/server/index.js.map +1 -1
  55. package/dist/features/heading/server/validate.d.ts +6 -0
  56. package/dist/features/heading/server/validate.d.ts.map +1 -0
  57. package/dist/features/heading/server/validate.js +15 -0
  58. package/dist/features/heading/server/validate.js.map +1 -0
  59. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  60. package/dist/features/indent/client/IndentPlugin.js +122 -1
  61. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  62. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  63. package/dist/features/indent/server/i18n.js +74 -37
  64. package/dist/features/indent/server/i18n.js.map +1 -1
  65. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  66. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  67. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  68. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  69. package/dist/features/lists/checklist/server/index.js +5 -2
  70. package/dist/features/lists/checklist/server/index.js.map +1 -1
  71. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  72. package/dist/features/lists/orderedList/server/index.js +5 -2
  73. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  74. package/dist/features/lists/shared/constants.d.ts +2 -0
  75. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  76. package/dist/features/lists/shared/constants.js +2 -0
  77. package/dist/features/lists/shared/constants.js.map +1 -0
  78. package/dist/features/lists/shared/validate.d.ts +5 -0
  79. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  80. package/dist/features/lists/shared/validate.js +15 -0
  81. package/dist/features/lists/shared/validate.js.map +1 -0
  82. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  83. package/dist/features/lists/unorderedList/server/index.js +5 -2
  84. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  85. package/dist/features/relationship/client/index.d.ts +2 -2
  86. package/dist/features/relationship/client/index.d.ts.map +1 -1
  87. package/dist/features/relationship/client/index.js.map +1 -1
  88. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  89. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  90. package/dist/features/relationship/client/plugins/index.js +27 -31
  91. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  92. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  93. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  94. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  95. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  96. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  97. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  98. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  99. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  100. package/dist/features/relationship/server/index.d.ts +8 -1
  101. package/dist/features/relationship/server/index.d.ts.map +1 -1
  102. package/dist/features/relationship/server/index.js +28 -11
  103. package/dist/features/relationship/server/index.js.map +1 -1
  104. package/dist/features/relationship/server/schema.d.ts +2 -2
  105. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  106. package/dist/features/relationship/server/schema.js +5 -10
  107. package/dist/features/relationship/server/schema.js.map +1 -1
  108. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  109. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  110. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  111. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  112. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  113. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  114. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  115. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  116. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  117. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js +17 -44
  118. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  119. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  120. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js +41 -18
  121. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  122. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  123. package/dist/features/toolbars/inline/client/Toolbar/index.js +2 -2
  124. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  125. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  126. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  127. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  128. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  129. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  130. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  131. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -11
  132. package/dist/features/typesServer.d.ts +13 -8
  133. package/dist/features/typesServer.d.ts.map +1 -1
  134. package/dist/features/typesServer.js.map +1 -1
  135. package/dist/features/upload/client/index.d.ts +3 -2
  136. package/dist/features/upload/client/index.d.ts.map +1 -1
  137. package/dist/features/upload/client/index.js.map +1 -1
  138. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  139. package/dist/features/upload/client/plugin/index.js +50 -53
  140. package/dist/features/upload/client/plugin/index.js.map +1 -1
  141. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  142. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  143. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  144. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  145. package/dist/features/upload/server/index.d.ts +6 -2
  146. package/dist/features/upload/server/index.d.ts.map +1 -1
  147. package/dist/features/upload/server/index.js +18 -14
  148. package/dist/features/upload/server/index.js.map +1 -1
  149. package/dist/features/upload/server/schema.d.ts +2 -2
  150. package/dist/features/upload/server/schema.d.ts.map +1 -1
  151. package/dist/features/upload/server/schema.js +4 -8
  152. package/dist/features/upload/server/schema.js.map +1 -1
  153. package/dist/features/upload/server/validate.d.ts +2 -2
  154. package/dist/features/upload/server/validate.d.ts.map +1 -1
  155. package/dist/features/upload/server/validate.js +3 -0
  156. package/dist/features/upload/server/validate.js.map +1 -1
  157. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  158. package/dist/field/Diff/converters/listitem/index.js +2 -1
  159. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  160. package/dist/field/Diff/index.d.ts +3 -2
  161. package/dist/field/Diff/index.d.ts.map +1 -1
  162. package/dist/field/Diff/index.js +1 -0
  163. package/dist/field/Diff/index.js.map +1 -1
  164. package/dist/field/RenderLexical/index.d.ts +3 -1
  165. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  166. package/dist/field/RenderLexical/index.js +23 -23
  167. package/dist/field/RenderLexical/index.js.map +1 -1
  168. package/dist/field/ViewSelector.d.ts.map +1 -1
  169. package/dist/field/ViewSelector.js +1 -0
  170. package/dist/field/ViewSelector.js.map +1 -1
  171. package/dist/field/bundled.css +1 -1
  172. package/dist/index.d.ts +1 -1
  173. package/dist/index.js +1 -1
  174. package/dist/index.js.map +1 -1
  175. package/dist/lexical/LexicalEditor.css +20 -9
  176. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  177. package/dist/lexical/LexicalEditor.js +61 -64
  178. package/dist/lexical/LexicalEditor.js.map +1 -1
  179. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  180. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  181. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  182. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +2 -1
  183. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -1
  184. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  185. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  186. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  187. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  188. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +1 -0
  189. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  190. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  191. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  192. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  193. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  194. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  195. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  196. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  197. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  198. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  199. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  200. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  201. package/dist/lexical/ui/ContentEditable.js +9 -6
  202. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  203. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  204. package/dist/lexical/ui/icons/H3/index.js +13 -6
  205. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  206. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  207. package/dist/lexical/ui/icons/H4/index.js +13 -6
  208. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  209. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  210. package/dist/lexical/ui/icons/H5/index.js +13 -6
  211. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  212. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  213. package/dist/lexical/ui/icons/H6/index.js +13 -6
  214. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  215. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  216. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  217. package/dist/validate/hasText.d.ts +2 -2
  218. package/dist/validate/hasText.d.ts.map +1 -1
  219. package/dist/validate/hasText.js.map +1 -1
  220. package/dist/validate/index.d.ts +1 -1
  221. package/dist/validate/index.d.ts.map +1 -1
  222. package/package.json +22 -22
  223. package/dist/dependencyChecker.spec.js +0 -16
  224. package/dist/dependencyChecker.spec.js.map +0 -1
  225. package/dist/exports/client/Field-F22V5L4V.js +0 -2
  226. package/dist/exports/client/Field-F22V5L4V.js.map +0 -7
  227. package/dist/exports/client/chunk-LN6VX25I.js +0 -2
  228. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  229. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  230. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  231. package/dist/features/link/markdownTransformer.spec.js +0 -195
  232. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  233. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.spec.js +0 -65
  234. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.spec.js.map +0 -1
  235. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  236. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  237. package/dist/lexical/utils/url.spec.js +0 -114
  238. package/dist/lexical/utils/url.spec.js.map +0 -1
  239. package/dist/utilities/jsx/jsx.spec.js +0 -178
  240. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  241. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-55HZXGUS.js.map} +0 -0
@@ -0,0 +1,65 @@
1
+ import { mergeRegister } from '@lexical/utils';
2
+ import { $getSelection, $isNodeSelection, $isRangeSelection, COMMAND_PRIORITY_HIGH, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND } from 'lexical';
3
+ import { useEffect } from 'react';
4
+ /** Move the current top-level line, including decorator nodes, without a pointer. */
5
+ export function useKeyboardReordering({
6
+ editor,
7
+ instructionsID
8
+ }) {
9
+ useEffect(() => {
10
+ const moveLine = ({
11
+ direction,
12
+ event
13
+ }) => {
14
+ if (!editor.isEditable() || !event.altKey || !event.shiftKey || event.ctrlKey || event.metaKey) {
15
+ return false;
16
+ }
17
+ const selection = $getSelection();
18
+ const selectedNode = $isRangeSelection(selection) && selection.isCollapsed() ? selection.anchor.getNode() : $isNodeSelection(selection) && selection.getNodes().length === 1 ? selection.getNodes()[0] : null;
19
+ const node = selectedNode?.getTopLevelElement();
20
+ if (!node) {
21
+ return false;
22
+ }
23
+ event.preventDefault();
24
+ const sibling = direction === -1 ? node.getPreviousSibling() : node.getNextSibling();
25
+ if (sibling) {
26
+ if (direction === -1) {
27
+ sibling.insertBefore(node);
28
+ } else {
29
+ sibling.insertAfter(node);
30
+ }
31
+ }
32
+ return true;
33
+ };
34
+ return mergeRegister(editor.registerCommand(KEY_ARROW_UP_COMMAND, event => moveLine({
35
+ direction: -1,
36
+ event
37
+ }), COMMAND_PRIORITY_HIGH), editor.registerCommand(KEY_ARROW_DOWN_COMMAND, event => moveLine({
38
+ direction: 1,
39
+ event
40
+ }), COMMAND_PRIORITY_HIGH));
41
+ }, [editor]);
42
+ useEffect(() => {
43
+ let restore;
44
+ const unregister = editor.registerRootListener(root => {
45
+ restore?.();
46
+ if (!root) {
47
+ return;
48
+ }
49
+ const description = root.getAttribute('aria-describedby');
50
+ root.setAttribute('aria-describedby', [description, instructionsID].filter(Boolean).join(' '));
51
+ restore = () => {
52
+ if (description === null) {
53
+ root.removeAttribute('aria-describedby');
54
+ } else {
55
+ root.setAttribute('aria-describedby', description);
56
+ }
57
+ };
58
+ });
59
+ return () => {
60
+ unregister();
61
+ restore?.();
62
+ };
63
+ }, [editor, instructionsID]);
64
+ }
65
+ //# sourceMappingURL=useKeyboardReordering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyboardReordering.js","names":["mergeRegister","$getSelection","$isNodeSelection","$isRangeSelection","COMMAND_PRIORITY_HIGH","KEY_ARROW_DOWN_COMMAND","KEY_ARROW_UP_COMMAND","useEffect","useKeyboardReordering","editor","instructionsID","moveLine","direction","event","isEditable","altKey","shiftKey","ctrlKey","metaKey","selection","selectedNode","isCollapsed","anchor","getNode","getNodes","length","node","getTopLevelElement","preventDefault","sibling","getPreviousSibling","getNextSibling","insertBefore","insertAfter","registerCommand","restore","unregister","registerRootListener","root","description","getAttribute","setAttribute","filter","Boolean","join","removeAttribute"],"sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.ts"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\nimport { mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isNodeSelection,\n $isRangeSelection,\n COMMAND_PRIORITY_HIGH,\n KEY_ARROW_DOWN_COMMAND,\n KEY_ARROW_UP_COMMAND,\n} from 'lexical'\nimport { useEffect } from 'react'\n\n/** Move the current top-level line, including decorator nodes, without a pointer. */\nexport function useKeyboardReordering({\n editor,\n instructionsID,\n}: {\n editor: LexicalEditor\n instructionsID: string\n}) {\n useEffect(() => {\n const moveLine = ({ direction, event }: { direction: -1 | 1; event: KeyboardEvent }) => {\n if (\n !editor.isEditable() ||\n !event.altKey ||\n !event.shiftKey ||\n event.ctrlKey ||\n event.metaKey\n ) {\n return false\n }\n const selection = $getSelection()\n const selectedNode =\n $isRangeSelection(selection) && selection.isCollapsed()\n ? selection.anchor.getNode()\n : $isNodeSelection(selection) && selection.getNodes().length === 1\n ? selection.getNodes()[0]\n : null\n const node = selectedNode?.getTopLevelElement()\n\n if (!node) {\n return false\n }\n event.preventDefault()\n const sibling = direction === -1 ? node.getPreviousSibling() : node.getNextSibling()\n\n if (sibling) {\n if (direction === -1) {\n sibling.insertBefore(node)\n } else {\n sibling.insertAfter(node)\n }\n }\n return true\n }\n\n return mergeRegister(\n editor.registerCommand(\n KEY_ARROW_UP_COMMAND,\n (event) => moveLine({ direction: -1, event }),\n COMMAND_PRIORITY_HIGH,\n ),\n editor.registerCommand(\n KEY_ARROW_DOWN_COMMAND,\n (event) => moveLine({ direction: 1, event }),\n COMMAND_PRIORITY_HIGH,\n ),\n )\n }, [editor])\n\n useEffect(() => {\n let restore: (() => void) | undefined\n const unregister = editor.registerRootListener((root) => {\n restore?.()\n if (!root) {\n return\n }\n const description = root.getAttribute('aria-describedby')\n root.setAttribute('aria-describedby', [description, instructionsID].filter(Boolean).join(' '))\n restore = () => {\n if (description === null) {\n root.removeAttribute('aria-describedby')\n } else {\n root.setAttribute('aria-describedby', description)\n }\n }\n })\n\n return () => {\n unregister()\n restore?.()\n }\n }, [editor, instructionsID])\n}\n"],"mappings":"AAEA,SAASA,aAAa,QAAQ;AAC9B,SACEC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,qBAAqB,EACrBC,sBAAsB,EACtBC,oBAAoB,QACf;AACP,SAASC,SAAS,QAAQ;AAE1B;AACA,OAAO,SAASC,sBAAsB;EACpCC,MAAM;EACNC;AAAc,CAIf;EACCH,SAAA,CAAU;IACR,MAAMI,QAAA,GAAWA,CAAC;MAAEC,SAAS;MAAEC;IAAK,CAA+C;MACjF,IACE,CAACJ,MAAA,CAAOK,UAAU,MAClB,CAACD,KAAA,CAAME,MAAM,IACb,CAACF,KAAA,CAAMG,QAAQ,IACfH,KAAA,CAAMI,OAAO,IACbJ,KAAA,CAAMK,OAAO,EACb;QACA,OAAO;M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,WAAA,EAAa7B,cAAA,CAAe,CAACgC,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;MACzFT,OAAA,GAAUA,CAAA;QACR,IAAII,WAAA,KAAgB,MAAM;UACxBD,IAAA,CAAKO,eAAe,CAAC;QACvB,OAAO;UACLP,IAAA,CAAKG,YAAY,CAAC,oBAAoBF,WAAA;QACxC;MACF;IACF;IAEA,OAAO;MACLH,UAAA;MACAD,OAAA;IACF;EACF,GAAG,CAAC1B,MAAA,EAAQC,cAAA,CAAe;AAC7B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"setHandlePosition.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,MAAU,QAyCvB"}
1
+ {"version":3,"file":"setHandlePosition.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,MAAU,QA2CvB"}
@@ -3,6 +3,7 @@
3
3
  import { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js';
4
4
  export function setHandlePosition(targetElem, handleElem, anchorElem, leftOffset = 0) {
5
5
  if (!targetElem) {
6
+ handleElem.style.visibility = 'hidden';
6
7
  handleElem.style.opacity = '0';
7
8
  handleElem.style.transform = 'translate(-10000px, -10000px)';
8
9
  return;
@@ -23,6 +24,7 @@ export function setHandlePosition(targetElem, handleElem, anchorElem, leftOffset
23
24
  }
24
25
  const left = leftOffset;
25
26
  handleElem.style.opacity = '1';
27
+ handleElem.style.visibility = 'visible';
26
28
  handleElem.style.transform = `translate(${left}px, ${top}px)`;
27
29
  }
28
30
  //# sourceMappingURL=setHandlePosition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setHandlePosition.js","names":["doesLineHeightAffectElement","setHandlePosition","targetElem","handleElem","anchorElem","leftOffset","style","opacity","transform","targetRect","getBoundingClientRect","targetStyle","window","getComputedStyle","floatingElemRect","anchorElementRect","top","isBlockStyle","some","classes","classList","contains","firstElementChild","actualLineHeight","parseInt","lineHeight","height","left"],"sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"sourcesContent":["'use client'\nimport { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const isBlockStyle = [\n 'LexicalEditorTheme__block',\n 'LexicalEditorTheme__upload',\n 'LexicalEditorTheme__relationship',\n ].some(\n (classes) =>\n targetElem.classList.contains(classes) ||\n targetElem.firstElementChild?.classList.contains(classes),\n )\n\n if (!isBlockStyle) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top\n } else {\n top = targetRect.top + 8 - anchorElementRect.top\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"mappings":"AAAA;;AACA,SAASA,2BAA2B,QAAQ;AAE5C,OAAO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ePosition","targetElem","handleElem","anchorElem","leftOffset","style","visibility","opacity","transform","targetRect","getBoundingClientRect","targetStyle","window","getComputedStyle","floatingElemRect","anchorElementRect","top","isBlockStyle","some","classes","classList","contains","firstElementChild","actualLineHeight","parseInt","lineHeight","height","left"],"sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"sourcesContent":["'use client'\nimport { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.visibility = 'hidden'\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const isBlockStyle = [\n 'LexicalEditorTheme__block',\n 'LexicalEditorTheme__upload',\n 'LexicalEditorTheme__relationship',\n ].some(\n (classes) =>\n targetElem.classList.contains(classes) ||\n targetElem.firstElementChild?.classList.contains(classes),\n )\n\n if (!isBlockStyle) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top\n } else {\n top = targetRect.top + 8 - anchorElementRect.top\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.visibility = 'visible'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"mappings":"AAAA;;AACA,SAASA,2BAA2B,QAAQ;AAE5C,OAAO,SAASC,kBACdC,UAA8B,EAC9BC,UAAuB,EACvBC,UAAuB,EACvBC,UAAA,GAAqB,CAA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 'react';
2
2
  import './ContentEditable.css';
3
3
  import type { SanitizedClientEditorConfig } from '../config/types.js';
4
- export declare function LexicalContentEditable({ className, editorConfig, }: {
4
+ export declare function LexicalContentEditable({ className, editorConfig, instructionsID, }: {
5
5
  className?: string;
6
6
  editorConfig: SanitizedClientEditorConfig;
7
+ instructionsID?: string;
7
8
  }): JSX.Element;
8
9
  //# sourceMappingURL=ContentEditable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../src/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,uBAAuB,CAAA;AAI9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAErE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,GACb,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,2BAA2B,CAAA;CAC1C,GAAG,GAAG,CAAC,OAAO,CAgBd"}
1
+ {"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../src/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,uBAAuB,CAAA;AAI9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAErE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,EACZ,cAAc,GACf,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,2BAA2B,CAAA;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,GAAG,CAAC,OAAO,CAgBd"}
@@ -8,10 +8,11 @@ import { useTranslation } from '@payloadcms/ui';
8
8
  import './ContentEditable.css';
9
9
  import * as React from 'react';
10
10
  export function LexicalContentEditable(t0) {
11
- const $ = _c(5);
11
+ const $ = _c(6);
12
12
  const {
13
13
  className,
14
- editorConfig
14
+ editorConfig,
15
+ instructionsID
15
16
  } = t0;
16
17
  const {
17
18
  t
@@ -21,9 +22,10 @@ export function LexicalContentEditable(t0) {
21
22
  getTheme
22
23
  } = t1;
23
24
  let t2;
24
- if ($[0] !== className || $[1] !== editorConfig?.admin?.placeholder || $[2] !== getTheme || $[3] !== t) {
25
+ if ($[0] !== className || $[1] !== editorConfig?.admin?.placeholder || $[2] !== getTheme || $[3] !== instructionsID || $[4] !== t) {
25
26
  const theme = getTheme();
26
27
  t2 = _jsx(ContentEditable, {
28
+ "aria-describedby": instructionsID,
27
29
  "aria-placeholder": t("lexical:general:placeholder"),
28
30
  className: className ?? "ContentEditable__root",
29
31
  placeholder: _jsx("p", {
@@ -34,10 +36,11 @@ export function LexicalContentEditable(t0) {
34
36
  $[0] = className;
35
37
  $[1] = editorConfig?.admin?.placeholder;
36
38
  $[2] = getTheme;
37
- $[3] = t;
38
- $[4] = t2;
39
+ $[3] = instructionsID;
40
+ $[4] = t;
41
+ $[5] = t2;
39
42
  } else {
40
- t2 = $[4];
43
+ t2 = $[5];
41
44
  }
42
45
  return t2;
43
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditable.js","names":["c","_c","useLexicalComposerContext","ContentEditable","useTranslation","React","LexicalContentEditable","t0","$","className","editorConfig","t","t1","getTheme","t2","admin","placeholder","theme","_jsx","children"],"sources":["../../../src/lexical/ui/ContentEditable.tsx"],"sourcesContent":["'use client'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport { useTranslation } from '@payloadcms/ui'\n\nimport './ContentEditable.css'\n\nimport * as React from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../config/types.js'\n\nexport function LexicalContentEditable({\n className,\n editorConfig,\n}: {\n className?: string\n editorConfig: SanitizedClientEditorConfig\n}): JSX.Element {\n const { t } = useTranslation<{}, string>()\n const [_, { getTheme }] = useLexicalComposerContext()\n const theme = getTheme()\n\n return (\n <ContentEditable\n aria-placeholder={t('lexical:general:placeholder')}\n className={className ?? 'ContentEditable__root'}\n placeholder={\n <p className={theme?.placeholder}>\n {editorConfig?.admin?.placeholder ?? t('lexical:general:placeholder')}\n </p>\n }\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAE/B,OAAO;AAEP,YAAYC,KAAA,MAAW;AAIvB,OAAO,SAAAC,uBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAgC;IAAAQ,SAAA;IAAAC;EAAA,IAAAH,EAMtC;EACC;IAAAI;EAAA,IAAcP,cAAA;EACd,SAAAQ,EAAA,IAA0BV,yBAAA;EAAhB;IAAAW;EAAA,IAAAD,EAAY;EAAA,IAAAE,EAAA;EAAA,IAAAN,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAE,YAAA,EAAAK,KAAA,EAAAC,WAAA,IAAAR,CAAA,QAAAK,QAAA,IAAAL,CAAA,QAAAG,CAAA;IACtB,MAAAM,KAAA,GAAcJ,QAAA;IAGZC,EAAA,GAAAI,IAAA,CAAAf,eAAA;MAAA,oBACoBQ,CAAA,CAAE;MAAAF,SAAA,EACTA,SAAA,IAAa;MAAAO,WAAA,EAEtBE,IAAA,CAAC;QAAAT,SAAA,EAAaQ,KAAA,EAAAD,WAAA;QAAAG,QAAA,EACXT,YAAA,EAAAK,KAAA,EAAAC,WAAA,IAAoCL,CAAA,CAAE;MAAA,C;;;;;;;;;;SAL7CG,E","ignoreList":[]}
1
+ {"version":3,"file":"ContentEditable.js","names":["c","_c","useLexicalComposerContext","ContentEditable","useTranslation","React","LexicalContentEditable","t0","$","className","editorConfig","instructionsID","t","t1","getTheme","t2","admin","placeholder","theme","_jsx","children"],"sources":["../../../src/lexical/ui/ContentEditable.tsx"],"sourcesContent":["'use client'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport { useTranslation } from '@payloadcms/ui'\n\nimport './ContentEditable.css'\n\nimport * as React from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../config/types.js'\n\nexport function LexicalContentEditable({\n className,\n editorConfig,\n instructionsID,\n}: {\n className?: string\n editorConfig: SanitizedClientEditorConfig\n instructionsID?: string\n}): JSX.Element {\n const { t } = useTranslation<{}, string>()\n const [_, { getTheme }] = useLexicalComposerContext()\n const theme = getTheme()\n return (\n <ContentEditable\n aria-describedby={instructionsID}\n aria-placeholder={t('lexical:general:placeholder')}\n className={className ?? 'ContentEditable__root'}\n placeholder={\n <p className={theme?.placeholder}>\n {editorConfig?.admin?.placeholder ?? t('lexical:general:placeholder')}\n </p>\n }\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAE/B,OAAO;AAEP,YAAYC,KAAA,MAAW;AAIvB,OAAO,SAAAC,uBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAgC;IAAAQ,SAAA;IAAAC,YAAA;IAAAC;EAAA,IAAAJ,EAQtC;EACC;IAAAK;EAAA,IAAcR,cAAA;EACd,SAAAS,EAAA,IAA0BX,yBAAA;EAAhB;IAAAY;EAAA,IAAAD,EAAY;EAAA,IAAAE,EAAA;EAAA,IAAAP,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAE,YAAA,EAAAM,KAAA,EAAAC,WAAA,IAAAT,CAAA,QAAAM,QAAA,IAAAN,CAAA,QAAAG,cAAA,IAAAH,CAAA,QAAAI,CAAA;IACtB,MAAAM,KAAA,GAAcJ,QAAA;IAEZC,EAAA,GAAAI,IAAA,CAAAhB,eAAA;MAAA,oBACoBQ,cAAA;MAAA,oBACAC,CAAA,CAAE;MAAAH,SAAA,EACTA,SAAA,IAAa;MAAAQ,WAAA,EAEtBE,IAAA,CAAC;QAAAV,SAAA,EAAaS,KAAA,EAAAD,WAAA;QAAAG,QAAA,EACXV,YAAA,EAAAM,KAAA,EAAAC,WAAA,IAAoCL,CAAA,CAAE;MAAA,C;;;;;;;;;;;SAN7CG,E","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H3/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAaA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H3/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAoBA,CAAA"}
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
 
3
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import React from 'react';
5
- const path = 'M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z';
5
+ const headingPath = 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z';
6
+ const numeralPath = 'M16.59 13.32 A1.5 1.25 0 1 1 18 15 A1.5 1.25 0 1 1 16.59 16.68';
6
7
  export const H3Icon = ({
7
8
  className
8
- }) => /*#__PURE__*/_jsx("svg", {
9
+ }) => /*#__PURE__*/_jsxs("svg", {
9
10
  "aria-hidden": "true",
10
11
  className: ['icon', className].filter(Boolean).join(' '),
11
12
  fill: "none",
@@ -14,9 +15,15 @@ export const H3Icon = ({
14
15
  viewBox: "0 0 24 24",
15
16
  width: 24,
16
17
  xmlns: "http://www.w3.org/2000/svg",
17
- children: /*#__PURE__*/_jsx("path", {
18
- d: path,
18
+ children: [/*#__PURE__*/_jsx("path", {
19
+ d: headingPath,
19
20
  fill: "currentColor"
20
- })
21
+ }), /*#__PURE__*/_jsx("path", {
22
+ d: numeralPath,
23
+ stroke: "currentColor",
24
+ strokeLinecap: "round",
25
+ strokeLinejoin: "round",
26
+ strokeWidth: 1
27
+ })]
21
28
  });
22
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","path","H3Icon","className","_jsx","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","d"],"sources":["../../../../../src/lexical/ui/icons/H3/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst path =\n 'M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z'\n\nexport const H3Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={path} fill=\"currentColor\" />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,IAAA,GACJ;AAEF,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,IAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;YAEN,aAAAT,IAAA,CAAC;IAAKU,CAAA,EAAGb,IAAA;IAAMO,IAAA,EAAK","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","headingPath","numeralPath","H3Icon","className","_jsxs","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","_jsx","d","stroke","strokeLinecap","strokeLinejoin","strokeWidth"],"sources":["../../../../../src/lexical/ui/icons/H3/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst headingPath =\n 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z'\nconst numeralPath = 'M16.59 13.32 A1.5 1.25 0 1 1 18 15 A1.5 1.25 0 1 1 16.59 16.68'\n\nexport const H3Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={headingPath} fill=\"currentColor\" />\n <path\n d={numeralPath}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1}\n />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,WAAA,GACJ;AACF,MAAMC,WAAA,GAAc;AAEpB,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,KAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;0BAENC,IAAA,CAAC;IAAKC,CAAA,EAAGf,WAAA;IAAaQ,IAAA,EAAK;mBAC3BM,IAAA,CAAC;IACCC,CAAA,EAAGd,WAAA;IACHe,MAAA,EAAO;IACPC,aAAA,EAAc;IACdC,cAAA,EAAe;IACfC,WAAA,EAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H4/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAaA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H4/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAoBA,CAAA"}
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
 
3
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import React from 'react';
5
- const path = 'M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z';
5
+ const headingPath = 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z';
6
+ const numeralPath = 'M18.85 17.5 V12.5 L16.5 15.85 H19.5';
6
7
  export const H4Icon = ({
7
8
  className
8
- }) => /*#__PURE__*/_jsx("svg", {
9
+ }) => /*#__PURE__*/_jsxs("svg", {
9
10
  "aria-hidden": "true",
10
11
  className: ['icon', className].filter(Boolean).join(' '),
11
12
  fill: "none",
@@ -14,9 +15,15 @@ export const H4Icon = ({
14
15
  viewBox: "0 0 24 24",
15
16
  width: 24,
16
17
  xmlns: "http://www.w3.org/2000/svg",
17
- children: /*#__PURE__*/_jsx("path", {
18
- d: path,
18
+ children: [/*#__PURE__*/_jsx("path", {
19
+ d: headingPath,
19
20
  fill: "currentColor"
20
- })
21
+ }), /*#__PURE__*/_jsx("path", {
22
+ d: numeralPath,
23
+ stroke: "currentColor",
24
+ strokeLinecap: "round",
25
+ strokeLinejoin: "round",
26
+ strokeWidth: 1
27
+ })]
21
28
  });
22
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","path","H4Icon","className","_jsx","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","d"],"sources":["../../../../../src/lexical/ui/icons/H4/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst path =\n 'M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z'\n\nexport const H4Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={path} fill=\"currentColor\" />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,IAAA,GACJ;AAEF,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,IAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;YAEN,aAAAT,IAAA,CAAC;IAAKU,CAAA,EAAGb,IAAA;IAAMO,IAAA,EAAK","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","headingPath","numeralPath","H4Icon","className","_jsxs","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","_jsx","d","stroke","strokeLinecap","strokeLinejoin","strokeWidth"],"sources":["../../../../../src/lexical/ui/icons/H4/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst headingPath =\n 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z'\nconst numeralPath = 'M18.85 17.5 V12.5 L16.5 15.85 H19.5'\n\nexport const H4Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={headingPath} fill=\"currentColor\" />\n <path\n d={numeralPath}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1}\n />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,WAAA,GACJ;AACF,MAAMC,WAAA,GAAc;AAEpB,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,KAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;0BAENC,IAAA,CAAC;IAAKC,CAAA,EAAGf,WAAA;IAAaQ,IAAA,EAAK;mBAC3BM,IAAA,CAAC;IACCC,CAAA,EAAGd,WAAA;IACHe,MAAA,EAAO;IACPC,aAAA,EAAc;IACdC,cAAA,EAAe;IACfC,WAAA,EAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H5/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAaA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H5/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAoBA,CAAA"}
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
 
3
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import React from 'react';
5
- const path = 'M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z';
5
+ const headingPath = 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z';
6
+ const numeralPath = 'M19.2 12.5 H16.8 V14.9 A1.5 1.5 0 1 1 16.7 16.9';
6
7
  export const H5Icon = ({
7
8
  className
8
- }) => /*#__PURE__*/_jsx("svg", {
9
+ }) => /*#__PURE__*/_jsxs("svg", {
9
10
  "aria-hidden": "true",
10
11
  className: ['icon', className].filter(Boolean).join(' '),
11
12
  fill: "none",
@@ -14,9 +15,15 @@ export const H5Icon = ({
14
15
  viewBox: "0 0 24 24",
15
16
  width: 24,
16
17
  xmlns: "http://www.w3.org/2000/svg",
17
- children: /*#__PURE__*/_jsx("path", {
18
- d: path,
18
+ children: [/*#__PURE__*/_jsx("path", {
19
+ d: headingPath,
19
20
  fill: "currentColor"
20
- })
21
+ }), /*#__PURE__*/_jsx("path", {
22
+ d: numeralPath,
23
+ stroke: "currentColor",
24
+ strokeLinecap: "round",
25
+ strokeLinejoin: "round",
26
+ strokeWidth: 1
27
+ })]
21
28
  });
22
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","path","H5Icon","className","_jsx","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","d"],"sources":["../../../../../src/lexical/ui/icons/H5/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst path =\n 'M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z'\n\nexport const H5Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={path} fill=\"currentColor\" />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,IAAA,GACJ;AAEF,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,IAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;YAEN,aAAAT,IAAA,CAAC;IAAKU,CAAA,EAAGb,IAAA;IAAMO,IAAA,EAAK","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","headingPath","numeralPath","H5Icon","className","_jsxs","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","_jsx","d","stroke","strokeLinecap","strokeLinejoin","strokeWidth"],"sources":["../../../../../src/lexical/ui/icons/H5/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst headingPath =\n 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z'\nconst numeralPath = 'M19.2 12.5 H16.8 V14.9 A1.5 1.5 0 1 1 16.7 16.9'\n\nexport const H5Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={headingPath} fill=\"currentColor\" />\n <path\n d={numeralPath}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1}\n />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,WAAA,GACJ;AACF,MAAMC,WAAA,GAAc;AAEpB,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,KAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;0BAENC,IAAA,CAAC;IAAKC,CAAA,EAAGf,WAAA;IAAaQ,IAAA,EAAK;mBAC3BM,IAAA,CAAC;IACCC,CAAA,EAAGd,WAAA;IACHe,MAAA,EAAO;IACPC,aAAA,EAAc;IACdC,cAAA,EAAe;IACfC,WAAA,EAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H6/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAaA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H6/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAoBA,CAAA"}
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
 
3
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import React from 'react';
5
- const path = 'M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z';
5
+ const headingPath = 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z';
6
+ const numeralPath = 'M18.85 12.55 C17.45 13.05 16.5 14.25 16.5 16 A1.5 1.5 0 1 1 19.5 16 A1.5 1.5 0 1 1 16.5 16';
6
7
  export const H6Icon = ({
7
8
  className
8
- }) => /*#__PURE__*/_jsx("svg", {
9
+ }) => /*#__PURE__*/_jsxs("svg", {
9
10
  "aria-hidden": "true",
10
11
  className: ['icon', className].filter(Boolean).join(' '),
11
12
  fill: "none",
@@ -14,9 +15,15 @@ export const H6Icon = ({
14
15
  viewBox: "0 0 24 24",
15
16
  width: 24,
16
17
  xmlns: "http://www.w3.org/2000/svg",
17
- children: /*#__PURE__*/_jsx("path", {
18
- d: path,
18
+ children: [/*#__PURE__*/_jsx("path", {
19
+ d: headingPath,
19
20
  fill: "currentColor"
20
- })
21
+ }), /*#__PURE__*/_jsx("path", {
22
+ d: numeralPath,
23
+ stroke: "currentColor",
24
+ strokeLinecap: "round",
25
+ strokeLinejoin: "round",
26
+ strokeWidth: 1
27
+ })]
21
28
  });
22
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","path","H6Icon","className","_jsx","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","d"],"sources":["../../../../../src/lexical/ui/icons/H6/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst path =\n 'M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z'\n\nexport const H6Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={path} fill=\"currentColor\" />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,IAAA,GACJ;AAEF,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,IAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;YAEN,aAAAT,IAAA,CAAC;IAAKU,CAAA,EAAGb,IAAA;IAAMO,IAAA,EAAK","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","headingPath","numeralPath","H6Icon","className","_jsxs","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","_jsx","d","stroke","strokeLinecap","strokeLinejoin","strokeWidth"],"sources":["../../../../../src/lexical/ui/icons/H6/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst headingPath =\n 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z'\nconst numeralPath =\n 'M18.85 12.55 C17.45 13.05 16.5 14.25 16.5 16 A1.5 1.5 0 1 1 19.5 16 A1.5 1.5 0 1 1 16.5 16'\n\nexport const H6Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={headingPath} fill=\"currentColor\" />\n <path\n d={numeralPath}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1}\n />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,WAAA,GACJ;AACF,MAAMC,WAAA,GACJ;AAEF,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,KAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;0BAENC,IAAA,CAAC;IAAKC,CAAA,EAAGf,WAAA;IAAaQ,IAAA,EAAK;mBAC3BM,IAAA,CAAC;IACCC,CAAA,EAAGd,WAAA;IACHe,MAAA,EAAO;IACPC,aAAA,EAAc;IACdC,cAAA,EAAe;IACfC,WAAA,EAAa","ignoreList":[]}
@@ -54,7 +54,8 @@ async function upgradeGlobal({
54
54
  slug: global.slug,
55
55
  data: document,
56
56
  depth: 0,
57
- locale: locale || undefined
57
+ locale: locale || undefined,
58
+ overrideAccess: true
58
59
  });
59
60
  }
60
61
  }
@@ -68,7 +69,8 @@ async function upgradeCollection({
68
69
  console.log(`Lexical Upgrade: ${locale}: Upgrading collection:`, collection.slug, '(' + cur + '/' + max + ')');
69
70
  const documentCount = (await payload.count({
70
71
  collection: collection.slug,
71
- locale: locale || undefined
72
+ locale: locale || undefined,
73
+ overrideAccess: true
72
74
  })).totalDocs;
73
75
  let page = 1;
74
76
  let upgraded = 0;
@@ -95,7 +97,8 @@ async function upgradeCollection({
95
97
  collection: collection.slug,
96
98
  data: document,
97
99
  depth: 0,
98
- locale: locale || undefined
100
+ locale: locale || undefined,
101
+ overrideAccess: true
99
102
  });
100
103
  }
101
104
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["upgradeDocumentFieldsRecursively","upgradeLexicalData","payload","collections","config","allLocales","localization","localeCodes","totalCollections","length","locale","curCollection","collection","upgradeCollection","cur","max","global","globals","upgradeGlobal","console","log","slug","document","findGlobal","depth","undefined","overrideAccess","found","upgradeDocument","fields","updateGlobal","data","documentCount","count","totalDocs","page","upgraded","documents","find","pagination","docs","id","update"],"sources":["../../../src/utilities/upgradeLexicalData/index.ts"],"sourcesContent":["import type { CollectionConfig, Field, GlobalConfig, Payload } from 'payload'\n\nimport { upgradeDocumentFieldsRecursively } from './upgradeDocumentFieldsRecursively.js'\n\n/**\n * This goes through every single document in your payload app and re-saves it, if it has a lexical editor.\n * This way, the data is automatically converted to the new format, and that automatic conversion gets applied to every single document in your app.\n *\n * @param payload\n */\nexport async function upgradeLexicalData({ payload }: { payload: Payload }) {\n const collections = payload.config.collections\n\n const allLocales = payload.config.localization ? payload.config.localization.localeCodes : [null]\n\n const totalCollections = collections.length\n for (const locale of allLocales) {\n let curCollection = 0\n for (const collection of collections) {\n curCollection++\n await upgradeCollection({\n collection,\n cur: curCollection,\n locale,\n max: totalCollections,\n payload,\n })\n }\n for (const global of payload.config.globals) {\n await upgradeGlobal({\n global,\n locale,\n payload,\n })\n }\n }\n}\n\nasync function upgradeGlobal({\n global,\n locale,\n payload,\n}: {\n global: GlobalConfig\n locale: null | string\n payload: Payload\n}) {\n console.log(`Lexical Upgrader: ${locale}: Upgrading global:`, global.slug)\n\n const document = await payload.findGlobal({\n slug: global.slug,\n depth: 0,\n locale: locale || undefined,\n overrideAccess: true,\n })\n\n const found = upgradeDocument({\n document,\n fields: global.fields,\n payload,\n })\n\n if (found) {\n await payload.updateGlobal({\n slug: global.slug,\n data: document,\n depth: 0,\n locale: locale || undefined,\n })\n }\n}\n\nasync function upgradeCollection({\n collection,\n cur,\n locale,\n max,\n payload,\n}: {\n collection: CollectionConfig\n cur: number\n locale: null | string\n max: number\n payload: Payload\n}) {\n console.log(\n `Lexical Upgrade: ${locale}: Upgrading collection:`,\n collection.slug,\n '(' + cur + '/' + max + ')',\n )\n\n const documentCount = (\n await payload.count({\n collection: collection.slug,\n locale: locale || undefined,\n })\n ).totalDocs\n\n let page = 1\n let upgraded = 0\n\n while (upgraded < documentCount) {\n const documents = await payload.find({\n collection: collection.slug,\n depth: 0,\n locale: locale || undefined,\n overrideAccess: true,\n page,\n pagination: true,\n })\n\n for (const document of documents.docs) {\n upgraded++\n console.log(\n `Lexical Upgrade: ${locale}: Upgrading collection:`,\n collection.slug,\n '(' +\n cur +\n '/' +\n max +\n ') - Upgrading Document: ' +\n document.id +\n ' (' +\n upgraded +\n '/' +\n documentCount +\n ')',\n )\n const found = upgradeDocument({\n document,\n fields: collection.fields,\n payload,\n })\n\n if (found) {\n await payload.update({\n id: document.id,\n collection: collection.slug,\n data: document,\n depth: 0,\n locale: locale || undefined,\n })\n }\n }\n page++\n }\n}\n\nfunction upgradeDocument({\n document,\n fields,\n payload,\n}: {\n document: Record<string, unknown>\n fields: Field[]\n payload: Payload\n}): boolean {\n return !!upgradeDocumentFieldsRecursively({\n data: document,\n fields,\n found: 0,\n payload,\n })\n}\n"],"mappings":"AAEA,SAASA,gCAAgC,QAAQ;AAEjD;;;;;;AAMA,OAAO,eAAeC,mBAAmB;EAAEC;AAAO,CAAwB;EACxE,MAAMC,WAAA,GAAcD,OAAA,CAAQE,MAAM,CAACD,WAAW;EAE9C,MAAME,UAAA,GAAaH,OAAA,CAAQE,MAAM,CAACE,YAAY,GAAGJ,OAAA,CAAQE,MAAM,CAACE,YAAY,CAACC,WAAW,GAAG,CAAC,KAAK;EAEjG,MAAMC,gBAAA,GAAmBL,WAAA,CAAYM,MAAM;EAC3C,KAAK,MAAMC,MAAA,IAAUL,UAAA,EAAY;IAC/B,IAAIM,aAAA,GAAgB;IACpB,KAAK,MAAMC,UAAA,IAAcT,WAAA,EAAa;MACpCQ,aAAA;MACA,MAAME,iBAAA,CAAkB;QACtBD,UAAA;QACAE,GAAA,EAAKH,aAAA;QACLD,MAAA;QACAK,GAAA,EAAKP,gBAAA;QACLN;MACF;IACF;IACA,KAAK,MAAMc,MAAA,IAAUd,OAAA,CAAQE,MAAM,CAACa,OAAO,EAAE;MAC3C,MAAMC,aAAA,CAAc;QAClBF,MAAA;QACAN,MAAA;QACAR;MACF;IACF;EACF;AACF;AAEA,eAAegB,cAAc;EAC3BF,MAAM;EACNN,MAAM;EACNR;AAAO,CAKR;EACCiB,OAAA,CAAQC,GAAG,CAAC,qBAAqBV,MAA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,MAAMjB,QAAA,IAAYe,SAAA,CAAUG,IAAI,EAAE;MACrCJ,QAAA;MACAjB,OAAA,CAAQC,GAAG,CACT,oBAAoBV,MAAA,yBAA+B,EACnDE,UAAA,CAAWS,IAAI,EACf,MACEP,GAAA,GACA,MACAC,GAAA,GACA,6BACAO,QAAA,CAASmB,EAAE,GACX,OACAL,QAAA,GACA,MACAJ,aAAA,GACA;MAEJ,MAAML,KAAA,GAAQC,eAAA,CAAgB;QAC5BN,QAAA;QACAO,MAAA,EAAQjB,UAAA,CAAWiB,MAAM;QACzB3B;MACF;MAEA,IAAIyB,KAAA,EAAO;QACT,MAAMzB,OAAA,CAAQwC,MAAM,CAAC;UACnBD,EAAA,EAAInB,QAAA,CAASmB,EAAE;UACf7B,UAAA,EAAYA,UAAA,CAAWS,IAAI;UAC3BU,IAAA,EAAMT,QAAA;UACNE,KAAA,EAAO;UACPd,MAAA,EAAQA,MAAA,IAAUe;QACpB;MACF;IACF;IACAU,IAAA;EACF;AACF;AAEA,SAASP,gBAAgB;EACvBN,QAAQ;EACRO,MAAM;EACN3B;AAAO,CAKR;EACC,OAAO,CAAC,CAACF,gCAAA,CAAiC;IACxC+B,IAAA,EAAMT,QAAA;IACNO,MAAA;IACAF,KAAA,EAAO;IACPzB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["upgradeDocumentFieldsRecursively","upgradeLexicalData","payload","collections","config","allLocales","localization","localeCodes","totalCollections","length","locale","curCollection","collection","upgradeCollection","cur","max","global","globals","upgradeGlobal","console","log","slug","document","findGlobal","depth","undefined","overrideAccess","found","upgradeDocument","fields","updateGlobal","data","documentCount","count","totalDocs","page","upgraded","documents","find","pagination","docs","id","update"],"sources":["../../../src/utilities/upgradeLexicalData/index.ts"],"sourcesContent":["import type { CollectionConfig, Field, GlobalConfig, Payload } from 'payload'\n\nimport { upgradeDocumentFieldsRecursively } from './upgradeDocumentFieldsRecursively.js'\n\n/**\n * This goes through every single document in your payload app and re-saves it, if it has a lexical editor.\n * This way, the data is automatically converted to the new format, and that automatic conversion gets applied to every single document in your app.\n *\n * @param payload\n */\nexport async function upgradeLexicalData({ payload }: { payload: Payload }) {\n const collections = payload.config.collections\n\n const allLocales = payload.config.localization ? payload.config.localization.localeCodes : [null]\n\n const totalCollections = collections.length\n for (const locale of allLocales) {\n let curCollection = 0\n for (const collection of collections) {\n curCollection++\n await upgradeCollection({\n collection,\n cur: curCollection,\n locale,\n max: totalCollections,\n payload,\n })\n }\n for (const global of payload.config.globals) {\n await upgradeGlobal({\n global,\n locale,\n payload,\n })\n }\n }\n}\n\nasync function upgradeGlobal({\n global,\n locale,\n payload,\n}: {\n global: GlobalConfig\n locale: null | string\n payload: Payload\n}) {\n console.log(`Lexical Upgrader: ${locale}: Upgrading global:`, global.slug)\n\n const document = await payload.findGlobal({\n slug: global.slug,\n depth: 0,\n locale: locale || undefined,\n overrideAccess: true,\n })\n\n const found = upgradeDocument({\n document,\n fields: global.fields,\n payload,\n })\n\n if (found) {\n await payload.updateGlobal({\n slug: global.slug,\n data: document,\n depth: 0,\n locale: locale || undefined,\n overrideAccess: true,\n })\n }\n}\n\nasync function upgradeCollection({\n collection,\n cur,\n locale,\n max,\n payload,\n}: {\n collection: CollectionConfig\n cur: number\n locale: null | string\n max: number\n payload: Payload\n}) {\n console.log(\n `Lexical Upgrade: ${locale}: Upgrading collection:`,\n collection.slug,\n '(' + cur + '/' + max + ')',\n )\n\n const documentCount = (\n await payload.count({\n collection: collection.slug,\n locale: locale || undefined,\n overrideAccess: true,\n })\n ).totalDocs\n\n let page = 1\n let upgraded = 0\n\n while (upgraded < documentCount) {\n const documents = await payload.find({\n collection: collection.slug,\n depth: 0,\n locale: locale || undefined,\n overrideAccess: true,\n page,\n pagination: true,\n })\n\n for (const document of documents.docs) {\n upgraded++\n console.log(\n `Lexical Upgrade: ${locale}: Upgrading collection:`,\n collection.slug,\n '(' +\n cur +\n '/' +\n max +\n ') - Upgrading Document: ' +\n document.id +\n ' (' +\n upgraded +\n '/' +\n documentCount +\n ')',\n )\n const found = upgradeDocument({\n document,\n fields: collection.fields,\n payload,\n })\n\n if (found) {\n await payload.update({\n id: document.id,\n collection: collection.slug,\n data: document,\n depth: 0,\n locale: locale || undefined,\n overrideAccess: true,\n })\n }\n }\n page++\n }\n}\n\nfunction upgradeDocument({\n document,\n fields,\n payload,\n}: {\n document: Record<string, unknown>\n fields: Field[]\n payload: Payload\n}): boolean {\n return !!upgradeDocumentFieldsRecursively({\n data: document,\n fields,\n found: 0,\n payload,\n })\n}\n"],"mappings":"AAEA,SAASA,gCAAgC,QAAQ;AAEjD;;;;;;AAMA,OAAO,eAAeC,mBAAmB;EAAEC;AAAO,CAAwB;EACxE,MAAMC,WAAA,GAAcD,OAAA,CAAQE,MAAM,CAACD,WAAW;EAE9C,MAAME,UAAA,GAAaH,OAAA,CAAQE,MAAM,CAACE,YAAY,GAAGJ,OAAA,CAAQE,MAAM,CAACE,YAAY,CAACC,WAAW,GAAG,CAAC,KAAK;EAEjG,MAAMC,gBAAA,GAAmBL,WAAA,CAAYM,MAAM;EAC3C,KAAK,MAAMC,MAAA,IAAUL,UAAA,EAAY;IAC/B,IAAIM,aAAA,GAAgB;IACpB,KAAK,MAAMC,UAAA,IAAcT,WAAA,EAAa;MACpCQ,aAAA;MACA,MAAME,iBAAA,CAAkB;QACtBD,UAAA;QACAE,GAAA,EAAKH,aAAA;QACLD,MAAA;QACAK,GAAA,EAAKP,gBAAA;QACLN;MACF;IACF;IACA,KAAK,MAAMc,MAAA,IAAUd,OAAA,CAAQE,MAAM,CAACa,OAAO,EAAE;MAC3C,MAAMC,aAAA,CAAc;QAClBF,MAAA;QACAN,MAAA;QACAR;MACF;IACF;EACF;AACF;AAEA,eAAegB,cAAc;EAC3BF,MAAM;EACNN,MAAM;EACNR;AAAO,CAKR;EACCiB,OAAA,CAAQC,GAAG,CAAC,qBAAqBV,MAAA,qBAA2B,EAAEM,MAAA,CAAOK,IAAI;EAEzE,MAAMC,QAAA,GA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B,QAAA,IAAYe,SAAA,CAAUG,IAAI,EAAE;MACrCJ,QAAA;MACAjB,OAAA,CAAQC,GAAG,CACT,oBAAoBV,MAAA,yBAA+B,EACnDE,UAAA,CAAWS,IAAI,EACf,MACEP,GAAA,GACA,MACAC,GAAA,GACA,6BACAO,QAAA,CAASmB,EAAE,GACX,OACAL,QAAA,GACA,MACAJ,aAAA,GACA;MAEJ,MAAML,KAAA,GAAQC,eAAA,CAAgB;QAC5BN,QAAA;QACAO,MAAA,EAAQjB,UAAA,CAAWiB,MAAM;QACzB3B;MACF;MAEA,IAAIyB,KAAA,EAAO;QACT,MAAMzB,OAAA,CAAQwC,MAAM,CAAC;UACnBD,EAAA,EAAInB,QAAA,CAASmB,EAAE;UACf7B,UAAA,EAAYA,UAAA,CAAWS,IAAI;UAC3BU,IAAA,EAAMT,QAAA;UACNE,KAAA,EAAO;UACPd,MAAA,EAAQA,MAAA,IAAUe,SAAA;UAClBC,cAAA,EAAgB;QAClB;MACF;IACF;IACAS,IAAA;EACF;AACF;AAEA,SAASP,gBAAgB;EACvBN,QAAQ;EACRO,MAAM;EACN3B;AAAO,CAKR;EACC,OAAO,CAAC,CAACF,gCAAA,CAAiC;IACxC+B,IAAA,EAAMT,QAAA;IACNO,MAAA;IACAF,KAAA,EAAO;IACPzB;EACF;AACF","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import type { SerializedEditorState, SerializedLexicalNode } from 'lexical';
1
+ import type { SerializedEditorState } from 'lexical';
2
2
  /**
3
3
  * This function checks if the editor state is empty (has any text). If the editor state has no nodes,
4
4
  * or only an empty paragraph node (no TextNode with length > 0), it returns false.
5
5
  * Otherwise, it returns true.
6
6
  */
7
- export declare function hasText(value: null | SerializedEditorState<SerializedLexicalNode> | undefined): value is SerializedEditorState<SerializedLexicalNode>;
7
+ export declare function hasText(value: null | SerializedEditorState | undefined): value is SerializedEditorState;
8
8
  //# sourceMappingURL=hasText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hasText.d.ts","sourceRoot":"","sources":["../../src/validate/hasText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EAGtB,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,IAAI,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,GAAG,SAAS,GACrE,KAAK,IAAI,qBAAqB,CAAC,qBAAqB,CAAC,CA6BvD"}
1
+ {"version":3,"file":"hasText.d.ts","sourceRoot":"","sources":["../../src/validate/hasText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAA+C,MAAM,SAAS,CAAA;AAEjG;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,IAAI,GAAG,qBAAqB,GAAG,SAAS,GAC9C,KAAK,IAAI,qBAAqB,CA6BhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hasText.js","names":["hasText","value","hasChildren","root","children","length","hasOnlyEmptyParagraph","type","paragraphNode","paragraphNodeChild"],"sources":["../../src/validate/hasText.ts"],"sourcesContent":["import type {\n SerializedEditorState,\n SerializedLexicalNode,\n SerializedParagraphNode,\n SerializedTextNode,\n} from 'lexical'\n\n/**\n * This function checks if the editor state is empty (has any text). If the editor state has no nodes,\n * or only an empty paragraph node (no TextNode with length > 0), it returns false.\n * Otherwise, it returns true.\n */\nexport function hasText(\n value: null | SerializedEditorState<SerializedLexicalNode> | undefined,\n): value is SerializedEditorState<SerializedLexicalNode> {\n const hasChildren = !!value?.root?.children?.length\n if (!hasChildren) {\n return false\n }\n\n let hasOnlyEmptyParagraph = false\n if (value?.root?.children?.length === 1) {\n if (value?.root?.children[0]?.type === 'paragraph') {\n const paragraphNode = value?.root?.children[0] as SerializedParagraphNode\n\n if (!paragraphNode?.children || paragraphNode?.children?.length === 0) {\n hasOnlyEmptyParagraph = true\n } else if (paragraphNode?.children?.length === 1) {\n const paragraphNodeChild = paragraphNode?.children[0]\n if (paragraphNodeChild?.type === 'text') {\n if (!(paragraphNodeChild as SerializedTextNode | undefined)?.['text']?.length) {\n hasOnlyEmptyParagraph = true\n }\n }\n }\n }\n }\n\n if (hasOnlyEmptyParagraph) {\n return false\n }\n\n return true\n}\n"],"mappings":"AAOA;;;;GAKA,OAAO,SAASA,QACdC,KAAsE;EAEtE,MAAMC,WAAA,GAAc,CAAC,CAACD,KAAA,EAAOE,IAAA,EAAMC,QAAA,EAAUC,MAAA;EAC7C,IAAI,CAACH,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAII,qBAAA,GAAwB;EAC5B,IAAIL,KAAA,EAAOE,IAAA,EAAMC,QAAA,EAAUC,MAAA,KAAW,GAAG;IACvC,IAAIJ,KAAA,EAAOE,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAAEG,IAAA,KAAS,aAAa;MAClD,MAAMC,aAAA,GAAgBP,KAAA,EAAOE,IAAA,EAAMC,QAAQ,CAAC,EAAE;MAE9C,IAAI,CAACI,aAAA,EAAeJ,QAAA,IAAYI,aAAA,EAAeJ,QAAA,EAAUC,MAAA,KAAW,GAAG;QACrEC,qBAAA,GAAwB;MAC1B,OAAO,IAAIE,aAAA,EAAeJ,QAAA,EAAUC,MAAA,KAAW,GAAG;QAChD,MAAMI,kBAAA,GAAqBD,aAAA,EAAeJ,QAAQ,CAAC,EAAE;QACrD,IAAIK,kBAAA,EAAoBF,IAAA,KAAS,QAAQ;UACvC,IAAI,CAAEE,kBAAA,GAAwD,OAAO,EAAEJ,MAAA,EAAQ;YAC7EC,qBAAA,GAAwB;UAC1B;QACF;MACF;IACF;EACF;EAEA,IAAIA,qBAAA,EAAuB;IACzB,OAAO;EACT;EAEA,OAAO;AACT","ignoreList":[]}
1
+ {"version":3,"file":"hasText.js","names":["hasText","value","hasChildren","root","children","length","hasOnlyEmptyParagraph","type","paragraphNode","paragraphNodeChild"],"sources":["../../src/validate/hasText.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical'\n\n/**\n * This function checks if the editor state is empty (has any text). If the editor state has no nodes,\n * or only an empty paragraph node (no TextNode with length > 0), it returns false.\n * Otherwise, it returns true.\n */\nexport function hasText(\n value: null | SerializedEditorState | undefined,\n): value is SerializedEditorState {\n const hasChildren = !!value?.root?.children?.length\n if (!hasChildren) {\n return false\n }\n\n let hasOnlyEmptyParagraph = false\n if (value?.root?.children?.length === 1) {\n if (value?.root?.children[0]?.type === 'paragraph') {\n const paragraphNode = value?.root?.children[0] as SerializedParagraphNode\n\n if (!paragraphNode?.children || paragraphNode?.children?.length === 0) {\n hasOnlyEmptyParagraph = true\n } else if (paragraphNode?.children?.length === 1) {\n const paragraphNodeChild = paragraphNode?.children[0]\n if (paragraphNodeChild?.type === 'text') {\n if (!(paragraphNodeChild as SerializedTextNode | undefined)?.['text']?.length) {\n hasOnlyEmptyParagraph = true\n }\n }\n }\n }\n }\n\n if (hasOnlyEmptyParagraph) {\n return false\n }\n\n return true\n}\n"],"mappings":"AAEA;;;;GAKA,OAAO,SAASA,QACdC,KAA+C;EAE/C,MAAMC,WAAA,GAAc,CAAC,CAACD,KAAA,EAAOE,IAAA,EAAMC,QAAA,EAAUC,MAAA;EAC7C,IAAI,CAACH,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAII,qBAAA,GAAwB;EAC5B,IAAIL,KAAA,EAAOE,IAAA,EAAMC,QAAA,EAAUC,MAAA,KAAW,GAAG;IACvC,IAAIJ,KAAA,EAAOE,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAAEG,IAAA,KAAS,aAAa;MAClD,MAAMC,aAAA,GAAgBP,KAAA,EAAOE,IAAA,EAAMC,QAAQ,CAAC,EAAE;MAE9C,IAAI,CAACI,aAAA,EAAeJ,QAAA,IAAYI,aAAA,EAAeJ,QAAA,EAAUC,MAAA,KAAW,GAAG;QACrEC,qBAAA,GAAwB;MAC1B,OAAO,IAAIE,aAAA,EAAeJ,QAAA,EAAUC,MAAA,KAAW,GAAG;QAChD,MAAMI,kBAAA,GAAqBD,aAAA,EAAeJ,QAAQ,CAAC,EAAE;QACrD,IAAIK,kBAAA,EAAoBF,IAAA,KAAS,QAAQ;UACvC,IAAI,CAAEE,kBAAA,GAAwD,OAAO,EAAEJ,MAAA,EAAQ;YAC7EC,qBAAA,GAAwB;UAC1B;QACF;MACF;IACF;EACF;EAEA,IAAIA,qBAAA,EAAuB;IACzB,OAAO;EACT;EAEA,OAAO;AACT","ignoreList":[]}
@@ -3,5 +3,5 @@ import type { RichTextField, Validate } from 'payload';
3
3
  import type { SanitizedServerEditorConfig } from '../lexical/config/types.js';
4
4
  export declare const richTextValidateHOC: ({ editorConfig, }: {
5
5
  editorConfig: SanitizedServerEditorConfig;
6
- }) => Validate<SerializedEditorState<import("lexical").SerializedLexicalNode>, unknown, unknown, RichTextField>;
6
+ }) => Validate<SerializedEditorState, unknown, unknown, RichTextField>;
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAK7E,eAAO,MAAM,mBAAmB,sBAE7B;IACD,YAAY,EAAE,2BAA2B,CAAA;CAC1C,8GAiCA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAK7E,eAAO,MAAM,mBAAmB,sBAE7B;IACD,YAAY,EAAE,2BAA2B,CAAA;CAC1C,qEAiCA,CAAA"}