@r2digisolutions/components 0.21.1 → 0.21.2
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.
|
@@ -63,18 +63,6 @@
|
|
|
63
63
|
|
|
64
64
|
const activeIds = $derived(selectedIds ?? (selectedId ? [selectedId] : []));
|
|
65
65
|
const activeSet = $derived(new Set(activeIds));
|
|
66
|
-
const ancestorOfSelection = $derived.by(() => {
|
|
67
|
-
const map = new Map(layers.map((l) => [l.id, l]));
|
|
68
|
-
const out = new Set<string>();
|
|
69
|
-
for (const id of activeIds) {
|
|
70
|
-
let cur = map.get(id);
|
|
71
|
-
while (cur?.parentId) {
|
|
72
|
-
out.add(cur.parentId);
|
|
73
|
-
cur = map.get(cur.parentId);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return out;
|
|
77
|
-
});
|
|
78
66
|
const inheritedLocked = $derived.by(() => {
|
|
79
67
|
const map = new Map(layers.map((l) => [l.id, l]));
|
|
80
68
|
const out = new Set<string>();
|
|
@@ -280,9 +268,7 @@
|
|
|
280
268
|
'flex w-full items-center gap-0.5 rounded-md px-1 py-1 text-left text-xs transition-colors',
|
|
281
269
|
activeSet.has(layer.id)
|
|
282
270
|
? 'bg-brand-500/15 text-primary'
|
|
283
|
-
|
|
284
|
-
? 'bg-brand-500/10 text-primary ring-1 ring-inset ring-brand-500/35'
|
|
285
|
-
: 'text-secondary hover:bg-surface-overlay hover:text-primary',
|
|
271
|
+
: 'text-secondary hover:bg-surface-overlay hover:text-primary',
|
|
286
272
|
dragId === layer.id && 'opacity-50',
|
|
287
273
|
nesting && 'ring-1 ring-brand-500 bg-brand-500/10'
|
|
288
274
|
]}
|
|
@@ -29,8 +29,9 @@ export declare function isLayoutPositionLocked(layers: CanvasLayer[], layerId: s
|
|
|
29
29
|
/** Child W/H is owned by a grid / scaleBox parent. */
|
|
30
30
|
export declare function isLayoutSizeLocked(layers: CanvasLayer[], layerId: string, map?: Map<string, CanvasLayer>): boolean;
|
|
31
31
|
/**
|
|
32
|
-
* Ancestors to draw while a nested layer is selected (
|
|
33
|
-
* Skips
|
|
32
|
+
* Ancestors to draw while a nested layer is selected (frame clip bounds).
|
|
33
|
+
* Skips the artboard, the current selection, and `group` — groups hug the
|
|
34
|
+
* children AABB, so outlining them looks like extra selection.
|
|
34
35
|
*/
|
|
35
36
|
export declare function selectionAncestorIds(layers: CanvasLayer[], selectedIds: string[]): string[];
|
|
36
37
|
/**
|
|
@@ -130,8 +130,9 @@ export function isLayoutSizeLocked(layers, layerId, map) {
|
|
|
130
130
|
return !!parent && LAYOUT_SIZE_KINDS.has(parent.kind);
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
|
-
* Ancestors to draw while a nested layer is selected (
|
|
134
|
-
* Skips
|
|
133
|
+
* Ancestors to draw while a nested layer is selected (frame clip bounds).
|
|
134
|
+
* Skips the artboard, the current selection, and `group` — groups hug the
|
|
135
|
+
* children AABB, so outlining them looks like extra selection.
|
|
135
136
|
*/
|
|
136
137
|
export function selectionAncestorIds(layers, selectedIds) {
|
|
137
138
|
const selected = new Set(selectedIds);
|
|
@@ -139,8 +140,12 @@ export function selectionAncestorIds(layers, selectedIds) {
|
|
|
139
140
|
const seen = new Set();
|
|
140
141
|
for (const id of selectedIds) {
|
|
141
142
|
for (const anc of getAncestors(layers, id)) {
|
|
142
|
-
if (selected.has(anc.id) ||
|
|
143
|
+
if (selected.has(anc.id) ||
|
|
144
|
+
seen.has(anc.id) ||
|
|
145
|
+
anc.kind === 'canvasPanel' ||
|
|
146
|
+
anc.kind === 'group') {
|
|
143
147
|
continue;
|
|
148
|
+
}
|
|
144
149
|
seen.add(anc.id);
|
|
145
150
|
out.push(anc.id);
|
|
146
151
|
}
|