@erxes/ui 3.3.3-next.4 → 3.3.4

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 (223) hide show
  1. package/chunks/chunk-4EIP6AVX.js +29 -0
  2. package/chunks/chunk-4J36M6XR.js +14 -0
  3. package/chunks/{chunk-OOHRHIWY.js → chunk-4WSQJAH2.js} +1 -1
  4. package/chunks/chunk-7T23XKCT.js +24 -0
  5. package/chunks/chunk-B2WUSPB5.js +50 -0
  6. package/chunks/chunk-B6WEOYCY.js +11 -0
  7. package/chunks/chunk-CAV3X4PT.js +14 -0
  8. package/chunks/chunk-CPF6PSFR.js +56 -0
  9. package/chunks/chunk-EKACQ5FS.js +45 -0
  10. package/chunks/{chunk-RB23BDYH.js → chunk-F2R6ZFEK.js} +1 -1
  11. package/chunks/chunk-I3I7T4UD.js +21 -0
  12. package/chunks/chunk-IJVY23RC.js +20 -0
  13. package/chunks/chunk-IN7H6TNM.js +28 -0
  14. package/chunks/chunk-JWRKTKTI.js +57 -0
  15. package/chunks/chunk-MWRDVBYJ.js +121 -0
  16. package/chunks/{chunk-V7OK6ZT2.js → chunk-O76CR475.js} +1 -1
  17. package/chunks/chunk-QTFBJ6EE.js +31 -0
  18. package/chunks/{chunk-KNEXXBOP.js → chunk-QWNOJAU5.js} +1 -1
  19. package/chunks/{chunk-5UVGUD5O.js → chunk-SN5JDDNY.js} +9 -9
  20. package/chunks/{chunk-5L7RF4AD.js → chunk-TDTZBA63.js} +1345 -1130
  21. package/chunks/chunk-TRZXPKUK.js +17 -0
  22. package/chunks/chunk-Z3U4QH2C.js +9 -0
  23. package/components/choicebox-group.js +73 -59
  24. package/components/collapsible.js +73 -59
  25. package/components/color-picker.js +73 -59
  26. package/components/index.js +73 -59
  27. package/components/multiselect.js +73 -59
  28. package/components/sidebar/context.js +1 -1
  29. package/components/sidebar/menu-sub.js +1 -1
  30. package/components/sidebar/menu.js +1 -1
  31. package/components/sidebar/root.js +1 -1
  32. package/components/sidebar/trigger.js +1 -1
  33. package/components/sidebar.js +3 -3
  34. package/components/string-array.js +3 -1
  35. package/components/upload.js +73 -59
  36. package/constants/SexCodes.js +2 -2
  37. package/constants/index.js +2 -2
  38. package/hooks/index.js +73 -59
  39. package/hooks/use-confirm.js +73 -59
  40. package/hooks/use-cursor-pagination.js +8 -8
  41. package/hooks/use-upload-chunked.js +8 -8
  42. package/hooks/use-upload-new.js +8 -8
  43. package/hooks/use-upload.js +73 -59
  44. package/index.js +121 -107
  45. package/modules/attachments/attachments.js +73 -59
  46. package/modules/attachments/index.js +73 -59
  47. package/modules/blocks/components/BarcodeAttribute.js +73 -59
  48. package/modules/blocks/components/BlockEditor.d.ts +2 -2
  49. package/modules/blocks/components/BlockEditor.js +73 -59
  50. package/modules/blocks/components/BlockEditorReadOnly.js +73 -59
  51. package/modules/blocks/components/CustomFileBlock.js +73 -59
  52. package/modules/blocks/components/CustomImageBlock.js +73 -59
  53. package/modules/blocks/components/CustomVideoBlock.js +8 -8
  54. package/modules/blocks/components/Editor.js +73 -59
  55. package/modules/blocks/components/FontFamilyButton.js +3 -1
  56. package/modules/blocks/components/GalleryBlock.js +73 -59
  57. package/modules/blocks/components/ImageStyleButton.js +73 -59
  58. package/modules/blocks/components/SlashMenu.js +73 -59
  59. package/modules/blocks/components/SuggestionMenu.js +73 -59
  60. package/modules/blocks/components/Toolbar.js +73 -59
  61. package/modules/blocks/components/index.js +73 -59
  62. package/modules/blocks/components/toolbar/ToolbarContents.d.ts +1 -0
  63. package/modules/blocks/components/toolbar/ToolbarContents.js +265 -0
  64. package/modules/blocks/components/toolbar/ToolbarRoot.d.ts +2 -0
  65. package/modules/blocks/components/toolbar/ToolbarRoot.js +10 -0
  66. package/modules/blocks/components/toolbar/buttons/ToolbarButton.d.ts +1 -0
  67. package/modules/blocks/components/toolbar/buttons/ToolbarButton.js +265 -0
  68. package/modules/blocks/components/toolbar/buttons/ToolbarFormattingButton.d.ts +2 -0
  69. package/modules/blocks/components/toolbar/buttons/ToolbarFormattingButton.js +10 -0
  70. package/modules/blocks/components/toolbar/buttons/ToolbarToggle.js +265 -0
  71. package/modules/blocks/components/toolbar/menus/ToolbarMenuDropdown.d.ts +2 -0
  72. package/modules/blocks/components/toolbar/menus/ToolbarMenuDropdown.js +10 -0
  73. package/modules/blocks/components/toolbar/menus/ToolbarMenuItem.d.ts +2 -0
  74. package/modules/blocks/components/toolbar/menus/ToolbarMenuItem.js +265 -0
  75. package/modules/blocks/components/toolbar/menus/ToolbarSelect.d.ts +2 -0
  76. package/modules/blocks/components/toolbar/menus/ToolbarSelect.js +265 -0
  77. package/modules/blocks/constant/blockEditorSchema.d.ts +9 -7
  78. package/modules/blocks/constant/blockEditorSchema.js +73 -59
  79. package/modules/blocks/constant/index.js +73 -59
  80. package/modules/blocks/constant/toolbar/codeIncompatibleControls.d.ts +1 -0
  81. package/modules/blocks/constant/toolbar/codeIncompatibleControls.js +6 -0
  82. package/modules/blocks/constant/toolbar/editorUIComponents.js +263 -0
  83. package/modules/blocks/constant/toolbar/fontFamilies.d.ts +4 -0
  84. package/modules/blocks/constant/toolbar/fontFamilies.js +6 -0
  85. package/modules/blocks/constant/toolbar/imageStyleOptions.d.ts +2 -0
  86. package/modules/blocks/constant/toolbar/imageStyleOptions.js +6 -0
  87. package/modules/blocks/hooks/toolbar/useCodeActive.d.ts +1 -0
  88. package/modules/blocks/hooks/toolbar/useCodeActive.js +7 -0
  89. package/modules/blocks/hooks/toolbar/useFontFamily.d.ts +2 -0
  90. package/modules/blocks/hooks/toolbar/useFontFamily.js +7 -0
  91. package/modules/blocks/hooks/toolbar/useToolbarComponents.d.ts +2 -0
  92. package/modules/blocks/hooks/toolbar/useToolbarComponents.js +264 -0
  93. package/modules/blocks/hooks/useBlockEditor.d.ts +1 -1
  94. package/modules/blocks/hooks/useBlockEditor.js +73 -59
  95. package/modules/blocks/index.js +73 -59
  96. package/modules/blocks/types/EditorBlock.d.ts +2 -0
  97. package/modules/blocks/types/EditorBlock.js +0 -0
  98. package/modules/blocks/types/TextEditor.d.ts +2 -1
  99. package/modules/blocks/types/toolbar/EditorVisibleBounds.d.ts +6 -0
  100. package/modules/blocks/types/toolbar/EditorVisibleBounds.js +0 -0
  101. package/modules/blocks/types/toolbar/FontFamily.d.ts +5 -0
  102. package/modules/blocks/types/toolbar/FontFamily.js +0 -0
  103. package/modules/blocks/types/toolbar/FormattingShortcut.d.ts +7 -0
  104. package/modules/blocks/types/toolbar/FormattingShortcut.js +0 -0
  105. package/modules/blocks/types/toolbar/ImageStyleOption.d.ts +7 -0
  106. package/modules/blocks/types/toolbar/ImageStyleOption.js +0 -0
  107. package/modules/blocks/types/toolbar/ToolbarFormattingButtonProps.d.ts +5 -0
  108. package/modules/blocks/types/toolbar/ToolbarFormattingButtonProps.js +0 -0
  109. package/modules/blocks/types/toolbar/ToolbarMenuItemProps.d.ts +4 -0
  110. package/modules/blocks/types/toolbar/ToolbarMenuItemProps.js +0 -0
  111. package/modules/blocks/types/toolbar/ToolbarPositioningOptions.d.ts +3 -0
  112. package/modules/blocks/types/toolbar/ToolbarPositioningOptions.js +0 -0
  113. package/modules/blocks/utils/getSlashMenuItems.d.ts +3 -0
  114. package/modules/blocks/utils/getSlashMenuItems.js +8 -0
  115. package/modules/blocks/utils/isEmptyBlock.d.ts +2 -0
  116. package/modules/blocks/utils/isEmptyBlock.js +6 -0
  117. package/modules/blocks/utils/removeCodeFormattingFromHTML.d.ts +1 -0
  118. package/modules/blocks/utils/removeCodeFormattingFromHTML.js +6 -0
  119. package/modules/blocks/utils/toolbar/getEditorVisibleBounds.d.ts +2 -0
  120. package/modules/blocks/utils/toolbar/getEditorVisibleBounds.js +6 -0
  121. package/modules/blocks/utils/toolbar/getToolbarPositioning.d.ts +2 -0
  122. package/modules/blocks/utils/toolbar/getToolbarPositioning.js +7 -0
  123. package/modules/blocks/utils/toolbar/isCodeFormattingShortcut.d.ts +2 -0
  124. package/modules/blocks/utils/toolbar/isCodeFormattingShortcut.js +6 -0
  125. package/modules/board/components/Board.js +73 -59
  126. package/modules/board/index.js +73 -59
  127. package/modules/chat-viz/components/ChatVizArea.js +2 -2
  128. package/modules/chat-viz/components/ChatVizBar.js +2 -2
  129. package/modules/chat-viz/components/ChatVizLine.js +2 -2
  130. package/modules/chat-viz/components/ChatVizMessage.js +7 -7
  131. package/modules/chat-viz/index.js +19 -19
  132. package/modules/display/components/CurrencyDisplay.js +8 -8
  133. package/modules/display/components/EmailDisplay.d.ts +2 -2
  134. package/modules/display/components/EmailDisplay.js +73 -59
  135. package/modules/display/components/PhoneDisplay.js +73 -59
  136. package/modules/display/components/RelativeDateDisplay.js +73 -59
  137. package/modules/display/components/SexDisplay.js +2 -2
  138. package/modules/display/index.js +75 -61
  139. package/modules/display/types/emailDisplay.d.ts +6 -0
  140. package/modules/display/types/emailDisplay.js +0 -0
  141. package/modules/display/utils/formatPhones.js +2 -2
  142. package/modules/email-editor/components/EmailEditor.js +73 -59
  143. package/modules/email-editor/components/EmailPreviewDeviceToggle.js +73 -59
  144. package/modules/email-editor/components/EmailTableBackground.js +73 -59
  145. package/modules/email-editor/components/EmailTableToolbar.js +73 -59
  146. package/modules/email-editor/components/index.js +74 -60
  147. package/modules/email-editor/index.js +76 -62
  148. package/modules/filter/components/Filter.js +73 -59
  149. package/modules/filter/date-filter/components/DateFilterCommand.js +73 -59
  150. package/modules/filter/date-filter/components/DialogDateView.js +73 -59
  151. package/modules/filter/date-filter/index.js +73 -59
  152. package/modules/filter/date-filter/utils/parseDateRangeFromString.js +8 -8
  153. package/modules/filter/index.js +73 -59
  154. package/modules/focus-sheet/components/focus-sheet.js +73 -59
  155. package/modules/hotkey/components/PopoverScoped.js +73 -59
  156. package/modules/hotkey/hooks/usePreviousHotkeyScope.js +2 -2
  157. package/modules/hotkey/hooks/useSequenceHotkeys.js +4 -4
  158. package/modules/hotkey/index.js +73 -59
  159. package/modules/icons/components/IconPicker.js +73 -59
  160. package/modules/icons/index.js +73 -59
  161. package/modules/index.js +101 -87
  162. package/modules/inputs/components/CurrencyField.js +73 -59
  163. package/modules/inputs/components/EmailField.js +73 -59
  164. package/modules/inputs/components/FullNameField.js +73 -59
  165. package/modules/inputs/components/LanguageSelect.js +73 -59
  166. package/modules/inputs/components/PhoneField.js +73 -59
  167. package/modules/inputs/components/SexField.js +73 -59
  168. package/modules/inputs/components/TimezoneSelect.js +73 -59
  169. package/modules/inputs/index.js +75 -61
  170. package/modules/layout/components/AppLayout.js +4 -4
  171. package/modules/layout/index.js +4 -4
  172. package/modules/navigation-menu/components/NavigationMenu.js +73 -59
  173. package/modules/navigation-menu/index.js +75 -61
  174. package/modules/preview/components/Preview.js +73 -59
  175. package/modules/record-field/components/NumberField.js +73 -59
  176. package/modules/record-field/components/TextField.js +73 -59
  177. package/modules/record-field/index.js +73 -59
  178. package/modules/record-field/meta-inputs/components/EmailVerificationInput.js +73 -59
  179. package/modules/record-field/meta-inputs/components/PhoneInput.js +73 -59
  180. package/modules/record-field/meta-inputs/components/PhoneVerificationInput.js +73 -59
  181. package/modules/record-field/meta-inputs/components/TextFieldInput.js +73 -59
  182. package/modules/record-table/components/MoreColumn.js +73 -59
  183. package/modules/record-table/components/RecordTableArrowEffect.js +73 -59
  184. package/modules/record-table/components/RecordTableCell.js +73 -59
  185. package/modules/record-table/components/RecordTableCellInline.js +73 -59
  186. package/modules/record-table/components/RecordTableColumnSelector.js +73 -59
  187. package/modules/record-table/components/RecordTableCursor.js +73 -59
  188. package/modules/record-table/components/RecordTableHead.js +73 -59
  189. package/modules/record-table/components/RecordTableHeader.js +73 -59
  190. package/modules/record-table/components/RecordTableHotkeyCell.js +73 -59
  191. package/modules/record-table/components/RecordTableProvider.js +2 -2
  192. package/modules/record-table/components/RecordTableRoot.js +73 -59
  193. package/modules/record-table/components/RecordTableRow.js +73 -59
  194. package/modules/record-table/components/RecordTableRowList.js +73 -59
  195. package/modules/record-table/components/RecordTableRowSkeleton.js +73 -59
  196. package/modules/record-table/components/RecordTableScroll.js +73 -59
  197. package/modules/record-table/components/RecordTableTree.js +73 -59
  198. package/modules/record-table/contexts/RecordTableHotkeyContext.js +73 -59
  199. package/modules/record-table/hooks/usePopoverOnEnter.js +73 -59
  200. package/modules/record-table/index.js +74 -60
  201. package/modules/report/components/report-page-container.js +73 -59
  202. package/modules/report/index.js +73 -59
  203. package/modules/select-operation/components/SelectOperation.js +73 -59
  204. package/modules/select-operation/index.js +73 -59
  205. package/modules/select-tree/components/SelectTree.js +73 -59
  206. package/modules/select-tree/hooks/useSelectTreeHide.js +2 -2
  207. package/modules/select-tree/index.js +73 -59
  208. package/modules/side-menu/components/SideMenu.js +73 -59
  209. package/package.json +10 -2
  210. package/styles.css +1 -1
  211. package/types/index.js +4 -4
  212. package/utils/core.js +8 -8
  213. package/utils/index.js +26 -26
  214. package/utils/localization/index.js +3 -3
  215. package/LICENSE.md +0 -672
  216. package/chunks/chunk-AHUBVFX5.js +0 -63
  217. package/chunks/chunk-YYNRA3GZ.js +0 -104
  218. package/chunks/{chunk-UQJA4TBO.js → chunk-AQEBKBOC.js} +3 -3
  219. package/chunks/{chunk-XREHNAPK.js → chunk-MBEYRZZN.js} +3 -3
  220. package/chunks/{chunk-2G6X7LOG.js → chunk-MSSVDJPS.js} +3 -3
  221. package/chunks/{chunk-XDSYT6EE.js → chunk-R7LIWID7.js} +3 -3
  222. package/chunks/{chunk-NLPBCYLN.js → chunk-RGR6MIXH.js} +3 -3
  223. package/chunks/{chunk-2RKVJ44N.js → chunk-UXDXIN6Q.js} +3 -3
