@payloadcms/richtext-lexical 3.0.0-beta.24 → 3.0.0-beta.25

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 (230) hide show
  1. package/dist/exports/components.d.ts +3 -2
  2. package/dist/exports/components.d.ts.map +1 -1
  3. package/dist/exports/components.js +3 -2
  4. package/dist/exports/components.js.map +1 -1
  5. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  6. package/dist/field/features/align/feature.client.js +126 -46
  7. package/dist/field/features/align/feature.client.js.map +1 -1
  8. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  9. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  10. package/dist/field/features/align/{inlineToolbarAlignGroup.js → toolbarAlignGroup.js} +3 -3
  11. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  12. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  13. package/dist/field/features/blockquote/feature.client.js +37 -23
  14. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  15. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  16. package/dist/field/features/blocks/component/index.js +1 -1
  17. package/dist/field/features/blocks/component/index.js.map +1 -1
  18. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  19. package/dist/field/features/blocks/feature.client.js +39 -8
  20. package/dist/field/features/blocks/feature.client.js.map +1 -1
  21. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  22. package/dist/field/features/blocks/populationPromise.js +2 -1
  23. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  24. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  25. package/dist/field/features/format/bold/feature.client.js +23 -19
  26. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  27. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -1
  28. package/dist/field/features/format/inlineCode/feature.client.js +23 -19
  29. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -1
  30. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  31. package/dist/field/features/format/italic/feature.client.js +23 -19
  32. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  33. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  34. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  35. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  36. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  37. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  38. package/dist/field/features/format/strikethrough/feature.client.js +23 -19
  39. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  40. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  41. package/dist/field/features/format/subscript/feature.client.js +23 -19
  42. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  43. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  44. package/dist/field/features/format/superscript/feature.client.js +23 -19
  45. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  46. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  47. package/dist/field/features/format/underline/feature.client.js +23 -19
  48. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  49. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  50. package/dist/field/features/heading/feature.client.js +49 -29
  51. package/dist/field/features/heading/feature.client.js.map +1 -1
  52. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -1
  53. package/dist/field/features/horizontalRule/feature.client.js +27 -4
  54. package/dist/field/features/horizontalRule/feature.client.js.map +1 -1
  55. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  56. package/dist/field/features/indent/feature.client.js +41 -37
  57. package/dist/field/features/indent/feature.client.js.map +1 -1
  58. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  59. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  60. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  61. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  62. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  63. package/dist/field/features/link/feature.client.js +44 -40
  64. package/dist/field/features/link/feature.client.js.map +1 -1
  65. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  66. package/dist/field/features/link/populationPromise.js +2 -1
  67. package/dist/field/features/link/populationPromise.js.map +1 -1
  68. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  69. package/dist/field/features/lists/checklist/feature.client.js +44 -19
  70. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  71. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -1
  72. package/dist/field/features/lists/orderedList/feature.client.js +44 -19
  73. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -1
  74. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -1
  75. package/dist/field/features/lists/unorderedList/feature.client.js +44 -19
  76. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -1
  77. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  78. package/dist/field/features/paragraph/feature.client.js +36 -22
  79. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  80. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  81. package/dist/field/features/relationship/feature.client.js +30 -4
  82. package/dist/field/features/relationship/feature.client.js.map +1 -1
  83. package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
  84. package/dist/field/features/relationship/populationPromise.js +2 -1
  85. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  86. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  87. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  88. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  89. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  90. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  91. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  92. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  93. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  94. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  95. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  96. package/dist/field/features/shared/{inlineToolbar → toolbar}/textDropdownGroup.js +2 -2
  97. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  98. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +6 -0
  99. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  100. package/dist/field/features/toolbars/fixed/Toolbar/index.js +152 -0
  101. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  102. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +81 -0
  103. package/dist/field/features/toolbars/fixed/feature.client.d.ts +3 -0
  104. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  105. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  106. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  107. package/dist/field/features/toolbars/fixed/feature.server.d.ts +3 -0
  108. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  109. package/dist/field/features/toolbars/fixed/feature.server.js +16 -0
  110. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  111. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +6 -0
  112. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  113. package/dist/field/{lexical/plugins → features}/toolbars/inline/Toolbar/index.js +43 -17
  114. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  115. package/dist/field/{lexical/plugins → features}/toolbars/inline/Toolbar/index.scss +3 -8
  116. package/dist/field/features/toolbars/inline/feature.client.d.ts +3 -0
  117. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  118. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  119. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  120. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  121. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  122. package/dist/field/features/toolbars/inline/feature.server.js +16 -0
  123. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  124. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  125. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  126. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarButton/index.js +9 -5
  127. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  128. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
  129. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
  130. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  131. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarDropdown/DropDown.js +14 -64
  132. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  133. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  134. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  135. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +139 -0
  136. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  137. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
  138. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars}/types.d.ts +16 -8
  139. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  140. package/dist/field/features/toolbars/types.js.map +1 -0
  141. package/dist/field/features/types.d.ts +7 -7
  142. package/dist/field/features/types.d.ts.map +1 -1
  143. package/dist/field/features/types.js.map +1 -1
  144. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  145. package/dist/field/features/upload/feature.client.js +29 -4
  146. package/dist/field/features/upload/feature.client.js.map +1 -1
  147. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  148. package/dist/field/features/upload/populationPromise.js +3 -1
  149. package/dist/field/features/upload/populationPromise.js.map +1 -1
  150. package/dist/field/lexical/EditorFocusProvider.d.ts +20 -0
  151. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -0
  152. package/dist/field/lexical/EditorFocusProvider.js +78 -0
  153. package/dist/field/lexical/EditorFocusProvider.js.map +1 -0
  154. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  155. package/dist/field/lexical/LexicalEditor.js +20 -4
  156. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  157. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  158. package/dist/field/lexical/LexicalProvider.js +3 -2
  159. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  160. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +2 -3
  161. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  162. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  163. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  164. package/dist/field/lexical/config/server/default.js +3 -1
  165. package/dist/field/lexical/config/server/default.js.map +1 -1
  166. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +6 -6
  167. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  168. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  169. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  170. package/dist/field/lexical/plugins/SlashMenu/index.js +10 -10
  171. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  172. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  173. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  174. package/dist/field/lexical/ui/icons/Add/index.js +16 -0
  175. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  176. package/dist/index.d.ts +8 -5
  177. package/dist/index.d.ts.map +1 -1
  178. package/dist/index.js +8 -4
  179. package/dist/index.js.map +1 -1
  180. package/dist/populate/populate.d.ts +2 -1
  181. package/dist/populate/populate.d.ts.map +1 -1
  182. package/dist/populate/populate.js +13 -11
  183. package/dist/populate/populate.js.map +1 -1
  184. package/dist/populate/populateLexicalPopulationPromises.d.ts +1 -1
  185. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -1
  186. package/dist/populate/populateLexicalPopulationPromises.js +2 -1
  187. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -1
  188. package/dist/populate/recurseNestedFields.d.ts +2 -1
  189. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  190. package/dist/populate/recurseNestedFields.js +2 -1
  191. package/dist/populate/recurseNestedFields.js.map +1 -1
  192. package/package.json +10 -10
  193. package/dist/field/features/align/inlineToolbarAlignGroup.d.ts +0 -3
  194. package/dist/field/features/align/inlineToolbarAlignGroup.d.ts.map +0 -1
  195. package/dist/field/features/align/inlineToolbarAlignGroup.js.map +0 -1
  196. package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts +0 -3
  197. package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts.map +0 -1
  198. package/dist/field/features/format/shared/inlineToolbarFormatGroup.js +0 -10
  199. package/dist/field/features/format/shared/inlineToolbarFormatGroup.js.map +0 -1
  200. package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts +0 -3
  201. package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts.map +0 -1
  202. package/dist/field/features/indent/inlineToolbarIndentGroup.js +0 -10
  203. package/dist/field/features/indent/inlineToolbarIndentGroup.js.map +0 -1
  204. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts +0 -3
  205. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts.map +0 -1
  206. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js +0 -10
  207. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js.map +0 -1
  208. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts +0 -3
  209. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts.map +0 -1
  210. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.js.map +0 -1
  211. package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts +0 -40
  212. package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts.map +0 -1
  213. package/dist/field/lexical/plugins/toolbars/fixed/types.js.map +0 -1
  214. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts +0 -6
  215. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts.map +0 -1
  216. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.js.map +0 -1
  217. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts +0 -8
  218. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts.map +0 -1
  219. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.js.map +0 -1
  220. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts +0 -17
  221. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts.map +0 -1
  222. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.js.map +0 -1
  223. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts +0 -18
  224. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts.map +0 -1
  225. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js +0 -42
  226. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js.map +0 -1
  227. package/dist/field/lexical/plugins/toolbars/inline/types.d.ts.map +0 -1
  228. package/dist/field/lexical/plugins/toolbars/inline/types.js +0 -3
  229. package/dist/field/lexical/plugins/toolbars/inline/types.js.map +0 -1
  230. /package/dist/field/{lexical/plugins/toolbars/fixed → features/toolbars}/types.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import { recurseNestedFields } from '../../../populate/recurseNestedFields.js';
