@d4gger/design-system 4.0.0 → 4.0.2

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 (257) hide show
  1. package/dist/_internal/props/propDef.cjs +2 -1
  2. package/dist/_internal/props/propDef.cjs.map +2 -2
  3. package/dist/_internal/props/propDef.d.cts.map +1 -1
  4. package/dist/_internal/props/propDef.d.mts.map +1 -1
  5. package/dist/_internal/props/propDef.d.ts.map +1 -1
  6. package/dist/_internal/props/propDef.js +2 -1
  7. package/dist/_internal/props/propDef.js.map +2 -2
  8. package/dist/brand-effects.css +5 -3
  9. package/dist/components/alert/Alert.cjs +17 -3
  10. package/dist/components/alert/Alert.cjs.map +2 -2
  11. package/dist/components/alert/Alert.d.cts +6 -0
  12. package/dist/components/alert/Alert.d.cts.map +1 -1
  13. package/dist/components/alert/Alert.d.mts +6 -0
  14. package/dist/components/alert/Alert.d.mts.map +1 -1
  15. package/dist/components/alert/Alert.d.ts +6 -0
  16. package/dist/components/alert/Alert.d.ts.map +1 -1
  17. package/dist/components/alert/Alert.js +17 -3
  18. package/dist/components/alert/Alert.js.map +2 -2
  19. package/dist/components/alert.css +74 -5
  20. package/dist/components/bottom-dock.css +8 -0
  21. package/dist/components/bottomDock/BottomDock.cjs +1 -1
  22. package/dist/components/bottomDock/BottomDock.cjs.map +2 -2
  23. package/dist/components/bottomDock/BottomDock.js +1 -1
  24. package/dist/components/bottomDock/BottomDock.js.map +2 -2
  25. package/dist/components/bottomDock/bottomDock.props.cjs +1 -1
  26. package/dist/components/bottomDock/bottomDock.props.cjs.map +2 -2
  27. package/dist/components/bottomDock/bottomDock.props.d.cts +2 -2
  28. package/dist/components/bottomDock/bottomDock.props.d.cts.map +1 -1
  29. package/dist/components/bottomDock/bottomDock.props.d.mts +2 -2
  30. package/dist/components/bottomDock/bottomDock.props.d.mts.map +1 -1
  31. package/dist/components/bottomDock/bottomDock.props.d.ts +2 -2
  32. package/dist/components/bottomDock/bottomDock.props.d.ts.map +1 -1
  33. package/dist/components/bottomDock/bottomDock.props.js +1 -1
  34. package/dist/components/bottomDock/bottomDock.props.js.map +2 -2
  35. package/dist/components/box.css +0 -12
  36. package/dist/components/card.css +1 -1
  37. package/dist/components/collapsible/Collapsible.cjs +10 -0
  38. package/dist/components/collapsible/Collapsible.cjs.map +2 -2
  39. package/dist/components/collapsible/Collapsible.d.cts.map +1 -1
  40. package/dist/components/collapsible/Collapsible.d.mts.map +1 -1
  41. package/dist/components/collapsible/Collapsible.d.ts.map +1 -1
  42. package/dist/components/collapsible/Collapsible.js +10 -0
  43. package/dist/components/collapsible/Collapsible.js.map +2 -2
  44. package/dist/components/config-drawer.css +9 -1
  45. package/dist/components/configDrawer/ConfigDrawer.cjs +1 -0
  46. package/dist/components/configDrawer/ConfigDrawer.cjs.map +2 -2
  47. package/dist/components/configDrawer/ConfigDrawer.d.cts.map +1 -1
  48. package/dist/components/configDrawer/ConfigDrawer.d.mts.map +1 -1
  49. package/dist/components/configDrawer/ConfigDrawer.d.ts.map +1 -1
  50. package/dist/components/configDrawer/ConfigDrawer.js +1 -0
  51. package/dist/components/configDrawer/ConfigDrawer.js.map +2 -2
  52. package/dist/components/dialog.css +1 -1
  53. package/dist/components/drawer.css +4 -2
  54. package/dist/components/environment-ribbon.css +73 -0
  55. package/dist/components/environmentRibbon/EnvironmentRibbon.cjs +69 -0
  56. package/dist/components/environmentRibbon/EnvironmentRibbon.cjs.map +7 -0
  57. package/dist/components/environmentRibbon/EnvironmentRibbon.d.cts +15 -0
  58. package/dist/components/environmentRibbon/EnvironmentRibbon.d.cts.map +1 -0
  59. package/dist/components/environmentRibbon/EnvironmentRibbon.d.mts +15 -0
  60. package/dist/components/environmentRibbon/EnvironmentRibbon.d.mts.map +1 -0
  61. package/dist/components/environmentRibbon/EnvironmentRibbon.d.ts +15 -0
  62. package/dist/components/environmentRibbon/EnvironmentRibbon.d.ts.map +1 -0
  63. package/dist/components/environmentRibbon/EnvironmentRibbon.js +39 -0
  64. package/dist/components/environmentRibbon/EnvironmentRibbon.js.map +7 -0
  65. package/dist/components/environmentRibbon/environmentRibbon.props.cjs +39 -0
  66. package/dist/components/environmentRibbon/environmentRibbon.props.cjs.map +7 -0
  67. package/dist/components/environmentRibbon/environmentRibbon.props.d.cts +18 -0
  68. package/dist/components/environmentRibbon/environmentRibbon.props.d.cts.map +1 -0
  69. package/dist/components/environmentRibbon/environmentRibbon.props.d.mts +18 -0
  70. package/dist/components/environmentRibbon/environmentRibbon.props.d.mts.map +1 -0
  71. package/dist/components/environmentRibbon/environmentRibbon.props.d.ts +18 -0
  72. package/dist/components/environmentRibbon/environmentRibbon.props.d.ts.map +1 -0
  73. package/dist/components/environmentRibbon/environmentRibbon.props.js +19 -0
  74. package/dist/components/environmentRibbon/environmentRibbon.props.js.map +7 -0
  75. package/dist/components/field.css +5 -0
  76. package/dist/components/flex/Flex.cjs +5 -4
  77. package/dist/components/flex/Flex.cjs.map +2 -2
  78. package/dist/components/flex/Flex.d.cts.map +1 -1
  79. package/dist/components/flex/Flex.d.mts.map +1 -1
  80. package/dist/components/flex/Flex.d.ts.map +1 -1
  81. package/dist/components/flex/Flex.js +5 -4
  82. package/dist/components/flex/Flex.js.map +2 -2
  83. package/dist/components/grid/Grid.cjs +5 -5
  84. package/dist/components/grid/Grid.cjs.map +2 -2
  85. package/dist/components/grid/Grid.d.cts.map +1 -1
  86. package/dist/components/grid/Grid.d.mts.map +1 -1
  87. package/dist/components/grid/Grid.d.ts.map +1 -1
  88. package/dist/components/grid/Grid.js +5 -5
  89. package/dist/components/grid/Grid.js.map +2 -2
  90. package/dist/components/icon/Icon.cjs +16 -0
  91. package/dist/components/icon/Icon.cjs.map +2 -2
  92. package/dist/components/icon/Icon.d.cts +25 -1
  93. package/dist/components/icon/Icon.d.cts.map +1 -1
  94. package/dist/components/icon/Icon.d.mts +25 -1
  95. package/dist/components/icon/Icon.d.mts.map +1 -1
  96. package/dist/components/icon/Icon.d.ts +25 -1
  97. package/dist/components/icon/Icon.d.ts.map +1 -1
  98. package/dist/components/icon/Icon.js +21 -0
  99. package/dist/components/icon/Icon.js.map +2 -2
  100. package/dist/components/icon/icons.cjs +12 -0
  101. package/dist/components/icon/icons.cjs.map +2 -2
  102. package/dist/components/icon/icons.d.cts +30 -0
  103. package/dist/components/icon/icons.d.cts.map +1 -1
  104. package/dist/components/icon/icons.d.mts +30 -0
  105. package/dist/components/icon/icons.d.mts.map +1 -1
  106. package/dist/components/icon/icons.d.ts +30 -0
  107. package/dist/components/icon/icons.d.ts.map +1 -1
  108. package/dist/components/icon/icons.js +12 -0
  109. package/dist/components/icon/icons.js.map +2 -2
  110. package/dist/components/index.cjs +1 -0
  111. package/dist/components/index.cjs.map +2 -2
  112. package/dist/components/index.d.cts +1 -0
  113. package/dist/components/index.d.cts.map +1 -1
  114. package/dist/components/index.d.mts +1 -0
  115. package/dist/components/index.d.mts.map +1 -1
  116. package/dist/components/index.d.ts +1 -0
  117. package/dist/components/index.d.ts.map +1 -1
  118. package/dist/components/index.js +1 -0
  119. package/dist/components/index.js.map +2 -2
  120. package/dist/components/input-otp.css +24 -0
  121. package/dist/components/inputOtp/InputOtp.cjs +2 -1
  122. package/dist/components/inputOtp/InputOtp.cjs.map +2 -2
  123. package/dist/components/inputOtp/InputOtp.d.cts +8 -0
  124. package/dist/components/inputOtp/InputOtp.d.cts.map +1 -1
  125. package/dist/components/inputOtp/InputOtp.d.mts +8 -0
  126. package/dist/components/inputOtp/InputOtp.d.mts.map +1 -1
  127. package/dist/components/inputOtp/InputOtp.d.ts +8 -0
  128. package/dist/components/inputOtp/InputOtp.d.ts.map +1 -1
  129. package/dist/components/inputOtp/InputOtp.js +2 -1
  130. package/dist/components/inputOtp/InputOtp.js.map +2 -2
  131. package/dist/components/inputOtp/inputOtp.props.cjs +4 -0
  132. package/dist/components/inputOtp/inputOtp.props.cjs.map +2 -2
  133. package/dist/components/inputOtp/inputOtp.props.d.cts +4 -0
  134. package/dist/components/inputOtp/inputOtp.props.d.cts.map +1 -1
  135. package/dist/components/inputOtp/inputOtp.props.d.mts +4 -0
  136. package/dist/components/inputOtp/inputOtp.props.d.mts.map +1 -1
  137. package/dist/components/inputOtp/inputOtp.props.d.ts +4 -0
  138. package/dist/components/inputOtp/inputOtp.props.d.ts.map +1 -1
  139. package/dist/components/inputOtp/inputOtp.props.js +4 -0
  140. package/dist/components/inputOtp/inputOtp.props.js.map +2 -2
  141. package/dist/components/link.css +21 -0
  142. package/dist/components/notification-center.css +17 -9
  143. package/dist/components/notificationCenter/NotificationCenter.cjs +7 -2
  144. package/dist/components/notificationCenter/NotificationCenter.cjs.map +2 -2
  145. package/dist/components/notificationCenter/NotificationCenter.d.cts +2 -0
  146. package/dist/components/notificationCenter/NotificationCenter.d.cts.map +1 -1
  147. package/dist/components/notificationCenter/NotificationCenter.d.mts +2 -0
  148. package/dist/components/notificationCenter/NotificationCenter.d.mts.map +1 -1
  149. package/dist/components/notificationCenter/NotificationCenter.d.ts +2 -0
  150. package/dist/components/notificationCenter/NotificationCenter.d.ts.map +1 -1
  151. package/dist/components/notificationCenter/NotificationCenter.js +7 -2
  152. package/dist/components/notificationCenter/NotificationCenter.js.map +2 -2
  153. package/dist/components/page-header.css +21 -0
  154. package/dist/components/pageHeader/PageHeader.cjs +10 -2
  155. package/dist/components/pageHeader/PageHeader.cjs.map +2 -2
  156. package/dist/components/pageHeader/PageHeader.d.cts.map +1 -1
  157. package/dist/components/pageHeader/PageHeader.d.mts.map +1 -1
  158. package/dist/components/pageHeader/PageHeader.d.ts.map +1 -1
  159. package/dist/components/pageHeader/PageHeader.js +10 -2
  160. package/dist/components/pageHeader/PageHeader.js.map +2 -2
  161. package/dist/components/pageHeader/pageHeader.props.cjs +7 -1
  162. package/dist/components/pageHeader/pageHeader.props.cjs.map +2 -2
  163. package/dist/components/pageHeader/pageHeader.props.d.cts +5 -0
  164. package/dist/components/pageHeader/pageHeader.props.d.cts.map +1 -1
  165. package/dist/components/pageHeader/pageHeader.props.d.mts +5 -0
  166. package/dist/components/pageHeader/pageHeader.props.d.mts.map +1 -1
  167. package/dist/components/pageHeader/pageHeader.props.d.ts +5 -0
  168. package/dist/components/pageHeader/pageHeader.props.d.ts.map +1 -1
  169. package/dist/components/pageHeader/pageHeader.props.js +7 -1
  170. package/dist/components/pageHeader/pageHeader.props.js.map +2 -2
  171. package/dist/components/rich-text-editor.css +2 -0
  172. package/dist/components/richTextEditor/EditorTools.cjs +98 -44
  173. package/dist/components/richTextEditor/EditorTools.cjs.map +2 -2
  174. package/dist/components/richTextEditor/EditorTools.d.cts +51 -1
  175. package/dist/components/richTextEditor/EditorTools.d.cts.map +1 -1
  176. package/dist/components/richTextEditor/EditorTools.d.mts +51 -1
  177. package/dist/components/richTextEditor/EditorTools.d.mts.map +1 -1
  178. package/dist/components/richTextEditor/EditorTools.d.ts +51 -1
  179. package/dist/components/richTextEditor/EditorTools.d.ts.map +1 -1
  180. package/dist/components/richTextEditor/EditorTools.js +98 -44
  181. package/dist/components/richTextEditor/EditorTools.js.map +2 -2
  182. package/dist/components/richTextEditor/MentionSuggestions.cjs +6 -7
  183. package/dist/components/richTextEditor/MentionSuggestions.cjs.map +2 -2
  184. package/dist/components/richTextEditor/MentionSuggestions.d.cts +3 -1
  185. package/dist/components/richTextEditor/MentionSuggestions.d.cts.map +1 -1
  186. package/dist/components/richTextEditor/MentionSuggestions.d.mts +3 -1
  187. package/dist/components/richTextEditor/MentionSuggestions.d.mts.map +1 -1
  188. package/dist/components/richTextEditor/MentionSuggestions.d.ts +3 -1
  189. package/dist/components/richTextEditor/MentionSuggestions.d.ts.map +1 -1
  190. package/dist/components/richTextEditor/MentionSuggestions.js +6 -7
  191. package/dist/components/richTextEditor/MentionSuggestions.js.map +2 -2
  192. package/dist/components/richTextEditor/RichTextEditor.cjs +17 -10
  193. package/dist/components/richTextEditor/RichTextEditor.cjs.map +3 -3
  194. package/dist/components/richTextEditor/RichTextEditor.d.cts +2 -1
  195. package/dist/components/richTextEditor/RichTextEditor.d.cts.map +1 -1
  196. package/dist/components/richTextEditor/RichTextEditor.d.mts +2 -1
  197. package/dist/components/richTextEditor/RichTextEditor.d.mts.map +1 -1
  198. package/dist/components/richTextEditor/RichTextEditor.d.ts +2 -1
  199. package/dist/components/richTextEditor/RichTextEditor.d.ts.map +1 -1
  200. package/dist/components/richTextEditor/RichTextEditor.js +17 -10
  201. package/dist/components/richTextEditor/RichTextEditor.js.map +3 -3
  202. package/dist/components/segmented-control.css +14 -5
  203. package/dist/components/sidebar/Sidebar.cjs +6 -2
  204. package/dist/components/sidebar/Sidebar.cjs.map +2 -2
  205. package/dist/components/sidebar/Sidebar.d.cts +8 -0
  206. package/dist/components/sidebar/Sidebar.d.cts.map +1 -1
  207. package/dist/components/sidebar/Sidebar.d.mts +8 -0
  208. package/dist/components/sidebar/Sidebar.d.mts.map +1 -1
  209. package/dist/components/sidebar/Sidebar.d.ts +8 -0
  210. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  211. package/dist/components/sidebar/Sidebar.js +6 -2
  212. package/dist/components/sidebar/Sidebar.js.map +2 -2
  213. package/dist/components/sidebar.css +58 -13
  214. package/dist/components.css +1 -0
  215. package/dist/docs/README.md +1 -0
  216. package/dist/docs/component-contract.md +5 -3
  217. package/dist/docs/component-index.json +9 -1
  218. package/dist/docs/components/alert.md +32 -8
  219. package/dist/docs/components/bottom-dock.md +4 -4
  220. package/dist/docs/components/box.md +3 -1
  221. package/dist/docs/components/card.md +1 -1
  222. package/dist/docs/components/collapsible.md +5 -0
  223. package/dist/docs/components/config-drawer.md +3 -1
  224. package/dist/docs/components/dialog.md +1 -1
  225. package/dist/docs/components/environment-ribbon.md +126 -0
  226. package/dist/docs/components/field.md +2 -0
  227. package/dist/docs/components/grid.md +2 -0
  228. package/dist/docs/components/icon.md +1 -0
  229. package/dist/docs/components/input-otp.md +10 -2
  230. package/dist/docs/components/layout-props.md +4 -1
  231. package/dist/docs/components/link.md +4 -0
  232. package/dist/docs/components/notification-center.md +14 -9
  233. package/dist/docs/components/page-header.md +18 -6
  234. package/dist/docs/components/rich-text-editor.md +6 -1
  235. package/dist/docs/components/segmented-control.md +3 -2
  236. package/dist/docs/components/sidebar.md +17 -6
  237. package/dist/docs/consumer-guide.md +11 -4
  238. package/dist/layout/Layout.cjs +13 -9
  239. package/dist/layout/Layout.cjs.map +2 -2
  240. package/dist/layout/Layout.d.cts.map +1 -1
  241. package/dist/layout/Layout.d.mts.map +1 -1
  242. package/dist/layout/Layout.d.ts.map +1 -1
  243. package/dist/layout/Layout.js +13 -9
  244. package/dist/layout/Layout.js.map +2 -2
  245. package/dist/layout/grid-area.cjs +32 -0
  246. package/dist/layout/grid-area.cjs.map +7 -0
  247. package/dist/layout/grid-area.d.cts +12 -0
  248. package/dist/layout/grid-area.d.cts.map +1 -0
  249. package/dist/layout/grid-area.d.mts +12 -0
  250. package/dist/layout/grid-area.d.mts.map +1 -0
  251. package/dist/layout/grid-area.d.ts +12 -0
  252. package/dist/layout/grid-area.d.ts.map +1 -0
  253. package/dist/layout/grid-area.js +12 -0
  254. package/dist/layout/grid-area.js.map +7 -0
  255. package/dist/styles.css +11636 -12164
  256. package/dist/tokens.css +2 -0
  257. package/package.json +1 -1
