@erxes/ui 3.4.2-next.4 → 3.4.16-next.1

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 (213) hide show
  1. package/README.md +8 -2
  2. package/chunks/{chunk-ZF6XCB7I.js → chunk-4CCLUOX6.js} +17 -13
  3. package/chunks/chunk-5Z3GGJHV.js +228 -0
  4. package/chunks/chunk-7O4K7V5O.js +72 -0
  5. package/chunks/chunk-AJCSQFCK.js +11 -0
  6. package/chunks/{chunk-5AYIRXXG.js → chunk-D6HNEGMV.js} +47 -19
  7. package/chunks/{chunk-PHBECHTA.js → chunk-GEVRIBPF.js} +58 -33
  8. package/chunks/{chunk-XJGTFZFD.js → chunk-GF3RIWOX.js} +2675 -2395
  9. package/chunks/{chunk-TMUQ5KOJ.js → chunk-GZ7VO7KA.js} +2 -2
  10. package/chunks/{chunk-7JKJSTQ6.js → chunk-HHT5SPZG.js} +1 -1
  11. package/chunks/{chunk-JKXVRU5D.js → chunk-I7XARNX4.js} +6 -0
  12. package/chunks/chunk-INFZPSGC.js +44 -0
  13. package/chunks/{chunk-67XHII4F.js → chunk-JKEWLTH7.js} +1 -1
  14. package/chunks/{chunk-KK6WMCQJ.js → chunk-JMDEHBWJ.js} +2 -0
  15. package/chunks/chunk-NCKIHIJR.js +9 -0
  16. package/chunks/{chunk-3GQN7K6A.js → chunk-OMGBQTKQ.js} +1 -1
  17. package/chunks/{chunk-NMKI4CJI.js → chunk-R7LWDDDY.js} +1 -1
  18. package/chunks/{chunk-ZRETEI5F.js → chunk-RRL4XQSY.js} +1 -1
  19. package/chunks/chunk-U46BZAPJ.js +134 -0
  20. package/chunks/chunk-UC7SM7BM.js +55 -0
  21. package/chunks/{chunk-Y5IJGIV3.js → chunk-V42CIN6H.js} +13 -11
  22. package/chunks/chunk-WOOM5JC4.js +82 -0
  23. package/chunks/{chunk-ZOTE5P5Q.js → chunk-X2W2IRYX.js} +10 -8
  24. package/chunks/{chunk-HXTLWTQH.js → chunk-XGRCG2DK.js} +45 -30
  25. package/chunks/chunk-Z37GI372.js +34 -0
  26. package/chunks/{chunk-O365JEFR.js → chunk-ZGLCEJEN.js} +12 -5
  27. package/components/choicebox-group.js +75 -66
  28. package/components/collapsible.js +75 -66
  29. package/components/color-picker.js +75 -66
  30. package/components/combobox.js +3 -3
  31. package/components/command.js +2 -2
  32. package/components/dialog.js +1 -1
  33. package/components/index.d.ts +1 -0
  34. package/components/index.js +84 -72
  35. package/components/input-otp.d.ts +36 -0
  36. package/components/input-otp.js +9 -0
  37. package/components/multiselect.js +75 -66
  38. package/components/sheet.d.ts +4 -2
  39. package/components/sheet.js +1 -1
  40. package/components/sidebar/context.js +2 -2
  41. package/components/sidebar/menu-sub.js +2 -2
  42. package/components/sidebar/menu.js +2 -2
  43. package/components/sidebar/root.js +4 -4
  44. package/components/sidebar/trigger.js +2 -2
  45. package/components/sidebar.js +7 -7
  46. package/components/upload.js +75 -66
  47. package/constants/SexCodes.js +3 -3
  48. package/constants/index.js +3 -3
  49. package/fonts.css +5 -0
  50. package/hooks/index.js +76 -67
  51. package/hooks/use-confirm.js +75 -66
  52. package/hooks/use-cursor-pagination.js +11 -11
  53. package/hooks/use-query-state.d.ts +14 -2
  54. package/hooks/use-query-state.js +1 -1
  55. package/hooks/use-upload-chunked.js +11 -11
  56. package/hooks/use-upload-new.js +12 -12
  57. package/hooks/use-upload.js +75 -66
  58. package/index.js +138 -118
  59. package/modules/attachments/attachments.js +75 -66
  60. package/modules/attachments/index.js +75 -66
  61. package/modules/blocks/components/BarcodeAttribute.d.ts +3 -5
  62. package/modules/blocks/components/BarcodeAttribute.js +3 -250
  63. package/modules/blocks/components/BlockEditor.d.ts +2 -41
  64. package/modules/blocks/components/BlockEditor.js +79 -69
  65. package/modules/blocks/components/BlockEditorComments.d.ts +6 -0
  66. package/modules/blocks/components/BlockEditorComments.js +274 -0
  67. package/modules/blocks/components/BlockEditorInlineContent.d.ts +40 -0
  68. package/modules/blocks/components/BlockEditorInlineContent.js +21 -0
  69. package/modules/blocks/components/BlockEditorReadOnly.js +75 -66
  70. package/modules/blocks/components/{Toolbar.js → BlockToolbar.js} +75 -66
  71. package/modules/blocks/components/CustomFileBlock.js +75 -66
  72. package/modules/blocks/components/CustomImageBlock.js +75 -66
  73. package/modules/blocks/components/CustomVideoBlock.js +11 -11
  74. package/modules/blocks/components/Editor.js +75 -66
  75. package/modules/blocks/components/FontSizeButton.d.ts +1 -0
  76. package/modules/blocks/components/FontSizeButton.js +9 -0
  77. package/modules/blocks/components/GalleryBlock.js +75 -66
  78. package/modules/blocks/components/ImageStyleButton.js +75 -66
  79. package/modules/blocks/components/SlashMenu.js +75 -66
  80. package/modules/blocks/components/SuggestionMenu.js +75 -66
  81. package/modules/blocks/components/index.d.ts +1 -1
  82. package/modules/blocks/components/index.js +78 -68
  83. package/modules/blocks/components/toolbar/ToolbarContents.js +75 -66
  84. package/modules/blocks/components/toolbar/buttons/ToolbarButton.js +75 -66
  85. package/modules/blocks/components/toolbar/buttons/ToolbarFormattingButton.js +2 -2
  86. package/modules/blocks/components/toolbar/buttons/ToolbarToggle.js +75 -66
  87. package/modules/blocks/components/toolbar/menus/ToolbarMenuItem.js +75 -66
  88. package/modules/blocks/components/toolbar/menus/ToolbarSelect.js +75 -66
  89. package/modules/blocks/constant/blockEditorSchema.d.ts +18 -0
  90. package/modules/blocks/constant/blockEditorSchema.js +79 -68
  91. package/modules/blocks/constant/index.js +79 -68
  92. package/modules/blocks/constant/toolbar/editorUIComponents.d.ts +3 -0
  93. package/modules/blocks/constant/toolbar/editorUIComponents.js +75 -66
  94. package/modules/blocks/hooks/toolbar/useFontSize.d.ts +2 -0
  95. package/modules/blocks/hooks/toolbar/useFontSize.js +7 -0
  96. package/modules/blocks/hooks/toolbar/useToolbarComponents.js +75 -66
  97. package/modules/blocks/hooks/useBarcodeAttribute.d.ts +35 -0
  98. package/modules/blocks/hooks/useBarcodeAttribute.js +11 -0
  99. package/modules/blocks/hooks/useBlockEditor.d.ts +5 -0
  100. package/modules/blocks/hooks/useBlockEditor.js +75 -66
  101. package/modules/blocks/hooks/useBlockEditorCommentComposer.d.ts +6 -0
  102. package/modules/blocks/hooks/useBlockEditorCommentComposer.js +273 -0
  103. package/modules/blocks/hooks/useBlockEditorEditable.d.ts +2 -0
  104. package/modules/blocks/hooks/useBlockEditorEditable.js +9 -0
  105. package/modules/blocks/index.js +80 -68
  106. package/modules/blocks/types/TextEditor.d.ts +1 -0
  107. package/modules/blocks/types/toolbar/FontSize.d.ts +5 -0
  108. package/modules/blocks/types/toolbar/FontSize.js +0 -0
  109. package/modules/board/components/Board.js +75 -66
  110. package/modules/board/index.js +75 -66
  111. package/modules/chat-viz/index.js +3 -3
  112. package/modules/display/components/CurrencyDisplay.js +11 -11
  113. package/modules/display/components/EmailDisplay.d.ts +1 -1
  114. package/modules/display/components/EmailDisplay.js +75 -66
  115. package/modules/display/components/PhoneDisplay.d.ts +3 -1
  116. package/modules/display/components/PhoneDisplay.js +75 -66
  117. package/modules/display/components/RelativeDateDisplay.js +75 -66
  118. package/modules/display/components/SexDisplay.js +3 -3
  119. package/modules/display/index.js +75 -66
  120. package/modules/display/types/emailDisplay.d.ts +1 -0
  121. package/modules/display/utils/formatPhones.js +3 -3
  122. package/modules/email-editor/components/EmailEditor.js +75 -66
  123. package/modules/email-editor/components/EmailPreviewDeviceToggle.js +75 -66
  124. package/modules/email-editor/components/EmailTableBackground.js +75 -66
  125. package/modules/email-editor/components/EmailTableToolbar.js +75 -66
  126. package/modules/email-editor/components/index.js +75 -66
  127. package/modules/email-editor/index.js +75 -66
  128. package/modules/filter/components/Filter.js +75 -66
  129. package/modules/filter/date-filter/components/DateFilterCommand.js +75 -66
  130. package/modules/filter/date-filter/components/DialogDateView.js +75 -66
  131. package/modules/filter/date-filter/constants/dateTypes.d.ts +1 -0
  132. package/modules/filter/date-filter/constants/dateTypes.js +5 -3
  133. package/modules/filter/date-filter/index.js +75 -66
  134. package/modules/filter/date-filter/utils/dateTokens.d.ts +1 -0
  135. package/modules/filter/date-filter/utils/dateTokens.js +4 -1
  136. package/modules/filter/date-filter/utils/getActiveTab.js +2 -2
  137. package/modules/filter/date-filter/utils/getDisplayValue.d.ts +1 -1
  138. package/modules/filter/date-filter/utils/getDisplayValue.js +3 -3
  139. package/modules/filter/date-filter/utils/parseDateRangeFromString.js +14 -14
  140. package/modules/filter/hooks/useFilterQueryState.js +2 -2
  141. package/modules/filter/index.js +75 -66
  142. package/modules/focus-sheet/components/focus-sheet.js +75 -66
  143. package/modules/hotkey/components/PopoverScoped.js +75 -66
  144. package/modules/hotkey/index.js +77 -68
  145. package/modules/icons/components/IconPicker.js +75 -66
  146. package/modules/icons/index.js +75 -66
  147. package/modules/index.js +102 -85
  148. package/modules/inputs/components/CurrencyField.js +75 -66
  149. package/modules/inputs/components/EmailField.js +75 -66
  150. package/modules/inputs/components/FullNameField.js +75 -66
  151. package/modules/inputs/components/LanguageSelect.js +75 -66
  152. package/modules/inputs/components/PhoneField.js +75 -66
  153. package/modules/inputs/components/SexField.js +75 -66
  154. package/modules/inputs/components/TimezoneSelect.js +75 -66
  155. package/modules/inputs/index.js +77 -68
  156. package/modules/layout/components/AppLayout.d.ts +6 -6
  157. package/modules/layout/components/AppLayout.js +10 -8
  158. package/modules/layout/components/AppLayoutPageSlot.d.ts +2 -0
  159. package/modules/layout/components/AppLayoutPageSlot.js +9 -0
  160. package/modules/layout/index.d.ts +1 -0
  161. package/modules/layout/index.js +20 -13
  162. package/modules/layout/states/appLayoutPageState.d.ts +4 -0
  163. package/modules/layout/states/appLayoutPageState.js +8 -0
  164. package/modules/navigation-menu/components/NavigationMenu.js +75 -66
  165. package/modules/navigation-menu/index.js +77 -68
  166. package/modules/preview/components/Preview.js +75 -66
  167. package/modules/record-field/components/NumberField.js +75 -66
  168. package/modules/record-field/components/TextField.js +75 -66
  169. package/modules/record-field/index.js +75 -66
  170. package/modules/record-field/meta-inputs/components/EmailVerificationInput.js +75 -66
  171. package/modules/record-field/meta-inputs/components/PhoneInput.js +75 -66
  172. package/modules/record-field/meta-inputs/components/PhoneVerificationInput.js +75 -66
  173. package/modules/record-field/meta-inputs/components/TextFieldInput.js +75 -66
  174. package/modules/record-table/components/MoreColumn.js +75 -66
  175. package/modules/record-table/components/RecordTableArrowEffect.js +75 -66
  176. package/modules/record-table/components/RecordTableCell.js +75 -66
  177. package/modules/record-table/components/RecordTableCellInline.js +75 -66
  178. package/modules/record-table/components/RecordTableColumnSelector.js +75 -66
  179. package/modules/record-table/components/RecordTableCursor.js +75 -66
  180. package/modules/record-table/components/RecordTableHead.js +75 -66
  181. package/modules/record-table/components/RecordTableHeader.js +75 -66
  182. package/modules/record-table/components/RecordTableHotkeyCell.js +75 -66
  183. package/modules/record-table/components/RecordTableProvider.js +2 -2
  184. package/modules/record-table/components/RecordTableRoot.js +75 -66
  185. package/modules/record-table/components/RecordTableRow.js +75 -66
  186. package/modules/record-table/components/RecordTableRowList.js +75 -66
  187. package/modules/record-table/components/RecordTableRowSkeleton.js +75 -66
  188. package/modules/record-table/components/RecordTableScroll.js +75 -66
  189. package/modules/record-table/components/RecordTableTree.js +75 -66
  190. package/modules/record-table/contexts/RecordTableHotkeyContext.js +75 -66
  191. package/modules/record-table/hooks/usePopoverOnEnter.js +75 -66
  192. package/modules/record-table/index.js +75 -66
  193. package/modules/report/components/report-page-container.js +75 -66
  194. package/modules/report/index.js +75 -66
  195. package/modules/select-operation/components/SelectOperation.js +75 -66
  196. package/modules/select-operation/index.js +75 -66
  197. package/modules/select-tree/components/SelectTree.js +75 -66
  198. package/modules/select-tree/hooks/useSelectTreeHide.js +2 -2
  199. package/modules/select-tree/index.js +75 -66
  200. package/modules/side-menu/components/SideMenu.js +75 -66
  201. package/package.json +9 -2
  202. package/styles.css +1 -1
  203. package/theme.css +3 -2
  204. package/types/UIConfig.d.ts +32 -0
  205. package/types/index.js +5 -5
  206. package/utils/core.js +11 -11
  207. package/utils/index.js +33 -33
  208. package/chunks/{chunk-F2R6ZFEK.js → chunk-CHDXXCMI.js} +3 -3
  209. package/chunks/{chunk-QTFBJ6EE.js → chunk-HT6R7GVC.js} +3 -3
  210. package/chunks/{chunk-AQEBKBOC.js → chunk-UQJA4TBO.js} +3 -3
  211. package/chunks/{chunk-RRQDMDYQ.js → chunk-WKCCSZLB.js} +0 -0
  212. package/chunks/{chunk-MBEYRZZN.js → chunk-XREHNAPK.js} +3 -3
  213. /package/modules/blocks/components/{Toolbar.d.ts → BlockToolbar.d.ts} +0 -0
