@payloadcms/richtext-lexical 4.0.0-internal.cc18726 → 4.0.0-internal.cd47d20

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 (191) hide show
  1. package/dist/exports/client/Field-BPLEYPXV.js +2 -0
  2. package/dist/exports/client/Field-BPLEYPXV.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/index.js +27 -27
  5. package/dist/exports/client/index.js.map +4 -4
  6. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  7. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  8. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  9. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  10. package/dist/features/blocks/client/component/index.d.ts +0 -6
  11. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  12. package/dist/features/blocks/client/component/index.js +126 -69
  13. package/dist/features/blocks/client/component/index.js.map +1 -1
  14. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  15. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  16. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  17. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  18. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  19. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  20. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  21. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  22. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  23. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  24. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  25. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  26. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  27. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  28. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  29. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  30. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  31. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  32. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  33. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  34. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  35. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  36. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  37. package/dist/features/heading/constants.d.ts +2 -0
  38. package/dist/features/heading/constants.d.ts.map +1 -0
  39. package/dist/features/heading/constants.js +2 -0
  40. package/dist/features/heading/constants.js.map +1 -0
  41. package/dist/features/heading/server/index.d.ts.map +1 -1
  42. package/dist/features/heading/server/index.js +5 -1
  43. package/dist/features/heading/server/index.js.map +1 -1
  44. package/dist/features/heading/server/validate.d.ts +6 -0
  45. package/dist/features/heading/server/validate.d.ts.map +1 -0
  46. package/dist/features/heading/server/validate.js +15 -0
  47. package/dist/features/heading/server/validate.js.map +1 -0
  48. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +1 -0
  49. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  50. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  51. package/dist/features/lists/checklist/server/index.js +5 -2
  52. package/dist/features/lists/checklist/server/index.js.map +1 -1
  53. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  54. package/dist/features/lists/orderedList/server/index.js +5 -2
  55. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  56. package/dist/features/lists/shared/constants.d.ts +2 -0
  57. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  58. package/dist/features/lists/shared/constants.js +2 -0
  59. package/dist/features/lists/shared/constants.js.map +1 -0
  60. package/dist/features/lists/shared/validate.d.ts +5 -0
  61. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  62. package/dist/features/lists/shared/validate.js +15 -0
  63. package/dist/features/lists/shared/validate.js.map +1 -0
  64. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  65. package/dist/features/lists/unorderedList/server/index.js +5 -2
  66. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  67. package/dist/features/relationship/client/index.d.ts +2 -2
  68. package/dist/features/relationship/client/index.d.ts.map +1 -1
  69. package/dist/features/relationship/client/index.js.map +1 -1
  70. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  71. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  72. package/dist/features/relationship/client/plugins/index.js +27 -31
  73. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  74. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  75. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  76. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  77. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  78. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  79. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  80. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  81. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  82. package/dist/features/relationship/server/index.d.ts +8 -1
  83. package/dist/features/relationship/server/index.d.ts.map +1 -1
  84. package/dist/features/relationship/server/index.js +28 -11
  85. package/dist/features/relationship/server/index.js.map +1 -1
  86. package/dist/features/relationship/server/schema.d.ts +2 -2
  87. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  88. package/dist/features/relationship/server/schema.js +5 -10
  89. package/dist/features/relationship/server/schema.js.map +1 -1
  90. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  91. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  92. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  93. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  94. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  95. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  96. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  97. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  98. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  99. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js +17 -44
  100. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  101. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  102. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js +41 -18
  103. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  104. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  105. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  106. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  107. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  108. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  109. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  110. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -11
  111. package/dist/features/upload/client/index.d.ts +3 -2
  112. package/dist/features/upload/client/index.d.ts.map +1 -1
  113. package/dist/features/upload/client/index.js.map +1 -1
  114. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  115. package/dist/features/upload/client/plugin/index.js +47 -52
  116. package/dist/features/upload/client/plugin/index.js.map +1 -1
  117. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  118. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  119. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  120. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  121. package/dist/features/upload/server/index.d.ts +6 -2
  122. package/dist/features/upload/server/index.d.ts.map +1 -1
  123. package/dist/features/upload/server/index.js +18 -14
  124. package/dist/features/upload/server/index.js.map +1 -1
  125. package/dist/features/upload/server/schema.d.ts +2 -2
  126. package/dist/features/upload/server/schema.d.ts.map +1 -1
  127. package/dist/features/upload/server/schema.js +4 -8
  128. package/dist/features/upload/server/schema.js.map +1 -1
  129. package/dist/features/upload/server/validate.d.ts +2 -2
  130. package/dist/features/upload/server/validate.d.ts.map +1 -1
  131. package/dist/features/upload/server/validate.js +3 -0
  132. package/dist/features/upload/server/validate.js.map +1 -1
  133. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  134. package/dist/field/Diff/converters/listitem/index.js +2 -1
  135. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  136. package/dist/field/Diff/index.d.ts +3 -2
  137. package/dist/field/Diff/index.d.ts.map +1 -1
  138. package/dist/field/Diff/index.js +1 -0
  139. package/dist/field/Diff/index.js.map +1 -1
  140. package/dist/field/RenderLexical/index.d.ts +3 -1
  141. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  142. package/dist/field/RenderLexical/index.js +23 -23
  143. package/dist/field/RenderLexical/index.js.map +1 -1
  144. package/dist/field/ViewSelector.d.ts.map +1 -1
  145. package/dist/field/ViewSelector.js +1 -0
  146. package/dist/field/ViewSelector.js.map +1 -1
  147. package/dist/field/bundled.css +1 -1
  148. package/dist/index.d.ts +1 -1
  149. package/dist/index.js +1 -1
  150. package/dist/index.js.map +1 -1
  151. package/dist/lexical/LexicalEditor.js.map +1 -1
  152. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  153. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  154. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  155. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  156. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  157. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  158. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  159. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  160. package/dist/lexical/ui/icons/H3/index.js +13 -6
  161. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  162. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  163. package/dist/lexical/ui/icons/H4/index.js +13 -6
  164. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  165. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  166. package/dist/lexical/ui/icons/H5/index.js +13 -6
  167. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  168. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  169. package/dist/lexical/ui/icons/H6/index.js +13 -6
  170. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  171. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  172. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  173. package/package.json +21 -21
  174. package/dist/dependencyChecker.spec.js +0 -16
  175. package/dist/dependencyChecker.spec.js.map +0 -1
  176. package/dist/exports/client/Field-F22V5L4V.js +0 -2
  177. package/dist/exports/client/Field-F22V5L4V.js.map +0 -7
  178. package/dist/features/converters/lexicalToHtml/sync/alignment.spec.js +0 -92
  179. package/dist/features/converters/lexicalToHtml/sync/alignment.spec.js.map +0 -1
  180. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  181. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  182. package/dist/features/link/markdownTransformer.spec.js +0 -195
  183. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  184. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.spec.js +0 -65
  185. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.spec.js.map +0 -1
  186. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  187. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  188. package/dist/lexical/utils/url.spec.js +0 -114
  189. package/dist/lexical/utils/url.spec.js.map +0 -1
  190. package/dist/utilities/jsx/jsx.spec.js +0 -178
  191. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
@@ -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":"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","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":"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","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "4.0.0-internal.cc18726",
3
+ "version": "4.0.0-internal.cd47d20",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -417,25 +417,25 @@
417
417
  ]