@@ -58,6 +58,7 @@ declare const RichTextEditor: typeof RichTextEditorRoot & {
58
58
  export { RichTextEditor, RichTextEditorContent, RichTextEditorRoot, RichTextEditorShell, RichTextEditorToolbar, RichTextEditorToolbarButton, createRichTextEditorExtensions };
59
59
  export type { RichTextEditorContentProps, RichTextEditorProps, RichTextEditorShellProps, RichTextEditorToolbarProps, RichTextEditorToolbarButtonProps, RichTextEditorToolbarSlot, RichTextEditorPreset, RichTextEditorExtensionConfig, };
60
60
  export { createVariableExtension, createMentionExtension } from './editorTokens.js';
61
+ export { defaultRichTextEditorLocaleText, resolveRichTextEditorLocaleText } from './EditorTools.js';
61
62
  export type { EditorVariable, EditorMention } from './editorTokens.js';
62
- export type { EditorTool, EditorInsertItem, EditorToolsOptions } from './EditorTools.js';
63
+ export type { EditorTool, EditorInsertItem, EditorToolsOptions, RichTextEditorLocaleText } from './EditorTools.js';
63
64
  //# sourceMappingURL=RichTextEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../../src/components/richTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAA0C,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAI1G,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAA;AAKnI,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpE,KAAK,sBAAsB,GAAG,eAAe,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAC5E,KAAK,6BAA6B,GAAG,eAAe,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAC1F,KAAK,mCAAmC,GAAG,eAAe,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAEtG,KAAK,kCAAkC,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC,CAAA;AACpH,KAAK,yBAAyB,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;AAI/H,KAAK,oBAAoB,GAAG,OAAO,GAAG,SAAS,CAAA;AAC/C,KAAK,6BAA6B,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,UAAU,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAAC,UAAU,CAAC,EAAE,gBAAgB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AAmC;CAAG;AAE1C,QAAA,MAAM,mBAAmB,iGAgCxB,CAAA;AAGD,QAAA,MAAM,2BAA2B,4GA2BhC,CAAA;AAGD,QAAA,MAAM,qBAAqB,mGAQ1B,CAAA;AAGD,QAAA,MAAM,qBAAqB,mGAiC1B,CAAA;AAGD,QAAA,MAAM,kBAAkB,4FAuGvB,CAAA;AAGD,QAAA,MAAM,cAAc,EAAE,OAAO,kBAAkB,GAAG;IAChD,IAAI,EAAE,OAAO,kBAAkB,CAAA;IAC/B,KAAK,EAAE,OAAO,mBAAmB,CAAA;IACjC,OAAO,EAAE,OAAO,qBAAqB,CAAA;IACrC,OAAO,EAAE,OAAO,qBAAqB,CAAA;IACrC,aAAa,EAAE,OAAO,2BAA2B,CAAA;CAOjD,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,CAAA;AAC7K,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,6BAA6B,GAC9B,CAAA;AAED,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAChF,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAA;AAChG,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA"}
@@ -10,8 +10,10 @@ import { Icon } from "../icon/Icon.js";
10
10
  import { Toolbar } from "../toolbar/Toolbar.js";
11
11
  import { createArticleExtensions } from "../articleNodes/articleExtensions.js";
12
12
  import { EditorTools } from "./EditorTools.js";
13
+ import { resolveRichTextEditorLocaleText } from "./EditorTools.js";
13
14
  import { createVariableExtension, createMentionExtension } from "./editorTokens.js";
14
15
  import { createVariableExtension as createVariableExtension2, createMentionExtension as createMentionExtension2 } from "./editorTokens.js";
16
+ import { defaultRichTextEditorLocaleText, resolveRichTextEditorLocaleText as resolveRichTextEditorLocaleText2 } from "./EditorTools.js";
15
17
  import { jsx, jsxs } from "react/jsx-runtime";
16
18
  const defaultRichTextEditorExtensions = [StarterKit];
17
19
  function createRichTextEditorExtensions(config = {}) {
@@ -51,18 +53,19 @@ function getRichTextEditorAttributes(editorOptions) {
51
53
  "data-slot": "rich-text-editor-prosemirror"
52
54
  };
53
55
  }
54
- function getRichTextEditorStatus(editor) {
56
+ function getRichTextEditorStatus(editor, localeText) {
57
+ const locale = resolveRichTextEditorLocaleText(localeText);
55
58
  if (!editor) {
56
- return "Editor loading";
59
+ return locale.loading;
57
60
  }
58
61
  const plainText = editor.getText().trim();
59
62
  if (plainText.length === 0) {
60
- return "Ready to write";
63
+ return locale.empty;
61
64
  }
62
- return `${plainText.length} characters`;
65
+ return locale.characterCount(plainText.length);
63
66
  }
64
67
  const RichTextEditorShell = React.forwardRef(
65
- ({ className: propClassName, disabled = false, editor, placeholder, toolbar, tools, headingLevels, insertItems, variables, mentions, ...props }, forwardedRef) => {
68
+ ({ className: propClassName, disabled = false, editor, placeholder, toolbar, tools, headingLevels, insertItems, variables, mentions, localeText, ...props }, forwardedRef) => {
66
69
  const {
67
70
  asChild: _asChild,
68
71
  className,
@@ -85,9 +88,9 @@ const RichTextEditorShell = React.forwardRef(
85
88
  "data-disabled": disabled ? "true" : void 0,
86
89
  "data-slot": "rich-text-editor",
87
90
  children: [
88
- renderRichTextEditorToolbar(toolbar, editor, disabled, { tools, headingLevels, insertItems, variables, mentions }),
91
+ renderRichTextEditorToolbar(toolbar, editor, disabled, { tools, headingLevels, insertItems, variables, mentions, localeText }),
89
92
  /* @__PURE__ */ jsx(RichTextEditorContent, { editor, placeholder, disabled }),
90
- /* @__PURE__ */ jsx("div", { className: "dsx-rich-text-editor__status", "data-slot": "rich-text-editor-status", children: /* @__PURE__ */ jsx("span", { children: getRichTextEditorStatus(editor) }) })
93
+ /* @__PURE__ */ jsx("div", { className: "dsx-rich-text-editor__status", "data-slot": "rich-text-editor-status", children: /* @__PURE__ */ jsx("span", { children: getRichTextEditorStatus(editor, localeText) }) })
91
94
  ]
92
95
  }
93
96
  );
@@ -122,7 +125,7 @@ const RichTextEditorToolbarButton = React.forwardRef(
122
125
  );
123
126
  RichTextEditorToolbarButton.displayName = "RichTextEditorToolbarButton";
124
127
  const RichTextEditorToolbar = React.forwardRef(
125
- ({ editor, disabled = false, className, tools, headingLevels, insertItems, variables, mentions, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Toolbar, { asChild: true, dir: props.dir === "rtl" || props.dir === "ltr" ? props.dir : void 0, children: /* @__PURE__ */ jsx("div", { ...props, ref: forwardedRef, className: classNames("dsx-rich-text-editor__toolbar", className), "data-disabled": disabled || !editor ? "true" : void 0, "data-slot": "rich-text-editor-toolbar", "aria-label": "Formatting toolbar", children: /* @__PURE__ */ jsx(EditorTools, { editor, disabled: disabled || !editor, tools, headingLevels, insertItems, variables, mentions }) }) })
128
+ ({ editor, disabled = false, className, tools, headingLevels, insertItems, variables, mentions, localeText, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Toolbar, { asChild: true, dir: props.dir === "rtl" || props.dir === "ltr" ? props.dir : void 0, children: /* @__PURE__ */ jsx("div", { ...props, ref: forwardedRef, className: classNames("dsx-rich-text-editor__toolbar", className), "data-disabled": disabled || !editor ? "true" : void 0, "data-slot": "rich-text-editor-toolbar", "aria-label": resolveRichTextEditorLocaleText(localeText).toolbarLabel, children: /* @__PURE__ */ jsx(EditorTools, { editor, disabled: disabled || !editor, tools, headingLevels, insertItems, variables, mentions, localeText }) }) })
126
129
  );
127
130
  RichTextEditorToolbar.displayName = "RichTextEditorToolbar";
128
131
  const RichTextEditorContent = React.forwardRef(
@@ -175,6 +178,7 @@ const RichTextEditorRoot = React.forwardRef(
175
178
  insertItems,
176
179
  variables,
177
180
  mentions,
181
+ localeText,
178
182
  ...props
179
183
  }, forwardedRef) => {
180
184
  const managedContent = isRichTextEditorContent(content) ? content : void 0;
@@ -251,7 +255,8 @@ const RichTextEditorRoot = React.forwardRef(
251
255
  headingLevels,
252
256
  insertItems,
253
257
  variables,
254
- mentions
258
+ mentions,
259
+ localeText
255
260
  }
256
261
  );
257
262
  }
@@ -273,6 +278,8 @@ export {
273
278
  RichTextEditorToolbarButton,
274
279
  createMentionExtension2 as createMentionExtension,
275
280
  createRichTextEditorExtensions,
276
- createVariableExtension2 as createVariableExtension
281
+ createVariableExtension2 as createVariableExtension,
282
+ defaultRichTextEditorLocaleText,
283
+ resolveRichTextEditorLocaleText2 as resolveRichTextEditorLocaleText
277
284
  };
278
285
  //# sourceMappingURL=RichTextEditor.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/richTextEditor/RichTextEditor.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport classNames from 'classnames'\nimport { EditorContent, useEditor, type Content, type Editor, type UseEditorOptions } from '@tiptap/react'\nimport StarterKit from '@tiptap/starter-kit'\n\nimport { extractProps } from '../../_internal/helpers/extractProps'\nimport { richTextEditorContentPropDefs, richTextEditorPropDefs, richTextEditorToolbarButtonPropDefs } from './richTextEditor.props'\nimport { Button } from '../button/Button'\nimport { Icon } from '../icon/Icon'\nimport { Toolbar } from '../toolbar/Toolbar'\nimport { createArticleExtensions } from '../articleNodes/articleExtensions'\nimport { EditorTools, type EditorToolsOptions } from './EditorTools'\nimport { createVariableExtension, createMentionExtension } from './editorTokens'\n\nimport type { GetPropDefTypes } from '../../_internal/props/propDef'\n\ntype RichTextEditorOwnProps = GetPropDefTypes<typeof richTextEditorPropDefs>\ntype RichTextEditorContentOwnProps = GetPropDefTypes<typeof richTextEditorContentPropDefs>\ntype RichTextEditorToolbarButtonOwnProps = GetPropDefTypes<typeof richTextEditorToolbarButtonPropDefs>\n\ntype RichTextEditorManagedEditorOptions = Omit<UseEditorOptions, 'content' | 'editable' | 'extensions' | 'onUpdate'>\ntype RichTextEditorToolbarSlot = React.ReactNode | ((context: { disabled: boolean; editor: Editor | null }) => React.ReactNode)\n\nconst defaultRichTextEditorExtensions: NonNullable<UseEditorOptions['extensions']> = [StarterKit]\n\ntype RichTextEditorPreset = 'basic' | 'article'\ntype RichTextEditorExtensionConfig = Pick<EditorToolsOptions, 'variables' | 'mentions'> & { preset?: RichTextEditorPreset; extensions?: UseEditorOptions['extensions'] }\n\nfunction createRichTextEditorExtensions(config: RichTextEditorExtensionConfig = {}): NonNullable<UseEditorOptions['extensions']> {\n if (config.extensions) return config.extensions\n return [...(config.preset === 'article' ? [StarterKit.configure({ codeBlock: false }), ...createArticleExtensions()] : defaultRichTextEditorExtensions), ...(config.variables ? [createVariableExtension({ variables: config.variables })] : []), ...(config.mentions ? [createMentionExtension({ mentions: config.mentions })] : [])]\n}\n\nfunction isRichTextEditorContent(value: unknown): value is Content {\n return value === null || typeof value === 'string' || typeof value === 'object'\n}\n\nfunction renderRichTextEditorToolbar(toolbar: RichTextEditorToolbarSlot | null | undefined, editor: Editor | null, disabled: boolean, options: EditorToolsOptions) {\n if (toolbar === null) {\n return null\n }\n\n if (typeof toolbar === 'function') {\n return toolbar({ disabled, editor })\n }\n\n if (toolbar !== undefined) {\n return toolbar\n }\n\n return <RichTextEditorToolbar editor={editor} disabled={disabled} {...options} />\n}\n\nfunction getRichTextEditorAttributes(editorOptions?: RichTextEditorManagedEditorOptions): NonNullable<NonNullable<UseEditorOptions['editorProps']>['attributes']> {\n const attributes = editorOptions?.editorProps?.attributes\n if (typeof attributes === 'function') {\n return (state) => {\n const resolved = attributes(state)\n return {\n ...resolved,\n class: classNames('dsx-rich-text-editor__prosemirror', resolved.class),\n 'data-slot': 'rich-text-editor-prosemirror',\n }\n }\n }\n\n return {\n ...attributes,\n class: classNames('dsx-rich-text-editor__prosemirror', attributes?.class),\n 'data-slot': 'rich-text-editor-prosemirror',\n }\n}\n\nfunction getRichTextEditorStatus(editor: Editor | null) {\n if (!editor) {\n return 'Editor loading'\n }\n\n const plainText = editor.getText().trim()\n\n if (plainText.length === 0) {\n return 'Ready to write'\n }\n\n return `${plainText.length} characters`\n}\n\ninterface RichTextEditorProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'content' | 'onUpdate'>,\n RichTextEditorOwnProps, EditorToolsOptions {\n content?: unknown\n editorOptions?: RichTextEditorManagedEditorOptions\n extensions?: UseEditorOptions['extensions']\n onEditorUpdate?: (editor: Editor) => void\n onUpdate?: (content: string) => void\n placeholder?: string\n preset?: RichTextEditorPreset\n serialize?: (editor: Editor) => string\n toolbar?: RichTextEditorToolbarSlot | null\n}\n\ninterface RichTextEditorShellProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, RichTextEditorOwnProps, EditorToolsOptions {\n editor: Editor | null\n placeholder?: string\n toolbar?: RichTextEditorToolbarSlot | null\n}\n\ninterface RichTextEditorToolbarProps extends React.HTMLAttributes<HTMLDivElement>, EditorToolsOptions {\n editor: Editor | null\n disabled?: boolean\n}\n\ninterface RichTextEditorContentProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n RichTextEditorContentOwnProps {\n editor: Editor | null\n placeholder?: string\n}\n\ninterface RichTextEditorToolbarButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n RichTextEditorToolbarButtonOwnProps {}\n\nconst RichTextEditorShell = React.forwardRef<HTMLDivElement, RichTextEditorShellProps>(\n ({ className: propClassName, disabled = false, editor, placeholder, toolbar, tools, headingLevels, insertItems, variables, mentions, ...props }, forwardedRef) => {\n const {\n asChild: _asChild,\n className,\n ...editorProps\n } = extractProps(\n {\n ...props,\n className: propClassName,\n disabled,\n },\n richTextEditorPropDefs,\n )\n\n return (\n <div\n {...editorProps}\n ref={forwardedRef}\n className={classNames('dsx-rich-text-editor', className)}\n aria-disabled={disabled}\n data-disabled={disabled ? 'true' : undefined}\n data-slot=\"rich-text-editor\"\n >\n {renderRichTextEditorToolbar(toolbar, editor, disabled, { tools, headingLevels, insertItems, variables, mentions })}\n <RichTextEditorContent editor={editor} placeholder={placeholder} disabled={disabled} />\n <div className=\"dsx-rich-text-editor__status\" data-slot=\"rich-text-editor-status\">\n <span>{getRichTextEditorStatus(editor)}</span>\n </div>\n </div>\n )\n },\n)\nRichTextEditorShell.displayName = 'RichTextEditorShell'\n\nconst RichTextEditorToolbarButton = React.forwardRef<HTMLButtonElement, RichTextEditorToolbarButtonProps>(\n ({ active = false, className: propClassName, ...props }, forwardedRef) => {\n const { asChild, className, ...buttonProps } = extractProps(\n {\n ...props,\n className: propClassName,\n active,\n },\n richTextEditorToolbarButtonPropDefs,\n )\n\n return (\n <Toolbar.Button asChild disabled={buttonProps.disabled}>\n <Button\n {...buttonProps}\n ref={forwardedRef}\n asChild={asChild}\n variant=\"ghost\"\n size=\"sm\"\n aria-pressed={active}\n data-active={active ? 'true' : undefined}\n data-slot=\"rich-text-editor-toolbar-button\"\n className={classNames('dsx-rich-text-editor__toolbar-button', className)}\n />\n </Toolbar.Button>\n )\n },\n)\nRichTextEditorToolbarButton.displayName = 'RichTextEditorToolbarButton'\n\nconst RichTextEditorToolbar = React.forwardRef<HTMLDivElement, RichTextEditorToolbarProps>(\n ({ editor, disabled = false, className, tools, headingLevels, insertItems, variables, mentions, ...props }, forwardedRef) => (\n <Toolbar asChild dir={props.dir === 'rtl' || props.dir === 'ltr' ? props.dir : undefined}>\n <div {...props} ref={forwardedRef} className={classNames('dsx-rich-text-editor__toolbar', className)} data-disabled={disabled || !editor ? 'true' : undefined} data-slot=\"rich-text-editor-toolbar\" aria-label=\"Formatting toolbar\">\n <EditorTools editor={editor} disabled={disabled || !editor} tools={tools} headingLevels={headingLevels} insertItems={insertItems} variables={variables} mentions={mentions} />\n </div>\n </Toolbar>\n ),\n)\nRichTextEditorToolbar.displayName = 'RichTextEditorToolbar'\n\nconst RichTextEditorContent = React.forwardRef<HTMLDivElement, RichTextEditorContentProps>(\n ({ className: propClassName, disabled = false, editor, placeholder, ...props }, forwardedRef) => {\n const {\n asChild: _asChild,\n className,\n mode: _mode,\n ...contentProps\n } = extractProps(\n {\n ...props,\n className: propClassName,\n disabled,\n },\n richTextEditorContentPropDefs,\n )\n\n return (\n <div\n {...contentProps}\n ref={forwardedRef}\n className={classNames('dsx-rich-text-editor__area', className)}\n data-disabled={disabled ? 'true' : undefined}\n data-slot=\"rich-text-editor-area\"\n >\n {editor?.isEmpty && placeholder ? (\n <div className=\"dsx-rich-text-editor__placeholder\" data-slot=\"rich-text-editor-placeholder\">\n {placeholder}\n </div>\n ) : null}\n <EditorContent editor={editor} className=\"dsx-rich-text-editor__content\" data-slot=\"rich-text-editor-content\" />\n </div>\n )\n },\n)\nRichTextEditorContent.displayName = 'RichTextEditorContent'\n\nconst RichTextEditorRoot = React.forwardRef<HTMLDivElement, RichTextEditorProps>(\n (\n {\n className,\n content = '',\n disabled = false,\n editorOptions,\n extensions,\n onEditorUpdate,\n onUpdate,\n placeholder,\n preset = 'basic',\n serialize,\n toolbar, tools, headingLevels, insertItems, variables, mentions,\n ...props\n },\n forwardedRef,\n ) => {\n const managedContent = isRichTextEditorContent(content) ? content : undefined\n\n const onEditorUpdateRef = React.useRef(onEditorUpdate)\n const onUpdateRef = React.useRef(onUpdate)\n const serializeRef = React.useRef(serialize)\n\n React.useEffect(() => {\n onEditorUpdateRef.current = onEditorUpdate\n onUpdateRef.current = onUpdate\n serializeRef.current = serialize\n })\n\n const registryRef = React.useRef({ variables, mentions })\n registryRef.current = { variables, mentions }\n const hasVariables = variables !== undefined\n const hasMentions = mentions !== undefined\n const managedExtensions = React.useMemo(() => extensions ?? [\n ...createRichTextEditorExtensions({ preset }),\n ...(hasVariables ? [createVariableExtension({ variables: () => registryRef.current.variables ?? [] })] : []),\n ...(hasMentions ? [createMentionExtension({ mentions: () => registryRef.current.mentions ?? [] })] : []),\n ], [extensions, preset, hasVariables, hasMentions])\n\n const editor = useEditor(\n {\n ...editorOptions,\n content: managedContent,\n editable: !disabled,\n extensions: managedExtensions,\n immediatelyRender: false,\n shouldRerenderOnTransaction: true,\n editorProps: {\n ...editorOptions?.editorProps,\n attributes: getRichTextEditorAttributes(editorOptions),\n },\n onUpdate: ({ editor: currentEditor }) => {\n onEditorUpdateRef.current?.(currentEditor)\n onUpdateRef.current?.((serializeRef.current ?? ((editorInstance: Editor) => editorInstance.getHTML()))(currentEditor))\n },\n },\n [editorOptions, managedExtensions],\n )\n\n React.useEffect(() => {\n if (editor && !editor.isDestroyed) editor.view.dispatch(editor.state.tr.setMeta('dsxRegistryRefresh', true))\n }, [editor, variables, mentions])\n\n React.useEffect(() => {\n editor?.setEditable(!disabled)\n }, [disabled, editor])\n\n React.useEffect(() => {\n if (!editor) {\n return\n }\n\n if (managedContent === undefined) {\n return\n }\n\n if (typeof managedContent === 'string') {\n if (editor.getHTML() !== managedContent) {\n editor.commands.setContent(managedContent, { emitUpdate: false })\n }\n\n return\n }\n\n if (JSON.stringify(editor.getJSON()) !== JSON.stringify(managedContent)) {\n editor.commands.setContent(managedContent, { emitUpdate: false })\n }\n }, [editor, managedContent])\n\n return (\n <RichTextEditorShell\n {...props}\n ref={forwardedRef}\n className={className}\n disabled={disabled}\n editor={editor}\n placeholder={placeholder}\n toolbar={toolbar}\n tools={tools} headingLevels={headingLevels} insertItems={insertItems} variables={variables} mentions={mentions}\n />\n )\n },\n)\nRichTextEditorRoot.displayName = 'RichTextEditor'\n\nconst RichTextEditor: typeof RichTextEditorRoot & {\n Root: typeof RichTextEditorRoot\n Shell: typeof RichTextEditorShell\n Toolbar: typeof RichTextEditorToolbar\n Content: typeof RichTextEditorContent\n ToolbarButton: typeof RichTextEditorToolbarButton\n} = Object.assign(RichTextEditorRoot, {\n Root: RichTextEditorRoot,\n Shell: RichTextEditorShell,\n Toolbar: RichTextEditorToolbar,\n Content: RichTextEditorContent,\n ToolbarButton: RichTextEditorToolbarButton,\n})\n\nexport { RichTextEditor, RichTextEditorContent, RichTextEditorRoot, RichTextEditorShell, RichTextEditorToolbar, RichTextEditorToolbarButton, createRichTextEditorExtensions }\nexport type {\n RichTextEditorContentProps,\n RichTextEditorProps,\n RichTextEditorShellProps,\n RichTextEditorToolbarProps,\n RichTextEditorToolbarButtonProps,\n RichTextEditorToolbarSlot,\n RichTextEditorPreset,\n RichTextEditorExtensionConfig,\n}\n\nexport { createVariableExtension, createMentionExtension } from './editorTokens'\nexport type { EditorVariable, EditorMention } from './editorTokens'\nexport type { EditorTool, EditorInsertItem, EditorToolsOptions } from './EditorTools'\n"],
5
- "mappings": ";AAEA,YAAY,WAAW;AACvB,OAAO,gBAAgB;AACvB,SAAS,eAAe,iBAAmE;AAC3F,OAAO,gBAAgB;AAEvB,SAAS,oBAAoB;AAC7B,SAAS,+BAA+B,wBAAwB,2CAA2C;AAC3G,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,+BAA+B;AACxC,SAAS,mBAA4C;AACrD,SAAS,yBAAyB,8BAA8B;AAmWhE,SAAS,2BAAAA,0BAAyB,0BAAAC,+BAA8B;AA7TvD,cAyFH,YAzFG;AA3BT,MAAM,kCAA+E,CAAC,UAAU;AAKhG,SAAS,+BAA+B,SAAwC,CAAC,GAAgD;AAC/H,MAAI,OAAO,WAAY,QAAO,OAAO;AACrC,SAAO,CAAC,GAAI,OAAO,WAAW,YAAY,CAAC,WAAW,UAAU,EAAE,WAAW,MAAM,CAAC,GAAG,GAAG,wBAAwB,CAAC,IAAI,iCAAkC,GAAI,OAAO,YAAY,CAAC,wBAAwB,EAAE,WAAW,OAAO,UAAU,CAAC,CAAC,IAAI,CAAC,GAAI,GAAI,OAAO,WAAW,CAAC,uBAAuB,EAAE,UAAU,OAAO,SAAS,CAAC,CAAC,IAAI,CAAC,CAAE;AACvU;AAEA,SAAS,wBAAwB,OAAkC;AACjE,SAAO,UAAU,QAAQ,OAAO,UAAU,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C,OAAO,YAAa,QAAO,KAAK,SAAS,OAAO,MAAM,GAAG,QAAQ,sBAAsB,IAAI,CAAC;AAAA,IAC7G,GAAG,CAAC,QAAQ,WAAW,QAAQ,CAAC;AAEhC,UAAM,UAAU,MAAM;AACpB,cAAQ,YAAY,CAAC,QAAQ;AAAA,IAC/B,GAAG,CAAC,UAAU,MAAM,CAAC;AAErB,UAAM,UAAU,MAAM;AACpB,UAAI,CAAC,QAAQ;AACX;AAAA,MACF;AAEA,UAAI,mBAAmB,QAAW;AAChC;AAAA,MACF;AAEA,UAAI,OAAO,mBAAmB,UAAU;AACtC,YAAI,OAAO,QAAQ,MAAM,gBAAgB;AACvC,iBAAO,SAAS,WAAW,gBAAgB,EAAE,YAAY,MAAM,CAAC;AAAA,QAClE;AAEA;AAAA,MACF;AAEA,UAAI,KAAK,UAAU,OAAO,QAAQ,CAAC,MAAM,KAAK,UAAU,cAAc,GAAG;AACvE,eAAO,SAAS,WAAW,gBAAgB,EAAE,YAAY,MAAM,CAAC;AAAA,MAClE;AAAA,IACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAAc;AAAA,QAA8B;AAAA,QAA0B;AAAA,QAAsB;AAAA;AAAA,IAC9F;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAEjC,MAAM,iBAMF,OAAO,OAAO,oBAAoB;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,eAAe;AACjB,CAAC;",
6
- "names": ["createVariableExtension", "createMentionExtension"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport classNames from 'classnames'\nimport { EditorContent, useEditor, type Content, type Editor, type UseEditorOptions } from '@tiptap/react'\nimport StarterKit from '@tiptap/starter-kit'\n\nimport { extractProps } from '../../_internal/helpers/extractProps'\nimport { richTextEditorContentPropDefs, richTextEditorPropDefs, richTextEditorToolbarButtonPropDefs } from './richTextEditor.props'\nimport { Button } from '../button/Button'\nimport { Icon } from '../icon/Icon'\nimport { Toolbar } from '../toolbar/Toolbar'\nimport { createArticleExtensions } from '../articleNodes/articleExtensions'\nimport { EditorTools, type EditorToolsOptions } from './EditorTools'\nimport { resolveRichTextEditorLocaleText, type RichTextEditorLocaleText } from './EditorTools'\nimport { createVariableExtension, createMentionExtension } from './editorTokens'\n\nimport type { GetPropDefTypes } from '../../_internal/props/propDef'\n\ntype RichTextEditorOwnProps = GetPropDefTypes<typeof richTextEditorPropDefs>\ntype RichTextEditorContentOwnProps = GetPropDefTypes<typeof richTextEditorContentPropDefs>\ntype RichTextEditorToolbarButtonOwnProps = GetPropDefTypes<typeof richTextEditorToolbarButtonPropDefs>\n\ntype RichTextEditorManagedEditorOptions = Omit<UseEditorOptions, 'content' | 'editable' | 'extensions' | 'onUpdate'>\ntype RichTextEditorToolbarSlot = React.ReactNode | ((context: { disabled: boolean; editor: Editor | null }) => React.ReactNode)\n\nconst defaultRichTextEditorExtensions: NonNullable<UseEditorOptions['extensions']> = [StarterKit]\n\ntype RichTextEditorPreset = 'basic' | 'article'\ntype RichTextEditorExtensionConfig = Pick<EditorToolsOptions, 'variables' | 'mentions'> & { preset?: RichTextEditorPreset; extensions?: UseEditorOptions['extensions'] }\n\nfunction createRichTextEditorExtensions(config: RichTextEditorExtensionConfig = {}): NonNullable<UseEditorOptions['extensions']> {\n if (config.extensions) return config.extensions\n return [...(config.preset === 'article' ? [StarterKit.configure({ codeBlock: false }), ...createArticleExtensions()] : defaultRichTextEditorExtensions), ...(config.variables ? [createVariableExtension({ variables: config.variables })] : []), ...(config.mentions ? [createMentionExtension({ mentions: config.mentions })] : [])]\n}\n\nfunction isRichTextEditorContent(value: unknown): value is Content {\n return value === null || typeof value === 'string' || typeof value === 'object'\n}\n\nfunction renderRichTextEditorToolbar(toolbar: RichTextEditorToolbarSlot | null | undefined, editor: Editor | null, disabled: boolean, options: EditorToolsOptions) {\n if (toolbar === null) {\n return null\n }\n\n if (typeof toolbar === 'function') {\n return toolbar({ disabled, editor })\n }\n\n if (toolbar !== undefined) {\n return toolbar\n }\n\n return <RichTextEditorToolbar editor={editor} disabled={disabled} {...options} />\n}\n\nfunction getRichTextEditorAttributes(editorOptions?: RichTextEditorManagedEditorOptions): NonNullable<NonNullable<UseEditorOptions['editorProps']>['attributes']> {\n const attributes = editorOptions?.editorProps?.attributes\n if (typeof attributes === 'function') {\n return (state) => {\n const resolved = attributes(state)\n return {\n ...resolved,\n class: classNames('dsx-rich-text-editor__prosemirror', resolved.class),\n 'data-slot': 'rich-text-editor-prosemirror',\n }\n }\n }\n\n return {\n ...attributes,\n class: classNames('dsx-rich-text-editor__prosemirror', attributes?.class),\n 'data-slot': 'rich-text-editor-prosemirror',\n }\n}\n\nfunction getRichTextEditorStatus(editor: Editor | null, localeText?: Partial<RichTextEditorLocaleText>) {\n const locale = resolveRichTextEditorLocaleText(localeText)\n if (!editor) {\n return locale.loading\n }\n\n const plainText = editor.getText().trim()\n\n if (plainText.length === 0) {\n return locale.empty\n }\n\n return locale.characterCount(plainText.length)\n}\n\ninterface RichTextEditorProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'content' | 'onUpdate'>,\n RichTextEditorOwnProps, EditorToolsOptions {\n content?: unknown\n editorOptions?: RichTextEditorManagedEditorOptions\n extensions?: UseEditorOptions['extensions']\n onEditorUpdate?: (editor: Editor) => void\n onUpdate?: (content: string) => void\n placeholder?: string\n preset?: RichTextEditorPreset\n serialize?: (editor: Editor) => string\n toolbar?: RichTextEditorToolbarSlot | null\n}\n\ninterface RichTextEditorShellProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, RichTextEditorOwnProps, EditorToolsOptions {\n editor: Editor | null\n placeholder?: string\n toolbar?: RichTextEditorToolbarSlot | null\n}\n\ninterface RichTextEditorToolbarProps extends React.HTMLAttributes<HTMLDivElement>, EditorToolsOptions {\n editor: Editor | null\n disabled?: boolean\n}\n\ninterface RichTextEditorContentProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n RichTextEditorContentOwnProps {\n editor: Editor | null\n placeholder?: string\n}\n\ninterface RichTextEditorToolbarButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n RichTextEditorToolbarButtonOwnProps {}\n\nconst RichTextEditorShell = React.forwardRef<HTMLDivElement, RichTextEditorShellProps>(\n ({ className: propClassName, disabled = false, editor, placeholder, toolbar, tools, headingLevels, insertItems, variables, mentions, localeText, ...props }, forwardedRef) => {\n const {\n asChild: _asChild,\n className,\n ...editorProps\n } = extractProps(\n {\n ...props,\n className: propClassName,\n disabled,\n },\n richTextEditorPropDefs,\n )\n\n return (\n <div\n {...editorProps}\n ref={forwardedRef}\n className={classNames('dsx-rich-text-editor', className)}\n aria-disabled={disabled}\n data-disabled={disabled ? 'true' : undefined}\n data-slot=\"rich-text-editor\"\n >\n {renderRichTextEditorToolbar(toolbar, editor, disabled, { tools, headingLevels, insertItems, variables, mentions, localeText })}\n <RichTextEditorContent editor={editor} placeholder={placeholder} disabled={disabled} />\n <div className=\"dsx-rich-text-editor__status\" data-slot=\"rich-text-editor-status\">\n <span>{getRichTextEditorStatus(editor, localeText)}</span>\n </div>\n </div>\n )\n },\n)\nRichTextEditorShell.displayName = 'RichTextEditorShell'\n\nconst RichTextEditorToolbarButton = React.forwardRef<HTMLButtonElement, RichTextEditorToolbarButtonProps>(\n ({ active = false, className: propClassName, ...props }, forwardedRef) => {\n const { asChild, className, ...buttonProps } = extractProps(\n {\n ...props,\n className: propClassName,\n active,\n },\n richTextEditorToolbarButtonPropDefs,\n )\n\n return (\n <Toolbar.Button asChild disabled={buttonProps.disabled}>\n <Button\n {...buttonProps}\n ref={forwardedRef}\n asChild={asChild}\n variant=\"ghost\"\n size=\"sm\"\n aria-pressed={active}\n data-active={active ? 'true' : undefined}\n data-slot=\"rich-text-editor-toolbar-button\"\n className={classNames('dsx-rich-text-editor__toolbar-button', className)}\n />\n </Toolbar.Button>\n )\n },\n)\nRichTextEditorToolbarButton.displayName = 'RichTextEditorToolbarButton'\n\nconst RichTextEditorToolbar = React.forwardRef<HTMLDivElement, RichTextEditorToolbarProps>(\n ({ editor, disabled = false, className, tools, headingLevels, insertItems, variables, mentions, localeText, ...props }, forwardedRef) => (\n <Toolbar asChild dir={props.dir === 'rtl' || props.dir === 'ltr' ? props.dir : undefined}>\n <div {...props} ref={forwardedRef} className={classNames('dsx-rich-text-editor__toolbar', className)} data-disabled={disabled || !editor ? 'true' : undefined} data-slot=\"rich-text-editor-toolbar\" aria-label={resolveRichTextEditorLocaleText(localeText).toolbarLabel}>\n <EditorTools editor={editor} disabled={disabled || !editor} tools={tools} headingLevels={headingLevels} insertItems={insertItems} variables={variables} mentions={mentions} localeText={localeText} />\n </div>\n </Toolbar>\n ),\n)\nRichTextEditorToolbar.displayName = 'RichTextEditorToolbar'\n\nconst RichTextEditorContent = React.forwardRef<HTMLDivElement, RichTextEditorContentProps>(\n ({ className: propClassName, disabled = false, editor, placeholder, ...props }, forwardedRef) => {\n const {\n asChild: _asChild,\n className,\n mode: _mode,\n ...contentProps\n } = extractProps(\n {\n ...props,\n className: propClassName,\n disabled,\n },\n richTextEditorContentPropDefs,\n )\n\n return (\n <div\n {...contentProps}\n ref={forwardedRef}\n className={classNames('dsx-rich-text-editor__area', className)}\n data-disabled={disabled ? 'true' : undefined}\n data-slot=\"rich-text-editor-area\"\n >\n {editor?.isEmpty && placeholder ? (\n <div className=\"dsx-rich-text-editor__placeholder\" data-slot=\"rich-text-editor-placeholder\">\n {placeholder}\n </div>\n ) : null}\n <EditorContent editor={editor} className=\"dsx-rich-text-editor__content\" data-slot=\"rich-text-editor-content\" />\n </div>\n )\n },\n)\nRichTextEditorContent.displayName = 'RichTextEditorContent'\n\nconst RichTextEditorRoot = React.forwardRef<HTMLDivElement, RichTextEditorProps>(\n (\n {\n className,\n content = '',\n disabled = false,\n editorOptions,\n extensions,\n onEditorUpdate,\n onUpdate,\n placeholder,\n preset = 'basic',\n serialize,\n toolbar, tools, headingLevels, insertItems, variables, mentions, localeText,\n ...props\n },\n forwardedRef,\n ) => {\n const managedContent = isRichTextEditorContent(content) ? content : undefined\n\n const onEditorUpdateRef = React.useRef(onEditorUpdate)\n const onUpdateRef = React.useRef(onUpdate)\n const serializeRef = React.useRef(serialize)\n\n React.useEffect(() => {\n onEditorUpdateRef.current = onEditorUpdate\n onUpdateRef.current = onUpdate\n serializeRef.current = serialize\n })\n\n const registryRef = React.useRef({ variables, mentions })\n registryRef.current = { variables, mentions }\n const hasVariables = variables !== undefined\n const hasMentions = mentions !== undefined\n const managedExtensions = React.useMemo(() => extensions ?? [\n ...createRichTextEditorExtensions({ preset }),\n ...(hasVariables ? [createVariableExtension({ variables: () => registryRef.current.variables ?? [] })] : []),\n ...(hasMentions ? [createMentionExtension({ mentions: () => registryRef.current.mentions ?? [] })] : []),\n ], [extensions, preset, hasVariables, hasMentions])\n\n const editor = useEditor(\n {\n ...editorOptions,\n content: managedContent,\n editable: !disabled,\n extensions: managedExtensions,\n immediatelyRender: false,\n shouldRerenderOnTransaction: true,\n editorProps: {\n ...editorOptions?.editorProps,\n attributes: getRichTextEditorAttributes(editorOptions),\n },\n onUpdate: ({ editor: currentEditor }) => {\n onEditorUpdateRef.current?.(currentEditor)\n onUpdateRef.current?.((serializeRef.current ?? ((editorInstance: Editor) => editorInstance.getHTML()))(currentEditor))\n },\n },\n [editorOptions, managedExtensions],\n )\n\n React.useEffect(() => {\n if (editor && !editor.isDestroyed) editor.view.dispatch(editor.state.tr.setMeta('dsxRegistryRefresh', true))\n }, [editor, variables, mentions])\n\n React.useEffect(() => {\n editor?.setEditable(!disabled)\n }, [disabled, editor])\n\n React.useEffect(() => {\n if (!editor) {\n return\n }\n\n if (managedContent === undefined) {\n return\n }\n\n if (typeof managedContent === 'string') {\n if (editor.getHTML() !== managedContent) {\n editor.commands.setContent(managedContent, { emitUpdate: false })\n }\n\n return\n }\n\n if (JSON.stringify(editor.getJSON()) !== JSON.stringify(managedContent)) {\n editor.commands.setContent(managedContent, { emitUpdate: false })\n }\n }, [editor, managedContent])\n\n return (\n <RichTextEditorShell\n {...props}\n ref={forwardedRef}\n className={className}\n disabled={disabled}\n editor={editor}\n placeholder={placeholder}\n toolbar={toolbar}\n tools={tools} headingLevels={headingLevels} insertItems={insertItems} variables={variables} mentions={mentions} localeText={localeText}\n />\n )\n },\n)\nRichTextEditorRoot.displayName = 'RichTextEditor'\n\nconst RichTextEditor: typeof RichTextEditorRoot & {\n Root: typeof RichTextEditorRoot\n Shell: typeof RichTextEditorShell\n Toolbar: typeof RichTextEditorToolbar\n Content: typeof RichTextEditorContent\n ToolbarButton: typeof RichTextEditorToolbarButton\n} = Object.assign(RichTextEditorRoot, {\n Root: RichTextEditorRoot,\n Shell: RichTextEditorShell,\n Toolbar: RichTextEditorToolbar,\n Content: RichTextEditorContent,\n ToolbarButton: RichTextEditorToolbarButton,\n})\n\nexport { RichTextEditor, RichTextEditorContent, RichTextEditorRoot, RichTextEditorShell, RichTextEditorToolbar, RichTextEditorToolbarButton, createRichTextEditorExtensions }\nexport type {\n RichTextEditorContentProps,\n RichTextEditorProps,\n RichTextEditorShellProps,\n RichTextEditorToolbarProps,\n RichTextEditorToolbarButtonProps,\n RichTextEditorToolbarSlot,\n RichTextEditorPreset,\n RichTextEditorExtensionConfig,\n}\n\nexport { createVariableExtension, createMentionExtension } from './editorTokens'\nexport { defaultRichTextEditorLocaleText, resolveRichTextEditorLocaleText } from './EditorTools'\nexport type { EditorVariable, EditorMention } from './editorTokens'\nexport type { EditorTool, EditorInsertItem, EditorToolsOptions, RichTextEditorLocaleText } from './EditorTools'\n"],
5
+ "mappings": ";AAEA,YAAY,WAAW;AACvB,OAAO,gBAAgB;AACvB,SAAS,eAAe,iBAAmE;AAC3F,OAAO,gBAAgB;AAEvB,SAAS,oB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C;AAAA,MACF;AAEA,UAAI,OAAO,mBAAmB,UAAU;AACtC,YAAI,OAAO,QAAQ,MAAM,gBAAgB;AACvC,iBAAO,SAAS,WAAW,gBAAgB,EAAE,YAAY,MAAM,CAAC;AAAA,QAClE;AAEA;AAAA,MACF;AAEA,UAAI,KAAK,UAAU,OAAO,QAAQ,CAAC,MAAM,KAAK,UAAU,cAAc,GAAG;AACvE,eAAO,SAAS,WAAW,gBAAgB,EAAE,YAAY,MAAM,CAAC;AAAA,MAClE;AAAA,IACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAAc;AAAA,QAA8B;AAAA,QAA0B;AAAA,QAAsB;AAAA,QAAoB;AAAA;AAAA,IAClH;AAAA,EAEJ;AACF;AACA,mBAAmB,cAAc;AAEjC,MAAM,iBAMF,OAAO,OAAO,oBAAoB;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,eAAe;AACjB,CAAC;",
6
+ "names": ["createVariableExtension", "createMentionExtension", "resolveRichTextEditorLocaleText"]
7
7
  }
@@ -30,11 +30,18 @@
30
30
  .dsx-segmented-control:where(.dsx-segmented-control--fill, [data-fill='true']) {
31
31
  width: 100%;
32
32
  align-self: stretch;
33
+ /* The equal share of the row is the visible padding in fill mode, so the segment padding is only the floor between a label and
34
+ the edge of its pill, and it is small (G-28, 2026-10-06). */
35
+ --dsx-segmented-control-item-gutter: var(--dsx-space-xs);
33
36
  }
34
37
 
38
+ /* A segment shares the row equally wherever its label fits and is never narrower than the label: `overflow-wrap: anywhere` is
39
+ inherited from a card and lets an item shrink below its longest word, which broke «Системная» into two lines on every phone
40
+ (G-28, 2026-10-06: 87px at 320, 96px at 360, 106px at 390 against the 126px the word needs). A label that still does not fit
41
+ makes the root scroll (the containment above), never break a word. */
35
42
  .dsx-segmented-control:where(.dsx-segmented-control--fill, [data-fill='true']) .dsx-segmented-control__item {
36
43
  flex: 1 1 0;
37
- min-width: 0;
44
+ min-width: max-content;
38
45
  }
39
46
 
40
47
  /* ---- Disabled root ---- */
@@ -56,7 +63,9 @@
56
63
  otherwise. No effect in roomy containers. */
57
64
  flex-shrink: 0;
58
65
  gap: var(--dsx-space-xs);
59
- padding-inline: var(--dsx-space-md);
66
+ /* `--dsx-segmented-control-item-gutter` is the hook for the inline padding of a segment: unset, each size keeps its own
67
+ (sm, md, lg below). Fill mode and the Preferences drawer's accent row set it (G-28, G-29, 2026-10-06). */
68
+ padding-inline: var(--dsx-segmented-control-item-gutter, var(--dsx-space-md));
60
69
  border: 0;
61
70
  border-radius: max(0px, calc(var(--dsx-grouped-radius, var(--dsx-rounded-md)) - var(--dsx-space-2xs)));
62
71
  background: transparent;
@@ -186,7 +195,7 @@
186
195
 
187
196
  .dsx-segmented-control--sm .dsx-segmented-control__item {
188
197
  min-height: calc(var(--dsx-density-control-height-sm, var(--dsx-size-lg)) - 2 * var(--dsx-boundary-control-width));
189
- padding-inline: var(--dsx-space-sm);
198
+ padding-inline: var(--dsx-segmented-control-item-gutter, var(--dsx-space-sm));
190
199
  font-size: var(--dsx-typography-label-small-font-size);
191
200
  letter-spacing: var(--dsx-typography-label-small-letter-spacing);
192
201
  }
@@ -197,7 +206,7 @@
197
206
 
198
207
  .dsx-segmented-control--md .dsx-segmented-control__item {
199
208
  min-height: calc(var(--dsx-density-control-height, var(--dsx-size-xl)) - 2 * var(--dsx-boundary-control-width));
200
- padding-inline: var(--dsx-space-md);
209
+ padding-inline: var(--dsx-segmented-control-item-gutter, var(--dsx-space-md));
201
210
  }
202
211
 
203
212
  .dsx-segmented-control--lg {
@@ -206,7 +215,7 @@
206
215
 
207
216
  .dsx-segmented-control--lg .dsx-segmented-control__item {
208
217
  min-height: calc(var(--dsx-density-control-height-lg, var(--dsx-size-2xl)) - 2 * var(--dsx-boundary-control-width));
209
- padding-inline: var(--dsx-space-lg);
218
+ padding-inline: var(--dsx-segmented-control-item-gutter, var(--dsx-space-lg));
210
219
  font-size: var(--dsx-typography-label-large-font-size);
211
220
  letter-spacing: var(--dsx-typography-label-large-letter-spacing);
212
221
  }
@@ -167,6 +167,7 @@ function useSidebar() {
167
167
  },
168
168
  isMobile: false,
169
169
  mobile: "none",
170
+ mobileTrigger: true,
170
171
  sidebarId: void 0,
171
172
  collapsible: "offcanvas",
172
173
  manualToggleRef: { current: false },
@@ -255,6 +256,7 @@ const SidebarProvider = React.forwardRef((props, forwardedRef) => {
255
256
  storage = "localStorage",
256
257
  toggleShortcut = true,
257
258
  mobile = "sheet",
259
+ mobileTrigger = true,
258
260
  mobileBreakpoint = 768,
259
261
  collapsible = "offcanvas",
260
262
  variant = "default",
@@ -366,6 +368,7 @@ const SidebarProvider = React.forwardRef((props, forwardedRef) => {
366
368
  setMobileSheetOpen,
367
369
  isMobile: isMobileMode,
368
370
  mobile,
371
+ mobileTrigger,
369
372
  sidebarId,
370
373
  collapsible,
371
374
  manualToggleRef,
@@ -376,7 +379,7 @@ const SidebarProvider = React.forwardRef((props, forwardedRef) => {
376
379
  submenuOpenOnActive,
377
380
  variant: effectiveVariant
378
381
  }),
379
- [effectiveExpanded, persisted.expanded, persisted.setExpanded, effectivePreviewExpanded, canPreview, mobileSheetOpen, isMobileMode, mobile, sidebarId, collapsible, defaultSubmenuMode, submenuOpenOnActive, effectiveVariant]
382
+ [effectiveExpanded, persisted.expanded, persisted.setExpanded, effectivePreviewExpanded, canPreview, mobileSheetOpen, isMobileMode, mobile, mobileTrigger, sidebarId, collapsible, defaultSubmenuMode, submenuOpenOnActive, effectiveVariant]
380
383
  );
381
384
  const nestedCounterRef = React.useRef(0);
382
385
  const desktopChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SidebarNestedContext.Provider, { value: { counter: nestedCounterRef, isActive: nested }, children });
@@ -438,6 +441,7 @@ const SidebarRoot = React.forwardRef((props, forwardedRef) => {
438
441
  },
439
442
  isMobile: false,
440
443
  mobile: "none",
444
+ mobileTrigger: true,
441
445
  sidebarId: void 0,
442
446
  collapsible: "offcanvas",
443
447
  manualToggleRef: { current: false },
@@ -550,7 +554,7 @@ const SidebarRoot = React.forwardRef((props, forwardedRef) => {
550
554
  } = sidebarProps;
551
555
  const isMobileSheetMode = value.isMobile && value.mobile === "sheet";
552
556
  const content = isMobileSheetMode ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(React.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Drawer, { open: value.mobileSheetOpen, onOpenChange: value.setMobileSheetOpen, direction: "left", children: [
553
- !value.mobileSheetOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
557
+ !value.mobileSheetOpen && value.mobileTrigger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
554
558
  "button",
555
559
  {
556
560
  type: "button",