svedit 0.9.0 → 0.10.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/README.md +113 -4
- package/dist/AnnotatedTextProperty.svelte +41 -8
- package/dist/AnnotatedTextProperty.svelte.d.ts.map +1 -1
- package/dist/Command.svelte.d.ts +0 -1
- package/dist/Command.svelte.d.ts.map +1 -1
- package/dist/Command.svelte.js +18 -3
- package/dist/CustomProperty.svelte +20 -9
- package/dist/CustomProperty.svelte.d.ts +2 -1
- package/dist/CustomProperty.svelte.d.ts.map +1 -1
- package/dist/Node.svelte +7 -5
- package/dist/Node.svelte.d.ts.map +1 -1
- package/dist/NodeArrayProperty.svelte +65 -42
- package/dist/NodeArrayProperty.svelte.d.ts.map +1 -1
- package/dist/NodeCaret.svelte +0 -7
- package/dist/NodeGap.svelte +179 -81
- package/dist/NodeGap.svelte.d.ts +0 -2
- package/dist/NodeGap.svelte.d.ts.map +1 -1
- package/dist/NodeGapMarkers.svelte +251 -84
- package/dist/NodeGapMarkers.svelte.d.ts +2 -0
- package/dist/NodeGapMarkers.svelte.d.ts.map +1 -1
- package/dist/NodeSelectionMarkers.svelte +4 -3
- package/dist/NodeSelectionMarkers.svelte.d.ts.map +1 -1
- package/dist/Session.svelte.d.ts +12 -1
- package/dist/Session.svelte.d.ts.map +1 -1
- package/dist/Session.svelte.js +40 -3
- package/dist/Svedit.svelte +336 -165
- package/dist/Svedit.svelte.d.ts.map +1 -1
- package/dist/Transaction.svelte.d.ts +24 -5
- package/dist/Transaction.svelte.d.ts.map +1 -1
- package/dist/Transaction.svelte.js +103 -61
- package/dist/doc_utils.d.ts +64 -3
- package/dist/doc_utils.d.ts.map +1 -1
- package/dist/doc_utils.js +276 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/node_visibility.svelte.d.ts +9 -0
- package/dist/node_visibility.svelte.d.ts.map +1 -0
- package/dist/node_visibility.svelte.js +718 -0
- package/dist/styles/svedit-animations.css +8 -0
- package/dist/styles/svedit-colors.css +1 -0
- package/dist/types.d.ts +46 -3
- package/dist/utils.d.ts +52 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +109 -3
- package/package.json +3 -2
- package/src/lib/AnnotatedTextProperty.svelte +41 -8
- package/src/lib/Command.svelte.js +18 -3
- package/src/lib/CustomProperty.svelte +20 -9
- package/src/lib/Node.svelte +7 -5
- package/src/lib/NodeArrayProperty.svelte +65 -42
- package/src/lib/NodeCaret.svelte +0 -7
- package/src/lib/NodeGap.svelte +179 -81
- package/src/lib/NodeGapMarkers.svelte +251 -84
- package/src/lib/NodeSelectionMarkers.svelte +4 -3
- package/src/lib/Session.svelte.js +40 -3
- package/src/lib/Svedit.svelte +336 -165
- package/src/lib/Transaction.svelte.js +103 -61
- package/src/lib/doc_utils.js +276 -10
- package/src/lib/index.js +5 -1
- package/src/lib/node_visibility.svelte.js +718 -0
- package/src/lib/styles/svedit-animations.css +8 -0
- package/src/lib/styles/svedit-colors.css +1 -0
- package/src/lib/types.d.ts +46 -3
- package/src/lib/utils.js +109 -3
- package/dist/node_gap_computation.svelte.d.ts +0 -5
- package/dist/node_gap_computation.svelte.d.ts.map +0 -1
- package/dist/node_gap_computation.svelte.js +0 -621
- package/src/lib/node_gap_computation.svelte.js +0 -621
package/dist/NodeGap.svelte
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
function cycle_z_index(/** @type {MouseEvent} */ e) {
|
|
3
|
+
const el = /** @type {HTMLElement} */ (e.currentTarget);
|
|
4
|
+
if (el.hasAttribute('data-sent-to-back')) {
|
|
5
|
+
document.querySelectorAll('.svedit-selectable[data-sent-to-back]').forEach(prev => {
|
|
6
|
+
prev.removeAttribute('data-sent-to-back');
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
el.setAttribute('data-sent-to-back', '');
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
1
13
|
<script>
|
|
14
|
+
import { serialize_path } from './utils.js';
|
|
15
|
+
import { getContext } from 'svelte';
|
|
16
|
+
|
|
2
17
|
/**
|
|
18
|
+
* ┌─────────────────────────────────────────────────────────────────┐
|
|
19
|
+
* │ MUST RULES — do not violate when modifying this file │
|
|
20
|
+
* ├─────────────────────────────────────────────────────────────────┤
|
|
21
|
+
* │ 1. Edge gaps (gap-before at offset 0 / gap-after.last) MUST │
|
|
22
|
+
* │ render OUTSIDE the node-array container — they extend into │
|
|
23
|
+
* │ the whitespace above/below (column) or left/right (row) of │
|
|
24
|
+
* │ the first/last node. They only clamp when the consumer │
|
|
25
|
+
* │ explicitly opts in via --node-caret-boundary(-x/-y). │
|
|
26
|
+
* │ 2. Gaps MUST NEVER overlap nodes. They render strictly in the │
|
|
27
|
+
* │ whitespace between nodes (mid gaps) or outside the node │
|
|
28
|
+
* │ array bounds (edge gaps). Never on top of a node. │
|
|
29
|
+
* └─────────────────────────────────────────────────────────────────┘
|
|
30
|
+
*
|
|
3
31
|
* Invisible keyboard caret selectable and gap hit area.
|
|
4
32
|
*
|
|
5
33
|
* Rendered as a sibling of Node elements inside NodeArrayProperty,
|
|
@@ -9,9 +37,10 @@
|
|
|
9
37
|
*
|
|
10
38
|
* Always present in the DOM when editable (stable structure for
|
|
11
39
|
* selection anchoring, scrollTo, etc.). Anchor positioning is
|
|
12
|
-
* activated lazily via the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
40
|
+
* activated lazily via the `.positioned` class, toggled imperatively
|
|
41
|
+
* by the IO callback / MO / bootstrap in node_visibility — keeps
|
|
42
|
+
* NodeGap allocation-free of per-instance Svelte signals, which
|
|
43
|
+
* matters at 1000+ NodeGaps per scroll frame.
|
|
15
44
|
*
|
|
16
45
|
* `position-visibility: anchors-visible` does NOT skip anchor
|
|
17
46
|
* resolution — the browser resolves all anchor() then hides the
|
|
@@ -20,42 +49,55 @@
|
|
|
20
49
|
*
|
|
21
50
|
* Row/column detection uses var(--row, 1) with the * 99999 multiplier
|
|
22
51
|
* trick — no @container style() queries, works in all browsers.
|
|
52
|
+
*
|
|
53
|
+
* If you override this component via `system_components.NodeGap`, make
|
|
54
|
+
* sure your custom component also handles read-only mode by rendering a
|
|
55
|
+
* plain `.node-gap` placeholder without editable internals.
|
|
23
56
|
*/
|
|
24
|
-
|
|
57
|
+
const svedit = getContext('svedit');
|
|
58
|
+
let { array_path, offset, count, empty = false } = $props();
|
|
59
|
+
let is_editable = $derived(svedit.editable);
|
|
25
60
|
|
|
26
61
|
let is_first = $derived(offset === 0);
|
|
27
62
|
let is_last = $derived(offset === count);
|
|
28
63
|
let type = $derived(is_first ? 'gap-before' : 'gap-after');
|
|
29
64
|
|
|
30
65
|
let gap_style = $derived.by(() => {
|
|
31
|
-
|
|
66
|
+
if (!is_editable) return '';
|
|
32
67
|
const prev_idx = offset - 1;
|
|
33
|
-
const pa = is_first
|
|
34
|
-
|
|
35
|
-
|
|
68
|
+
const pa = is_first
|
|
69
|
+
? `--${serialize_path([...array_path, 0])}`
|
|
70
|
+
: `--${serialize_path([...array_path, prev_idx])}`;
|
|
71
|
+
const next = `--${serialize_path([...array_path, offset])}`;
|
|
72
|
+
const container = `--${serialize_path(array_path)}`;
|
|
36
73
|
return `--_pa:${pa};--_next:${next};--_container:${container}`;
|
|
37
74
|
});
|
|
38
75
|
|
|
39
76
|
let anchor_name = $derived.by(() => {
|
|
40
|
-
|
|
41
|
-
if (is_first) return `--g-${
|
|
42
|
-
return `--g-${
|
|
77
|
+
if (!is_editable) return '';
|
|
78
|
+
if (is_first) return `--g-${serialize_path([...array_path, 0])}-gap-before`;
|
|
79
|
+
return `--g-${serialize_path([...array_path, offset - 1])}-gap-after`;
|
|
43
80
|
});
|
|
44
81
|
</script>
|
|
45
82
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
83
|
+
{#if is_editable}
|
|
84
|
+
<div
|
|
85
|
+
class="node-gap"
|
|
86
|
+
class:gap-before={is_first}
|
|
87
|
+
class:gap-after={!is_first}
|
|
88
|
+
class:empty
|
|
89
|
+
class:last={is_last}
|
|
90
|
+
data-type={type}
|
|
91
|
+
data-gap-array-path={serialize_path(array_path)}
|
|
92
|
+
data-gap-offset={offset}
|
|
93
|
+
style={gap_style}
|
|
94
|
+
>
|
|
95
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
96
|
+
<div class="svedit-selectable" style="anchor-name:{anchor_name}" onpointerdown={cycle_z_index}><br /></div>
|
|
97
|
+
</div>
|
|
98
|
+
{:else}
|
|
99
|
+
<div class="node-gap"></div>
|
|
100
|
+
{/if}
|
|
59
101
|
|
|
60
102
|
<style>
|
|
61
103
|
.node-gap {
|
|
@@ -70,7 +112,7 @@
|
|
|
70
112
|
/* Un-positioned: minimal in-DOM presence, no anchor resolution */
|
|
71
113
|
/* ------------------------------------------------------------------ */
|
|
72
114
|
|
|
73
|
-
.node-gap:not(.positioned) .svedit-selectable {
|
|
115
|
+
:global(.node-gap:not(.positioned) .svedit-selectable) {
|
|
74
116
|
position: absolute;
|
|
75
117
|
pointer-events: none;
|
|
76
118
|
width: 0;
|
|
@@ -100,34 +142,46 @@
|
|
|
100
142
|
* --node-caret-boundary-y override per-axis, falling back to
|
|
101
143
|
* --node-caret-boundary when unset.
|
|
102
144
|
*/
|
|
103
|
-
.node-gap.positioned {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
145
|
+
:global(.node-gap.positioned) {
|
|
146
|
+
/* Fallback 9999999px: when --_pa is orphan (node briefly missing during
|
|
147
|
+
edits), anchor() without a fallback invalidates the custom property
|
|
148
|
+
and `top` falls back to 0, placing the gap at viewport top as a
|
|
149
|
+
giant overlay. 9999999px ensures orphan anchors produce huge values
|
|
150
|
+
that min() excludes instead.
|
|
151
|
+
LIMIT: documents taller or wider than 9999999px will re-surface
|
|
152
|
+
the reported giant-overlay bug — the fallback must exceed the
|
|
153
|
+
containing block's dimensions to land off-screen. If you need to
|
|
154
|
+
support larger documents, bump this value here and in the matching
|
|
155
|
+
`* 9999999px` branch-disable trick throughout this file (and in
|
|
156
|
+
NodeGapMarkers.svelte). Stay below ~33M px to avoid Blink's
|
|
157
|
+
LayoutUnit ceiling. */
|
|
158
|
+
--_s-t: anchor(var(--_pa) top, 9999999px);
|
|
159
|
+
--_s-b: anchor(var(--_pa) bottom, 9999999px);
|
|
160
|
+
--_s-l: anchor(var(--_pa) left, 9999999px);
|
|
161
|
+
--_s-r: anchor(var(--_pa) right, 9999999px);
|
|
108
162
|
}
|
|
109
|
-
.positioned.gap-before:not(.empty) {
|
|
163
|
+
:global(.node-gap.positioned.gap-before:not(.empty)) {
|
|
110
164
|
--_b-t: anchor(var(--node-caret-boundary-y, var(--node-caret-boundary, --_no-boundary)) top, 0px);
|
|
111
165
|
--_b-l: anchor(var(--node-caret-boundary-x, var(--node-caret-boundary, --_no-boundary)) left, 0px);
|
|
112
166
|
}
|
|
113
|
-
.positioned.gap-after:not(.last) {
|
|
167
|
+
:global(.node-gap.positioned.gap-after:not(.last)) {
|
|
114
168
|
--_n-t: anchor(var(--_next) top);
|
|
115
169
|
--_n-l: anchor(var(--_next) left);
|
|
116
170
|
--_c-r: anchor(var(--_container) right);
|
|
117
171
|
}
|
|
118
|
-
.positioned.gap-after.last,
|
|
119
|
-
.positioned.gap-before.empty {
|
|
172
|
+
:global(.node-gap.positioned.gap-after.last),
|
|
173
|
+
:global(.node-gap.positioned.gap-before.empty) {
|
|
120
174
|
--_c-t: anchor(var(--_container) top);
|
|
121
175
|
--_c-b: anchor(var(--_container) bottom);
|
|
122
176
|
--_c-l: anchor(var(--_container) left);
|
|
123
177
|
--_c-r: anchor(var(--_container) right);
|
|
124
178
|
--_b-b: anchor(var(--node-caret-boundary-y, var(--node-caret-boundary, --_no-boundary)) bottom, 0px);
|
|
125
179
|
--_b-r: anchor(var(--node-caret-boundary-x, var(--node-caret-boundary, --_no-boundary)) right, 0px);
|
|
126
|
-
--_b-bt: anchor(var(--node-caret-boundary-y, var(--node-caret-boundary, --_no-boundary)) bottom,
|
|
127
|
-
--_b-rl: anchor(var(--node-caret-boundary-x, var(--node-caret-boundary, --_no-boundary)) right,
|
|
180
|
+
--_b-bt: anchor(var(--node-caret-boundary-y, var(--node-caret-boundary, --_no-boundary)) bottom, 9999999px);
|
|
181
|
+
--_b-rl: anchor(var(--node-caret-boundary-x, var(--node-caret-boundary, --_no-boundary)) right, 9999999px);
|
|
128
182
|
}
|
|
129
183
|
|
|
130
|
-
.positioned .svedit-selectable {
|
|
184
|
+
:global(.node-gap.positioned .svedit-selectable) {
|
|
131
185
|
--_eg: var(--node-caret-edge-gap, 24px);
|
|
132
186
|
--_gm: var(--node-caret-gap-min-size, 16px);
|
|
133
187
|
--_R: var(--row, 1);
|
|
@@ -141,42 +195,55 @@
|
|
|
141
195
|
cursor: pointer;
|
|
142
196
|
}
|
|
143
197
|
|
|
198
|
+
:global(.node-gap.positioned .svedit-selectable[data-sent-to-back]) {
|
|
199
|
+
z-index: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
144
202
|
/* ------------------------------------------------------------------ */
|
|
145
203
|
/* Merged column / row layout positioning */
|
|
146
204
|
/* */
|
|
147
205
|
/* Uses var(--row, 1) with the * 99999 multiplier trick: */
|
|
148
206
|
/* --_R = var(--row, 1) → 1 in row, 0 in column */
|
|
149
207
|
/* --_C = calc(1 - var(--row, 1))→ 1 in column, 0 in row */
|
|
150
|
-
/* Inside min(), + var(--_R) *
|
|
151
|
-
/* + var(--_C) *
|
|
208
|
+
/* Inside min(), + var(--_R) * 9999999px disables a col branch in row, */
|
|
209
|
+
/* + var(--_C) * 9999999px disables a row branch in column. */
|
|
152
210
|
/* ------------------------------------------------------------------ */
|
|
153
211
|
|
|
154
212
|
/* Between two siblings: col centers vertically, row centers horizontally */
|
|
155
|
-
.positioned.gap-after:not(.last) .svedit-selectable {
|
|
213
|
+
:global(.node-gap.positioned.gap-after:not(.last) .svedit-selectable) {
|
|
156
214
|
--_mid: calc((var(--_s-b) + var(--_n-t)) / 2 - var(--_gm) / 2);
|
|
157
215
|
top: min(
|
|
158
|
-
calc(var(--_s-b) + var(--_R) *
|
|
159
|
-
calc(var(--_mid) + var(--_R) *
|
|
160
|
-
calc(var(--_s-t) + var(--_C) *
|
|
216
|
+
calc(var(--_s-b) + var(--_R) * 9999999px),
|
|
217
|
+
calc(var(--_mid) + var(--_R) * 9999999px),
|
|
218
|
+
calc(var(--_s-t) + var(--_C) * 9999999px)
|
|
161
219
|
);
|
|
162
220
|
bottom: min(
|
|
163
|
-
calc(var(--_n-t) + var(--_R) *
|
|
164
|
-
calc(var(--_mid) + var(--_R) *
|
|
165
|
-
calc(var(--_s-b) + var(--_C) *
|
|
221
|
+
calc(var(--_n-t) + var(--_R) * 9999999px),
|
|
222
|
+
calc(var(--_mid) + var(--_R) * 9999999px),
|
|
223
|
+
calc(var(--_s-b) + var(--_C) * 9999999px)
|
|
166
224
|
);
|
|
167
225
|
left: min(
|
|
168
|
-
calc(var(--_s-l) + var(--_R) *
|
|
169
|
-
calc(var(--_s-r) + var(--_C) *
|
|
226
|
+
calc(var(--_s-l) + var(--_R) * 9999999px),
|
|
227
|
+
calc(var(--_s-r) + var(--_C) * 9999999px),
|
|
170
228
|
calc(
|
|
171
229
|
(var(--_s-r) + var(--_n-l)) / 2
|
|
172
230
|
- var(--_gm) / 2
|
|
173
231
|
+ max(0px, var(--_s-r) - var(--_n-l)) * 999
|
|
174
|
-
+ var(--_C) *
|
|
232
|
+
+ var(--_C) * 9999999px
|
|
175
233
|
),
|
|
176
|
-
|
|
234
|
+
/* Safety clamp for wrap: pins gap inside CB when current/next
|
|
235
|
+
wrap across rows. Disabled in nowrap/horizontal-scroll where
|
|
236
|
+
next is side-by-side on the same row (n-l > s-r) — there
|
|
237
|
+
the other branches position correctly and this clamp would
|
|
238
|
+
wrongly force the gap to CB right minus eg. */
|
|
239
|
+
calc(
|
|
240
|
+
100% - var(--_eg)
|
|
241
|
+
+ max(0px, var(--_n-l) - var(--_s-r) + 0.5px) * 9999
|
|
242
|
+
+ var(--_C) * 9999999px
|
|
243
|
+
)
|
|
177
244
|
);
|
|
178
245
|
right: min(
|
|
179
|
-
calc(var(--_s-r) + var(--_R) *
|
|
246
|
+
calc(var(--_s-r) + var(--_R) * 9999999px),
|
|
180
247
|
calc(
|
|
181
248
|
max(
|
|
182
249
|
0px,
|
|
@@ -198,7 +265,7 @@
|
|
|
198
265
|
)
|
|
199
266
|
)
|
|
200
267
|
)
|
|
201
|
-
+ var(--_C) *
|
|
268
|
+
+ var(--_C) * 9999999px
|
|
202
269
|
)
|
|
203
270
|
);
|
|
204
271
|
min-height: calc(var(--_gm) * var(--_C));
|
|
@@ -210,23 +277,44 @@
|
|
|
210
277
|
/* After last node: col extends down, row extends right.
|
|
211
278
|
top also clamps to boundary_bottom - eg so that min-height
|
|
212
279
|
(which wins over bottom in overconstrained abs-pos) cannot
|
|
213
|
-
push the element past the boundary.
|
|
214
|
-
|
|
280
|
+
push the element past the boundary.
|
|
281
|
+
|
|
282
|
+
left's third branch (100% - --_eg + max(0, --_s-r - 100% + 0.5px) * 9999)
|
|
283
|
+
is the wrap-layout safety clamp: in column or row+wrap layouts
|
|
284
|
+
where the last node sits WITHIN the CB (--_s-r < 100%), it pins
|
|
285
|
+
the gap inside the CB so it doesn't extend past the right edge.
|
|
286
|
+
The * 9999 multiplier disables this branch in nowrap horizontal-
|
|
287
|
+
scroll (where --_s-r > 100% — the trailing node has overflowed
|
|
288
|
+
the CB and the gap is expected to follow it).
|
|
289
|
+
|
|
290
|
+
right's `min(--_c-r - --_eg, --_s-r - --_eg)` is what fills the
|
|
291
|
+
gap into the whitespace between the last node and the container
|
|
292
|
+
in non-overflow layouts. In non-overflow, --_c-r < --_s-r in the
|
|
293
|
+
`right` axis (container right is further left than node right
|
|
294
|
+
from the CB right edge), so min picks --_c-r - --_eg and the gap
|
|
295
|
+
ends at container.right + --_eg (the MUST-RULE overshoot). In
|
|
296
|
+
overflow, --_s-r < --_c-r and min picks --_s-r - --_eg — the gap
|
|
297
|
+
follows the node out past the container. */
|
|
298
|
+
:global(.node-gap.positioned.gap-after.last .svedit-selectable) {
|
|
215
299
|
top: min(
|
|
216
|
-
calc(min(var(--_s-b), calc(var(--_b-bt) - var(--_eg))) + var(--_R) *
|
|
217
|
-
calc(var(--_s-t) + var(--_C) *
|
|
300
|
+
calc(min(var(--_s-b), calc(var(--_b-bt) - var(--_eg))) + var(--_R) * 9999999px),
|
|
301
|
+
calc(var(--_s-t) + var(--_C) * 9999999px)
|
|
218
302
|
);
|
|
219
303
|
bottom: min(
|
|
220
|
-
calc(max(var(--_b-b), var(--_s-b) - var(--_eg)) + var(--_R) *
|
|
221
|
-
calc(var(--_s-b) + var(--_C) *
|
|
304
|
+
calc(max(var(--_b-b), var(--_s-b) - var(--_eg)) + var(--_R) * 9999999px),
|
|
305
|
+
calc(var(--_s-b) + var(--_C) * 9999999px)
|
|
222
306
|
);
|
|
223
307
|
left: min(
|
|
224
|
-
calc(var(--_s-l) + var(--_R) *
|
|
225
|
-
calc(min(var(--_s-r), calc(var(--_b-rl) - var(--_eg))) + var(--_C) *
|
|
226
|
-
calc(
|
|
308
|
+
calc(var(--_s-l) + var(--_R) * 9999999px),
|
|
309
|
+
calc(min(var(--_s-r), calc(var(--_b-rl) - var(--_eg))) + var(--_C) * 9999999px),
|
|
310
|
+
calc(
|
|
311
|
+
100% - var(--_eg)
|
|
312
|
+
+ max(0px, var(--_s-r) - 100% + 0.5px) * 9999
|
|
313
|
+
+ var(--_C) * 9999999px
|
|
314
|
+
)
|
|
227
315
|
);
|
|
228
316
|
right: min(
|
|
229
|
-
calc(var(--_s-r) + var(--_R) *
|
|
317
|
+
calc(var(--_s-r) + var(--_R) * 9999999px),
|
|
230
318
|
calc(
|
|
231
319
|
max(
|
|
232
320
|
var(--_b-r),
|
|
@@ -235,7 +323,7 @@
|
|
|
235
323
|
calc(var(--_s-r) - var(--_eg))
|
|
236
324
|
)
|
|
237
325
|
)
|
|
238
|
-
+ var(--_C) *
|
|
326
|
+
+ var(--_C) * 9999999px
|
|
239
327
|
)
|
|
240
328
|
);
|
|
241
329
|
min-height: calc(var(--_eg) * var(--_C));
|
|
@@ -243,44 +331,54 @@
|
|
|
243
331
|
}
|
|
244
332
|
|
|
245
333
|
/* Before first node: col extends up, row extends left */
|
|
246
|
-
.positioned.gap-before:not(.empty) .svedit-selectable {
|
|
334
|
+
:global(.node-gap.positioned.gap-before:not(.empty) .svedit-selectable) {
|
|
247
335
|
top: min(
|
|
248
336
|
calc(
|
|
249
337
|
max(var(--_b-t), var(--_s-t) - var(--_eg))
|
|
250
|
-
+ var(--_R) *
|
|
338
|
+
+ var(--_R) * 9999999px
|
|
251
339
|
),
|
|
252
|
-
calc(var(--_s-t) + var(--_C) *
|
|
340
|
+
calc(var(--_s-t) + var(--_C) * 9999999px)
|
|
253
341
|
);
|
|
254
342
|
bottom: min(
|
|
255
|
-
calc(var(--_s-t) + var(--_R) *
|
|
256
|
-
calc(var(--_s-b) + var(--_C) *
|
|
343
|
+
calc(var(--_s-t) + var(--_R) * 9999999px),
|
|
344
|
+
calc(var(--_s-b) + var(--_C) * 9999999px)
|
|
257
345
|
);
|
|
258
346
|
left: min(
|
|
259
|
-
calc(var(--_s-l) + var(--_R) *
|
|
347
|
+
calc(var(--_s-l) + var(--_R) * 9999999px),
|
|
260
348
|
calc(
|
|
261
349
|
max(var(--_b-l), var(--_s-l) - var(--_eg))
|
|
262
|
-
+ var(--_C) *
|
|
350
|
+
+ var(--_C) * 9999999px
|
|
263
351
|
)
|
|
264
352
|
);
|
|
265
353
|
right: min(
|
|
266
|
-
calc(var(--_s-r) + var(--_R) *
|
|
267
|
-
calc(var(--_s-l) + var(--_C) *
|
|
354
|
+
calc(var(--_s-r) + var(--_R) * 9999999px),
|
|
355
|
+
calc(var(--_s-l) + var(--_C) * 9999999px)
|
|
268
356
|
);
|
|
269
357
|
min-height: calc(var(--_eg) * var(--_C));
|
|
270
358
|
min-width: calc(var(--_eg) * var(--_R));
|
|
271
359
|
}
|
|
272
360
|
|
|
273
|
-
/* Empty array:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
361
|
+
/* Empty array: the gap fills its placeholder, which is this
|
|
362
|
+
selectable's containing block (NodeArrayProperty sets it
|
|
363
|
+
position: relative). inset:0 fills it with no anchor() — so no
|
|
364
|
+
.positioned gating and no anchor cost. The width:auto, height:auto
|
|
365
|
+
and pointer-events:auto override the :not(.positioned) 0×0
|
|
366
|
+
collapse; position-visibility:always overrides the .positioned
|
|
367
|
+
rule's anchors-visible, so a transient positioned toggle can't
|
|
368
|
+
hide the gap. */
|
|
369
|
+
:global(.node-gap.gap-before.empty .svedit-selectable) {
|
|
370
|
+
position: absolute;
|
|
371
|
+
inset: 0;
|
|
372
|
+
width: auto;
|
|
373
|
+
height: auto;
|
|
374
|
+
pointer-events: auto;
|
|
375
|
+
position-visibility: always;
|
|
279
376
|
}
|
|
280
377
|
|
|
281
|
-
/* Debugging styles
|
|
282
|
-
/* .positioned .svedit-selectable {
|
|
283
|
-
outline:
|
|
378
|
+
/* Debugging styles - DO NOT CHANGE OR REMOVE */
|
|
379
|
+
/* :global(.node-gap.positioned .svedit-selectable) {
|
|
380
|
+
outline: 2px solid rgba(238, 0, 255, 0.5);
|
|
381
|
+
background-color: rgba(238, 0, 255, 0.5);
|
|
284
382
|
outline-offset: -0.5px;
|
|
285
383
|
} */
|
|
286
384
|
</style>
|
package/dist/NodeGap.svelte.d.ts
CHANGED
|
@@ -8,13 +8,11 @@ declare const NodeGap: import("svelte").Component<{
|
|
|
8
8
|
offset: any;
|
|
9
9
|
count: any;
|
|
10
10
|
empty?: boolean;
|
|
11
|
-
positioned?: boolean;
|
|
12
11
|
}, {}, "">;
|
|
13
12
|
type $$ComponentProps = {
|
|
14
13
|
array_path: any;
|
|
15
14
|
offset: any;
|
|
16
15
|
count: any;
|
|
17
16
|
empty?: boolean;
|
|
18
|
-
positioned?: boolean;
|
|
19
17
|
};
|
|
20
18
|
//# sourceMappingURL=NodeGap.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeGap.svelte.d.ts","sourceRoot":"","sources":["../src/lib/NodeGap.svelte.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"NodeGap.svelte.d.ts","sourceRoot":"","sources":["../src/lib/NodeGap.svelte.js"],"names":[],"mappings":";;;;;AAsGA;gBAxCgC,GAAG;YAAU,GAAG;WAAS,GAAG;YAAU,OAAO;WAwCvB;wBAxCpC;IAAE,UAAU,EAAE,GAAG,CAAC;IAAC,MAAM,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE"}
|