@@ -9,7 +9,7 @@ import {
9
9
  SidebarMenuSub,
10
10
  SidebarMenuSubButton,
11
11
  SidebarMenuSubItem
12
- } from "./chunk-F2R6ZFEK.js";
12
+ } from "./chunk-CHDXXCMI.js";
13
13
  import {
14
14
  SidebarMenu,
15
15
  SidebarMenuAction,
@@ -26,7 +26,7 @@ import {
26
26
  SidebarInset,
27
27
  SidebarRail,
28
28
  SidebarRoot
29
- } from "./chunk-67XHII4F.js";
29
+ } from "./chunk-JKEWLTH7.js";
30
30
  import {
31
31
  SidebarTrigger
32
32
  } from "./chunk-XD4TBZYB.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-6FIFKPLP.js";
7
7
  import {
8
8
  Command
9
- } from "./chunk-3GQN7K6A.js";
9
+ } from "./chunk-OMGBQTKQ.js";
10
10
  import {
11
11
  Popover
12
12
  } from "./chunk-F2VATUUS.js";
@@ -1,6 +1,11 @@
1
+ import {
2
+ RENAMED_FIXED_DATES
3
+ } from "./chunk-ZGLCEJEN.js";
4
+
1
5
  // src/modules/filter/date-filter/utils/dateTokens.ts