2
2
  export const blockPopulationPromiseHOC = (props)=>{
3
- const blockPopulationPromise = ({ context, currentDepth, depth, editorPopulationPromises, fieldPromises, findMany, flattenLocales, node, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc })=>{
3
+ const blockPopulationPromise = ({ context, currentDepth, depth, draft, editorPopulationPromises, fieldPromises, findMany, flattenLocales, node, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc })=>{
4
4
  const blockFieldData = node.fields;
5
5
  // find block used in this node
6
6
  const block = props.blocks.find((block)=>block.slug === blockFieldData.blockType);
@@ -22,6 +22,7 @@ export const blockPopulationPromiseHOC = (props)=>{
22
22
  req,
23
23
  showHiddenFields,
24
24
  // The afterReadPromise gets its data from looking for field.name inside the siblingDoc. Thus, here we cannot pass the whole document's siblingDoc, but only the siblingDoc (sibling fields) of the current field.
25
+ draft,
25
26
  siblingDoc: blockFieldData
26
27
  });
27
28
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/blocks/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { BlocksFeatureProps } from './feature.server.js'\nimport type { SerializedBlockNode } from './nodes/BlocksNode.js'\n\nimport { recurseNestedFields } from '../../../populate/recurseNestedFields.js'\n\nexport const blockPopulationPromiseHOC = (\n props: BlocksFeatureProps,\n): PopulationPromise<SerializedBlockNode> => {\n const blockPopulationPromise: PopulationPromise<SerializedBlockNode> = ({\n context,\n currentDepth,\n depth,\n editorPopulationPromises,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) => {\n const blockFieldData = node.fields\n\n // find block used in this node\n const block = props.blocks.find((block) => block.slug === blockFieldData.blockType)\n if (!block || !block?.fields?.length || !blockFieldData) {\n return\n }\n\n recurseNestedFields({\n context,\n currentDepth,\n data: blockFieldData,\n depth,\n editorPopulationPromises,\n fieldPromises,\n fields: block.fields,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n // The afterReadPromise gets its data from looking for field.name inside the siblingDoc. Thus, here we cannot pass the whole document's siblingDoc, but only the siblingDoc (sibling fields) of the current field.\n siblingDoc: blockFieldData,\n })\n }\n\n return blockPopulationPromise\n}\n"],"names":["recurseNestedFields","blockPopulationPromiseHOC","props","blockPopulationPromise","context","currentDepth","depth","editorPopulationPromises","fieldPromises","findMany","flattenLocales","node","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","blockFieldData","fields","block","blocks","find","slug","blockType","length","data"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,mBAAmB,QAAQ,2CAA0C;AAE9E,OAAO,MAAMC,4BAA4B,CACvCC;IAEA,MAAMC,yBAAiE,CAAC,EACtEC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,wBAAwB,EACxBC,aAAa,EACbC,QAAQ,EACRC,cAAc,EACdC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EAChBC,UAAU,EACX;QACC,MAAMC,iBAAiBN,KAAKO,MAAM;QAElC,+BAA+B;QAC/B,MAAMC,QAAQjB,MAAMkB,MAAM,CAACC,IAAI,CAAC,CAACF,QAAUA,MAAMG,IAAI,KAAKL,eAAeM,SAAS;QAClF,IAAI,CAACJ,SAAS,CAACA,OAAOD,QAAQM,UAAU,CAACP,gBAAgB;YACvD;QACF;QAEAjB,oBAAoB;YAClBI;YACAC;YACAoB,MAAMR;YACNX;YACAC;YACAC;YACAU,QAAQC,MAAMD,MAAM;YACpBT;YACAC;YACAE;YACAC;YACAC;YACAC;YACA,kNAAkN;YAClNC,YAAYC;QACd;IACF;IAEA,OAAOd;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/blocks/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { BlocksFeatureProps } from './feature.server.js'\nimport type { SerializedBlockNode } from './nodes/BlocksNode.js'\n\nimport { recurseNestedFields } from '../../../populate/recurseNestedFields.js'\n\nexport const blockPopulationPromiseHOC = (\n props: BlocksFeatureProps,\n): PopulationPromise<SerializedBlockNode> => {\n const blockPopulationPromise: PopulationPromise<SerializedBlockNode> = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) => {\n const blockFieldData = node.fields\n\n // find block used in this node\n const block = props.blocks.find((block) => block.slug === blockFieldData.blockType)\n if (!block || !block?.fields?.length || !blockFieldData) {\n return\n }\n\n recurseNestedFields({\n context,\n currentDepth,\n data: blockFieldData,\n depth,\n editorPopulationPromises,\n fieldPromises,\n fields: block.fields,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n // The afterReadPromise gets its data from looking for field.name inside the siblingDoc. Thus, here we cannot pass the whole document's siblingDoc, but only the siblingDoc (sibling fields) of the current field.\n draft,\n siblingDoc: blockFieldData,\n })\n }\n\n return blockPopulationPromise\n}\n"],"names":["recurseNestedFields","blockPopulationPromiseHOC","props","blockPopulationPromise","context","currentDepth","depth","draft","editorPopulationPromises","fieldPromises","findMany","flattenLocales","node","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","blockFieldData","fields","block","blocks","find","slug","blockType","length","data"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,mBAAmB,QAAQ,2CAA0C;AAE9E,OAAO,MAAMC,4BAA4B,CACvCC;IAEA,MAAMC,yBAAiE,CAAC,EACtEC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,KAAK,EACLC,wBAAwB,EACxBC,aAAa,EACbC,QAAQ,EACRC,cAAc,EACdC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EAChBC,UAAU,EACX;QACC,MAAMC,iBAAiBN,KAAKO,MAAM;QAElC,+BAA+B;QAC/B,MAAMC,QAAQlB,MAAMmB,MAAM,CAACC,IAAI,CAAC,CAACF,QAAUA,MAAMG,IAAI,KAAKL,eAAeM,SAAS;QAClF,IAAI,CAACJ,SAAS,CAACA,OAAOD,QAAQM,UAAU,CAACP,gBAAgB;YACvD;QACF;QAEAlB,oBAAoB;YAClBI;YACAC;YACAqB,MAAMR;YACNZ;YACAE;YACAC;YACAU,QAAQC,MAAMD,MAAM;YACpBT;YACAC;YACAE;YACAC;YACAC;YACAC;YACA,kNAAkN;YAClNT;YACAU,YAAYC;QACd;IACF;IAEA,OAAOf;AACT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/bold/feature.client.tsx"],"names":[],"mappings":";AAoDA,eAAO,MAAM,0BAA0B,+BAA2C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/bold/feature.client.tsx"],"names":[],"mappings":";AA0DA,eAAO,MAAM,0BAA0B,+BAA2C,CAAA"}
@@ -2,8 +2,26 @@
2
2
  import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical';
3
3
  import { BoldIcon } from '../../../lexical/ui/icons/Bold/index.js';
4
4
  import { createClientComponent } from '../../createClientComponent.js';
5
- import { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js';
5
+ import { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js';
6
6
  import { BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE } from './markdownTransformers.js';
7
+ const toolbarGroups = [
8
+ toolbarFormatGroupWithItems([
9
+ {
10
+ ChildComponent: BoldIcon,
11
+ isActive: ({ selection })=>{
12
+ if ($isRangeSelection(selection)) {
13
+ return selection.hasFormat('bold');
14
+ }
15
+ return false;
16
+ },
17
+ key: 'bold',
18
+ onSelect: ({ editor })=>{
19
+ editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold');
20
+ },
21
+ order: 1
22
+ }
23
+ ])
24
+ ];
7
25
  const BoldFeatureClient = (props)=>{
8
26
  return {
9
27
  clientFeatureProps: props,
@@ -18,25 +36,11 @@ const BoldFeatureClient = (props)=>{
18
36
  return {
19
37
  clientFeatureProps: props,
20
38
  markdownTransformers,
39
+ toolbarFixed: {
40
+ groups: toolbarGroups
41
+ },
21
42
  toolbarInline: {
22
- groups: [
23
- inlineToolbarFormatGroupWithItems([
24
- {
25
- ChildComponent: BoldIcon,
26
- isActive: ({ selection })=>{
27
- if ($isRangeSelection(selection)) {
28
- return selection.hasFormat('bold');
29
- }
30
- return false;
31
- },
32
- key: 'bold',
33
- onSelect: ({ editor })=>{
34
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold');
35
- },
36
- order: 1
37
- }
38
- ])
39
- ]
43
+ groups: toolbarGroups
40
44
  }
41
45
  };
42
46
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/bold/feature.client.tsx"],"sourcesContent":["'use client'\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { BoldIcon } from '../../../lexical/ui/icons/Bold/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js'\nimport {\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n} from './markdownTransformers.js'\n\nconst BoldFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: ({ featureProviderMap }) => {\n const markdownTransformers = [BOLD_STAR, BOLD_UNDERSCORE]\n if (featureProviderMap.get('italic')) {\n markdownTransformers.push(BOLD_ITALIC_UNDERSCORE, BOLD_ITALIC_STAR)\n }\n\n return {\n clientFeatureProps: props,\n markdownTransformers,\n toolbarInline: {\n groups: [\n inlineToolbarFormatGroupWithItems([\n {\n ChildComponent: BoldIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('bold')\n }\n return false\n },\n key: 'bold',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')\n },\n order: 1,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const BoldFeatureClientComponent = createClientComponent(BoldFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","BoldIcon","createClientComponent","inlineToolbarFormatGroupWithItems","BOLD_ITALIC_STAR","BOLD_ITALIC_UNDERSCORE","BOLD_STAR","BOLD_UNDERSCORE","BoldFeatureClient","props","clientFeatureProps","feature","featureProviderMap","markdownTransformers","get","push","toolbarInline","groups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","BoldFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAIhE,SAASC,QAAQ,QAAQ,0CAAyC;AAClE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iCAAiC,QAAQ,wCAAuC;AACzF,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,QACV,4BAA2B;AAElC,MAAMC,oBAA8D,CAACC;IACnE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,MAAMC,uBAAuB;gBAACP;gBAAWC;aAAgB;YACzD,IAAIK,mBAAmBE,GAAG,CAAC,WAAW;gBACpCD,qBAAqBE,IAAI,CAACV,wBAAwBD;YACpD;YAEA,OAAO;gBACLM,oBAAoBD;gBACpBI;gBACAG,eAAe;oBACbC,QAAQ;wBACNd,kCAAkC;4BAChC;gCACEe,gBAAgBjB;gCAChBkB,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIrB,kBAAkBqB,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACzB,qBAAqB;gCAC9C;gCACA0B,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,6BAA6BzB,sBAAsBM,mBAAkB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/bold/feature.client.tsx"],"sourcesContent":["'use client'\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { BoldIcon } from '../../../lexical/ui/icons/Bold/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js'\nimport {\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n} from './markdownTransformers.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarFormatGroupWithItems([\n {\n ChildComponent: BoldIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('bold')\n }\n return false\n },\n key: 'bold',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')\n },\n order: 1,\n },\n ]),\n]\n\nconst BoldFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: ({ featureProviderMap }) => {\n const markdownTransformers = [BOLD_STAR, BOLD_UNDERSCORE]\n if (featureProviderMap.get('italic')) {\n markdownTransformers.push(BOLD_ITALIC_UNDERSCORE, BOLD_ITALIC_STAR)\n }\n\n return {\n clientFeatureProps: props,\n markdownTransformers,\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }\n },\n }\n}\n\nexport const BoldFeatureClientComponent = createClientComponent(BoldFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","BoldIcon","createClientComponent","toolbarFormatGroupWithItems","BOLD_ITALIC_STAR","BOLD_ITALIC_UNDERSCORE","BOLD_STAR","BOLD_UNDERSCORE","toolbarGroups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","BoldFeatureClient","props","clientFeatureProps","feature","featureProviderMap","markdownTransformers","get","push","toolbarFixed","groups","toolbarInline","BoldFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAKhE,SAASC,QAAQ,QAAQ,0CAAyC;AAClE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,2BAA2B,QAAQ,kCAAiC;AAC7E,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,QACV,4BAA2B;AAElC,MAAMC,gBAAgC;IACpCL,4BAA4B;QAC1B;YACEM,gBAAgBR;YAChBS,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAIZ,kBAAkBY,YAAY;oBAChC,OAAOA,UAAUC,SAAS,CAAC;gBAC7B;gBACA,OAAO;YACT;YACAC,KAAK;YACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAAChB,qBAAqB;YAC9C;YACAiB,OAAO;QACT;KACD;CACF;AAED,MAAMC,oBAA8D,CAACC;IACnE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,MAAMC,uBAAuB;gBAACjB;gBAAWC;aAAgB;YACzD,IAAIe,mBAAmBE,GAAG,CAAC,WAAW;gBACpCD,qBAAqBE,IAAI,CAACpB,wBAAwBD;YACpD;YAEA,OAAO;gBACLgB,oBAAoBD;gBACpBI;gBACAG,cAAc;oBACZC,QAAQnB;gBACV;gBACAoB,eAAe;oBACbD,QAAQnB;gBACV;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMqB,6BAA6B3B,sBAAsBgB,mBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/inlineCode/feature.client.tsx"],"names":[],"mappings":";AA4CA,eAAO,MAAM,gCAAgC,+BAAiD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/inlineCode/feature.client.tsx"],"names":[],"mappings":";AAkDA,eAAO,MAAM,gCAAgC,+BAAiD,CAAA"}
@@ -2,8 +2,26 @@
2
2
  import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical';
3
3
  import { CodeIcon } from '../../../lexical/ui/icons/Code/index.js';
4
4
  import { createClientComponent } from '../../createClientComponent.js';
5
- import { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js';
5
+ import { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js';
6
6
  import { INLINE_CODE } from './markdownTransformers.js';
7
+ const toolbarGroups = [
8
+ toolbarFormatGroupWithItems([
9
+ {
10
+ ChildComponent: CodeIcon,
11
+ isActive: ({ selection })=>{
12
+ if ($isRangeSelection(selection)) {
13
+ return selection.hasFormat('code');
14
+ }
15
+ return false;
16
+ },
17
+ key: 'inlineCode',
18
+ onSelect: ({ editor })=>{
19
+ editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code');
20
+ },
21
+ order: 7
22
+ }
23
+ ])
24
+ ];
7
25
  const InlineCodeFeatureClient = (props)=>{
8
26
  return {
9
27
  clientFeatureProps: props,
@@ -13,25 +31,11 @@ const InlineCodeFeatureClient = (props)=>{
13
31
  markdownTransformers: [
14
32
  INLINE_CODE
15
33
  ],
34
+ toolbarFixed: {
35
+ groups: toolbarGroups
36
+ },
16
37
  toolbarInline: {
17
- groups: [
18
- inlineToolbarFormatGroupWithItems([
19
- {
20
- ChildComponent: CodeIcon,
21
- isActive: ({ selection })=>{
22
- if ($isRangeSelection(selection)) {
23
- return selection.hasFormat('code');
24
- }
25
- return false;
26
- },
27
- key: 'inlineCode',
28
- onSelect: ({ editor })=>{
29
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code');
30
- },
31
- order: 7
32
- }
33
- ])
34
- ]
38
+ groups: toolbarGroups
35
39
  }
36
40
  };
37
41
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/inlineCode/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { CodeIcon } from '../../../lexical/ui/icons/Code/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js'\nimport { INLINE_CODE } from './markdownTransformers.js'\n\nconst InlineCodeFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n markdownTransformers: [INLINE_CODE],\n\n toolbarInline: {\n groups: [\n inlineToolbarFormatGroupWithItems([\n {\n ChildComponent: CodeIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('code')\n }\n return false\n },\n key: 'inlineCode',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code')\n },\n order: 7,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const InlineCodeFeatureClientComponent = createClientComponent(InlineCodeFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","CodeIcon","createClientComponent","inlineToolbarFormatGroupWithItems","INLINE_CODE","InlineCodeFeatureClient","props","clientFeatureProps","feature","markdownTransformers","toolbarInline","groups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","InlineCodeFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAIhE,SAASC,QAAQ,QAAQ,0CAAyC;AAClE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iCAAiC,QAAQ,wCAAuC;AACzF,SAASC,WAAW,QAAQ,4BAA2B;AAEvD,MAAMC,0BAAoE,CAACC;IACzE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,sBAAsB;oBAACL;iBAAY;gBAEnCM,eAAe;oBACbC,QAAQ;wBACNR,kCAAkC;4BAChC;gCACES,gBAAgBX;gCAChBY,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIf,kBAAkBe,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACnB,qBAAqB;gCAC9C;gCACAoB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,mCAAmCnB,sBAAsBG,yBAAwB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/inlineCode/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { CodeIcon } from '../../../lexical/ui/icons/Code/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js'\nimport { INLINE_CODE } from './markdownTransformers.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarFormatGroupWithItems([\n {\n ChildComponent: CodeIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('code')\n }\n return false\n },\n key: 'inlineCode',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code')\n },\n order: 7,\n },\n ]),\n]\n\nconst InlineCodeFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n markdownTransformers: [INLINE_CODE],\n\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }\n },\n }\n}\n\nexport const InlineCodeFeatureClientComponent = createClientComponent(InlineCodeFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","CodeIcon","createClientComponent","toolbarFormatGroupWithItems","INLINE_CODE","toolbarGroups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","InlineCodeFeatureClient","props","clientFeatureProps","feature","markdownTransformers","toolbarFixed","groups","toolbarInline","InlineCodeFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAKhE,SAASC,QAAQ,QAAQ,0CAAyC;AAClE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,2BAA2B,QAAQ,kCAAiC;AAC7E,SAASC,WAAW,QAAQ,4BAA2B;AAEvD,MAAMC,gBAAgC;IACpCF,4BAA4B;QAC1B;YACEG,gBAAgBL;YAChBM,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAIT,kBAAkBS,YAAY;oBAChC,OAAOA,UAAUC,SAAS,CAAC;gBAC7B;gBACA,OAAO;YACT;YACAC,KAAK;YACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACb,qBAAqB;YAC9C;YACAc,OAAO;QACT;KACD;CACF;AAED,MAAMC,0BAAoE,CAACC;IACzE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,sBAAsB;oBAACf;iBAAY;gBAEnCgB,cAAc;oBACZC,QAAQhB;gBACV;gBACAiB,eAAe;oBACbD,QAAQhB;gBACV;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMkB,mCAAmCrB,sBAAsBa,yBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/italic/feature.client.tsx"],"names":[],"mappings":";AA4CA,eAAO,MAAM,4BAA4B,+BAA6C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/italic/feature.client.tsx"],"names":[],"mappings":";AAkDA,eAAO,MAAM,4BAA4B,+BAA6C,CAAA"}
@@ -2,8 +2,26 @@
2
2
  import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical';
3
3
  import { ItalicIcon } from '../../../lexical/ui/icons/Italic/index.js';
4
4
  import { createClientComponent } from '../../createClientComponent.js';
5
- import { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js';
5
+ import { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js';
6
6
  import { ITALIC_STAR, ITALIC_UNDERSCORE } from './markdownTransformers.js';
7
+ const toolbarGroups = [
8
+ toolbarFormatGroupWithItems([
9
+ {
10
+ ChildComponent: ItalicIcon,
11
+ isActive: ({ selection })=>{
12
+ if ($isRangeSelection(selection)) {
13
+ return selection.hasFormat('italic');
14
+ }
15
+ return false;
16
+ },
17
+ key: 'italic',
18
+ onSelect: ({ editor })=>{
19
+ editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic');
20
+ },
21
+ order: 2
22
+ }
23
+ ])
24
+ ];
7
25
  const ItalicFeatureClient = (props)=>{
8
26
  return {
9
27
  clientFeatureProps: props,
@@ -14,25 +32,11 @@ const ItalicFeatureClient = (props)=>{
14
32
  ITALIC_STAR,
15
33
  ITALIC_UNDERSCORE
16
34
  ],
35
+ toolbarFixed: {
36
+ groups: toolbarGroups
37
+ },
17
38
  toolbarInline: {
18
- groups: [
19
- inlineToolbarFormatGroupWithItems([
20
- {
21
- ChildComponent: ItalicIcon,
22
- isActive: ({ selection })=>{
23
- if ($isRangeSelection(selection)) {
24
- return selection.hasFormat('italic');
25
- }
26
- return false;
27
- },
28
- key: 'italic',
29
- onSelect: ({ editor })=>{
30
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic');
31
- },
32
- order: 2
33
- }
34
- ])
35
- ]
39
+ groups: toolbarGroups
36
40
  }
37
41
  };
38
42
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/italic/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { ItalicIcon } from '../../../lexical/ui/icons/Italic/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js'\nimport { ITALIC_STAR, ITALIC_UNDERSCORE } from './markdownTransformers.js'\n\nconst ItalicFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n\n markdownTransformers: [ITALIC_STAR, ITALIC_UNDERSCORE],\n toolbarInline: {\n groups: [\n inlineToolbarFormatGroupWithItems([\n {\n ChildComponent: ItalicIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('italic')\n }\n return false\n },\n key: 'italic',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')\n },\n order: 2,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const ItalicFeatureClientComponent = createClientComponent(ItalicFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","ItalicIcon","createClientComponent","inlineToolbarFormatGroupWithItems","ITALIC_STAR","ITALIC_UNDERSCORE","ItalicFeatureClient","props","clientFeatureProps","feature","markdownTransformers","toolbarInline","groups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","ItalicFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAIhE,SAASC,UAAU,QAAQ,4CAA2C;AACtE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iCAAiC,QAAQ,wCAAuC;AACzF,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,4BAA2B;AAE1E,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBAEpBG,sBAAsB;oBAACN;oBAAaC;iBAAkB;gBACtDM,eAAe;oBACbC,QAAQ;wBACNT,kCAAkC;4BAChC;gCACEU,gBAAgBZ;gCAChBa,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIhB,kBAAkBgB,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACpB,qBAAqB;gCAC9C;gCACAqB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,+BAA+BpB,sBAAsBI,qBAAoB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/italic/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { ItalicIcon } from '../../../lexical/ui/icons/Italic/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js'\nimport { ITALIC_STAR, ITALIC_UNDERSCORE } from './markdownTransformers.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarFormatGroupWithItems([\n {\n ChildComponent: ItalicIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('italic')\n }\n return false\n },\n key: 'italic',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')\n },\n order: 2,\n },\n ]),\n]\n\nconst ItalicFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n\n markdownTransformers: [ITALIC_STAR, ITALIC_UNDERSCORE],\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }\n },\n }\n}\n\nexport const ItalicFeatureClientComponent = createClientComponent(ItalicFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","ItalicIcon","createClientComponent","toolbarFormatGroupWithItems","ITALIC_STAR","ITALIC_UNDERSCORE","toolbarGroups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","ItalicFeatureClient","props","clientFeatureProps","feature","markdownTransformers","toolbarFixed","groups","toolbarInline","ItalicFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAKhE,SAASC,UAAU,QAAQ,4CAA2C;AACtE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,2BAA2B,QAAQ,kCAAiC;AAC7E,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,4BAA2B;AAE1E,MAAMC,gBAAgC;IACpCH,4BAA4B;QAC1B;YACEI,gBAAgBN;YAChBO,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAIV,kBAAkBU,YAAY;oBAChC,OAAOA,UAAUC,SAAS,CAAC;gBAC7B;gBACA,OAAO;YACT;YACAC,KAAK;YACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACd,qBAAqB;YAC9C;YACAe,OAAO;QACT;KACD;CACF;AAED,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBAEpBG,sBAAsB;oBAAChB;oBAAaC;iBAAkB;gBACtDgB,cAAc;oBACZC,QAAQhB;gBACV;gBACAiB,eAAe;oBACbD,QAAQhB;gBACV;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMkB,+BAA+BtB,sBAAsBc,qBAAoB"}
@@ -0,0 +1,3 @@
1
+ import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js';
2
+ export declare const toolbarFormatGroupWithItems: (items: ToolbarGroupItem[]) => ToolbarGroup;
3
+ //# sourceMappingURL=toolbarFormatGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbarFormatGroup.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/shared/toolbarFormatGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE7E,eAAO,MAAM,2BAA2B,UAAW,gBAAgB,EAAE,KAAG,YAOvE,CAAA"}
@@ -0,0 +1,10 @@
1
+ export const toolbarFormatGroupWithItems = (items)=>{
2
+ return {
3
+ type: 'buttons',
4
+ items,
5
+ key: 'format',
6
+ order: 40
7
+ };
8
+ };
9
+
10
+ //# sourceMappingURL=toolbarFormatGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/format/shared/toolbarFormatGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nexport const toolbarFormatGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'buttons',\n items,\n key: 'format',\n order: 40,\n }\n}\n"],"names":["toolbarFormatGroupWithItems","items","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAEA,OAAO,MAAMA,8BAA8B,CAACC;IAC1C,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/strikethrough/feature.client.tsx"],"names":[],"mappings":";AA4CA,eAAO,MAAM,mCAAmC,+BAAoD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/strikethrough/feature.client.tsx"],"names":[],"mappings":";AAiDA,eAAO,MAAM,mCAAmC,+BAAoD,CAAA"}
@@ -2,8 +2,26 @@
2
2
  import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical';
3
3
  import { StrikethroughIcon } from '../../../lexical/ui/icons/Strikethrough/index.js';
4
4
  import { createClientComponent } from '../../createClientComponent.js';
5
- import { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js';
5
+ import { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js';
6
6
  import { STRIKETHROUGH } from './markdownTransformers.js';
7
+ const toolbarGroups = [
8
+ toolbarFormatGroupWithItems([
9
+ {
10
+ ChildComponent: StrikethroughIcon,
11
+ isActive: ({ selection })=>{
12
+ if ($isRangeSelection(selection)) {
13
+ return selection.hasFormat('strikethrough');
14
+ }
15
+ return false;
16
+ },
17
+ key: 'strikethrough',
18
+ onSelect: ({ editor })=>{
19
+ editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough');
20
+ },
21
+ order: 4
22
+ }
23
+ ])
24
+ ];
7
25
  const StrikethroughFeatureClient = (props)=>{
8
26
  return {
9
27
  clientFeatureProps: props,
@@ -13,25 +31,11 @@ const StrikethroughFeatureClient = (props)=>{
13
31
  markdownTransformers: [
14
32
  STRIKETHROUGH
15
33
  ],
34
+ toolbarFixed: {
35
+ groups: toolbarGroups
36
+ },
16
37
  toolbarInline: {
17
- groups: [
18
- inlineToolbarFormatGroupWithItems([
19
- {
20
- ChildComponent: StrikethroughIcon,
21
- isActive: ({ selection })=>{
22
- if ($isRangeSelection(selection)) {
23
- return selection.hasFormat('strikethrough');
24
- }
25
- return false;
26
- },
27
- key: 'strikethrough',
28
- onSelect: ({ editor })=>{
29
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough');
30
- },
31
- order: 4
32
- }
33
- ])
34
- ]
38
+ groups: toolbarGroups
35
39
  }
36
40
  };
37
41
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/strikethrough/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { StrikethroughIcon } from '../../../lexical/ui/icons/Strikethrough/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js'\nimport { STRIKETHROUGH } from './markdownTransformers.js'\n\nconst StrikethroughFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n\n markdownTransformers: [STRIKETHROUGH],\n toolbarInline: {\n groups: [\n inlineToolbarFormatGroupWithItems([\n {\n ChildComponent: StrikethroughIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('strikethrough')\n }\n return false\n },\n key: 'strikethrough',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough')\n },\n order: 4,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const StrikethroughFeatureClientComponent = createClientComponent(StrikethroughFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","StrikethroughIcon","createClientComponent","inlineToolbarFormatGroupWithItems","STRIKETHROUGH","StrikethroughFeatureClient","props","clientFeatureProps","feature","markdownTransformers","toolbarInline","groups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","StrikethroughFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAIhE,SAASC,iBAAiB,QAAQ,mDAAkD;AACpF,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iCAAiC,QAAQ,wCAAuC;AACzF,SAASC,aAAa,QAAQ,4BAA2B;AAEzD,MAAMC,6BAAuE,CAACC;IAC5E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBAEpBG,sBAAsB;oBAACL;iBAAc;gBACrCM,eAAe;oBACbC,QAAQ;wBACNR,kCAAkC;4BAChC;gCACES,gBAAgBX;gCAChBY,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIf,kBAAkBe,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACnB,qBAAqB;gCAC9C;gCACAoB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,sCAAsCnB,sBAAsBG,4BAA2B"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/strikethrough/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { StrikethroughIcon } from '../../../lexical/ui/icons/Strikethrough/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js'\nimport { STRIKETHROUGH } from './markdownTransformers.js'\n\nconst toolbarGroups = [\n toolbarFormatGroupWithItems([\n {\n ChildComponent: StrikethroughIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('strikethrough')\n }\n return false\n },\n key: 'strikethrough',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough')\n },\n order: 4,\n },\n ]),\n]\n\nconst StrikethroughFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n\n markdownTransformers: [STRIKETHROUGH],\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }\n },\n }\n}\n\nexport const StrikethroughFeatureClientComponent = createClientComponent(StrikethroughFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","StrikethroughIcon","createClientComponent","toolbarFormatGroupWithItems","STRIKETHROUGH","toolbarGroups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","StrikethroughFeatureClient","props","clientFeatureProps","feature","markdownTransformers","toolbarFixed","groups","toolbarInline","StrikethroughFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAIhE,SAASC,iBAAiB,QAAQ,mDAAkD;AACpF,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,2BAA2B,QAAQ,kCAAiC;AAC7E,SAASC,aAAa,QAAQ,4BAA2B;AAEzD,MAAMC,gBAAgB;IACpBF,4BAA4B;QAC1B;YACEG,gBAAgBL;YAChBM,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAIT,kBAAkBS,YAAY;oBAChC,OAAOA,UAAUC,SAAS,CAAC;gBAC7B;gBACA,OAAO;YACT;YACAC,KAAK;YACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACb,qBAAqB;YAC9C;YACAc,OAAO;QACT;KACD;CACF;AAED,MAAMC,6BAAuE,CAACC;IAC5E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBAEpBG,sBAAsB;oBAACf;iBAAc;gBACrCgB,cAAc;oBACZC,QAAQhB;gBACV;gBACAiB,eAAe;oBACbD,QAAQhB;gBACV;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMkB,sCAAsCrB,sBAAsBa,4BAA2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/subscript/feature.client.tsx"],"names":[],"mappings":";AAyCA,eAAO,MAAM,+BAA+B,+BAAgD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/subscript/feature.client.tsx"],"names":[],"mappings":";AA+CA,eAAO,MAAM,+BAA+B,+BAAgD,CAAA"}
@@ -2,32 +2,36 @@
2
2
  import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical';
3
3
  import { SubscriptIcon } from '../../../lexical/ui/icons/Subscript/index.js';
4
4
  import { createClientComponent } from '../../createClientComponent.js';
5
- import { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js';
5
+ import { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js';
6
+ const toolbarGroups = [
7
+ toolbarFormatGroupWithItems([
8
+ {
9
+ ChildComponent: SubscriptIcon,
10
+ isActive: ({ selection })=>{
11
+ if ($isRangeSelection(selection)) {
12
+ return selection.hasFormat('subscript');
13
+ }
14
+ return false;
15
+ },
16
+ key: 'subscript',
17
+ onSelect: ({ editor })=>{
18
+ editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'subscript');
19
+ },
20
+ order: 5
21
+ }
22
+ ])
23
+ ];
6
24
  const SubscriptFeatureClient = (props)=>{
7
25
  return {
8
26
  clientFeatureProps: props,
9
27
  feature: ()=>{
10
28
  return {
11
29
  clientFeatureProps: props,
30
+ toolbarFixed: {
31
+ groups: toolbarGroups
32
+ },
12
33
  toolbarInline: {
13
- groups: [
14
- inlineToolbarFormatGroupWithItems([
15
- {
16
- ChildComponent: SubscriptIcon,
17
- isActive: ({ selection })=>{
18
- if ($isRangeSelection(selection)) {
19
- return selection.hasFormat('subscript');
20
- }
21
- return false;
22
- },
23
- key: 'subscript',
24
- onSelect: ({ editor })=>{
25
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'subscript');
26
- },
27
- order: 5
28
- }
29
- ])
30
- ]
34
+ groups: toolbarGroups
31
35
  }
32
36
  };
33
37
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/subscript/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SubscriptIcon } from '../../../lexical/ui/icons/Subscript/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js'\n\nconst SubscriptFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n toolbarInline: {\n groups: [\n inlineToolbarFormatGroupWithItems([\n {\n ChildComponent: SubscriptIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('subscript')\n }\n return false\n },\n key: 'subscript',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'subscript')\n },\n order: 5,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const SubscriptFeatureClientComponent = createClientComponent(SubscriptFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","SubscriptIcon","createClientComponent","inlineToolbarFormatGroupWithItems","SubscriptFeatureClient","props","clientFeatureProps","feature","toolbarInline","groups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","SubscriptFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAIhE,SAASC,aAAa,QAAQ,+CAA8C;AAC5E,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iCAAiC,QAAQ,wCAAuC;AAEzF,MAAMC,yBAAmE,CAACC;IACxE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,eAAe;oBACbC,QAAQ;wBACNN,kCAAkC;4BAChC;gCACEO,gBAAgBT;gCAChBU,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIb,kBAAkBa,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACjB,qBAAqB;gCAC9C;gCACAkB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,kCAAkCjB,sBAAsBE,wBAAuB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/subscript/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SubscriptIcon } from '../../../lexical/ui/icons/Subscript/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarFormatGroupWithItems([\n {\n ChildComponent: SubscriptIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('subscript')\n }\n return false\n },\n key: 'subscript',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'subscript')\n },\n order: 5,\n },\n ]),\n]\n\nconst SubscriptFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }\n },\n }\n}\n\nexport const SubscriptFeatureClientComponent = createClientComponent(SubscriptFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","SubscriptIcon","createClientComponent","toolbarFormatGroupWithItems","toolbarGroups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","SubscriptFeatureClient","props","clientFeatureProps","feature","toolbarFixed","groups","toolbarInline","SubscriptFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAKhE,SAASC,aAAa,QAAQ,+CAA8C;AAC5E,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,2BAA2B,QAAQ,kCAAiC;AAE7E,MAAMC,gBAAgC;IACpCD,4BAA4B;QAC1B;YACEE,gBAAgBJ;YAChBK,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAIR,kBAAkBQ,YAAY;oBAChC,OAAOA,UAAUC,SAAS,CAAC;gBAC7B;gBACA,OAAO;YACT;YACAC,KAAK;YACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACZ,qBAAqB;YAC9C;YACAa,OAAO;QACT;KACD;CACF;AAED,MAAMC,yBAAmE,CAACC;IACxE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,cAAc;oBACZC,QAAQf;gBACV;gBACAgB,eAAe;oBACbD,QAAQf;gBACV;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMiB,kCAAkCnB,sBAAsBY,wBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/superscript/feature.client.tsx"],"names":[],"mappings":";AAyCA,eAAO,MAAM,iCAAiC,+BAAkD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/superscript/feature.client.tsx"],"names":[],"mappings":";AA+CA,eAAO,MAAM,iCAAiC,+BAAkD,CAAA"}
@@ -2,32 +2,36 @@
2
2
  import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical';
3
3
  import { SuperscriptIcon } from '../../../lexical/ui/icons/Superscript/index.js';
4
4
  import { createClientComponent } from '../../createClientComponent.js';
5
- import { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js';
5
+ import { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js';
6
+ const toolbarGroups = [
7
+ toolbarFormatGroupWithItems([
8
+ {
9
+ ChildComponent: SuperscriptIcon,
10
+ isActive: ({ selection })=>{
11
+ if ($isRangeSelection(selection)) {
12
+ return selection.hasFormat('superscript');
13
+ }
14
+ return false;
15
+ },
16
+ key: 'superscript',
17
+ onSelect: ({ editor })=>{
18
+ editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'superscript');
19
+ },
20
+ order: 6
21
+ }
22
+ ])
23
+ ];
6
24
  const SuperscriptFeatureClient = (props)=>{
7
25
  return {
8
26
  clientFeatureProps: props,
9
27
  feature: ()=>{
10
28
  return {
11
29
  clientFeatureProps: props,
30
+ toolbarFixed: {
31
+ groups: toolbarGroups
32
+ },
12
33
  toolbarInline: {
13
- groups: [
14
- inlineToolbarFormatGroupWithItems([
15
- {
16
- ChildComponent: SuperscriptIcon,
17
- isActive: ({ selection })=>{
18
- if ($isRangeSelection(selection)) {
19
- return selection.hasFormat('superscript');
20
- }
21
- return false;
22
- },
23
- key: 'superscript',
24
- onSelect: ({ editor })=>{
25
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'superscript');
26
- },
27
- order: 6
28
- }
29
- ])
30
- ]
34
+ groups: toolbarGroups
31
35
  }
32
36
  };
33
37
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/superscript/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SuperscriptIcon } from '../../../lexical/ui/icons/Superscript/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js'\n\nconst SuperscriptFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n toolbarInline: {\n groups: [\n inlineToolbarFormatGroupWithItems([\n {\n ChildComponent: SuperscriptIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('superscript')\n }\n return false\n },\n key: 'superscript',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'superscript')\n },\n order: 6,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const SuperscriptFeatureClientComponent = createClientComponent(SuperscriptFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","SuperscriptIcon","createClientComponent","inlineToolbarFormatGroupWithItems","SuperscriptFeatureClient","props","clientFeatureProps","feature","toolbarInline","groups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","SuperscriptFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAIhE,SAASC,eAAe,QAAQ,iDAAgD;AAChF,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iCAAiC,QAAQ,wCAAuC;AAEzF,MAAMC,2BAAqE,CAACC;IAC1E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,eAAe;oBACbC,QAAQ;wBACNN,kCAAkC;4BAChC;gCACEO,gBAAgBT;gCAChBU,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIb,kBAAkBa,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACjB,qBAAqB;gCAC9C;gCACAkB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,oCAAoCjB,sBAAsBE,0BAAyB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/superscript/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SuperscriptIcon } from '../../../lexical/ui/icons/Superscript/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarFormatGroupWithItems([\n {\n ChildComponent: SuperscriptIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('superscript')\n }\n return false\n },\n key: 'superscript',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'superscript')\n },\n order: 6,\n },\n ]),\n]\n\nconst SuperscriptFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }\n },\n }\n}\n\nexport const SuperscriptFeatureClientComponent = createClientComponent(SuperscriptFeatureClient)\n"],"names":["$isRangeSelection","FORMAT_TEXT_COMMAND","SuperscriptIcon","createClientComponent","toolbarFormatGroupWithItems","toolbarGroups","ChildComponent","isActive","selection","hasFormat","key","onSelect","editor","dispatchCommand","order","SuperscriptFeatureClient","props","clientFeatureProps","feature","toolbarFixed","groups","toolbarInline","SuperscriptFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,iBAAiB,EAAEC,mBAAmB,QAAQ,UAAS;AAKhE,SAASC,eAAe,QAAQ,iDAAgD;AAChF,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,2BAA2B,QAAQ,kCAAiC;AAE7E,MAAMC,gBAAgC;IACpCD,4BAA4B;QAC1B;YACEE,gBAAgBJ;YAChBK,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAIR,kBAAkBQ,YAAY;oBAChC,OAAOA,UAAUC,SAAS,CAAC;gBAC7B;gBACA,OAAO;YACT;YACAC,KAAK;YACLC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACZ,qBAAqB;YAC9C;YACAa,OAAO;QACT;KACD;CACF;AAED,MAAMC,2BAAqE,CAACC;IAC1E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,cAAc;oBACZC,QAAQf;gBACV;gBACAgB,eAAe;oBACbD,QAAQf;gBACV;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMiB,oCAAoCnB,sBAAsBY,0BAAyB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/underline/feature.client.tsx"],"names":[],"mappings":";AAyCA,eAAO,MAAM,+BAA+B,+BAAgD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/format/underline/feature.client.tsx"],"names":[],"mappings":";AA+CA,eAAO,MAAM,+BAA+B,+BAAgD,CAAA"}
@@ -2,32 +2,36 @@
2
2
  import { $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical';
3
3
  import { UnderlineIcon } from '../../../lexical/ui/icons/Underline/index.js';
4
4
  import { createClientComponent } from '../../createClientComponent.js';
5
- import { inlineToolbarFormatGroupWithItems } from '../shared/inlineToolbarFormatGroup.js';
5
+ import { toolbarFormatGroupWithItems } from '../shared/toolbarFormatGroup.js';
6
+ const toolbarGroups = [
7
+ toolbarFormatGroupWithItems([
8
+ {
9
+ ChildComponent: UnderlineIcon,
10
+ isActive: ({ selection })=>{
11
+ if ($isRangeSelection(selection)) {
12
+ return selection.hasFormat('underline');
13
+ }
14
+ return false;
15
+ },
16
+ key: 'underline',
17
+ onSelect: ({ editor })=>{
18
+ editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline');
19
+ },
20
+ order: 3
21
+ }
22
+ ])
23
+ ];
6
24
  const UnderlineFeatureClient = (props)=>{
7
25
  return {
8
26
  clientFeatureProps: props,
9
27
  feature: ()=>{
10
28
  return {
11
29
  clientFeatureProps: props,
30
+ toolbarFixed: {
31
+ groups: toolbarGroups
32
+ },
12
33
  toolbarInline: {
13
- groups: [
14
- inlineToolbarFormatGroupWithItems([
15
- {
16
- ChildComponent: UnderlineIcon,
17
- isActive: ({ selection })=>{
18
- if ($isRangeSelection(selection)) {
19
- return selection.hasFormat('underline');
20
- }
21
- return false;
22
- },
23
- key: 'underline',
24
- onSelect: ({ editor })=>{
25
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline');
26
- },
27
- order: 3
28
- }
29
- ])
30
- ]
34
+ groups: toolbarGroups
31
35
  }
32
36
  };
33
37
  }