@gemologic/sheen 0.1.0-rc.0
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/LICENSE +19 -0
- package/README.md +32 -0
- package/dist/core.d.ts +52 -0
- package/dist/core.js +29 -0
- package/dist/formisch.d.ts +5 -0
- package/dist/formisch.js +22 -0
- package/dist/forms.d.ts +34 -0
- package/dist/forms.js +18 -0
- package/dist/index.d.ts +144 -0
- package/dist/index.js +75 -0
- package/dist/layout/Layout.d.ts +28 -0
- package/dist/layout/Layout.js +121 -0
- package/dist/metadata.d.ts +46 -0
- package/dist/metadata.js +47 -0
- package/dist/navigation.d.ts +30 -0
- package/dist/navigation.js +16 -0
- package/dist/overlays.d.ts +28 -0
- package/dist/overlays.js +15 -0
- package/dist/primitives/Accordion.d.ts +16 -0
- package/dist/primitives/Accordion.js +223 -0
- package/dist/primitives/ActivityTimeline.d.ts +20 -0
- package/dist/primitives/ActivityTimeline.js +104 -0
- package/dist/primitives/AlertDialog.d.ts +7 -0
- package/dist/primitives/AlertDialog.js +8 -0
- package/dist/primitives/Avatar.d.ts +22 -0
- package/dist/primitives/Avatar.js +115 -0
- package/dist/primitives/Breadcrumb.d.ts +11 -0
- package/dist/primitives/Breadcrumb.js +66 -0
- package/dist/primitives/Button.d.ts +11 -0
- package/dist/primitives/Button.js +59 -0
- package/dist/primitives/ButtonGroup.d.ts +7 -0
- package/dist/primitives/ButtonGroup.js +33 -0
- package/dist/primitives/Checkbox.d.ts +22 -0
- package/dist/primitives/Checkbox.js +93 -0
- package/dist/primitives/CheckboxGroup.d.ts +18 -0
- package/dist/primitives/CheckboxGroup.js +122 -0
- package/dist/primitives/Collapsible.d.ts +9 -0
- package/dist/primitives/Collapsible.js +72 -0
- package/dist/primitives/Combobox.d.ts +41 -0
- package/dist/primitives/Combobox.js +684 -0
- package/dist/primitives/CommandPalette.d.ts +42 -0
- package/dist/primitives/CommandPalette.js +319 -0
- package/dist/primitives/ConfirmDialog.d.ts +11 -0
- package/dist/primitives/ConfirmDialog.js +42 -0
- package/dist/primitives/ContextMenu.d.ts +16 -0
- package/dist/primitives/ContextMenu.js +132 -0
- package/dist/primitives/DescriptionList.d.ts +11 -0
- package/dist/primitives/DescriptionList.js +44 -0
- package/dist/primitives/Dialog.d.ts +21 -0
- package/dist/primitives/Dialog.js +141 -0
- package/dist/primitives/Drawer.d.ts +9 -0
- package/dist/primitives/Drawer.js +21 -0
- package/dist/primitives/DropdownMenu.d.ts +59 -0
- package/dist/primitives/DropdownMenu.js +441 -0
- package/dist/primitives/EditableTextField.d.ts +11 -0
- package/dist/primitives/EditableTextField.js +126 -0
- package/dist/primitives/EmptyState.d.ts +7 -0
- package/dist/primitives/EmptyState.js +45 -0
- package/dist/primitives/Field.d.ts +18 -0
- package/dist/primitives/Field.js +72 -0
- package/dist/primitives/FileDropzone.d.ts +40 -0
- package/dist/primitives/FileDropzone.js +261 -0
- package/dist/primitives/IconButton.d.ts +8 -0
- package/dist/primitives/IconButton.js +34 -0
- package/dist/primitives/Input.d.ts +7 -0
- package/dist/primitives/Input.js +55 -0
- package/dist/primitives/InputGroup.d.ts +7 -0
- package/dist/primitives/InputGroup.js +73 -0
- package/dist/primitives/Link.d.ts +7 -0
- package/dist/primitives/Link.js +35 -0
- package/dist/primitives/LinkTooltip.d.ts +11 -0
- package/dist/primitives/LinkTooltip.js +88 -0
- package/dist/primitives/NavList.d.ts +17 -0
- package/dist/primitives/NavList.js +143 -0
- package/dist/primitives/Notice.d.ts +8 -0
- package/dist/primitives/Notice.js +64 -0
- package/dist/primitives/NumberField.d.ts +22 -0
- package/dist/primitives/NumberField.js +177 -0
- package/dist/primitives/Pagination.d.ts +12 -0
- package/dist/primitives/Pagination.js +127 -0
- package/dist/primitives/Popover.d.ts +12 -0
- package/dist/primitives/Popover.js +103 -0
- package/dist/primitives/Progress.d.ts +17 -0
- package/dist/primitives/Progress.js +98 -0
- package/dist/primitives/RadioGroup.d.ts +19 -0
- package/dist/primitives/RadioGroup.js +173 -0
- package/dist/primitives/Resizable.d.ts +36 -0
- package/dist/primitives/Resizable.js +196 -0
- package/dist/primitives/ScrollArea.d.ts +6 -0
- package/dist/primitives/ScrollArea.js +178 -0
- package/dist/primitives/SearchInput.d.ts +12 -0
- package/dist/primitives/SearchInput.js +89 -0
- package/dist/primitives/SegmentedControl.d.ts +25 -0
- package/dist/primitives/SegmentedControl.js +188 -0
- package/dist/primitives/Select.d.ts +24 -0
- package/dist/primitives/Select.js +320 -0
- package/dist/primitives/Separator.d.ts +6 -0
- package/dist/primitives/Separator.js +31 -0
- package/dist/primitives/ShortcutPending.d.ts +6 -0
- package/dist/primitives/ShortcutPending.js +40 -0
- package/dist/primitives/ShortcutProvider.d.ts +32 -0
- package/dist/primitives/ShortcutProvider.js +172 -0
- package/dist/primitives/ShortcutScope.d.ts +6 -0
- package/dist/primitives/ShortcutScope.js +29 -0
- package/dist/primitives/ShortcutSheet.d.ts +5 -0
- package/dist/primitives/ShortcutSheet.js +87 -0
- package/dist/primitives/Skeleton.d.ts +5 -0
- package/dist/primitives/Skeleton.js +23 -0
- package/dist/primitives/Slider.d.ts +35 -0
- package/dist/primitives/Slider.js +210 -0
- package/dist/primitives/Spinner.d.ts +7 -0
- package/dist/primitives/Spinner.js +44 -0
- package/dist/primitives/Status.d.ts +15 -0
- package/dist/primitives/Status.js +78 -0
- package/dist/primitives/Stepper.d.ts +32 -0
- package/dist/primitives/Stepper.js +147 -0
- package/dist/primitives/Surface.d.ts +11 -0
- package/dist/primitives/Surface.js +58 -0
- package/dist/primitives/Switch.d.ts +4 -0
- package/dist/primitives/Switch.js +7 -0
- package/dist/primitives/Table.d.ts +23 -0
- package/dist/primitives/Table.js +101 -0
- package/dist/primitives/Tabs.d.ts +17 -0
- package/dist/primitives/Tabs.js +157 -0
- package/dist/primitives/TagInput.d.ts +33 -0
- package/dist/primitives/TagInput.js +288 -0
- package/dist/primitives/Textarea.d.ts +8 -0
- package/dist/primitives/Textarea.js +106 -0
- package/dist/primitives/Toast.d.ts +10 -0
- package/dist/primitives/Toast.js +78 -0
- package/dist/primitives/Toaster.d.ts +9 -0
- package/dist/primitives/Toaster.js +183 -0
- package/dist/primitives/Tooltip.d.ts +13 -0
- package/dist/primitives/Tooltip.js +84 -0
- package/dist/primitives/Tree.d.ts +23 -0
- package/dist/primitives/Tree.js +275 -0
- package/dist/primitives/Typography.d.ts +16 -0
- package/dist/primitives/Typography.js +82 -0
- package/dist/primitives/boolean-input-state.d.ts +14 -0
- package/dist/primitives/boolean-input-state.js +39 -0
- package/dist/primitives/button-variants.d.ts +9 -0
- package/dist/primitives/button-variants.js +7 -0
- package/dist/primitives/choice-options.d.ts +7 -0
- package/dist/primitives/choice-options.js +35 -0
- package/dist/primitives/create-confirm.d.ts +15 -0
- package/dist/primitives/create-confirm.js +49 -0
- package/dist/primitives/create-toaster.d.ts +51 -0
- package/dist/primitives/create-toaster.js +87 -0
- package/dist/primitives/link-focus.d.ts +2 -0
- package/dist/primitives/link-focus.js +38 -0
- package/dist/primitives/menu-focus.d.ts +3 -0
- package/dist/primitives/menu-focus.js +32 -0
- package/dist/primitives/tooltip-layer.d.ts +14 -0
- package/dist/primitives/tooltip-layer.js +84 -0
- package/dist/theme/ThemeProvider.d.ts +59 -0
- package/dist/theme/ThemeProvider.js +239 -0
- package/dist/theme/intl.d.ts +6 -0
- package/dist/theme/intl.js +13 -0
- package/dist/theme/keyboard-script.d.ts +2 -0
- package/dist/theme/keyboard-script.js +6 -0
- package/dist/theme/layers.d.ts +7 -0
- package/dist/theme/layers.js +23 -0
- package/dist/theme/messages.d.ts +235 -0
- package/dist/theme/messages.js +115 -0
- package/dist/theme/script.d.ts +9 -0
- package/dist/theme/script.js +49 -0
- package/dist/theme/state.d.ts +27 -0
- package/dist/theme/state.js +55 -0
- package/dist/utils/browser-status.d.ts +5 -0
- package/dist/utils/browser-status.js +22 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/utils/cn.js +7 -0
- package/dist/utils/optimistic.d.ts +6 -0
- package/dist/utils/optimistic.js +16 -0
- package/dist/utils/polymorphic.d.ts +1 -0
- package/dist/utils/shortcut-platform.d.ts +2 -0
- package/dist/utils/shortcut-platform.js +10 -0
- package/dist/utils/shortcut-registry.d.ts +61 -0
- package/dist/utils/shortcut-registry.js +186 -0
- package/package.json +100 -0
- package/src/core.ts +55 -0
- package/src/formisch.ts +28 -0
- package/src/forms.ts +34 -0
- package/src/index.ts +144 -0
- package/src/layout/Layout.tsx +43 -0
- package/src/metadata.d.ts +46 -0
- package/src/metadata.ts +66 -0
- package/src/navigation.ts +30 -0
- package/src/overlays.ts +28 -0
- package/src/primitives/Accordion.tsx +145 -0
- package/src/primitives/ActivityTimeline.tsx +72 -0
- package/src/primitives/AlertDialog.tsx +8 -0
- package/src/primitives/Avatar.tsx +85 -0
- package/src/primitives/Breadcrumb.tsx +41 -0
- package/src/primitives/Button.tsx +27 -0
- package/src/primitives/ButtonGroup.tsx +18 -0
- package/src/primitives/Checkbox.tsx +51 -0
- package/src/primitives/CheckboxGroup.tsx +73 -0
- package/src/primitives/Collapsible.tsx +43 -0
- package/src/primitives/Combobox.tsx +402 -0
- package/src/primitives/CommandPalette.tsx +234 -0
- package/src/primitives/ConfirmDialog.tsx +25 -0
- package/src/primitives/ContextMenu.tsx +100 -0
- package/src/primitives/DescriptionList.tsx +26 -0
- package/src/primitives/Dialog.tsx +81 -0
- package/src/primitives/Drawer.tsx +26 -0
- package/src/primitives/DropdownMenu.tsx +221 -0
- package/src/primitives/EditableTextField.tsx +91 -0
- package/src/primitives/EmptyState.tsx +21 -0
- package/src/primitives/Field.tsx +38 -0
- package/src/primitives/FileDropzone.tsx +189 -0
- package/src/primitives/IconButton.tsx +22 -0
- package/src/primitives/Input.tsx +17 -0
- package/src/primitives/InputGroup.tsx +23 -0
- package/src/primitives/Link.tsx +19 -0
- package/src/primitives/LinkTooltip.tsx +31 -0
- package/src/primitives/NavList.tsx +58 -0
- package/src/primitives/Notice.tsx +25 -0
- package/src/primitives/NumberField.tsx +168 -0
- package/src/primitives/Pagination.tsx +64 -0
- package/src/primitives/Popover.tsx +44 -0
- package/src/primitives/Progress.tsx +62 -0
- package/src/primitives/RadioGroup.tsx +104 -0
- package/src/primitives/Resizable.tsx +170 -0
- package/src/primitives/ScrollArea.tsx +115 -0
- package/src/primitives/SearchInput.tsx +98 -0
- package/src/primitives/SegmentedControl.tsx +140 -0
- package/src/primitives/Select.tsx +171 -0
- package/src/primitives/Separator.tsx +13 -0
- package/src/primitives/ShortcutPending.tsx +21 -0
- package/src/primitives/ShortcutProvider.tsx +179 -0
- package/src/primitives/ShortcutScope.tsx +17 -0
- package/src/primitives/ShortcutSheet.tsx +35 -0
- package/src/primitives/Skeleton.tsx +12 -0
- package/src/primitives/Slider.tsx +153 -0
- package/src/primitives/Spinner.tsx +19 -0
- package/src/primitives/Status.tsx +33 -0
- package/src/primitives/Stepper.tsx +106 -0
- package/src/primitives/Surface.tsx +21 -0
- package/src/primitives/Switch.tsx +9 -0
- package/src/primitives/Table.tsx +57 -0
- package/src/primitives/Tabs.tsx +96 -0
- package/src/primitives/TagInput.tsx +282 -0
- package/src/primitives/Textarea.tsx +77 -0
- package/src/primitives/Toast.tsx +36 -0
- package/src/primitives/Toaster.tsx +175 -0
- package/src/primitives/Tooltip.tsx +41 -0
- package/src/primitives/Tree.tsx +256 -0
- package/src/primitives/Typography.tsx +39 -0
- package/src/primitives/boolean-input-state.ts +65 -0
- package/src/primitives/button-variants.ts +20 -0
- package/src/primitives/choice-options.ts +39 -0
- package/src/primitives/create-confirm.tsx +56 -0
- package/src/primitives/create-toaster.ts +128 -0
- package/src/primitives/link-focus.ts +38 -0
- package/src/primitives/menu-focus.ts +43 -0
- package/src/primitives/tooltip-layer.tsx +53 -0
- package/src/styles.css +655 -0
- package/src/theme/ThemeProvider.tsx +215 -0
- package/src/theme/intl.ts +14 -0
- package/src/theme/keyboard-script.ts +4 -0
- package/src/theme/layers.ts +16 -0
- package/src/theme/messages.ts +157 -0
- package/src/theme/script.ts +70 -0
- package/src/theme/state.ts +48 -0
- package/src/utils/browser-status.ts +36 -0
- package/src/utils/cn.ts +5 -0
- package/src/utils/optimistic.ts +22 -0
- package/src/utils/polymorphic.ts +1 -0
- package/src/utils/shortcut-platform.ts +4 -0
- package/src/utils/shortcut-registry.ts +216 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createSignal as e } from "solid-js";
|
|
2
|
+
//#region src/theme/layers.ts
|
|
3
|
+
function t() {
|
|
4
|
+
let [t, n] = e([]);
|
|
5
|
+
return {
|
|
6
|
+
register(e) {
|
|
7
|
+
return n((t) => t.includes(e) ? t : [...t, e]), () => {
|
|
8
|
+
n((t) => t.filter((t) => t !== e));
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
isTop(e) {
|
|
12
|
+
return t().at(-1) === e;
|
|
13
|
+
},
|
|
14
|
+
zIndex(e) {
|
|
15
|
+
return 100 + Math.max(0, t().indexOf(e)) * 2;
|
|
16
|
+
},
|
|
17
|
+
aboveAll() {
|
|
18
|
+
return 100 + t().length * 2;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { t as createOverlayStack };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
export declare const englishMessages: Readonly<{
|
|
2
|
+
close: "Close";
|
|
3
|
+
cancel: "Cancel";
|
|
4
|
+
confirm: "Confirm";
|
|
5
|
+
retry: "Retry";
|
|
6
|
+
remove: "Remove";
|
|
7
|
+
breadcrumb: "Breadcrumb";
|
|
8
|
+
loading: "Loading";
|
|
9
|
+
notifications: "Notifications";
|
|
10
|
+
noNotifications: "No notifications";
|
|
11
|
+
unread: "Unread";
|
|
12
|
+
markAllNotificationsRead: "Mark all read";
|
|
13
|
+
noResults: "No results";
|
|
14
|
+
empty: "Nothing here yet";
|
|
15
|
+
selectOption: "Select an option";
|
|
16
|
+
avatarOverflow: "{count} more";
|
|
17
|
+
nextPage: "Next page";
|
|
18
|
+
previousPage: "Previous page";
|
|
19
|
+
firstPage: "First page";
|
|
20
|
+
lastPage: "Last page";
|
|
21
|
+
pagination: "Pagination";
|
|
22
|
+
pageLabel: "Page {page}";
|
|
23
|
+
pageStatus: "Page {page} of {pages}";
|
|
24
|
+
clearSearch: "Clear search";
|
|
25
|
+
statusBar: "Application status";
|
|
26
|
+
connected: "Connected";
|
|
27
|
+
connecting: "Connecting";
|
|
28
|
+
disconnected: "Disconnected";
|
|
29
|
+
degraded: "Degraded connection";
|
|
30
|
+
unknownConnection: "Connection unknown";
|
|
31
|
+
backgroundTasks: "Background tasks";
|
|
32
|
+
notFound: "Not found";
|
|
33
|
+
serverError: "Something went wrong";
|
|
34
|
+
permissionDenied: "Permission denied";
|
|
35
|
+
retrying: "Retrying";
|
|
36
|
+
retryFailed: "Retry failed. Try again.";
|
|
37
|
+
moreActions: "More actions";
|
|
38
|
+
pendingShortcut: "Pending shortcut";
|
|
39
|
+
shortcutHelp: "Keyboard shortcuts";
|
|
40
|
+
shortcutGroup: "Application";
|
|
41
|
+
commandPalette: "Command palette";
|
|
42
|
+
openCommandPalette: "Open command palette";
|
|
43
|
+
searchCommands: "Search commands";
|
|
44
|
+
commandResults: "Command results";
|
|
45
|
+
recentCommands: "Recent";
|
|
46
|
+
refreshingCommands: "Refreshing commands";
|
|
47
|
+
commandSourceFailed: "Commands could not be refreshed.";
|
|
48
|
+
cycleThemeMode: "Cycle theme mode";
|
|
49
|
+
toggleSidebar: "Toggle sidebar";
|
|
50
|
+
sidebar: "Sidebar";
|
|
51
|
+
savedViews: "Saved views";
|
|
52
|
+
selectView: "Select a saved view";
|
|
53
|
+
viewName: "View name";
|
|
54
|
+
saveView: "Save view";
|
|
55
|
+
saveCurrentView: "Save current view";
|
|
56
|
+
manageSavedViews: "Manage saved views";
|
|
57
|
+
noSavedViews: "No saved views yet.";
|
|
58
|
+
renameView: "Rename view";
|
|
59
|
+
restoreView: "Restore view";
|
|
60
|
+
deleteView: "Delete view";
|
|
61
|
+
deleteSavedViewTitle: "Delete saved view?";
|
|
62
|
+
deleteSavedViewDescription: "Delete {name}? This cannot be undone.";
|
|
63
|
+
retryViewOperation: "Retry view operation";
|
|
64
|
+
settingsSections: "Settings sections";
|
|
65
|
+
settingsSaveBar: "Settings save bar";
|
|
66
|
+
saveChanges: "Save changes";
|
|
67
|
+
savingChanges: "Saving changes";
|
|
68
|
+
unsavedChanges: "Unsaved changes";
|
|
69
|
+
saveFailed: "Save failed. Your changes were retained.";
|
|
70
|
+
editableUpdateFailed: "Update failed. Your draft was retained.";
|
|
71
|
+
tagValues: "Tags";
|
|
72
|
+
tagAdded: "Added {value}";
|
|
73
|
+
tagRemoved: "Removed {value}";
|
|
74
|
+
tagMoved: "Moved {value}";
|
|
75
|
+
tagDuplicate: "{value} is already added.";
|
|
76
|
+
tagValidating: "Validating tag";
|
|
77
|
+
tagValidationFailed: "Tag validation failed. Your draft was retained.";
|
|
78
|
+
tagReorderInstructions: "Press Delete to remove. Hold Alt and press an arrow key, Home, or End to reorder.";
|
|
79
|
+
chooseFiles: "Choose files";
|
|
80
|
+
dropFilesHere: "Drop files here";
|
|
81
|
+
fileDropHint: "Drag files here or choose from this device.";
|
|
82
|
+
selectedFiles: "Selected files";
|
|
83
|
+
fileCountRejected: "Only {count} more files can be added.";
|
|
84
|
+
fileTooLarge: "{name} exceeds the {size} limit.";
|
|
85
|
+
fileTypeRejected: "{name} is not an accepted file type.";
|
|
86
|
+
uploadProgress: "Upload progress for {name}";
|
|
87
|
+
workflowCompleted: "Completed";
|
|
88
|
+
workflowCurrent: "Current";
|
|
89
|
+
workflowUpcoming: "Upcoming";
|
|
90
|
+
workflowError: "Error";
|
|
91
|
+
stepperProgress: "{label} progress";
|
|
92
|
+
increaseValue: "Increase {label}";
|
|
93
|
+
decreaseValue: "Decrease {label}";
|
|
94
|
+
minimumValue: "Minimum {label}";
|
|
95
|
+
maximumValue: "Maximum {label}";
|
|
96
|
+
expandTreeItem: "Expand {label}";
|
|
97
|
+
collapseTreeItem: "Collapse {label}";
|
|
98
|
+
shortcutInventory: "All registered shortcuts. Availability depends on the active scope.";
|
|
99
|
+
shortcutShadowed: "Replaced by a newer binding";
|
|
100
|
+
shortcutDisabled: "Character shortcut disabled";
|
|
101
|
+
unsavedTitle: "Discard unsaved changes?";
|
|
102
|
+
unsavedDescription: "Your unsaved changes will be lost if you leave this page.";
|
|
103
|
+
discardChanges: "Discard changes";
|
|
104
|
+
navigationFailed: "Navigation failed. Your changes have been retained.";
|
|
105
|
+
}>;
|
|
106
|
+
/** Optional message families supplied by packages layered on the UI provider. */
|
|
107
|
+
export interface ExtensionMessages {
|
|
108
|
+
readonly copyCode?: string;
|
|
109
|
+
readonly codeCopied?: string;
|
|
110
|
+
readonly codeCopyFailed?: string;
|
|
111
|
+
readonly wrapCode?: string;
|
|
112
|
+
readonly stopWrappingCode?: string;
|
|
113
|
+
readonly codeHighlightedLines?: string;
|
|
114
|
+
readonly viewerSearch?: string;
|
|
115
|
+
readonly viewerCopy?: string;
|
|
116
|
+
readonly viewerCopied?: string;
|
|
117
|
+
readonly viewerCopyFailed?: string;
|
|
118
|
+
readonly viewerMatches?: string;
|
|
119
|
+
readonly searchTable?: string;
|
|
120
|
+
readonly tableShortcuts?: string;
|
|
121
|
+
readonly refreshing?: string;
|
|
122
|
+
readonly previousResults?: string;
|
|
123
|
+
readonly clearFilters?: string;
|
|
124
|
+
readonly clearSearchAndFilters?: string;
|
|
125
|
+
readonly selectAll?: string;
|
|
126
|
+
readonly selectPage?: string;
|
|
127
|
+
readonly selectRow?: string;
|
|
128
|
+
readonly clearSelection?: string;
|
|
129
|
+
readonly selectionActions?: string;
|
|
130
|
+
readonly selectedCount?: string;
|
|
131
|
+
readonly cardView?: string;
|
|
132
|
+
readonly rowActions?: string;
|
|
133
|
+
readonly sort?: string;
|
|
134
|
+
readonly sortColumn?: string;
|
|
135
|
+
readonly sortedAscending?: string;
|
|
136
|
+
readonly sortedDescending?: string;
|
|
137
|
+
readonly notSorted?: string;
|
|
138
|
+
readonly sortPriority?: string;
|
|
139
|
+
readonly export?: string;
|
|
140
|
+
readonly exportCSV?: string;
|
|
141
|
+
readonly exportJSON?: string;
|
|
142
|
+
readonly preparingExport?: string;
|
|
143
|
+
readonly exportFailed?: string;
|
|
144
|
+
readonly retryExport?: string;
|
|
145
|
+
readonly downloadLastExport?: string;
|
|
146
|
+
readonly filters?: string;
|
|
147
|
+
readonly filterAdd?: string;
|
|
148
|
+
readonly filterColumns?: string;
|
|
149
|
+
readonly filterSearchColumns?: string;
|
|
150
|
+
readonly filterEdit?: string;
|
|
151
|
+
readonly filterRemove?: string;
|
|
152
|
+
readonly filterApply?: string;
|
|
153
|
+
readonly filterOperator?: string;
|
|
154
|
+
readonly filterValue?: string;
|
|
155
|
+
readonly filterMinimum?: string;
|
|
156
|
+
readonly filterMaximum?: string;
|
|
157
|
+
readonly filterDate?: string;
|
|
158
|
+
readonly filterStartDate?: string;
|
|
159
|
+
readonly filterEndDate?: string;
|
|
160
|
+
readonly filterValues?: string;
|
|
161
|
+
readonly filterCaseSensitive?: string;
|
|
162
|
+
readonly filterNegated?: string;
|
|
163
|
+
readonly filterInheritedNegation?: string;
|
|
164
|
+
readonly filterInvalid?: string;
|
|
165
|
+
readonly filterEquals?: string;
|
|
166
|
+
readonly filterContains?: string;
|
|
167
|
+
readonly filterStartsWith?: string;
|
|
168
|
+
readonly filterEndsWith?: string;
|
|
169
|
+
readonly filterLessThan?: string;
|
|
170
|
+
readonly filterAtMost?: string;
|
|
171
|
+
readonly filterGreaterThan?: string;
|
|
172
|
+
readonly filterAtLeast?: string;
|
|
173
|
+
readonly filterBetween?: string;
|
|
174
|
+
readonly filterIsEmpty?: string;
|
|
175
|
+
readonly filterIsAnyOf?: string;
|
|
176
|
+
readonly filterSummary?: string;
|
|
177
|
+
readonly filterNot?: string;
|
|
178
|
+
readonly filterInheritedNot?: string;
|
|
179
|
+
readonly queryBuilder?: string;
|
|
180
|
+
readonly queryGroup?: string;
|
|
181
|
+
readonly queryRule?: string;
|
|
182
|
+
readonly queryMatch?: string;
|
|
183
|
+
readonly queryMatchAll?: string;
|
|
184
|
+
readonly queryMatchAny?: string;
|
|
185
|
+
readonly queryColumn?: string;
|
|
186
|
+
readonly queryAddRule?: string;
|
|
187
|
+
readonly queryAddGroup?: string;
|
|
188
|
+
readonly queryNegate?: string;
|
|
189
|
+
readonly queryRemoveNegation?: string;
|
|
190
|
+
readonly queryRemove?: string;
|
|
191
|
+
readonly queryMoveBefore?: string;
|
|
192
|
+
readonly queryMoveAfter?: string;
|
|
193
|
+
readonly queryChanged?: string;
|
|
194
|
+
readonly groupMissing?: string;
|
|
195
|
+
readonly loadingChildren?: string;
|
|
196
|
+
readonly columns?: string;
|
|
197
|
+
readonly showColumn?: string;
|
|
198
|
+
readonly moveColumnStart?: string;
|
|
199
|
+
readonly moveColumnEnd?: string;
|
|
200
|
+
readonly pinColumn?: string;
|
|
201
|
+
readonly pinNone?: string;
|
|
202
|
+
readonly pinStart?: string;
|
|
203
|
+
readonly pinEnd?: string;
|
|
204
|
+
readonly autoFitColumn?: string;
|
|
205
|
+
readonly resetColumnWidth?: string;
|
|
206
|
+
readonly reorderColumn?: string;
|
|
207
|
+
readonly resizeColumn?: string;
|
|
208
|
+
readonly columnWidthPixels?: string;
|
|
209
|
+
readonly editCell?: string;
|
|
210
|
+
readonly cellValueRequired?: string;
|
|
211
|
+
readonly cellValueInvalid?: string;
|
|
212
|
+
readonly noValue?: string;
|
|
213
|
+
readonly cellUpdateFailed?: string;
|
|
214
|
+
readonly cellUpdateFailedDescription?: string;
|
|
215
|
+
readonly cellConflict?: string;
|
|
216
|
+
readonly tableControls?: string;
|
|
217
|
+
readonly resultCountOne?: string;
|
|
218
|
+
readonly resultCount?: string;
|
|
219
|
+
readonly expand?: string;
|
|
220
|
+
readonly collapse?: string;
|
|
221
|
+
readonly chartViewAsTable?: string;
|
|
222
|
+
readonly chartMissingValue?: string;
|
|
223
|
+
readonly chartTablePagination?: string;
|
|
224
|
+
readonly chartShowSeries?: string;
|
|
225
|
+
readonly chartHideSeries?: string;
|
|
226
|
+
readonly chartZoomControls?: string;
|
|
227
|
+
readonly chartZoomIn?: string;
|
|
228
|
+
readonly chartZoomOut?: string;
|
|
229
|
+
readonly chartResetZoom?: string;
|
|
230
|
+
readonly chartKeyboardInstructions?: string;
|
|
231
|
+
}
|
|
232
|
+
type CoreMessages = Readonly<Record<keyof typeof englishMessages, string>>;
|
|
233
|
+
export type Messages = CoreMessages & ExtensionMessages;
|
|
234
|
+
export declare function resolveMessages(parent: Messages, overrides?: Partial<Messages>): Messages;
|
|
235
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
//#region src/theme/messages.ts
|
|
2
|
+
var e = Object.freeze({
|
|
3
|
+
close: "Close",
|
|
4
|
+
cancel: "Cancel",
|
|
5
|
+
confirm: "Confirm",
|
|
6
|
+
retry: "Retry",
|
|
7
|
+
remove: "Remove",
|
|
8
|
+
breadcrumb: "Breadcrumb",
|
|
9
|
+
loading: "Loading",
|
|
10
|
+
notifications: "Notifications",
|
|
11
|
+
noNotifications: "No notifications",
|
|
12
|
+
unread: "Unread",
|
|
13
|
+
markAllNotificationsRead: "Mark all read",
|
|
14
|
+
noResults: "No results",
|
|
15
|
+
empty: "Nothing here yet",
|
|
16
|
+
selectOption: "Select an option",
|
|
17
|
+
avatarOverflow: "{count} more",
|
|
18
|
+
nextPage: "Next page",
|
|
19
|
+
previousPage: "Previous page",
|
|
20
|
+
firstPage: "First page",
|
|
21
|
+
lastPage: "Last page",
|
|
22
|
+
pagination: "Pagination",
|
|
23
|
+
pageLabel: "Page {page}",
|
|
24
|
+
pageStatus: "Page {page} of {pages}",
|
|
25
|
+
clearSearch: "Clear search",
|
|
26
|
+
statusBar: "Application status",
|
|
27
|
+
connected: "Connected",
|
|
28
|
+
connecting: "Connecting",
|
|
29
|
+
disconnected: "Disconnected",
|
|
30
|
+
degraded: "Degraded connection",
|
|
31
|
+
unknownConnection: "Connection unknown",
|
|
32
|
+
backgroundTasks: "Background tasks",
|
|
33
|
+
notFound: "Not found",
|
|
34
|
+
serverError: "Something went wrong",
|
|
35
|
+
permissionDenied: "Permission denied",
|
|
36
|
+
retrying: "Retrying",
|
|
37
|
+
retryFailed: "Retry failed. Try again.",
|
|
38
|
+
moreActions: "More actions",
|
|
39
|
+
pendingShortcut: "Pending shortcut",
|
|
40
|
+
shortcutHelp: "Keyboard shortcuts",
|
|
41
|
+
shortcutGroup: "Application",
|
|
42
|
+
commandPalette: "Command palette",
|
|
43
|
+
openCommandPalette: "Open command palette",
|
|
44
|
+
searchCommands: "Search commands",
|
|
45
|
+
commandResults: "Command results",
|
|
46
|
+
recentCommands: "Recent",
|
|
47
|
+
refreshingCommands: "Refreshing commands",
|
|
48
|
+
commandSourceFailed: "Commands could not be refreshed.",
|
|
49
|
+
cycleThemeMode: "Cycle theme mode",
|
|
50
|
+
toggleSidebar: "Toggle sidebar",
|
|
51
|
+
sidebar: "Sidebar",
|
|
52
|
+
savedViews: "Saved views",
|
|
53
|
+
selectView: "Select a saved view",
|
|
54
|
+
viewName: "View name",
|
|
55
|
+
saveView: "Save view",
|
|
56
|
+
saveCurrentView: "Save current view",
|
|
57
|
+
manageSavedViews: "Manage saved views",
|
|
58
|
+
noSavedViews: "No saved views yet.",
|
|
59
|
+
renameView: "Rename view",
|
|
60
|
+
restoreView: "Restore view",
|
|
61
|
+
deleteView: "Delete view",
|
|
62
|
+
deleteSavedViewTitle: "Delete saved view?",
|
|
63
|
+
deleteSavedViewDescription: "Delete {name}? This cannot be undone.",
|
|
64
|
+
retryViewOperation: "Retry view operation",
|
|
65
|
+
settingsSections: "Settings sections",
|
|
66
|
+
settingsSaveBar: "Settings save bar",
|
|
67
|
+
saveChanges: "Save changes",
|
|
68
|
+
savingChanges: "Saving changes",
|
|
69
|
+
unsavedChanges: "Unsaved changes",
|
|
70
|
+
saveFailed: "Save failed. Your changes were retained.",
|
|
71
|
+
editableUpdateFailed: "Update failed. Your draft was retained.",
|
|
72
|
+
tagValues: "Tags",
|
|
73
|
+
tagAdded: "Added {value}",
|
|
74
|
+
tagRemoved: "Removed {value}",
|
|
75
|
+
tagMoved: "Moved {value}",
|
|
76
|
+
tagDuplicate: "{value} is already added.",
|
|
77
|
+
tagValidating: "Validating tag",
|
|
78
|
+
tagValidationFailed: "Tag validation failed. Your draft was retained.",
|
|
79
|
+
tagReorderInstructions: "Press Delete to remove. Hold Alt and press an arrow key, Home, or End to reorder.",
|
|
80
|
+
chooseFiles: "Choose files",
|
|
81
|
+
dropFilesHere: "Drop files here",
|
|
82
|
+
fileDropHint: "Drag files here or choose from this device.",
|
|
83
|
+
selectedFiles: "Selected files",
|
|
84
|
+
fileCountRejected: "Only {count} more files can be added.",
|
|
85
|
+
fileTooLarge: "{name} exceeds the {size} limit.",
|
|
86
|
+
fileTypeRejected: "{name} is not an accepted file type.",
|
|
87
|
+
uploadProgress: "Upload progress for {name}",
|
|
88
|
+
workflowCompleted: "Completed",
|
|
89
|
+
workflowCurrent: "Current",
|
|
90
|
+
workflowUpcoming: "Upcoming",
|
|
91
|
+
workflowError: "Error",
|
|
92
|
+
stepperProgress: "{label} progress",
|
|
93
|
+
increaseValue: "Increase {label}",
|
|
94
|
+
decreaseValue: "Decrease {label}",
|
|
95
|
+
minimumValue: "Minimum {label}",
|
|
96
|
+
maximumValue: "Maximum {label}",
|
|
97
|
+
expandTreeItem: "Expand {label}",
|
|
98
|
+
collapseTreeItem: "Collapse {label}",
|
|
99
|
+
shortcutInventory: "All registered shortcuts. Availability depends on the active scope.",
|
|
100
|
+
shortcutShadowed: "Replaced by a newer binding",
|
|
101
|
+
shortcutDisabled: "Character shortcut disabled",
|
|
102
|
+
unsavedTitle: "Discard unsaved changes?",
|
|
103
|
+
unsavedDescription: "Your unsaved changes will be lost if you leave this page.",
|
|
104
|
+
discardChanges: "Discard changes",
|
|
105
|
+
navigationFailed: "Navigation failed. Your changes have been retained."
|
|
106
|
+
});
|
|
107
|
+
function t(e, t = {}) {
|
|
108
|
+
for (let e of Object.values(t)) if (typeof e != "string") throw Error("Sheen message overrides must be strings");
|
|
109
|
+
return Object.freeze({
|
|
110
|
+
...e,
|
|
111
|
+
...t
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { e as englishMessages, t as resolveMessages };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ThemeOverrides, ThemeState } from "./state.ts";
|
|
2
|
+
import type { ThemeMetadata } from "@gemologic/sheen-tokens/catalog";
|
|
3
|
+
export declare function createThemeScript(options?: {
|
|
4
|
+
defaults?: ThemeState;
|
|
5
|
+
storageKey?: string;
|
|
6
|
+
themeIds?: readonly string[];
|
|
7
|
+
themes?: readonly ThemeMetadata[];
|
|
8
|
+
}): string;
|
|
9
|
+
export declare function createScopeScript(overrides: ThemeOverrides, defaults: ThemeState, themes?: readonly ThemeMetadata[]): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defaultThemeState as e, themeChoices as t } from "./state.js";
|
|
2
|
+
import { bundledThemeMetadata as n } from "@gemologic/sheen-tokens/catalog";
|
|
3
|
+
//#region src/theme/script.ts
|
|
4
|
+
function r(e) {
|
|
5
|
+
let t = { ...e.defaults };
|
|
6
|
+
try {
|
|
7
|
+
let n = JSON.parse(localStorage.getItem(e.storageKey) ?? "null");
|
|
8
|
+
if (typeof n == "object" && n) {
|
|
9
|
+
for (let [r, i] of Object.entries(n)) if (typeof i == "string" && (e.choices[r]?.includes(i) && (t[r] = i), r === "locale")) try {
|
|
10
|
+
Intl.getCanonicalLocales(i).length && (t.locale = i);
|
|
11
|
+
} catch {}
|
|
12
|
+
}
|
|
13
|
+
} catch {}
|
|
14
|
+
let n = document.documentElement;
|
|
15
|
+
for (let [e, r] of Object.entries(t)) {
|
|
16
|
+
let t = e === "mode" && r === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : r;
|
|
17
|
+
n.setAttribute(`data-sheen-${e}`, t);
|
|
18
|
+
}
|
|
19
|
+
n.setAttribute("data-sheen-preference", t.mode ?? "dark"), n.setAttribute("data-sheen-icon-set", e.iconSets[t.theme ?? ""] ?? "radix"), n.setAttribute("dir", t.direction ?? "ltr"), n.setAttribute("lang", t.locale ?? "en-US");
|
|
20
|
+
}
|
|
21
|
+
function i(i = {}) {
|
|
22
|
+
let a = i.themes ?? n, o = i.themeIds ?? a.map((e) => e.id), s = {
|
|
23
|
+
defaults: i.defaults ?? { ...e },
|
|
24
|
+
storageKey: i.storageKey ?? "sheen",
|
|
25
|
+
choices: {
|
|
26
|
+
...t,
|
|
27
|
+
theme: o
|
|
28
|
+
},
|
|
29
|
+
iconSets: Object.fromEntries(a.map((e) => [e.id, e.iconSet]))
|
|
30
|
+
}, c = JSON.stringify(s).replaceAll("<", "\\u003c").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
|
|
31
|
+
return `(${r.toString()})(${c});`;
|
|
32
|
+
}
|
|
33
|
+
function a(e, t, n) {
|
|
34
|
+
let r = document.currentScript?.parentElement, i = r?.parentElement?.closest("[data-sheen-theme]");
|
|
35
|
+
if (!r || !i) return;
|
|
36
|
+
for (let [n, a] of Object.entries(t)) {
|
|
37
|
+
let t = Object.getOwnPropertyDescriptor(e, n)?.value, o = t === null ? a : typeof t == "string" ? t : i.getAttribute(`data-sheen-${n}`) ?? a;
|
|
38
|
+
n === "mode" && o === "system" && (o = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), r.setAttribute(`data-sheen-${n}`, o), r.querySelector(":scope > [data-sheen-portal=\"scope\"]")?.setAttribute(`data-sheen-${n}`, o);
|
|
39
|
+
}
|
|
40
|
+
r.setAttribute("dir", r.getAttribute("data-sheen-direction") ?? "ltr"), r.setAttribute("lang", r.getAttribute("data-sheen-locale") ?? "en-US");
|
|
41
|
+
let a = r.querySelector(":scope > [data-sheen-portal=\"scope\"]"), o = n[r.getAttribute("data-sheen-theme") ?? ""] ?? "radix";
|
|
42
|
+
r.setAttribute("data-sheen-icon-set", o), a?.setAttribute("data-sheen-icon-set", o);
|
|
43
|
+
}
|
|
44
|
+
function o(e, t, r = n) {
|
|
45
|
+
let i = (e) => JSON.stringify(e).replaceAll("<", "\\u003c").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029"), o = Object.fromEntries(r.map((e) => [e.id, e.iconSet]));
|
|
46
|
+
return `(${a.toString()})(${i(e)},${i(t)},${i(o)});`;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { o as createScopeScript, i as createThemeScript };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AccentName } from "@gemologic/sheen-tokens/catalog";
|
|
2
|
+
import type { Mode } from "@gemologic/sheen-tokens";
|
|
3
|
+
export interface ThemeState {
|
|
4
|
+
theme: string;
|
|
5
|
+
mode: Mode | "system";
|
|
6
|
+
accent: AccentName;
|
|
7
|
+
density: "compact" | "comfortable" | "spacious";
|
|
8
|
+
radius: "sharp" | "soft" | "round";
|
|
9
|
+
motion: "full" | "reduced";
|
|
10
|
+
direction: "ltr" | "rtl";
|
|
11
|
+
locale: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultThemeState: Readonly<ThemeState>;
|
|
14
|
+
export type ThemeOverrides = {
|
|
15
|
+
[K in keyof ThemeState]?: ThemeState[K] | null;
|
|
16
|
+
};
|
|
17
|
+
export declare function resolveThemeState(parent: ThemeState, overrides: ThemeOverrides, defaults: ThemeState): ThemeState;
|
|
18
|
+
export declare function readThemeState(value: unknown, fallback: ThemeState, themeIds?: readonly string[]): ThemeState;
|
|
19
|
+
export declare const themeChoices: Readonly<{
|
|
20
|
+
theme: string[];
|
|
21
|
+
mode: string[];
|
|
22
|
+
accent: readonly AccentName[];
|
|
23
|
+
density: string[];
|
|
24
|
+
radius: string[];
|
|
25
|
+
motion: string[];
|
|
26
|
+
direction: string[];
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { accentNames as e, bundledThemeMetadata as t, isAccentName as n } from "@gemologic/sheen-tokens/catalog";
|
|
2
|
+
//#region src/theme/state.ts
|
|
3
|
+
var r = Object.freeze({
|
|
4
|
+
theme: "obsidian",
|
|
5
|
+
mode: "dark",
|
|
6
|
+
accent: "jade",
|
|
7
|
+
density: "comfortable",
|
|
8
|
+
radius: "soft",
|
|
9
|
+
motion: "full",
|
|
10
|
+
direction: "ltr",
|
|
11
|
+
locale: "en-US"
|
|
12
|
+
});
|
|
13
|
+
function i(e, t, n) {
|
|
14
|
+
return {
|
|
15
|
+
theme: t.theme === null ? n.theme : t.theme ?? e.theme,
|
|
16
|
+
mode: t.mode === null ? n.mode : t.mode ?? e.mode,
|
|
17
|
+
accent: t.accent === null ? n.accent : t.accent ?? e.accent,
|
|
18
|
+
density: t.density === null ? n.density : t.density ?? e.density,
|
|
19
|
+
radius: t.radius === null ? n.radius : t.radius ?? e.radius,
|
|
20
|
+
motion: t.motion === null ? n.motion : t.motion ?? e.motion,
|
|
21
|
+
direction: t.direction === null ? n.direction : t.direction ?? e.direction,
|
|
22
|
+
locale: t.locale === null ? n.locale : t.locale ?? e.locale
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function a(e, r, i = t.map((e) => e.id)) {
|
|
26
|
+
if (typeof e != "object" || !e) return { ...r };
|
|
27
|
+
let a = { ...r };
|
|
28
|
+
if ("theme" in e && typeof e.theme == "string" && i.includes(e.theme) && (a.theme = e.theme), "mode" in e && (e.mode === "dark" || e.mode === "light" || e.mode === "system") && (a.mode = e.mode), "accent" in e && typeof e.accent == "string" && n(e.accent) && (a.accent = e.accent), "density" in e && (e.density === "compact" || e.density === "comfortable" || e.density === "spacious") && (a.density = e.density), "radius" in e && (e.radius === "sharp" || e.radius === "soft" || e.radius === "round") && (a.radius = e.radius), "motion" in e && (e.motion === "full" || e.motion === "reduced") && (a.motion = e.motion), "direction" in e && (e.direction === "rtl" || e.direction === "ltr") && (a.direction = e.direction), "locale" in e && typeof e.locale == "string") try {
|
|
29
|
+
Intl.getCanonicalLocales(e.locale).length && (a.locale = e.locale);
|
|
30
|
+
} catch {}
|
|
31
|
+
return a;
|
|
32
|
+
}
|
|
33
|
+
var o = Object.freeze({
|
|
34
|
+
theme: t.map((e) => e.id),
|
|
35
|
+
mode: [
|
|
36
|
+
"dark",
|
|
37
|
+
"light",
|
|
38
|
+
"system"
|
|
39
|
+
],
|
|
40
|
+
accent: e,
|
|
41
|
+
density: [
|
|
42
|
+
"compact",
|
|
43
|
+
"comfortable",
|
|
44
|
+
"spacious"
|
|
45
|
+
],
|
|
46
|
+
radius: [
|
|
47
|
+
"sharp",
|
|
48
|
+
"soft",
|
|
49
|
+
"round"
|
|
50
|
+
],
|
|
51
|
+
motion: ["full", "reduced"],
|
|
52
|
+
direction: ["ltr", "rtl"]
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
export { r as defaultThemeState, a as readThemeState, i as resolveThemeState, o as themeChoices };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Accessor } from "solid-js";
|
|
2
|
+
/** Browser connectivity hint, not backend health. Undefined until client mount. */
|
|
3
|
+
export declare function useOnlineStatus(): Accessor<boolean | undefined>;
|
|
4
|
+
/** Document focus, not merely an active element. Undefined until client mount. */
|
|
5
|
+
export declare function useIsWindowFocused(): Accessor<boolean | undefined>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createSignal as e, onCleanup as t, onMount as n } from "solid-js";
|
|
2
|
+
//#region src/utils/browser-status.ts
|
|
3
|
+
function r() {
|
|
4
|
+
let [r, i] = e();
|
|
5
|
+
return n(() => {
|
|
6
|
+
let e = () => i(window.navigator.onLine);
|
|
7
|
+
window.addEventListener("online", e), window.addEventListener("offline", e), e(), t(() => {
|
|
8
|
+
window.removeEventListener("online", e), window.removeEventListener("offline", e);
|
|
9
|
+
});
|
|
10
|
+
}), r;
|
|
11
|
+
}
|
|
12
|
+
function i() {
|
|
13
|
+
let [r, i] = e();
|
|
14
|
+
return n(() => {
|
|
15
|
+
let e = () => i(document.hasFocus());
|
|
16
|
+
window.addEventListener("focus", e), window.addEventListener("blur", e), document.addEventListener("visibilitychange", e), e(), t(() => {
|
|
17
|
+
window.removeEventListener("focus", e), window.removeEventListener("blur", e), document.removeEventListener("visibilitychange", e);
|
|
18
|
+
});
|
|
19
|
+
}), r;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { i as useIsWindowFocused, r as useOnlineStatus };
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type OptimisticRevert = () => void | Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* Apply app-owned local state immediately and revert once if its commit fails.
|
|
4
|
+
* The app must make its inverse safe for concurrent edits; this helper owns no cache.
|
|
5
|
+
*/
|
|
6
|
+
export declare function optimistic<T>(apply: () => OptimisticRevert, commit: () => T | Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/utils/optimistic.ts
|
|
2
|
+
async function e(e, t) {
|
|
3
|
+
let n = e();
|
|
4
|
+
try {
|
|
5
|
+
return await t();
|
|
6
|
+
} catch (e) {
|
|
7
|
+
try {
|
|
8
|
+
await n();
|
|
9
|
+
} catch (t) {
|
|
10
|
+
throw AggregateError([e, t], "Optimistic commit and rollback both failed", { cause: e });
|
|
11
|
+
}
|
|
12
|
+
throw e;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as optimistic };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { PolymorphicProps as SheenPolymorphicProps } from "@kobalte/core/polymorphic";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface ShortcutDefinition {
|
|
2
|
+
readonly keys: string;
|
|
3
|
+
readonly scope: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly group: string;
|
|
6
|
+
readonly developmentOnly?: boolean;
|
|
7
|
+
readonly run: () => void | Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export interface ShortcutAction {
|
|
10
|
+
readonly keys: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly group: string;
|
|
13
|
+
readonly scope?: string;
|
|
14
|
+
readonly developmentOnly?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ShortcutInput {
|
|
17
|
+
readonly key: string;
|
|
18
|
+
readonly ctrlKey: boolean;
|
|
19
|
+
readonly metaKey: boolean;
|
|
20
|
+
readonly altKey: boolean;
|
|
21
|
+
readonly shiftKey: boolean;
|
|
22
|
+
readonly editing: boolean;
|
|
23
|
+
readonly composing?: boolean;
|
|
24
|
+
readonly repeat?: boolean;
|
|
25
|
+
readonly characterShortcuts?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ShortcutRegistryOptions {
|
|
28
|
+
readonly platform: "mac" | "other";
|
|
29
|
+
readonly development: boolean;
|
|
30
|
+
readonly warn?: (message: string) => void;
|
|
31
|
+
readonly onError?: (error: unknown) => void;
|
|
32
|
+
readonly onPending?: (pending: readonly PendingShortcut[]) => void;
|
|
33
|
+
readonly onChange?: (bindings: readonly ShortcutBinding[]) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface ShortcutBinding {
|
|
36
|
+
readonly id: number;
|
|
37
|
+
readonly scope: string;
|
|
38
|
+
readonly keys: string;
|
|
39
|
+
readonly displayKeys: string;
|
|
40
|
+
readonly label: string;
|
|
41
|
+
readonly group: string;
|
|
42
|
+
readonly characterOnly: boolean;
|
|
43
|
+
readonly shadowed: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface PendingShortcut {
|
|
46
|
+
readonly keys: string;
|
|
47
|
+
readonly displayKeys: string;
|
|
48
|
+
readonly label: string;
|
|
49
|
+
readonly scope: string;
|
|
50
|
+
readonly completed: number;
|
|
51
|
+
}
|
|
52
|
+
/** Pure registry core. The browser owner supplies active scopes, input context, and event prevention. */
|
|
53
|
+
export declare function createShortcutRegistry(options: ShortcutRegistryOptions): {
|
|
54
|
+
cancelPending: () => void;
|
|
55
|
+
register(definition: ShortcutDefinition): () => void;
|
|
56
|
+
/** Scopes are ordered outermost to innermost. Only the winning action executes. */
|
|
57
|
+
dispatch(input: ShortcutInput, activeScopes: readonly string[], beforeRun?: () => void): boolean;
|
|
58
|
+
snapshot: () => readonly ShortcutBinding[];
|
|
59
|
+
run(id: number): boolean;
|
|
60
|
+
dispose(): void;
|
|
61
|
+
};
|