@payloadcms/richtext-lexical 4.0.0-internal.e7d4ebc → 4.0.0-internal.f11981a

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 (225) hide show
  1. package/dist/exports/client/Field-F22V5L4V.js +2 -0
  2. package/dist/exports/client/{Field-QGSHF22S.js.map → Field-F22V5L4V.js.map} +3 -3
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-43E5QYAA.js +2 -0
  5. package/dist/exports/client/chunk-43E5QYAA.js.map +7 -0
  6. package/dist/exports/client/chunk-LN6VX25I.js +2 -0
  7. package/dist/exports/client/chunk-LN6VX25I.js.map +7 -0
  8. package/dist/exports/client/component-D5QLYS7W.js +2 -0
  9. package/dist/exports/client/component-D5QLYS7W.js.map +7 -0
  10. package/dist/exports/client/index.d.ts +1 -1
  11. package/dist/exports/client/index.d.ts.map +1 -1
  12. package/dist/exports/client/index.js +25 -25
  13. package/dist/exports/client/index.js.map +4 -4
  14. package/dist/features/blocks/server/index.js +2 -2
  15. package/dist/features/blocks/server/index.js.map +1 -1
  16. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  17. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
  18. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  19. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +1 -1
  20. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  21. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  22. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  23. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
  24. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  25. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
  26. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  27. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  28. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  29. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  30. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  31. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  32. package/dist/features/link/server/index.js +2 -2
  33. package/dist/features/link/server/index.js.map +1 -1
  34. package/dist/features/table/client/index.d.ts.map +1 -0
  35. package/dist/features/table/client/index.js.map +1 -0
  36. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  37. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  38. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  39. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  40. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  41. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  42. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  43. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  44. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  45. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  46. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  47. package/dist/features/table/client/utils/debounce.js.map +1 -0
  48. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  49. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  50. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  51. package/dist/features/table/markdownTransformer.js.map +1 -0
  52. package/dist/features/table/server/index.d.ts +3 -0
  53. package/dist/features/table/server/index.d.ts.map +1 -0
  54. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  55. package/dist/features/table/server/index.js.map +1 -0
  56. package/dist/features/table/server/schema.d.ts.map +1 -0
  57. package/dist/features/table/server/schema.js.map +1 -0
  58. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  59. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +0 -2
  60. package/dist/features/typesServer.d.ts +1 -1
  61. package/dist/features/typesServer.d.ts.map +1 -1
  62. package/dist/features/typesServer.js.map +1 -1
  63. package/dist/features/upload/client/component/index.js +2 -1
  64. package/dist/features/upload/client/component/index.js.map +1 -1
  65. package/dist/features/upload/server/index.js +2 -2
  66. package/dist/features/upload/server/index.js.map +1 -1
  67. package/dist/field/bundled.css +1 -1
  68. package/dist/i18n.d.ts.map +1 -1
  69. package/dist/i18n.js +68 -0
  70. package/dist/i18n.js.map +1 -1
  71. package/dist/index.d.ts +2 -2
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +5 -5
  74. package/dist/index.js.map +1 -1
  75. package/dist/lexical/config/server/loader.d.ts +1 -1
  76. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  77. package/dist/lexical/config/server/loader.js +2 -2
  78. package/dist/lexical/config/server/loader.js.map +1 -1
  79. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  80. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  81. package/dist/lexical/config/server/sanitize.js +2 -2
  82. package/dist/lexical/config/server/sanitize.js.map +1 -1
  83. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +16 -24
  84. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  85. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  86. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  87. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  88. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  89. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -20
  90. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  91. package/dist/lexical/plugins/SlashMenu/index.css +0 -1
  92. package/dist/lexical/ui/ContentEditable.css +0 -4
  93. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  94. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  95. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  96. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  97. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  98. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  99. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  100. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  101. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  102. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  103. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  104. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  105. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  106. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  107. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  108. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  109. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  110. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  111. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  112. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  113. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  114. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  115. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  116. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  117. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  118. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  119. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  120. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  121. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  122. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  123. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  124. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  125. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  126. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  127. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  128. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  129. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  130. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  131. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  132. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  133. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  134. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  135. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  136. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  137. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  138. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  139. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  140. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  141. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  142. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  143. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  144. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  145. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  146. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  147. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  148. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  149. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  150. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  151. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  152. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  153. package/dist/types/index.d.ts +1 -1
  154. package/dist/types/index.d.ts.map +1 -1
  155. package/dist/types/index.js.map +1 -1
  156. package/dist/types/nodeTypes.d.ts +1 -1
  157. package/dist/types/nodeTypes.d.ts.map +1 -1
  158. package/dist/types/nodeTypes.js.map +1 -1
  159. package/dist/utilities/createServerFeature.d.ts +1 -1
  160. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  161. package/dist/utilities/createServerFeature.js +2 -2
  162. package/dist/utilities/createServerFeature.js.map +1 -1
  163. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  164. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  165. package/dist/utilities/editorConfigFactory.js +9 -9
  166. package/dist/utilities/editorConfigFactory.js.map +1 -1
  167. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  168. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  169. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  170. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  171. package/package.json +94 -20
  172. package/dist/exports/client/Field-QGSHF22S.js +0 -2
  173. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  174. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  175. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  176. package/dist/exports/client/chunk-X3D4LZS7.js.map +0 -7
  177. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  178. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  179. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  180. package/dist/features/experimental_table/client/index.js.map +0 -1
  181. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  182. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  183. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  184. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  185. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  186. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  187. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  188. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  189. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  190. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  191. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  192. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  193. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  194. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  195. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  196. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  197. package/dist/features/experimental_table/server/index.d.ts +0 -3
  198. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  199. package/dist/features/experimental_table/server/index.js.map +0 -1
  200. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  201. package/dist/features/experimental_table/server/schema.js.map +0 -1
  202. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  203. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  204. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -0
  205. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  206. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +0 -0
  207. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  208. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  209. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +0 -0
  210. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  211. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  212. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
  213. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  214. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  215. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  216. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  217. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  218. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  219. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  220. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  221. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  222. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  223. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  224. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  225. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"editorConfigFactory.d.ts","sourceRoot":"","sources":["../../src/utilities/editorConfigFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,KAAK,EAA2B,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACjG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EACV,aAAa,EAEb,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA;AAO1B,eAAO,MAAM,mBAAmB;IAC9B,OAAO,SAAe;QACpB,MAAM,EAAE,eAAe,CAAA;QACvB,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC5B,KAAG,OAAO,CAAC,2BAA2B,CAAC;IAMxC;;;;;;;OAOG;IACH,UAAU,SAAe;QACvB,MAAM,EAAE,eAAe,CAAA;QACvB,MAAM,EAAE,8BAA8B,CAAA;QACtC,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB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CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,KAAG;IACF,QAAQ,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAA;IAC5D,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,eAAe,EAAE,2BAA2B,CAAA;CA0C7C,CAAA"}
@@ -3,7 +3,7 @@ import { loadFeatures } from '../lexical/config/server/loader.js';
3
3
  import { sanitizeServerFeatures } from '../lexical/config/server/sanitize.js';