2
6
  var QUARTER_TOKEN = /^(\d{4})-quarter-([1-4])$/;
3
7
  var HALF_TOKEN = /^(\d{4})-half-([1-2])$/;
8
+ var normalizeFixedDate = (value) => Object.prototype.hasOwnProperty.call(RENAMED_FIXED_DATES, value) ? RENAMED_FIXED_DATES[value] : value;
4
9
  var parseQuarterToken = (value) => {
5
10
  const match = QUARTER_TOKEN.exec(value);
6
11
  if (!match)
@@ -21,6 +26,7 @@ var parseHalfToken = (value) => {
21
26
  };
22
27
 
23
28
  export {
29
+ normalizeFixedDate,
24
30
  parseQuarterToken,
25
31
  parseHalfToken
26
32
  };
@@ -0,0 +1,44 @@
1
+ import {
2
+ appLayoutPageOverlayState,
3
+ appLayoutPageTargetState
4
+ } from "./chunk-NCKIHIJR.js";
5
+
6
+ // src/modules/layout/components/AppLayoutPageSlot.tsx
7
+ import { useAtomValue, useSetAtom } from "jotai";
8
+ import { useLayoutEffect, useRef } from "react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ var AppLayoutPageSlot = ({ children }) => {
11
+ const ref = useRef(null);
12
+ const target = useAtomValue(appLayoutPageTargetState);
13
+ const setTarget = useSetAtom(appLayoutPageTargetState);
14
+ const overlayOpen = useAtomValue(appLayoutPageOverlayState);
15
+ const active = overlayOpen && target === ref.current;
16
+ useLayoutEffect(() => {
17
+ const element = ref.current;
18
+ setTarget(element);
19
+ return () => setTarget((current) => current === element ? null : current);
20
+ }, [setTarget]);
21
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
22
+ /* @__PURE__ */ jsx(
23
+ "div",
24
+ {
25
+ hidden: active,
26
+ ...active ? { inert: "" } : {},
27
+ className: active ? "hidden" : "flex min-h-0 min-w-0 flex-1 flex-col",
28
+ children
29
+ }
30
+ ),
31
+ /* @__PURE__ */ jsx(
32
+ "div",
33
+ {
34
+ ref,
35
+ hidden: !active,
36
+ className: active ? "flex min-h-0 min-w-0 flex-1 flex-col" : "hidden"
37
+ }
38
+ )
39
+ ] });
40
+ };
41
+
42
+ export {
43
+ AppLayoutPageSlot
44
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Sheet
3
- } from "./chunk-5AYIRXXG.js";
3
+ } from "./chunk-D6HNEGMV.js";
4
4
  import {
5
5
  useSidebar
6
6
  } from "./chunk-G2QQZN4L.js";
