@threadlabs/looma 0.3.0 → 0.4.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/svelte/index.d.ts DELETED
@@ -1,204 +0,0 @@
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 };