@@ -0,0 +1,29 @@
1
+ // src/modules/blocks/utils/toolbar/getEditorVisibleBounds.ts
2
+ var getEditorVisibleBounds = (editor) => {
3
+ const bounds = editor.getBoundingClientRect();
4
+ let top = 0;
5
+ let bottom = window.innerHeight;
6
+ let left = Math.max(0, bounds.left);
7
+ let right = Math.min(window.innerWidth, bounds.right);
8
+ for (let parent = editor.parentElement; parent; parent = parent.parentElement) {
9
+ const style = getComputedStyle(parent);
10
+ const clipsY = /(auto|scroll|hidden|clip)/.test(style.overflowY);
11
+ const clipsX = /(auto|scroll|hidden|clip)/.test(style.overflowX);
12
+ if (!clipsY && !clipsX)
13
+ continue;
14
+ const rect = parent.getBoundingClientRect();
15
+ if (clipsY) {
16
+ top = Math.max(top, rect.top);
17
+ bottom = Math.min(bottom, rect.bottom);
18
+ }
19
+ if (clipsX) {
20
+ left = Math.max(left, rect.left);
21
+ right = Math.min(right, rect.right);
22
+ }
23
+ }
24
+ return { top, bottom, left, right };
25
+ };
26
+
27
+ export {
28
+ getEditorVisibleBounds
29
+ };
@@ -0,0 +1,14 @@
1
+ // src/modules/blocks/utils/removeCodeFormattingFromHTML.ts
2
+ var removeCodeFormattingFromHTML = (html) => {
3
+ const template = document.createElement("template");
4
+ template.innerHTML = html;
5
+ template.content.querySelectorAll("code").forEach((code) => {
6
+ code.replaceChildren(document.createTextNode(code.textContent ?? ""));
7
+ code.removeAttribute("class");
8
+ });
9
+ return template.innerHTML;
10
+ };
11
+
12
+ export {
13
+ removeCodeFormattingFromHTML
14
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Sidebar
3
- } from "./chunk-KNEXXBOP.js";
3
+ } from "./chunk-QWNOJAU5.js";
4
4
  import {
5
5
  Separator
6
6
  } from "./chunk-A6ID2P5A.js";
