@erxes/ui 4.0.0-v2.0 → 4.0.0-v2.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.
- package/README.md +6 -6
- package/dist/base.css +17 -4
- package/dist/components/accordion.d.ts +6 -7
- package/dist/components/accordion.js +8 -13
- package/dist/components/alert-dialog.d.ts +12 -11
- package/dist/components/alert-dialog.js +26 -29
- package/dist/components/alert.js +2 -2
- package/dist/components/avatar.d.ts +7 -5
- package/dist/components/avatar.js +30 -19
- package/dist/components/background-gradient-animation.d.ts +2 -11
- package/dist/components/background-gradient-animation.js +21 -50
- package/dist/components/badge.d.ts +3 -2
- package/dist/components/badge.js +36 -21
- package/dist/components/breadcrumb.d.ts +6 -4
- package/dist/components/breadcrumb.js +18 -14
- package/dist/components/button.d.ts +15 -7
- package/dist/components/button.js +46 -23
- package/dist/components/calendar.js +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/chart-config.d.ts +4 -18
- package/dist/components/chart-config.js +1 -6
- package/dist/components/charts.d.ts +1 -1
- package/dist/components/charts.js +20 -28
- package/dist/components/checkbox.d.ts +2 -3
- package/dist/components/checkbox.js +4 -6
- package/dist/components/choicebox-group.d.ts +1 -1
- package/dist/components/choicebox-group.js +5 -9
- package/dist/components/collapsible.d.ts +5 -9
- package/dist/components/collapsible.js +8 -25
- package/dist/components/color-picker.js +9 -8
- package/dist/components/combobox.d.ts +6 -6
- package/dist/components/combobox.js +19 -18
- package/dist/components/command-bar.js +22 -19
- package/dist/components/command.d.ts +18 -8
- package/dist/components/command.js +62 -26
- package/dist/components/context-menu.d.ts +17 -29
- package/dist/components/context-menu.js +20 -66
- package/dist/components/copy-text.js +7 -11
- package/dist/components/date-picker.js +21 -18
- package/dist/components/date-text-input.js +3 -3
- package/dist/components/date-time-input.d.ts +12 -0
- package/dist/components/date-time-input.js +21 -0
- package/dist/components/dialog.d.ts +17 -12
- package/dist/components/dialog.js +36 -32
- package/dist/components/drag-handle.d.ts +2 -2
- package/dist/components/drag-handle.js +0 -1
- package/dist/components/dropdown-menu.d.ts +35 -16
- package/dist/components/dropdown-menu.js +78 -37
- package/dist/components/empty.js +2 -2
- package/dist/components/form.d.ts +15 -6
- package/dist/components/form.js +34 -17
- package/dist/components/hover-card.d.ts +6 -5
- package/dist/components/hover-card.js +18 -9
- package/dist/components/info-card.js +5 -6
- package/dist/components/input-group.d.ts +22 -0
- package/dist/components/input-group.js +42 -0
- package/dist/components/input.d.ts +11 -2
- package/dist/components/input.js +21 -8
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.d.ts +3 -3
- package/dist/components/label.js +9 -6
- package/dist/components/multiselect.d.ts +21 -6
- package/dist/components/multiselect.js +81 -127
- package/dist/components/on-demand.d.ts +17 -0
- package/dist/components/on-demand.js +42 -0
- package/dist/components/popover.d.ts +18 -9
- package/dist/components/popover.js +38 -13
- package/dist/components/radio-group.d.ts +5 -5
- package/dist/components/radio-group.js +23 -29
- package/dist/components/resizable.d.ts +8 -21
- package/dist/components/resizable.js +5 -10
- package/dist/components/scroll-area.d.ts +12 -7
- package/dist/components/scroll-area.js +18 -18
- package/dist/components/select.d.ts +22 -14
- package/dist/components/select.js +90 -51
- package/dist/components/separator.d.ts +3 -3
- package/dist/components/separator.js +8 -12
- package/dist/components/sheet.d.ts +15 -11
- package/dist/components/sheet.js +63 -47
- package/dist/components/sidebar/context.js +4 -4
- package/dist/components/sidebar/group.d.ts +9 -8
- package/dist/components/sidebar/group.js +18 -13
- package/dist/components/sidebar/layout.d.ts +7 -2
- package/dist/components/sidebar/layout.js +11 -3
- package/dist/components/sidebar/menu-sub.d.ts +4 -3
- package/dist/components/sidebar/menu-sub.js +13 -13
- package/dist/components/sidebar/menu.d.ts +6 -6
- package/dist/components/sidebar/menu.js +28 -40
- package/dist/components/sidebar/panel.js +10 -15
- package/dist/components/sidebar/root.d.ts +1 -2
- package/dist/components/sidebar/root.js +7 -8
- package/dist/components/sidebar/trigger.js +1 -1
- package/dist/components/sidebar-tree-indicator.js +4 -4
- package/dist/components/skeleton.d.ts +7 -1
- package/dist/components/skeleton.js +18 -2
- package/dist/components/slider.d.ts +5 -5
- package/dist/components/slider.js +20 -11
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +24 -188
- package/dist/components/string-array.js +2 -2
- package/dist/components/switch.d.ts +2 -3
- package/dist/components/switch.js +6 -8
- package/dist/components/table.d.ts +14 -3
- package/dist/components/table.js +33 -9
- package/dist/components/tabs.d.ts +34 -8
- package/dist/components/tabs.js +96 -23
- package/dist/components/text-overflow.d.ts +8 -10
- package/dist/components/text-overflow.js +33 -39
- package/dist/components/textarea.d.ts +8 -1
- package/dist/components/textarea.js +24 -3
- package/dist/components/toaster.d.ts +1 -0
- package/dist/components/toaster.js +41 -20
- package/dist/components/toggle-group.d.ts +5 -3
- package/dist/components/toggle-group.js +11 -12
- package/dist/components/toggle.d.ts +3 -4
- package/dist/components/toggle.js +6 -6
- package/dist/components/tooltip.d.ts +7 -6
- package/dist/components/tooltip.js +18 -8
- package/dist/components/upload.d.ts +7 -2
- package/dist/components/upload.js +28 -7
- package/dist/components.css +325 -0
- package/dist/constants/CountryPhoneCodes.d.ts +1 -1
- package/dist/constants/CountryPhoneCodes.js +2 -2
- package/dist/federation.d.ts +10 -0
- package/dist/federation.js +24 -0
- package/dist/fonts.css +1 -1
- package/dist/hooks/use-confirm.js +17 -19
- package/dist/hooks/use-toast.d.ts +14 -16
- package/dist/hooks/use-toast.js +13 -108
- package/dist/index.d.ts +9 -8
- package/dist/index.js +7 -7
- package/dist/lib/cn-tables.d.ts +27 -0
- package/dist/lib/cn-tables.js +128 -0
- package/dist/lib/utils.d.ts +14 -2
- package/dist/lib/utils.js +14 -6
- package/dist/modules/attachments/attachment-media.js +56 -56
- package/dist/modules/blocks/components/BarcodeAttribute.js +11 -8
- package/dist/modules/blocks/components/BarcodeSizeSettings.js +5 -6
- package/dist/modules/blocks/components/BlockEditor.js +14 -4
- package/dist/modules/blocks/components/BlockEditorInlineContent.d.ts +26 -36
- package/dist/modules/blocks/components/BlockEditorInlineContent.js +2 -2
- package/dist/modules/blocks/components/BlockToolbar.d.ts +6 -0
- package/dist/modules/blocks/components/BlockToolbar.js +19 -4
- package/dist/modules/blocks/components/CustomFileBlock.d.ts +13 -39
- package/dist/modules/blocks/components/CustomFileBlock.js +8 -9
- package/dist/modules/blocks/components/CustomImageBlock.d.ts +28 -78
- package/dist/modules/blocks/components/CustomImageBlock.js +20 -99
- package/dist/modules/blocks/components/CustomVideoBlock.d.ts +26 -63
- package/dist/modules/blocks/components/CustomVideoBlock.js +10 -8
- package/dist/modules/blocks/components/DocumentPlaceholderBlock.d.ts +13 -39
- package/dist/modules/blocks/components/DocumentPlaceholderBlock.js +1 -2
- package/dist/modules/blocks/components/Editor.d.ts +1 -1
- package/dist/modules/blocks/components/Editor.js +5 -4
- package/dist/modules/blocks/components/FontFamilyButton.js +25 -21
- package/dist/modules/blocks/components/FontSizeButton.js +26 -22
- package/dist/modules/blocks/components/GalleryBlock.d.ts +7 -25
- package/dist/modules/blocks/components/GalleryBlock.js +2 -35
- package/dist/modules/blocks/components/GalleryBlockContent.js +8 -3
- package/dist/modules/blocks/components/GalleryBlockParts.js +23 -21
- package/dist/modules/blocks/components/GalleryExternalHtml.d.ts +2 -0
- package/dist/modules/blocks/components/GalleryExternalHtml.js +36 -0
- package/dist/modules/blocks/components/ImageExternalHtml.d.ts +2 -0
- package/dist/modules/blocks/components/ImageExternalHtml.js +51 -0
- package/dist/modules/blocks/components/ImageStyleButton.js +22 -18
- package/dist/modules/blocks/components/LazyEditor.d.ts +9 -0
- package/dist/modules/blocks/components/LazyEditor.js +14 -0
- package/dist/modules/blocks/components/MediaBlockWrapper.d.ts +24 -0
- package/dist/modules/blocks/components/MediaBlockWrapper.js +98 -0
- package/dist/modules/blocks/components/SlashMenu.js +2 -2
- package/dist/modules/blocks/components/SuggestionMenu.js +5 -6
- package/dist/modules/blocks/components/TableColorPicker.d.ts +1 -1
- package/dist/modules/blocks/components/TableColorPicker.js +20 -27
- package/dist/modules/blocks/components/TableHandleWithRemove.js +34 -50
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarButton.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarButton.js +3 -4
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarToggle.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/buttons/ToolbarToggle.js +3 -4
- package/dist/modules/blocks/components/toolbar/menus/MenuCheckboxItem.d.ts +3 -0
- package/dist/modules/blocks/components/toolbar/menus/MenuCheckboxItem.js +8 -0
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuDropdown.js +1 -1
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuItem.d.ts +2 -2
- package/dist/modules/blocks/components/toolbar/menus/ToolbarMenuItem.js +5 -16
- package/dist/modules/blocks/components/toolbar/menus/ToolbarSelect.d.ts +1 -1
- package/dist/modules/blocks/components/toolbar/menus/ToolbarSelect.js +24 -20
- package/dist/modules/blocks/constant/blockEditorSchema.d.ts +268 -653
- package/dist/modules/blocks/constant/blockEditorSchema.js +33 -41
- package/dist/modules/blocks/constant/galleryBlockConfig.d.ts +1 -2
- package/dist/modules/blocks/constant/imageBlockConfig.d.ts +46 -0
- package/dist/modules/blocks/constant/imageBlockConfig.js +39 -0
- package/dist/modules/blocks/constant/toolbar/editorUIComponents.d.ts +2 -3
- package/dist/modules/blocks/constant/toolbar/editorUIComponents.js +7 -9
- package/dist/modules/blocks/hooks/toolbar/useCodeActive.js +5 -7
- package/dist/modules/blocks/hooks/toolbar/useStringStyle.d.ts +9 -0
- package/dist/modules/blocks/hooks/toolbar/useStringStyle.js +27 -0
- package/dist/modules/blocks/hooks/useBlockEditor.d.ts +2 -0
- package/dist/modules/blocks/hooks/useBlockEditor.js +9 -3
- package/dist/modules/blocks/hooks/useEditorValue.d.ts +2 -1
- package/dist/modules/blocks/hooks/useEditorValue.js +8 -19
- package/dist/modules/blocks/types/TextEditor.d.ts +3 -1
- package/dist/modules/blocks/types/toolbar/ImageStyleOption.d.ts +1 -1
- package/dist/modules/blocks/utils/getSlashMenuItems.js +0 -15
- package/dist/modules/blocks/utils/parseBlocks.d.ts +3 -1
- package/dist/modules/blocks/utils/parseBlocks.js +14 -1
- package/dist/modules/display/components/EmailDisplay.js +26 -27
- package/dist/modules/display/components/PhoneDisplay.js +2 -2
- package/dist/modules/display/components/RelativeDateDisplay.d.ts +2 -2
- package/dist/modules/display/components/RelativeDateDisplay.js +7 -10
- package/dist/modules/filter/components/FilterBar.js +6 -6
- package/dist/modules/filter/components/FilterDialog.js +13 -20
- package/dist/modules/filter/components/FilterPopover.js +20 -28
- package/dist/modules/hotkey/components/PopoverScoped.d.ts +5 -4
- package/dist/modules/hotkey/components/PopoverScoped.js +5 -5
- package/dist/modules/hotkey/hooks/useScopedHotkeys.d.ts +3 -3
- package/dist/modules/hotkey/hooks/useScopedHotkeys.js +15 -24
- package/dist/modules/icons/components/IconComponent.d.ts +1 -1
- package/dist/modules/icons/components/IconPicker.js +15 -14
- package/dist/modules/inputs/components/ContactFieldParts.js +13 -14
- package/dist/modules/inputs/components/EmailFieldForm.js +2 -3
- package/dist/modules/inputs/components/FullNameField.js +6 -4
- package/dist/modules/inputs/components/PhoneFieldForm.js +2 -1
- package/dist/modules/layout/components/AppLayout.js +18 -20
- package/dist/modules/layout/components/AppLayoutPageSlot.js +1 -1
- package/dist/modules/layout/components/AppLayoutResizeHandle.js +1 -1
- package/dist/modules/layout/components/Page.d.ts +6 -1
- package/dist/modules/layout/components/Page.js +11 -3
- package/dist/modules/layout/components/PageHeader.d.ts +10 -3
- package/dist/modules/layout/components/PageHeader.js +19 -4
- package/dist/modules/navigation-menu/components/NavigationMenu.js +12 -15
- package/dist/modules/record-field/components/NumberField.d.ts +2 -2
- package/dist/modules/record-field/components/NumberField.js +22 -25
- package/dist/modules/record-field/components/TextField.d.ts +3 -3
- package/dist/modules/record-field/components/TextField.js +25 -28
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.d.ts +3 -1
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.js +18 -12
- package/dist/modules/record-table/components/CheckboxColumn.d.ts +4 -3
- package/dist/modules/record-table/components/CheckboxColumn.js +52 -35
- package/dist/modules/record-table/components/MoreColumn.js +4 -3
- package/dist/modules/record-table/components/RecordTable.d.ts +3 -2
- package/dist/modules/record-table/components/RecordTable.js +2 -1
- package/dist/modules/record-table/components/RecordTableCell.d.ts +6 -3
- package/dist/modules/record-table/components/RecordTableCell.js +17 -11
- package/dist/modules/record-table/components/RecordTableCellInline.d.ts +15 -4
- package/dist/modules/record-table/components/RecordTableCellInline.js +48 -24
- package/dist/modules/record-table/components/RecordTableColumnSelector.d.ts +1 -2
- package/dist/modules/record-table/components/RecordTableColumnSelector.js +48 -45
- package/dist/modules/record-table/components/RecordTableContainer.d.ts +8 -3
- package/dist/modules/record-table/components/RecordTableContainer.js +28 -16
- package/dist/modules/record-table/components/RecordTableCursor.js +4 -4
- package/dist/modules/record-table/components/RecordTableHead.d.ts +9 -4
- package/dist/modules/record-table/components/RecordTableHead.js +40 -34
- package/dist/modules/record-table/components/RecordTableHeader.js +24 -15
- package/dist/modules/record-table/components/RecordTableProvider.d.ts +30 -7
- package/dist/modules/record-table/components/RecordTableProvider.js +32 -22
- package/dist/modules/record-table/components/RecordTableRoot.d.ts +2 -1
- package/dist/modules/record-table/components/RecordTableRoot.js +7 -12
- package/dist/modules/record-table/components/RecordTableRow.d.ts +8 -1
- package/dist/modules/record-table/components/RecordTableRow.js +13 -12
- package/dist/modules/record-table/components/RecordTableRowList.d.ts +6 -1
- package/dist/modules/record-table/components/RecordTableRowList.js +28 -20
- package/dist/modules/record-table/components/RecordTableRowSkeleton.js +8 -12
- package/dist/modules/record-table/hooks/useColumnLayout.d.ts +2 -2
- package/dist/modules/record-table/hooks/useColumnLayout.js +8 -5
- package/dist/modules/record-table/hooks/useTablePreferences.d.ts +5 -5
- package/dist/modules/record-table/hooks/useTablePreferences.js +3 -3
- package/dist/modules/record-table/utils/columnLayout.d.ts +4 -4
- package/dist/modules/record-table/utils/columnLayout.js +7 -7
- package/dist/modules/record-table/utils/columnUtils.d.ts +3 -2
- package/dist/modules/record-table/utils/rowFields.d.ts +1 -0
- package/dist/modules/record-table/utils/rowFields.js +10 -9
- package/dist/styles.css +3 -0
- package/dist/theme.css +102 -69
- package/dist/utils/file-storage.d.ts +1 -1
- package/dist/utils/plugin-runtime.d.ts +1 -1
- package/dist/utils/record-timeline.d.ts +1 -1
- package/dist/utils/record-timeline.js +1 -1
- package/package.json +25 -22
- package/dist/components/multiselect-options.d.ts +0 -16
- package/dist/components/multiselect-options.js +0 -13
- package/dist/components/multiselect-parts.d.ts +0 -23
- package/dist/components/multiselect-parts.js +0 -62
- package/dist/components/multiselect-state.d.ts +0 -66
- package/dist/components/multiselect-state.js +0 -131
- package/dist/components/time-picker.d.ts +0 -10
- package/dist/components/time-picker.js +0 -33
- package/dist/components/toasts.d.ts +0 -21
- package/dist/components/toasts.js +0 -69
- package/dist/modules/blocks/hooks/toolbar/useFontFamily.d.ts +0 -2
- package/dist/modules/blocks/hooks/toolbar/useFontFamily.js +0 -24
- package/dist/modules/blocks/hooks/toolbar/useFontSize.d.ts +0 -2
- package/dist/modules/blocks/hooks/toolbar/useFontSize.js +0 -24
- package/dist/modules/blocks/types/toolbar/EditorVisibleBounds.d.ts +0 -6
- package/dist/modules/blocks/types/toolbar/EditorVisibleBounds.js +0 -0
- package/dist/modules/blocks/types/toolbar/FontFamily.d.ts +0 -5
- package/dist/modules/blocks/types/toolbar/FontFamily.js +0 -0
- package/dist/modules/blocks/types/toolbar/FontSize.d.ts +0 -5
- package/dist/modules/blocks/types/toolbar/FontSize.js +0 -0
- package/dist/modules/blocks/types/toolbar/ToolbarMenuItemProps.d.ts +0 -4
- package/dist/modules/blocks/types/toolbar/ToolbarMenuItemProps.js +0 -0
- package/dist/modules/blocks/types/toolbar/ToolbarPositioningOptions.d.ts +0 -3
- package/dist/modules/blocks/types/toolbar/ToolbarPositioningOptions.js +0 -0
- package/dist/modules/blocks/utils/toolbar/getEditorVisibleBounds.d.ts +0 -2
- package/dist/modules/blocks/utils/toolbar/getEditorVisibleBounds.js +0 -30
- package/dist/modules/blocks/utils/toolbar/getToolbarPositioning.d.ts +0 -2
- package/dist/modules/blocks/utils/toolbar/getToolbarPositioning.js +0 -41
- package/dist/modules/hotkey/hooks/useScopedHotKeysCallback.d.ts +0 -9
- package/dist/modules/hotkey/hooks/useScopedHotKeysCallback.js +0 -15
- package/dist/modules/hotkey/states/internal/pendingHotkeyState.d.ts +0 -4
- package/dist/modules/hotkey/states/internal/pendingHotkeyState.js +0 -4
package/dist/hooks/use-toast.js
CHANGED
|
@@ -1,113 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Toast } from "@base-ui/react/toast";
|
|
2
2
|
// src/hooks/use-toast.tsx
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const addToRemoveQueue = (toastId) => {
|
|
12
|
-
if (toastTimeouts.has(toastId)) return;
|
|
13
|
-
const timeout = setTimeout(() => {
|
|
14
|
-
toastTimeouts.delete(toastId);
|
|
15
|
-
dispatch({
|
|
16
|
-
type: "REMOVE_TOAST",
|
|
17
|
-
toastId
|
|
18
|
-
});
|
|
19
|
-
}, TOAST_REMOVE_DELAY);
|
|
20
|
-
toastTimeouts.set(toastId, timeout);
|
|
21
|
-
};
|
|
22
|
-
const reducer = (state, action) => {
|
|
23
|
-
switch (action.type) {
|
|
24
|
-
case "ADD_TOAST": return {
|
|
25
|
-
...state,
|
|
26
|
-
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
|
|
27
|
-
};
|
|
28
|
-
case "UPDATE_TOAST": return {
|
|
29
|
-
...state,
|
|
30
|
-
toasts: state.toasts.map((t) => t.id === action.toast.id ? {
|
|
31
|
-
...t,
|
|
32
|
-
...action.toast
|
|
33
|
-
} : t)
|
|
34
|
-
};
|
|
35
|
-
case "DISMISS_TOAST": {
|
|
36
|
-
const { toastId } = action;
|
|
37
|
-
if (toastId) addToRemoveQueue(toastId);
|
|
38
|
-
else state.toasts.forEach((item) => {
|
|
39
|
-
addToRemoveQueue(item.id);
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
...state,
|
|
43
|
-
toasts: state.toasts.map((t) => t.id === toastId || toastId === void 0 ? {
|
|
44
|
-
...t,
|
|
45
|
-
open: false
|
|
46
|
-
} : t)
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
case "REMOVE_TOAST":
|
|
50
|
-
if (action.toastId === void 0) return {
|
|
51
|
-
...state,
|
|
52
|
-
toasts: []
|
|
53
|
-
};
|
|
54
|
-
return {
|
|
55
|
-
...state,
|
|
56
|
-
toasts: state.toasts.filter((t) => t.id !== action.toastId)
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
61
|
-
let memoryState = { toasts: [] };
|
|
62
|
-
const subscribe = (listener) => {
|
|
63
|
-
listeners.add(listener);
|
|
64
|
-
return () => {
|
|
65
|
-
listeners.delete(listener);
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
const getSnapshot = () => memoryState;
|
|
69
|
-
function dispatch(action) {
|
|
70
|
-
memoryState = reducer(memoryState, action);
|
|
71
|
-
listeners.forEach((listener) => listener());
|
|
72
|
-
}
|
|
73
|
-
function toast(props) {
|
|
74
|
-
const id = genId();
|
|
75
|
-
const update = (next) => dispatch({
|
|
76
|
-
type: "UPDATE_TOAST",
|
|
77
|
-
toast: {
|
|
78
|
-
...next,
|
|
79
|
-
id
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
const dismiss = () => dispatch({
|
|
83
|
-
type: "DISMISS_TOAST",
|
|
84
|
-
toastId: id
|
|
85
|
-
});
|
|
86
|
-
dispatch({
|
|
87
|
-
type: "ADD_TOAST",
|
|
88
|
-
toast: {
|
|
89
|
-
...props,
|
|
90
|
-
id,
|
|
91
|
-
open: true,
|
|
92
|
-
onOpenChange: (open) => {
|
|
93
|
-
if (!open) dismiss();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
3
|
+
/** The one queue every toast goes through; the Toaster renders it. */
|
|
4
|
+
const toastManager = Toast.createToastManager();
|
|
5
|
+
const toast = ({ title, description, variant = "default", action }) => {
|
|
6
|
+
const id = toastManager.add({
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
type: variant,
|
|
10
|
+
data: { action }
|
|
96
11
|
});
|
|
97
12
|
return {
|
|
98
13
|
id,
|
|
99
|
-
dismiss
|
|
100
|
-
update
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function useToast() {
|
|
104
|
-
return {
|
|
105
|
-
...React.useSyncExternalStore(subscribe, getSnapshot),
|
|
106
|
-
toast,
|
|
107
|
-
dismiss: (toastId) => dispatch({
|
|
108
|
-
type: "DISMISS_TOAST",
|
|
109
|
-
toastId
|
|
110
|
-
})
|
|
14
|
+
dismiss: () => toastManager.close(id)
|
|
111
15
|
};
|
|
112
|
-
}
|
|
113
|
-
|
|
16
|
+
};
|
|
17
|
+
const useToast = () => ({ toast });
|
|
18
|
+
export { toast, toastManager, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { Command } from "./components/command.js";
|
|
|
20
20
|
import { ContextMenu } from "./components/context-menu.js";
|
|
21
21
|
import { CopyText } from "./components/copy-text.js";
|
|
22
22
|
import { DatePicker } from "./components/date-picker.js";
|
|
23
|
+
import { DateInput, TimeField } from "./components/date-time-input.js";
|
|
23
24
|
import { Dialog } from "./components/dialog.js";
|
|
24
25
|
import { DragHandle } from "./components/drag-handle.js";
|
|
25
26
|
import { DropdownMenu } from "./components/dropdown-menu.js";
|
|
@@ -28,28 +29,26 @@ import { Form } from "./components/form.js";
|
|
|
28
29
|
import { HoverCard } from "./components/hover-card.js";
|
|
29
30
|
import { InfoCard } from "./components/info-card.js";
|
|
30
31
|
import { Input } from "./components/input.js";
|
|
32
|
+
import { InputGroup } from "./components/input-group.js";
|
|
31
33
|
import { Kbd } from "./components/kbd.js";
|
|
32
34
|
import { Label } from "./components/label.js";
|
|
33
|
-
import { MultipleSelector } from "./components/
|
|
35
|
+
import { MultipleSelector, Resizable, Slider } from "./components/on-demand.js";
|
|
36
|
+
import { MultiSelectOption } from "./components/multiselect.js";
|
|
34
37
|
import { Popover } from "./components/popover.js";
|
|
35
|
-
import { MultiSelectOption } from "./components/multiselect-options.js";
|
|
36
38
|
import { RadioGroup } from "./components/radio-group.js";
|
|
37
|
-
import { Resizable } from "./components/resizable.js";
|
|
38
39
|
import { ScrollArea } from "./components/scroll-area.js";
|
|
39
40
|
import { Select } from "./components/select.js";
|
|
40
41
|
import { Separator } from "./components/separator.js";
|
|
41
42
|
import { Sheet } from "./components/sheet.js";
|
|
42
43
|
import { Sidebar } from "./components/sidebar.js";
|
|
43
44
|
import { Skeleton } from "./components/skeleton.js";
|
|
44
|
-
import { Slider } from "./components/slider.js";
|
|
45
45
|
import { Spinner } from "./components/spinner.js";
|
|
46
46
|
import { StringArrayInput } from "./components/string-array.js";
|
|
47
47
|
import { Switch } from "./components/switch.js";
|
|
48
48
|
import { Table } from "./components/table.js";
|
|
49
|
-
import { Tabs } from "./components/tabs.js";
|
|
49
|
+
import { TabButton, Tabs } from "./components/tabs.js";
|
|
50
50
|
import { TextOverflowTooltip } from "./components/text-overflow.js";
|
|
51
51
|
import { Textarea } from "./components/textarea.js";
|
|
52
|
-
import { DateInput, TimeField } from "./components/time-picker.js";
|
|
53
52
|
import { Toaster } from "./components/toaster.js";
|
|
54
53
|
import { ToggleGroup } from "./components/toggle-group.js";
|
|
55
54
|
import { Toggle } from "./components/toggle.js";
|
|
@@ -60,7 +59,8 @@ import { useMultiQueryState, useQueryState } from "./hooks/use-query-state.js";
|
|
|
60
59
|
import { toast, useToast } from "./hooks/use-toast.js";
|
|
61
60
|
import { useUpload } from "./hooks/use-upload.js";
|
|
62
61
|
import { cn } from "./lib/utils.js";
|
|
63
|
-
import { Editor } from "./modules/blocks/components/
|
|
62
|
+
import { Editor } from "./modules/blocks/components/LazyEditor.js";
|
|
63
|
+
import { editorText } from "./modules/blocks/utils/parseBlocks.js";
|
|
64
64
|
import { EmailDisplay } from "./modules/display/components/EmailDisplay.js";
|
|
65
65
|
import { PhoneDisplay } from "./modules/display/components/PhoneDisplay.js";
|
|
66
66
|
import { RelativeDateDisplay } from "./modules/display/components/RelativeDateDisplay.js";
|
|
@@ -86,6 +86,7 @@ import { NumberField } from "./modules/record-field/components/NumberField.js";
|
|
|
86
86
|
import { TextField } from "./modules/record-field/components/TextField.js";
|
|
87
87
|
import { PhoneInput } from "./modules/record-field/meta-inputs/components/PhoneInput.js";
|
|
88
88
|
import { RecordTable } from "./modules/record-table/components/RecordTable.js";
|
|
89
|
+
import { RecordTableColumnDef } from "./modules/record-table/components/RecordTableProvider.js";
|
|
89
90
|
import { RecordTableInlineCell } from "./modules/record-table/components/RecordTableCellInline.js";
|
|
90
91
|
import { EnumCursorDirection } from "./modules/record-table/types/RecordTableCursorTypes.js";
|
|
91
92
|
import { themeState } from "./state/themeState.js";
|
|
@@ -100,4 +101,4 @@ import { getPluginAssetsUrl } from "./utils/getPluginAssetsUrl.js";
|
|
|
100
101
|
import { jsonOf } from "./utils/json.js";
|
|
101
102
|
import { PluginLiveMessage, PluginRuntime, PluginSession, getPluginRuntime, pluginFetch, pluginJson, setPluginRuntime, useLiveSignal } from "./utils/plugin-runtime.js";
|
|
102
103
|
import { RecordTimeline, RecordTimelineProps, setRecordTimeline } from "./utils/record-timeline.js";
|
|
103
|
-
export { Accordion, Alert, AlertDialog, AppLayout, AppLayoutFooterLink, Avatar, type AvatarProps, BackgroundGradientAnimation, Badge, type BadgeProps, Breadcrumb, Button, type ButtonProps, Calendar, type CalendarProps, Card, type ChartConfig, ChartContainer, ChartLegendContent, ChartTooltipContent, Checkbox, ChoiceboxGroup, Collapsible, ColorPicker, Combobox, Command, CommandBar, ContextMenu, CopyText, DateInput, DatePicker, Dialog, DragHandle, DropdownMenu, Editor, EmailDisplay, EmailListField, Empty, EnumCursorDirection, type FileStorageAdapter, Filter, Form, FullNameField, FullNameValue, HoverCard, type IUIConfig, IconComponent, IconPicker, IconsProvider, InfoCard, Input, Kbd, Label, type MultiSelectOption, MultipleSelector, NavigationMenuLinkItem, NumberField, PageContainer, PageHeader, PageSubHeader, PhoneDisplay, PhoneField, PhoneInput, type PluginLiveMessage, type PluginRuntime, type PluginSession, Popover, PopoverScoped, RadioGroup, RecordTable, RecordTableInlineCell, RecordTimeline, type RecordTimelineProps, RelativeDateDisplay, Resizable, ScrollArea, Select, Separator, SexCode, SexDisplay, SexField, Sheet, Sidebar, Skeleton, Slider, Spinner, StringArrayInput, Switch, type TActivityRowProps, type TDashboardWidgetPreview, type TPropertyInputMeta, type TPropertyInputProps, Table, Tabs, TextField, TextOverflowTooltip, Textarea, type ThemeOption, TimeField, Toaster, Toggle, ToggleGroup, Tooltip, Upload, badgeVariants, buttonVariants, cn, formatPhoneNumber, getPluginAssetsUrl, getPluginRuntime, isUndefinedOrNull, jsonOf, pluginFetch, pluginJson, readImage, setFileStorage, setPluginRuntime, setRecordTimeline, themeState, toast, useConfirm, useFilterContext, useFilterQueryState, useLiveSignal, useMultiQueryState, usePreviousHotkeyScope, useQueryState, useScopedHotkeys, useToast, useUpload };
|
|
104
|
+
export { Accordion, Alert, AlertDialog, AppLayout, AppLayoutFooterLink, Avatar, type AvatarProps, BackgroundGradientAnimation, Badge, type BadgeProps, Breadcrumb, Button, type ButtonProps, Calendar, type CalendarProps, Card, type ChartConfig, ChartContainer, ChartLegendContent, ChartTooltipContent, Checkbox, ChoiceboxGroup, Collapsible, ColorPicker, Combobox, Command, CommandBar, ContextMenu, CopyText, DateInput, DatePicker, Dialog, DragHandle, DropdownMenu, Editor, EmailDisplay, EmailListField, Empty, EnumCursorDirection, type FileStorageAdapter, Filter, Form, FullNameField, FullNameValue, HoverCard, type IUIConfig, IconComponent, IconPicker, IconsProvider, InfoCard, Input, InputGroup, Kbd, Label, type MultiSelectOption, MultipleSelector, NavigationMenuLinkItem, NumberField, PageContainer, PageHeader, PageSubHeader, PhoneDisplay, PhoneField, PhoneInput, type PluginLiveMessage, type PluginRuntime, type PluginSession, Popover, PopoverScoped, RadioGroup, RecordTable, type RecordTableColumnDef, RecordTableInlineCell, RecordTimeline, type RecordTimelineProps, RelativeDateDisplay, Resizable, ScrollArea, Select, Separator, SexCode, SexDisplay, SexField, Sheet, Sidebar, Skeleton, Slider, Spinner, StringArrayInput, Switch, type TActivityRowProps, type TDashboardWidgetPreview, type TPropertyInputMeta, type TPropertyInputProps, TabButton, Table, Tabs, TextField, TextOverflowTooltip, Textarea, type ThemeOption, TimeField, Toaster, Toggle, ToggleGroup, Tooltip, Upload, badgeVariants, buttonVariants, cn, editorText, formatPhoneNumber, getPluginAssetsUrl, getPluginRuntime, isUndefinedOrNull, jsonOf, pluginFetch, pluginJson, readImage, setFileStorage, setPluginRuntime, setRecordTimeline, themeState, toast, useConfirm, useFilterContext, useFilterQueryState, useLiveSignal, useMultiQueryState, usePreviousHotkeyScope, useQueryState, useScopedHotkeys, useToast, useUpload };
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { Command } from "./components/command.js";
|
|
|
19
19
|
import { ContextMenu } from "./components/context-menu.js";
|
|
20
20
|
import { CopyText } from "./components/copy-text.js";
|
|
21
21
|
import { DatePicker } from "./components/date-picker.js";
|
|
22
|
+
import { DateInput, TimeField } from "./components/date-time-input.js";
|
|
22
23
|
import { Dialog } from "./components/dialog.js";
|
|
23
24
|
import { DragHandle } from "./components/drag-handle.js";
|
|
24
25
|
import { DropdownMenu } from "./components/dropdown-menu.js";
|
|
@@ -27,27 +28,25 @@ import { Form } from "./components/form.js";
|
|
|
27
28
|
import { HoverCard } from "./components/hover-card.js";
|
|
28
29
|
import { InfoCard } from "./components/info-card.js";
|
|
29
30
|
import { Input } from "./components/input.js";
|
|
31
|
+
import { InputGroup } from "./components/input-group.js";
|
|
30
32
|
import { Kbd } from "./components/kbd.js";
|
|
31
33
|
import { Label } from "./components/label.js";
|
|
32
|
-
import { MultipleSelector } from "./components/
|
|
34
|
+
import { MultipleSelector, Resizable, Slider } from "./components/on-demand.js";
|
|
33
35
|
import { Popover } from "./components/popover.js";
|
|
34
36
|
import { RadioGroup } from "./components/radio-group.js";
|
|
35
|
-
import { Resizable } from "./components/resizable.js";
|
|
36
37
|
import { ScrollArea } from "./components/scroll-area.js";
|
|
37
38
|
import { Select } from "./components/select.js";
|
|
38
39
|
import { Separator } from "./components/separator.js";
|
|
39
40
|
import { Sheet } from "./components/sheet.js";
|
|
40
41
|
import { Sidebar } from "./components/sidebar.js";
|
|
41
42
|
import { Skeleton } from "./components/skeleton.js";
|
|
42
|
-
import { Slider } from "./components/slider.js";
|
|
43
43
|
import { Spinner } from "./components/spinner.js";
|
|
44
44
|
import { StringArrayInput } from "./components/string-array.js";
|
|
45
45
|
import { Switch } from "./components/switch.js";
|
|
46
46
|
import { Table } from "./components/table.js";
|
|
47
|
-
import { Tabs } from "./components/tabs.js";
|
|
47
|
+
import { TabButton, Tabs } from "./components/tabs.js";
|
|
48
48
|
import { TextOverflowTooltip } from "./components/text-overflow.js";
|
|
49
49
|
import { Textarea } from "./components/textarea.js";
|
|
50
|
-
import { DateInput, TimeField } from "./components/time-picker.js";
|
|
51
50
|
import { Toaster } from "./components/toaster.js";
|
|
52
51
|
import { ToggleGroup } from "./components/toggle-group.js";
|
|
53
52
|
import { Toggle } from "./components/toggle.js";
|
|
@@ -58,7 +57,8 @@ import { useMultiQueryState, useQueryState } from "./hooks/use-query-state.js";
|
|
|
58
57
|
import { toast, useToast } from "./hooks/use-toast.js";
|
|
59
58
|
import { useUpload } from "./hooks/use-upload.js";
|
|
60
59
|
import { cn } from "./lib/utils.js";
|
|
61
|
-
import { Editor } from "./modules/blocks/components/
|
|
60
|
+
import { Editor } from "./modules/blocks/components/LazyEditor.js";
|
|
61
|
+
import { editorText } from "./modules/blocks/utils/parseBlocks.js";
|
|
62
62
|
import { EmailDisplay } from "./modules/display/components/EmailDisplay.js";
|
|
63
63
|
import { PhoneDisplay } from "./modules/display/components/PhoneDisplay.js";
|
|
64
64
|
import { RelativeDateDisplay } from "./modules/display/components/RelativeDateDisplay.js";
|
|
@@ -96,4 +96,4 @@ import { getPluginAssetsUrl } from "./utils/getPluginAssetsUrl.js";
|
|
|
96
96
|
import { jsonOf } from "./utils/json.js";
|
|
97
97
|
import { getPluginRuntime, pluginFetch, pluginJson, setPluginRuntime, useLiveSignal } from "./utils/plugin-runtime.js";
|
|
98
98
|
import { RecordTimeline, setRecordTimeline } from "./utils/record-timeline.js";
|
|
99
|
-
export { Accordion, Alert, AlertDialog, AppLayout, AppLayoutFooterLink, Avatar, BackgroundGradientAnimation, Badge, Breadcrumb, Button, Calendar, Card, ChartContainer, ChartLegendContent, ChartTooltipContent, Checkbox, ChoiceboxGroup, Collapsible, ColorPicker, Combobox, Command, CommandBar, ContextMenu, CopyText, DateInput, DatePicker, Dialog, DragHandle, DropdownMenu, Editor, EmailDisplay, EmailListField, Empty, EnumCursorDirection, Filter, Form, FullNameField, FullNameValue, HoverCard, IconComponent, IconPicker, IconsProvider, InfoCard, Input, Kbd, Label, MultipleSelector, NavigationMenuLinkItem, NumberField, PageContainer, PageHeader, PageSubHeader, PhoneDisplay, PhoneField, PhoneInput, Popover, PopoverScoped, RadioGroup, RecordTable, RecordTableInlineCell, RecordTimeline, RelativeDateDisplay, Resizable, ScrollArea, Select, Separator, SexCode, SexDisplay, SexField, Sheet, Sidebar, Skeleton, Slider, Spinner, StringArrayInput, Switch, Table, Tabs, TextField, TextOverflowTooltip, Textarea, TimeField, Toaster, Toggle, ToggleGroup, Tooltip, Upload, badgeVariants, buttonVariants, cn, formatPhoneNumber, getPluginAssetsUrl, getPluginRuntime, isUndefinedOrNull, jsonOf, pluginFetch, pluginJson, readImage, setFileStorage, setPluginRuntime, setRecordTimeline, themeState, toast, useConfirm, useFilterContext, useFilterQueryState, useLiveSignal, useMultiQueryState, usePreviousHotkeyScope, useQueryState, useScopedHotkeys, useToast, useUpload };
|
|
99
|
+
export { Accordion, Alert, AlertDialog, AppLayout, AppLayoutFooterLink, Avatar, BackgroundGradientAnimation, Badge, Breadcrumb, Button, Calendar, Card, ChartContainer, ChartLegendContent, ChartTooltipContent, Checkbox, ChoiceboxGroup, Collapsible, ColorPicker, Combobox, Command, CommandBar, ContextMenu, CopyText, DateInput, DatePicker, Dialog, DragHandle, DropdownMenu, Editor, EmailDisplay, EmailListField, Empty, EnumCursorDirection, Filter, Form, FullNameField, FullNameValue, HoverCard, IconComponent, IconPicker, IconsProvider, InfoCard, Input, InputGroup, Kbd, Label, MultipleSelector, NavigationMenuLinkItem, NumberField, PageContainer, PageHeader, PageSubHeader, PhoneDisplay, PhoneField, PhoneInput, Popover, PopoverScoped, RadioGroup, RecordTable, RecordTableInlineCell, RecordTimeline, RelativeDateDisplay, Resizable, ScrollArea, Select, Separator, SexCode, SexDisplay, SexField, Sheet, Sidebar, Skeleton, Slider, Spinner, StringArrayInput, Switch, TabButton, Table, Tabs, TextField, TextOverflowTooltip, Textarea, TimeField, Toaster, Toggle, ToggleGroup, Tooltip, Upload, badgeVariants, buttonVariants, cn, editorText, formatPhoneNumber, getPluginAssetsUrl, getPluginRuntime, isUndefinedOrNull, jsonOf, pluginFetch, pluginJson, readImage, setFileStorage, setPluginRuntime, setRecordTimeline, themeState, toast, useConfirm, useFilterContext, useFilterQueryState, useLiveSignal, useMultiQueryState, usePreviousHotkeyScope, useQueryState, useScopedHotkeys, useToast, useUpload };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
GROUP_COUNT: number;
|
|
3
|
+
customValidatorNames: string[];
|
|
4
|
+
edgeStart: Int32Array<ArrayBufferLike>;
|
|
5
|
+
labelStart: Int32Array<ArrayBufferLike>;
|
|
6
|
+
labelText: string;
|
|
7
|
+
edgeTarget: Int32Array<ArrayBuffer>;
|
|
8
|
+
nodeGroup: Int32Array<ArrayBufferLike>;
|
|
9
|
+
nodeVlist: Int32Array<ArrayBuffer>;
|
|
10
|
+
vlistPat: Int32Array<ArrayBufferLike>;
|
|
11
|
+
vlistOps: Int32Array<ArrayBufferLike>;
|
|
12
|
+
vlistRef: Int32Array<ArrayBufferLike>;
|
|
13
|
+
vlistGroup: Int32Array<ArrayBufferLike>;
|
|
14
|
+
litAnchor: Int32Array<ArrayBuffer>;
|
|
15
|
+
litGroup: Int32Array<ArrayBuffer>;
|
|
16
|
+
litPool: Int32Array<ArrayBuffer>;
|
|
17
|
+
poolOffsets: Int32Array<ArrayBuffer>;
|
|
18
|
+
poolText: string;
|
|
19
|
+
adjGid: Int32Array<ArrayBufferLike>;
|
|
20
|
+
adjStart: Int32Array<ArrayBufferLike>;
|
|
21
|
+
adjTgt: Int32Array<ArrayBufferLike>;
|
|
22
|
+
patGid: Int32Array<ArrayBufferLike>;
|
|
23
|
+
patTgt: Int32Array<ArrayBufferLike>;
|
|
24
|
+
postfixLookupGroups: Int32Array<ArrayBufferLike>;
|
|
25
|
+
orderSensitiveModifiers: string;
|
|
26
|
+
};
|
|
27
|
+
export { _default as default };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// src/lib/cn-tables.ts
|
|
2
|
+
const P = 48;
|
|
3
|
+
const U = (s, o = 0) => {
|
|
4
|
+
const out = new Int32Array(s.length);
|
|
5
|
+
for (let i = 0; i < s.length; i++) out[i] = s.charCodeAt(i) - P - o;
|
|
6
|
+
return out;
|
|
7
|
+
};
|
|
8
|
+
const PS = (counts) => {
|
|
9
|
+
const out = new Int32Array(counts.length + 1);
|
|
10
|
+
for (let i = 0; i < counts.length; i++) out[i + 1] = out[i] + counts[i];
|
|
11
|
+
return out;
|
|
12
|
+
};
|
|
13
|
+
const DZ = (s) => {
|
|
14
|
+
const out = new Int32Array(s.length);
|
|
15
|
+
let a = 0;
|
|
16
|
+
for (let i = 0; i < s.length; i++) {
|
|
17
|
+
const z = s.charCodeAt(i) - P;
|
|
18
|
+
a += z >>> 1 ^ -(z & 1);
|
|
19
|
+
out[i] = a;
|
|
20
|
+
}
|
|
21
|
+
return out;
|
|
22
|
+
};
|
|
23
|
+
const GROUP_COUNT = 384;
|
|
24
|
+
const customValidatorNames = [];
|
|
25
|
+
const edgeStart = PS(U("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010"));
|
|
26
|
+
const labelStart = PS(U(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3"));
|
|
27
|
+
const labelText = "@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom";
|
|
28
|
+
const edgeTarget = (() => {
|
|
29
|
+
const N = edgeStart.length - 1;
|
|
30
|
+
const sizes = new Int32Array(N);
|
|
31
|
+
for (let i = N - 1; i >= 0; i--) {
|
|
32
|
+
let s = 1;
|
|
33
|
+
let c = i + 1;
|
|
34
|
+
for (let k = edgeStart[i]; k < edgeStart[i + 1]; k++) {
|
|
35
|
+
s += sizes[c];
|
|
36
|
+
c += sizes[c];
|
|
37
|
+
}
|
|
38
|
+
sizes[i] = s;
|
|
39
|
+
}
|
|
40
|
+
const out = new Int32Array(edgeStart[N]);
|
|
41
|
+
let e = 0;
|
|
42
|
+
for (let i = 0; i < N; i++) {
|
|
43
|
+
let c = i + 1;
|
|
44
|
+
for (let k = edgeStart[i]; k < edgeStart[i + 1]; k++) {
|
|
45
|
+
out[e++] = c;
|
|
46
|
+
c += sizes[c];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
})();
|
|
51
|
+
const nodeGroup = U("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000", 1);
|
|
52
|
+
const vlistPat = PS(U("123333359346463635126536711575"));
|
|
53
|
+
const vlistOps = U("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;032B:032");
|
|
54
|
+
const vlistRef = U("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199");
|
|
55
|
+
const vlistGroup = DZ("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j000200200020020002002000200200020020002002000200020000200000200200200200200020002000020000200200200200200200202002002020020020020020020020020020202002002002002002002002000200200202002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002000200200200200200200020020020200200200200200200020202020002000200020002002002002000020200200");
|
|
56
|
+
const nodeVlist = (() => {
|
|
57
|
+
const out = (/* @__PURE__ */ new Int32Array(319)).fill(-1);
|
|
58
|
+
const A = DZ("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222");
|
|
59
|
+
const V = DZ("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");
|
|
60
|
+
for (let i = 0; i < A.length; i++) out[A[i]] = V[i];
|
|
61
|
+
return out;
|
|
62
|
+
})();
|
|
63
|
+
const SETS = "container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| accordion-down accordion-up appear bounce fifth first fourth none ping pulse second spin third| auto square video| auto cell fr max min px|none | auto cell full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto cell dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate| cell px|auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out out-quad out-quint spring| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto cell dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto cell dvw fit full lvw max min px screen svw| cell loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto cell px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| cell dvh fit full lh lvh max min none px screen svh| auto cell dvh dvw fit full lh lvh lvw max min none px screen svh svw| cell dvw fit full lvw max min none px screen svw| auto cell dvh dvw fit full lvh lvw max min none prose px svh svw| auto cell dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full lg md none sm|3d | auto smooth|gutter- auto both stable| auto none thin| button-outline button-primary destructive focus focus-destructive inner lg none sm subtle xl xs| auto cell dvh dvw fit full lvh lvw max min px svh svw| 2xl 2xs 3xs 4xs base lg sm xl xs| center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| cell full px| auto cell dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map((s) => {
|
|
64
|
+
const tails = s.split(" ");
|
|
65
|
+
const prefix = tails.shift();
|
|
66
|
+
for (let i = 0; i < tails.length; i++) tails[i] = prefix + tails[i];
|
|
67
|
+
return tails;
|
|
68
|
+
});
|
|
69
|
+
const AA = DZ("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422");
|
|
70
|
+
const AG = DZ("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622");
|
|
71
|
+
const AS = DZ("02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}22
:22z22222222222G000qOVI00000{2<40000@00000G¦§000ª00000000000000021K¬«00®000000000000000000000222HGH_1¸222½2¾2222ÇÊ000°2±");
|
|
72
|
+
const litAnchor = /* @__PURE__ */ new Int32Array(1148);
|
|
73
|
+
const litGroup = /* @__PURE__ */ new Int32Array(1148);
|
|
74
|
+
const litPool = /* @__PURE__ */ new Int32Array(1148);
|
|
75
|
+
let poolText = "";
|
|
76
|
+
const poolOffsets = /* @__PURE__ */ new Int32Array(1072);
|
|
77
|
+
{
|
|
78
|
+
const tailRef = /* @__PURE__ */ new Map();
|
|
79
|
+
let nextRef = 0;
|
|
80
|
+
let e = 0;
|
|
81
|
+
for (let i = 0; i < AA.length; i++) for (const tail of SETS[AS[i]]) {
|
|
82
|
+
let r = tailRef.get(tail);
|
|
83
|
+
if (r === void 0) {
|
|
84
|
+
r = nextRef++;
|
|
85
|
+
tailRef.set(tail, r);
|
|
86
|
+
poolOffsets[r * 2] = poolText.length;
|
|
87
|
+
poolOffsets[r * 2 + 1] = tail.length;
|
|
88
|
+
poolText += tail;
|
|
89
|
+
}
|
|
90
|
+
litAnchor[e] = AA[i];
|
|
91
|
+
litGroup[e] = AG[i];
|
|
92
|
+
litPool[e] = r;
|
|
93
|
+
e++;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const adjGid = DZ("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p");
|
|
97
|
+
const adjStart = PS(U("1::24444432:442:44:44>222222:44:4421322511111311111114"));
|
|
98
|
+
const adjTgt = DZ("24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222");
|
|
99
|
+
const patGid = U("ij");
|
|
100
|
+
const patTgt = U("");
|
|
101
|
+
const postfixLookupGroups = U("1");
|
|
102
|
+
var cn_tables_default = {
|
|
103
|
+
GROUP_COUNT,
|
|
104
|
+
customValidatorNames,
|
|
105
|
+
edgeStart,
|
|
106
|
+
labelStart,
|
|
107
|
+
labelText,
|
|
108
|
+
edgeTarget,
|
|
109
|
+
nodeGroup,
|
|
110
|
+
nodeVlist,
|
|
111
|
+
vlistPat,
|
|
112
|
+
vlistOps,
|
|
113
|
+
vlistRef,
|
|
114
|
+
vlistGroup,
|
|
115
|
+
litAnchor,
|
|
116
|
+
litGroup,
|
|
117
|
+
litPool,
|
|
118
|
+
poolOffsets,
|
|
119
|
+
poolText,
|
|
120
|
+
adjGid,
|
|
121
|
+
adjStart,
|
|
122
|
+
adjTgt,
|
|
123
|
+
patGid,
|
|
124
|
+
patTgt,
|
|
125
|
+
postfixLookupGroups,
|
|
126
|
+
orderSensitiveModifiers: "* ** after backdrop before details-content file first-letter first-line marker placeholder selection"
|
|
127
|
+
};
|
|
128
|
+
export { cn_tables_default as default };
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Ref, RefCallback } from "react";
|
|
2
|
+
declare module 'react' {
|
|
3
|
+
interface CSSProperties {
|
|
4
|
+
[variable: `--${string}`]: string | number | undefined;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Joins classes and drops the ones a later class overrides. The merge tables include the
|
|
9
|
+
* scales theme.css and styles.css declare in `@theme`, so `cn('shadow-sm', 'shadow-focus')`
|
|
10
|
+
* keeps only the last; `pnpm check:generated` fails when they are older than the theme.
|
|
11
|
+
*/
|
|
12
|
+
export declare const cn: import("cn").CnFunction;
|
|
13
|
+
/** One ref callback that sets every given ref, for an element both the component and its caller need. */
|
|
14
|
+
export declare const mergeRefs: <T>(...refs: (Ref<T> | undefined)[]) => RefCallback<T>;
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import cn_tables_default from "./cn-tables.js";
|
|
2
|
+
import { createCn } from "cn/engine";
|
|
3
3
|
// src/lib/utils.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Joins classes and drops the ones a later class overrides. The merge tables include the
|
|
6
|
+
* scales theme.css and styles.css declare in `@theme`, so `cn('shadow-sm', 'shadow-focus')`
|
|
7
|
+
* keeps only the last; `pnpm check:generated` fails when they are older than the theme.
|
|
8
|
+
*/
|
|
9
|
+
const cn = createCn(cn_tables_default);
|
|
10
|
+
/** One ref callback that sets every given ref, for an element both the component and its caller need. */
|
|
11
|
+
const mergeRefs = (...refs) => (node) => {
|
|
12
|
+
for (const ref of refs) if (typeof ref === "function") ref(node);
|
|
13
|
+
else if (ref) ref.current = node;
|
|
14
|
+
};
|
|
15
|
+
export { cn, mergeRefs };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Button } from "../../components/button.js";
|
|
1
|
+
import { Button, buttonVariants } from "../../components/button.js";
|
|
2
2
|
import { Dialog } from "../../components/dialog.js";
|
|
3
3
|
import { cn } from "../../lib/utils.js";
|
|
4
4
|
import { readImage } from "../../utils/core.js";
|
|
5
5
|
import { useCarousel } from "./use-carousel.js";
|
|
6
|
-
import { useState } from "react";
|
|
7
6
|
import { IconChevronLeft, IconChevronRight, IconDownload, IconX } from "@tabler/icons-react";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useState } from "react";
|
|
9
9
|
// src/modules/attachments/attachment-media.tsx
|
|
10
|
-
const navButtonClassName = "absolute bg-background/80 hover:bg-background p-1.5 rounded-full z-50 transition-colors";
|
|
11
10
|
/** Thumbnails drawn by `renderThumbnails`, each opening its image in a lightbox. */
|
|
12
11
|
const AttachmentPreview = ({ images, renderThumbnails }) => {
|
|
13
12
|
const [open, setOpen] = useState(false);
|
|
@@ -22,65 +21,66 @@ const AttachmentPreview = ({ images, renderThumbnails }) => {
|
|
|
22
21
|
open,
|
|
23
22
|
onOpenChange: setOpen,
|
|
24
23
|
children: /* @__PURE__ */ jsxs(Dialog.Content, {
|
|
25
|
-
|
|
24
|
+
variant: "bare",
|
|
25
|
+
className: "max-w-fit",
|
|
26
26
|
"aria-describedby": void 0,
|
|
27
|
-
children: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"aria-label": "Download file",
|
|
44
|
-
asChild: true,
|
|
45
|
-
children: /* @__PURE__ */ jsx("a", {
|
|
27
|
+
children: [/* @__PURE__ */ jsx(Dialog.Title, {
|
|
28
|
+
className: "sr-only",
|
|
29
|
+
children: current.name || "Image preview"
|
|
30
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: "relative p-6",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Button, {
|
|
34
|
+
variant: "overlay",
|
|
35
|
+
size: "icon",
|
|
36
|
+
className: "absolute top-6 -right-4 z-50",
|
|
37
|
+
onClick: () => setOpen(false),
|
|
38
|
+
"aria-label": "Close lightbox",
|
|
39
|
+
children: /* @__PURE__ */ jsx(IconX, { size: 20 })
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ jsx("a", {
|
|
42
|
+
"aria-label": "Download file",
|
|
46
43
|
target: "_blank",
|
|
47
44
|
rel: "noreferrer",
|
|
48
45
|
href: readImage(current.url),
|
|
49
|
-
className: cn(
|
|
46
|
+
className: cn(buttonVariants({
|
|
47
|
+
variant: "overlay",
|
|
48
|
+
size: "icon"
|
|
49
|
+
}), "absolute top-20 -right-4 z-50 -translate-y-1/2"),
|
|
50
50
|
children: /* @__PURE__ */ jsx(IconDownload, {})
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ jsx(Button, {
|
|
53
|
+
variant: "overlay",
|
|
54
|
+
size: "icon",
|
|
55
|
+
className: "absolute -left-4 top-1/2 z-50 -translate-y-1/2",
|
|
56
|
+
onClick: carousel.prev,
|
|
57
|
+
"aria-label": "Previous image",
|
|
58
|
+
children: /* @__PURE__ */ jsx(IconChevronLeft, { size: 24 })
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ jsx("img", {
|
|
61
|
+
src: readImage(current.url),
|
|
62
|
+
alt: current.name,
|
|
63
|
+
className: "max-w-lightbox max-h-lightbox object-contain rounded shadow-2xl select-none",
|
|
64
|
+
draggable: false
|
|
65
|
+
}, current.url),
|
|
66
|
+
/* @__PURE__ */ jsx(Button, {
|
|
67
|
+
variant: "overlay",
|
|
68
|
+
size: "icon",
|
|
69
|
+
className: "absolute -right-4 top-1/2 z-50 -translate-y-1/2",
|
|
70
|
+
onClick: carousel.next,
|
|
71
|
+
"aria-label": "Next image",
|
|
72
|
+
children: /* @__PURE__ */ jsx(IconChevronRight, { size: 24 })
|
|
73
|
+
}),
|
|
74
|
+
images.length > 1 && /* @__PURE__ */ jsxs("div", {
|
|
75
|
+
className: "absolute bottom-4 left-1/2 -translate-x-1/2 bg-background/70 text-foreground text-xs px-3 py-1 rounded-full",
|
|
76
|
+
children: [
|
|
77
|
+
carousel.index + 1,
|
|
78
|
+
" / ",
|
|
79
|
+
images.length
|
|
80
|
+
]
|
|
51
81
|
})
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
variant: "secondary",
|
|
55
|
-
size: "icon",
|
|
56
|
-
className: cn(navButtonClassName, "-left-4 top-1/2 -translate-y-1/2"),
|
|
57
|
-
onClick: carousel.prev,
|
|
58
|
-
"aria-label": "Previous image",
|
|
59
|
-
children: /* @__PURE__ */ jsx(IconChevronLeft, { size: 24 })
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ jsx("img", {
|
|
62
|
-
src: readImage(current.url),
|
|
63
|
-
alt: current.name,
|
|
64
|
-
className: "max-w-[90vw] max-h-[90vh] object-contain rounded shadow-2xl select-none",
|
|
65
|
-
draggable: false
|
|
66
|
-
}, current.url),
|
|
67
|
-
/* @__PURE__ */ jsx(Button, {
|
|
68
|
-
variant: "secondary",
|
|
69
|
-
size: "icon",
|
|
70
|
-
className: cn(navButtonClassName, "-right-4 top-1/2 -translate-y-1/2"),
|
|
71
|
-
onClick: carousel.next,
|
|
72
|
-
"aria-label": "Next image",
|
|
73
|
-
children: /* @__PURE__ */ jsx(IconChevronRight, { size: 24 })
|
|
74
|
-
}),
|
|
75
|
-
images.length > 1 && /* @__PURE__ */ jsxs("div", {
|
|
76
|
-
className: "absolute bottom-4 left-1/2 -translate-x-1/2 bg-background/70 text-foreground text-xs px-3 py-1 rounded-full",
|
|
77
|
-
children: [
|
|
78
|
-
carousel.index + 1,
|
|
79
|
-
" / ",
|
|
80
|
-
images.length
|
|
81
|
-
]
|
|
82
|
-
})
|
|
83
|
-
]
|
|
82
|
+
]
|
|
83
|
+
})]
|
|
84
84
|
})
|
|
85
85
|
})] });
|
|
86
86
|
};
|