@@ -61,6 +61,8 @@ var useErxesUpload = (options) => {
61
61
  const dropzoneProps = useDropzone({
62
62
  onDrop,
63
63
  noClick: true,
64
+ // A document-wide drop blocker would also swallow text drops elsewhere
65
+ preventDropOnDocument: false,
64
66
  accept: allowedMimeTypes.reduce(
65
67
  (acc, type) => ({ ...acc, [type]: [] }),
66
68
  {}
@@ -0,0 +1,9 @@
1
+ // src/modules/layout/states/appLayoutPageState.ts
2
+ import { atom } from "jotai";
3
+ var appLayoutPageTargetState = atom(null);
4
+ var appLayoutPageOverlayState = atom(false);
5
+
6
+ export {
7
+ appLayoutPageTargetState,
8
+ appLayoutPageOverlayState
9
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Dialog
3
- } from "./chunk-ZF6XCB7I.js";
3
+ } from "./chunk-4CCLUOX6.js";
4
4
  import {
5
5
  cn
6
6
  } from "./chunk-KTBDECJI.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-FJTUANXN.js";
4
4
  import {
5
5
  useQueryState
6
- } from "./chunk-PHBECHTA.js";
6
+ } from "./chunk-GEVRIBPF.js";
7
7
 
8
8
  // src/modules/filter/hooks/useFilterQueryState.tsx
9
9
  import { useSetAtom } from "jotai";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MONTHS
3
- } from "./chunk-O365JEFR.js";
3
+ } from "./chunk-ZGLCEJEN.js";
4
4
 
