@infonomic/payload-alternative-lexical-editor 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (579) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapter.d.ts +11 -0
  3. package/dist/adapter.d.ts.map +1 -0
  4. package/dist/adapter.js +124 -0
  5. package/dist/adapter.js.map +1 -0
  6. package/dist/cell/rsc-entry.d.ts +20 -0
  7. package/dist/cell/rsc-entry.d.ts.map +1 -0
  8. package/dist/cell/rsc-entry.js +68 -0
  9. package/dist/cell/rsc-entry.js.map +1 -0
  10. package/dist/field/apply-value-plugin.d.ts +9 -0
  11. package/dist/field/apply-value-plugin.d.ts.map +1 -0
  12. package/dist/field/apply-value-plugin.js +66 -0
  13. package/dist/field/apply-value-plugin.js.map +1 -0
  14. package/dist/field/build-initial-state.d.ts +29 -0
  15. package/dist/field/build-initial-state.d.ts.map +1 -0
  16. package/dist/field/build-initial-state.js +14 -0
  17. package/dist/field/build-initial-state.js.map +1 -0
  18. package/dist/field/config/default.d.ts +6 -0
  19. package/dist/field/config/default.d.ts.map +1 -0
  20. package/dist/field/config/default.js +52 -0
  21. package/dist/field/config/default.js.map +1 -0
  22. package/dist/field/config/editor-config-context.d.ts +14 -0
  23. package/dist/field/config/editor-config-context.d.ts.map +1 -0
  24. package/dist/field/config/editor-config-context.js +38 -0
  25. package/dist/field/config/editor-config-context.js.map +1 -0
  26. package/dist/field/config/types.d.ts +22 -0
  27. package/dist/field/config/types.d.ts.map +1 -0
  28. package/dist/field/config/types.js +2 -0
  29. package/dist/field/config/types.js.map +1 -0
  30. package/dist/field/constants.d.ts +2 -0
  31. package/dist/field/constants.d.ts.map +1 -0
  32. package/dist/field/constants.js +2 -0
  33. package/dist/field/constants.js.map +1 -0
  34. package/dist/field/context/shared-autocomplete-context.d.ts +18 -0
  35. package/dist/field/context/shared-autocomplete-context.d.ts.map +1 -0
  36. package/dist/field/context/shared-autocomplete-context.js +40 -0
  37. package/dist/field/context/shared-autocomplete-context.js.map +1 -0
  38. package/dist/field/context/shared-history-context.d.ts +19 -0
  39. package/dist/field/context/shared-history-context.d.ts.map +1 -0
  40. package/dist/field/context/shared-history-context.js +13 -0
  41. package/dist/field/context/shared-history-context.js.map +1 -0
  42. package/dist/field/context/shared-on-change-context.d.ts +13 -0
  43. package/dist/field/context/shared-on-change-context.d.ts.map +1 -0
  44. package/dist/field/context/shared-on-change-context.js +18 -0
  45. package/dist/field/context/shared-on-change-context.js.map +1 -0
  46. package/dist/field/debug.d.ts +3 -0
  47. package/dist/field/debug.d.ts.map +1 -0
  48. package/dist/field/debug.js +17 -0
  49. package/dist/field/debug.js.map +1 -0
  50. package/dist/field/editor-context.d.ts +15 -0
  51. package/dist/field/editor-context.d.ts.map +1 -0
  52. package/dist/field/editor-context.js +37 -0
  53. package/dist/field/editor-context.js.map +1 -0
  54. package/dist/field/editor.css +1477 -0
  55. package/dist/field/editor.d.ts +4 -0
  56. package/dist/field/editor.d.ts.map +1 -0
  57. package/dist/field/editor.js +86 -0
  58. package/dist/field/editor.js.map +1 -0
  59. package/dist/field/field-component.css +44 -0
  60. package/dist/field/field-component.d.ts +16 -0
  61. package/dist/field/field-component.d.ts.map +1 -0
  62. package/dist/field/field-component.js +136 -0
  63. package/dist/field/field-component.js.map +1 -0
  64. package/dist/field/hooks/useMediaQuery.d.ts +3 -0
  65. package/dist/field/hooks/useMediaQuery.d.ts.map +1 -0
  66. package/dist/field/hooks/useMediaQuery.js +20 -0
  67. package/dist/field/hooks/useMediaQuery.js.map +1 -0
  68. package/dist/field/hooks/useModal.d.ts +13 -0
  69. package/dist/field/hooks/useModal.d.ts.map +1 -0
  70. package/dist/field/hooks/useModal.js +28 -0
  71. package/dist/field/hooks/useModal.js.map +1 -0
  72. package/dist/field/hooks/useReport.d.ts +9 -0
  73. package/dist/field/hooks/useReport.d.ts.map +1 -0
  74. package/dist/field/hooks/useReport.js +51 -0
  75. package/dist/field/hooks/useReport.js.map +1 -0
  76. package/dist/field/images/cat-typing.gif +0 -0
  77. package/dist/field/images/emoji/1F600.png +0 -0
  78. package/dist/field/images/emoji/1F641.png +0 -0
  79. package/dist/field/images/emoji/1F642.png +0 -0
  80. package/dist/field/images/emoji/2764.png +0 -0
  81. package/dist/field/images/icons/3-columns.svg +3 -0
  82. package/dist/field/images/icons/admonition.svg +1 -0
  83. package/dist/field/images/icons/arrow-clockwise.svg +1 -0
  84. package/dist/field/images/icons/arrow-counterclockwise.svg +1 -0
  85. package/dist/field/images/icons/bg-color.svg +1 -0
  86. package/dist/field/images/icons/camera.svg +1 -0
  87. package/dist/field/images/icons/card-checklist.svg +1 -0
  88. package/dist/field/images/icons/caret-right-fill.svg +1 -0
  89. package/dist/field/images/icons/chat-left-text.svg +1 -0
  90. package/dist/field/images/icons/chat-right-dots.svg +1 -0
  91. package/dist/field/images/icons/chat-right-text.svg +1 -0
  92. package/dist/field/images/icons/chat-right.svg +1 -0
  93. package/dist/field/images/icons/chat-square-quote.svg +1 -0
  94. package/dist/field/images/icons/chevron-down.svg +1 -0
  95. package/dist/field/images/icons/clipboard.svg +1 -0
  96. package/dist/field/images/icons/close.svg +1 -0
  97. package/dist/field/images/icons/code.svg +1 -0
  98. package/dist/field/images/icons/comments.svg +1 -0
  99. package/dist/field/images/icons/copy.svg +1 -0
  100. package/dist/field/images/icons/diagram-2.svg +1 -0
  101. package/dist/field/images/icons/download.svg +1 -0
  102. package/dist/field/images/icons/draggable-block-menu.svg +1 -0
  103. package/dist/field/images/icons/dropdown-more.svg +1 -0
  104. package/dist/field/images/icons/figma.svg +1 -0
  105. package/dist/field/images/icons/file-earmark-text.svg +4 -0
  106. package/dist/field/images/icons/file-image.svg +1 -0
  107. package/dist/field/images/icons/filetype-gif.svg +1 -0
  108. package/dist/field/images/icons/font-color.svg +1 -0
  109. package/dist/field/images/icons/font-family.svg +1 -0
  110. package/dist/field/images/icons/gear.svg +1 -0
  111. package/dist/field/images/icons/horizontal-rule.svg +1 -0
  112. package/dist/field/images/icons/indent.svg +1 -0
  113. package/dist/field/images/icons/journal-code.svg +1 -0
  114. package/dist/field/images/icons/journal-text.svg +1 -0
  115. package/dist/field/images/icons/justify.svg +1 -0
  116. package/dist/field/images/icons/link.svg +1 -0
  117. package/dist/field/images/icons/list-ol.svg +1 -0
  118. package/dist/field/images/icons/list-ul.svg +1 -0
  119. package/dist/field/images/icons/lock-fill.svg +1 -0
  120. package/dist/field/images/icons/lock.svg +1 -0
  121. package/dist/field/images/icons/markdown.svg +1 -0
  122. package/dist/field/images/icons/mic.svg +1 -0
  123. package/dist/field/images/icons/outdent.svg +1 -0
  124. package/dist/field/images/icons/paint-bucket.svg +1 -0
  125. package/dist/field/images/icons/palette.svg +1 -0
  126. package/dist/field/images/icons/pencil-fill.svg +1 -0
  127. package/dist/field/images/icons/plug-fill.svg +1 -0
  128. package/dist/field/images/icons/plug.svg +1 -0
  129. package/dist/field/images/icons/plus-slash-minus.svg +1 -0
  130. package/dist/field/images/icons/plus.svg +1 -0
  131. package/dist/field/images/icons/prettier-error.svg +1 -0
  132. package/dist/field/images/icons/prettier.svg +1 -0
  133. package/dist/field/images/icons/send.svg +1 -0
  134. package/dist/field/images/icons/square-check.svg +1 -0
  135. package/dist/field/images/icons/sticky.svg +1 -0
  136. package/dist/field/images/icons/success-alt.svg +1 -0
  137. package/dist/field/images/icons/success.svg +1 -0
  138. package/dist/field/images/icons/table.svg +1 -0
  139. package/dist/field/images/icons/text-center.svg +1 -0
  140. package/dist/field/images/icons/text-left.svg +1 -0
  141. package/dist/field/images/icons/text-paragraph.svg +1 -0
  142. package/dist/field/images/icons/text-right.svg +1 -0
  143. package/dist/field/images/icons/trash.svg +1 -0
  144. package/dist/field/images/icons/trash3.svg +1 -0
  145. package/dist/field/images/icons/tweet.svg +1 -0
  146. package/dist/field/images/icons/type-bold.svg +1 -0
  147. package/dist/field/images/icons/type-h1.svg +1 -0
  148. package/dist/field/images/icons/type-h2.svg +1 -0
  149. package/dist/field/images/icons/type-h3.svg +1 -0
  150. package/dist/field/images/icons/type-h4.svg +1 -0
  151. package/dist/field/images/icons/type-h5.svg +1 -0
  152. package/dist/field/images/icons/type-h6.svg +1 -0
  153. package/dist/field/images/icons/type-italic.svg +1 -0
  154. package/dist/field/images/icons/type-strikethrough.svg +1 -0
  155. package/dist/field/images/icons/type-subscript.svg +1 -0
  156. package/dist/field/images/icons/type-superscript.svg +1 -0
  157. package/dist/field/images/icons/type-underline.svg +1 -0
  158. package/dist/field/images/icons/upload.svg +1 -0
  159. package/dist/field/images/icons/user.svg +1 -0
  160. package/dist/field/images/icons/vimeo.svg +1 -0
  161. package/dist/field/images/icons/youtube.svg +1 -0
  162. package/dist/field/images/landscape.jpg +0 -0
  163. package/dist/field/images/logo.svg +1 -0
  164. package/dist/field/images/yellow-flower-small.jpg +0 -0
  165. package/dist/field/images/yellow-flower.jpg +0 -0
  166. package/dist/field/index.d.ts +12 -0
  167. package/dist/field/index.d.ts.map +1 -0
  168. package/dist/field/index.js +9 -0
  169. package/dist/field/index.js.map +1 -0
  170. package/dist/field/lexical-after-read-populate-links.d.ts +47 -0
  171. package/dist/field/lexical-after-read-populate-links.d.ts.map +1 -0
  172. package/dist/field/lexical-after-read-populate-links.js +118 -0
  173. package/dist/field/lexical-after-read-populate-links.js.map +1 -0
  174. package/dist/field/lexical-after-read-populate-media.d.ts +34 -0
  175. package/dist/field/lexical-after-read-populate-media.d.ts.map +1 -0
  176. package/dist/field/lexical-after-read-populate-media.js +40 -0
  177. package/dist/field/lexical-after-read-populate-media.js.map +1 -0
  178. package/dist/field/lexical-before-change-populate-links.d.ts +52 -0
  179. package/dist/field/lexical-before-change-populate-links.d.ts.map +1 -0
  180. package/dist/field/lexical-before-change-populate-links.js +116 -0
  181. package/dist/field/lexical-before-change-populate-links.js.map +1 -0
  182. package/dist/field/nodes/admonition-node/admonition-node-component.css +115 -0
  183. package/dist/field/nodes/admonition-node/admonition-node-component.d.ts +11 -0
  184. package/dist/field/nodes/admonition-node/admonition-node-component.d.ts.map +1 -0
  185. package/dist/field/nodes/admonition-node/admonition-node-component.js +157 -0
  186. package/dist/field/nodes/admonition-node/admonition-node-component.js.map +1 -0
  187. package/dist/field/nodes/admonition-node/admonition-node.d.ts +28 -0
  188. package/dist/field/nodes/admonition-node/admonition-node.d.ts.map +1 -0
  189. package/dist/field/nodes/admonition-node/admonition-node.js +134 -0
  190. package/dist/field/nodes/admonition-node/admonition-node.js.map +1 -0
  191. package/dist/field/nodes/admonition-node/icons/danger-icon.css +11 -0
  192. package/dist/field/nodes/admonition-node/icons/danger-icon.d.ts +8 -0
  193. package/dist/field/nodes/admonition-node/icons/danger-icon.d.ts.map +1 -0
  194. package/dist/field/nodes/admonition-node/icons/danger-icon.js +7 -0
  195. package/dist/field/nodes/admonition-node/icons/danger-icon.js.map +1 -0
  196. package/dist/field/nodes/admonition-node/icons/index.d.ts +5 -0
  197. package/dist/field/nodes/admonition-node/icons/index.d.ts.map +1 -0
  198. package/dist/field/nodes/admonition-node/icons/index.js +5 -0
  199. package/dist/field/nodes/admonition-node/icons/index.js.map +1 -0
  200. package/dist/field/nodes/admonition-node/icons/note-icon.css +11 -0
  201. package/dist/field/nodes/admonition-node/icons/note-icon.d.ts +8 -0
  202. package/dist/field/nodes/admonition-node/icons/note-icon.d.ts.map +1 -0
  203. package/dist/field/nodes/admonition-node/icons/note-icon.js +7 -0
  204. package/dist/field/nodes/admonition-node/icons/note-icon.js.map +1 -0
  205. package/dist/field/nodes/admonition-node/icons/tip-icon.css +11 -0
  206. package/dist/field/nodes/admonition-node/icons/tip-icon.d.ts +8 -0
  207. package/dist/field/nodes/admonition-node/icons/tip-icon.d.ts.map +1 -0
  208. package/dist/field/nodes/admonition-node/icons/tip-icon.js +7 -0
  209. package/dist/field/nodes/admonition-node/icons/tip-icon.js.map +1 -0
  210. package/dist/field/nodes/admonition-node/icons/warning-icon.css +11 -0
  211. package/dist/field/nodes/admonition-node/icons/warning-icon.d.ts +8 -0
  212. package/dist/field/nodes/admonition-node/icons/warning-icon.d.ts.map +1 -0
  213. package/dist/field/nodes/admonition-node/icons/warning-icon.js +7 -0
  214. package/dist/field/nodes/admonition-node/icons/warning-icon.js.map +1 -0
  215. package/dist/field/nodes/admonition-node/index.d.ts +4 -0
  216. package/dist/field/nodes/admonition-node/index.d.ts.map +1 -0
  217. package/dist/field/nodes/admonition-node/index.js +4 -0
  218. package/dist/field/nodes/admonition-node/index.js.map +1 -0
  219. package/dist/field/nodes/admonition-node/types.d.ts +14 -0
  220. package/dist/field/nodes/admonition-node/types.d.ts.map +1 -0
  221. package/dist/field/nodes/admonition-node/types.js +2 -0
  222. package/dist/field/nodes/admonition-node/types.js.map +1 -0
  223. package/dist/field/nodes/index.d.ts +10 -0
  224. package/dist/field/nodes/index.d.ts.map +1 -0
  225. package/dist/field/nodes/index.js +44 -0
  226. package/dist/field/nodes/index.js.map +1 -0
  227. package/dist/field/nodes/inline-image-node/index.d.ts +4 -0
  228. package/dist/field/nodes/inline-image-node/index.d.ts.map +1 -0
  229. package/dist/field/nodes/inline-image-node/index.js +4 -0
  230. package/dist/field/nodes/inline-image-node/index.js.map +1 -0
  231. package/dist/field/nodes/inline-image-node/inline-image-node-component.css +205 -0
  232. package/dist/field/nodes/inline-image-node/inline-image-node-component.d.ts +18 -0
  233. package/dist/field/nodes/inline-image-node/inline-image-node-component.d.ts.map +1 -0
  234. package/dist/field/nodes/inline-image-node/inline-image-node-component.js +239 -0
  235. package/dist/field/nodes/inline-image-node/inline-image-node-component.js.map +1 -0
  236. package/dist/field/nodes/inline-image-node/inline-image-node.d.ts +39 -0
  237. package/dist/field/nodes/inline-image-node/inline-image-node.d.ts.map +1 -0
  238. package/dist/field/nodes/inline-image-node/inline-image-node.js +204 -0
  239. package/dist/field/nodes/inline-image-node/inline-image-node.js.map +1 -0
  240. package/dist/field/nodes/inline-image-node/types.d.ts +33 -0
  241. package/dist/field/nodes/inline-image-node/types.d.ts.map +1 -0
  242. package/dist/field/nodes/inline-image-node/types.js +2 -0
  243. package/dist/field/nodes/inline-image-node/types.js.map +1 -0
  244. package/dist/field/nodes/layout-container-node/layout-container-node.d.ts +29 -0
  245. package/dist/field/nodes/layout-container-node/layout-container-node.d.ts.map +1 -0
  246. package/dist/field/nodes/layout-container-node/layout-container-node.js +66 -0
  247. package/dist/field/nodes/layout-container-node/layout-container-node.js.map +1 -0
  248. package/dist/field/nodes/layout-container-node/layout-item-node.d.ts +23 -0
  249. package/dist/field/nodes/layout-container-node/layout-item-node.d.ts.map +1 -0
  250. package/dist/field/nodes/layout-container-node/layout-item-node.js +50 -0
  251. package/dist/field/nodes/layout-container-node/layout-item-node.js.map +1 -0
  252. package/dist/field/nodes/link-nodes/auto-link-node.d.ts +17 -0
  253. package/dist/field/nodes/link-nodes/auto-link-node.d.ts.map +1 -0
  254. package/dist/field/nodes/link-nodes/auto-link-node.js +46 -0
  255. package/dist/field/nodes/link-nodes/auto-link-node.js.map +1 -0
  256. package/dist/field/nodes/link-nodes/index.d.ts +4 -0
  257. package/dist/field/nodes/link-nodes/index.d.ts.map +1 -0
  258. package/dist/field/nodes/link-nodes/index.js +4 -0
  259. package/dist/field/nodes/link-nodes/index.js.map +1 -0
  260. package/dist/field/nodes/link-nodes/link-node.d.ts +42 -0
  261. package/dist/field/nodes/link-nodes/link-node.d.ts.map +1 -0
  262. package/dist/field/nodes/link-nodes/link-node.js +340 -0
  263. package/dist/field/nodes/link-nodes/link-node.js.map +1 -0
  264. package/dist/field/nodes/link-nodes/types.d.ts +16 -0
  265. package/dist/field/nodes/link-nodes/types.d.ts.map +1 -0
  266. package/dist/field/nodes/link-nodes/types.js +2 -0
  267. package/dist/field/nodes/link-nodes/types.js.map +1 -0
  268. package/dist/field/nodes/vimeo-node/index.d.ts +30 -0
  269. package/dist/field/nodes/vimeo-node/index.d.ts.map +1 -0
  270. package/dist/field/nodes/vimeo-node/index.js +92 -0
  271. package/dist/field/nodes/vimeo-node/index.js.map +1 -0
  272. package/dist/field/nodes/youtube-node/index.d.ts +30 -0
  273. package/dist/field/nodes/youtube-node/index.d.ts.map +1 -0
  274. package/dist/field/nodes/youtube-node/index.js +92 -0
  275. package/dist/field/nodes/youtube-node/index.js.map +1 -0
  276. package/dist/field/plugins/admonition-plugin/admonition-drawer.css +8 -0
  277. package/dist/field/plugins/admonition-plugin/admonition-drawer.d.ts +5 -0
  278. package/dist/field/plugins/admonition-plugin/admonition-drawer.d.ts.map +1 -0
  279. package/dist/field/plugins/admonition-plugin/admonition-drawer.js +44 -0
  280. package/dist/field/plugins/admonition-plugin/admonition-drawer.js.map +1 -0
  281. package/dist/field/plugins/admonition-plugin/fields.d.ts +14 -0
  282. package/dist/field/plugins/admonition-plugin/fields.d.ts.map +1 -0
  283. package/dist/field/plugins/admonition-plugin/fields.js +72 -0
  284. package/dist/field/plugins/admonition-plugin/fields.js.map +1 -0
  285. package/dist/field/plugins/admonition-plugin/index.d.ts +8 -0
  286. package/dist/field/plugins/admonition-plugin/index.d.ts.map +1 -0
  287. package/dist/field/plugins/admonition-plugin/index.js +65 -0
  288. package/dist/field/plugins/admonition-plugin/index.js.map +1 -0
  289. package/dist/field/plugins/admonition-plugin/types.d.ts +15 -0
  290. package/dist/field/plugins/admonition-plugin/types.d.ts.map +1 -0
  291. package/dist/field/plugins/admonition-plugin/types.js +2 -0
  292. package/dist/field/plugins/admonition-plugin/types.js.map +1 -0
  293. package/dist/field/plugins/auto-embed-plugin/index.d.ts +26 -0
  294. package/dist/field/plugins/auto-embed-plugin/index.d.ts.map +1 -0
  295. package/dist/field/plugins/auto-embed-plugin/index.js +191 -0
  296. package/dist/field/plugins/auto-embed-plugin/index.js.map +1 -0
  297. package/dist/field/plugins/code-highlight-plugin/index.d.ts +10 -0
  298. package/dist/field/plugins/code-highlight-plugin/index.d.ts.map +1 -0
  299. package/dist/field/plugins/code-highlight-plugin/index.js +11 -0
  300. package/dist/field/plugins/code-highlight-plugin/index.js.map +1 -0
  301. package/dist/field/plugins/drag-drop-paste-plugin/index.d.ts +9 -0
  302. package/dist/field/plugins/drag-drop-paste-plugin/index.d.ts.map +1 -0
  303. package/dist/field/plugins/drag-drop-paste-plugin/index.js +37 -0
  304. package/dist/field/plugins/drag-drop-paste-plugin/index.js.map +1 -0
  305. package/dist/field/plugins/floating-text-format-toolbar-plugin/index.css +150 -0
  306. package/dist/field/plugins/floating-text-format-toolbar-plugin/index.d.ts +13 -0
  307. package/dist/field/plugins/floating-text-format-toolbar-plugin/index.d.ts.map +1 -0
  308. package/dist/field/plugins/floating-text-format-toolbar-plugin/index.js +236 -0
  309. package/dist/field/plugins/floating-text-format-toolbar-plugin/index.js.map +1 -0
  310. package/dist/field/plugins/inline-image-plugin/fields.d.ts +12 -0
  311. package/dist/field/plugins/inline-image-plugin/fields.d.ts.map +1 -0
  312. package/dist/field/plugins/inline-image-plugin/fields.js +160 -0
  313. package/dist/field/plugins/inline-image-plugin/fields.js.map +1 -0
  314. package/dist/field/plugins/inline-image-plugin/index.d.ts +26 -0
  315. package/dist/field/plugins/inline-image-plugin/index.d.ts.map +1 -0
  316. package/dist/field/plugins/inline-image-plugin/index.js +222 -0
  317. package/dist/field/plugins/inline-image-plugin/index.js.map +1 -0
  318. package/dist/field/plugins/inline-image-plugin/inline-image-drawer.css +29 -0
  319. package/dist/field/plugins/inline-image-plugin/inline-image-drawer.d.ts +5 -0
  320. package/dist/field/plugins/inline-image-plugin/inline-image-drawer.d.ts.map +1 -0
  321. package/dist/field/plugins/inline-image-plugin/inline-image-drawer.js +51 -0
  322. package/dist/field/plugins/inline-image-plugin/inline-image-drawer.js.map +1 -0
  323. package/dist/field/plugins/inline-image-plugin/types.d.ts +16 -0
  324. package/dist/field/plugins/inline-image-plugin/types.d.ts.map +1 -0
  325. package/dist/field/plugins/inline-image-plugin/types.js +2 -0
  326. package/dist/field/plugins/inline-image-plugin/types.js.map +1 -0
  327. package/dist/field/plugins/inline-image-plugin/utils.d.ts +9 -0
  328. package/dist/field/plugins/inline-image-plugin/utils.d.ts.map +1 -0
  329. package/dist/field/plugins/inline-image-plugin/utils.js +27 -0
  330. package/dist/field/plugins/inline-image-plugin/utils.js.map +1 -0
  331. package/dist/field/plugins/layout-plugin/insert-layout-dialog.d.ts +14 -0
  332. package/dist/field/plugins/layout-plugin/insert-layout-dialog.d.ts.map +1 -0
  333. package/dist/field/plugins/layout-plugin/insert-layout-dialog.js +26 -0
  334. package/dist/field/plugins/layout-plugin/insert-layout-dialog.js.map +1 -0
  335. package/dist/field/plugins/layout-plugin/layout-plugin.d.ts +8 -0
  336. package/dist/field/plugins/layout-plugin/layout-plugin.d.ts.map +1 -0
  337. package/dist/field/plugins/layout-plugin/layout-plugin.js +87 -0
  338. package/dist/field/plugins/layout-plugin/layout-plugin.js.map +1 -0
  339. package/dist/field/plugins/link-plugin/auto-link/auto-link-plugin.d.ts +22 -0
  340. package/dist/field/plugins/link-plugin/auto-link/auto-link-plugin.d.ts.map +1 -0
  341. package/dist/field/plugins/link-plugin/auto-link/auto-link-plugin.js +218 -0
  342. package/dist/field/plugins/link-plugin/auto-link/auto-link-plugin.js.map +1 -0
  343. package/dist/field/plugins/link-plugin/auto-link/index.d.ts +10 -0
  344. package/dist/field/plugins/link-plugin/auto-link/index.d.ts.map +1 -0
  345. package/dist/field/plugins/link-plugin/auto-link/index.js +17 -0
  346. package/dist/field/plugins/link-plugin/auto-link/index.js.map +1 -0
  347. package/dist/field/plugins/link-plugin/link/fields.d.ts +11 -0
  348. package/dist/field/plugins/link-plugin/link/fields.d.ts.map +1 -0
  349. package/dist/field/plugins/link-plugin/link/fields.js +120 -0
  350. package/dist/field/plugins/link-plugin/link/fields.js.map +1 -0
  351. package/dist/field/plugins/link-plugin/link/floating-link-editor.css +128 -0
  352. package/dist/field/plugins/link-plugin/link/floating-link-editor.d.ts +13 -0
  353. package/dist/field/plugins/link-plugin/link/floating-link-editor.d.ts.map +1 -0
  354. package/dist/field/plugins/link-plugin/link/floating-link-editor.js +239 -0
  355. package/dist/field/plugins/link-plugin/link/floating-link-editor.js.map +1 -0
  356. package/dist/field/plugins/link-plugin/link/index.d.ts +2 -0
  357. package/dist/field/plugins/link-plugin/link/index.d.ts.map +1 -0
  358. package/dist/field/plugins/link-plugin/link/index.js +65 -0
  359. package/dist/field/plugins/link-plugin/link/index.js.map +1 -0
  360. package/dist/field/plugins/link-plugin/link/link-drawer.css +21 -0
  361. package/dist/field/plugins/link-plugin/link/link-drawer.d.ts +5 -0
  362. package/dist/field/plugins/link-plugin/link/link-drawer.d.ts.map +1 -0
  363. package/dist/field/plugins/link-plugin/link/link-drawer.js +72 -0
  364. package/dist/field/plugins/link-plugin/link/link-drawer.js.map +1 -0
  365. package/dist/field/plugins/link-plugin/link/types.d.ts +20 -0
  366. package/dist/field/plugins/link-plugin/link/types.d.ts.map +1 -0
  367. package/dist/field/plugins/link-plugin/link/types.js +2 -0
  368. package/dist/field/plugins/link-plugin/link/types.js.map +1 -0
  369. package/dist/field/plugins/table-action-menu-plugin/index.d.ts +6 -0
  370. package/dist/field/plugins/table-action-menu-plugin/index.d.ts.map +1 -0
  371. package/dist/field/plugins/table-action-menu-plugin/index.js +476 -0
  372. package/dist/field/plugins/table-action-menu-plugin/index.js.map +1 -0
  373. package/dist/field/plugins/table-plugin/index.d.ts +4 -0
  374. package/dist/field/plugins/table-plugin/index.d.ts.map +1 -0
  375. package/dist/field/plugins/table-plugin/index.js +30 -0
  376. package/dist/field/plugins/table-plugin/index.js.map +1 -0
  377. package/dist/field/plugins/table-plugin/table-drawer.d.ts +12 -0
  378. package/dist/field/plugins/table-plugin/table-drawer.d.ts.map +1 -0
  379. package/dist/field/plugins/table-plugin/table-drawer.js +42 -0
  380. package/dist/field/plugins/table-plugin/table-drawer.js.map +1 -0
  381. package/dist/field/plugins/toolbar-plugin/index.d.ts +10 -0
  382. package/dist/field/plugins/toolbar-plugin/index.d.ts.map +1 -0
  383. package/dist/field/plugins/toolbar-plugin/index.js +394 -0
  384. package/dist/field/plugins/toolbar-plugin/index.js.map +1 -0
  385. package/dist/field/plugins/treeview-plugin/index.d.ts +10 -0
  386. package/dist/field/plugins/treeview-plugin/index.d.ts.map +1 -0
  387. package/dist/field/plugins/treeview-plugin/index.js +9 -0
  388. package/dist/field/plugins/treeview-plugin/index.js.map +1 -0
  389. package/dist/field/plugins/vimeo-plugin/index.d.ts +4 -0
  390. package/dist/field/plugins/vimeo-plugin/index.d.ts.map +1 -0
  391. package/dist/field/plugins/vimeo-plugin/index.js +29 -0
  392. package/dist/field/plugins/vimeo-plugin/index.js.map +1 -0
  393. package/dist/field/plugins/youtube-plugin/index.d.ts +4 -0
  394. package/dist/field/plugins/youtube-plugin/index.d.ts.map +1 -0
  395. package/dist/field/plugins/youtube-plugin/index.js +29 -0
  396. package/dist/field/plugins/youtube-plugin/index.js.map +1 -0
  397. package/dist/field/rsc-entry.d.ts +9 -0
  398. package/dist/field/rsc-entry.d.ts.map +1 -0
  399. package/dist/field/rsc-entry.js +57 -0
  400. package/dist/field/rsc-entry.js.map +1 -0
  401. package/dist/field/shared/canUseDOM.d.ts +9 -0
  402. package/dist/field/shared/canUseDOM.d.ts.map +1 -0
  403. package/dist/field/shared/canUseDOM.js +9 -0
  404. package/dist/field/shared/canUseDOM.js.map +1 -0
  405. package/dist/field/shared/environment.d.ts +23 -0
  406. package/dist/field/shared/environment.d.ts.map +1 -0
  407. package/dist/field/shared/environment.js +22 -0
  408. package/dist/field/shared/environment.js.map +1 -0
  409. package/dist/field/shared/invariant.d.ts +9 -0
  410. package/dist/field/shared/invariant.d.ts.map +1 -0
  411. package/dist/field/shared/invariant.js +18 -0
  412. package/dist/field/shared/invariant.js.map +1 -0
  413. package/dist/field/shared/simpleDiffWithCursor.d.ts +13 -0
  414. package/dist/field/shared/simpleDiffWithCursor.d.ts.map +1 -0
  415. package/dist/field/shared/simpleDiffWithCursor.js +34 -0
  416. package/dist/field/shared/simpleDiffWithCursor.js.map +1 -0
  417. package/dist/field/shared/useLayoutEffect.d.ts +11 -0
  418. package/dist/field/shared/useLayoutEffect.d.ts.map +1 -0
  419. package/dist/field/shared/useLayoutEffect.js +12 -0
  420. package/dist/field/shared/useLayoutEffect.js.map +1 -0
  421. package/dist/field/shared/warnOnlyOnce.d.ts +9 -0
  422. package/dist/field/shared/warnOnlyOnce.d.ts.map +1 -0
  423. package/dist/field/shared/warnOnlyOnce.js +21 -0
  424. package/dist/field/shared/warnOnlyOnce.js.map +1 -0
  425. package/dist/field/themes/lexical-editor-theme.css +558 -0
  426. package/dist/field/themes/lexical-editor-theme.d.ts +10 -0
  427. package/dist/field/themes/lexical-editor-theme.d.ts.map +1 -0
  428. package/dist/field/themes/lexical-editor-theme.js +105 -0
  429. package/dist/field/themes/lexical-editor-theme.js.map +1 -0
  430. package/dist/field/types.d.ts +10 -0
  431. package/dist/field/types.d.ts.map +1 -0
  432. package/dist/field/types.js +2 -0
  433. package/dist/field/types.js.map +1 -0
  434. package/dist/field/ui/button.css +45 -0
  435. package/dist/field/ui/button.d.ts +19 -0
  436. package/dist/field/ui/button.d.ts.map +1 -0
  437. package/dist/field/ui/button.js +8 -0
  438. package/dist/field/ui/button.js.map +1 -0
  439. package/dist/field/ui/checkbox.css +52 -0
  440. package/dist/field/ui/color-picker.css +88 -0
  441. package/dist/field/ui/color-picker.d.ts +21 -0
  442. package/dist/field/ui/color-picker.d.ts.map +1 -0
  443. package/dist/field/ui/color-picker.js +250 -0
  444. package/dist/field/ui/color-picker.js.map +1 -0
  445. package/dist/field/ui/content-editable-inline.d.ts +13 -0
  446. package/dist/field/ui/content-editable-inline.d.ts.map +1 -0
  447. package/dist/field/ui/content-editable-inline.js +14 -0
  448. package/dist/field/ui/content-editable-inline.js.map +1 -0
  449. package/dist/field/ui/content-editable.css +28 -0
  450. package/dist/field/ui/content-editable.d.ts +13 -0
  451. package/dist/field/ui/content-editable.d.ts.map +1 -0
  452. package/dist/field/ui/content-editable.js +15 -0
  453. package/dist/field/ui/content-editable.js.map +1 -0
  454. package/dist/field/ui/dialog.css +17 -0
  455. package/dist/field/ui/dialog.d.ts +17 -0
  456. package/dist/field/ui/dialog.d.ts.map +1 -0
  457. package/dist/field/ui/dialog.js +10 -0
  458. package/dist/field/ui/dialog.js.map +1 -0
  459. package/dist/field/ui/dropdown.d.ts +25 -0
  460. package/dist/field/ui/dropdown.d.ts.map +1 -0
  461. package/dist/field/ui/dropdown.js +118 -0
  462. package/dist/field/ui/dropdown.js.map +1 -0
  463. package/dist/field/ui/file-input.d.ts +18 -0
  464. package/dist/field/ui/file-input.d.ts.map +1 -0
  465. package/dist/field/ui/file-input.js +17 -0
  466. package/dist/field/ui/file-input.js.map +1 -0
  467. package/dist/field/ui/input.css +32 -0
  468. package/dist/field/ui/modal.css +84 -0
  469. package/dist/field/ui/modal.d.ts +17 -0
  470. package/dist/field/ui/modal.d.ts.map +1 -0
  471. package/dist/field/ui/modal.js +48 -0
  472. package/dist/field/ui/modal.js.map +1 -0
  473. package/dist/field/ui/placeholder-inline.d.ts +14 -0
  474. package/dist/field/ui/placeholder-inline.d.ts.map +1 -0
  475. package/dist/field/ui/placeholder-inline.js +12 -0
  476. package/dist/field/ui/placeholder-inline.js.map +1 -0
  477. package/dist/field/ui/placeholder.css +33 -0
  478. package/dist/field/ui/placeholder.d.ts +14 -0
  479. package/dist/field/ui/placeholder.d.ts.map +1 -0
  480. package/dist/field/ui/placeholder.js +14 -0
  481. package/dist/field/ui/placeholder.js.map +1 -0
  482. package/dist/field/ui/select.css +34 -0
  483. package/dist/field/ui/select.d.ts +16 -0
  484. package/dist/field/ui/select.d.ts.map +1 -0
  485. package/dist/field/ui/select.js +17 -0
  486. package/dist/field/ui/select.js.map +1 -0
  487. package/dist/field/ui/switch.d.ts +15 -0
  488. package/dist/field/ui/switch.d.ts.map +1 -0
  489. package/dist/field/ui/switch.js +8 -0
  490. package/dist/field/ui/switch.js.map +1 -0
  491. package/dist/field/ui/text-input.d.ts +20 -0
  492. package/dist/field/ui/text-input.d.ts.map +1 -0
  493. package/dist/field/ui/text-input.js +18 -0
  494. package/dist/field/ui/text-input.js.map +1 -0
  495. package/dist/field/utils/cloneDeep.d.ts +2 -0
  496. package/dist/field/utils/cloneDeep.d.ts.map +1 -0
  497. package/dist/field/utils/cloneDeep.js +50 -0
  498. package/dist/field/utils/cloneDeep.js.map +1 -0
  499. package/dist/field/utils/deepEqual.d.ts +2 -0
  500. package/dist/field/utils/deepEqual.d.ts.map +1 -0
  501. package/dist/field/utils/deepEqual.js +48 -0
  502. package/dist/field/utils/deepEqual.js.map +1 -0
  503. package/dist/field/utils/emoji-list.d.ts +28 -0
  504. package/dist/field/utils/emoji-list.d.ts.map +1 -0
  505. package/dist/field/utils/emoji-list.js +16613 -0
  506. package/dist/field/utils/emoji-list.js.map +1 -0
  507. package/dist/field/utils/getDOMRangeRect.d.ts +9 -0
  508. package/dist/field/utils/getDOMRangeRect.d.ts.map +1 -0
  509. package/dist/field/utils/getDOMRangeRect.js +23 -0
  510. package/dist/field/utils/getDOMRangeRect.js.map +1 -0
  511. package/dist/field/utils/getSelectedNode.d.ts +3 -0
  512. package/dist/field/utils/getSelectedNode.d.ts.map +1 -0
  513. package/dist/field/utils/getSelectedNode.js +25 -0
  514. package/dist/field/utils/getSelectedNode.js.map +1 -0
  515. package/dist/field/utils/guard.d.ts +9 -0
  516. package/dist/field/utils/guard.d.ts.map +1 -0
  517. package/dist/field/utils/guard.js +11 -0
  518. package/dist/field/utils/guard.js.map +1 -0
  519. package/dist/field/utils/hashSerializedState.d.ts +3 -0
  520. package/dist/field/utils/hashSerializedState.d.ts.map +1 -0
  521. package/dist/field/utils/hashSerializedState.js +32 -0
  522. package/dist/field/utils/hashSerializedState.js.map +1 -0
  523. package/dist/field/utils/isMobileWidth.d.ts +9 -0
  524. package/dist/field/utils/isMobileWidth.d.ts.map +1 -0
  525. package/dist/field/utils/isMobileWidth.js +9 -0
  526. package/dist/field/utils/isMobileWidth.js.map +1 -0
  527. package/dist/field/utils/joinClasses.d.ts +9 -0
  528. package/dist/field/utils/joinClasses.d.ts.map +1 -0
  529. package/dist/field/utils/joinClasses.js +11 -0
  530. package/dist/field/utils/joinClasses.js.map +1 -0
  531. package/dist/field/utils/load-related.d.ts +4 -0
  532. package/dist/field/utils/load-related.d.ts.map +1 -0
  533. package/dist/field/utils/load-related.js +45 -0
  534. package/dist/field/utils/load-related.js.map +1 -0
  535. package/dist/field/utils/point.d.ts +22 -0
  536. package/dist/field/utils/point.d.ts.map +1 -0
  537. package/dist/field/utils/point.js +43 -0
  538. package/dist/field/utils/point.js.map +1 -0
  539. package/dist/field/utils/rect.d.ts +46 -0
  540. package/dist/field/utils/rect.d.ts.map +1 -0
  541. package/dist/field/utils/rect.js +101 -0
  542. package/dist/field/utils/rect.js.map +1 -0
  543. package/dist/field/utils/setFloatingElemPosition.d.ts +2 -0
  544. package/dist/field/utils/setFloatingElemPosition.d.ts.map +1 -0
  545. package/dist/field/utils/setFloatingElemPosition.js +34 -0
  546. package/dist/field/utils/setFloatingElemPosition.js.map +1 -0
  547. package/dist/field/utils/setFloatingElemPositionForLinkEditor.d.ts +2 -0
  548. package/dist/field/utils/setFloatingElemPositionForLinkEditor.d.ts.map +1 -0
  549. package/dist/field/utils/setFloatingElemPositionForLinkEditor.js +33 -0
  550. package/dist/field/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
  551. package/dist/field/utils/swipe.d.ts +12 -0
  552. package/dist/field/utils/swipe.d.ts.map +1 -0
  553. package/dist/field/utils/swipe.js +100 -0
  554. package/dist/field/utils/swipe.js.map +1 -0
  555. package/dist/field/utils/url.d.ts +11 -0
  556. package/dist/field/utils/url.d.ts.map +1 -0
  557. package/dist/field/utils/url.js +45 -0
  558. package/dist/field/utils/url.js.map +1 -0
  559. package/dist/index.d.ts +3 -0
  560. package/dist/index.d.ts.map +1 -0
  561. package/dist/index.js +3 -0
  562. package/dist/index.js.map +1 -0
  563. package/dist/types.d.ts +33 -0
  564. package/dist/types.d.ts.map +1 -0
  565. package/dist/types.js +2 -0
  566. package/dist/types.js.map +1 -0
  567. package/dist/validate/hasText.d.ts +3 -0
  568. package/dist/validate/hasText.d.ts.map +1 -0
  569. package/dist/validate/hasText.js +29 -0
  570. package/dist/validate/hasText.js.map +1 -0
  571. package/dist/validate/validate-client.d.ts +4 -0
  572. package/dist/validate/validate-client.d.ts.map +1 -0
  573. package/dist/validate/validate-client.js +17 -0
  574. package/dist/validate/validate-client.js.map +1 -0
  575. package/dist/validate/validate-server.d.ts +4 -0
  576. package/dist/validate/validate-server.d.ts.map +1 -0
  577. package/dist/validate/validate-server.js +10 -0
  578. package/dist/validate/validate-server.js.map +1 -0
  579. package/package.json +108 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { addClassNamesToElement } from '@lexical/utils';
