@threadlabs/looma 0.2.19 → 0.3.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/dist/{chunk-A5MSXQ7Y.js → chunk-3NVMCHGR.js} +2225 -1255
- package/dist/chunk-XDNZIKNI.js +2721 -0
- package/dist/declarative-generated.cjs +93 -79
- package/dist/declarative-generated.d.cts +7 -1
- package/dist/declarative-generated.d.ts +7 -1
- package/dist/declarative-generated.js +91 -78
- package/dist/declarative.cjs +1499 -1702
- package/dist/declarative.d.cts +77 -3
- package/dist/declarative.d.ts +77 -3
- package/dist/declarative.js +5 -3
- package/dist/index.cjs +3732 -3025
- package/dist/index.d.cts +211 -35
- package/dist/index.d.ts +211 -35
- package/dist/index.js +6 -61
- package/dist/loader.cjs +3725 -2962
- package/dist/loader.js +2 -2
- package/editor/{chunk-WI7ZA44X.js → chunk-U36XNFJN.js} +111 -77
- package/editor/extensions/index.d.ts +272 -27
- package/editor/index.d.ts +1 -1
- package/editor/index.js +1 -1
- package/editor/{table-overlay-DoiLie4h.d.ts → table-overlay-DZFGHQDt.d.ts} +48 -6
- package/editor/ui.d.ts +15 -11
- package/editor/ui.js +1 -1
- package/layout/index.cjs +197 -340
- package/layout/index.d.cts +11 -0
- package/layout/index.d.ts +11 -0
- package/layout/index.js +197 -340
- package/layout.css +31 -134
- package/package.json +24 -11
- package/react/index.d.ts +1276 -0
- package/react/index.js +1526 -0
- package/styles.css +5 -10
- package/svelte/index.d.ts +204 -0
- package/svelte/index.js +1881 -0
- package/theme-dark.css +81 -2
- package/theme-high-contrast.css +14 -0
- package/theme-light.css +30 -1
- package/tokens.css +45 -1
- package/vue/chunk-UZMTYDP6.js +4355 -0
- package/vue/editor/index.d.ts +78 -8
- package/vue/editor/index.js +59 -49
- package/vue/index.d.ts +67 -78
- package/vue/index.js +3 -9
- package/dist/chunk-ECJQ4YGC.js +0 -2925
- package/dist/valibot.cjs +0 -31
- package/dist/valibot.d.cts +0 -10
- package/dist/valibot.d.ts +0 -10
- package/dist/valibot.js +0 -9
- package/dist/validation-bxcou-l-.d.cts +0 -58
- package/dist/validation-bxcou-l-.d.ts +0 -58
- package/vue/chunk-P7BZ2KJZ.js +0 -3559
package/styles.css
CHANGED
|
@@ -207,12 +207,7 @@
|
|
|
207
207
|
color: var(--ui-action-secondary-text, var(--ui-text-primary));
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
/*
|
|
211
|
-
* reflect its `variant` prop, so a `variant` attribute only exists on buttons
|
|
212
|
-
* rendered server-side; client-rendered buttons (e.g. a dialog opened after
|
|
213
|
-
* mount) carry only the Stencil-synced data-variant. Keying on data-variant
|
|
214
|
-
* (as the size rules already do with data-size) makes this fallback apply in
|
|
215
|
-
* both cases instead of stranding client-rendered variants on the neutral base. */
|
|
210
|
+
/* The invocation attribute and lowered reflected value share one fallback. */
|
|
216
211
|
ui-button:is([variant="solid"], [data-variant="solid"]) {
|
|
217
212
|
color: var(--ui-action-primary-text, var(--ui-text-on-accent));
|
|
218
213
|
}
|
|
@@ -279,21 +274,21 @@
|
|
|
279
274
|
transform: translateY(0);
|
|
280
275
|
}
|
|
281
276
|
|
|
282
|
-
ui-button:is([variant="
|
|
277
|
+
ui-button:is([variant="danger"], [data-variant="danger"]) > button {
|
|
283
278
|
border-color: var(--ui-danger-solid);
|
|
284
279
|
background: var(--ui-danger-solid);
|
|
285
280
|
color: var(--ui-text-on-accent);
|
|
286
|
-
box-shadow: var(--ui-button-
|
|
281
|
+
box-shadow: var(--ui-button-danger-shadow, inset 0 1px rgb(255 255 255 / 0.14), var(--ui-shadow-xs));
|
|
287
282
|
}
|
|
288
283
|
|
|
289
|
-
ui-button:is([variant="
|
|
284
|
+
ui-button:is([variant="danger"], [data-variant="danger"]) > button:hover:enabled {
|
|
290
285
|
background: var(--ui-danger-hover);
|
|
291
286
|
border-color: var(--ui-danger-hover);
|
|
292
287
|
box-shadow: var(--ui-shadow-sm);
|
|
293
288
|
transform: translateY(-1px);
|
|
294
289
|
}
|
|
295
290
|
|
|
296
|
-
ui-button:is([variant="
|
|
291
|
+
ui-button:is([variant="danger"], [data-variant="danger"]) > button:active:enabled {
|
|
297
292
|
background: var(--ui-danger-hover);
|
|
298
293
|
border-color: var(--ui-danger-hover);
|
|
299
294
|
box-shadow: none;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/** Inputs accepted by generated DOM factories before lifecycle attachment. */
|
|
2
|
+
interface VanillaComponentOptions {
|
|
3
|
+
readonly attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
4
|
+
readonly children?: readonly Node[];
|
|
5
|
+
readonly slots?: Readonly<Record<string, readonly Node[]>>;
|
|
6
|
+
readonly [name: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare function createUiAffordanceScope(options?: VanillaComponentOptions): HTMLElement;
|
|
10
|
+
declare function createUiAvatarGroup(options?: VanillaComponentOptions): HTMLElement;
|
|
11
|
+
declare function createUiAvatar(options?: VanillaComponentOptions): HTMLElement;
|
|
12
|
+
declare function createUiBadge(options?: VanillaComponentOptions): HTMLElement;
|
|
13
|
+
declare function createUiButton(options?: VanillaComponentOptions): HTMLElement;
|
|
14
|
+
declare function createUiCallout(options?: VanillaComponentOptions): HTMLElement;
|
|
15
|
+
declare function createUiCheckbox(options?: VanillaComponentOptions): HTMLElement;
|
|
16
|
+
declare function createUiCombobox(options?: VanillaComponentOptions): HTMLElement;
|
|
17
|
+
declare function createUiContextMenu(options?: VanillaComponentOptions): HTMLElement;
|
|
18
|
+
declare function createUiDialog(options?: VanillaComponentOptions): HTMLElement;
|
|
19
|
+
declare function createUiDisclosure(options?: VanillaComponentOptions): HTMLElement;
|
|
20
|
+
declare function createUiEditable(options?: VanillaComponentOptions): HTMLElement;
|
|
21
|
+
declare function createUiFormField(options?: VanillaComponentOptions): HTMLElement;
|
|
22
|
+
declare function createUiIconButton(options?: VanillaComponentOptions): HTMLElement;
|
|
23
|
+
declare function createUiInput(options?: VanillaComponentOptions): HTMLElement;
|
|
24
|
+
declare function createUiMenuItem(options?: VanillaComponentOptions): HTMLElement;
|
|
25
|
+
declare function createUiMenu(options?: VanillaComponentOptions): HTMLElement;
|
|
26
|
+
declare function createUiPopover(options?: VanillaComponentOptions): HTMLElement;
|
|
27
|
+
declare function createUiRadioGroup(options?: VanillaComponentOptions): HTMLElement;
|
|
28
|
+
declare function createUiRadio(options?: VanillaComponentOptions): HTMLElement;
|
|
29
|
+
declare function createUiSearchResultRow(options?: VanillaComponentOptions): HTMLElement;
|
|
30
|
+
declare function createUiSearchShell(options?: VanillaComponentOptions): HTMLElement;
|
|
31
|
+
declare function createUiSelect(options?: VanillaComponentOptions): HTMLElement;
|
|
32
|
+
declare function createUiSwitch(options?: VanillaComponentOptions): HTMLElement;
|
|
33
|
+
declare function createUiTabs(options?: VanillaComponentOptions): HTMLElement;
|
|
34
|
+
declare function createUiTextarea(options?: VanillaComponentOptions): HTMLElement;
|
|
35
|
+
declare function createUiToastRegion(options?: VanillaComponentOptions): HTMLElement;
|
|
36
|
+
declare function createUiTooltip(options?: VanillaComponentOptions): HTMLElement;
|
|
37
|
+
declare function createUiTopBar(options?: VanillaComponentOptions): HTMLElement;
|
|
38
|
+
declare function createUiTreeItem(options?: VanillaComponentOptions): HTMLElement;
|
|
39
|
+
declare function createUiTree(options?: VanillaComponentOptions): HTMLElement;
|
|
40
|
+
declare function createUiCluster(options?: VanillaComponentOptions): HTMLElement;
|
|
41
|
+
declare function createUiContainer(options?: VanillaComponentOptions): HTMLElement;
|
|
42
|
+
declare function createUiGrid(options?: VanillaComponentOptions): HTMLElement;
|
|
43
|
+
declare function createUiReel(options?: VanillaComponentOptions): HTMLElement;
|
|
44
|
+
declare function createUiSeparator(options?: VanillaComponentOptions): HTMLElement;
|
|
45
|
+
declare function createUiSidebar(options?: VanillaComponentOptions): HTMLElement;
|
|
46
|
+
declare function createUiStack(options?: VanillaComponentOptions): HTMLElement;
|
|
47
|
+
declare function createUiSwitcher(options?: VanillaComponentOptions): HTMLElement;
|
|
48
|
+
declare function createUiEditorInsertTableGrid(options?: VanillaComponentOptions): HTMLElement;
|
|
49
|
+
declare function createUiEditorMentionMenu(options?: VanillaComponentOptions): HTMLElement;
|
|
50
|
+
declare function createUiEditorSlashMenu(options?: VanillaComponentOptions): HTMLElement;
|
|
51
|
+
declare function createUiEditorTableContextMenu(options?: VanillaComponentOptions): HTMLElement;
|
|
52
|
+
declare function createUiEditorTableOverlay(options?: VanillaComponentOptions): HTMLElement;
|
|
53
|
+
declare function createUiEditorTableToolbar(options?: VanillaComponentOptions): HTMLElement;
|
|
54
|
+
declare function createUiEditorToolbar(options?: VanillaComponentOptions): HTMLElement;
|
|
55
|
+
|
|
56
|
+
type GeneratedTagName = "ui-affordance-scope" | "ui-avatar-group" | "ui-avatar" | "ui-badge" | "ui-button" | "ui-callout" | "ui-checkbox" | "ui-combobox" | "ui-context-menu" | "ui-dialog" | "ui-disclosure" | "ui-editable" | "ui-form-field" | "ui-icon-button" | "ui-input" | "ui-menu-item" | "ui-menu" | "ui-popover" | "ui-radio-group" | "ui-radio" | "ui-search-result-row" | "ui-search-shell" | "ui-select" | "ui-switch" | "ui-tabs" | "ui-textarea" | "ui-toast-region" | "ui-tooltip" | "ui-top-bar" | "ui-tree-item" | "ui-tree" | "ui-cluster" | "ui-container" | "ui-grid" | "ui-reel" | "ui-separator" | "ui-sidebar" | "ui-stack" | "ui-switcher" | "ui-editor-insert-table-grid" | "ui-editor-mention-menu" | "ui-editor-slash-menu" | "ui-editor-table-context-menu" | "ui-editor-table-overlay" | "ui-editor-table-toolbar" | "ui-editor-toolbar";
|
|
57
|
+
declare const factoryByTag: Readonly<Record<GeneratedTagName, (options?: VanillaComponentOptions) => HTMLElement>>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Stable event-detail shapes exposed by the handwritten Svelte adapter.
|
|
61
|
+
* The adapter unwraps `CustomEvent.detail`; handlers therefore receive these
|
|
62
|
+
* payloads directly rather than browser event objects.
|
|
63
|
+
*
|
|
64
|
+
* @contract Event names and detail objects remain identical to the native
|
|
65
|
+
* declarative roots so Svelte integration does not introduce another API.
|
|
66
|
+
*/
|
|
67
|
+
interface SvelteAdapterEventMap {
|
|
68
|
+
open: {
|
|
69
|
+
open: boolean;
|
|
70
|
+
reason: string;
|
|
71
|
+
trigger: string;
|
|
72
|
+
};
|
|
73
|
+
close: {
|
|
74
|
+
open: boolean;
|
|
75
|
+
reason: string;
|
|
76
|
+
trigger: string;
|
|
77
|
+
};
|
|
78
|
+
select: {
|
|
79
|
+
value: string;
|
|
80
|
+
previousValue?: string;
|
|
81
|
+
trigger: string;
|
|
82
|
+
};
|
|
83
|
+
change: {
|
|
84
|
+
checked: boolean;
|
|
85
|
+
value: string;
|
|
86
|
+
trigger: string;
|
|
87
|
+
};
|
|
88
|
+
dismiss: {
|
|
89
|
+
id: string;
|
|
90
|
+
reason: string;
|
|
91
|
+
trigger: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** A tag accepted by the generated native-root factory inventory. */
|
|
95
|
+
type AdapterTagName = GeneratedTagName;
|
|
96
|
+
/**
|
|
97
|
+
* Property values applied after a native root is created.
|
|
98
|
+
* Object values always use DOM properties because stringifying structured
|
|
99
|
+
* component input would silently corrupt its contract.
|
|
100
|
+
*/
|
|
101
|
+
type AdapterPropsRecord = Record<string, unknown>;
|
|
102
|
+
/**
|
|
103
|
+
* Svelte-facing callbacks for native Looma events.
|
|
104
|
+
*
|
|
105
|
+
* @ownership `bindAdapter` owns the DOM listeners; the caller owns callback
|
|
106
|
+
* identity and may replace callbacks through the action's `update` method.
|
|
107
|
+
*/
|
|
108
|
+
type AdapterEventHandlers = {
|
|
109
|
+
onOpen?: (detail: SvelteAdapterEventMap["open"]) => void;
|
|
110
|
+
onClose?: (detail: SvelteAdapterEventMap["close"]) => void;
|
|
111
|
+
onSelect?: (detail: SvelteAdapterEventMap["select"]) => void;
|
|
112
|
+
onChange?: (detail: SvelteAdapterEventMap["change"]) => void;
|
|
113
|
+
onDismiss?: (detail: SvelteAdapterEventMap["dismiss"]) => void;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Inputs shared by one-shot factory creation and the stateful Svelte action.
|
|
117
|
+
* `props` target DOM properties when available, while attributes, children,
|
|
118
|
+
* and slots preserve the generated factory's declarative construction rules.
|
|
119
|
+
*/
|
|
120
|
+
type SvelteAdapterOptions = AdapterEventHandlers & {
|
|
121
|
+
props?: AdapterPropsRecord;
|
|
122
|
+
attributes?: VanillaComponentOptions["attributes"];
|
|
123
|
+
children?: VanillaComponentOptions["children"];
|
|
124
|
+
slots?: VanillaComponentOptions["slots"];
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Keeps a Svelte-owned native root synchronized with adapter props and events.
|
|
128
|
+
*
|
|
129
|
+
* @ownership Svelte owns the node. The action owns only listeners it installs
|
|
130
|
+
* and never removes or replaces the node.
|
|
131
|
+
* @lifecycle Every update removes the previous listener set before installing
|
|
132
|
+
* the next one; `destroy` performs the final listener cleanup.
|
|
133
|
+
*/
|
|
134
|
+
declare function bindAdapter(node: HTMLElement, options?: SvelteAdapterOptions): {
|
|
135
|
+
update(updatedOptions?: SvelteAdapterOptions): void;
|
|
136
|
+
destroy(): void;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Materializes a native root directly from the generated declarative factory.
|
|
140
|
+
*
|
|
141
|
+
* @ownership The returned element belongs to the caller. Event listeners are
|
|
142
|
+
* attached for its lifetime; callers needing replaceable callbacks should use
|
|
143
|
+
* `bindAdapter` after creation.
|
|
144
|
+
* @failure An unknown tag cannot enter through the typed API; unchecked input
|
|
145
|
+
* fails when no generated factory exists rather than producing a partial root.
|
|
146
|
+
*/
|
|
147
|
+
declare function createAdapterElement(tagName: AdapterTagName, options?: SvelteAdapterOptions): HTMLElement;
|
|
148
|
+
/**
|
|
149
|
+
* Canonical adapter export-to-native-tag correspondence.
|
|
150
|
+
* Release checks consume this map to prove that generated Svelte factories and
|
|
151
|
+
* the framework-neutral package graph expose the same component inventory.
|
|
152
|
+
*/
|
|
153
|
+
declare const ADAPTER_COMPONENT_TAG_MAP: {
|
|
154
|
+
readonly AffordanceScope: "ui-affordance-scope";
|
|
155
|
+
readonly AvatarGroup: "ui-avatar-group";
|
|
156
|
+
readonly Avatar: "ui-avatar";
|
|
157
|
+
readonly Badge: "ui-badge";
|
|
158
|
+
readonly Button: "ui-button";
|
|
159
|
+
readonly Callout: "ui-callout";
|
|
160
|
+
readonly Checkbox: "ui-checkbox";
|
|
161
|
+
readonly Combobox: "ui-combobox";
|
|
162
|
+
readonly ContextMenu: "ui-context-menu";
|
|
163
|
+
readonly Dialog: "ui-dialog";
|
|
164
|
+
readonly Disclosure: "ui-disclosure";
|
|
165
|
+
readonly Editable: "ui-editable";
|
|
166
|
+
readonly FormField: "ui-form-field";
|
|
167
|
+
readonly IconButton: "ui-icon-button";
|
|
168
|
+
readonly Input: "ui-input";
|
|
169
|
+
readonly MenuItem: "ui-menu-item";
|
|
170
|
+
readonly Menu: "ui-menu";
|
|
171
|
+
readonly Popover: "ui-popover";
|
|
172
|
+
readonly RadioGroup: "ui-radio-group";
|
|
173
|
+
readonly Radio: "ui-radio";
|
|
174
|
+
readonly SearchResultRow: "ui-search-result-row";
|
|
175
|
+
readonly SearchShell: "ui-search-shell";
|
|
176
|
+
readonly Select: "ui-select";
|
|
177
|
+
readonly Switch: "ui-switch";
|
|
178
|
+
readonly Tabs: "ui-tabs";
|
|
179
|
+
readonly Textarea: "ui-textarea";
|
|
180
|
+
readonly ToastRegion: "ui-toast-region";
|
|
181
|
+
readonly Tooltip: "ui-tooltip";
|
|
182
|
+
readonly TopBar: "ui-top-bar";
|
|
183
|
+
readonly TreeItem: "ui-tree-item";
|
|
184
|
+
readonly Tree: "ui-tree";
|
|
185
|
+
readonly EditorInsertTableGrid: "ui-editor-insert-table-grid";
|
|
186
|
+
readonly EditorMentionMenu: "ui-editor-mention-menu";
|
|
187
|
+
readonly EditorSlashMenu: "ui-editor-slash-menu";
|
|
188
|
+
readonly EditorTableContextMenu: "ui-editor-table-context-menu";
|
|
189
|
+
readonly EditorTableOverlay: "ui-editor-table-overlay";
|
|
190
|
+
readonly EditorTableToolbar: "ui-editor-table-toolbar";
|
|
191
|
+
readonly EditorToolbar: "ui-editor-toolbar";
|
|
192
|
+
readonly Container: "ui-container";
|
|
193
|
+
readonly Grid: "ui-grid";
|
|
194
|
+
readonly Cluster: "ui-cluster";
|
|
195
|
+
readonly Reel: "ui-reel";
|
|
196
|
+
readonly Separator: "ui-separator";
|
|
197
|
+
readonly Sidebar: "ui-sidebar";
|
|
198
|
+
readonly Stack: "ui-stack";
|
|
199
|
+
readonly Switcher: "ui-switcher";
|
|
200
|
+
};
|
|
201
|
+
/** Human-readable provenance recorded beside generated adapter artifacts. */
|
|
202
|
+
declare const SVELTE_ADAPTER_NOTE = "Native-root adapter: factories and bindAdapter project the framework-neutral Looma declarative contract into Svelte.";
|
|
203
|
+
|
|
204
|
+
export { ADAPTER_COMPONENT_TAG_MAP, type AdapterEventHandlers, type AdapterPropsRecord, type AdapterTagName, type GeneratedTagName, SVELTE_ADAPTER_NOTE, type SvelteAdapterEventMap, type SvelteAdapterOptions, type VanillaComponentOptions, bindAdapter, createAdapterElement, createUiAffordanceScope, createUiAvatar, createUiAvatarGroup, createUiBadge, createUiButton, createUiCallout, createUiCheckbox, createUiCluster, createUiCombobox, createUiContainer, createUiContextMenu, createUiDialog, createUiDisclosure, createUiEditable, createUiEditorInsertTableGrid, createUiEditorMentionMenu, createUiEditorSlashMenu, createUiEditorTableContextMenu, createUiEditorTableOverlay, createUiEditorTableToolbar, createUiEditorToolbar, createUiFormField, createUiGrid, createUiIconButton, createUiInput, createUiMenu, createUiMenuItem, createUiPopover, createUiRadio, createUiRadioGroup, createUiReel, createUiSearchResultRow, createUiSearchShell, createUiSelect, createUiSeparator, createUiSidebar, createUiStack, createUiSwitch, createUiSwitcher, createUiTabs, createUiTextarea, createUiToastRegion, createUiTooltip, createUiTopBar, createUiTree, createUiTreeItem, factoryByTag };
|