5
5
  // src/modules/filter/date-filter/utils/getActiveTab.ts
6
6
  var getActiveTab = (date) => {
@@ -0,0 +1,134 @@
1
+ // src/modules/blocks/hooks/useBarcodeAttribute.ts
2
+ import {
3
+ useRef,
4
+ useState
5
+ } from "react";
6
+ import { useForm } from "react-hook-form";
7
+ import { zodResolver } from "@hookform/resolvers/zod";
8
+ import { z } from "zod";
9
+ var MIN_WIDTH = 80;
10
+ var MIN_HEIGHT = 30;
11
+ var MAX_WIDTH = 600;
12
+ var MAX_HEIGHT = 300;
13
+ var barcodeSizeSchema = z.object({
14
+ width: z.coerce.number().finite().int().min(MIN_WIDTH).max(MAX_WIDTH),
15
+ height: z.coerce.number().finite().int().min(MIN_HEIGHT).max(MAX_HEIGHT)
16
+ });
17
+ var BARCODE_SIZE_PRESETS = [
18
+ { width: 113, height: 78 },
19
+ { width: 141, height: 98 },
20
+ { width: 169, height: 118 },
21
+ { width: 211, height: 147 },
22
+ { width: 282, height: 196 }
23
+ ];
24
+ var BARCODE_DIMENSION_LIMITS = {
25
+ width: { min: MIN_WIDTH, max: MAX_WIDTH },
26
+ height: { min: MIN_HEIGHT, max: MAX_HEIGHT }
27
+ };
28
+ var useBarcodeAttribute = ({
29
+ width,
30
+ height,
31
+ onResize
32
+ }) => {
33
+ const [settingsOpen, setSettingsOpen] = useState(false);
34
+ const form = useForm({
35
+ resolver: zodResolver(
36
+ barcodeSizeSchema
37
+ ),
38
+ defaultValues: { width, height }
39
+ });
40
+ const dimensions = form.watch();
41
+ const preset = BARCODE_SIZE_PRESETS.find(
42
+ (size2) => size2.width === Number(dimensions.width) && size2.height === Number(dimensions.height)
43
+ );
44
+ const applySize = form.handleSubmit((dimensions2) => {
45
+ onResize(dimensions2);
46
+ setSettingsOpen(false);
47
+ });
48
+ const [dragSize, setDragSize] = useState(null);
49
+ const size = dragSize ?? { width, height };
50
+ const dragStart = useRef(null);
51
+ const getResizedDimensions = (event) => {
52
+ const start = dragStart.current;
53
+ if (!start) {
54
+ return size;
55
+ }
56
+ return {
57
+ width: Math.min(
58
+ MAX_WIDTH,
59
+ Math.max(MIN_WIDTH, start.width + event.clientX - start.clientX)
60
+ ),
61
+ height: Math.min(
62
+ MAX_HEIGHT,
63
+ Math.max(MIN_HEIGHT, start.height + start.clientY - event.clientY)
64
+ )
65
+ };
66
+ };
67
+ const handleResizeStart = (event) => {
68
+ event.preventDefault();
69
+ event.stopPropagation();
70
+ event.currentTarget.setPointerCapture(event.pointerId);
71
+ dragStart.current = {
72
+ ...size,
73
+ clientX: event.clientX,
74
+ clientY: event.clientY
75
+ };
76
+ };
77
+ const handleResize = (event) => {
78
+ if (dragStart.current) {
79
+ setDragSize(getResizedDimensions(event));
80
+ }
81
+ };
82
+ const handleResizeEnd = (event) => {
83
+ if (!dragStart.current) {
84
+ return;
85
+ }
86
+ const resizedDimensions = getResizedDimensions(event);
87
+ dragStart.current = null;
88
+ onResize(resizedDimensions);
89
+ setDragSize(null);
90
+ };
91
+ const handleSettingsOpenChange = (open) => {
92
+ if (open)
93
+ form.reset({ width: size.width, height: size.height });
94
+ setSettingsOpen(open);
95
+ };
96
+ const handlePresetChange = (value) => {
97
+ const selected = BARCODE_SIZE_PRESETS.find(
98
+ (preset2) => String(preset2.width) === value
99
+ );
100
+ if (selected)
101
+ form.reset(selected);
102
+ };
103
+ const handleInputKeyDown = (event) => {
104
+ if (event.key !== "Enter")
105
+ return;
106
+ event.preventDefault();
107
+ event.stopPropagation();
108
+ void applySize();
109
+ };
110
+ const handleResizeCancel = () => {
111
+ dragStart.current = null;
112
+ setDragSize(null);
113
+ };
114
+ return {
115
+ form,
116
+ size,
117
+ preset,
118
+ settingsOpen,
119
+ applySize,
120
+ handleSettingsOpenChange,
121
+ handlePresetChange,
122
+ handleInputKeyDown,
123
+ handleResizeStart,
124
+ handleResize,
125
+ handleResizeEnd,
126
+ handleResizeCancel
127
+ };
128
+ };
129
+
130
+ export {
131
+ BARCODE_SIZE_PRESETS,
132
+ BARCODE_DIMENSION_LIMITS,
133
+ useBarcodeAttribute
134
+ };
@@ -0,0 +1,55 @@
1
+ import {
2
+ useFontSize
3
+ } from "./chunk-Z37GI372.js";
4
+
5
+ // src/modules/blocks/components/FontSizeButton.tsx
6
+ import { useComponentsContext } from "@blocknote/react";
7
+ import { IconTextSize } from "@tabler/icons-react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var FONT_SIZES = [8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 72];
10
+ var FontSizeButton = () => {
11
+ const Components = useComponentsContext();
12
+ const { currentSize, isFileBlock, handleSizeChange } = useFontSize();
13
+ if (!Components || isFileBlock) {
14
+ return null;
15
+ }
16
+ return /* @__PURE__ */ jsxs(Components.Generic.Menu.Root, { children: [
17
+ /* @__PURE__ */ jsx(Components.Generic.Menu.Trigger, { children: /* @__PURE__ */ jsx(
18
+ Components.FormattingToolbar.Button,
19
+ {
20
+ "data-test": "fontSize",
21
+ className: "bn-button",
22
+ label: "Font Size",
23
+ mainTooltip: "Font Size",
24
+ icon: /* @__PURE__ */ jsx(IconTextSize, { size: 16 }),
25
+ children: currentSize || "Default"
26
+ }
27
+ ) }),
28
+ /* @__PURE__ */ jsxs(Components.Generic.Menu.Dropdown, { className: "bn-menu-dropdown bn-drag-handle-menu", children: [
29
+ /* @__PURE__ */ jsx(
30
+ Components.Generic.Menu.Item,
31
+ {
32
+ checked: !currentSize,
33
+ onClick: () => handleSizeChange(""),
34
+ children: "Default"
35
+ }
36
+ ),
37
+ FONT_SIZES.map((size) => /* @__PURE__ */ jsxs(
38
+ Components.Generic.Menu.Item,
39
+ {
40
+ checked: currentSize === `${size}pt`,
41
+ onClick: () => handleSizeChange(`${size}pt`),
42
+ children: [
43
+ size,
44
+ " pt"
45
+ ]
46
+ },
47
+ size
48
+ ))
49
+ ] })
50
+ ] });
51
+ };
52
+
53
+ export {
54
+ FontSizeButton
55
+ };
@@ -1,31 +1,33 @@
1
1
  import {
2
+ normalizeFixedDate,
2
3
  parseHalfToken,
3
4
  parseQuarterToken
4
- } from "./chunk-JKXVRU5D.js";
5
+ } from "./chunk-I7XARNX4.js";
5
6
  import {
6
7
  MONTHS
7
- } from "./chunk-O365JEFR.js";
8
+ } from "./chunk-ZGLCEJEN.js";
8
9
 