418
418
  },
419
419
  "dependencies": {
420
- "@lexical/clipboard": "0.48.0",
421
- "@lexical/headless": "0.48.0",
422
- "@lexical/html": "0.48.0",
423
- "@lexical/link": "0.48.0",
424
- "@lexical/list": "0.48.0",
425
- "@lexical/mark": "0.48.0",
426
- "@lexical/markdown": "0.48.0",
427
- "@lexical/react": "0.48.0",
428
- "@lexical/rich-text": "0.48.0",
429
- "@lexical/selection": "0.48.0",
430
- "@lexical/table": "0.48.0",
431
- "@lexical/utils": "0.48.0",
420
+ "@lexical/clipboard": "0.50.0",
421
+ "@lexical/headless": "0.50.0",
422
+ "@lexical/html": "0.50.0",
423
+ "@lexical/link": "0.50.0",
424
+ "@lexical/list": "0.50.0",
425
+ "@lexical/mark": "0.50.0",
426
+ "@lexical/markdown": "0.50.0",
427
+ "@lexical/react": "0.50.0",
428
+ "@lexical/rich-text": "0.50.0",
429
+ "@lexical/selection": "0.50.0",
430
+ "@lexical/table": "0.50.0",
431
+ "@lexical/utils": "0.50.0",
432
432
  "acorn": "8.16.0",
433
433
  "bson-objectid": "2.0.4",
434
434
  "csstype": "3.2.3",
435
435
  "dequal": "2.0.3",
436
436
  "escape-html": "1.0.3",
437
437
  "jsox": "1.2.125",
438
- "lexical": "0.48.0",
438
+ "lexical": "0.50.0",
439
439
  "mdast-util-from-markdown": "2.0.3",
440
440
  "mdast-util-mdx-jsx": "3.2.0",
441
441
  "micromark-extension-mdx-jsx": "3.0.2",
@@ -443,8 +443,8 @@
443
443
  "react-error-boundary": "6.1.1",
444
444
  "ts-essentials": "10.0.3",
445
445
  "uuid": "14.0.0",
446
- "@payloadcms/translations": "4.0.0-internal.cc18726",
447
- "@payloadcms/ui": "4.0.0-internal.cc18726"
446
+ "@payloadcms/ui": "4.0.0-internal.cd47d20",
447
+ "@payloadcms/translations": "4.0.0-internal.cd47d20"
448
448
  },
449
449
  "devDependencies": {
450
450
  "@babel/cli": "7.27.2",
@@ -452,7 +452,7 @@
452
452
  "@babel/preset-env": "7.27.2",
453
453
  "@babel/preset-react": "7.27.1",
454
454
  "@babel/preset-typescript": "7.27.1",
455
- "@lexical/eslint-plugin": "0.48.0",
455
+ "@lexical/eslint-plugin": "0.50.0",
456
456
  "@types/escape-html": "1.0.4",
457
457
  "@types/json-schema": "7.0.15",
458
458
  "@types/node": "24.12.3",
@@ -464,14 +464,14 @@
464
464
  "esbuild-sass-plugin": "3.3.1",
465
465
  "swc-plugin-transform-remove-imports": "8.3.0",
466
466
  "@payloadcms/eslint-config": "3.28.0",
467
- "payload": "4.0.0-internal.cc18726"
467
+ "payload": "4.0.0-internal.cd47d20"
468
468
  },
469
469
  "peerDependencies": {
470
470
  "@faceless-ui/modal": "3.0.1",
471
471
  "@faceless-ui/scroll-info": "2.0.0",
472
472
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
473
473
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
474
- "payload": "4.0.0-internal.cc18726"
474
+ "payload": "4.0.0-internal.cd47d20"
475
475
  },
476
476
  "engines": {
477
477
  "node": ">=24.15.0"
@@ -493,8 +493,8 @@
493
493
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
494
494
  "build:without_reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm copyfiles && pnpm build:types && pnpm build:swc && pnpm build:esbuild && pnpm build:esbuild:postproces && rm -rf dist/exports/client && mv dist/exports/client_unoptimized dist/exports/client",
495
495
  "clean": "rimraf -g {dist,*.tsbuildinfo,esbuild}",
496
- "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
497
- "copyfiles:debug": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
496
+ "copyfiles": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
497
+ "copyfiles:debug": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
498
498
  "lint": "eslint .",
499
499
  "lint:fix": "eslint . --fix"
500
500
  }