4
4
  import { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js';
5
5
  export const editorConfigFactory = {
6
- default: async args => {
6
+ default: args => {
7
7
  return getDefaultSanitizedEditorConfig({
8
8
  config: args.config,
9
9
  parentIsLocalized: args.parentIsLocalized ?? false
@@ -17,8 +17,8 @@ export const editorConfigFactory = {
17
17
  * This is the least efficient way to get the editor config, and not recommended. It is recommended to extract the `features` arg
18
18
  * into a separate variable and use `fromFeatures` instead.
19
19
  */
20
- fromEditor: async args => {
21
- const lexicalAdapter = await args.editor({
20
+ fromEditor: args => {
21
+ const lexicalAdapter = args.editor({
22
22
  config: args.config,
23
23
  isRoot: args.isRoot ?? false,
24
24
  parentIsLocalized: args.parentIsLocalized ?? false
@@ -29,17 +29,17 @@ export const editorConfigFactory = {
29
29
  /**
30
30
  * Create a new editor config - behaves just like instantiating a new `lexicalEditor`
31
31
  */
32
- fromFeatures: async args => {
33
- return (await featuresInputToEditorConfig(args)).sanitizedConfig;
32
+ fromFeatures: args => {
33
+ return featuresInputToEditorConfig(args).sanitizedConfig;
34
34
  },
35
35
  fromField: args => {
36
36
  const lexicalAdapter = args.field.editor;
37
37
  const sanitizedServerEditorConfig = lexicalAdapter.editorConfig;
38
38
  return sanitizedServerEditorConfig;
39
39
  },
40
- fromUnsanitizedField: async args => {
40
+ fromUnsanitizedField: args => {
41
41
  const lexicalAdapterProvider = args.field.editor;
42
- const lexicalAdapter = await lexicalAdapterProvider({
42
+ const lexicalAdapter = lexicalAdapterProvider({
43
43
  config: args.config,
44
44
  isRoot: args.isRoot ?? false,
45
45
  parentIsLocalized: args.parentIsLocalized ?? false
@@ -48,7 +48,7 @@ export const editorConfigFactory = {
48
48
  return sanitizedServerEditorConfig;
49
49
  }
50
50
  };
51
- export const featuresInputToEditorConfig = async args => {
51
+ export const featuresInputToEditorConfig = args => {
52
52
  let features = [];
53
53
  if (args.features && typeof args.features === 'function') {
54
54
  const rootEditor = args.config.editor;
@@ -67,7 +67,7 @@ export const featuresInputToEditorConfig = async args => {
67
67
  features = defaultEditorFeatures;
68
68
  }
69
69
  const lexical = args.lexical ?? defaultEditorConfig.lexical;
70
- const resolvedFeatureMap = await loadFeatures({
70
+ const resolvedFeatureMap = loadFeatures({
71
71
  config: args.config,
72
72
  isRoot: args.isRoot ?? false,
73
73
  parentIsLocalized: args.parentIsLocalized ?? false,
@@ -1 +1 @@
1
- {"version":3,"file":"editorConfigFactory.js","names":["defaultEditorConfig","defaultEditorFeatures","loadFeatures","sanitizeServerFeatures","getDefaultSanitizedEditorConfig","editorConfigFactory","default","args","config","parentIsLocalized","fromEditor","lexicalAdapter","editor","isRoot","sanitizedServerEditorConfig","editorConfig","fromFeatures","featuresInputToEditorConfig","sanitizedConfig","fromField","field","fromUnsanitizedField","lexicalAdapterProvider","features","rootEditor","rootEditorFeatures","defaultFeatures","rootFeatures","lexical","resolvedFeatureMap","unSanitizedEditorConfig"],"sources":["../../src/utilities/editorConfigFactory.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\nimport type { RichTextAdapterProvider, RichTextField, SanitizedConfig } from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from '../features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type {\n FeaturesInput,\n LexicalRichTextAdapter,\n LexicalRichTextAdapterProvider,\n} from '../types/index.js'\n\nimport { defaultEditorConfig, defaultEditorFeatures } from '../lexical/config/server/default.js'\nimport { loadFeatures } from '../lexical/config/server/loader.js'\nimport { sanitizeServerFeatures } from '../lexical/config/server/sanitize.js'\nimport { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js'\n\nexport const editorConfigFactory = {\n default: async (args: {\n config: SanitizedConfig\n parentIsLocalized?: boolean\n }): Promise<SanitizedServerEditorConfig> => {\n return getDefaultSanitizedEditorConfig({\n config: args.config,\n parentIsLocalized: args.parentIsLocalized ?? false,\n })\n },\n /**\n * If you have instantiated a lexical editor and are accessing it outside a field (=> this is the unsanitized editor),\n * you can extract the editor config from it.\n * This is common if you define the editor in a re-usable module scope variable and pass it to the richText field.\n *\n * This is the least efficient way to get the editor config, and not recommended. It is recommended to extract the `features` arg\n * into a separate variable and use `fromFeatures` instead.\n */\n fromEditor: async (args: {\n config: SanitizedConfig\n editor: LexicalRichTextAdapterProvider\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n }): Promise<SanitizedServerEditorConfig> => {\n const lexicalAdapter: LexicalRichTextAdapter = await args.editor({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n })\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n /**\n * Create a new editor config - behaves just like instantiating a new `lexicalEditor`\n */\n fromFeatures: async (args: {\n config: SanitizedConfig\n features?: FeaturesInput\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n }): Promise<SanitizedServerEditorConfig> => {\n return (await featuresInputToEditorConfig(args)).sanitizedConfig\n },\n fromField: (args: { field: RichTextField }): SanitizedServerEditorConfig => {\n const lexicalAdapter: LexicalRichTextAdapter = args.field.editor as LexicalRichTextAdapter\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n fromUnsanitizedField: async (args: {\n config: SanitizedConfig\n field: RichTextField\n isRoot?: boolean\n parentIsLocalized?: boolean\n }): Promise<SanitizedServerEditorConfig> => {\n const lexicalAdapterProvider: RichTextAdapterProvider = args.field\n .editor as RichTextAdapterProvider\n\n const lexicalAdapter: LexicalRichTextAdapter = (await lexicalAdapterProvider({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n })) as LexicalRichTextAdapter\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n}\n\nexport const featuresInputToEditorConfig = async (args: {\n config: SanitizedConfig\n features?: FeaturesInput\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n}): Promise<{\n features: FeatureProviderServer<unknown, unknown, unknown>[]\n resolvedFeatureMap: ResolvedServerFeatureMap\n sanitizedConfig: SanitizedServerEditorConfig\n}> => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (args.features && typeof args.features === 'function') {\n const rootEditor = args.config.editor\n let rootEditorFeatures: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (typeof rootEditor === 'object' && 'features' in rootEditor) {\n rootEditorFeatures = (rootEditor as LexicalRichTextAdapter).features\n }\n features = args.features({\n defaultFeatures: defaultEditorFeatures,\n rootFeatures: rootEditorFeatures,\n })\n } else {\n features = args.features as FeatureProviderServer<unknown, unknown, unknown>[]\n }\n\n if (!features) {\n features = defaultEditorFeatures\n }\n\n const lexical = args.lexical ?? defaultEditorConfig.lexical\n\n const resolvedFeatureMap = await loadFeatures({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n unSanitizedEditorConfig: {\n features,\n lexical,\n },\n })\n\n return {\n features,\n resolvedFeatureMap,\n sanitizedConfig: {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical: args.lexical,\n resolvedFeatureMap,\n },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","loadFeatures","sanitizeServerFeatures","getDefaultSanitizedEditorConfig","editorConfigFactory","default","args","config","parentIsLocalized","fromEditor","lexicalAdapter","editor","isRoot","sanitizedServerEditorConfig","editorConfig","fromFeatures","featuresInputToEditorConfig","sanitizedConfig","fromField","field","fromUnsanitizedField","lexicalAdapterProvider","features","rootEditor","rootEditorFeatures","defaultFeatures","rootFeatures","lexical","resolvedFeatureMap","unSanitizedEditorConfig"],"sources":["../../src/utilities/editorConfigFactory.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\nimport type { RichTextAdapterProvider, RichTextField, SanitizedConfig } from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from '../features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type {\n FeaturesInput,\n LexicalRichTextAdapter,\n LexicalRichTextAdapterProvider,\n} from '../types/index.js'\n\nimport { defaultEditorConfig, defaultEditorFeatures } from '../lexical/config/server/default.js'\nimport { loadFeatures } from '../lexical/config/server/loader.js'\nimport { sanitizeServerFeatures } from '../lexical/config/server/sanitize.js'\nimport { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js'\n\nexport const editorConfigFactory = {\n default: (args: {\n config: SanitizedConfig\n parentIsLocalized?: boolean\n }): SanitizedServerEditorConfig => {\n return getDefaultSanitizedEditorConfig({\n config: args.config,\n parentIsLocalized: args.parentIsLocalized ?? false,\n })\n },\n /**\n * If you have instantiated a lexical editor and are accessing it outside a field (=> this is the unsanitized editor),\n * you can extract the editor config from it.\n * This is common if you define the editor in a re-usable module scope variable and pass it to the richText field.\n *\n * This is the least efficient way to get the editor config, and not recommended. It is recommended to extract the `features` arg\n * into a separate variable and use `fromFeatures` instead.\n */\n fromEditor: (args: {\n config: SanitizedConfig\n editor: LexicalRichTextAdapterProvider\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n }): SanitizedServerEditorConfig => {\n const lexicalAdapter: LexicalRichTextAdapter = args.editor({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n })\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n /**\n * Create a new editor config - behaves just like instantiating a new `lexicalEditor`\n */\n fromFeatures: (args: {\n config: SanitizedConfig\n features?: FeaturesInput\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n }): SanitizedServerEditorConfig => {\n return featuresInputToEditorConfig(args).sanitizedConfig\n },\n fromField: (args: { field: RichTextField }): SanitizedServerEditorConfig => {\n const lexicalAdapter: LexicalRichTextAdapter = args.field.editor as LexicalRichTextAdapter\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n fromUnsanitizedField: (args: {\n config: SanitizedConfig\n field: RichTextField\n isRoot?: boolean\n parentIsLocalized?: boolean\n }): SanitizedServerEditorConfig => {\n const lexicalAdapterProvider: RichTextAdapterProvider = args.field\n .editor as RichTextAdapterProvider\n\n const lexicalAdapter: LexicalRichTextAdapter = lexicalAdapterProvider({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n }) as LexicalRichTextAdapter\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n}\n\nexport const featuresInputToEditorConfig = (args: {\n config: SanitizedConfig\n features?: FeaturesInput\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n}): {\n features: FeatureProviderServer<unknown, unknown, unknown>[]\n resolvedFeatureMap: ResolvedServerFeatureMap\n sanitizedConfig: SanitizedServerEditorConfig\n} => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (args.features && typeof args.features === 'function') {\n const rootEditor = args.config.editor\n let rootEditorFeatures: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (typeof rootEditor === 'object' && 'features' in rootEditor) {\n rootEditorFeatures = (rootEditor as LexicalRichTextAdapter).features\n }\n features = args.features({\n defaultFeatures: defaultEditorFeatures,\n rootFeatures: rootEditorFeatures,\n })\n } else {\n features = args.features as FeatureProviderServer<unknown, unknown, unknown>[]\n }\n\n if (!features) {\n features = defaultEditorFeatures\n }\n\n const lexical = args.lexical ?? defaultEditorConfig.lexical\n\n const resolvedFeatureMap = loadFeatures({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n unSanitizedEditorConfig: {\n features,\n lexical,\n },\n })\n\n return {\n features,\n resolvedFeatureMap,\n sanitizedConfig: {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical: args.lexical,\n resolvedFeatureMap,\n },\n }\n}\n"],"mappings":"AAWA,SAASA,mBAAmB,EAAEC,qBAAqB,QAAQ;AAC3D,SAASC,YAAY,QAAQ;AAC7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,+BAA+B,QAAQ;AAEhD,OAAO,MAAMC,mBAAA,GAAsB;EACjCC,OAAA,EAAUC,IAAA;IAIR,OAAOH,+BAAA,CAAgC;MACrCI,MAAA,EAAQD,IAAA,CAAKC,MAAM;MACnBC,iBAAA,EAAmBF,IAAA,CAAKE,iBAAiB,IAAI;IAC/C;EACF;EACA;;;;;;;;EAQAC,UAAA,EAAaH,IAAA;IAOX,MAAMI,cAAA,GAAyCJ,IAAA,CAAKK,MAAM,CAAC;MACzDJ,MAAA,EAAQD,IAAA,CAAKC,MAAM;MACnBK,MAAA,EAAQN,IAAA,CAAKM,MAAM,IAAI;MACvBJ,iBAAA,EAAmBF,IAAA,CAAKE,iBAAiB,IAAI;IAC/C;IAEA,MAAMK,2BAAA,GAA2DH,cAAA,CAAeI,YAAY;IAC5F,OAAOD,2BAAA;EACT;EACA;;;EAGAE,YAAA,EAAeT,IAAA;IAOb,OAAOU,2BAAA,CAA4BV,IAAA,EAAM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,YAAA,CAAa;IACtCM,MAAA,EAAQD,IAAA,CAAKC,MAAM;IACnBK,MAAA,EAAQN,IAAA,CAAKM,MAAM,IAAI;IACvBJ,iBAAA,EAAmBF,IAAA,CAAKE,iBAAiB,IAAI;IAC7CqB,uBAAA,EAAyB;MACvBP,QAAA;MACAK;IACF;EACF;EAEA,OAAO;IACLL,QAAA;IACAM,kBAAA;IACAX,eAAA,EAAiB;MACfK,QAAA,EAAUpB,sBAAA,CAAuB0B,kBAAA;MACjCD,OAAA,EAASrB,IAAA,CAAKqB,OAAO;MACrBC;IACF;EACF;AACF","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import type { SanitizedConfig } from 'payload';
2
2
  import { type SanitizedServerEditorConfig } from '../index.js';
3
- export declare const getDefaultSanitizedEditorConfig: (args: {
3
+ export declare const getDefaultSanitizedEditorConfig: ({ config, parentIsLocalized, }: {
4
4
  config: SanitizedConfig;
5
5
  parentIsLocalized: boolean;
6
- }) => Promise<SanitizedServerEditorConfig>;
6
+ }) => SanitizedServerEditorConfig;
7
7
  //# sourceMappingURL=getDefaultSanitizedEditorConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultSanitizedEditorConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/getDefaultSanitizedEditorConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAgB9D,eAAO,MAAM,+BAA+B,SAAgB;IAC1D,MAAM,EAAE,eAAe,CAAA;IACvB,iBAAiB,EAAE,OAAO,CAAA;CAC3B,KAAG,OAAO,CAAC,2BAA2B,CAoBtC,CAAA"}
1
+ {"version":3,"file":"getDefaultSanitizedEditorConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/getDefaultSanitizedEditorConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAQ9D,eAAO,MAAM,+BAA+B,mCAGzC;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,iBAAiB,EAAE,OAAO,CAAA;CAC3B,KAAG,2BAGH,CAAA"}
@@ -1,21 +1,10 @@
1
1
  import { defaultEditorConfig } from '../lexical/config/server/default.js';
2
2
  import { sanitizeServerEditorConfig } from '../lexical/config/server/sanitize.js';
3
- let cachedDefaultSanitizedServerEditorConfig = global._payload_lexical_defaultSanitizedServerEditorConfig;
4
- if (!cachedDefaultSanitizedServerEditorConfig) {
5
- cachedDefaultSanitizedServerEditorConfig = global._payload_lexical_defaultSanitizedServerEditorConfig = null;
6
- }
7
- export const getDefaultSanitizedEditorConfig = async args => {
8
- const {
9
- config,
10
- parentIsLocalized
11
- } = args;
12
- if (cachedDefaultSanitizedServerEditorConfig) {
13
- return await cachedDefaultSanitizedServerEditorConfig;
14
- }
15
- cachedDefaultSanitizedServerEditorConfig = sanitizeServerEditorConfig(defaultEditorConfig, config, parentIsLocalized);
16
- global.payload_lexical_defaultSanitizedServerEditorConfig = cachedDefaultSanitizedServerEditorConfig;
17
- cachedDefaultSanitizedServerEditorConfig = await cachedDefaultSanitizedServerEditorConfig;
18
- global.payload_lexical_defaultSanitizedServerEditorConfig = cachedDefaultSanitizedServerEditorConfig;
19
- return cachedDefaultSanitizedServerEditorConfig;
3
+ const lexicalGlobal = globalThis;
4
+ export const getDefaultSanitizedEditorConfig = ({
5
+ config,
6
+ parentIsLocalized
7
+ }) => {
8
+ return lexicalGlobal._payload_lexical_defaultSanitizedServerEditorConfig ??= sanitizeServerEditorConfig(defaultEditorConfig, config, parentIsLocalized);
20
9
  };
21
10
  //# sourceMappingURL=getDefaultSanitizedEditorConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultSanitizedEditorConfig.js","names":["defaultEditorConfig","sanitizeServerEditorConfig","cachedDefaultSanitizedServerEditorConfig","global","_payload_lexical_defaultSanitizedServerEditorConfig","getDefaultSanitizedEditorConfig","args","config","parentIsLocalized","payload_lexical_defaultSanitizedServerEditorConfig"],"sources":["../../src/utilities/getDefaultSanitizedEditorConfig.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport { type SanitizedServerEditorConfig } from '../index.js'\nimport { defaultEditorConfig } from '../lexical/config/server/default.js'\nimport { sanitizeServerEditorConfig } from '../lexical/config/server/sanitize.js'\n\nlet cachedDefaultSanitizedServerEditorConfig:\n | null\n | Promise<SanitizedServerEditorConfig>\n | SanitizedServerEditorConfig = (global as any)\n ._payload_lexical_defaultSanitizedServerEditorConfig\n\nif (!cachedDefaultSanitizedServerEditorConfig) {\n cachedDefaultSanitizedServerEditorConfig = (\n global as any\n )._payload_lexical_defaultSanitizedServerEditorConfig = null\n}\n\nexport const getDefaultSanitizedEditorConfig = async (args: {\n config: SanitizedConfig\n parentIsLocalized: boolean\n}): Promise<SanitizedServerEditorConfig> => {\n const { config, parentIsLocalized } = args\n\n if (cachedDefaultSanitizedServerEditorConfig) {\n return await cachedDefaultSanitizedServerEditorConfig\n }\n\n cachedDefaultSanitizedServerEditorConfig = sanitizeServerEditorConfig(\n defaultEditorConfig,\n config,\n parentIsLocalized,\n )\n ;(global as any).payload_lexical_defaultSanitizedServerEditorConfig =\n cachedDefaultSanitizedServerEditorConfig\n\n cachedDefaultSanitizedServerEditorConfig = await cachedDefaultSanitizedServerEditorConfig\n ;(global as any).payload_lexical_defaultSanitizedServerEditorConfig =\n cachedDefaultSanitizedServerEditorConfig\n\n return cachedDefaultSanitizedServerEditorConfig\n}\n"],"mappings":"AAGA,SAASA,mBAAmB,QAAQ;AACpC,SAASC,0BAA0B,QAAQ;AAE3C,IAAIC,wCAAA,GAG8BC,MAAC,CAChCC,mDAAmD;AAEtD,IAAI,CAACF,wCAAA,EAA0C;EAC7CA,wCAAA,GAA2CC,MACzC,CACAC,mDAAmD,GAAG;AAC1D;AAEA,OAAO,MAAMC,+BAAA,GAAkC,MAAOC,IAAA;EAIpD,MAAM;IAAEC,MAAM;IAAEC;EAAiB,CAAE,GAAGF,IAAA;EAEtC,IAAIJ,wCAAA,EAA0C;IAC5C,OAAO,MAAMA,wCAAA;EACf;EAEAA,wCAAA,GAA2CD,0BAAA,CACzCD,mBAAA,EACAO,MAAA,EACAC,iBAAA;EAEAL,MAAA,CAAeM,kDAAkD,GACjEP,wCAAA;EAEFA,wCAAA,GAA2C,MAAMA,wCAAA;EAC/CC,MAAA,CAAeM,kDAAkD,GACjEP,wCAAA;EAEF,OAAOA,wCAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"getDefaultSanitizedEditorConfig.js","names":["defaultEditorConfig","sanitizeServerEditorConfig","lexicalGlobal","globalThis","getDefaultSanitizedEditorConfig","config","parentIsLocalized","_payload_lexical_defaultSanitizedServerEditorConfig"],"sources":["../../src/utilities/getDefaultSanitizedEditorConfig.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport { type SanitizedServerEditorConfig } from '../index.js'\nimport { defaultEditorConfig } from '../lexical/config/server/default.js'\nimport { sanitizeServerEditorConfig } from '../lexical/config/server/sanitize.js'\n\nconst lexicalGlobal = globalThis as {\n _payload_lexical_defaultSanitizedServerEditorConfig?: SanitizedServerEditorConfig\n} & typeof globalThis\n\nexport const getDefaultSanitizedEditorConfig = ({\n config,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n parentIsLocalized: boolean\n}): SanitizedServerEditorConfig => {\n return (lexicalGlobal._payload_lexical_defaultSanitizedServerEditorConfig ??=\n sanitizeServerEditorConfig(defaultEditorConfig, config, parentIsLocalized))\n}\n"],"mappings":"AAGA,SAASA,mBAAmB,QAAQ;AACpC,SAASC,0BAA0B,QAAQ;AAE3C,MAAMC,aAAA,GAAgBC,UAAA;AAItB,OAAO,MAAMC,+BAAA,GAAkCA,CAAC;EAC9CC,MAAM;EACNC;AAAiB,CAIlB;EACC,OAAQJ,aAAA,CAAcK,mDAAmD,KACvEN,0BAAA,CAA2BD,mBAAA,EAAqBK,MAAA,EAAQC,iBAAA;AAC5D","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "4.0.0-internal.e7d4ebc",
3
+ "version": "4.0.0-internal.f11981a",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -18,7 +18,6 @@
18
18
  }
19
19
  ],
20
20
  "sideEffects": [
21
- "*.scss",
22
21
  "*.css"
23
22
  ],
24
23
  "type": "module",
@@ -113,6 +112,11 @@
113
112
  "types": "./dist/lexical-proxy/@lexical-utils.d.ts",
114
113
  "default": "./dist/lexical-proxy/@lexical-utils.js"
115
114
  },
115
+ "./lexical/react/ExtensionComponent": {
116
+ "import": "./dist/lexical-proxy/@lexical-react/ExtensionComponent.js",
117
+ "types": "./dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts",
118
+ "default": "./dist/lexical-proxy/@lexical-react/ExtensionComponent.js"
119
+ },
116
120
  "./lexical/react/LexicalAutoEmbedPlugin": {
117
121
  "import": "./dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js",
118
122
  "types": "./dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts",
@@ -178,6 +182,16 @@
178
182
  "types": "./dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts",
179
183
  "default": "./dist/lexical-proxy/@lexical-react/LexicalContentEditable.js"
180
184
  },
185
+ "./lexical/react/LexicalExtensionComposer": {
186
+ "import": "./dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js",
187
+ "types": "./dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts",
188
+ "default": "./dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js"
189
+ },
190
+ "./lexical/react/LexicalExtensionEditorComposer": {
191
+ "import": "./dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js",
192
+ "types": "./dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts",
193
+ "default": "./dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js"
194
+ },
181
195
  "./lexical/react/LexicalNodeContextMenuPlugin": {
182
196
  "import": "./dist/lexical-proxy/@lexical-react/LexicalNodeContextMenuPlugin.js",
183
197
  "types": "./dist/lexical-proxy/@lexical-react/LexicalNodeContextMenuPlugin.d.ts",
@@ -268,6 +282,11 @@
268
282
  "types": "./dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts",
269
283
  "default": "./dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js"
270
284
  },
285
+ "./lexical/react/LexicalSelectionAlwaysOnDisplay": {
286
+ "import": "./dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js",
287
+ "types": "./dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts",
288
+ "default": "./dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js"
289
+ },
271
290
  "./lexical/react/LexicalTabIndentationPlugin": {
272
291
  "import": "./dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js",
273
292
  "types": "./dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts",
@@ -293,11 +312,56 @@
293
312
  "types": "./dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts",
294
313
  "default": "./dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js"
295
314
  },
315
+ "./lexical/react/ReactExtension": {
316
+ "import": "./dist/lexical-proxy/@lexical-react/ReactExtension.js",
317
+ "types": "./dist/lexical-proxy/@lexical-react/ReactExtension.d.ts",
318
+ "default": "./dist/lexical-proxy/@lexical-react/ReactExtension.js"
319
+ },
320
+ "./lexical/react/ReactPluginHostExtension": {
321
+ "import": "./dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js",
322
+ "types": "./dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts",
323
+ "default": "./dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js"
324
+ },
325
+ "./lexical/react/ReactProviderExtension": {
326
+ "import": "./dist/lexical-proxy/@lexical-react/ReactProviderExtension.js",
327
+ "types": "./dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts",
328
+ "default": "./dist/lexical-proxy/@lexical-react/ReactProviderExtension.js"
329
+ },
330
+ "./lexical/react/TreeViewExtension": {
331
+ "import": "./dist/lexical-proxy/@lexical-react/TreeViewExtension.js",
332
+ "types": "./dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts",
333
+ "default": "./dist/lexical-proxy/@lexical-react/TreeViewExtension.js"
334
+ },
335
+ "./lexical/react/useExtensionComponent": {
336
+ "import": "./dist/lexical-proxy/@lexical-react/useExtensionComponent.js",
337
+ "types": "./dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts",
338
+ "default": "./dist/lexical-proxy/@lexical-react/useExtensionComponent.js"
339
+ },
340
+ "./lexical/react/useExtensionSignalValue": {
341
+ "import": "./dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js",
342
+ "types": "./dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts",
343
+ "default": "./dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js"
344
+ },
345
+ "./lexical/react/useLexicalAriaLiveRegion": {
346
+ "import": "./dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js",
347
+ "types": "./dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts",
348
+ "default": "./dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js"
349
+ },
296
350
  "./lexical/react/useLexicalEditable": {
297
351
  "import": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.js",
298
352
  "types": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts",
299
353
  "default": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.js"
300
354
  },
355
+ "./lexical/react/useLexicalFocusManagerRef": {
356
+ "import": "./dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js",
357
+ "types": "./dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts",
358
+ "default": "./dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js"
359
+ },
360
+ "./lexical/react/useLexicalFocusTrapRef": {
361
+ "import": "./dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js",
362
+ "types": "./dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts",
363
+ "default": "./dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js"
364
+ },
301
365
  "./lexical/react/useLexicalIsTextContentEmpty": {
302
366
  "import": "./dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js",
303
367
  "types": "./dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts",
@@ -308,6 +372,16 @@
308
372
  "types": "./dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts",
309
373
  "default": "./dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js"
310
374
  },
375
+ "./lexical/react/useLexicalRovingTabIndexRef": {
376
+ "import": "./dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js",
377
+ "types": "./dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts",
378
+ "default": "./dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js"
379
+ },
380
+ "./lexical/react/useLexicalSlotRef": {
381
+ "import": "./dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js",
382
+ "types": "./dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts",
383
+ "default": "./dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js"
384
+ },
311
385
  "./lexical/react/useLexicalSubscription": {
312
386
  "import": "./dist/lexical-proxy/@lexical-react/useLexicalSubscription.js",
313
387
  "types": "./dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts",
@@ -343,25 +417,25 @@
343
417
  ]
344
418
  },
345
419
  "dependencies": {
346
- "@lexical/clipboard": "0.45.0",
347
- "@lexical/headless": "0.45.0",
348
- "@lexical/html": "0.45.0",
349
- "@lexical/link": "0.45.0",
350
- "@lexical/list": "0.45.0",
351
- "@lexical/mark": "0.45.0",
352
- "@lexical/markdown": "0.45.0",
353
- "@lexical/react": "0.45.0",
354
- "@lexical/rich-text": "0.45.0",
355
- "@lexical/selection": "0.45.0",
356
- "@lexical/table": "0.45.0",
357
- "@lexical/utils": "0.45.0",
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",
358
432
  "acorn": "8.16.0",
359
433
  "bson-objectid": "2.0.4",
360
434
  "csstype": "3.2.3",
361
435
  "dequal": "2.0.3",
362
436
  "escape-html": "1.0.3",
363
437
  "jsox": "1.2.125",
364
- "lexical": "0.45.0",
438
+ "lexical": "0.48.0",
365
439
  "mdast-util-from-markdown": "2.0.3",
366
440
  "mdast-util-mdx-jsx": "3.2.0",
367
441
  "micromark-extension-mdx-jsx": "3.0.2",
@@ -369,8 +443,8 @@
369
443
  "react-error-boundary": "6.1.1",
370
444
  "ts-essentials": "10.0.3",
371
445
  "uuid": "14.0.0",
372
- "@payloadcms/ui": "4.0.0-internal.e7d4ebc",
373
- "@payloadcms/translations": "4.0.0-internal.e7d4ebc"
446
+ "@payloadcms/translations": "4.0.0-internal.f11981a",
447
+ "@payloadcms/ui": "4.0.0-internal.f11981a"
374
448
  },
375
449
  "devDependencies": {
376
450
  "@babel/cli": "7.27.2",
@@ -378,7 +452,7 @@
378
452
  "@babel/preset-env": "7.27.2",
379
453
  "@babel/preset-react": "7.27.1",
380
454
  "@babel/preset-typescript": "7.27.1",
381
- "@lexical/eslint-plugin": "0.45.0",
455
+ "@lexical/eslint-plugin": "0.48.0",
382
456
  "@types/escape-html": "1.0.4",
383
457
  "@types/json-schema": "7.0.15",
384
458
  "@types/node": "24.12.3",
@@ -390,14 +464,14 @@
390
464
  "esbuild-sass-plugin": "3.3.1",
391
465
  "swc-plugin-transform-remove-imports": "8.3.0",
392
466
  "@payloadcms/eslint-config": "3.28.0",
393
- "payload": "4.0.0-internal.e7d4ebc"
467
+ "payload": "4.0.0-internal.f11981a"
394
468
  },
395
469
  "peerDependencies": {
396
470
  "@faceless-ui/modal": "3.0.1",
397
471
  "@faceless-ui/scroll-info": "2.0.0",
398
472
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
399
473
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
400
- "payload": "4.0.0-internal.e7d4ebc"
474
+ "payload": "4.0.0-internal.f11981a"
401
475
  },
402
476
  "engines": {
403
477
  "node": ">=24.15.0"
@@ -1,2 +0,0 @@
1
- "use client";import{b as Be,d as $,e as K,g as Oe,h as Ie,i as Fe,j as $e,k as Se,l as Pe,m as Ke}from"./chunk-X3D4LZS7.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 tn,FieldDescription as on,FieldError as rn,FieldLabel as nn,isFieldRTL as sn,RenderCustomComponent as Mt,useConfig as ln,useEditDepth as an,useEffectEvent as cn,useField as un,useLocale as dn}from"@payloadcms/ui";import{mergeFieldStyles as fn}from"@payloadcms/ui/shared";import{dequal as mn}from"dequal/lite";import At,{useCallback as Bt,useEffect as Ot,useMemo as pn,useState as It}from"react";import{ErrorBoundary as gn}from"react-error-boundary";import"./bundled.css";import{jsx as j}from"react/jsx-runtime";import{LexicalComposer as Yr}from"@lexical/react/LexicalComposer.js";import{useEditDepth as Gr}from"@payloadcms/ui";import*as kt from"react";import{useMemo as Ur}from"react";import{c as _r}from"react/compiler-runtime";import{jsx as E,jsxs as se}from"react/jsx-runtime";import{useLexicalComposerContext as Dr}from"@lexical/react/LexicalComposerContext.js";import{LexicalErrorBoundary as Lr}from"@lexical/react/LexicalErrorBoundary.js";import{HistoryPlugin as Mr}from"@lexical/react/LexicalHistoryPlugin.js";import{OnChangePlugin as Ar}from"@lexical/react/LexicalOnChangePlugin.js";import{RichTextPlugin as Br}from"@lexical/react/LexicalRichTextPlugin.js";import{useLexicalEditable as Or}from"@lexical/react/useLexicalEditable";import{BLUR_COMMAND as Ir,COMMAND_PRIORITY_LOW as Tt,FOCUS_COMMAND as Fr}from"lexical";import*as Q from"react";import{useEffect as $r,useState as Kr}from"react";import{jsx as je}from"react/jsx-runtime";import"react";var z=({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 ze}from"@lexical/clipboard";import{useLexicalComposerContext as zt}from"@lexical/react/LexicalComposerContext.js";import{objectKlassEquals as Ht}from"@lexical/utils";import He from"bson-objectid";import{$getSelection as Vt,$isNodeSelection as Wt,COMMAND_PRIORITY_LOW as Yt,COPY_COMMAND as Gt}from"lexical";import{useEffect as Ut}from"react";var Te=e=>{if("fields"in e&&typeof e.fields=="object"&&e.fields!==null&&"id"in e.fields?e.fields.id=new He.default().toHexString():"id"in e&&(e.id=new He.default().toHexString()),e.children)for(let t of e.children)Te(t)};function Ve(){let e=jt(3),[t]=zt(),o,r;return e[0]!==t?(o=()=>t.registerCommand(Gt,n=>{let c=Vt();if(Wt(c)){let s=c.getNodes()[0]?.exportJSON(),u=JSON.parse(JSON.stringify(s));Te(u);let d={namespace:t._config.namespace,nodes:[u]},m=JSON.stringify(d);return ze(t,null,{"application/x-lexical-editor":m,"text/plain":""}).catch(Jt),!0}return ze(t,Ht(n,ClipboardEvent)?n:null).then(()=>{if(!(n instanceof ClipboardEvent)||!n.clipboardData)throw new Error("No clipboard event");let l=n.clipboardData.getData("application/x-lexical-editor");if(!l)return!0;let s=JSON.parse(l);for(let d of s.nodes)Te(d);let u=JSON.stringify(s);n.clipboardData.setData("application/x-lexical-editor",u)}).catch(l=>{throw n instanceof ClipboardEvent&&n.clipboardData?.setData("application/x-lexical-editor",""),l}),!0},Yt),r=[t],e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]),Ut(o,r),null}function Jt(e){throw e}import{c as qt}from"react/compiler-runtime";import{useLexicalComposerContext as Qt}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as fe,mergeRegister as Xt}from"@lexical/utils";import{$createNodeSelection as Zt,$getEditor as oe,$getNearestNodeFromDOMNode as eo,$getSelection as me,$isDecoratorNode as H,$isElementNode as Re,$isLineBreakNode as to,$isNodeSelection as pe,$isRangeSelection as We,$isRootOrShadowRoot as oo,$isTextNode as ro,$setSelection as Ye,CLICK_COMMAND as no,COMMAND_PRIORITY_LOW as Y,KEY_ARROW_DOWN_COMMAND as io,KEY_ARROW_UP_COMMAND as so,KEY_BACKSPACE_COMMAND as lo,KEY_DELETE_COMMAND as ao,SELECTION_CHANGE_COMMAND as co}from"lexical";import{useEffect as uo}from"react";function Ge(){let e=qt(3),[t]=Qt(),o=xo,r,n;return e[0]!==t?(r=()=>Xt(t.registerCommand(no,yo,Y),t.registerCommand(ao,o,Y),t.registerCommand(lo,o,Y),t.registerCommand(co,ho,Y),t.registerCommand(so,po,Y),t.registerCommand(io,fo,Y)),n=[t],e[0]=t,e[1]=r,e[2]=n):(r=e[1],n=e[2]),uo(r,n),null}function fo(e){let t=me();if(pe(t)){e.preventDefault();let l=t.getNodes()[0]?.getNextSibling();if(H(l)){let d=oe().getElementByKey(l.getKey());return d&&re({element:d,node:l}),!0}if(!Re(l))return!0;let s=l.getFirstDescendant()??l;return s&&(fe(s,ge)?.selectEnd(),e.preventDefault()),!0}if(!We(t))return!1;let r=(t.isBackward()?t.anchor:t.focus).getNode(),n=fe(r,mo),c=n?.getNextSibling();if(!n||c!==Ue(n))return!1;if(H(c)){let l=oe().getElementByKey(c.getKey());if(l)return re({element:l,node:c}),e.preventDefault(),!0}return!1}function mo(e){return Ue(e)!==null}function po(e){let t=me();if(pe(t)){let l=t.getNodes()[0]?.getPreviousSibling();if(H(l)){let d=oe().getElementByKey(l.getKey());return d?(re({element:d,node:l}),e.preventDefault(),!0):!1}if(!Re(l))return!1;let s=l.getLastDescendant()??l;return s?(fe(s,ge)?.selectStart(),e.preventDefault(),!0):!1}if(!We(t))return!1;let r=(t.isBackward()?t.anchor:t.focus).getNode(),n=fe(r,go),c=n?.getPreviousSibling();if(!n||c!==Je(n))return!1;if(H(c)){let l=oe().getElementByKey(c.getKey());if(l)return re({element:l,node:c}),e.preventDefault(),!0}return!1}function go(e){return Je(e)!==null}function ho(){let e=bo();return document.querySelector(".decorator-selected")?.classList.remove("decorator-selected"),e?(e.element?.classList.add("decorator-selected"),!0):!1}function yo(e){document.querySelector(".decorator-selected")?.classList.remove("decorator-selected");let t=Eo(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"]')?Ye(null):re(t),!0}function xo(e){let t=me();return pe(t)?(e.preventDefault(),t.getNodes().forEach(Co),!0):!1}function Co(e){e.remove()}function Eo(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest('[data-lexical-decorator="true"]');if(!(t instanceof HTMLElement))return;let o=eo(t);return H(o)?{element:t,node:o}:void 0}function bo(){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=Zt();o.add(t.getKey()),Ye(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)||oo(e))return!1;let t=e.getFirstChild(),o=t===null||to(t)||ro(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&o}function Ue(e){let t=e.getNextSibling();for(;t!==null;){if(ge(t))return t;t=t.getNextSibling()}return null}function Je(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 Ro}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as ko,isHTMLElement as vo}from"lexical";import*as Ze from"react";import{useCallback as _o,useEffect as Xe,useRef as Do,useState as Lo}from"react";import{createPortal as Mo}from"react-dom";var G=(e,t,o,r,n=50,c=25)=>{let l=0;if(e&&!e.contains(r)){let{bottom:s,left:u,right:d,top:m}=e.getBoundingClientRect(),a=m+window.scrollY,i=s+window.scrollY;if(o<a-c||o>i+c||t<u-n||t>d+n)return-1;(t<u||t>d)&&(l=t<u?t-u:t-d)}return l};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 r=o.split(",").pop();return t.y=t.y-Number(r?.replace(")","")),t}function he(e){let t=(u,d)=>u?parseFloat(window.getComputedStyle(u)[d]):0,{marginBottom:o,marginTop:r}=window.getComputedStyle(e),n=t(e.previousElementSibling,"marginBottom"),c=t(e.nextElementSibling,"marginTop"),l=Math.max(parseFloat(r),n);return{marginBottom:Math.max(parseFloat(o),c),marginTop:l}}import{$getRoot as No}from"lexical";function V(e){return e.getEditorState().read(()=>No().getChildrenKeys())}var wo=1,So=-1,qe=0,B={props:null,result:null};function Po(e,t,o=20){let r=e.x-t.x,n=e.y-t.y;return r*r+n*n<=o*o}function J(e){let{anchorElem:t,cache_threshold:o=20,editor:r,fuzzy:n=!1,horizontalOffset:c=0,point:{x:l,y:s},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&&Po(B.props.point,e.point,o))return B.result;let m=t.getBoundingClientRect(),a=V(r),i={blockElem:null,blockNode:null,distance:1/0,foundAtIndex:-1,isFoundNodeEmptyParagraph:!1};return r.getEditorState().read(()=>{if(d){let p=r.getElementByKey(a[0]),g=r.getElementByKey(a[a.length-1]);if(p&&g){let[f,C]=[U(p),U(g)];if(s<f.top?(i.blockElem=p,i.distance=f.top-s,i.blockNode=ye(a[0]),i.foundAtIndex=0):s>C.bottom&&(i.distance=s-C.bottom,i.blockNode=ye(a[a.length-1]),i.blockElem=g,i.foundAtIndex=a.length-1),i?.blockElem)return{blockElem:null,isFoundNodeEmptyParagraph:!1}}}let x=u,y=qe;for(;x>=0&&x<a.length;){let p=a[x],g=r.getElementByKey(p);if(g===null)break;let f=new K(l+c,s),C=$e.fromDOMRect(U(g)),{marginBottom:h,marginTop:b}=he(g),v=C.generateNewRect({bottom:C.bottom+h,left:m.left,right:m.right,top:C.top-b}),{distance:w,isOnBottomSide:k,isOnTopSide:L}=v.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()===""&&(!n&&!e.returnEmptyParagraphs&&(i.blockElem=null,i.blockNode=null),i.isFoundNodeEmptyParagraph=!0);break}else n&&w<i.distance&&(i.blockElem=g,i.blockNode=ye(p),i.distance=w,i.foundAtIndex=x);y===qe&&(L?y=So:k?y=wo: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 To=["IMG","INPUT","TEXTAREA","SELECT","BUTTON","VIDEO","OBJECT","EMBED","IFRAME","HR"];function Qe(e){if(!e||To.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,r=0){if(!e){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let n=e.getBoundingClientRect(),c=window.getComputedStyle(e),l=t.getBoundingClientRect(),s=o.getBoundingClientRect(),u;if(["LexicalEditorTheme__block","LexicalEditorTheme__upload","LexicalEditorTheme__relationship"].some(a=>e.classList.contains(a)||e.firstElementChild?.classList.contains(a)))u=n.top+8-s.top;else{let a=Qe(e)?parseInt(c.lineHeight,10):0;u=n.top+(a-l.height)/2-s.top}let m=r;t.style.opacity="1",t.style.transform=`translate(${m}px, ${u}px)`}var Ao="add-block-menu",Ee=1/0;function Bo(e){return e===0?1/0:Ee>=0&&Ee<e?Ee:Math.floor(e/2)}function Oo(e,t,o){let r=t.parentElement,{editorConfig:n}=P(),c=n?.admin?.hideGutter?-24:12,l=Do(null),[s,u]=Lo(null);Xe(()=>{function m(a){let i=a.target;if(!vo(i))return;let x=G(r,a.pageX,a.pageY,i);if(x===-1){u(null);return}if(xe(i,Ao))return;let y=V(e),{blockElem:p,blockNode:g,foundAtIndex:f}=J({anchorElem:t,cache_threshold:0,editor:e,horizontalOffset:-x,point:new K(a.x,a.y),returnEmptyParagraphs:!0,startIndex:Bo(y.length),useEdgeAsDefault:!1});Ee=f,p&&g&&(s?.node!==g||s?.elem!==p)&&u({elem:p,node:g})}return document?.addEventListener("mousemove",m),()=>{document?.removeEventListener("mousemove",m)}},[r,t,e,s]),Xe(()=>{l.current&&s?.node&&Ce(s?.elem,l.current,t,c)},[t,s,c]);let d=_o(m=>{let a=s;a?.node&&(e.update(()=>{let i=!0;if((a?.node.getType()!=="paragraph"||a.node.getTextContent()!=="")&&(i=!1),!i){let x=ko();a?.node.insertAfter(x),setTimeout(()=>{a={elem:e.getElementByKey(x.getKey()),node:x},u(a)},0)}}),setTimeout(()=>{e.update(()=>{e.focus(),a?.node&&"select"in a.node&&typeof a.node.select=="function"&&a.node.select()})},1),setTimeout(()=>{e.dispatchCommand(Ie,{node:a?.node})},2),m.stopPropagation(),m.preventDefault())},[e,s]);return Mo(ke(Ze.Fragment,{children:ke("button",{"aria-label":"Add block",className:"icon add-block-menu",onClick:m=>{d(m)},ref:l,type:"button",children:ke("div",{className:o?"icon":""})})}),t)}function et(e){let{anchorElem:t}=e,o=t===void 0?document.body:t,[r]=Ro();return Oo(r,o,r._editable)}import{jsx as be,jsxs as Fo}from"react/jsx-runtime";import{useLexicalComposerContext as $o}from"@lexical/react/LexicalComposerContext.js";import{eventFiles as rt}from"@lexical/rich-text";import{$getNearestNodeFromDOMNode as nt,$getNodeByKey as Ko,isHTMLElement as ve}from"lexical";import*as ct from"react";import{useEffect as _e,useRef as ne,useState as it}from"react";import{createPortal as jo}from"react-dom";var tt=0,Io=-24;var W=0;function ot(e,t,o,r,n,c,l,s,u,d=!1){let{height:m,top:a}=r.getBoundingClientRect(),{top:i,width:x}=l.getBoundingClientRect(),{marginBottom:y,marginTop:p}=he(r),g=a,f=c>=a+m/2+window.scrollY,C=!1;if(n?.elem)if(r!==n?.elem)(f&&n?.elem&&n?.elem===r.nextElementSibling||!f&&n?.elem&&n?.elem===r.previousElementSibling)&&(W++,W<200&&(C=!0));else{W++;let w=n?.boundingBox?.y,k=r.getBoundingClientRect().y;(f===n?.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=-tt:h=tt);let b=g-i+h,v=Io-t;return o.style.width=`calc(${x}px - ${e} - var(--spacer-5))`,o.style.opacity=".8",o.style.transform=`translate(${v}px, calc(${b}px - 2px))`,n?.elem&&(n.elem.style.opacity="",n?.elem===r?f?n.elem.style.marginTop="":n.elem.style.marginBottom="":(n.elem.style.marginBottom="",n.elem.style.marginTop="")),W=0,{isBelow:f,willStayInSamePosition:C}}var zo="draggable-block-menu",st="application/x-lexical-drag-block",ie=1/0;function lt(e){return e===0?1/0:ie>=0&&ie<e?ie:Math.floor(e/2)}function Ho(e,t){let{transform:o}=t.style;e.setDragImage(t,0,0),setTimeout(()=>{t.style.transform=o})}function at(e,t){e&&(e.style.opacity="0"),t&&(t.style.opacity="",t.style.marginBottom="",t.style.marginTop="")}function Vo(e,t,o){let r=t.parentElement,n=ne(null),c=ne(null),l=ne(null),s=ne(!1),u=ne([]),[d,m]=it(null),[a,i]=it(null),{editorConfig:x}=P(),y=x?.admin?.hideGutter?-44:-8;_e(()=>{function f(C){let h=C.target;if(!ve(h))return;let b=G(r,C.pageX,C.pageY,h);if(b===-1){m(null);return}if(xe(h,zo))return;let v=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:lt(v.length),useEdgeAsDefault:!1,verbose:!1});ie=k,!(!w&&!L)&&d!==w&&m(w)}return document?.addEventListener("mousemove",f),()=>{document?.removeEventListener("mousemove",f)}},[r,t,e,d]),_e(()=>{n.current&&Ce(d,n.current,t,y)},[t,d,y]),_e(()=>{function f(h){if(!s.current)return!1;let[b]=rt(h);if(b)return!1;let{pageY:v,target:w}=h;if(!ve(w))return!1;let k=G(r,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:lt(L.length),useEdgeAsDefault:!0,verbose:!0});ie=I;let F=c.current;if(S===null||F===null)return!1;if(h.preventDefault(),h.dataTransfer.dropEffect="move",d!==S){let{isBelow:_,willStayInSamePosition:M}=ot(x?.admin?.hideGutter?"0px":"var(--spacer-5)",y+(x?.admin?.hideGutter?n?.current?.getBoundingClientRect()?.width??0:-(n?.current?.getBoundingClientRect()?.width??0)),F,S,a,v,t,h,l,R);M||i({boundingBox:S.getBoundingClientRect(),elem:S,isBelow:_})}else a?.elem&&(at(F,a.elem),i({boundingBox:S.getBoundingClientRect(),elem:S,isBelow:!1}));return!0}function C(h){if(!s.current)return!1;let[b]=rt(h);if(b)return!1;let{dataTransfer:v,pageY:w,target:k}=h,L=v?.getData(st)||"";return e.update(()=>{let S=Ko(L);if(!S||!ve(k))return!1;let I=G(r,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 _=nt(R);if(!_)return!1;if(_===S)return!0;let{height:M,top:ae}=U(R),Ne=w>=ae+M/2+window.scrollY;F?(_.insertBefore(S),_.remove()):Ne?_.insertAfter(S):_.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=[]}},[r,y,t,e,a,d,x?.admin?.hideGutter]);function p(f){let C=f.dataTransfer;if(!C||!d)return;Ho(C,d),C.effectAllowed="move";let h="";e.update(()=>{let b=nt(d);b&&(h=b.getKey())}),s.current=!0,C.setData(st,h)}function g(){s.current=!1,a?.elem&&at(c.current,a?.elem)}return jo(Fo(ct.Fragment,{children:[be("button",{"aria-label":"Drag to move",className:"icon draggable-block-menu",draggable:!0,onDragEnd:g,onDragStart:p,ref:n,type:"button",children:be("div",{className:o?"icon":""})}),be("div",{className:"draggable-block-target-line",ref:c}),be("div",{className:"debug-highlight",ref:l})]}),t)}function ut(e){let{anchorElem:t}=e,o=t===void 0?document.body:t,[r]=$o();return Vo(r,o,r._editable)}import{c as Wo}from"react/compiler-runtime";import{jsx as De}from"react/jsx-runtime";import{useLexicalComposerContext as Yo}from"@lexical/react/LexicalComposerContext";import{$createParagraphNode as Go,$getRoot as Uo}from"lexical";import"react";var dt="insert-paragraph-at-end",ft=()=>{let e=Wo(2),[t]=Yo(),{editorConfig:o}=P();if(o?.admin?.hideInsertParagraphAtEnd)return null;let r;return e[0]!==t?(r=De("div",{"aria-label":"Insert Paragraph",className:dt,onClick:()=>{t.update(Jo)},role:"button",tabIndex:0,children:De("div",{className:`${dt}-inside`,children:De("span",{children:"+"})})}),e[0]=t,e[1]=r):r=e[1],r};function Jo(){let e=Go();Uo().append(e),e.select()}import{c as qo}from"react/compiler-runtime";import{registerMarkdownShortcuts as Qo}from"@lexical/markdown";import{useLexicalComposerContext as Xo}from"@lexical/react/LexicalComposerContext";import*as mt from"react";var pt=()=>{let e=qo(4),{editorConfig:t}=P(),[o]=Xo(),r,n;return e[0]!==o||e[1]!==t.features.markdownTransformers?(r=()=>Qo(o,t.features.markdownTransformers??[]),n=[o,t.features.markdownTransformers],e[0]=o,e[1]=t.features.markdownTransformers,e[2]=r,e[3]=n):(r=e[2],n=e[3]),mt.useEffect(r,n),null};import{c as Zo}from"react/compiler-runtime";import{useLexicalComposerContext as er}from"@lexical/react/LexicalComposerContext.js";import{$getRoot as tr}from"lexical";import{useEffect as or}from"react";function rr(e){e.update(()=>{let t=o=>{let r=o.getType();if((r==="block"||r==="inlineBlock")&&o.markDirty(),"getChildren"in o&&typeof o.getChildren=="function")for(let n of o.getChildren())t(n)};t(tr())})}function gt(){let e=Zo(5),[t]=er(),{currentView:o,views:r}=$(),n,c;return e[0]!==o||e[1]!==t||e[2]!==r?(n=()=>{r&&(o==="default"?r.default?Se(t,r.default?.nodes):Pe(t):r[o]&&(Pe(t),Se(t,r[o]?.nodes)),rr(t))},c=[t,r,o],e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=c):(n=e[3],c=e[4]),or(n,c),null}import{useLexicalComposerContext as nr}from"@lexical/react/LexicalComposerContext";import{$getSelection as ir,$isRangeSelection as sr,RootNode as lr}from"lexical";import{useEffect as ar}from"react";function ht(){let[e]=nr();return ar(()=>e.registerNodeTransform(lr,t=>{let o=ir();if(sr(o)){let r=o.anchor.getNode(),n=o.focus.getNode();(!r.isAttached()||!n.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 cr}from"@lexical/react/LexicalComposerContext";import{$getSelection as ur,COMMAND_PRIORITY_LOW as dr,SELECT_ALL_COMMAND as fr}from"lexical";import{useEffect as mr}from"react";function yt(){let[e]=cr();return mr(()=>e.registerCommand(fr,()=>{if(ur())return!1;let o=document.activeElement;return o instanceof HTMLInputElement&&o.select(),!0},dr),[e]),null}import{jsx as q,jsxs as Ct}from"react/jsx-runtime";import{useLexicalComposerContext as gr}from"@lexical/react/LexicalComposerContext.js";import{useTranslation as Et}from"@payloadcms/ui";import{useCallback as hr,useMemo as yr,useState as xr}from"react";import"react";import*as bt from"react-dom";import{c as pr}from"react/compiler-runtime";import"react";function xt(e,t){let o=pr(4),{maxLength:r,minLength:n}=t,c=r===void 0?75:r,l=n===void 0?1:n,s;return o[0]!==c||o[1]!==l||o[2]!==e?(s=u=>{let{query:d}=u,m="[^"+e+Oe+"\\s]",i=new RegExp("(^|\\s|\\()(["+e+"]((?:"+m+"){0,"+c+"}))$").exec(d);if(i!==null){let x=i[1],y=i[3];if(y.length>=l)return{leadOffset:i.index+x.length,matchingString:y,replaceableString:i[2]}}return null},o[0]=c,o[1]=l,o[2]=e,o[3]=s):s=o[3],s}var O="slash-menu-popup";function Cr({isSelected:e,item:t,onClick:o,onMouseEnter:r,ref:n}){let{fieldProps:{featureClientSchemaMap:c,schemaPath:l}}=P(),{i18n:s}=Et(),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:c,i18n:s,schemaPath:l}):t.label),d.length>25&&(d=d.substring(0,25)+"..."),Ct("button",{"aria-selected":e,className:u,id:O+"__item-"+t.key,onClick:o,onMouseEnter:r,ref:n,role:"option",tabIndex:-1,type:"button",children:[t?.Icon&&q(t.Icon,{}),q("span",{className:`${O}__item-text`,children:d})]},t.key)}function Nt({anchorElem:e=document.body}){let[t]=gr(),[o,r]=xr(null),{editorConfig:n}=P(),{i18n:c}=Et(),{fieldProps:{featureClientSchemaMap:l,schemaPath:s}}=P(),u=xt("/",{minLength:0}),d=hr(()=>{let a=[];for(let i of n.features.slashMenu.dynamicGroups)if(o){let x=i({editor:t,queryString:o});a=a.concat(x)}return a},[t,o,n?.features]),m=yr(()=>{let a=[];for(let i of n?.features.slashMenu.groups??[])a.push(i);if(o){let i=o.toLowerCase().replace(/[\s\-_]/g,"");a=a.map(y=>{let p=y.items.filter(g=>{let f=g.key;return g.label&&(f=typeof g.label=="function"?g.label({featureClientSchemaMap:l,i18n:c,schemaPath:s}):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}),a=a.filter(y=>y!=null);let x=d();for(let y of x){let p=a.find(g=>g.key===y.key);p?a=a.filter(g=>g.key!==y.key):p={...y,items:[]},p?.items?.length&&(p.items=p.items.concat(p.items)),a.push(p)}}return a},[o,n?.features.slashMenu.groups,d,l,c,s]);return q(Fe,{anchorElem:e,groups:m,menuRenderFn:(a,{selectedItemKey:i,selectItemAndCleanUp:x,setSelectedItemKey:y})=>a.current&&m.length?bt.createPortal(q("div",{className:O,"data-theme":"dark",children:m.map(p=>{let g=p.key;return p.label&&l&&(g=typeof p.label=="function"?p.label({featureClientSchemaMap:l,i18n:c,schemaPath:s}):p.label),Ct("div",{className:`${O}__group ${O}__group-${p.key}`,children:[q("div",{className:`${O}__group-title`,children:g}),p.items.map((f,C)=>q(Cr,{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)})}),a.current):null,onQueryChange:r,triggerFn:u})}import{c as Er}from"react/compiler-runtime";import{useLexicalComposerContext as br}from"@lexical/react/LexicalComposerContext";import{TEXT_TYPE_TO_FORMAT as Nr,TextNode as wr}from"lexical";import{useEffect as Sr}from"react";function wt(e){let t=Er(6),{features:o}=e,[r]=br(),n;t[0]!==r||t[1]!==o.enabledFormats?(n=()=>{let l=Pr(o.enabledFormats);if(l.length!==0)return r.registerNodeTransform(wr,s=>{l.forEach(u=>{s.hasFormat(u)&&s.toggleFormat(u)})})},t[0]=r,t[1]=o.enabledFormats,t[2]=n):n=t[2];let c;return t[3]!==r||t[4]!==o?(c=[r,o],t[3]=r,t[4]=o,t[5]=c):c=t[5],Sr(n,c),null}function Pr(e){let t=Object.keys(Nr),o=new Set(e);return t.filter(r=>!o.has(r))}import{c as Tr}from"react/compiler-runtime";import{jsx as St}from"react/jsx-runtime";import{useLexicalComposerContext as Rr}from"@lexical/react/LexicalComposerContext";import{ContentEditable as kr}from"@lexical/react/LexicalContentEditable.js";import{useTranslation as vr}from"@payloadcms/ui";import"react";function Pt(e){let t=Tr(5),{className:o,editorConfig:r}=e,{t:n}=vr(),[,c]=Rr(),{getTheme:l}=c,s;if(t[0]!==o||t[1]!==r?.admin?.placeholder||t[2]!==l||t[3]!==n){let u=l();s=St(kr,{"aria-placeholder":n("lexical:general:placeholder"),className:o??"ContentEditable__root",placeholder:St("p",{className:u?.placeholder,children:r?.admin?.placeholder??n("lexical:general:placeholder")})}),t[0]=o,t[1]=r?.admin?.placeholder,t[2]=l,t[3]=n,t[4]=s}else s=t[4];return s}var Rt=e=>{let t=_r(13),{editorConfig:o,editorContainerRef:r,isSmallWidthViewport:n,onChange:c,rtl:l}=e,s=P(),[u]=Dr(),d=Or(),[m,a]=Kr(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=f=>{f!==null&&a(f)},t[0]=i):i=t[0];let x=i,y,p;t[1]!==u||t[2]!==s?(y=()=>{if(!s?.uuid){console.error("Lexical Editor must be used within an EditorConfigProvider");return}s?.parentEditor?.uuid&&s.parentEditor?.registerChild(s.uuid,s);let f=()=>{s.focusEditor(s)},C=()=>{s.blurEditor(s)},h=u.registerCommand(Fr,()=>(f(),!0),Tt),b=u.registerCommand(Ir,()=>(C(),!0),Tt);return()=>{h(),b(),s.parentEditor?.unregisterChild?.(s.uuid)}},p=[u,s],t[1]=u,t[2]=s,t[3]=y,t[4]=p):(y=t[3],p=t[4]),$r(y,p);let g;return t[5]!==o||t[6]!==r||t[7]!==m||t[8]!==d||t[9]!==n||t[10]!==c||t[11]!==l?(g=se(Q.Fragment,{children:[o.features.plugins?.map(jr),se("div",{className:"editor-container",dir:l?"rtl":void 0,ref:r,children:[o.features.plugins?.map(zr),E(Br,{contentEditable:E("div",{className:"editor-scroller",children:E("div",{className:"editor",ref:x,children:E(Pt,{editorConfig:o})})}),ErrorBoundary:Lr}),E(ht,{}),d&&E(ft,{}),E(Ge,{}),E(Ve,{}),E(wt,{features:o.features}),E(yt,{}),E(gt,{}),d&&E(Ar,{ignoreSelectionChange:!0,onChange:(f,C,h)=>{(!h.has("focus")||h.size>1)&&c?.(f,C,h)}}),m&&se(Q.Fragment,{children:[!n&&d&&se(Q.Fragment,{children:[o.admin?.hideDraggableBlockElement?null:E(ut,{anchorElem:m}),o.admin?.hideAddBlockButton?null:E(et,{anchorElem:m})]}),o.features.plugins?.map(f=>{if(f.position==="floatingAnchorElem"&&!(f.desktopOnly===!0&&n))return E(z,{anchorElem:m,clientProps:f.clientProps,plugin:f},f.key)}),d&&E(Q.Fragment,{children:E(Nt,{anchorElem:m})})]}),d&&se(Q.Fragment,{children:[E(Mr,{}),o?.features?.markdownTransformers?.length>0&&E(pt,{})]}),o.features.plugins?.map(Hr),o.features.plugins?.map(Vr)]}),o.features.plugins?.map(Wr)]}),t[5]=o,t[6]=r,t[7]=m,t[8]=d,t[9]=n,t[10]=c,t[11]=l,t[12]=g):g=t[12],g};function jr(e){if(e.position==="aboveContainer")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}function zr(e){if(e.position==="top")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}function Hr(e){if(e.position==="normal")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}function Vr(e){if(e.position==="bottom")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}function Wr(e){if(e.position==="belowContainer")return E(z,{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?j(o,{children:j(vt,{providers:t.slice(1),children:e})}):j(o,{children:e})},_t=e=>{let{composerKey:t,editorConfig:o,fieldProps:r,isSmallWidthViewport:n,onChange:c,readOnly:l,rtl:s,value:u}=e,{currentView:d,views:m}=$(),a=P(),i=Gr(),x=kt.useRef(null),y=Ur(()=>{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:l!==!0,editorState:u!=null?JSON.stringify(u):void 0,namespace:o.lexical.namespace,nodes:Ke({editorConfig:o,nodeViews:p}),onError:g=>{throw g},theme:o.lexical.theme}},[o,m,d]);return y?j(Yr,{initialConfig:y,children:j(Ae,{editorConfig:o,editorContainerRef:x,fieldProps:r,parentContext:a?.editDepth===i?a:void 0,children:j(vt,{providers:o.features.providers,children:j(Rt,{editorConfig:o,editorContainerRef:x,isSmallWidthViewport:n,onChange:c,rtl:s})})})},t+y.editable+d):j("p",{children:"Loading..."})};import{c as Jr}from"react/compiler-runtime";import{jsx as X,jsxs as qr}from"react/jsx-runtime";import{ChevronIcon as Qr,Popup as Xr,PopupList as Dt}from"@payloadcms/ui";import"react";function Lt(){let e=Jr(5),{currentView:t,setCurrentView:o,views:r}=$();if(!r||Object.keys(r).length===0)return null;let n,c;if(e[0]!==t||e[1]!==o||e[2]!==r){c=Symbol.for("react.early_return_sentinel");e:{let l=Object.keys(r);if(!l.some(en)){c=null;break e}let u=["default",...l.filter(Zr)],d=t.charAt(0).toUpperCase()+t.slice(1);n=X("div",{className:"lexical-view-selector",children:X(Xr,{button:qr("button",{className:"lexical-view-selector__button",type:"button",children:[X("span",{className:"lexical-view-selector__label",children:d}),X(Qr,{className:"lexical-view-selector__icon"})]}),buttonType:"custom",horizontalAlign:"left",render:m=>{let{close:a}=m;return X(Dt.ButtonGroup,{children:u.map(i=>{let x=i.charAt(0).toUpperCase()+i.slice(1);return X(Dt.Button,{active:i===t,disabled:i===t,onClick:()=>{o?.(i),a()},children:x},i)})})},size:"large"})})}e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=c}else n=e[3],c=e[4];return c!==Symbol.for("react.early_return_sentinel")?c:n}function Zr(e){return e!=="default"}function en(e){return e!=="default"}var Z="rich-text-lexical",hn=e=>{let{editorConfig:t,field:o,field:{admin:{className:r,description:n,readOnly:c}={},label:l,localized:s,required:u},path:d,readOnly:m,schemaPath:a,validate:i}=e,x=m||c,y=dn(),{config:{localization:p}}=ln(),g=sn({fieldLocalized:s,locale:y,localizationConfig:p||void 0}),f=an(),{isControlledByParent:C}=$(),h=Bt((A,te)=>typeof i=="function"?i(A,{...te,required:u}):!0,[i,u]),{customComponents:{AfterInput:b,BeforeInput:v,Description:w,Error:k,Label:L}={},disabled:S,initialValue:I,path:R,setValue:F,showError:_,value:M}=un({potentiallyStalePath:d,validate:h}),ae=x||S,[ee,Ne]=It(!1),[Le,we]=It(),ce=At.useRef(I),T=At.useRef(M);Ot(()=>{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,r,_&&"error",ae&&`${Z}--read-only`,t?.admin?.hideGutter!==!0&&!ee?`${Z}--show-gutter`:null].filter(Boolean).join(" "),ue=`${R}.${f}`,de=Be(),Ft=Bt(A=>{de(()=>{let Me=A.toJSON();T.current=Me,F(Me)})},[F,de]),$t=pn(()=>fn(o),[o]),Kt=cn(A=>{T.current!==M&&!mn(T.current!=null?JSON.parse(JSON.stringify(T.current)):T.current,M)&&(ce.current=A,T.current=M,we(new Date))});return Ot(()=>{Object.is(I,ce.current)||Kt(I)},[I]),le("div",{className:N,"data-field-path":R,"data-field-schemapath":a,"data-lexical-view":t?.view,style:$t,children:[le("div",{className:`${Z}__label-row`,children:[L||D(nn,{label:l,localized:s,path:R,required:u}),!C&&D(Lt,{})]}),le("div",{className:`${Z}__wrap`,children:[D(Mt,{CustomComponent:k,Fallback:D(rn,{path:R,showError:_})}),le(gn,{fallbackRender:yn,onReset:()=>{},children:[v,D("div",{className:`${Z}__editor-content`,children:D(tn,{modalSlugPrefix:`lexical-${R}`,children:D(_t,{composerKey:ue,editorConfig:t,fieldProps:e,isSmallWidthViewport:ee,onChange:Ft,readOnly:ae,rtl:g,value:M},JSON.stringify({path:R,rerenderProviderKey:Le}))})}),b]}),D(Mt,{CustomComponent:w,Fallback:D(on,{description:n,path:R})})]})]},ue)};function yn({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 kl=hn;export{kl as RichText};
2
- //# sourceMappingURL=Field-QGSHF22S.js.map
@@ -1,2 +0,0 @@
1
- import{a as O,b as y}from"./chunk-5VIL27GI.js";import{b as F}from"./chunk-RJ5MAOKZ.js";import{c as q}from"react/compiler-runtime";import{jsx as _}from"react/jsx-runtime";import{Drawer as z,EditDepthProvider as G,useModal as J}from"@payloadcms/ui";import"react";import{jsx as I,jsxs as N}from"react/jsx-runtime";import{useLexicalEditable as T}from"@lexical/react/useLexicalEditable";import{Form as W,RenderFields as $,useDocumentForm as v,useDocumentInfo as k,useServerFunctions as L}from"@payloadcms/ui";import{abortAndIgnore as R}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as E}from"payload/shared";import{useCallback as B,useEffect as M,useRef as H,useState as U}from"react";import{v4 as V}from"uuid";var j=({data:S,featureKey:e,fieldMapOverride:b,handleDrawerSubmit:w,schemaFieldsPathOverride:r,schemaPath:A,schemaPathSuffix:u,submitRef:D})=>{let{id:o,collectionSlug:a,getDocPreferences:i,globalSlug:n}=k(),{fields:s}=v(),t=T(),m=H(new AbortController),[d,l]=U(!1),{fieldProps:{featureClientSchemaMap:f}}=F(),{getFormState:p}=L(),c=r??`${A}.lexical_internal_feature.${e}${u?`.${u}`:""}`,C=b??f[e]?.[c];M(()=>{let h=new AbortController;return(async()=>{let{state:g}=await p({id:o,collectionSlug:a,data:S??{},docPermissions:{fields:!0},docPreferences:await i(),documentFormState:E(s,{excludeFiles:!0}),globalSlug:n,initialBlockData:S,operation:"update",readOnly:!t,renderAllFields:!0,schemaPath:c,signal:h.signal});l(g)})(),()=>{R(h)}},[c,o,S,p,a,t,n,i,s]);let x=B(async({formState:h})=>{R(m.current);let P=new AbortController;m.current=P;let{state:g}=await p({id:o,collectionSlug:a,docPermissions:{fields:!0},docPreferences:await i(),documentFormState:E(s,{excludeFiles:!0}),formState:h,globalSlug:n,initialBlockFormState:h,operation:"update",readOnly:!t,schemaPath:c,signal:P.signal});return g||h},[p,o,t,a,i,s,n,c]);return M(()=>()=>{R(m.current)},[]),d===!1?null:N(W,{beforeSubmit:[x],className:"fields-drawer",disableValidationOnSubmit:!0,fields:Array.isArray(C)?C:[],initialState:d,onChange:[x],onSubmit:w,uuid:V(),children:[I($,{fields:Array.isArray(C)?C:[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:c,permissions:!0,readOnly:!t}),I(y,{submitRef:D})]})};var pe=S=>{let e=q(17),{className:b,data:w,drawerSlug:r,drawerTitle:A,featureKey:u,fieldMapOverride:D,handleDrawerSubmit:o,schemaFieldsPathOverride:a,schemaPath:i,schemaPathSuffix:n}=S,{closeModal:s}=J(),{headerActions:t,submitRef:m}=O(),d=A??"",l;e[0]!==s||e[1]!==r||e[2]!==o?(l=(p,c)=>{s(r),setTimeout(()=>{o(p,c)},1)},e[0]=s,e[1]=r,e[2]=o,e[3]=l):l=e[3];let f;return e[4]!==b||e[5]!==w||e[6]!==r||e[7]!==u||e[8]!==D||e[9]!==t||e[10]!==a||e[11]!==i||e[12]!==n||e[13]!==m||e[14]!==d||e[15]!==l?(f=_(G,{children:_(z,{className:b,headerActions:t,slug:r,title:d,children:_(j,{data:w,featureKey:u,fieldMapOverride:D,handleDrawerSubmit:l,schemaFieldsPathOverride:a,schemaPath:i,schemaPathSuffix:n,submitRef:m})})}),e[4]=b,e[5]=w,e[6]=r,e[7]=u,e[8]=D,e[9]=t,e[10]=a,e[11]=i,e[12]=n,e[13]=m,e[14]=d,e[15]=l,e[16]=f):f=e[16],f};import{createCommand as K}from"lexical";var be=K("INSERT_UPLOAD_WITH_DRAWER_COMMAND");export{pe as a,be as b};
2
- //# sourceMappingURL=chunk-UD4DQ4AK.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/utilities/fieldsDrawer/Drawer.tsx", "../../../src/utilities/fieldsDrawer/DrawerContent.tsx", "../../../src/features/upload/client/drawer/commands.ts"],
4
- "sourcesContent": ["'use client'\nimport type { ClientField, Data, FormState, JsonObject } from 'payload'\n\nimport { Drawer, EditDepthProvider, useModal } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\nimport { useDrawerSubmit } from './useDrawerSubmit.js'\n\nexport type FieldsDrawerProps = {\n readonly className?: string\n readonly data?: Data\n readonly drawerSlug: string\n readonly drawerTitle?: string\n readonly featureKey: string\n readonly fieldMapOverride?: ClientField[]\n readonly handleDrawerSubmit: (fields: FormState, data: JsonObject) => void\n readonly schemaFieldsPathOverride?: string\n readonly schemaPath: string\n readonly schemaPathSuffix?: string\n}\n\n/**\n * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature.\n * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only\n * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts.\n */\nexport const FieldsDrawer: React.FC<FieldsDrawerProps> = ({\n className,\n data,\n drawerSlug,\n drawerTitle,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPath,\n schemaPathSuffix,\n}) => {\n const { closeModal } = useModal()\n const { headerActions, submitRef } = useDrawerSubmit()\n\n // The Drawer only renders its children (and itself) if it's open. Thus, by extracting the main content\n // to DrawerContent, this should be faster\n return (\n <EditDepthProvider>\n <Drawer\n className={className}\n headerActions={headerActions}\n slug={drawerSlug}\n title={drawerTitle ?? ''}\n >\n <DrawerContent\n data={data}\n featureKey={featureKey}\n fieldMapOverride={fieldMapOverride}\n handleDrawerSubmit={(args, args2) => {\n // Simply close drawer - no need for useLexicalDrawer here as at this point,\n // we don't need to restore the cursor position. This is handled by the useEffect in useLexicalDrawer.\n closeModal(drawerSlug)\n\n // Actual drawer submit logic needs to be triggered after the drawer is closed.\n // That's because the lexical selection / cursor restore logic that is striggerer by\n // `useLexicalDrawer` neeeds to be triggered before any editor.update calls that may happen\n // in the `handleDrawerSubmit` function.\n setTimeout(() => {\n handleDrawerSubmit(args, args2)\n }, 1)\n }}\n schemaFieldsPathOverride={schemaFieldsPathOverride}\n schemaPath={schemaPath}\n schemaPathSuffix={schemaPathSuffix}\n submitRef={submitRef}\n />\n </Drawer>\n </EditDepthProvider>\n )\n}\n", "'use client'\nimport type { FormState } from 'payload'\n\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport {\n Form,\n RenderFields,\n useDocumentForm,\n useDocumentInfo,\n useServerFunctions,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { deepCopyObjectSimpleWithoutReactComponents } from 'payload/shared'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { FieldsDrawerProps } from './Drawer.js'\n\nimport { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js'\nimport { RegisterFormSubmit } from './useDrawerSubmit.js'\nimport './index.css'\n\nexport const DrawerContent: React.FC<\n {\n submitRef: React.RefObject<(() => void) | null>\n } & Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>\n> = ({\n data,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPath,\n schemaPathSuffix,\n submitRef,\n}) => {\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { fields: parentDocumentFields } = useDocumentForm()\n const isEditable = useLexicalEditable()\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n\n const [initialState, setInitialState] = useState<false | FormState | undefined>(false)\n\n const {\n fieldProps: { featureClientSchemaMap },\n } = useEditorConfigContext()\n\n const { getFormState } = useServerFunctions()\n\n const schemaFieldsPath =\n schemaFieldsPathOverride ??\n `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fields: any = fieldMapOverride ?? featureClientSchemaMap[featureKey]?.[schemaFieldsPath] // Field Schema\n\n useEffect(() => {\n const controller = new AbortController()\n\n const awaitInitialState = async () => {\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: data ?? {},\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: data,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n\n return () => {\n abortAndIgnore(controller)\n }\n }, [\n schemaFieldsPath,\n id,\n data,\n getFormState,\n collectionSlug,\n isEditable,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n const onChange = useCallback(\n async ({ formState: prevFormState }: { formState: FormState }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n return state\n },\n [\n getFormState,\n id,\n isEditable,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n schemaFieldsPath,\n ],\n )\n\n // cleanup effect\n useEffect(() => {\n return () => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [])\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n className=\"fields-drawer\"\n disableValidationOnSubmit\n fields={Array.isArray(fields) ? fields : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fields={Array.isArray(fields) ? fields : []}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <RegisterFormSubmit submitRef={submitRef} />\n </Form>\n )\n}\n", "'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nexport const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND')\n"],
5
- "mappings": "uFAAA,OAAAA,KAAAC,MAAA,iEAGA,OAASC,UAAAA,EAAQC,qBAAAA,EAAmBC,YAAAA,MAAgB,iBACpD,MAAkB,0DCDlB,OAASC,sBAAAA,MAA0B,oCACnC,OACEC,QAAAA,EACAC,gBAAAA,EACAC,mBAAAA,EACAC,mBAAAA,EACAC,sBAAAA,MACK,iBACP,OAASC,kBAAAA,MAAsB,wBAC/B,OAASC,8CAAAA,MAAkD,iBAC3D,OAAgBC,eAAAA,EAAaC,aAAAA,EAAWC,UAAAA,EAAQC,YAAAA,MAAgB,QAChE,OAASC,MAAMC,MAAY,OAMpB,IAAAC,EAAA,CAAA,CAEP,KAAAC,EAKEA,WAAAA,EACAC,iBAAAA,EACAC,mBAAAA,EACAC,yBAAAA,EACAC,WAAAA,EACAC,iBAAAA,EACAC,UAAAA,KACAC,CACD,GAAA,CACC,GAAAC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lBR,EAAWR,CAAA,EAMXiB,WAAA,IAAA,CACEb,EAAmBW,EAAMC,CAAA,CAAA,EAAA,CACxB,CAAA,EACLpB,EAAA,CAAA,EAAAY,EAAAZ,EAAA,CAAA,EAAAI,EAAAJ,EAAA,CAAA,EAAAQ,EAAAR,EAAA,CAAA,EAAAkB,GAAAA,EAAAlB,EAAA,CAAA,EAAA,IAAAsB,EAAA,OAAAtB,EAAA,CAAA,IAAAE,GAAAF,EAAA,CAAA,IAAAG,GAAAH,EAAA,CAAA,IAAAI,GAAAJ,EAAA,CAAA,IAAAM,GAAAN,EAAA,CAAA,IAAAO,GAAAP,EAAA,CAAA,IAAAc,GAAAd,EAAA,EAAA,IAAAS,GAAAT,EAAA,EAAA,IAAAU,GAAAV,EAAA,EAAA,IAAAW,GAAAX,EAAA,EAAA,IAAAe,GAAAf,EAAA,EAAA,IAAAiB,GAAAjB,EAAA,EAAA,IAAAkB,GAvBNI,EAAAC,EAAAC,EAAA,CAAAC,SACEF,EAAAG,EAAA,CAAAxB,UAAAA,EAAAY,cAAAA,EAAAa,KAGQvB,EAAAwB,MACCX,EAAeQ,SAEtBF,EAAAM,EAAA,CAAA1B,KAAAA,EAAAG,WAAAA,EAAAC,iBAAAA,EAAAC,mBAIsBU,EAYpBT,yBAAAA,EAAAC,WAAAA,EAAAC,iBAAAA,EAAAI,UAAAA,CAAA,CAAA,iHAvBNO,GE1CJ,OAASQ,iBAAAA,MAAqB,UAEvB,IAAMC,GAERD,EAAc,mCAAA",
6
- "names": ["c", "_c", "Drawer", "EditDepthProvider", "useModal", "useLexicalEditable", "Form", "RenderFields", "useDocumentForm", "useDocumentInfo", "useServerFunctions", "abortAndIgnore", "deepCopyObjectSimpleWithoutReactComponents", "useCallback", "useEffect", "useRef", "useState", "v4", "uuid", "DrawerContent", "data", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPath", "schemaPathSuffix", "submitRef", "id", "collectionSlug", "getDocPreferences", "globalSlug", "useDocumentInfo", "parentDocumentFields", "fields", "useDocumentForm", "useLexicalEditable", "isEditable", "onChangeAbortControllerRef", "useRef", "AbortController", "fieldProps", "useEditorConfigContext", "getFormState", "useServerFunctions", "schemaFieldsPath", "useEffect", "awaitInitialState", "state", "docPermissions", "docPreferences", "deepCopyObjectSimpleWithoutReactComponents", "documentFormState", "initialBlockData", "operation", "readOnly", "renderAllFields", "setInitialState", "abortAndIgnore", "controller", "onChange", "formState", "state_0", "prevFormState", "initialBlockFormState", "initialState", "_jsxs", "Form", "beforeSubmit", "className", "disableValidationOnSubmit", "isArray", "onSubmit", "uuid", "_jsx", "RenderFields", "forceRender", "parentIndexPath", "parentPath", "parentSchemaPath", "permissions", "FieldsDrawer", "t0", "$", "_c", "className", "data", "drawerSlug", "drawerTitle", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPath", "schemaPathSuffix", "closeModal", "useModal", "headerActions", "submitRef", "useDrawerSubmit", "t1", "t2", "args", "args2", "setTimeout", "t3", "_jsx", "EditDepthProvider", "children", "Drawer", "slug", "title", "DrawerContent", "createCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND"]
7
- }
@@ -1,2 +0,0 @@
1
- var P=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";import{c as ct}from"react/compiler-runtime";import{useRef as lt}from"react";function Gt(i){let t=ct(2),e=i===void 0?500:i,o=lt(void 0),n;return t[0]!==e?(n=c=>new Promise(a=>{let s=()=>{c(),a()};"requestIdleCallback"in window?("cancelIdleCallback"in window&&o.current!==void 0&&cancelIdleCallback(o.current),o.current=requestIdleCallback(s,{timeout:e})):at().then(s)}),t[0]=e,t[1]=n):n=t[1],n}function at(){return new Promise(i=>{setTimeout(i,100),requestAnimationFrame(()=>{setTimeout(i,0)})})}import{jsx as ut}from"react/jsx-runtime";import{useControllableState as ft}from"@payloadcms/ui";import{createContext as dt,use as mt,useMemo as ht}from"react";var V=dt({currentView:"default",inheritable:!1,setCurrentView:()=>{}}),oe=i=>{let t=pt(),e=i.currentView!==void 0,o=t.inheritable&&(!!t.views||!!t.hasExplicitCurrentView),n=e||t.inheritable&&!!t.hasExplicitCurrentView,{children:r,currentView:c,inheritable:a,views:s}={children:i.children,currentView:o?t.currentView:i.currentView,inheritable:t.inheritable||i.inheritable,views:o&&t.views?t.views:i.views},[f,d]=ft(c,"default"),m=s&&f!=="default"&&!s[f]?"default":f,h=ht(()=>{let y=s?s[m]:void 0;return{currentView:m,currentViewMap:y,hasExplicitCurrentView:n,inheritable:a,isControlledByParent:o,setCurrentView:d,views:s}},[m,a,n,o,d,s]);return ut(V,{value:h,children:r})};function pt(){return mt(V)}var T=class{_x;_y;constructor(t,e){this._x=t,this._y=e}calcDeltaXTo({x:t}){return this.x-t}calcDeltaYTo({y:t}){return this.y-t}calcDistanceTo(t){return Math.sqrt(Math.pow(this.calcDeltaXTo(t),2)+Math.pow(this.calcDeltaYTo(t),2))}calcHorizontalDistanceTo(t){return Math.abs(this.calcDeltaXTo(t))}calcVerticalDistance(t){return Math.abs(this.calcDeltaYTo(t))}equals({x:t,y:e}){return this.x===t&&this.y===e}get x(){return this._x}get y(){return this._y}};function $(i){return i instanceof T}import{jsx as At}from"react/jsx-runtime";import{useLexicalComposerContext as Lt}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Bt}from"@lexical/utils";import{$getSelection as I,$isRangeSelection as N,$isTextNode as Pt,COMMAND_PRIORITY_LOW as Vt,createCommand as $t,getDOMSelection as Yt}from"lexical";import{useCallback as J,useEffect as G,useState as Wt}from"react";import*as v from"react";import{c as q}from"react/compiler-runtime";import{useLexicalComposerContext as U}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Y}from"@lexical/utils";import{$getSelection as F,$isRangeSelection as gt,$setSelection as _t,COMMAND_PRIORITY_LOW as W,COMMAND_PRIORITY_NORMAL as C,createCommand as wt,KEY_ARROW_DOWN_COMMAND as yt,KEY_ARROW_UP_COMMAND as Ot,KEY_ENTER_COMMAND as xt,KEY_ESCAPE_COMMAND as bt,KEY_TAB_COMMAND as Ct}from"lexical";import{useCallback as E,useEffect as x,useLayoutEffect as St,useMemo as Mt,useRef as Rt,useState as Dt}from"react";var Tt="slash-menu-popup",H=i=>{let t=document.getElementById("slash-menu");if(!t)return;let e=t.getBoundingClientRect();e.top+e.height>window.innerHeight&&t.scrollIntoView({block:"center"}),e.top<0&&t.scrollIntoView({block:"center"}),i.scrollIntoView({block:"nearest"})};function Et(i,t,e){let o=e;for(let n=o;n<=t.length;n++)i.substring(i.length-n)===t.substring(0,n)&&(o=n);return o}function vt(i){let t=F();if(!gt(t)||!t.isCollapsed())return;let e=t.anchor;if(e.type!=="text")return;let o=e.getNode();if(!o.isSimpleText())return;let n=e.offset,r=o.getTextContent().slice(0,n),c=i.replaceableString.length,a=Et(r,i.matchingString,c),s=n-a;if(s<0)return;let f;return s===0?[f]=o.splitText(n):[,f]=o.splitText(s,n),f}function It(i,t){let e=getComputedStyle(i),o=e.position==="absolute",n=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if(e.position==="fixed")return document.body;for(let r=i;r=r.parentElement;)if(e=getComputedStyle(r),!(o&&e.position==="static")&&n.test(e.overflow+e.overflowY+e.overflowX))return r;return document.body}function X(i,t){let e=i.getBoundingClientRect(),o=t.getBoundingClientRect();return e.top>o.top&&e.top<o.bottom}function Nt(i,t,e,o){let n=q(7),[r]=U(),c,a;n[0]!==r||n[1]!==e||n[2]!==o||n[3]!==i||n[4]!==t?(c=()=>{let s=t.current;if(s!=null&&i!=null){let f=r.getRootElement(),d=f!=null?It(f,!1):document.body,m=!1,h=X(s,d),y=function(){m||(window.requestAnimationFrame(function(){e(),m=!1}),m=!0);let l=X(s,d);l!==h&&(h=l,o?.(l))},u=new ResizeObserver(e);return window.addEventListener("resize",e),document.addEventListener("scroll",y,{capture:!0,passive:!0}),u.observe(s),()=>{u.disconnect(),window.removeEventListener("resize",e),document.removeEventListener("scroll",y,!0)}}},a=[r,o,e,i,t],n[0]=r,n[1]=e,n[2]=o,n[3]=i,n[4]=t,n[5]=c,n[6]=a):(c=n[5],a=n[6]),x(c,a)}var j=wt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function z({anchorElementRef:i,close:t,editor:e,groups:o,menuRenderFn:n,resolution:r,shouldSplitNodeWithQuery:c=!1}){let[a,s]=Dt(null),f=r.match&&r.match.matchingString||"",d=E(u=>{let l=e.getRootElement();l!==null&&(l.setAttribute("aria-activedescendant",`${Tt}__item-${u.key}`),s(u.key))},[e]),m=E(()=>{if(o!==null&&f!=null){let u=o.flatMap(l=>l.items);if(u.length){let l=u[0];d(l)}}},[o,d,f]);x(()=>{m()},[f,m]);let h=E(u=>{t(),e.update(()=>{let l=r.match!=null&&c?vt(r.match):null;l&&l.remove()}),setTimeout(()=>{let l;e.read(()=>{l=F()?.clone()}),e.update(()=>{l&&_t(l)}),u.onSelect({editor:e,queryString:r.match?r.match.matchingString:""})},0)},[e,c,r.match,t]);x(()=>()=>{let u=e.getRootElement();u!==null&&u.removeAttribute("aria-activedescendant")},[e]),St(()=>{o===null?s(null):a===null&&m()},[o,a,d,m]),x(()=>Y(e.registerCommand(j,({item:u})=>u.ref&&u.ref.current!=null?(H(u.ref.current),!0):!1,W)),[e,d]),x(()=>Y(e.registerCommand(yt,u=>{let l=u;if(o!==null&&o.length&&a!==null){let g=o.flatMap(_=>_.items),p=g.findIndex(_=>_.key===a),O=p!==g.length-1?p+1:0,w=g[O];if(!w)return!1;d(w),w.ref!=null&&w.ref.current&&e.dispatchCommand(j,{index:O,item:w}),l.preventDefault(),l.stopImmediatePropagation()}return!0},C),e.registerCommand(Ot,u=>{let l=u;if(o!==null&&o.length&&a!==null){let g=o.flatMap(_=>_.items),p=g.findIndex(_=>_.key===a),O=p!==0?p-1:g.length-1,w=g[O];if(!w)return!1;d(w),w.ref!=null&&w.ref.current&&H(w.ref.current),l.preventDefault(),l.stopImmediatePropagation()}return!0},C),e.registerCommand(bt,u=>{let l=u;return l.preventDefault(),l.stopImmediatePropagation(),t(),!0},W),e.registerCommand(Ct,u=>{let l=u;if(o===null||a===null)return!1;let p=o.flatMap(O=>O.items).find(O=>O.key===a);return p?(l.preventDefault(),l.stopImmediatePropagation(),h(p),!0):!1},C),e.registerCommand(xt,u=>{if(o===null||a===null)return!1;let g=o.flatMap(p=>p.items).find(p=>p.key===a);return g?(u!==null&&(u.preventDefault(),u.stopImmediatePropagation()),h(g),!0):!1},C)),[h,t,e,o,a,d]);let y=Mt(()=>({groups:o,selectedItemKey:a,selectItemAndCleanUp:h,setSelectedItemKey:s}),[h,a,o]);return n(i,y,r.match?r.match.matchingString:"")}function kt(i,t){t!=null&&(i.className=t),i.setAttribute("aria-label","Slash menu"),i.setAttribute("role","listbox"),i.style.display="block",i.style.position="absolute"}function K(i,t,e,o){let n=q(14),[r]=U(),c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c=P?document.createElement("div"):null,n[0]=c):c=n[0];let a=Rt(c),s;n[1]!==i||n[2]!==o||n[3]!==r||n[4]!==t?(s=()=>{if(a.current===null||parent===void 0)return;let u=r.getRootElement(),l=a.current,g=l.firstChild;if(u!==null&&t!==null){let{height:p,width:O}=t.getRect(),{left:w,top:_}=t.getRect(),S=_;if(_=_-(i.getBoundingClientRect().top+window.scrollY),w=w-(i.getBoundingClientRect().left+window.scrollX),l.style.left=`${w+window.scrollX}px`,l.style.height=`${p}px`,l.style.width=`${O}px`,g!==null){let M=g.getBoundingClientRect(),A=M.height,R=M.width,D=u.getBoundingClientRect(),L=document.dir==="rtl"||document.documentElement.dir==="rtl",ot=i.getBoundingClientRect(),B=Math.max(0,D.left);if(!L&&w+R>D.right)l.style.left=`${D.right-R+window.scrollX}px`;else if(L&&M.left<B){let st=B+R-ot.left;l.style.left=`${st+window.scrollX}px`}let it=S+A+32>window.innerHeight,rt=S<0;it&&!rt?l.style.top=`${_+32-A+window.scrollY-(p+24)}px`:l.style.top=`${_+window.scrollY+32}px`}l.isConnected||(kt(l,o),i.append(l)),l.setAttribute("id","slash-menu"),a.current=l,u.setAttribute("aria-controls","slash-menu")}},n[1]=i,n[2]=o,n[3]=r,n[4]=t,n[5]=s):s=n[5];let f=s,d,m;n[6]!==r||n[7]!==f||n[8]!==t?(d=()=>{let u=r.getRootElement();if(t!==null)return f(),()=>{u!==null&&u.removeAttribute("aria-controls");let l=a.current;l!==null&&l.isConnected&&(l.remove(),l.removeAttribute("id"))}},m=[r,f,t],n[6]=r,n[7]=f,n[8]=t,n[9]=d,n[10]=m):(d=n[9],m=n[10]),x(d,m);let h;return n[11]!==t||n[12]!==e?(h=u=>{t!==null&&(u||e(null))},n[11]=t,n[12]=e,n[13]=h):h=n[13],Nt(t,a,f,h),a}var ye=`\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'"~=<>_:;`;function Ht(i){let t=i.anchor;if(t.type!=="text")return null;let e=t.getNode();if(!e.isSimpleText())return null;let o=t.offset;return e.getTextContent().slice(0,o)}function Q(i,t,e){let o=Yt(e);if(o===null||!o.isCollapsed)return!1;let n=o.anchorNode,r=i,c=o.anchorOffset;if(n==null||c==null)return!1;try{t.setStart(n,r),t.setEnd(n,c>1?c:1)}catch{return!1}return!0}function Xt(i){let t;return i.getEditorState().read(()=>{let e=I();N(e)&&(t=Ht(e))}),t}function Z(i,t){return t!==0?!1:i.getEditorState().read(()=>{let e=I();if(N(e)){let r=e.anchor.getNode().getPreviousSibling();return Pt(r)&&r.isTextEntity()}return!1})}function tt(i){v.startTransition?v.startTransition(i):i()}var jt=$t("ENABLE_SLASH_MENU_COMMAND");function Oe({anchorClassName:i,anchorElem:t,groups:e,menuRenderFn:o,onClose:n,onOpen:r,onQueryChange:c,triggerFn:a}){let[s]=Lt(),[f,d]=Wt(null),m=K(t,f,d,i),h=J(()=>{d(null),n!=null&&f!==null&&n()},[n,f]),y=J(u=>{d(u),r!=null&&f===null&&r(u)},[r,f]);return G(()=>Bt(s.registerCommand(jt,({node:u})=>(s.getEditorState().read(()=>{let l={leadOffset:0,matchingString:"",replaceableString:""};if(!Z(s,l.leadOffset)&&u!==null){let g=s._window??window,p=g.document.createRange();Q(l.leadOffset,p,g)!==null&&tt(()=>y({getRect:()=>p.getBoundingClientRect(),match:l}));return}}),!0),Vt)),[s,y]),G(()=>{let u=()=>{s.getEditorState().read(()=>{let g=s._window??window,p=g.document.createRange(),O=I(),w=Xt(s);if(!N(O)||!O.isCollapsed()||w===void 0||p===null){h();return}let _=a({editor:s,query:w});if(c(_?_.matchingString:null),_!==null&&!Z(s,_.leadOffset)&&Q(_.leadOffset,p,g)!==null){tt(()=>y({getRect:()=>p.getBoundingClientRect(),match:_}));return}h()})},l=s.registerUpdateListener(u);return()=>{l()}},[s,a,c,f,h,y]),m.current===null||f===null||s===null?null:At(z,{anchorElementRef:m,close:h,editor:s,groups:e,menuRenderFn:o,resolution:f,shouldSplitNodeWithQuery:!0})}var et=class i{_bottom;_left;_right;_top;constructor(t,e,o,n){let[r,c]=e<=n?[e,n]:[n,e],[a,s]=t<=o?[t,o]:[o,t];this._top=r,this._right=s,this._left=a,this._bottom=c}static fromDOM(t){let{height:e,left:o,top:n,width:r}=t.getBoundingClientRect();return i.fromLWTH(o,r,n,e)}static fromDOMRect(t){let{height:e,left:o,top:n,width:r}=t;return i.fromLWTH(o,r,n,e)}static fromLTRB(t,e,o,n){return new i(t,e,o,n)}static fromLWTH(t,e,o,n){return new i(t,o,t+e,o+n)}static fromPoints(t,e){let{x:o,y:n}=t,{x:r,y:c}=e;return i.fromLTRB(o,n,r,c)}contains(t){if($(t)){let{x:c,y:a}=t,s=a<this._top,f=a>this._bottom,d=c<this._left,m=c>this._right;return{reason:{isOnBottomSide:f,isOnLeftSide:d,isOnRightSide:m,isOnTopSide:s},result:!s&&!f&&!d&&!m}}let{bottom:e,left:o,right:n,top:r}=t;return r>=this._top&&r<=this._bottom&&e>=this._top&&e<=this._bottom&&o>=this._left&&o<=this._right&&n>=this._left&&n<=this._right}distanceFromPoint(t){let e=this.contains(t);if(e.result)return{distance:0,isOnBottomSide:e.reason.isOnBottomSide,isOnLeftSide:e.reason.isOnLeftSide,isOnRightSide:e.reason.isOnRightSide,isOnTopSide:e.reason.isOnTopSide};let o=0,n=0;return t.x<this._left?o=this._left-t.x:t.x>this._right&&(o=t.x-this._right),t.y<this._top?n=this._top-t.y:t.y>this._bottom&&(n=t.y-this._bottom),{distance:Math.sqrt(o*o+n*n),isOnBottomSide:t.y>this._bottom,isOnLeftSide:t.x<this._left,isOnRightSide:t.x>this._right,isOnTopSide:t.y<this._top}}equals({bottom:t,left:e,right:o,top:n}){return n===this._top&&t===this._bottom&&e===this._left&&o===this._right}generateNewRect({bottom:t=this.bottom,left:e=this.left,right:o=this.right,top:n=this.top}){return new i(e,n,o,t)}intersectsWith(t){let{height:e,left:o,top:n,width:r}=t,{height:c,left:a,top:s,width:f}=this,d=o+r>=a+f?o+r:a+f,m=n+e>=s+c?n+e:s+c,h=o<=a?o:a,y=n<=s?n:s;return d-h<=r+f&&m-y<=e+c}get bottom(){return this._bottom}get height(){return Math.abs(this._bottom-this._top)}get left(){return this._left}get right(){return this._right}get top(){return this._top}get width(){return Math.abs(this._left-this._right)}};import k from"react";var b=new WeakMap;function Me(i,t){b.has(i)||b.set(i,new Map);let e=b.get(i);for(let[o,n]of Object.entries(t))if(!(!n||typeof n!="object")){if(o==="blocks"){for(let[r,c]of Object.entries(n))e.set(`block:${r}`,c);continue}if(o==="inlineBlocks"){for(let[r,c]of Object.entries(n))e.set(`inlineBlock:${r}`,c);continue}e.set(o,n)}}function Re(i){b.delete(i)}function nt(i,t,e){let o=b.get(i);if(t==="block"&&e?.__fields?.blockType){let n=e.__fields.blockType;return o?.get(`block:${n}`)}if(t==="inlineBlock"&&e?.__fields?.blockType){let n=e.__fields.blockType;return o?.get(`inlineBlock:${n}`)}return o?.get(t)}function qt({node:i,nodeType:t}){if(!("getType"in i)||i.getType()!==t)return;let e=i;if(e.prototype._originalDecorate||(e.prototype._originalDecorate=e.prototype.decorate),e.prototype._originalCreateDOM||(e.prototype._originalCreateDOM=e.prototype.createDOM),e.prototype.decorate&&!e.prototype._decorateOverridden){e.prototype._decorateOverridden=!0;let o=!!e.prototype.createDOM;e.prototype.decorate=function(n,r){let c=nt(n,t,this);if(c){if(c.Component)return c.Component({config:r,editor:n,isEditor:!0,isJSXConverter:!1,node:this});if(c.createDOM&&c.html){let s=typeof c.html=="function"?c.html({config:r,editor:n,isEditor:!0,isJSXConverter:!1,node:this}):c.html;return k.createElement("span",{dangerouslySetInnerHTML:{__html:s}})}if(c.html&&o&&!c.createDOM)return k.createElement(k.Fragment);if(t==="block"){let s=c;if(s.Block||s.Label)return e.prototype._originalDecorate.call(this,n,r,s.Block,s.Label)}else if(t==="inlineBlock"){let s=c;if(s.Block||s.Label)return e.prototype._originalDecorate.call(this,n,r,s.Block,s.Label)}}return e.prototype._originalDecorate.call(this,n,r)}}e.prototype.createDOM&&!e.prototype._createDOMOverridden&&(e.prototype._createDOMOverridden=!0,e.prototype.createDOM=function(o,n){let r=nt(n,t,this);if(r){if(r.createDOM)return r.createDOM({config:o,editor:n,node:this});if(r.html){let c=typeof r.html=="function"?r.html({config:o,editor:n,isEditor:!0,isJSXConverter:!1,node:this}):r.html,a=document.createElement("div");return a.innerHTML=c,a.firstElementChild||a}}return e.prototype._originalCreateDOM.call(this,o,n)})}function De({editorConfig:i,nodeViews:t}){let e=Ut({nodes:i.features.nodes});if(t){let o=new Set;for(let[n,r]of Object.entries(t))!r||typeof r!="object"||(n==="blocks"&&Object.keys(r).length>0?o.add("block"):n==="inlineBlocks"&&Object.keys(r).length>0?o.add("inlineBlock"):o.add(n));for(let n of e)if("getType"in n){let r=n.getType();o.has(r)&&qt({node:n,nodeType:r})}}return e}function Ut({nodes:i}){return i.map(t=>"node"in t?t.node:t)}export{P as a,Gt as b,oe as c,pt as d,T as e,$ as f,ye as g,jt as h,Oe as i,et as j,Me as k,Re as l,De as m};
2
- //# sourceMappingURL=chunk-X3D4LZS7.js.map