9
10
  // src/modules/filter/date-filter/utils/getDisplayValue.ts
10
11
  import { format } from "date-fns";
11
- var getDisplayValue = (value) => {
12
+ var getDisplayValue = (rawValue) => {
13
+ const value = normalizeFixedDate(rawValue);
12
14
  if (value === "today") {
13
15
  return "Today";
14
16
  }
15
17
  if (value === "in-the-past") {
16
18
  return "In the past";
17
19
  }
18
- if (value === "1-day-from-now") {
19
- return "1 day from now";
20
+ if (value === "last-1-day") {
21
+ return "Last 1 day";
20
22
  }
21
- if (value === "3-days-from-now") {
22
- return "3 days from now";
23
+ if (value === "last-3-days") {
24
+ return "Last 3 days";
23
25
  }
24
- if (value === "1-week-from-now") {
25
- return "1 week from now";
26
+ if (value === "last-7-days") {
27
+ return "Last 7 days";
26
28
  }
27
- if (value === "3-months-from-now") {
28
- return "3 months from now";
29
+ if (value === "last-3-months") {
30
+ return "Last 3 months";
29
31
  }
30
32
  if (MONTHS.some((month) => value.includes(month))) {
31
33
  return value;
@@ -0,0 +1,82 @@
1
+ import {
2
+ BarcodeAttribute
3
+ } from "./chunk-5Z3GGJHV.js";
4
+
5
+ // src/modules/blocks/components/BlockEditorInlineContent.tsx
6
+ import { createReactInlineContentSpec } from "@blocknote/react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var Mention = createReactInlineContentSpec(
9
+ {
10
+ type: "mention",
11
+ propSchema: {
12
+ fullName: {
13
+ default: "Unknown"
14
+ },
15
+ _id: {
16
+ default: ""
17
+ }
18
+ },
19
+ content: "none"
20
+ },
21
+ {
22
+ render: (props) => /* @__PURE__ */ jsxs("span", { className: "bg-primary/10 p-1 rounded font-bold text-sm text-primary inline-flex items-center", children: [
23
+ "@",
24
+ props.inlineContent.props.fullName
25
+ ] })
26
+ }
27
+ );
28
+ var Attribute = createReactInlineContentSpec(
29
+ {
30
+ type: "attribute",
31
+ propSchema: {
32
+ name: {
33
+ default: "Unknown"
34
+ },
35
+ value: {
36
+ default: ""
37
+ },
38
+ width: {
39
+ default: 150
40
+ },
41
+ height: {
42
+ default: 50
43
+ }
44
+ },
45
+ content: "none"
46
+ },
47
+ {
48
+ render: (props) => props.inlineContent.props.value === "barcode" ? /* @__PURE__ */ jsx(
49
+ BarcodeAttribute,
50
+ {
51
+ editable: props.editor.isEditable,
52
+ height: props.inlineContent.props.height,
53
+ width: props.inlineContent.props.width,
54
+ onRemove: (element) => {
55
+ props.editor.transact((tr) => {
56
+ let found = false;
57
+ tr.doc.descendants((node, position) => {
58
+ if (found)
59
+ return false;
60
+ const dom = props.editor.prosemirrorView?.nodeDOM(position);
61
+ if (node.type.name === "attribute" && dom instanceof HTMLElement && dom.contains(element)) {
62
+ tr.delete(position, position + node.nodeSize);
63
+ found = true;
64
+ return false;
65
+ }
66
+ return true;
67
+ });
68
+ });
69
+ },
70
+ onResize: ({ width, height }) => props.updateInlineContent({
71
+ type: "attribute",
72
+ props: { ...props.inlineContent.props, width, height }
73
+ })
74
+ }
75
+ ) : /* @__PURE__ */ jsx("span", { className: "bg-yellow-50 p-1 rounded font-bold text-sm text-yellow-900 inline-flex items-center", children: props.inlineContent.props.name })
76
+ }
77
+ );
78
+
79
+ export {
80
+ Mention,
81
+ Attribute
82
+ };
@@ -1,10 +1,11 @@
1
1
  import {
2
+ normalizeFixedDate,
2
3
  parseHalfToken,
3
4
  parseQuarterToken
4
- } from "./chunk-JKXVRU5D.js";
5
+ } from "./chunk-I7XARNX4.js";
5
6
  import {
6
7
  MONTHS
7
- } from "./chunk-O365JEFR.js";
8
+ } from "./chunk-ZGLCEJEN.js";
8
9
  import {
9
10
  isUndefinedOrNull
10
11
  } from "./chunk-JSZTGL4T.js";
@@ -24,25 +25,26 @@ var parseDateRangeFromString = (date) => {
24
25
  from: startOfDay(new Date(1979, 0, 1)),
25
26
  to: endOfDay(today)
26
27
  },
27
- "1-day-from-now": {
28
+ "last-1-day": {
28
29
  from: startOfDay(subDays(today, 1)),
29
30
  to: endOfDay(today)
30
31
  },
31
- "3-days-from-now": {
32
+ "last-3-days": {
32
33
  from: startOfDay(subDays(today, 3)),
33
34
  to: endOfDay(today)
34
35
  },
35
- "1-week-from-now": {
36
+ "last-7-days": {
36
37
  from: startOfDay(subDays(today, 7)),
37
38
  to: endOfDay(today)
38
39
  },
39
- "3-months-from-now": {
40
+ "last-3-months": {
40
41
  from: startOfDay(subMonths(today, 3)),
41
42
  to: endOfDay(today)
42
43
  }
43
44
  };
44
- if (dateRanges[date]) {
45
- return dateRanges[date];
45
+ const fixedDate = normalizeFixedDate(date);
46
+ if (dateRanges[fixedDate]) {
47
+ return dateRanges[fixedDate];
46
48
  }
47
49
  if (MONTHS.some((month) => date.includes(month))) {
48
50
  const [year, month] = date.split("-");
@@ -1,6 +1,9 @@
1
+ import {
2
+ AppLayoutPageSlot
3
+ } from "./chunk-INFZPSGC.js";
1
4
  import {
2
5
  Sidebar
3
- } from "./chunk-TMUQ5KOJ.js";
6
+ } from "./chunk-GZ7VO7KA.js";
4
7
  import {
5
8
  Separator
6
9
  } from "./chunk-A6ID2P5A.js";
@@ -12,7 +15,11 @@ import {
12
15
  } from "./chunk-KTBDECJI.js";
13
16
 
14
17
  // src/modules/layout/components/AppLayout.tsx
15
- import * as React from "react";
18
+ import {
19
+ useLayoutEffect,
20
+ useRef,
21
+ useState
22
+ } from "react";
16
23
  import {
17
24
  IconLayoutSidebarLeftCollapse,
18
25
  IconLayoutSidebarLeftExpand,
@@ -54,9 +61,7 @@ var AppLayoutResizeHandle = ({
54
61
  onReset,
55
62
  onResizingChange
56
63
  }) => {
57
- const drag = React.useRef(
58
- null
59
- );
64
+ const drag = useRef(null);
60
65
  const stopDrag = (event) => {
61
66
  if (!drag.current) {
62
67
  return;
@@ -149,17 +154,17 @@ var APP_LAYOUT_PAGE_ENTER = [{ opacity: 0.4 }, { opacity: 1 }];
149
154
  var getPageKey = (pathname) => pathname.split("/").filter(Boolean).slice(0, 2).join("/");
150
155
  var AppLayoutPage = ({ children }) => {
151
156
  const { pathname } = useLocation();
152
- const pageRef = React.useRef(null);
157
+ const pageRef = useRef(null);
153
158
  const pageKey = getPageKey(pathname);
154
- const previousKey = React.useRef(pageKey);
155
- React.useLayoutEffect(() => {
159
+ const previousKey = useRef(pageKey);
160
+ useLayoutEffect(() => {
156
161
  const page = pageRef.current;
157
162
  if (previousKey.current === pageKey) {
158
- return;
163
+ return void 0;
159
164
  }
160
165
  previousKey.current = pageKey;
161
166
  if (!page?.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
162
- return;
167
+ return void 0;
163
168
  }
164
169
  const animation = page.animate(APP_LAYOUT_PAGE_ENTER, {
165
170
  duration: 160,
@@ -172,10 +177,30 @@ var AppLayoutPage = ({ children }) => {
172
177
  {
173
178
  ref: pageRef,
174
179
  className: "relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",
175
- children
180
+ children: /* @__PURE__ */ jsx(AppLayoutPageSlot, { children })
176
181
  }
177
182
  );
178
183
  };
184
+ var AppLayoutSidebarHeader = ({
185
+ title,
186
+ onCollapse
187
+ }) => /* @__PURE__ */ jsxs("div", { className: "flex h-10 shrink-0 items-center px-2", children: [
188
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 truncate px-2 text-sm font-medium", children: title }),
189
+ /* @__PURE__ */ jsx(
190
+ Button,
191
+ {
192
+ "aria-expanded": true,
193
+ "aria-label": "Collapse sidebar",
194
+ className: "size-8 shrink-0 rounded-md",
195
+ size: "icon",
196
+ title: "Collapse sidebar",
197
+ type: "button",
198
+ variant: "ghost",
199
+ onClick: onCollapse,
200
+ children: /* @__PURE__ */ jsx(IconLayoutSidebarLeftCollapse, {})
201
+ }
202
+ )
203
+ ] });
179
204
  var AppLayoutDesktop = ({
180
205
  atoms,
181
206
  children,
@@ -185,8 +210,8 @@ var AppLayoutDesktop = ({
185
210
  }) => {
186
211
  const [open, setOpen] = useAtom(atoms.open);
187
212
  const [width, setWidth] = useAtom(atoms.width);
188
- const [resizing, setResizing] = React.useState(false);
189
- const asideRef = React.useRef(null);
213
+ const [resizing, setResizing] = useState(false);
214
+ const asideRef = useRef(null);
190
215
  const currentWidth = width ?? APP_LAYOUT_DEFAULT_WIDTH;
191
216
  return /* @__PURE__ */ jsxs(
192
217
  "div",
@@ -215,23 +240,13 @@ var AppLayoutDesktop = ({
215
240
  className: "flex h-full flex-col",
216
241
  style: { minWidth: currentWidth },
217
242
  children: [
218
- /* @__PURE__ */ jsxs("div", { className: "flex h-10 shrink-0 items-center px-2", children: [
219
- /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 truncate px-2 text-sm font-medium", children: title }),
220
- /* @__PURE__ */ jsx(
221
- Button,
222
- {
223
- "aria-expanded": true,
224
- "aria-label": "Collapse sidebar",
225
- className: "size-8 shrink-0 rounded-md",
226
- size: "icon",
227
- title: "Collapse sidebar",
228
- type: "button",
229
- variant: "ghost",
230
- onClick: () => setOpen(false),
231
- children: /* @__PURE__ */ jsx(IconLayoutSidebarLeftCollapse, {})
232
- }
233
- )
234
- ] }),
243
+ /* @__PURE__ */ jsx(
244
+ AppLayoutSidebarHeader,
245
+ {
246
+ title,
247
+ onCollapse: () => setOpen(false)
248
+ }
249
+ ),
235
250
  /* @__PURE__ */ jsx(
236
251
  "div",
237
252
  {
@@ -0,0 +1,34 @@
1
+ // src/modules/blocks/hooks/toolbar/useFontSize.ts
2
+ import {
3
+ useBlockNoteEditor,
4
+ useEditorContentOrSelectionChange
5
+ } from "@blocknote/react";
6
+ import { useState } from "react";
7
+ var useFontSize = () => {
8
+ const editor = useBlockNoteEditor();
9
+ const [currentSize, setCurrentSize] = useState(
10
+ () => editor.getActiveStyles().fontSize || ""
11
+ );
12
+ const [isFileBlock, setIsFileBlock] = useState(() => {
13
+ const { block } = editor.getTextCursorPosition();
14
+ return !!editor.schema.blockSpecs[block.type].config.isFileBlock;
15
+ });
16
+ useEditorContentOrSelectionChange(() => {
17
+ setCurrentSize(editor.getActiveStyles().fontSize || "");
18
+ const { block } = editor.getTextCursorPosition();
19
+ setIsFileBlock(!!editor.schema.blockSpecs[block.type].config.isFileBlock);
20
+ }, editor);
21
+ const handleSizeChange = (size) => {
22
+ if (size) {
23
+ editor.addStyles({ fontSize: size });
24
+ } else {
25
+ editor.removeStyles({ fontSize: "" });
26
+ }
27
+ editor.focus();
28
+ };
29
+ return { currentSize, isFileBlock, handleSizeChange };
30
+ };
31
+
32
+ export {
33
+ useFontSize
34
+ };