@@ -1,16 +0,0 @@
1
- import { lexicalTargetVersion } from './index';
2
- import { fileURLToPath } from 'url';
3
- import path from 'path';
4
- import fs from 'fs/promises';
5
- import { describe, it, expect } from 'vitest';
6
- const filename = fileURLToPath(import.meta.url);
7
- const dirname = path.dirname(filename);
8
- describe('Lexical dependency checker', () => {
9
- it('ensure lexical version installed in package.json matches dependency checker version', async () => {
10
- const packageJsonString = await fs.readFile(path.resolve(dirname, '../package.json'), 'utf-8');
11
- const packageJson = JSON.parse(packageJsonString);
12
- const packageJsonLexicalVersion = packageJson.dependencies['lexical'];
13
- expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion);
14
- });
15
- });
16
- //# sourceMappingURL=dependencyChecker.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencyChecker.spec.js","names":["lexicalTargetVersion","fileURLToPath","path","fs","describe","it","expect","filename","import","meta","url","dirname","packageJsonString","readFile","resolve","packageJson","JSON","parse","packageJsonLexicalVersion","dependencies","toBe"],"sources":["../src/dependencyChecker.spec.ts"],"sourcesContent":["import { lexicalTargetVersion } from './index'\nimport { fileURLToPath } from 'url'\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { describe, it, expect } from 'vitest'\n\nconst filename = fileURLToPath(import.meta.url)\nconst dirname = path.dirname(filename)\n\ndescribe('Lexical dependency checker', () => {\n it('ensure lexical version installed in package.json matches dependency checker version', async () => {\n const packageJsonString = await fs.readFile(path.resolve(dirname, '../package.json'), 'utf-8')\n const packageJson = JSON.parse(packageJsonString)\n const packageJsonLexicalVersion = packageJson.dependencies['lexical']\n\n expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion)\n })\n})\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ;AACrC,SAASC,aAAa,QAAQ;AAC9B,OAAOC,IAAA,MAAU;AACjB,OAAOC,EAAA,MAAQ;AACf,SAASC,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ;AAErC,MAAMC,QAAA,GAAWN,aAAA,CAAcO,MAAA,CAAAC,IAAA,CAAYC,GAAG;AAC9C,MAAMC,OAAA,GAAUT,IAAA,CAAKS,OAAO,CAACJ,QAAA;AAE7BH,QAAA,CAAS,8BAA8B;EACrCC,EAAA,CAAG,uFAAuF;IACxF,MAAMO,iBAAA,GAAoB,MAAMT,EAAA,CAAGU,QAAQ,CAACX,IAAA,CAAKY,OAAO,CAACH,OAAA,EAAS,oBAAoB;IACtF,MAAMI,WAAA,GAAcC,IAAA,CAAKC,KAAK,CAACL,iBAAA;IAC/B,MAAMM,yBAAA,GAA4BH,WAAA,CAAYI,YAAY,CAAC,UAAU;IAErEb,MAAA,CAAOY,yBAAA,EAA2BE,IAAI,CAACpB,oBAAA;EACzC;AACF","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use client";import{b as Be,c as Oe,e as $,f as K,h as Ie,i as Fe,j as $e,k as Ke,l as Se,m as Pe,n as ze}from"./chunk-LN6VX25I.js";import{a as Ae,b as P}from"./chunk-RJ5MAOKZ.js";import{jsx as D,jsxs as le}from"react/jsx-runtime";import{BulkUploadProvider as rn,FieldDescription as nn,FieldError as sn,FieldLabel as ln,isFieldRTL as an,RenderCustomComponent as At,useConfig as cn,useEditDepth as un,useEffectEvent as dn,useField as fn,useLocale as mn}from"@payloadcms/ui";import{mergeFieldStyles as pn}from"@payloadcms/ui/shared";import{dequal as gn}from"dequal/lite";import Bt,{useCallback as Ot,useEffect as It,useMemo as hn,useState as Ft}from"react";import{ErrorBoundary as yn}from"react-error-boundary";import"./bundled.css";import{jsx as z}from"react/jsx-runtime";import{LexicalComposer as Ur}from"@lexical/react/LexicalComposer.js";import{useEditDepth as Jr}from"@payloadcms/ui";import*as _t from"react";import{useMemo as qr}from"react";import{c as Lr}from"react/compiler-runtime";import{jsx as E,jsxs as se}from"react/jsx-runtime";import{useLexicalComposerContext as Mr}from"@lexical/react/LexicalComposerContext.js";import{LexicalErrorBoundary as Ar}from"@lexical/react/LexicalErrorBoundary.js";import{HistoryPlugin as Br}from"@lexical/react/LexicalHistoryPlugin.js";import{OnChangePlugin as Or}from"@lexical/react/LexicalOnChangePlugin.js";import{RichTextPlugin as Ir}from"@lexical/react/LexicalRichTextPlugin.js";import{useLexicalEditable as Fr}from"@lexical/react/useLexicalEditable";import{BLUR_COMMAND as $r,COMMAND_PRIORITY_LOW as Rt,FOCUS_COMMAND as Kr}from"lexical";import*as Q from"react";import{useEffect as zr,useState as jr}from"react";import{jsx as je}from"react/jsx-runtime";import"react";var j=({anchorElem:e,clientProps:t,plugin:o})=>o.position==="floatingAnchorElem"&&e?o.Component&&je(o.Component,{anchorElem:e,clientProps:t}):o.Component&&je(o.Component,{clientProps:t});import{c as jt}from"react/compiler-runtime";import{copyToClipboard as He}from"@lexical/clipboard";import{useLexicalComposerContext as Ht}from"@lexical/react/LexicalComposerContext.js";import{objectKlassEquals as Vt}from"@lexical/utils";import Ve from"bson-objectid";import{$getSelection as Wt,$isNodeSelection as Yt,COMMAND_PRIORITY_LOW as Gt,COPY_COMMAND as Ut}from"lexical";import{useEffect as Jt}from"react";var Te=e=>{if("fields"in e&&typeof e.fields=="object"&&e.fields!==null&&"id"in e.fields?e.fields.id=new Ve.default().toHexString():"id"in e&&(e.id=new Ve.default().toHexString()),e.children)for(let t of e.children)Te(t)};function We(){let e=jt(3),[t]=Ht(),o,n;return e[0]!==t?(o=()=>t.registerCommand(Ut,r=>{let a=Wt();if(Yt(a)){let l=a.getNodes()[0]?.exportJSON(),u=JSON.parse(JSON.stringify(l));Te(u);let d={namespace:t._config.namespace,nodes:[u]},m=JSON.stringify(d);return He(t,null,{"application/x-lexical-editor":m,"text/plain":""}).catch(qt),!0}return He(t,Vt(r,ClipboardEvent)?r:null).then(()=>{if(!(r instanceof ClipboardEvent)||!r.clipboardData)throw new Error("No clipboard event");let s=r.clipboardData.getData("application/x-lexical-editor");if(!s)return!0;let l=JSON.parse(s);for(let d of l.nodes)Te(d);let u=JSON.stringify(l);r.clipboardData.setData("application/x-lexical-editor",u)}).catch(s=>{throw r instanceof ClipboardEvent&&r.clipboardData?.setData("application/x-lexical-editor",""),s}),!0},Gt),n=[t],e[0]=t,e[1]=o,e[2]=n):(o=e[1],n=e[2]),Jt(o,n),null}function qt(e){throw e}import{c as Qt}from"react/compiler-runtime";import{useLexicalComposerContext as Xt}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as fe,mergeRegister as Zt}from"@lexical/utils";import{$createNodeSelection as eo,$getEditor as oe,$getNearestNodeFromDOMNode as to,$getSelection as me,$isDecoratorNode as H,$isElementNode as Re,$isLineBreakNode as oo,$isNodeSelection as pe,$isRangeSelection as Ye,$isRootOrShadowRoot as ro,$isTextNode as no,$setSelection as Ge,CLICK_COMMAND as io,COMMAND_PRIORITY_LOW as Y,KEY_ARROW_DOWN_COMMAND as so,KEY_ARROW_UP_COMMAND as lo,KEY_BACKSPACE_COMMAND as ao,KEY_DELETE_COMMAND as co,SELECTION_CHANGE_COMMAND as uo}from"lexical";import{useEffect as fo}from"react";function Ue(){let e=Qt(3),[t]=Xt(),o=Co,n,r;return e[0]!==t?(n=()=>Zt(t.registerCommand(io,xo,Y),t.registerCommand(co,o,Y),t.registerCommand(ao,o,Y),t.registerCommand(uo,yo,Y),t.registerCommand(lo,go,Y),t.registerCommand(so,mo,Y)),r=[t],e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),fo(n,r),null}function mo(e){let t=me();if(pe(t)){e.preventDefault();let s=t.getNodes()[0]?.getNextSibling();if(H(s)){let d=oe().getElementByKey(s.getKey());return d&&re({element:d,node:s}),!0}if(!Re(s))return!0;let l=s.getFirstDescendant()??s;return l&&(fe(l,ge)?.selectEnd(),e.preventDefault()),!0}if(!Ye(t))return!1;let n=(t.isBackward()?t.anchor:t.focus).getNode(),r=fe(n,po),a=r?.getNextSibling();if(!r||a!==Je(r))return!1;if(H(a)){let s=oe().getElementByKey(a.getKey());if(s)return re({element:s,node:a}),e.preventDefault(),!0}return!1}function po(e){return Je(e)!==null}function go(e){let t=me();if(pe(t)){let s=t.getNodes()[0]?.getPreviousSibling();if(H(s)){let d=oe().getElementByKey(s.getKey());return d?(re({element:d,node:s}),e.preventDefault(),!0):!1}if(!Re(s))return!1;let l=s.getLastDescendant()??s;return l?(fe(l,ge)?.selectStart(),e.preventDefault(),!0):!1}if(!Ye(t))return!1;let n=(t.isBackward()?t.anchor:t.focus).getNode(),r=fe(n,ho),a=r?.getPreviousSibling();if(!r||a!==qe(r))return!1;if(H(a)){let s=oe().getElementByKey(a.getKey());if(s)return re({element:s,node:a}),e.preventDefault(),!0}return!1}function ho(e){return qe(e)!==null}function yo(){let e=No();return document.querySelector(".decorator-selected")?.classList.remove("decorator-selected"),e?(e.element?.classList.add("decorator-selected"),!0):!1}function xo(e){document.querySelector(".decorator-selected")?.classList.remove("decorator-selected");let t=bo(e);if(!t)return!0;let{target:o}=e;return!(o instanceof HTMLElement)||o.isContentEditable||o.closest('button, textarea, input, .react-select, .code-editor, .no-select-decorator, [role="button"]')?Ge(null):re(t),!0}function Co(e){let t=me();return pe(t)?(e.preventDefault(),t.getNodes().forEach(Eo),!0):!1}function Eo(e){e.remove()}function bo(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest('[data-lexical-decorator="true"]');if(!(t instanceof HTMLElement))return;let o=to(t);return H(o)?{element:t,node:o}:void 0}function No(){let e=me();if(!pe(e))return;let t=e.getNodes();if(t.length!==1)return;let o=t[0];return H(o)?{decorator:o,element:oe().getElementByKey(o.getKey())}:void 0}function re({element:e,node:t}){document.querySelector(".decorator-selected")?.classList.remove("decorator-selected");let o=eo();o.add(t.getKey()),Ge(o),e.scrollIntoView({behavior:"smooth",block:"nearest"}),e.classList.add("decorator-selected")}function ge(e){if(H(e)&&!e.isInline())return!0;if(!Re(e)||ro(e))return!1;let t=e.getFirstChild(),o=t===null||oo(t)||no(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&o}function Je(e){let t=e.getNextSibling();for(;t!==null;){if(ge(t))return t;t=t.getNextSibling()}return null}function qe(e){let t=e.getPreviousSibling();for(;t!==null;){if(ge(t))return t;t=t.getPreviousSibling()}return null}import{jsx as ke}from"react/jsx-runtime";import{useLexicalComposerContext as ko}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as _o,isHTMLElement as vo}from"lexical";import*as et from"react";import{useCallback as Do,useEffect as Ze,useRef as Lo,useState as Mo}from"react";import{createPortal as Ao}from"react-dom";var G=(e,t,o,n,r=50,a=25)=>{let s=0;if(e&&!e.contains(n)){let{bottom:l,left:u,right:d,top:m}=e.getBoundingClientRect(),c=m+window.scrollY,i=l+window.scrollY;if(o<c-a||o>i+a||t<u-r||t>d+r)return-1;(t<u||t>d)&&(s=t<u?t-u:t-d)}return s};import{$getNodeByKey as ye}from"lexical";function U(e){let t=e.getBoundingClientRect(),o=getComputedStyle(e).getPropertyValue("transform");if(!o||o==="none")return t;let n=o.split(",").pop();return t.y=t.y-Number(n?.replace(")","")),t}function he(e){let t=(u,d)=>u?parseFloat(window.getComputedStyle(u)[d]):0,{marginBottom:o,marginTop:n}=window.getComputedStyle(e),r=t(e.previousElementSibling,"marginBottom"),a=t(e.nextElementSibling,"marginTop"),s=Math.max(parseFloat(n),r);return{marginBottom:Math.max(parseFloat(o),a),marginTop:s}}import{$getRoot as wo}from"lexical";function V(e){return e.getEditorState().read(()=>wo().getChildrenKeys())}var So=1,Po=-1,Qe=0,B={props:null,result:null};function To(e,t,o=20){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r<=o*o}function J(e){let{anchorElem:t,cache_threshold:o=20,editor:n,fuzzy:r=!1,horizontalOffset:a=0,point:{x:s,y:l},startIndex:u=0,useEdgeAsDefault:d=!1}=e;if(o>0&&B.props&&B.result&&B.props.fuzzy===e.fuzzy&&B.props.horizontalOffset===e.horizontalOffset&&B.props.useEdgeAsDefault===e.useEdgeAsDefault&&To(B.props.point,e.point,o))return B.result;let m=t.getBoundingClientRect(),c=V(n),i={blockElem:null,blockNode:null,distance:1/0,foundAtIndex:-1,isFoundNodeEmptyParagraph:!1};return n.getEditorState().read(()=>{if(d){let p=n.getElementByKey(c[0]),g=n.getElementByKey(c[c.length-1]);if(p&&g){let[f,C]=[U(p),U(g)];if(l<f.top?(i.blockElem=p,i.distance=f.top-l,i.blockNode=ye(c[0]),i.foundAtIndex=0):l>C.bottom&&(i.distance=l-C.bottom,i.blockNode=ye(c[c.length-1]),i.blockElem=g,i.foundAtIndex=c.length-1),i?.blockElem)return{blockElem:null,isFoundNodeEmptyParagraph:!1}}}let x=u,y=Qe;for(;x>=0&&x<c.length;){let p=c[x],g=n.getElementByKey(p);if(g===null)break;let f=new K(s+a,l),C=Ke.fromDOMRect(U(g)),{marginBottom:h,marginTop:b}=he(g),_=C.generateNewRect({bottom:C.bottom+h,left:m.left,right:m.right,top:C.top-b}),{distance:w,isOnBottomSide:k,isOnTopSide:L}=_.distanceFromPoint(f);if(w===0){i.blockElem=g,i.blockNode=ye(p),i.foundAtIndex=x,i.distance=w,i.blockNode&&i.blockNode.getType()==="paragraph"&&i.blockNode.getTextContent()===""&&(!r&&!e.returnEmptyParagraphs&&(i.blockElem=null,i.blockNode=null),i.isFoundNodeEmptyParagraph=!0);break}else r&&w<i.distance&&(i.blockElem=g,i.blockNode=ye(p),i.distance=w,i.foundAtIndex=x);y===Qe&&(L?y=Po:k?y=So:y=1/0),x+=y}}),B.props=e,B.result={blockElem:i.blockElem,blockNode:i.blockNode,foundAtIndex:i.foundAtIndex,isFoundNodeEmptyParagraph:i.isFoundNodeEmptyParagraph},{blockElem:i.blockElem,blockNode:i.blockNode,foundAtIndex:i.foundAtIndex,isFoundNodeEmptyParagraph:i.isFoundNodeEmptyParagraph}}function xe(e,t){return!!e.closest(`.${t}`)}var Ro=["IMG","INPUT","TEXTAREA","SELECT","BUTTON","VIDEO","OBJECT","EMBED","IFRAME","HR"];function Xe(e){if(!e||Ro.includes(e.tagName)||e.offsetHeight===0||e.offsetWidth===0)return!1;let t=window.getComputedStyle(e);return!(t.display==="table-cell"||t.position==="absolute"||t.visibility==="hidden"||t.opacity==="0")}function Ce(e,t,o,n=0){if(!e){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let r=e.getBoundingClientRect(),a=window.getComputedStyle(e),s=t.getBoundingClientRect(),l=o.getBoundingClientRect(),u;if(["LexicalEditorTheme__block","LexicalEditorTheme__upload","LexicalEditorTheme__relationship"].some(c=>e.classList.contains(c)||e.firstElementChild?.classList.contains(c)))u=r.top+8-l.top;else{let c=Xe(e)?parseInt(a.lineHeight,10):0;u=r.top+(c-s.height)/2-l.top}let m=n;t.style.opacity="1",t.style.transform=`translate(${m}px, ${u}px)`}var Bo="add-block-menu",Ee=1/0;function Oo(e){return e===0?1/0:Ee>=0&&Ee<e?Ee:Math.floor(e/2)}function Io(e,t,o){let n=t.parentElement,{editorConfig:r}=P(),a=r?.admin?.hideGutter?-24:12,s=Lo(null),[l,u]=Mo(null);Ze(()=>{function m(c){let i=c.target;if(!vo(i))return;let x=G(n,c.pageX,c.pageY,i);if(x===-1){u(null);return}if(xe(i,Bo))return;let y=V(e),{blockElem:p,blockNode:g,foundAtIndex:f}=J({anchorElem:t,cache_threshold:0,editor:e,horizontalOffset:-x,point:new K(c.x,c.y),returnEmptyParagraphs:!0,startIndex:Oo(y.length),useEdgeAsDefault:!1});Ee=f,p&&g&&(l?.node!==g||l?.elem!==p)&&u({elem:p,node:g})}return document?.addEventListener("mousemove",m),()=>{document?.removeEventListener("mousemove",m)}},[n,t,e,l]),Ze(()=>{s.current&&l?.node&&Ce(l?.elem,s.current,t,a)},[t,l,a]);let d=Do(m=>{let c=l;c?.node&&(e.update(()=>{let i=!0;if((c?.node.getType()!=="paragraph"||c.node.getTextContent()!=="")&&(i=!1),!i){let x=_o();c?.node.insertAfter(x),setTimeout(()=>{c={elem:e.getElementByKey(x.getKey()),node:x},u(c)},0)}}),setTimeout(()=>{e.update(()=>{e.focus(),c?.node&&"select"in c.node&&typeof c.node.select=="function"&&c.node.select()})},1),setTimeout(()=>{e.dispatchCommand(Fe,{node:c?.node})},2),m.stopPropagation(),m.preventDefault())},[e,l]);return Ao(ke(et.Fragment,{children:ke("button",{"aria-label":"Add block",className:"icon add-block-menu",onClick:m=>{d(m)},ref:s,type:"button",children:ke("div",{className:o?"icon":""})})}),t)}function tt(e){let{anchorElem:t}=e,o=t===void 0?document.body:t,[n]=ko();return Io(n,o,n._editable)}import{jsx as be,jsxs as $o}from"react/jsx-runtime";import{useLexicalComposerContext as Ko}from"@lexical/react/LexicalComposerContext.js";import{eventFiles as nt}from"@lexical/rich-text";import{$getNearestNodeFromDOMNode as it,$getNodeByKey as zo,isHTMLElement as _e}from"lexical";import*as ut from"react";import{useEffect as ve,useRef as ne,useState as st}from"react";import{createPortal as jo}from"react-dom";var ot=0,Fo=-24;var W=0;function rt(e,t,o,n,r,a,s,l,u,d=!1){let{height:m,top:c}=n.getBoundingClientRect(),{top:i,width:x}=s.getBoundingClientRect(),{marginBottom:y,marginTop:p}=he(n),g=c,f=a>=c+m/2+window.scrollY,C=!1;if(r?.elem)if(n!==r?.elem)(f&&r?.elem&&r?.elem===n.nextElementSibling||!f&&r?.elem&&r?.elem===n.previousElementSibling)&&(W++,W<200&&(C=!0));else{W++;let w=r?.boundingBox?.y,k=n.getBoundingClientRect().y;(f===r?.isBelow&&w===k||W<200)&&(C=!1)}if(C)return{isBelow:f,willStayInSamePosition:C};d?g+=m/2:f?g+=m+y/2:g-=p/2;let h=0;d||(f?h=-ot:h=ot);let b=g-i+h,_=Fo-t;return o.style.width=`calc(${x}px - ${e} - var(--spacer-5))`,o.style.opacity=".8",o.style.transform=`translate(${_}px, calc(${b}px - 2px))`,r?.elem&&(r.elem.style.opacity="",r?.elem===n?f?r.elem.style.marginTop="":r.elem.style.marginBottom="":(r.elem.style.marginBottom="",r.elem.style.marginTop="")),W=0,{isBelow:f,willStayInSamePosition:C}}var Ho="draggable-block-menu",lt="application/x-lexical-drag-block",ie=1/0;function at(e){return e===0?1/0:ie>=0&&ie<e?ie:Math.floor(e/2)}function Vo(e,t){let{transform:o}=t.style;e.setDragImage(t,0,0),setTimeout(()=>{t.style.transform=o})}function ct(e,t){e&&(e.style.opacity="0"),t&&(t.style.opacity="",t.style.marginBottom="",t.style.marginTop="")}function Wo(e,t,o){let n=t.parentElement,r=ne(null),a=ne(null),s=ne(null),l=ne(!1),u=ne([]),[d,m]=st(null),[c,i]=st(null),{editorConfig:x}=P(),y=x?.admin?.hideGutter?-44:-8;ve(()=>{function f(C){let h=C.target;if(!_e(h))return;let b=G(n,C.pageX,C.pageY,h);if(b===-1){m(null);return}if(xe(h,Ho))return;let _=V(e),{blockElem:w,foundAtIndex:k,isFoundNodeEmptyParagraph:L}=J({anchorElem:t,cache_threshold:0,editor:e,horizontalOffset:-b,point:new K(C.x,C.y),startIndex:at(_.length),useEdgeAsDefault:!1,verbose:!1});ie=k,!(!w&&!L)&&d!==w&&m(w)}return document?.addEventListener("mousemove",f),()=>{document?.removeEventListener("mousemove",f)}},[n,t,e,d]),ve(()=>{r.current&&Ce(d,r.current,t,y)},[t,d,y]),ve(()=>{function f(h){if(!l.current)return!1;let[b]=nt(h);if(b)return!1;let{pageY:_,target:w}=h;if(!_e(w))return!1;let k=G(n,h.pageX,h.pageY,w,100,50),L=V(e),{blockElem:S,foundAtIndex:I,isFoundNodeEmptyParagraph:R}=J({anchorElem:t,editor:e,fuzzy:!0,horizontalOffset:-k,point:new K(h.x,h.y),startIndex:at(L.length),useEdgeAsDefault:!0,verbose:!0});ie=I;let F=a.current;if(S===null||F===null)return!1;if(h.preventDefault(),h.dataTransfer.dropEffect="move",d!==S){let{isBelow:v,willStayInSamePosition:M}=rt(x?.admin?.hideGutter?"0px":"var(--spacer-5)",y+(x?.admin?.hideGutter?r?.current?.getBoundingClientRect()?.width??0:-(r?.current?.getBoundingClientRect()?.width??0)),F,S,c,_,t,h,s,R);M||i({boundingBox:S.getBoundingClientRect(),elem:S,isBelow:v})}else c?.elem&&(ct(F,c.elem),i({boundingBox:S.getBoundingClientRect(),elem:S,isBelow:!1}));return!0}function C(h){if(!l.current)return!1;let[b]=nt(h);if(b)return!1;let{dataTransfer:_,pageY:w,target:k}=h,L=_?.getData(lt)||"";return e.update(()=>{let S=zo(L);if(!S||!_e(k))return!1;let I=G(n,h.pageX,h.pageY,k,100,50),{blockElem:R,isFoundNodeEmptyParagraph:F}=J({anchorElem:t,editor:e,fuzzy:!0,horizontalOffset:-I,point:new K(h.x,h.y),useEdgeAsDefault:!0});if(!R)return!1;let v=it(R);if(!v)return!1;if(v===S)return!0;let{height:M,top:ae}=U(R),Ne=w>=ae+M/2+window.scrollY;F?(v.insertBefore(S),v.remove()):Ne?v.insertAfter(S):v.insertBefore(S),d!==null&&m(null),document.querySelectorAll(".lexical-block-highlighter").forEach(T=>{T.remove()});let we=e.getElementByKey(S.getKey()),ce=setTimeout(()=>{let T=we?.getBoundingClientRect();if(!T)return;let N=document.createElement("div");N.className="lexical-block-highlighter",N.style.backgroundColor="var(--color-bg-inverse)",N.style.transition="opacity 0.5s ease-in-out",N.style.zIndex="1",N.style.pointerEvents="none",N.style.boxSizing="border-box",N.style.borderRadius="4px",N.style.position="absolute",document.body.appendChild(N),N.style.opacity="0.1",N.style.height=`${T.height+8}px`,N.style.width=`${T.width+8}px`,N.style.top=`${T.top+window.scrollY-4}px`,N.style.left=`${T.left-4}px`;let ue=setTimeout(()=>{N.style.opacity="0";let de=setTimeout(()=>{N.remove()},500);u.current.push(de)},1e3);u.current.push(ue)},120);u.current.push(ce)}),!0}return document.addEventListener("dragover",f),document.addEventListener("drop",C),()=>{document.removeEventListener("dragover",f),document.removeEventListener("drop",C),u.current.forEach(clearTimeout),u.current=[]}},[n,y,t,e,c,d,x?.admin?.hideGutter]);function p(f){let C=f.dataTransfer;if(!C||!d)return;Vo(C,d),C.effectAllowed="move";let h="";e.update(()=>{let b=it(d);b&&(h=b.getKey())}),l.current=!0,C.setData(lt,h)}function g(){l.current=!1,c?.elem&&ct(a.current,c?.elem)}return jo($o(ut.Fragment,{children:[be("button",{"aria-label":"Drag to move",className:"icon draggable-block-menu",draggable:!0,onDragEnd:g,onDragStart:p,ref:r,type:"button",children:be("div",{className:o?"icon":""})}),be("div",{className:"draggable-block-target-line",ref:a}),be("div",{className:"debug-highlight",ref:s})]}),t)}function dt(e){let{anchorElem:t}=e,o=t===void 0?document.body:t,[n]=Ko();return Wo(n,o,n._editable)}import{c as Yo}from"react/compiler-runtime";import{jsx as De}from"react/jsx-runtime";import{useLexicalComposerContext as Go}from"@lexical/react/LexicalComposerContext";import{useTranslation as Uo}from"@payloadcms/ui";import{$createParagraphNode as Jo,$getRoot as qo}from"lexical";import"react";var ft="insert-paragraph-at-end",mt=()=>{let e=Yo(5),[t]=Go(),{editorConfig:o}=P(),{t:n}=Uo();if(o?.admin?.hideInsertParagraphAtEnd)return null;let r;e[0]!==t?(r=()=>{t.update(Qo)},e[0]=t,e[1]=r):r=e[1];let a=r,s;return e[2]!==a||e[3]!==n?(s=De("button",{"aria-label":n("lexical:general:insertParagraph"),className:ft,onClick:a,type:"button",children:De("span",{className:`${ft}-inside`,children:De(Be,{size:16})})}),e[2]=a,e[3]=n,e[4]=s):s=e[4],s};function Qo(){let e=Jo();qo().append(e),e.select()}import{c as Xo}from"react/compiler-runtime";import{registerMarkdownShortcuts as Zo}from"@lexical/markdown";import{useLexicalComposerContext as er}from"@lexical/react/LexicalComposerContext";import*as pt from"react";var gt=()=>{let e=Xo(4),{editorConfig:t}=P(),[o]=er(),n,r;return e[0]!==o||e[1]!==t.features.markdownTransformers?(n=()=>Zo(o,t.features.markdownTransformers??[]),r=[o,t.features.markdownTransformers],e[0]=o,e[1]=t.features.markdownTransformers,e[2]=n,e[3]=r):(n=e[2],r=e[3]),pt.useEffect(n,r),null};import{c as tr}from"react/compiler-runtime";import{useLexicalComposerContext as or}from"@lexical/react/LexicalComposerContext.js";import{$getRoot as rr}from"lexical";import{useEffect as nr}from"react";function ir(e){e.update(()=>{let t=o=>{let n=o.getType();if((n==="block"||n==="inlineBlock")&&o.markDirty(),"getChildren"in o&&typeof o.getChildren=="function")for(let r of o.getChildren())t(r)};t(rr())})}function ht(){let e=tr(5),[t]=or(),{currentView:o,views:n}=$(),r,a;return e[0]!==o||e[1]!==t||e[2]!==n?(r=()=>{n&&(o==="default"?n.default?Se(t,n.default?.nodes):Pe(t):n[o]&&(Pe(t),Se(t,n[o]?.nodes)),ir(t))},a=[t,n,o],e[0]=o,e[1]=t,e[2]=n,e[3]=r,e[4]=a):(r=e[3],a=e[4]),nr(r,a),null}import{useLexicalComposerContext as sr}from"@lexical/react/LexicalComposerContext";import{$getSelection as lr,$isRangeSelection as ar,RootNode as cr}from"lexical";import{useEffect as ur}from"react";function yt(){let[e]=sr();return ur(()=>e.registerNodeTransform(cr,t=>{let o=lr();if(ar(o)){let n=o.anchor.getNode(),r=o.focus.getNode();(!n.isAttached()||!r.isAttached())&&(t.selectEnd(),console.warn("updateEditor: selection has been moved to the end of the editor because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node."))}return!1}),[e]),null}import{useLexicalComposerContext as dr}from"@lexical/react/LexicalComposerContext";import{$getSelection as fr,COMMAND_PRIORITY_LOW as mr,SELECT_ALL_COMMAND as pr}from"lexical";import{useEffect as gr}from"react";function xt(){let[e]=dr();return gr(()=>e.registerCommand(pr,()=>{if(fr())return!1;let o=document.activeElement;return o instanceof HTMLInputElement&&o.select(),!0},mr),[e]),null}import{jsx as q,jsxs as Et}from"react/jsx-runtime";import{useLexicalComposerContext as yr}from"@lexical/react/LexicalComposerContext.js";import{useTranslation as bt}from"@payloadcms/ui";import{useCallback as xr,useMemo as Cr,useState as Er}from"react";import"react";import*as Nt from"react-dom";import{c as hr}from"react/compiler-runtime";import"react";function Ct(e,t){let o=hr(4),{maxLength:n,minLength:r}=t,a=n===void 0?75:n,s=r===void 0?1:r,l;return o[0]!==a||o[1]!==s||o[2]!==e?(l=u=>{let{query:d}=u,m="[^"+e+Ie+"\\s]",i=new RegExp("(^|\\s|\\()(["+e+"]((?:"+m+"){0,"+a+"}))$").exec(d);if(i!==null){let x=i[1],y=i[3];if(y.length>=s)return{leadOffset:i.index+x.length,matchingString:y,replaceableString:i[2]}}return null},o[0]=a,o[1]=s,o[2]=e,o[3]=l):l=o[3],l}var O="slash-menu-popup";function br({isSelected:e,item:t,onClick:o,onMouseEnter:n,ref:r}){let{fieldProps:{featureClientSchemaMap:a,schemaPath:s}}=P(),{i18n:l}=bt(),u=`${O}__item ${O}__item-${t.key}`;e&&(u+=` ${O}__item--selected`);let d=t.key;return t.label&&(d=typeof t.label=="function"?t.label({featureClientSchemaMap:a,i18n:l,schemaPath:s}):t.label),d.length>25&&(d=d.substring(0,25)+"..."),Et("button",{"aria-selected":e,className:u,id:O+"__item-"+t.key,onClick:o,onMouseEnter:n,ref:r,role:"option",tabIndex:-1,type:"button",children:[t?.Icon&&q(t.Icon,{}),q("span",{className:`${O}__item-text`,children:d})]},t.key)}function wt({anchorElem:e=document.body}){let[t]=yr(),[o,n]=Er(null),{editorConfig:r}=P(),{i18n:a}=bt(),{fieldProps:{featureClientSchemaMap:s,schemaPath:l}}=P(),u=Ct("/",{minLength:0}),d=xr(()=>{let c=[];for(let i of r.features.slashMenu.dynamicGroups)if(o){let x=i({editor:t,queryString:o});c=c.concat(x)}return c},[t,o,r?.features]),m=Cr(()=>{let c=[];for(let i of r?.features.slashMenu.groups??[])c.push(i);if(o){let i=o.toLowerCase().replace(/[\s\-_]/g,"");c=c.map(y=>{let p=y.items.filter(g=>{let f=g.key;return g.label&&(f=typeof g.label=="function"?g.label({featureClientSchemaMap:s,i18n:a,schemaPath:l}):g.label),new RegExp(o,"gi").exec(f)||f.toLowerCase().replace(/[\s\-_]/g,"").includes(i)?!0:g.keywords!=null?g.keywords.some(h=>new RegExp(o,"gi").exec(h)?!0:h.toLowerCase().replace(/[\s\-_]/g,"").includes(i)):!1});return p.length?{...y,items:p}:null}),c=c.filter(y=>y!=null);let x=d();for(let y of x){let p=c.find(g=>g.key===y.key);p?c=c.filter(g=>g.key!==y.key):p={...y,items:[]},p?.items?.length&&(p.items=p.items.concat(p.items)),c.push(p)}}return c},[o,r?.features.slashMenu.groups,d,s,a,l]);return q($e,{anchorElem:e,groups:m,menuRenderFn:(c,{selectedItemKey:i,selectItemAndCleanUp:x,setSelectedItemKey:y})=>c.current&&m.length?Nt.createPortal(q("div",{className:O,"data-theme":"dark",children:m.map(p=>{let g=p.key;return p.label&&s&&(g=typeof p.label=="function"?p.label({featureClientSchemaMap:s,i18n:a,schemaPath:l}):p.label),Et("div",{className:`${O}__group ${O}__group-${p.key}`,children:[q("div",{className:`${O}__group-title`,children:g}),p.items.map((f,C)=>q(br,{index:C,isSelected:i===f.key,item:f,onClick:()=>{y(f.key),x(f)},onMouseEnter:()=>{y(f.key)},ref:h=>{f.ref={current:h}}},f.key))]},p.key)})}),c.current):null,onQueryChange:n,triggerFn:u})}import{c as Nr}from"react/compiler-runtime";import{useLexicalComposerContext as wr}from"@lexical/react/LexicalComposerContext";import{TEXT_TYPE_TO_FORMAT as Sr,TextNode as Pr}from"lexical";import{useEffect as Tr}from"react";function St(e){let t=Nr(6),{features:o}=e,[n]=wr(),r;t[0]!==n||t[1]!==o.enabledFormats?(r=()=>{let s=Rr(o.enabledFormats);if(s.length!==0)return n.registerNodeTransform(Pr,l=>{s.forEach(u=>{l.hasFormat(u)&&l.toggleFormat(u)})})},t[0]=n,t[1]=o.enabledFormats,t[2]=r):r=t[2];let a;return t[3]!==n||t[4]!==o?(a=[n,o],t[3]=n,t[4]=o,t[5]=a):a=t[5],Tr(r,a),null}function Rr(e){let t=Object.keys(Sr),o=new Set(e);return t.filter(n=>!o.has(n))}import{c as kr}from"react/compiler-runtime";import{jsx as Pt}from"react/jsx-runtime";import{useLexicalComposerContext as _r}from"@lexical/react/LexicalComposerContext";import{ContentEditable as vr}from"@lexical/react/LexicalContentEditable.js";import{useTranslation as Dr}from"@payloadcms/ui";import"react";function Tt(e){let t=kr(5),{className:o,editorConfig:n}=e,{t:r}=Dr(),[,a]=_r(),{getTheme:s}=a,l;if(t[0]!==o||t[1]!==n?.admin?.placeholder||t[2]!==s||t[3]!==r){let u=s();l=Pt(vr,{"aria-placeholder":r("lexical:general:placeholder"),className:o??"ContentEditable__root",placeholder:Pt("p",{className:u?.placeholder,children:n?.admin?.placeholder??r("lexical:general:placeholder")})}),t[0]=o,t[1]=n?.admin?.placeholder,t[2]=s,t[3]=r,t[4]=l}else l=t[4];return l}var kt=e=>{let t=Lr(13),{editorConfig:o,editorContainerRef:n,isSmallWidthViewport:r,onChange:a,rtl:s}=e,l=P(),[u]=Mr(),d=Fr(),[m,c]=jr(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=f=>{f!==null&&c(f)},t[0]=i):i=t[0];let x=i,y,p;t[1]!==u||t[2]!==l?(y=()=>{if(!l?.uuid){console.error("Lexical Editor must be used within an EditorConfigProvider");return}l?.parentEditor?.uuid&&l.parentEditor?.registerChild(l.uuid,l);let f=()=>{l.focusEditor(l)},C=()=>{l.blurEditor(l)},h=u.registerCommand(Kr,()=>(f(),!0),Rt),b=u.registerCommand($r,()=>(C(),!0),Rt);return()=>{h(),b(),l.parentEditor?.unregisterChild?.(l.uuid)}},p=[u,l],t[1]=u,t[2]=l,t[3]=y,t[4]=p):(y=t[3],p=t[4]),zr(y,p);let g;return t[5]!==o||t[6]!==n||t[7]!==m||t[8]!==d||t[9]!==r||t[10]!==a||t[11]!==s?(g=se(Q.Fragment,{children:[o.features.plugins?.map(Hr),se("div",{className:"editor-container",dir:s?"rtl":void 0,ref:n,children:[o.features.plugins?.map(Vr),E(Ir,{contentEditable:E("div",{className:"editor-scroller",children:E("div",{className:"editor",ref:x,children:E(Tt,{editorConfig:o})})}),ErrorBoundary:Ar}),E(yt,{}),d&&E(mt,{}),E(Ue,{}),E(We,{}),E(St,{features:o.features}),E(xt,{}),E(ht,{}),d&&E(Or,{ignoreSelectionChange:!0,onChange:(f,C,h)=>{(!h.has("focus")||h.size>1)&&a?.(f,C,h)}}),m&&se(Q.Fragment,{children:[!r&&d&&se(Q.Fragment,{children:[o.admin?.hideDraggableBlockElement?null:E(dt,{anchorElem:m}),o.admin?.hideAddBlockButton?null:E(tt,{anchorElem:m})]}),o.features.plugins?.map(f=>{if(f.position==="floatingAnchorElem"&&!(f.desktopOnly===!0&&r))return E(j,{anchorElem:m,clientProps:f.clientProps,plugin:f},f.key)}),d&&E(Q.Fragment,{children:E(wt,{anchorElem:m})})]}),d&&se(Q.Fragment,{children:[E(Br,{}),o?.features?.markdownTransformers?.length>0&&E(gt,{})]}),o.features.plugins?.map(Wr),o.features.plugins?.map(Yr)]}),o.features.plugins?.map(Gr)]}),t[5]=o,t[6]=n,t[7]=m,t[8]=d,t[9]=r,t[10]=a,t[11]=s,t[12]=g):g=t[12],g};function Hr(e){if(e.position==="aboveContainer")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}function Vr(e){if(e.position==="top")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}function Wr(e){if(e.position==="normal")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}function Yr(e){if(e.position==="bottom")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}function Gr(e){if(e.position==="belowContainer")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}var vt=({children:e,providers:t})=>{if(!t?.length)return e;let o=t[0];return t.length>1?z(o,{children:z(vt,{providers:t.slice(1),children:e})}):z(o,{children:e})},Dt=e=>{let{composerKey:t,editorConfig:o,fieldProps:n,isSmallWidthViewport:r,onChange:a,readOnly:s,rtl:l,value:u}=e,{currentView:d,views:m}=$(),c=P(),i=Jr(),x=_t.useRef(null),y=qr(()=>{if(u&&typeof u!="object")throw new Error("The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: "+JSON.stringify(u));if(u&&Array.isArray(u)&&!("root"in u))throw new Error("You have tried to pass in data from the old Slate editor to the new Lexical editor. The data structure is different, thus you will have to migrate your data. We offer a one-line migration script which migrates all your rich text fields: https://payloadcms.com/docs/lexical/migration#migration-via-migration-script-recommended");if(u&&"jsonContent"in u)throw new Error("You have tried to pass in data from payload-plugin-lexical. The data structure is different, thus you will have to migrate your data. Migration guide: https://payloadcms.com/docs/lexical/migration#migrating-from-payload-plugin-lexical");let p=m?.[d]?.nodes;return{editable:s!==!0,editorState:u!=null?JSON.stringify(u):void 0,namespace:o.lexical.namespace,nodes:ze({editorConfig:o,nodeViews:p}),onError:g=>{throw g},theme:o.lexical.theme}},[o,m,d]);return y?z(Ur,{initialConfig:y,children:z(Ae,{editorConfig:o,editorContainerRef:x,fieldProps:n,parentContext:c?.editDepth===i?c:void 0,children:z(vt,{providers:o.features.providers,children:z(kt,{editorConfig:o,editorContainerRef:x,isSmallWidthViewport:r,onChange:a,rtl:l})})})},t+y.editable+d):z("p",{children:"Loading..."})};import{c as Qr}from"react/compiler-runtime";import{jsx as X,jsxs as Xr}from"react/jsx-runtime";import{ChevronIcon as Zr,Popup as en,PopupList as Lt}from"@payloadcms/ui";import"react";function Mt(){let e=Qr(5),{currentView:t,setCurrentView:o,views:n}=$();if(!n||Object.keys(n).length===0)return null;let r,a;if(e[0]!==t||e[1]!==o||e[2]!==n){a=Symbol.for("react.early_return_sentinel");e:{let s=Object.keys(n);if(!s.some(on)){a=null;break e}let u=["default",...s.filter(tn)],d=t.charAt(0).toUpperCase()+t.slice(1);r=X("div",{className:"lexical-view-selector",children:X(en,{button:Xr("button",{className:"lexical-view-selector__button",type:"button",children:[X("span",{className:"lexical-view-selector__label",children:d}),X(Zr,{className:"lexical-view-selector__icon"})]}),buttonType:"custom",horizontalAlign:"left",render:m=>{let{close:c}=m;return X(Lt.ButtonGroup,{children:u.map(i=>{let x=i.charAt(0).toUpperCase()+i.slice(1);return X(Lt.Button,{active:i===t,disabled:i===t,onClick:()=>{o?.(i),c()},children:x},i)})})},size:"large"})})}e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=a}else r=e[3],a=e[4];return a!==Symbol.for("react.early_return_sentinel")?a:r}function tn(e){return e!=="default"}function on(e){return e!=="default"}var Z="rich-text-lexical",xn=e=>{let{editorConfig:t,field:o,field:{admin:{className:n,description:r,readOnly:a}={},label:s,localized:l,required:u},path:d,readOnly:m,schemaPath:c,validate:i}=e,x=m||a,y=mn(),{config:{localization:p}}=cn(),g=an({fieldLocalized:l,locale:y,localizationConfig:p||void 0}),f=un(),{isControlledByParent:C}=$(),h=Ot((A,te)=>typeof i=="function"?i(A,{...te,required:u}):!0,[i,u]),{customComponents:{AfterInput:b,BeforeInput:_,Description:w,Error:k,Label:L}={},disabled:S,initialValue:I,path:R,setValue:F,showError:v,value:M}=fn({potentiallyStalePath:d,validate:h}),ae=x||S,[ee,Ne]=Ft(!1),[Le,we]=Ft(),ce=Bt.useRef(I),T=Bt.useRef(M);It(()=>{let A=()=>{let te=window.matchMedia("(max-width: 768px)").matches;te!==ee&&Ne(te)};return A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}},[ee]);let N=["field-type",Z,n,v&&"error",ae&&`${Z}--read-only`,t?.admin?.hideGutter!==!0&&!ee?`${Z}--show-gutter`:null].filter(Boolean).join(" "),ue=`${R}.${f}`,de=Oe(),$t=Ot(A=>{de(()=>{let Me=A.toJSON();T.current=Me,F(Me)})},[F,de]),Kt=hn(()=>pn(o),[o]),zt=dn(A=>{T.current!==M&&!gn(T.current!=null?JSON.parse(JSON.stringify(T.current)):T.current,M)&&(ce.current=A,T.current=M,we(new Date))});return It(()=>{Object.is(I,ce.current)||zt(I)},[I]),le("div",{className:N,"data-field-path":R,"data-field-schemapath":c,"data-lexical-view":t?.view,style:Kt,children:[le("div",{className:`${Z}__label-row`,children:[L||D(ln,{label:s,localized:l,path:R,required:u}),!C&&D(Mt,{})]}),le("div",{className:`${Z}__wrap`,children:[D(At,{CustomComponent:k,Fallback:D(sn,{path:R,showError:v})}),le(yn,{fallbackRender:Cn,onReset:()=>{},children:[_,D("div",{className:`${Z}__editor-content`,children:D(rn,{modalSlugPrefix:`lexical-${R}`,children:D(Dt,{composerKey:ue,editorConfig:t,fieldProps:e,isSmallWidthViewport:ee,onChange:$t,readOnly:ae,rtl:g,value:M},JSON.stringify({path:R,rerenderProviderKey:Le}))})}),b]}),D(At,{CustomComponent:w,Fallback:D(nn,{description:r,path:R})})]})]},ue)};function Cn({error:e}){return le("div",{className:"errorBoundary",role:"alert",children:[D("p",{children:"Something went wrong:"}),D("pre",{style:{color:"red"},children:e instanceof Error?e.message:String(e)})]})}var Ll=xn;export{Ll as RichText};
2
- //# sourceMappingURL=Field-F22V5L4V.js.map