9
+ import { ElementNode } from 'lexical';
10
+ export class LayoutContainerNode extends ElementNode {
11
+ __templateColumns;
12
+ constructor(templateColumns, key) {
13
+ super(key);
14
+ this.__templateColumns = templateColumns;
15
+ }
16
+ static getType() {
17
+ return 'layout-container';
18
+ }
19
+ static clone(node) {
20
+ return new LayoutContainerNode(node.__templateColumns, node.__key);
21
+ }
22
+ createDOM(config) {
23
+ const dom = document.createElement('div');
24
+ dom.style.gridTemplateColumns = this.__templateColumns;
25
+ if (typeof config.theme.layoutContainer === 'string') {
26
+ addClassNamesToElement(dom, config.theme.layoutContainer);
27
+ }
28
+ return dom;
29
+ }
30
+ updateDOM(prevNode, dom) {
31
+ if (prevNode.__templateColumns !== this.__templateColumns) {
32
+ dom.style.gridTemplateColumns = this.__templateColumns;
33
+ }
34
+ return false;
35
+ }
36
+ static importDOM() {
37
+ return {};
38
+ }
39
+ static importJSON(json) {
40
+ return $createLayoutContainerNode(json.templateColumns);
41
+ }
42
+ canBeEmpty() {
43
+ return false;
44
+ }
45
+ exportJSON() {
46
+ return {
47
+ ...super.exportJSON(),
48
+ templateColumns: this.__templateColumns,
49
+ type: 'layout-container',
50
+ version: 1,
51
+ };
52
+ }
53
+ getTemplateColumns() {
54
+ return this.getLatest().__templateColumns;
55
+ }
56
+ setTemplateColumns(templateColumns) {
57
+ this.getWritable().__templateColumns = templateColumns;
58
+ }
59
+ }
60
+ export function $createLayoutContainerNode(templateColumns) {
61
+ return new LayoutContainerNode(templateColumns);
62
+ }
63
+ export function $isLayoutContainerNode(node) {
64
+ return node instanceof LayoutContainerNode;
65
+ }
66
+ //# sourceMappingURL=layout-container-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-container-node.js","sourceRoot":"","sources":["../../../../src/field/nodes/layout-container-node/layout-container-node.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AASvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AASrC,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD,iBAAiB,CAAQ;IAEzB,YAAY,eAAuB,EAAE,GAAa;QAChD,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAA;IAC1C,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,kBAAkB,CAAA;IAC3B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAyB;QACpC,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACpE,CAAC;IAED,SAAS,CAAC,MAAoB;QAC5B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACzC,GAAG,CAAC,KAAK,CAAC,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,CAAA;QACtD,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;YACrD,sBAAsB,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;QAC3D,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,SAAS,CAAC,QAA6B,EAAE,GAAgB;QACvD,IAAI,QAAQ,CAAC,iBAAiB,KAAK,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC1D,GAAG,CAAC,KAAK,CAAC,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,CAAA;QACxD,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,CAAC,SAAS;QACd,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,IAAmC;QACnD,OAAO,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IACzD,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAA;IACd,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,eAAe,EAAE,IAAI,CAAC,iBAAiB;YACvC,IAAI,EAAE,kBAAkB;YACxB,OAAO,EAAE,CAAC;SACX,CAAA;IACH,CAAC;IAED,kBAAkB;QAChB,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,iBAAiB,CAAA;IAC3C,CAAC;IAED,kBAAkB,CAAC,eAAuB;QACxC,IAAI,CAAC,WAAW,EAAE,CAAC,iBAAiB,GAAG,eAAe,CAAA;IACxD,CAAC;CACF;AAED,MAAM,UAAU,0BAA0B,CAAC,eAAuB;IAChE,OAAO,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAAA;AACjD,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,IAAoC;IAEpC,OAAO,IAAI,YAAY,mBAAmB,CAAA;AAC5C,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { DOMConversionMap, EditorConfig, LexicalNode, SerializedElementNode } from 'lexical';
9
+ import { ElementNode } from 'lexical';
10
+ export type SerializedLayoutItemNode = SerializedElementNode;
11
+ export declare class LayoutItemNode extends ElementNode {
12
+ static getType(): string;
13
+ static clone(node: LayoutItemNode): LayoutItemNode;
14
+ createDOM(config: EditorConfig): HTMLElement;
15
+ updateDOM(): boolean;
16
+ static importDOM(): DOMConversionMap | null;
17
+ static importJSON(): LayoutItemNode;
18
+ isShadowRoot(): boolean;
19
+ exportJSON(): SerializedLayoutItemNode;
20
+ }
21
+ export declare function $createLayoutItemNode(): LayoutItemNode;
22
+ export declare function $isLayoutItemNode(node: LexicalNode | null | undefined): node is LayoutItemNode;
23
+ //# sourceMappingURL=layout-item-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-item-node.d.ts","sourceRoot":"","sources":["../../../../src/field/nodes/layout-container-node/layout-item-node.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,CAAA;AAE5D,qBAAa,cAAe,SAAQ,WAAW;IAC7C,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc;IAIlD,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW;IAQ5C,SAAS,IAAI,OAAO;IAIpB,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAI3C,MAAM,CAAC,UAAU,IAAI,cAAc;IAInC,YAAY,IAAI,OAAO;IAIvB,UAAU,IAAI,wBAAwB;CAOvC;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CAEtD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,cAAc,CAE9F"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { addClassNamesToElement } from '@lexical/utils';
9
+ import { ElementNode } from 'lexical';
10
+ export class LayoutItemNode extends ElementNode {
11
+ static getType() {
12
+ return 'layout-item';
13
+ }
14
+ static clone(node) {
15
+ return new LayoutItemNode(node.__key);
16
+ }
17
+ createDOM(config) {
18
+ const dom = document.createElement('div');
19
+ if (typeof config.theme.layoutItem === 'string') {
20
+ addClassNamesToElement(dom, config.theme.layoutItem);
21
+ }
22
+ return dom;
23
+ }
24
+ updateDOM() {
25
+ return false;
26
+ }
27
+ static importDOM() {
28
+ return {};
29
+ }
30
+ static importJSON() {
31
+ return $createLayoutItemNode();
32
+ }
33
+ isShadowRoot() {
34
+ return true;
35
+ }
36
+ exportJSON() {
37
+ return {
38
+ ...super.exportJSON(),
39
+ type: 'layout-item',
40
+ version: 1,
41
+ };
42
+ }
43
+ }
44
+ export function $createLayoutItemNode() {
45
+ return new LayoutItemNode();
46
+ }
47
+ export function $isLayoutItemNode(node) {
48
+ return node instanceof LayoutItemNode;
49
+ }
50
+ //# sourceMappingURL=layout-item-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-item-node.js","sourceRoot":"","sources":["../../../../src/field/nodes/layout-container-node/layout-item-node.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAIrC,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,MAAM,CAAC,OAAO;QACZ,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAoB;QAC/B,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACvC,CAAC;IAED,SAAS,CAAC,MAAoB;QAC5B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACzC,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;YAChD,sBAAsB,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACtD,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,SAAS;QACP,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,CAAC,SAAS;QACd,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,CAAC,UAAU;QACf,OAAO,qBAAqB,EAAE,CAAA;IAChC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,CAAC;SACX,CAAA;IACH,CAAC;CACF;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,cAAc,EAAE,CAAA;AAC7B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAoC;IACpE,OAAO,IAAI,YAAY,cAAc,CAAA;AACvC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type ElementNode, type LexicalNode, type RangeSelection } from 'lexical';
2
+ import { LinkNode } from './link-node';
3
+ import type { LinkAttributes, SerializedLinkNode } from './types';
4
+ export type SerializedAutoLinkNode = SerializedLinkNode;
5
+ export declare class AutoLinkNode extends LinkNode {
6
+ static getType(): string;
7
+ static clone(node: AutoLinkNode): AutoLinkNode;
8
+ static importJSON(serializedNode: SerializedAutoLinkNode): AutoLinkNode;
9
+ static importDOM(): null;
10
+ exportJSON(): SerializedAutoLinkNode;
11
+ insertNewAfter(selection: RangeSelection, restoreSelection?: boolean): null | ElementNode;
12
+ }
13
+ export declare function $createAutoLinkNode({ attributes }: {
14
+ attributes: LinkAttributes;
15
+ }): AutoLinkNode;
16
+ export declare function $isAutoLinkNode(node: LexicalNode | null | undefined): node is AutoLinkNode;
17
+ //# sourceMappingURL=auto-link-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-link-node.d.ts","sourceRoot":"","sources":["../../../../src/field/nodes/link-nodes/auto-link-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjE,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAA;AAKvD,qBAAa,YAAa,SAAQ,QAAQ;IACxC,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY;IAI9C,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,sBAAsB,GAAG,YAAY;IASvE,MAAM,CAAC,SAAS,IAAI,IAAI;IAKxB,UAAU,IAAI,sBAAsB;IAQpC,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,gBAAgB,UAAO,GAAG,IAAI,GAAG,WAAW;CASvF;AAED,wBAAgB,mBAAmB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,cAAc,CAAA;CAAE,GAAG,YAAY,CAEhG;AACD,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,YAAY,CAE1F"}
@@ -0,0 +1,46 @@
1
+ import { $applyNodeReplacement, $isElementNode, } from 'lexical';
2
+ import { LinkNode } from './link-node';
3
+ // Custom node type to override `canInsertTextAfter` that will
4
+ // allow typing within the link
5
+ export class AutoLinkNode extends LinkNode {
6
+ static getType() {
7
+ return 'autolink';
8
+ }
9
+ static clone(node) {
10
+ return new AutoLinkNode({ attributes: node.__attributes, key: node.__key });
11
+ }
12
+ static importJSON(serializedNode) {
13
+ const node = $createAutoLinkNode({ attributes: serializedNode.attributes });
14
+ node.setFormat(serializedNode.format);
15
+ node.setIndent(serializedNode.indent);
16
+ node.setDirection(serializedNode.direction);
17
+ return node;
18
+ }
19
+ static importDOM() {
20
+ // TODO: Should link node should handle the import over autolink?
21
+ return null;
22
+ }
23
+ exportJSON() {
24
+ return {
25
+ ...super.exportJSON(),
26
+ type: 'autolink',
27
+ version: 1,
28
+ };
29
+ }
30
+ insertNewAfter(selection, restoreSelection = true) {
31
+ const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection);
32
+ if ($isElementNode(element)) {
33
+ const linkNode = $createAutoLinkNode({ attributes: this.__attributes });
34
+ element.append(linkNode);
35
+ return linkNode;
36
+ }
37
+ return null;
38
+ }
39
+ }
40
+ export function $createAutoLinkNode({ attributes }) {
41
+ return $applyNodeReplacement(new AutoLinkNode({ attributes }));
42
+ }
43
+ export function $isAutoLinkNode(node) {
44
+ return node instanceof AutoLinkNode;
45
+ }
46
+ //# sourceMappingURL=auto-link-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-link-node.js","sourceRoot":"","sources":["../../../../src/field/nodes/link-nodes/auto-link-node.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,cAAc,GAIf,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAKtC,8DAA8D;AAC9D,+BAA+B;AAE/B,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxC,MAAM,CAAC,OAAO;QACZ,OAAO,UAAU,CAAA;IACnB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAkB;QAC7B,OAAO,IAAI,YAAY,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,I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C,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './auto-link-node';
2
+ export * from './link-node';
3
+ export * from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/field/nodes/link-nodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './auto-link-node';
2
+ export * from './link-node';
3
+ export * from './types';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/field/nodes/link-nodes/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { type DOMConversionMap, type EditorConfig, ElementNode, type LexicalCommand, type LexicalNode, type NodeKey, type NodeSelection, type RangeSelection } from 'lexical';
9
+ import type { SerializedAutoLinkNode } from './auto-link-node';
10
+ import type { LinkAttributes, SerializedLinkNode } from './types';
11
+ /** @noInheritDoc */
12
+ export declare class LinkNode extends ElementNode {
13
+ __attributes: LinkAttributes;
14
+ static getType(): string;
15
+ static clone(node: LinkNode): LinkNode;
16
+ constructor({ attributes, key, }: {
17
+ attributes: LinkAttributes;
18
+ key?: NodeKey;
19
+ });
20
+ createDOM(config: EditorConfig): HTMLAnchorElement;
21
+ updateDOM(prevNode: LinkNode, anchor: HTMLAnchorElement, _config: EditorConfig): boolean;
22
+ static importDOM(): DOMConversionMap | null;
23
+ static importJSON(serializedNode: SerializedLinkNode | SerializedAutoLinkNode): LinkNode;
24
+ exportJSON(): SerializedLinkNode | SerializedAutoLinkNode;
25
+ getAttributes(): LinkAttributes;
26
+ setAttributes(attributes: LinkAttributes): void;
27
+ insertNewAfter(selection: RangeSelection, restoreSelection?: boolean): null | ElementNode;
28
+ canInsertTextBefore(): false;
29
+ canInsertTextAfter(): false;
30
+ canBeEmpty(): false;
31
+ isInline(): true;
32
+ extractWithChild(_child: LexicalNode, selection: RangeSelection | NodeSelection, _destination: 'clone' | 'html'): boolean;
33
+ }
34
+ export declare function $createLinkNode({ attributes }: {
35
+ attributes: LinkAttributes;
36
+ }): LinkNode;
37
+ export declare function $isLinkNode(node: LexicalNode | null | undefined): node is LinkNode;
38
+ export declare const TOGGLE_LINK_COMMAND: LexicalCommand<LinkAttributes | null>;
39
+ export declare function $toggleLink(linkAttributes: LinkAttributes & {
40
+ text?: string;
41
+ }): void;
42
+ //# sourceMappingURL=link-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-node.d.ts","sourceRoot":"","sources":["../../../../src/field/nodes/link-nodes/link-node.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAOL,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjE,oBAAoB;AACpB,qBAAa,QAAS,SAAQ,WAAW;IACvC,YAAY,EAAE,cAAc,CAAA;IAE5B,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ;gBAO1B,EACV,UAMC,EACD,GAAG,GACJ,EAAE;QACD,UAAU,EAAE,cAAc,CAAA;QAC1B,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licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { addClassNamesToElement, isHTMLAnchorElement } from '@lexical/utils';
9
+ import { $applyNodeReplacement, $createTextNode, $getSelection, $isElementNode, $isRangeSelection, createCommand, ElementNode, } from 'lexical';
10
+ import { sanitizeUrl } from '../../utils/url';
11
+ /** @noInheritDoc */
12
+ export class LinkNode extends ElementNode {
13
+ __attributes;
14
+ static getType() {
15
+ return 'link';
16
+ }
17
+ static clone(node) {
18
+ return new LinkNode({
19
+ attributes: node.__attributes,
20
+ key: node.__key,
21
+ });
22
+ }
23
+ constructor({ attributes = {
24
+ url: undefined,
25
+ newTab: false,
26
+ rel: null,
27
+ doc: null,
28
+ linkType: 'custom',
29
+ }, key, }) {
30
+ super(key);
31
+ this.__attributes = attributes;
32
+ }
33
+ createDOM(config) {
34
+ const element = document.createElement('a');
35
+ if (this.__attributes?.linkType === 'custom') {
36
+ element.href = sanitizeUrl(this.__attributes.url ?? '');
37
+ }
38
+ else {
39
+ // TODO: note the admin/collections url doesn't actually matter here, as this link
40
+ // will not be followed. Instead the floating link editor will appear.
41
+ // That said - it would be nice to be able to access the payload routes/admin configuration
42
+ // value to ensure that this is the correct admin path.
43
+ element.href = `/admin/collections/${this.__attributes.doc?.relationTo}/${this.__attributes.doc?.value}`;
44
+ }
45
+ if (this.__attributes?.newTab ?? false) {
46
+ element.target = '_blank';
47
+ }
48
+ element.rel = '';
49
+ if (this.__attributes?.newTab === true && this.__attributes?.linkType === 'custom') {
50
+ element.rel = manageRel(element.rel, 'add', 'noopener');
51
+ element.rel = manageRel(element.rel, 'add', 'nofollow');
52
+ }
53
+ if (this.__attributes?.rel != null) {
54
+ element.rel += ` ${this.__attributes?.rel}`;
55
+ }
56
+ addClassNamesToElement(element, config.theme.link);
57
+ return element;
58
+ }
59
+ updateDOM(prevNode, anchor, _config) {
60
+ const url = this.__attributes?.url;
61
+ const newTab = this.__attributes?.newTab;
62
+ const rel = this.__attributes?.rel;
63
+ // A custom URL but the URL has been updated.
64
+ if (url != null &&
65
+ url !== prevNode.__attributes?.url &&
66
+ this.__attributes?.linkType === 'custom') {
67
+ anchor.href = url;
68
+ }
69
+ // We've changed from a custom URL to an internal URL
70
+ if (this.__attributes?.linkType === 'internal' &&
71
+ prevNode.__attributes?.linkType === 'custom') {
72
+ // TODO: note the admin/collections url doesn't actually matter here, as this link
73
+ // will not be followed. Instead the floating link editor will appear.
74
+ // That said - it would be nice to be able to access the payload routes/admin configuration
75
+ // value to ensure that this is the correct admin path.
76
+ anchor.href = `/admin/collections/${this.__attributes.doc?.relationTo}/${this.__attributes.doc?.value}`;
77
+ }
78
+ // We've changed the internal URL to a new value
79
+ if (this.__attributes.doc?.value !== prevNode.__attributes.doc?.value &&
80
+ this.__attributes?.linkType === 'internal') {
81
+ // TODO: note the admin/collections url doesn't actually matter here, as this link
82
+ // will not be followed. Instead the floating link editor will appear.
83
+ // That said - it would be nice to be able to access the payload routes/admin configuration
84
+ // value to ensure that this is the correct admin path.
85
+ anchor.href = `/admin/collections/${this.__attributes.doc?.relationTo}/${this.__attributes.doc?.value}`;
86
+ }
87
+ // TODO: not 100% sure why we're setting rel to '' - revisit
88
+ // Start rel config here, then check newTab below
89
+ if (anchor.rel == null) {
90
+ anchor.rel = '';
91
+ }
92
+ if (newTab !== prevNode.__attributes?.newTab) {
93
+ if (newTab != null && newTab === true) {
94
+ anchor.target = '_blank';
95
+ if (this.__attributes?.linkType === 'custom') {
96
+ anchor.rel = manageRel(anchor.rel, 'add', 'noopener');
97
+ anchor.rel = manageRel(anchor.rel, 'add', 'nofollow');
98
+ }
99
+ }
100
+ else {
101
+ anchor.removeAttribute('target');
102
+ anchor.rel = manageRel(anchor.rel, 'remove', 'noopener');
103
+ anchor.rel = manageRel(anchor.rel, 'remove', 'nofollow');
104
+ }
105
+ }
106
+ // TODO - revisit - I don't think there can be any other rel
107
+ // values other than nofollow and noopener - so not
108
+ // sure why anchor.rel += rel below
109
+ if (rel !== prevNode.__attributes.rel) {
110
+ if (rel != null) {
111
+ anchor.rel += rel;
112
+ }
113
+ else {
114
+ anchor.removeAttribute('rel');
115
+ }
116
+ }
117
+ return false;
118
+ }
119
+ static importDOM() {
120
+ return {
121
+ a: (_node) => ({
122
+ conversion: convertAnchorElement,
123
+ priority: 1,
124
+ }),
125
+ };
126
+ }
127
+ static importJSON(serializedNode) {
128
+ const node = $createLinkNode({
129
+ attributes: serializedNode.attributes,
130
+ });
131
+ node.setFormat(serializedNode.format);
132
+ node.setIndent(serializedNode.indent);
133
+ node.setDirection(serializedNode.direction);
134
+ return node;
135
+ }
136
+ exportJSON() {
137
+ return {
138
+ ...super.exportJSON(),
139
+ attributes: this.getAttributes(),
140
+ type: 'link',
141
+ version: 2,
142
+ };
143
+ }
144
+ getAttributes() {
145
+ return this.getLatest().__attributes;
146
+ }
147
+ setAttributes(attributes) {
148
+ const writable = this.getWritable();
149
+ writable.__attributes = attributes;
150
+ }
151
+ insertNewAfter(selection, restoreSelection = true) {
152
+ const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection);
153
+ if ($isElementNode(element)) {
154
+ const linkNode = $createLinkNode({ attributes: this.__attributes });
155
+ element.append(linkNode);
156
+ return linkNode;
157
+ }
158
+ return null;
159
+ }
160
+ canInsertTextBefore() {
161
+ return false;
162
+ }
163
+ canInsertTextAfter() {
164
+ return false;
165
+ }
166
+ canBeEmpty() {
167
+ return false;
168
+ }
169
+ isInline() {
170
+ return true;
171
+ }
172
+ extractWithChild(_child, selection, _destination) {
173
+ if (!$isRangeSelection(selection)) {
174
+ return false;
175
+ }
176
+ const anchorNode = selection.anchor.getNode();
177
+ const focusNode = selection.focus.getNode();
178
+ return (this.isParentOf(anchorNode) &&
179
+ this.isParentOf(focusNode) &&
180
+ selection.getTextContent().length > 0);
181
+ }
182
+ }
183
+ function convertAnchorElement(domNode) {
184
+ let node = null;
185
+ if (isHTMLAnchorElement(domNode)) {
186
+ const content = domNode.textContent;
187
+ if (content !== null && content !== '') {
188
+ node = $createLinkNode({
189
+ attributes: {
190
+ url: domNode.getAttribute('href') ?? '',
191
+ rel: domNode.getAttribute('rel'),
192
+ newTab: domNode.getAttribute('target') === '_blank',
193
+ linkType: 'custom',
194
+ doc: null,
195
+ },
196
+ });
197
+ }
198
+ }
199
+ return { node };
200
+ }
201
+ export function $createLinkNode({ attributes }) {
202
+ const linkNode = new LinkNode({ attributes });
203
+ return $applyNodeReplacement(linkNode);
204
+ }
205
+ export function $isLinkNode(node) {
206
+ return node instanceof LinkNode;
207
+ }
208
+ export const TOGGLE_LINK_COMMAND = createCommand('TOGGLE_LINK_COMMAND');
209
+ export function $toggleLink(linkAttributes) {
210
+ const selection = $getSelection();
211
+ if (!$isRangeSelection(selection)) {
212
+ return;
213
+ }
214
+ const nodes = selection.extract();
215
+ if (linkAttributes === null) {
216
+ // Remove LinkNodes
217
+ nodes.forEach((node) => {
218
+ const parent = node.getParent();
219
+ if ($isLinkNode(parent)) {
220
+ const children = parent.getChildren();
221
+ for (let i = 0; i < children.length; i += 1) {
222
+ parent.insertBefore(children[i]);
223
+ }
224
+ parent.remove();
225
+ }
226
+ });
227
+ }
228
+ else {
229
+ // Add or merge LinkNodes
230
+ if (nodes.length === 1) {
231
+ const firstNode = nodes[0];
232
+ // if the first node is a LinkNode or if its
233
+ // parent is a LinkNode, we update the URL, target and rel.
234
+ const linkNode = $isLinkNode(firstNode)
235
+ ? firstNode
236
+ : $getLinkAncestor(firstNode);
237
+ if (linkNode !== null) {
238
+ linkNode.setAttributes(linkAttributes);
239
+ if (linkAttributes.text != null && linkAttributes.text !== linkNode.getTextContent()) {
240
+ // remove all children and add child with new textcontent:
241
+ linkNode.append($createTextNode(linkAttributes.text));
242
+ linkNode.getChildren().forEach((child) => {
243
+ if (child !== linkNode.getLastChild()) {
244
+ child.remove();
245
+ }
246
+ });
247
+ }
248
+ return;
249
+ }
250
+ }
251
+ let prevParent = null;
252
+ let linkNode = null;
253
+ nodes.forEach((node) => {
254
+ const parent = node.getParent();
255
+ if (parent === linkNode || parent === null || ($isElementNode(node) && !node.isInline())) {
256
+ return;
257
+ }
258
+ if ($isLinkNode(parent)) {
259
+ linkNode = parent;
260
+ parent.setAttributes(linkAttributes);
261
+ if (linkAttributes.text != null && linkAttributes.text !== parent.getTextContent()) {
262
+ // remove all children and add child with new textcontent:
263
+ parent.append($createTextNode(linkAttributes.text));
264
+ parent.getChildren().forEach((child) => {
265
+ if (child !== parent.getLastChild()) {
266
+ child.remove();
267
+ }
268
+ });
269
+ }
270
+ return;
271
+ }
272
+ if (parent.is(prevParent) === false) {
273
+ prevParent = parent;
274
+ linkNode = $createLinkNode({ attributes: linkAttributes });
275
+ if ($isLinkNode(parent)) {
276
+ if (node.getPreviousSibling() === null) {
277
+ parent.insertBefore(linkNode);
278
+ }
279
+ else {
280
+ parent.insertAfter(linkNode);
281
+ }
282
+ }
283
+ else {
284
+ node.insertBefore(linkNode);
285
+ }
286
+ }
287
+ if ($isLinkNode(node)) {
288
+ if (node.is(linkNode)) {
289
+ return;
290
+ }
291
+ if (linkNode !== null) {
292
+ const children = node.getChildren();
293
+ for (let i = 0; i < children.length; i += 1) {
294
+ linkNode.append(children[i]);
295
+ }
296
+ }
297
+ node.remove();
298
+ return;
299
+ }
300
+ if (linkNode !== null) {
301
+ linkNode.append(node);
302
+ }
303
+ });
304
+ }
305
+ }
306
+ function $getLinkAncestor(node) {
307
+ return $getAncestor(node, (ancestor) => $isLinkNode(ancestor));
308
+ }
309
+ function $getAncestor(node, predicate) {
310
+ let parent = node;
311
+ while (parent !== null) {
312
+ parent = parent.getParent();
313
+ if (parent === null) {
314
+ break;
315
+ }
316
+ if (predicate(parent)) {
317
+ break;
318
+ }
319
+ }
320
+ return parent;
321
+ }
322
+ function manageRel(input, action, value) {
323
+ let result;
324
+ let mutableInput = `${input}`;
325
+ if (action === 'add') {
326
+ // if we somehow got out of sync - clean up
327
+ if (mutableInput.includes(value)) {
328
+ const re = new RegExp(value, 'g');
329
+ mutableInput = mutableInput.replace(re, '').trim();
330
+ }
331
+ mutableInput = mutableInput.trim();
332
+ result = mutableInput.length === 0 ? `${value}` : `${mutableInput} ${value}`;
333
+ }
334
+ else {
335
+ const re = new RegExp(value, 'g');
336
+ result = mutableInput.replace(re, '').trim();
337
+ }
338
+ return result;
339
+ }
340
+ //# sourceMappingURL=link-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-node.js","sourceRoot":"","sources":["../../../../src/field/nodes/link-nodes/link-node.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,aAAa,EAIb,WAAW,GAMZ,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAI7C,oBAAoB;AACpB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC,YAAY,CAAgB;IAE5B,MAAM,CAAC,OAAO;QACZ,OAAO,MAAM,CAAA;IACf,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAc;QACzB,OAAO,IAAI,QAAQ,CAAC;YAClB,UAAU,EAAE,IAAI,CAAC,YAAY;YAC7B,GAAG,EAAE,IAAI,CAAC,KAAK;SAChB,CAAC,CAAA;IACJ,CAAC;IAED,YAAY,EACV,UAAU,GAAG;QACX,GAAG,EAAE,SAAS;QACd,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,IAAI;QACT,QAAQ,EAAE,QAAQ;KACnB,EACD,GAAG,GAIJ;QACC,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,YAAY,GAAG,UAAU,CAAA;IAChC,CAAC;IAED,SAAS,CAAC,MAAoB;QAC5B,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;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