@@ -0,0 +1,24 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-KTBDECJI.js";
4
+
5
+ // src/modules/blocks/components/toolbar/menus/ToolbarMenuDropdown.tsx
6
+ import { components } from "@blocknote/shadcn";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var ToolbarMenuDropdown = ({
9
+ className,
10
+ ...props
11
+ }) => /* @__PURE__ */ jsx(
12
+ components.Generic.Menu.Dropdown,
13
+ {
14
+ ...props,
15
+ className: cn(
16
+ "max-h-[min(20rem,50dvh)]! overflow-y-auto! overscroll-contain",
17
+ className
18
+ )
19
+ }
20
+ );
21
+
22
+ export {
23
+ ToolbarMenuDropdown
24
+ };
@@ -0,0 +1,50 @@
1
+ import {
2
+ FONT_FAMILIES
3
+ } from "./chunk-IN7H6TNM.js";
4
+ import {
5
+ useFontFamily
6
+ } from "./chunk-EKACQ5FS.js";
7
+
8
+ // src/modules/blocks/components/FontFamilyButton.tsx
9
+ import { useComponentsContext } from "@blocknote/react";
10
+ import { IconTypography } from "@tabler/icons-react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var FontFamilyButton = () => {
13
+ const Components = useComponentsContext();
14
+ const { currentFont, isFileBlock, handleFontChange } = useFontFamily();
15
+ if (!Components || isFileBlock) {
16
+ return null;
17
+ }
18
+ return /* @__PURE__ */ jsxs(Components.Generic.Menu.Root, { children: [
19
+ /* @__PURE__ */ jsx(Components.Generic.Menu.Trigger, { children: /* @__PURE__ */ jsx(
20
+ Components.FormattingToolbar.Button,
21
+ {
22
+ "data-test": "fontFamily",
23
+ className: "bn-button",
24
+ label: "Font",
25
+ mainTooltip: "Font Family",
26
+ icon: /* @__PURE__ */ jsx(IconTypography, { size: 16 })
27
+ }
28
+ ) }),
29
+ /* @__PURE__ */ jsx(Components.Generic.Menu.Dropdown, { className: "bn-menu-dropdown bn-drag-handle-menu", children: FONT_FAMILIES.map((font) => /* @__PURE__ */ jsx(
30
+ Components.Generic.Menu.Item,
31
+ {
32
+ checked: currentFont === font.value,
33
+ onClick: () => handleFontChange(font.value),
34
+ children: /* @__PURE__ */ jsx(
35
+ "div",
36
+ {
37
+ className: "flex items-center gap-2 w-full",
38
+ style: { fontFamily: font.value },
39
+ children: font.name
40
+ }
41
+ )
42
+ },
43
+ font.value || "default"
44
+ )) })
45
+ ] });
46
+ };
47
+
48
+ export {
49
+ FontFamilyButton
50
+ };
@@ -0,0 +1,11 @@
1
+ // src/modules/blocks/utils/isEmptyBlock.ts
2
+ var isEmptyBlock = (block) => {
3
+ if (!block) {
4
+ return false;
5
+ }
6
+ return Array.isArray(block.content) && !block.content.length && !block.children?.length;
7
+ };
8
+
9
+ export {
10
+ isEmptyBlock
11
+ };
@@ -0,0 +1,14 @@
1
+ // src/modules/blocks/constant/toolbar/codeIncompatibleControls.ts
2
+ var CODE_INCOMPATIBLE_CONTROLS = [
3
+ "bold",
4
+ "italic",
5
+ "underline",
6
+ "strike",
7
+ "fontFamily",
8
+ "colors",
9
+ "createLink"
10
+ ];
11
+
12
+ export {
13
+ CODE_INCOMPATIBLE_CONTROLS
14
+ };
@@ -0,0 +1,56 @@
1
+ // src/modules/blocks/utils/getSlashMenuItems.tsx
2
+ import { getDefaultReactSlashMenuItems } from "@blocknote/react";
3
+ import { filterSuggestionItems } from "@blocknote/core";
4
+ import { IconPhoto } from "@tabler/icons-react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var getSlashMenuItems = (query, editor, additionalSlashMenuItems) => {
7
+ const items = getDefaultReactSlashMenuItems(editor);
8
+ const hasImageItem = items.some((item) => item.title === "Image");
9
+ const hasCustomImageBlock = "image" in editor.schema.blockSchema;
10
+ const filePanelPlugin = editor.filePanel?.plugins[0];
11
+ if (!hasImageItem && hasCustomImageBlock && filePanelPlugin) {
12
+ items.splice(9, 0, {
13
+ title: editor.dictionary.slash_menu.image.title,
14
+ subtext: editor.dictionary.slash_menu.image.subtext,
15
+ aliases: editor.dictionary.slash_menu.image.aliases,
16
+ badge: void 0,
17
+ group: editor.dictionary.slash_menu.image.group,
18
+ onItemClick: () => {
19
+ const currentBlock = editor.getTextCursorPosition().block;
20
+ const insertedBlock = editor.insertBlocks(
21
+ [{ type: "image" }],
22
+ currentBlock,
23
+ "after"
24
+ )[0];
25
+ editor.transact(
26
+ (tr) => tr.setMeta(filePanelPlugin, {
27
+ block: insertedBlock
28
+ })
29
+ );
30
+ }
31
+ });
32
+ }
33
+ if ("gallery" in editor.schema.blockSchema) {
34
+ items.push({
35
+ title: "Gallery",
36
+ subtext: "Insert a multi-image gallery grid",
37
+ aliases: ["gallery", "images", "grid"],
38
+ badge: void 0,
39
+ group: editor.dictionary.slash_menu.image.group,
40
+ icon: /* @__PURE__ */ jsx(IconPhoto, { size: 18 }),
41
+ onItemClick: () => {
42
+ const currentBlock = editor.getTextCursorPosition().block;
43
+ editor.insertBlocks([{ type: "gallery" }], currentBlock, "after");
44
+ }
45
+ });
46
+ }
47
+ const customItems = typeof additionalSlashMenuItems === "function" ? additionalSlashMenuItems(editor) : additionalSlashMenuItems;
48
+ if (customItems?.length) {
49
+ items.push(...customItems);
50
+ }
51
+ return Promise.resolve(filterSuggestionItems(items, query));
52
+ };
53
+
54
+ export {
55
+ getSlashMenuItems
56
+ };
@@ -0,0 +1,45 @@
1
+ // src/modules/blocks/hooks/toolbar/useFontFamily.ts
2
+ import {
3
+ useBlockNoteEditor,
4
+ useEditorContentOrSelectionChange
5
+ } from "@blocknote/react";
6
+ import { useState } from "react";
7
+ var useFontFamily = () => {
8
+ const editor = useBlockNoteEditor();
9
+ const [currentFont, setCurrentFont] = useState(() => {
10
+ const styles = editor.getActiveStyles();
11
+ return styles.fontFamily || "";
12
+ });
13
+ const [isFileBlock, setIsFileBlock] = useState(false);
14
+ useEditorContentOrSelectionChange(() => {
15
+ if (!editor)
16
+ return;
17
+ try {
18
+ const styles = editor.getActiveStyles();
19
+ setCurrentFont(styles?.fontFamily || "");
20
+ const block = editor.getTextCursorPosition()?.block;
21
+ const blockSpec = block ? editor.schema.blockSpecs[block.type] : null;
22
+ setIsFileBlock(!!blockSpec?.config?.isFileBlock);
23
+ } catch {
24
+ }
25
+ }, editor);
26
+ const handleFontChange = (fontValue) => {
27
+ if (!editor)
28
+ return;
29
+ try {
30
+ if (fontValue === "") {
31
+ editor.removeStyles({ fontFamily: "" });
32
+ } else {
33
+ editor.addStyles({ fontFamily: fontValue });
34
+ }
35
+ editor.focus();
36
+ } catch (error) {
37
+ console.error("Error changing font:", error);
38
+ }
39
+ };
40
+ return { currentFont, isFileBlock, handleFontChange };
41
+ };
42
+
43
+ export {
44
+ useFontFamily
45
+ };
@@ -45,7 +45,7 @@ var SidebarMenuSubButton = React.forwardRef(({ asChild = false, size = "md", isA
45
45
  "data-size": size,
46
46
  "data-active": isActive,
47
47
  className: cn(
48
- "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded px-2 outline-hidden font-semibold hover:bg-accent focus-visible:ring-2 active:bg-accent disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
48
+ "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded px-2 outline-hidden font-normal hover:bg-accent focus-visible:ring-2 active:bg-accent disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
49
49
  "data-[active=true]:bg-primary/10 data-[active=true]:text-primary data-[active=true]:font-semibold data-[active=true]:[&>svg]:text-primary data-[active=true]:[&>svg]:animate-icon-pop motion-reduce:[&>svg]:animate-none [&>svg]:transition-transform active:[&>svg]:scale-90",
50
50
  size === "sm" && "text-xs",
51
51
  size === "md" && "text-sm",
@@ -0,0 +1,21 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-KTBDECJI.js";
4
+
5
+ // src/modules/blocks/components/toolbar/ToolbarRoot.tsx
6
+ import { components } from "@blocknote/shadcn";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var ToolbarRoot = ({
9
+ className,
10
+ ...props
11
+ }) => /* @__PURE__ */ jsx(
12
+ components.FormattingToolbar.Root,
13
+ {
14
+ ...props,
15
+ className: cn("min-w-0 max-w-full flex-wrap!", className)
16
+ }
17
+ );
18
+
19
+ export {
20
+ ToolbarRoot
21
+ };
@@ -0,0 +1,20 @@
1
+ // src/modules/blocks/hooks/toolbar/useCodeActive.ts
2
+ import {
3
+ useBlockNoteEditor,
4
+ useEditorContentOrSelectionChange
5
+ } from "@blocknote/react";
6
+ import { useState } from "react";
7
+ var useCodeActive = () => {
8
+ const editor = useBlockNoteEditor();
9
+ const [codeActive, setCodeActive] = useState(
10
+ Boolean(editor.getActiveStyles().code)
11
+ );
12
+ useEditorContentOrSelectionChange(() => {
13
+ setCodeActive(Boolean(editor.getActiveStyles().code));
14
+ }, editor);
15
+ return codeActive;
16
+ };
17
+
18
+ export {
19
+ useCodeActive
20
+ };
@@ -0,0 +1,28 @@
1
+ // src/modules/blocks/constant/toolbar/fontFamilies.ts
2
+ var FONT_FAMILIES = [
3
+ { name: "Default", value: "" },
4
+ { name: "Arial", value: "Arial, sans-serif" },
5
+ { name: "Helvetica", value: "Helvetica, sans-serif" },
6
+ { name: "Times New Roman", value: '"Times New Roman", serif' },
7
+ { name: "Georgia", value: "Georgia, serif" },
8
+ { name: "Garamond", value: "Garamond, serif" },
9
+ { name: "Courier New", value: '"Courier New", monospace' },
10
+ { name: "Verdana", value: "Verdana, sans-serif" },
11
+ { name: "Trebuchet MS", value: '"Trebuchet MS", sans-serif' },
12
+ { name: "Palatino", value: "Palatino, serif" },
13
+ { name: "Tahoma", value: "Tahoma, sans-serif" },
14
+ { name: "Century Gothic", value: '"Century Gothic", sans-serif' },
15
+ { name: "Lucida Sans", value: '"Lucida Sans", sans-serif' },
16
+ { name: "Monaco", value: "Monaco, monospace" },
17
+ { name: "Consolas", value: "Consolas, monospace" },
18
+ { name: "Calibri", value: "Calibri, sans-serif" },
19
+ { name: "Cambria", value: "Cambria, serif" },
20
+ { name: "Didot", value: "Didot, serif" },
21
+ { name: "Rockwell", value: "Rockwell, serif" },
22
+ { name: "Franklin Gothic", value: '"Franklin Gothic Medium", sans-serif' },
23
+ { name: "Impact", value: "Impact, fantasy" }
24
+ ];
25
+
26
+ export {
27
+ FONT_FAMILIES
28
+ };
@@ -0,0 +1,57 @@
1
+ import {
2
+ getEditorVisibleBounds
3
+ } from "./chunk-4EIP6AVX.js";
4
+
5
+ // src/modules/blocks/utils/toolbar/getToolbarPositioning.ts
6
+ var getToolbarPositioning = (getEditorElement) => ({
7
+ middleware: [
8
+ {
9
+ name: "editorBoundary",
10
+ fn: ({ elements, rects, x, y }) => {
11
+ const editor = getEditorElement();
12
+ if (!editor)
13
+ return { x, y };
14
+ const { top, bottom, left, right } = getEditorVisibleBounds(editor);
15
+ const anchor = elements.reference.getBoundingClientRect();
16
+ const maxWidth = `${Math.floor(Math.max(0, right - left))}px`;
17
+ if (elements.floating.style.maxWidth !== maxWidth) {
18
+ elements.floating.style.maxWidth = maxWidth;
19
+ return { reset: { rects: true } };
20
+ }
21
+ const originX = anchor.left - rects.reference.x;
22
+ const originY = anchor.top - rects.reference.y;
23
+ const above = anchor.top - rects.floating.height - 10;
24
+ elements.floating.style.visibility = anchor.bottom <= top || anchor.top >= bottom ? "hidden" : "";
25
+ return {
26
+ x: Math.max(
27
+ left,
28
+ Math.min(x + originX, right - rects.floating.width)
29
+ ) - originX,
30
+ y: Math.max(
31
+ top,
32
+ Math.min(
33
+ above >= top ? above : anchor.bottom + 10,
34
+ bottom - rects.floating.height
35
+ )
36
+ ) - originY
37
+ };
38
+ }
39
+ }
40
+ ],
41
+ whileElementsMounted: (_reference, _floating, update) => {
42
+ update();
43
+ const editor = getEditorElement();
44
+ if (!editor)
45
+ return () => void 0;
46
+ editor.ownerDocument.addEventListener("scroll", update, true);
47
+ window.addEventListener("resize", update);
48
+ return () => {
49
+ editor.ownerDocument.removeEventListener("scroll", update, true);
50
+ window.removeEventListener("resize", update);
51
+ };
52
+ }
53
+ });
54
+
55
+ export {
56
+ getToolbarPositioning
57
+ };
@@ -0,0 +1,121 @@
1
+ import {
2
+ handleStringArrayPaste
3
+ } from "./chunk-WLKDIP4Y.js";
4
+ import {
5
+ Input
6
+ } from "./chunk-KT3H4JCX.js";
7
+ import {
8
+ buttonVariants
9
+ } from "./chunk-DCCZEG7Z.js";
10
+ import {
11
+ cn
12
+ } from "./chunk-KTBDECJI.js";
13
+
14
+ // src/components/string-array.tsx
15
+ import { IconX } from "@tabler/icons-react";
16
+ import { useRef, useState } from "react";
17
+ import { Button, Tag, TagGroup, TagList } from "react-aria-components";
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ function StringArrayInput({
20
+ value,
21
+ onValueChange,
22
+ id,
23
+ placeholder,
24
+ styleClasses,
25
+ onBlur,
26
+ splitOnPaste = false
27
+ }) {
28
+ const [draft, setDraft] = useState("");
29
+ const inputRef = useRef(null);
30
+ const lastTagRef = useRef(null);
31
+ return /* @__PURE__ */ jsxs(
32
+ "div",
33
+ {
34
+ className: cn(
35
+ "flex items-center rounded bg-background border-none transition-[color,box-shadow] focus-within:shadow-focus outline-none min-h-8 h-auto p-0 px-1 gap-1 flex-wrap",
36
+ styleClasses?.inlineTagsContainer
37
+ ),
38
+ children: [
39
+ /* @__PURE__ */ jsx(
40
+ TagGroup,
41
+ {
42
+ "aria-label": placeholder || "Tags",
43
+ className: "contents",
44
+ onRemove: (keys) => {
45
+ if (inputRef.current?.matches(":disabled"))
46
+ return;
47
+ const nextValue = value.filter((_, index) => !keys.has(index));
48
+ onValueChange(nextValue);
49
+ if (!nextValue.length)
50
+ inputRef.current?.focus();
51
+ },
52
+ children: /* @__PURE__ */ jsx(TagList, { className: "flex flex-wrap gap-1", children: value.map((tag, index) => /* @__PURE__ */ jsxs(
53
+ Tag,
54
+ {
55
+ id: index,
56
+ textValue: tag,
57
+ ref: index === value.length - 1 ? lastTagRef : void 0,
58
+ className: cn(
59
+ "flex items-center h-6 relative bg-background border border-input hover:bg-background rounded-md font-medium text-xs ps-2 pe-5 outline-none data-[focus-visible]:shadow-focus",
60
+ styleClasses?.tag?.body
61
+ ),
62
+ children: [
63
+ tag,
64
+ /* @__PURE__ */ jsx(
65
+ Button,
66
+ {
67
+ slot: "remove",
68
+ type: "button",
69
+ className: cn(
70
+ buttonVariants({ variant: "ghost", size: "icon" }),
71
+ "absolute -inset-y-px -end-px p-0 rounded-e-md flex size-6 transition-[color,box-shadow] outline-none text-muted-foreground/80 hover:text-foreground",
72
+ styleClasses?.tag?.closeButton
73
+ ),
74
+ children: /* @__PURE__ */ jsx(IconX, { className: "size-3", "aria-hidden": "true" })
75
+ }
76
+ )
77
+ ]
78
+ },
79
+ index
80
+ )) })
81
+ }
82
+ ),
83
+ /* @__PURE__ */ jsx(
84
+ Input,
85
+ {
86
+ ref: inputRef,
87
+ id,
88
+ placeholder: placeholder || "Add a tag",
89
+ "aria-label": placeholder || "Add a tag",
90
+ className: cn(
91
+ "flex-1 w-full min-w-[80px] shadow-none px-2 h-7",
92
+ styleClasses?.input
93
+ ),
94
+ value: draft,
95
+ onChange: (event) => setDraft(event.target.value),
96
+ onKeyDown: (event) => {
97
+ if (event.nativeEvent.isComposing)
98
+ return;
99
+ if (event.key === "Enter" || event.key === ",") {
100
+ event.preventDefault();
101
+ const tag = draft.trim();
102
+ if (tag && !value.includes(tag))
103
+ onValueChange([...value, tag]);
104
+ setDraft("");
105
+ } else if (event.key === "ArrowLeft" && !draft && value.length) {
106
+ event.preventDefault();
107
+ lastTagRef.current?.focus();
108
+ }
109
+ },
110
+ onBlur,
111
+ onPaste: (event) => splitOnPaste && handleStringArrayPaste({ event, value, onValueChange })
112
+ }
113
+ )
114
+ ]
115
+ }
116
+ );
117
+ }
118
+
119
+ export {
120
+ StringArrayInput
121
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  usePreviousHotkeyScope
3
- } from "./chunk-2RKVJ44N.js";
3
+ } from "./chunk-UXDXIN6Q.js";
4
4
  import {
5
5
  pendingHotkeyState
6
6
  } from "./chunk-O6IUPS6U.js";
@@ -0,0 +1,31 @@
1
+ import {
2
+ useCodeActive
3
+ } from "./chunk-IJVY23RC.js";
4
+ import {
5
+ CODE_INCOMPATIBLE_CONTROLS
6
+ } from "./chunk-CAV3X4PT.js";
7
+
8
+ // src/modules/blocks/components/toolbar/buttons/ToolbarFormattingButton.tsx
9
+ import { components } from "@blocknote/shadcn";
10
+ import { forwardRef } from "react";
11
+ import { jsx } from "react/jsx-runtime";
12
+ var ToolbarFormattingButton = forwardRef((props, ref) => {
13
+ const codeActive = useCodeActive();
14
+ const codeIncompatible = CODE_INCOMPATIBLE_CONTROLS.includes(
15
+ props["data-test"] ?? ""
16
+ );
17
+ const disabledByCode = codeActive && codeIncompatible;
18
+ const buttonProps = {
19
+ ...props,
20
+ ref,
21
+ disabled: props.disabled || props.isDisabled || disabledByCode,
22
+ isDisabled: props.isDisabled || disabledByCode,
23
+ isSelected: disabledByCode && props.isSelected !== void 0 ? false : props.isSelected
24
+ };
25
+ return /* @__PURE__ */ jsx(components.FormattingToolbar.Button, { ...buttonProps });
26
+ });
27
+ ToolbarFormattingButton.displayName = "ToolbarFormattingButton";
28
+
29
+ export {
30
+ ToolbarFormattingButton
31
+ };
@@ -9,7 +9,7 @@ import {
9
9
  SidebarMenuSub,
10
10
  SidebarMenuSubButton,
11
11
  SidebarMenuSubItem
12
- } from "./chunk-RB23BDYH.js";
12
+ } from "./chunk-F2R6ZFEK.js";
13
13
  import {
14
14
  SidebarMenu,
15
15
  SidebarMenuAction,
@@ -1,9 +1,3 @@
1
- import {
2
- ChatVizPie
3
- } from "./chunk-XD4PKWF4.js";
4
- import {
5
- sanitizeChartVizPayload
6
- } from "./chunk-FJLBHW7X.js";
7
1
  import {
8
2
  applyChartVizTransforms,
9
3
  getChartVizInteractiveDomain,
@@ -11,13 +5,19 @@ import {
11
5
  } from "./chunk-W5KVCFS2.js";
12
6
  import {
13
7
  ChatVizArea
14
- } from "./chunk-XDSYT6EE.js";
8
+ } from "./chunk-R7LIWID7.js";
15
9
  import {
16
10
  ChatVizBar
17
- } from "./chunk-NLPBCYLN.js";
11
+ } from "./chunk-RGR6MIXH.js";
18
12
  import {
19
13
  ChatVizLine
20
- } from "./chunk-2G6X7LOG.js";
14
+ } from "./chunk-MSSVDJPS.js";
15
+ import {
16
+ ChatVizPie
17
+ } from "./chunk-XD4PKWF4.js";
18
+ import {
19
+ sanitizeChartVizPayload
20
+ } from "./chunk-FJLBHW7X.js";
21
21
  import {
22
22
  Slider
23
23
  } from "./chunk-FTTQ6J3Y.js";