@r2digisolutions/components 0.19.20 → 0.19.22
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/components/atoms/Textarea/Textarea.svelte +4 -0
- package/dist/components/atoms/Textarea/Textarea.svelte.d.ts +1 -0
- package/dist/components/molecules/CanvasInspector/CanvasInspector.svelte +165 -71
- package/dist/components/molecules/Cascader/Cascader.svelte +2 -0
- package/dist/components/molecules/ColorPicker/ColorPicker.svelte +4 -13
- package/dist/components/molecules/DatePicker/DatePicker.svelte +2 -0
- package/dist/components/molecules/DateTimePicker/DateTimePicker.svelte +2 -0
- package/dist/components/molecules/DropdownMenu/DropdownMenu.svelte +12 -21
- package/dist/components/molecules/MediaLayerItem/MediaLayerItem.svelte +11 -3
- package/dist/components/molecules/MediaLayerItem/MediaLayerItem.svelte.d.ts +5 -1
- package/dist/components/molecules/MediaLayerList/MediaLayerList.svelte +31 -4
- package/dist/components/molecules/MediaStage/MediaStage.svelte +193 -164
- package/dist/components/molecules/MediaStage/MediaStage.svelte.d.ts +1 -45
- package/dist/components/molecules/MultiSelect/MultiSelect.svelte +2 -0
- package/dist/components/molecules/Popover/Popover.svelte +6 -0
- package/dist/components/molecules/Select/Select.svelte +36 -14
- package/dist/components/molecules/TimePicker/TimePicker.svelte +2 -0
- package/dist/components/molecules/TreeSelect/TreeSelect.svelte +2 -0
- package/dist/components/molecules/UserMenu/UserMenu.svelte +2 -0
- package/dist/components/organisms/CanvasEditor/CanvasEditor.svelte +155 -147
- package/dist/components/organisms/Dialog/Dialog.svelte +19 -3
- package/dist/components/organisms/Menubar/Menubar.svelte +121 -43
- package/dist/components/organisms/Menubar/Menubar.svelte.d.ts +1 -1
- package/dist/components/organisms/NotificationCenter/NotificationCenter.svelte +2 -0
- package/dist/components/organisms/PricingTable/PricingTable.svelte +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/utils/canvasHierarchy.d.ts +33 -0
- package/dist/utils/canvasHierarchy.js +108 -13
- package/dist/utils/popoverInvoker.d.ts +11 -0
- package/dist/utils/popoverInvoker.js +39 -0
- package/package.json +1 -1
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
md: 'max-w-md',
|
|
88
88
|
lg: 'max-w-lg',
|
|
89
89
|
xl: 'max-w-2xl',
|
|
90
|
-
full: '
|
|
90
|
+
full: ''
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
const footerAlignClasses: Record<FooterAlign, string> = {
|
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
{id}
|
|
213
213
|
class={[
|
|
214
214
|
'dialog-root',
|
|
215
|
+
size === 'full' && 'dialog-full',
|
|
215
216
|
sizeClasses[size],
|
|
216
217
|
position === 'top' && 'dialog-top',
|
|
217
218
|
!blurBackdrop && 'dialog-no-blur',
|
|
@@ -279,10 +280,10 @@
|
|
|
279
280
|
{#if children}
|
|
280
281
|
<div
|
|
281
282
|
class={[
|
|
282
|
-
'min-h-0 flex-1 px-5 py-2 text-sm text-primary',
|
|
283
|
+
'min-h-0 min-w-0 flex-1 px-5 py-2 text-sm text-primary',
|
|
283
284
|
scrollable &&
|
|
284
285
|
(size === 'full'
|
|
285
|
-
? '
|
|
286
|
+
? 'overflow-auto'
|
|
286
287
|
: size === 'xl'
|
|
287
288
|
? 'max-h-[min(70vh,36rem)] overflow-y-auto'
|
|
288
289
|
: 'max-h-[min(60vh,28rem)] overflow-y-auto')
|
|
@@ -332,6 +333,14 @@
|
|
|
332
333
|
overflow: visible;
|
|
333
334
|
}
|
|
334
335
|
|
|
336
|
+
.dialog-root.dialog-full {
|
|
337
|
+
width: calc(100% - 1.5rem);
|
|
338
|
+
height: calc(100% - 1.5rem);
|
|
339
|
+
max-width: none;
|
|
340
|
+
max-height: none;
|
|
341
|
+
overflow: hidden;
|
|
342
|
+
}
|
|
343
|
+
|
|
335
344
|
.dialog-root.dialog-top {
|
|
336
345
|
margin-top: 8vh;
|
|
337
346
|
margin-bottom: auto;
|
|
@@ -359,6 +368,13 @@
|
|
|
359
368
|
box-shadow: var(--shadow-xl);
|
|
360
369
|
overflow: hidden;
|
|
361
370
|
max-height: calc(100vh - 2rem);
|
|
371
|
+
min-width: 0;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.dialog-root.dialog-full .dialog-panel {
|
|
375
|
+
height: 100%;
|
|
376
|
+
max-height: 100%;
|
|
377
|
+
width: 100%;
|
|
362
378
|
}
|
|
363
379
|
|
|
364
380
|
.dialog-root[open] {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Attachment } from 'svelte/attachments';
|
|
3
|
+
|
|
2
4
|
export interface MenubarSubItem {
|
|
3
5
|
id: string;
|
|
4
6
|
label: string;
|
|
@@ -21,17 +23,16 @@
|
|
|
21
23
|
interface MenubarProps {
|
|
22
24
|
items?: MenubarItem[];
|
|
23
25
|
class?: string;
|
|
24
|
-
onselect?: (itemId: string, parentId: string) => void;
|
|
26
|
+
onselect?: (itemId: string, parentId: string, checked?: boolean) => void;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
let {
|
|
28
|
-
items = [],
|
|
29
|
-
class: className = '',
|
|
30
|
-
onselect
|
|
31
|
-
}: MenubarProps = $props();
|
|
29
|
+
let { items = [], class: className = '', onselect }: MenubarProps = $props();
|
|
32
30
|
|
|
33
31
|
let openId = $state<string | null>(null);
|
|
34
|
-
|
|
32
|
+
/** Local toggle overlay so checks flip even if the parent keeps `checked` static. */
|
|
33
|
+
let localChecked = $state<Record<string, boolean>>({});
|
|
34
|
+
/** Open submenu ids from the root menu down (Export → …). */
|
|
35
|
+
let flyoutPath = $state<string[]>([]);
|
|
35
36
|
let menubarEl = $state<HTMLElement | null>(null);
|
|
36
37
|
let menuEl = $state<HTMLDivElement | null>(null);
|
|
37
38
|
let menuStyle = $state('');
|
|
@@ -41,6 +42,10 @@
|
|
|
41
42
|
return `menubar-menu-${id}`;
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
function flyoutDomId(id: string) {
|
|
46
|
+
return `menubar-flyout-${id}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
function close() {
|
|
45
50
|
if (menuEl?.matches(':popover-open')) {
|
|
46
51
|
try {
|
|
@@ -50,15 +55,13 @@
|
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
openId = null;
|
|
53
|
-
|
|
58
|
+
flyoutPath = [];
|
|
54
59
|
highlightedId = null;
|
|
55
60
|
menuStyle = '';
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
function positionMenu(id: string) {
|
|
59
|
-
const btn = menubarEl?.querySelector(
|
|
60
|
-
`[data-menubar-trigger="${id}"]`
|
|
61
|
-
) as HTMLElement | null;
|
|
64
|
+
const btn = menubarEl?.querySelector(`[data-menubar-trigger="${id}"]`) as HTMLElement | null;
|
|
62
65
|
if (!btn || !menuEl) return;
|
|
63
66
|
const rect = btn.getBoundingClientRect();
|
|
64
67
|
const pad = 8;
|
|
@@ -78,9 +81,49 @@
|
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
|
|
84
|
+
function positionFlyout(id: string, flyoutEl?: HTMLElement | null) {
|
|
85
|
+
const trigger = (menuEl?.querySelector(`[data-menubar-item="${CSS.escape(id)}"]`) ??
|
|
86
|
+
document.querySelector(`[data-menubar-item="${CSS.escape(id)}"]`)) as HTMLElement | null;
|
|
87
|
+
const el = flyoutEl ?? (document.getElementById(flyoutDomId(id)) as HTMLElement | null);
|
|
88
|
+
if (!trigger || !el) return;
|
|
89
|
+
const rect = trigger.getBoundingClientRect();
|
|
90
|
+
const pad = 8;
|
|
91
|
+
const w = Math.max(180, el.offsetWidth || 180);
|
|
92
|
+
const h = el.offsetHeight || 80;
|
|
93
|
+
let left = rect.right - 4;
|
|
94
|
+
if (left + w > window.innerWidth - pad) {
|
|
95
|
+
left = Math.max(pad, rect.left - w + 4);
|
|
96
|
+
}
|
|
97
|
+
let top = rect.top - 4;
|
|
98
|
+
if (top + h > window.innerHeight - pad) {
|
|
99
|
+
top = Math.max(pad, window.innerHeight - h - pad);
|
|
100
|
+
}
|
|
101
|
+
el.style.cssText = `position:fixed;margin:0;inset:auto;top:${Math.round(top)}px;left:${Math.round(left)}px;`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function flyoutAttach(id: string): Attachment<HTMLElement> {
|
|
105
|
+
return (el) => {
|
|
106
|
+
try {
|
|
107
|
+
if (!el.matches(':popover-open')) el.showPopover();
|
|
108
|
+
} catch {
|
|
109
|
+
/* ignore */
|
|
110
|
+
}
|
|
111
|
+
positionFlyout(id, el);
|
|
112
|
+
const frame = requestAnimationFrame(() => positionFlyout(id, el));
|
|
113
|
+
return () => {
|
|
114
|
+
cancelAnimationFrame(frame);
|
|
115
|
+
try {
|
|
116
|
+
if (el.matches(':popover-open')) el.hidePopover();
|
|
117
|
+
} catch {
|
|
118
|
+
/* ignore */
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
81
124
|
function open(id: string) {
|
|
82
125
|
openId = id;
|
|
83
|
-
|
|
126
|
+
flyoutPath = [];
|
|
84
127
|
highlightedId = null;
|
|
85
128
|
queueMicrotask(() => {
|
|
86
129
|
if (!menuEl) return;
|
|
@@ -99,9 +142,20 @@
|
|
|
99
142
|
else open(id);
|
|
100
143
|
}
|
|
101
144
|
|
|
145
|
+
function isChecked(item: MenubarSubItem): boolean | undefined {
|
|
146
|
+
if (item.checked === undefined) return undefined;
|
|
147
|
+
return localChecked[item.id] ?? item.checked;
|
|
148
|
+
}
|
|
149
|
+
|
|
102
150
|
function select(subItem: MenubarSubItem, parentId: string) {
|
|
103
151
|
if (subItem.disabled || subItem.separator) return;
|
|
104
152
|
if (subItem.children?.length) return;
|
|
153
|
+
if (subItem.checked !== undefined) {
|
|
154
|
+
const next = !isChecked(subItem);
|
|
155
|
+
localChecked[subItem.id] = next;
|
|
156
|
+
onselect?.(subItem.id, parentId, next);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
105
159
|
onselect?.(subItem.id, parentId);
|
|
106
160
|
close();
|
|
107
161
|
}
|
|
@@ -129,7 +183,7 @@
|
|
|
129
183
|
function onToggle(e: ToggleEvent) {
|
|
130
184
|
if (e.newState === 'closed') {
|
|
131
185
|
openId = null;
|
|
132
|
-
|
|
186
|
+
flyoutPath = [];
|
|
133
187
|
highlightedId = null;
|
|
134
188
|
menuStyle = '';
|
|
135
189
|
}
|
|
@@ -141,8 +195,13 @@
|
|
|
141
195
|
|
|
142
196
|
$effect(() => {
|
|
143
197
|
if (!openId) return;
|
|
198
|
+
const path = flyoutPath;
|
|
144
199
|
const onWin = () => {
|
|
145
200
|
if (openId) positionMenu(openId);
|
|
201
|
+
for (const id of path) {
|
|
202
|
+
const el = document.getElementById(flyoutDomId(id));
|
|
203
|
+
if (el) positionFlyout(id, el);
|
|
204
|
+
}
|
|
146
205
|
};
|
|
147
206
|
window.addEventListener('resize', onWin);
|
|
148
207
|
window.addEventListener('scroll', onWin, true);
|
|
@@ -155,31 +214,35 @@
|
|
|
155
214
|
const openItem = $derived(items.find((i) => i.id === openId) ?? null);
|
|
156
215
|
</script>
|
|
157
216
|
|
|
158
|
-
{#snippet menuRows(list: MenubarSubItem[], parentId: string)}
|
|
217
|
+
{#snippet menuRows(list: MenubarSubItem[], parentId: string, ancestors: string[])}
|
|
159
218
|
{@const checks = levelHasChecks(list)}
|
|
160
219
|
{#each list as sub (sub.id)}
|
|
161
220
|
{#if sub.separator}
|
|
162
221
|
<div class="menubar-sep" role="separator"></div>
|
|
163
222
|
{:else}
|
|
223
|
+
{@const checked = isChecked(sub)}
|
|
164
224
|
{@const hasChildren = Boolean(sub.children?.length)}
|
|
165
|
-
{@const
|
|
225
|
+
{@const flyoutOpen = flyoutPath[ancestors.length] === sub.id}
|
|
226
|
+
{@const isHot = highlightedId === sub.id || flyoutPath.includes(sub.id)}
|
|
166
227
|
<div
|
|
167
228
|
class="relative"
|
|
168
229
|
role="presentation"
|
|
169
230
|
onmouseenter={() => {
|
|
170
231
|
if (sub.disabled) return;
|
|
171
232
|
highlightedId = sub.id;
|
|
172
|
-
|
|
233
|
+
flyoutPath = hasChildren ? [...ancestors, sub.id] : ancestors;
|
|
173
234
|
}}
|
|
174
235
|
>
|
|
175
236
|
<button
|
|
176
237
|
type="button"
|
|
177
|
-
|
|
238
|
+
data-menubar-item={sub.id}
|
|
239
|
+
role={checked !== undefined ? 'menuitemcheckbox' : 'menuitem'}
|
|
178
240
|
disabled={sub.disabled}
|
|
179
241
|
aria-disabled={sub.disabled || undefined}
|
|
180
|
-
aria-checked={
|
|
242
|
+
aria-checked={checked}
|
|
181
243
|
aria-haspopup={hasChildren ? 'menu' : undefined}
|
|
182
|
-
aria-expanded={hasChildren ?
|
|
244
|
+
aria-expanded={hasChildren ? flyoutOpen : undefined}
|
|
245
|
+
aria-controls={hasChildren ? flyoutDomId(sub.id) : undefined}
|
|
183
246
|
onclick={() => select(sub, parentId)}
|
|
184
247
|
class={[
|
|
185
248
|
'menubar-item',
|
|
@@ -191,8 +254,15 @@
|
|
|
191
254
|
>
|
|
192
255
|
{#if checks}
|
|
193
256
|
<span class="menubar-check" aria-hidden="true">
|
|
194
|
-
{#if
|
|
195
|
-
<svg
|
|
257
|
+
{#if checked}
|
|
258
|
+
<svg
|
|
259
|
+
width="12"
|
|
260
|
+
height="12"
|
|
261
|
+
viewBox="0 0 24 24"
|
|
262
|
+
fill="none"
|
|
263
|
+
stroke="currentColor"
|
|
264
|
+
stroke-width="2.75"
|
|
265
|
+
>
|
|
196
266
|
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
|
197
267
|
</svg>
|
|
198
268
|
{/if}
|
|
@@ -217,17 +287,20 @@
|
|
|
217
287
|
{/if}
|
|
218
288
|
</button>
|
|
219
289
|
|
|
220
|
-
{#if hasChildren &&
|
|
290
|
+
{#if hasChildren && flyoutOpen && sub.children?.length}
|
|
221
291
|
<div
|
|
222
|
-
|
|
292
|
+
id={flyoutDomId(sub.id)}
|
|
293
|
+
class="menubar-popover menubar-panel menubar-flyout m-0 outline-none"
|
|
294
|
+
popover="manual"
|
|
223
295
|
role="menu"
|
|
224
296
|
tabindex="-1"
|
|
297
|
+
{@attach flyoutAttach(sub.id)}
|
|
225
298
|
onmouseenter={() => {
|
|
226
|
-
|
|
299
|
+
flyoutPath = [...ancestors, sub.id];
|
|
227
300
|
highlightedId = sub.id;
|
|
228
301
|
}}
|
|
229
302
|
>
|
|
230
|
-
{@render menuRows(sub.children, parentId)}
|
|
303
|
+
{@render menuRows(sub.children, parentId, [...ancestors, sub.id])}
|
|
231
304
|
</div>
|
|
232
305
|
{/if}
|
|
233
306
|
</div>
|
|
@@ -235,7 +308,11 @@
|
|
|
235
308
|
{/each}
|
|
236
309
|
{/snippet}
|
|
237
310
|
|
|
238
|
-
<div
|
|
311
|
+
<div
|
|
312
|
+
bind:this={menubarEl}
|
|
313
|
+
class={['menubar-bar flex items-center gap-px', className]}
|
|
314
|
+
role="menubar"
|
|
315
|
+
>
|
|
239
316
|
{#each items as item (item.id)}
|
|
240
317
|
{@const isOpen = openId === item.id}
|
|
241
318
|
<button
|
|
@@ -250,17 +327,14 @@
|
|
|
250
327
|
if (openId !== null && openId !== item.id) open(item.id);
|
|
251
328
|
}}
|
|
252
329
|
onkeydown={(e) => handleMenuKeydown(e, item)}
|
|
253
|
-
class={[
|
|
254
|
-
'menubar-trigger',
|
|
255
|
-
isOpen ? 'menubar-trigger-open' : 'menubar-trigger-idle'
|
|
256
|
-
]}
|
|
330
|
+
class={['menubar-trigger', isOpen ? 'menubar-trigger-open' : 'menubar-trigger-idle']}
|
|
257
331
|
>
|
|
258
332
|
{item.label}
|
|
259
333
|
</button>
|
|
260
334
|
{/each}
|
|
261
335
|
</div>
|
|
262
336
|
|
|
263
|
-
<!--
|
|
337
|
+
<!-- Native Popover — overflow visible so UA `overflow:auto` never paints a nested scrollbar -->
|
|
264
338
|
<div
|
|
265
339
|
bind:this={menuEl}
|
|
266
340
|
id={openId ? menuDomId(openId) : 'menubar-menu'}
|
|
@@ -272,14 +346,17 @@
|
|
|
272
346
|
class="menubar-popover menubar-panel m-0 outline-none"
|
|
273
347
|
>
|
|
274
348
|
{#if openItem?.items?.length}
|
|
275
|
-
{@render menuRows(openItem.items, openItem.id)}
|
|
349
|
+
{@render menuRows(openItem.items, openItem.id, [])}
|
|
276
350
|
{/if}
|
|
277
351
|
</div>
|
|
278
352
|
|
|
279
353
|
<style>
|
|
280
|
-
/* UA popover
|
|
354
|
+
/* UA popover: inset:0 + overflow:auto — both cause the nested scrollbar */
|
|
281
355
|
.menubar-popover:popover-open {
|
|
282
356
|
inset: unset;
|
|
357
|
+
overflow: visible;
|
|
358
|
+
height: fit-content;
|
|
359
|
+
width: max-content;
|
|
283
360
|
}
|
|
284
361
|
|
|
285
362
|
.menubar-trigger {
|
|
@@ -293,7 +370,9 @@
|
|
|
293
370
|
font-weight: 400;
|
|
294
371
|
letter-spacing: -0.01em;
|
|
295
372
|
outline: none;
|
|
296
|
-
transition:
|
|
373
|
+
transition:
|
|
374
|
+
background-color 80ms ease,
|
|
375
|
+
color 80ms ease;
|
|
297
376
|
}
|
|
298
377
|
|
|
299
378
|
.menubar-trigger:focus-visible {
|
|
@@ -306,7 +385,11 @@
|
|
|
306
385
|
|
|
307
386
|
.menubar-trigger-idle:hover {
|
|
308
387
|
/* text-primary is light in dark mode → soft white wash (never surface-overlay #171717) */
|
|
309
|
-
background: color-mix(
|
|
388
|
+
background: color-mix(
|
|
389
|
+
in oklab,
|
|
390
|
+
var(--text-primary, var(--color-text-primary, CanvasText)) 14%,
|
|
391
|
+
transparent
|
|
392
|
+
);
|
|
310
393
|
color: var(--text-primary, var(--color-text-primary, CanvasText));
|
|
311
394
|
}
|
|
312
395
|
|
|
@@ -353,13 +436,6 @@
|
|
|
353
436
|
0 4px 16px -4px color-mix(in oklab, #000 40%, transparent);
|
|
354
437
|
}
|
|
355
438
|
|
|
356
|
-
:global(.menubar-flyout) {
|
|
357
|
-
position: absolute;
|
|
358
|
-
left: calc(100% - 2px);
|
|
359
|
-
top: -0.25rem;
|
|
360
|
-
z-index: 2;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
439
|
:global(.menubar-sep) {
|
|
364
440
|
height: 1px;
|
|
365
441
|
margin: 0.25rem 0.5rem;
|
|
@@ -383,7 +459,9 @@
|
|
|
383
459
|
letter-spacing: -0.01em;
|
|
384
460
|
text-align: left;
|
|
385
461
|
outline: none;
|
|
386
|
-
transition:
|
|
462
|
+
transition:
|
|
463
|
+
background-color 60ms ease,
|
|
464
|
+
color 60ms ease;
|
|
387
465
|
}
|
|
388
466
|
|
|
389
467
|
:global(.menubar-item-default) {
|
|
@@ -18,7 +18,7 @@ export interface MenubarItem {
|
|
|
18
18
|
interface MenubarProps {
|
|
19
19
|
items?: MenubarItem[];
|
|
20
20
|
class?: string;
|
|
21
|
-
onselect?: (itemId: string, parentId: string) => void;
|
|
21
|
+
onselect?: (itemId: string, parentId: string, checked?: boolean) => void;
|
|
22
22
|
}
|
|
23
23
|
declare const Menubar: import("svelte").Component<MenubarProps, {}, "">;
|
|
24
24
|
type Menubar = ReturnType<typeof Menubar>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { on } from 'svelte/events';
|
|
3
3
|
import NotificationRow from '../../molecules/NotificationRow/NotificationRow.svelte';
|
|
4
|
+
import { popoverInvokerToggle } from '../../../utils/popoverInvoker.js';
|
|
4
5
|
|
|
5
6
|
export interface NotificationItem {
|
|
6
7
|
id: string;
|
|
@@ -169,6 +170,7 @@
|
|
|
169
170
|
type="button"
|
|
170
171
|
popovertarget={popoverId}
|
|
171
172
|
popovertargetaction="toggle"
|
|
173
|
+
{@attach popoverInvokerToggle(() => popoverEl)}
|
|
172
174
|
aria-label="{copy.trigger}{unreadCount > 0 ? withCount(copy.unreadSuffix, unreadCount) : ''}"
|
|
173
175
|
aria-expanded={open}
|
|
174
176
|
aria-controls={popoverId}
|
|
@@ -427,8 +427,8 @@
|
|
|
427
427
|
{/snippet}
|
|
428
428
|
|
|
429
429
|
{#snippet comparisonTable(withPricingHeader: boolean)}
|
|
430
|
-
<div class="w-full overflow-x-auto rounded-xl border border-border bg-surface-elevated">
|
|
431
|
-
<table class="w-full min-w-
|
|
430
|
+
<div class="min-w-0 w-full overflow-x-auto rounded-xl border border-border bg-surface-elevated">
|
|
431
|
+
<table class="w-full min-w-max border-collapse text-sm" aria-label="Plan feature comparison">
|
|
432
432
|
<thead class="sticky top-0 z-30">
|
|
433
433
|
{#if withPricingHeader}
|
|
434
434
|
<tr class="border-b border-border bg-surface-elevated shadow-sm">
|
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
</div>
|
|
572
572
|
{/snippet}
|
|
573
573
|
|
|
574
|
-
<div class={['w-full space-y-4', className]}>
|
|
574
|
+
<div class={['min-w-0 w-full space-y-4', className]}>
|
|
575
575
|
{#if canToggleBilling}
|
|
576
576
|
<div class="flex justify-center">
|
|
577
577
|
<SegmentedControl
|
package/dist/index.d.ts
CHANGED
|
@@ -834,6 +834,7 @@ export { default as AudioEditorTemplate } from './components/templates/AudioEdit
|
|
|
834
834
|
export { themeStore } from './utils/theme.svelte.js';
|
|
835
835
|
export type { Theme, ThemePalette } from './utils/theme.svelte.js';
|
|
836
836
|
export { createId } from './utils/id.js';
|
|
837
|
+
export { bindPopoverInvokerToggle, popoverInvokerToggle } from './utils/popoverInvoker.js';
|
|
837
838
|
export { resolveAccessor, accessorPatchKey, resolveRowKey } from './utils/columnAccessor.js';
|
|
838
839
|
export type { ColumnAccessor, RowKey } from './utils/columnAccessor.js';
|
|
839
840
|
export { pageVisibility } from './utils/pageVisibility.svelte.js';
|
|
@@ -864,7 +865,7 @@ export type { MediaAsset, MediaAssetKind, MediaClip, MediaClipAlign, MediaClipRe
|
|
|
864
865
|
export { uid, createMediaClip, createMediaTrack, createMediaAsset, clipDurationMs, moveClip, trimClipStart, trimClipEnd, isClipActiveAt, findClipAt, updateClipInTracks, removeClipFromTracks, removeClipsFromTracks, splitClipAt, splitClipsAt, duplicateClipInTracks, mergeClipsInTracks, canMergeMediaClips, moveClipsByDelta, findClipById, nextTrackName, reorderTracks, moveTrack, removeTrack, removeTracks, defaultOverlayRect, defaultMediaClipRect, resolveClipRect, alignClipRect, alignMediaRect, clipHasSpatialRect, isMediaClipFieldModified, resetMediaClipField, findTransitionAt, transitionLayerStyle, transitionDipOverlay, resolvePreviewOpacity, resolveClipOpacity, MEDIA_CLIP_DEFAULTS, kindFromFile, probeMediaSrc } from './utils/mediaTracks.js';
|
|
865
866
|
export { emptyCanvasDocument, createCanvasLayer, createCanvasGuide, createPathFromDocPoints, rebakePathLayer, pathPointsToDoc, reorderCanvasLayers, updateCanvasLayer, updateCanvasLayers, alignLayerRect, snapLayerRect, snapRectToGuides, migrateCanvasDocument, defaultSlotFromRect, rectFromSlot, ensureLayerSlot, canvasLayerFieldDefault, isCanvasFieldModified, resetCanvasField, applyTextAutoSize, CANVAS_PRESETS, presetIdForSize } from './utils/canvasDocument.js';
|
|
866
867
|
export type { CanvasDocument, CanvasLayer, CanvasLayerKind, CanvasLayerRect, CanvasPoint, CanvasObjectFit, CanvasTextAlign, CanvasResettableField, CanvasAlign, CanvasFontStyle, CanvasTextDecoration, CanvasGuide, CanvasGuideOrientation, CanvasAnchors, CanvasSlot, CanvasExposedProp, CanvasWidgetDefinition } from './utils/canvasDocument.js';
|
|
867
|
-
export { isContainerKind, canHaveChildren, getChildren, getDescendantIds, getSubtreeIds, getAncestors, isEffectivelyVisible, paintTransformForLayer, isDescendant, canReparent, ANCHOR_PRESETS, resolveSlotRect, slotFromLocalRect, computeAbsoluteRects, absoluteRectFor, reparentLayer, wrapSelection, groupLayers, ungroupLayers, deleteSubtree, duplicateSubtree, reorderSiblings, clipPathForLayer, scrollBoxOverflow, scrollBarMetrics, applyScrollBoxOffsets } from './utils/canvasHierarchy.js';
|
|
868
|
+
export { isContainerKind, canHaveChildren, getChildren, getDescendantIds, getSubtreeIds, getAncestors, enclosingGroupId, isEffectivelyVisible, isEffectivelyLocked, isLayoutPositionLocked, isLayoutSizeLocked, selectionAncestorIds, LAYOUT_POSITION_KINDS, LAYOUT_SIZE_KINDS, paintTransformForLayer, isDescendant, canReparent, ANCHOR_PRESETS, resolveSlotRect, slotFromLocalRect, translateSlot, stepAxis, computeAbsoluteRects, absoluteRectFor, reparentLayer, wrapSelection, groupLayers, ungroupLayers, deleteSubtree, duplicateSubtree, reorderSiblings, clipPathForLayer, scrollBoxOverflow, scrollBarMetrics, applyScrollBoxOffsets } from './utils/canvasHierarchy.js';
|
|
868
869
|
export { createWidgetDefinition, createWidgetFromSelection, placeWidgetInstance, resolveWidgetInstance, flattenLayersWithWidgets, breakWidgetInstance, updateWidgetDefinition, deleteWidgetDefinition, renameWidgetDefinition, duplicateWidgetDefinition, syncInstanceSizesToDefinition, setExposedProp, isPropExposed, getExposedProp, getExposedFieldDefault, resolveExposedPropValue, groupExposedPropsByLayer, setInstanceOverride, getNamedSlotsFromDefinition, listFillableSlotsForInstance } from './utils/canvasWidget.js';
|
|
869
870
|
export { createCanvasHistory, pushCanvasHistory, undoCanvasHistory, redoCanvasHistory, serializeCanvasDoc, parseCanvasDoc } from './utils/canvasHistory.js';
|
|
870
871
|
export type { CanvasHistoryState } from './utils/canvasHistory.js';
|
package/dist/index.js
CHANGED
|
@@ -568,6 +568,7 @@ export { default as AudioEditorTemplate } from './components/templates/AudioEdit
|
|
|
568
568
|
// ── Utils ────────────────────────────────────────────────────────────────────
|
|
569
569
|
export { themeStore } from './utils/theme.svelte.js';
|
|
570
570
|
export { createId } from './utils/id.js';
|
|
571
|
+
export { bindPopoverInvokerToggle, popoverInvokerToggle } from './utils/popoverInvoker.js';
|
|
571
572
|
export { resolveAccessor, accessorPatchKey, resolveRowKey } from './utils/columnAccessor.js';
|
|
572
573
|
export { pageVisibility } from './utils/pageVisibility.svelte.js';
|
|
573
574
|
export { network } from './utils/network.svelte.js';
|
|
@@ -586,7 +587,7 @@ export { emptyBlogDocument, createBlock, createComponentBlock, serializeBlogDocu
|
|
|
586
587
|
export { msToPx, pxToMs, pxPerMsFromZoom, snapMs, clampMs, formatTimecode, ticksForDuration, snapStepForZoom } from './utils/mediaTime.js';
|
|
587
588
|
export { uid, createMediaClip, createMediaTrack, createMediaAsset, clipDurationMs, moveClip, trimClipStart, trimClipEnd, isClipActiveAt, findClipAt, updateClipInTracks, removeClipFromTracks, removeClipsFromTracks, splitClipAt, splitClipsAt, duplicateClipInTracks, mergeClipsInTracks, canMergeMediaClips, moveClipsByDelta, findClipById, nextTrackName, reorderTracks, moveTrack, removeTrack, removeTracks, defaultOverlayRect, defaultMediaClipRect, resolveClipRect, alignClipRect, alignMediaRect, clipHasSpatialRect, isMediaClipFieldModified, resetMediaClipField, findTransitionAt, transitionLayerStyle, transitionDipOverlay, resolvePreviewOpacity, resolveClipOpacity, MEDIA_CLIP_DEFAULTS, kindFromFile, probeMediaSrc } from './utils/mediaTracks.js';
|
|
588
589
|
export { emptyCanvasDocument, createCanvasLayer, createCanvasGuide, createPathFromDocPoints, rebakePathLayer, pathPointsToDoc, reorderCanvasLayers, updateCanvasLayer, updateCanvasLayers, alignLayerRect, snapLayerRect, snapRectToGuides, migrateCanvasDocument, defaultSlotFromRect, rectFromSlot, ensureLayerSlot, canvasLayerFieldDefault, isCanvasFieldModified, resetCanvasField, applyTextAutoSize, CANVAS_PRESETS, presetIdForSize } from './utils/canvasDocument.js';
|
|
589
|
-
export { isContainerKind, canHaveChildren, getChildren, getDescendantIds, getSubtreeIds, getAncestors, isEffectivelyVisible, paintTransformForLayer, isDescendant, canReparent, ANCHOR_PRESETS, resolveSlotRect, slotFromLocalRect, computeAbsoluteRects, absoluteRectFor, reparentLayer, wrapSelection, groupLayers, ungroupLayers, deleteSubtree, duplicateSubtree, reorderSiblings, clipPathForLayer, scrollBoxOverflow, scrollBarMetrics, applyScrollBoxOffsets } from './utils/canvasHierarchy.js';
|
|
590
|
+
export { isContainerKind, canHaveChildren, getChildren, getDescendantIds, getSubtreeIds, getAncestors, enclosingGroupId, isEffectivelyVisible, isEffectivelyLocked, isLayoutPositionLocked, isLayoutSizeLocked, selectionAncestorIds, LAYOUT_POSITION_KINDS, LAYOUT_SIZE_KINDS, paintTransformForLayer, isDescendant, canReparent, ANCHOR_PRESETS, resolveSlotRect, slotFromLocalRect, translateSlot, stepAxis, computeAbsoluteRects, absoluteRectFor, reparentLayer, wrapSelection, groupLayers, ungroupLayers, deleteSubtree, duplicateSubtree, reorderSiblings, clipPathForLayer, scrollBoxOverflow, scrollBarMetrics, applyScrollBoxOffsets } from './utils/canvasHierarchy.js';
|
|
590
591
|
export { createWidgetDefinition, createWidgetFromSelection, placeWidgetInstance, resolveWidgetInstance, flattenLayersWithWidgets, breakWidgetInstance, updateWidgetDefinition, deleteWidgetDefinition, renameWidgetDefinition, duplicateWidgetDefinition, syncInstanceSizesToDefinition, setExposedProp, isPropExposed, getExposedProp, getExposedFieldDefault, resolveExposedPropValue, groupExposedPropsByLayer, setInstanceOverride, getNamedSlotsFromDefinition, listFillableSlotsForInstance } from './utils/canvasWidget.js';
|
|
591
592
|
export { createCanvasHistory, pushCanvasHistory, undoCanvasHistory, redoCanvasHistory, serializeCanvasDoc, parseCanvasDoc } from './utils/canvasHistory.js';
|
|
592
593
|
export { renderCanvasDocument, exportCanvasBlob, downloadBlob, backgroundAlpha } from './utils/canvasExport.js';
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { CanvasAnchors, CanvasDocument, CanvasLayer, CanvasLayerKind, CanvasLayerRect, CanvasSlot } from './canvasDocument.js';
|
|
2
2
|
export declare const CONTAINER_KINDS: ReadonlySet<CanvasLayerKind>;
|
|
3
3
|
export declare const LAYOUT_BOX_KINDS: ReadonlySet<CanvasLayerKind>;
|
|
4
|
+
/** Parents that own child X/Y (UMG slot layout). Group / panel / overlay stay freeform. */
|
|
5
|
+
export declare const LAYOUT_POSITION_KINDS: ReadonlySet<CanvasLayerKind>;
|
|
6
|
+
/** Parents that own child W/H (cell / uniform scale). */
|
|
7
|
+
export declare const LAYOUT_SIZE_KINDS: ReadonlySet<CanvasLayerKind>;
|
|
4
8
|
/**
|
|
5
9
|
* Structural shells whose empty area should start a marquee (not a layer drag),
|
|
6
10
|
* matching Figma-style select-drag on the canvas / inside frames.
|
|
11
|
+
* Groups are omitted: they behave like a single object (click/drag the group).
|
|
7
12
|
*/
|
|
8
13
|
export declare const MARQUEE_PASS_KINDS: ReadonlySet<CanvasLayerKind>;
|
|
9
14
|
export declare function isContainerKind(kind: CanvasLayerKind): boolean;
|
|
@@ -13,8 +18,21 @@ export declare function getChildren(layers: CanvasLayer[], parentId: string | nu
|
|
|
13
18
|
export declare function getDescendantIds(layers: CanvasLayer[], rootId: string): string[];
|
|
14
19
|
export declare function getSubtreeIds(layers: CanvasLayer[], rootId: string): string[];
|
|
15
20
|
export declare function getAncestors(layers: CanvasLayer[], layerId: string): CanvasLayer[];
|
|
21
|
+
/** Outermost `group` ancestor, or null if the layer is not inside a group. */
|
|
22
|
+
export declare function enclosingGroupId(layers: CanvasLayer[], layerId: string): string | null;
|
|
16
23
|
/** True when the layer and every ancestor is visible (flat stage paint must check this). */
|
|
17
24
|
export declare function isEffectivelyVisible(layers: CanvasLayer[], layerId: string, map?: Map<string, CanvasLayer>): boolean;
|
|
25
|
+
/** True when the layer or any ancestor is locked (parent lock freezes the whole subtree). */
|
|
26
|
+
export declare function isEffectivelyLocked(layers: CanvasLayer[], layerId: string, map?: Map<string, CanvasLayer>): boolean;
|
|
27
|
+
/** Child X/Y is owned by an hBox / vBox / wrap / grid parent. */
|
|
28
|
+
export declare function isLayoutPositionLocked(layers: CanvasLayer[], layerId: string, map?: Map<string, CanvasLayer>): boolean;
|
|
29
|
+
/** Child W/H is owned by a grid / scaleBox parent. */
|
|
30
|
+
export declare function isLayoutSizeLocked(layers: CanvasLayer[], layerId: string, map?: Map<string, CanvasLayer>): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Ancestors to draw while a nested layer is selected (UMG / Canva parent chrome).
|
|
33
|
+
* Skips `canvasPanel` (full-bleed artboard) and layers already in the selection.
|
|
34
|
+
*/
|
|
35
|
+
export declare function selectionAncestorIds(layers: CanvasLayer[], selectedIds: string[]): string[];
|
|
18
36
|
/**
|
|
19
37
|
* CSS transform for a flat-stage layer so ancestor rotations orbit children
|
|
20
38
|
* around each ancestor's center (DOM is not nested).
|
|
@@ -107,6 +125,20 @@ export declare function slotFromLocalRect(parentSize: {
|
|
|
107
125
|
width: number;
|
|
108
126
|
height: number;
|
|
109
127
|
}, rect: CanvasLayerRect, anchors?: CanvasAnchors): CanvasSlot;
|
|
128
|
+
/**
|
|
129
|
+
* Translate a UMG slot without changing size.
|
|
130
|
+
* `right` / `bottom` are inverted (distance from the opposite anchored edge).
|
|
131
|
+
*/
|
|
132
|
+
export declare function translateSlot(slot: CanvasSlot, dx: number, dy: number): CanvasSlot;
|
|
133
|
+
/**
|
|
134
|
+
* Keyboard nudge along one axis.
|
|
135
|
+
* With snap: land on the next/previous grid line (if already on-grid, move one cell; Shift = two).
|
|
136
|
+
*/
|
|
137
|
+
export declare function stepAxis(value: number, dir: 1 | -1, opts: {
|
|
138
|
+
snap: boolean;
|
|
139
|
+
cell: number;
|
|
140
|
+
coarse?: boolean;
|
|
141
|
+
}): number;
|
|
110
142
|
export declare function contentPadding(layer: CanvasLayer): {
|
|
111
143
|
left: number;
|
|
112
144
|
top: number;
|
|
@@ -158,6 +190,7 @@ export declare function reparentLayer(layers: CanvasLayer[], layerId: string, ne
|
|
|
158
190
|
width: number;
|
|
159
191
|
height: number;
|
|
160
192
|
}): CanvasLayer[];
|
|
193
|
+
/** Wrap one or more layers in a new parent (`group`, `hBox`, `border`, …). */
|
|
161
194
|
export declare function wrapSelection(doc: CanvasDocument, selectedIds: string[], wrapKind?: CanvasLayerKind): {
|
|
162
195
|
doc: CanvasDocument;
|
|
163
196
|
wrapperId: string;
|