dotquilt 0.1.0 → 0.1.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.
- package/dist/internal/loading-controller.js +12 -4
- package/dist/internal/morph.js +163 -13
- package/dist/region-styles.js +18 -1
- package/dist/region.css +1 -1
- package/dist/text-styles.js +5 -1
- package/dist/text.css +1 -1
- package/package.json +1 -1
|
@@ -421,13 +421,17 @@ export class LoadingController extends EventElement {
|
|
|
421
421
|
return;
|
|
422
422
|
const prior = this.#previous;
|
|
423
423
|
this.#previous = state;
|
|
424
|
+
// A placeholder that hands over keeps its place until the handoff ends,
|
|
425
|
+
// and the handoff reads its layout as it starts: the presentation goes
|
|
426
|
+
// from pending straight to handoff, never through ready.
|
|
427
|
+
const handingOff = state === 'ready' && prior === 'pending' && !skipHandoff;
|
|
424
428
|
content.inert = state === 'pending';
|
|
425
429
|
content.setAttribute('aria-busy', String(state !== 'ready'));
|
|
426
430
|
if (state === 'pending')
|
|
427
431
|
content.setAttribute('aria-hidden', 'true');
|
|
428
432
|
else
|
|
429
433
|
content.removeAttribute('aria-hidden');
|
|
430
|
-
this.setAttribute('data-presentation', state);
|
|
434
|
+
this.setAttribute('data-presentation', handingOff ? 'handoff' : state);
|
|
431
435
|
this.placeholderChanged(placeholder.firstElementChild, state);
|
|
432
436
|
const indicator = refresh.firstElementChild;
|
|
433
437
|
if (state === 'refreshing' &&
|
|
@@ -467,7 +471,7 @@ export class LoadingController extends EventElement {
|
|
|
467
471
|
return;
|
|
468
472
|
}
|
|
469
473
|
this.#participants = undefined;
|
|
470
|
-
if (
|
|
474
|
+
if (handingOff)
|
|
471
475
|
this.#start(revision, w);
|
|
472
476
|
else
|
|
473
477
|
this.#settled = true;
|
|
@@ -566,8 +570,12 @@ export class LoadingController extends EventElement {
|
|
|
566
570
|
? this.#specHandoff(placeholder, content, duration, source.animation)
|
|
567
571
|
: {
|
|
568
572
|
// Custom and dense sources keep one shared clock: they draw in
|
|
569
|
-
// step with the content's progress.
|
|
570
|
-
|
|
573
|
+
// step with the content's progress. They draw their own marks,
|
|
574
|
+
// and the chart's leave where its line wipes in, so the layer
|
|
575
|
+
// holds at full strength and only lets go at the very end
|
|
576
|
+
// (fading it all the way, marks landed at half strength). The
|
|
577
|
+
// hold is in time, so the easing only shapes the last step.
|
|
578
|
+
outgoing: placeholder.animate({ opacity: [1, 1, 0], offset: [0, 0.9, 1], easing }, { duration, fill: 'both' }),
|
|
571
579
|
incoming: content.animate({ opacity: [0, 1] }, { duration, easing, fill: 'both' }),
|
|
572
580
|
extra: [],
|
|
573
581
|
};
|
package/dist/internal/morph.js
CHANGED
|
@@ -40,8 +40,142 @@ function contentNodes(region) {
|
|
|
40
40
|
(!node.slot &&
|
|
41
41
|
!node.matches('style,script,template,[data-dotquilt-placeholder],[data-dotquilt-style],[data-dotquilt-static]')));
|
|
42
42
|
}
|
|
43
|
+
const unclipped = {
|
|
44
|
+
left: Number.NEGATIVE_INFINITY,
|
|
45
|
+
top: Number.NEGATIVE_INFINITY,
|
|
46
|
+
right: Number.POSITIVE_INFINITY,
|
|
47
|
+
bottom: Number.POSITIVE_INFINITY,
|
|
48
|
+
};
|
|
49
|
+
const intersect = (a, b) => ({
|
|
50
|
+
left: Math.max(a.left, b.left),
|
|
51
|
+
top: Math.max(a.top, b.top),
|
|
52
|
+
right: Math.min(a.right, b.right),
|
|
53
|
+
bottom: Math.min(a.bottom, b.bottom),
|
|
54
|
+
});
|
|
55
|
+
/** `clip-path: inset(…)` as edges, or undefined for anything else. */
|
|
56
|
+
function insetOf(value, box) {
|
|
57
|
+
const match = /^inset\(([^)]*)\)/.exec(value);
|
|
58
|
+
const lengths = match?.[1]?.split(' round ')[0]?.trim().split(/\s+/) ?? [];
|
|
59
|
+
const px = (length, of) => {
|
|
60
|
+
const parts = /^(-?[\d.]+)(px|%)$/.exec(length ?? '');
|
|
61
|
+
if (!parts)
|
|
62
|
+
return Number.NaN;
|
|
63
|
+
return parts[2] === '%' ? (Number(parts[1]) / 100) * of : Number(parts[1]);
|
|
64
|
+
};
|
|
65
|
+
const [top, right = top, bottom = top, left = right] = lengths;
|
|
66
|
+
const edges = {
|
|
67
|
+
left: box.left + px(left, box.width),
|
|
68
|
+
top: box.top + px(top, box.height),
|
|
69
|
+
right: box.right - px(right, box.width),
|
|
70
|
+
bottom: box.bottom - px(bottom, box.height),
|
|
71
|
+
};
|
|
72
|
+
return Object.values(edges).every(Number.isFinite) ? edges : undefined;
|
|
73
|
+
}
|
|
74
|
+
/** `clip: rect(…)`, which applies to absolutely positioned elements. */
|
|
75
|
+
function rectOf(value, box) {
|
|
76
|
+
const sides = /^rect\((.*)\)$/.exec(value)?.[1]?.split(/[\s,]+/);
|
|
77
|
+
if (sides?.length !== 4)
|
|
78
|
+
return undefined;
|
|
79
|
+
const [top, right, bottom, left] = sides.map((side) => side === 'auto' ? undefined : Number.parseFloat(side));
|
|
80
|
+
return {
|
|
81
|
+
left: box.left + (left ?? 0),
|
|
82
|
+
top: box.top + (top ?? 0),
|
|
83
|
+
right: box.left + (right ?? box.width),
|
|
84
|
+
bottom: box.top + (bottom ?? box.height),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function clipOf(element, win) {
|
|
88
|
+
const css = win.getComputedStyle(element);
|
|
89
|
+
const position = css.position;
|
|
90
|
+
const transformed = css.transform !== 'none';
|
|
91
|
+
let own;
|
|
92
|
+
let content;
|
|
93
|
+
const box = () => element.getBoundingClientRect();
|
|
94
|
+
// Other shapes count as the element's box, which they mostly stay inside.
|
|
95
|
+
if (css.clipPath !== 'none')
|
|
96
|
+
own = insetOf(css.clipPath, box()) ?? box();
|
|
97
|
+
if ((position === 'absolute' || position === 'fixed') && css.clip !== 'auto')
|
|
98
|
+
own = intersect(own ?? unclipped, rectOf(css.clip, box()) ?? unclipped);
|
|
99
|
+
// Overflow clips block, flex, grid and table cell boxes, not inline ones
|
|
100
|
+
// or table rows and groups.
|
|
101
|
+
const x = css.overflowX !== 'visible', y = css.overflowY !== 'visible';
|
|
102
|
+
if ((x || y) &&
|
|
103
|
+
css.display !== 'inline' &&
|
|
104
|
+
css.display !== 'contents' &&
|
|
105
|
+
!/^table-(row|column|header|footer)/.test(css.display)) {
|
|
106
|
+
const { left, top } = box();
|
|
107
|
+
const padding = {
|
|
108
|
+
left: left + element.clientLeft,
|
|
109
|
+
top: top + element.clientTop,
|
|
110
|
+
right: left + element.clientLeft + element.clientWidth,
|
|
111
|
+
bottom: top + element.clientTop + element.clientHeight,
|
|
112
|
+
};
|
|
113
|
+
content = {
|
|
114
|
+
left: x ? padding.left : unclipped.left,
|
|
115
|
+
top: y ? padding.top : unclipped.top,
|
|
116
|
+
right: x ? padding.right : unclipped.right,
|
|
117
|
+
bottom: y ? padding.bottom : unclipped.bottom,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
own,
|
|
122
|
+
content,
|
|
123
|
+
position,
|
|
124
|
+
anchors: position !== 'static' || transformed,
|
|
125
|
+
transformed,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The part of `rect` that shows once `from` and its ancestors up to `region`
|
|
130
|
+
* have clipped it, or undefined when less than 2px of it shows either way.
|
|
131
|
+
* getClientRects() and getBoundingClientRect() ignore clipping, so without
|
|
132
|
+
* this a visually hidden header (a 1px box with `overflow: hidden`, `clip`
|
|
133
|
+
* or `clip-path: inset(50%)`) would become a row of marks.
|
|
134
|
+
*
|
|
135
|
+
* With `ownBox`, `rect` is `from`'s own box, which its overflow doesn't clip.
|
|
136
|
+
*/
|
|
137
|
+
function visiblePart(rect, from, region, clips, ownBox = false) {
|
|
138
|
+
let edges = rect;
|
|
139
|
+
// Absolutely positioned content escapes the overflow of ancestors until
|
|
140
|
+
// the one that contains it (any positioned one; a transformed one for fixed).
|
|
141
|
+
let escaping;
|
|
142
|
+
for (let element = from; element && element !== region; element = element.parentElement) {
|
|
143
|
+
const clip = clips(element);
|
|
144
|
+
if (escaping && (escaping === 'fixed' ? clip.transformed : clip.anchors))
|
|
145
|
+
escaping = undefined;
|
|
146
|
+
if (clip.content && !escaping && !(ownBox && element === from))
|
|
147
|
+
edges = intersect(edges, clip.content);
|
|
148
|
+
if (clip.own)
|
|
149
|
+
edges = intersect(edges, clip.own);
|
|
150
|
+
if (clip.position === 'absolute' || clip.position === 'fixed')
|
|
151
|
+
escaping = clip.position;
|
|
152
|
+
}
|
|
153
|
+
return edges.right - edges.left >= 2 && edges.bottom - edges.top >= 2
|
|
154
|
+
? edges
|
|
155
|
+
: undefined;
|
|
156
|
+
}
|
|
157
|
+
/** Caches each element's clip for one plan. */
|
|
158
|
+
function clipCache(region) {
|
|
159
|
+
const win = region.ownerDocument.defaultView;
|
|
160
|
+
const cache = new Map();
|
|
161
|
+
const none = {
|
|
162
|
+
own: undefined,
|
|
163
|
+
content: undefined,
|
|
164
|
+
position: 'static',
|
|
165
|
+
anchors: false,
|
|
166
|
+
transformed: false,
|
|
167
|
+
};
|
|
168
|
+
return (element) => {
|
|
169
|
+
let clip = cache.get(element);
|
|
170
|
+
if (!clip) {
|
|
171
|
+
clip = win ? clipOf(element, win) : none;
|
|
172
|
+
cache.set(element, clip);
|
|
173
|
+
}
|
|
174
|
+
return clip;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
43
177
|
/** Lines of text, as runs of words that sit together, in reading order. */
|
|
44
|
-
function textRuns(nodes, origin) {
|
|
178
|
+
function textRuns(nodes, origin, region, clips) {
|
|
45
179
|
const doc = nodes[0]?.ownerDocument;
|
|
46
180
|
if (!doc)
|
|
47
181
|
return [];
|
|
@@ -54,9 +188,11 @@ function textRuns(nodes, origin) {
|
|
|
54
188
|
if (parent?.closest('[aria-hidden=true] svg, script, style'))
|
|
55
189
|
return;
|
|
56
190
|
range.selectNodeContents(text);
|
|
57
|
-
for (const rect of range.getClientRects())
|
|
58
|
-
|
|
59
|
-
|
|
191
|
+
for (const rect of range.getClientRects()) {
|
|
192
|
+
const shown = visiblePart(rect, parent, region, clips);
|
|
193
|
+
if (shown)
|
|
194
|
+
rects.push(shown);
|
|
195
|
+
}
|
|
60
196
|
};
|
|
61
197
|
for (const node of nodes) {
|
|
62
198
|
if (node instanceof Text)
|
|
@@ -67,13 +203,14 @@ function textRuns(nodes, origin) {
|
|
|
67
203
|
collect(text);
|
|
68
204
|
}
|
|
69
205
|
}
|
|
70
|
-
rects.sort((a, b) => Math.round((a.top + a.
|
|
71
|
-
|
|
206
|
+
rects.sort((a, b) => Math.round((a.top + a.bottom) / 8) - Math.round((b.top + b.bottom) / 8) ||
|
|
207
|
+
a.left - b.left);
|
|
72
208
|
const runs = [];
|
|
73
209
|
for (const rect of rects) {
|
|
210
|
+
const height = rect.bottom - rect.top;
|
|
74
211
|
const run = runs.find((run) => Math.min(run.b, rect.bottom) - Math.max(run.t, rect.top) >=
|
|
75
|
-
0.5 * Math.min(run.b - run.t,
|
|
76
|
-
rect.left - run.r <= 0.6 *
|
|
212
|
+
0.5 * Math.min(run.b - run.t, height) &&
|
|
213
|
+
rect.left - run.r <= 0.6 * height &&
|
|
77
214
|
rect.left - run.r >= -2);
|
|
78
215
|
if (run) {
|
|
79
216
|
run.r = Math.max(run.r, rect.right);
|
|
@@ -92,7 +229,7 @@ function textRuns(nodes, origin) {
|
|
|
92
229
|
}));
|
|
93
230
|
}
|
|
94
231
|
/** Images, avatars, badges: boxes in the content a block or circle can become. */
|
|
95
|
-
function contentBoxes(nodes, origin, area) {
|
|
232
|
+
function contentBoxes(nodes, origin, area, region, clips) {
|
|
96
233
|
const win = nodes[0]?.ownerDocument?.defaultView;
|
|
97
234
|
if (!win)
|
|
98
235
|
return [];
|
|
@@ -117,8 +254,20 @@ function contentBoxes(nodes, origin, area) {
|
|
|
117
254
|
if (!element.matches('img,svg,video,canvas,iframe,object') &&
|
|
118
255
|
!visual(css))
|
|
119
256
|
continue;
|
|
120
|
-
const
|
|
121
|
-
|
|
257
|
+
const shown = visiblePart(rect, element, region, clips, true);
|
|
258
|
+
if (!shown)
|
|
259
|
+
continue;
|
|
260
|
+
const width = shown.right - shown.left, height = shown.bottom - shown.top;
|
|
261
|
+
if (width < 14 || height < 14)
|
|
262
|
+
continue;
|
|
263
|
+
const r = radiusOf(css, width, height);
|
|
264
|
+
const box = {
|
|
265
|
+
x: shown.left - origin.left,
|
|
266
|
+
y: shown.top - origin.top,
|
|
267
|
+
w: width,
|
|
268
|
+
h: height,
|
|
269
|
+
r,
|
|
270
|
+
};
|
|
122
271
|
atoms.push({
|
|
123
272
|
kind: round(box) ? 'round' : 'box',
|
|
124
273
|
box,
|
|
@@ -195,8 +344,9 @@ export function planMorph(region, participants) {
|
|
|
195
344
|
const parts = participants.flatMap((participant) => partsOf(participant, origin));
|
|
196
345
|
const nodes = contentNodes(region);
|
|
197
346
|
const area = Math.max(1, origin.width * origin.height);
|
|
198
|
-
const
|
|
199
|
-
const
|
|
347
|
+
const clips = clipCache(region);
|
|
348
|
+
const runs = textRuns(nodes, origin, region, clips);
|
|
349
|
+
const boxes = contentBoxes(nodes, origin, area, region, clips);
|
|
200
350
|
// Blocks and circles become the content's boxes: a circle prefers a round
|
|
201
351
|
// one, and a box much bigger or smaller than the block is not its match.
|
|
202
352
|
const shapes = parts.filter((part) => part.kind !== 'row');
|
package/dist/region-styles.js
CHANGED
|
@@ -10,6 +10,23 @@ export { regionCss };
|
|
|
10
10
|
* it counts towards the 9 KB gate for a page's external stylesheets.
|
|
11
11
|
*/
|
|
12
12
|
const threadCss = `.thread{position:absolute;inset:auto 0 calc(100% + var(--dotquilt-refresh-gap,6px));height:var(--s);--s:${markSize};background:radial-gradient(circle closest-side,${markColor} 75%,#0000) 0/calc(var(--s) + ${markGap}) space no-repeat;opacity:${restOpacity}}.glow{--dotquilt-color:${glowColor};opacity:${peakOpacity};mask:linear-gradient(90deg,#0000,#000,#0000) -70%/40% no-repeat}@media(forced-colors:active){.thread{background:none;border-top:1px dotted;opacity:1}.glow{display:none}}`;
|
|
13
|
+
/**
|
|
14
|
+
* Once ready or refreshing, the placeholder layer takes no space, so the
|
|
15
|
+
* region is as tall as its content. It keeps its place through the handoff,
|
|
16
|
+
* which reads it and draws from it.
|
|
17
|
+
*
|
|
18
|
+
* Size containment, not `display: none` or a clip: the placeholder stays laid
|
|
19
|
+
* out at its own size and on screen, hidden, so its loaders neither see a
|
|
20
|
+
* zero size nor mark themselves offscreen (which changes their attributes
|
|
21
|
+
* before hydration, and lags when the next loading cycle shows them again).
|
|
22
|
+
* A taller placeholder overflows the region, hidden, ending where the region
|
|
23
|
+
* used to end.
|
|
24
|
+
*
|
|
25
|
+
* While the external stylesheet loads, the layers render as
|
|
26
|
+
* `display: contents`, so the document rule hides the placeholder as the
|
|
27
|
+
* server markup did.
|
|
28
|
+
*/
|
|
29
|
+
const settledCss = ':host([data-presentation=ready]) .p,:host([data-presentation=refreshing]) .p{contain:size}dotquilt-region:state(unstyled)[data-presentation=ready]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=refreshing]::part(placeholder){display:none}';
|
|
13
30
|
export const regionStyles = /* @__PURE__ */ Object.freeze([
|
|
14
|
-
regionCss + threadCss,
|
|
31
|
+
regionCss + settledCss + threadCss,
|
|
15
32
|
]);
|
package/dist/region.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
dotquilt-region:state(unstyled)::part(placeholder),dotquilt-region:state(unstyled)::part(refresh-indicator){visibility:hidden;pointer-events:none}dotquilt-region:state(unstyled)[data-presentation=pending]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=handoff]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=refreshing]::part(refresh-indicator){visibility:inherit}dotquilt-region:state(unstyled)[data-presentation=pending]::part(content){visibility:hidden}:host{display:grid;position:relative}:host(:focus){outline:none}:host(:focus-visible:not([data-dotquilt-focus=pointer])),:host([data-dotquilt-focus=""]:focus){outline:2px solid currentColor;outline-offset:3px}:host .f{display:grid;min-width:0;min-height:100%}:host [part]{display:block;grid-area:1/1;min-width:0}:host .p,:host .r{visibility:hidden;pointer-events:none}:host([data-presentation=pending]) .p,:host([data-presentation=handoff]) .p,:host([data-presentation=refreshing]) .r{visibility:inherit}:host([data-presentation=pending]) .c{visibility:hidden}:host([hidden]){display:none}:host > svg{position:absolute;inset:0;pointer-events:none}:host .fallback{display:block;min-height:1em;border:1px dotted currentColor}:host([data-dotquilt-waiting]) .p{visibility:hidden}.thread{position:absolute;inset:auto 0 calc(100% + var(--dotquilt-refresh-gap,6px));height:var(--s);--s:var(--dotquilt-dot-size,4.4px);background:radial-gradient(circle closest-side,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 75%,#0000) 0/calc(var(--s) + var(--dotquilt-dot-gap,4.6px)) space no-repeat;opacity:0.37}.glow{--dotquilt-color:var(--dotquilt-accent-color,light-dark(#4f8f93,#8dc4c5));opacity:0.9;mask:linear-gradient(90deg,#0000,#000,#0000) -70%/40% no-repeat}@media(forced-colors:active){.thread{background:none;border-top:1px dotted;opacity:1}.glow{display:none}}
|
|
1
|
+
dotquilt-region:state(unstyled)::part(placeholder),dotquilt-region:state(unstyled)::part(refresh-indicator){visibility:hidden;pointer-events:none}dotquilt-region:state(unstyled)[data-presentation=pending]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=handoff]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=refreshing]::part(refresh-indicator){visibility:inherit}dotquilt-region:state(unstyled)[data-presentation=pending]::part(content){visibility:hidden}:host{display:grid;position:relative}:host(:focus){outline:none}:host(:focus-visible:not([data-dotquilt-focus=pointer])),:host([data-dotquilt-focus=""]:focus){outline:2px solid currentColor;outline-offset:3px}:host .f{display:grid;min-width:0;min-height:100%}:host [part]{display:block;grid-area:1/1;min-width:0}:host .p,:host .r{visibility:hidden;pointer-events:none}:host([data-presentation=pending]) .p,:host([data-presentation=handoff]) .p,:host([data-presentation=refreshing]) .r{visibility:inherit}:host([data-presentation=pending]) .c{visibility:hidden}:host([hidden]){display:none}:host > svg{position:absolute;inset:0;pointer-events:none}:host .fallback{display:block;min-height:1em;border:1px dotted currentColor}:host([data-dotquilt-waiting]) .p{visibility:hidden}:host([data-presentation=ready]) .p,:host([data-presentation=refreshing]) .p{contain:size}dotquilt-region:state(unstyled)[data-presentation=ready]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=refreshing]::part(placeholder){display:none}.thread{position:absolute;inset:auto 0 calc(100% + var(--dotquilt-refresh-gap,6px));height:var(--s);--s:var(--dotquilt-dot-size,4.4px);background:radial-gradient(circle closest-side,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 75%,#0000) 0/calc(var(--s) + var(--dotquilt-dot-gap,4.6px)) space no-repeat;opacity:0.37}.glow{--dotquilt-color:var(--dotquilt-accent-color,light-dark(#4f8f93,#8dc4c5));opacity:0.9;mask:linear-gradient(90deg,#0000,#000,#0000) -70%/40% no-repeat}@media(forced-colors:active){.thread{background:none;border-top:1px dotted;opacity:1}.glow{display:none}}
|
package/dist/text-styles.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { markColor, textMarkShapes } from './internal/marks.js';
|
|
2
2
|
import { regionCss } from './region-css.js';
|
|
3
|
+
// The layers share one baseline, so the loader sits on the text's baseline
|
|
4
|
+
// even while its content is empty and only the mask has text: an empty first
|
|
5
|
+
// layer would otherwise put the baseline at its bottom edge and make the line
|
|
6
|
+
// taller.
|
|
3
7
|
export const textStyles = /* @__PURE__ */ Object.freeze([
|
|
4
8
|
regionCss +
|
|
5
|
-
':host{display:inline-grid;vertical-align:baseline;min-height:1em}:host .mask{display:block;min-height:1em;white-space:pre;opacity:.3;color:transparent;background:radial-gradient(circle,' +
|
|
9
|
+
':host{display:inline-grid;vertical-align:baseline;min-height:1em}:host [part]{align-self:baseline}:host .mask{display:block;min-height:1em;white-space:pre;opacity:.3;color:transparent;background:radial-gradient(circle,' +
|
|
6
10
|
markColor +
|
|
7
11
|
' 1px,#0000 0) 0 0/6px 6px}' +
|
|
8
12
|
textMarkShapes((mark) => `:host([mark=${mark}])`, '.mask') +
|
package/dist/text.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
dotquilt-region:state(unstyled)::part(placeholder),dotquilt-region:state(unstyled)::part(refresh-indicator){visibility:hidden;pointer-events:none}dotquilt-region:state(unstyled)[data-presentation=pending]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=handoff]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=refreshing]::part(refresh-indicator){visibility:inherit}dotquilt-region:state(unstyled)[data-presentation=pending]::part(content){visibility:hidden}:host{display:grid;position:relative}:host(:focus){outline:none}:host(:focus-visible:not([data-dotquilt-focus=pointer])),:host([data-dotquilt-focus=""]:focus){outline:2px solid currentColor;outline-offset:3px}:host .f{display:grid;min-width:0;min-height:100%}:host [part]{display:block;grid-area:1/1;min-width:0}:host .p,:host .r{visibility:hidden;pointer-events:none}:host([data-presentation=pending]) .p,:host([data-presentation=handoff]) .p,:host([data-presentation=refreshing]) .r{visibility:inherit}:host([data-presentation=pending]) .c{visibility:hidden}:host([hidden]){display:none}:host > svg{position:absolute;inset:0;pointer-events:none}:host .fallback{display:block;min-height:1em;border:1px dotted currentColor}:host([data-dotquilt-waiting]) .p{visibility:hidden}:host{display:inline-grid;vertical-align:baseline;min-height:1em}:host .mask{display:block;min-height:1em;white-space:pre;opacity:.3;color:transparent;background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 1px,#0000 0) 0 0/6px 6px}:host([mark=square]) .mask{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/6px 6px repeat;mask:linear-gradient(#0000 1.5px,#000 2.5px,#000 3.5px,#0000 4.5px),linear-gradient(90deg,#0000 1.5px,#000 2.5px,#000 3.5px,#0000 4.5px);mask-size:6px 6px;mask-position:0 0;mask-repeat:repeat;mask-composite:intersect}:host([mark=dash]) .mask{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/6px 6px repeat;mask:radial-gradient(circle at 1.7px 3px,#000 0.3px,#0000 1.3px),radial-gradient(circle at 4.3px 3px,#000 0.3px,#0000 1.3px),linear-gradient(#0000 1.7px,#000 2.7px,#000 3.3px,#0000 4.3px),linear-gradient(90deg,#0000 1.2px,#000 2.2px,#000 3.8px,#0000 4.8px);mask-size:6px 6px;mask-position:0 0;mask-repeat:repeat;mask-composite:add,add,intersect}:host([data-dotquilt-waiting]) .mask,:host([data-dotquilt-waiting])>svg{visibility:hidden}:host ::slotted([slot=placeholder]){display:none}:host([data-custom][data-dotquilt-glyphs]) .mask{visibility:hidden}:host > svg{width:100%;height:100%;overflow:visible}@media(forced-colors:active){:host > svg{display:none}:host .mask{visibility:visible;border:1px dotted CanvasText}}
|
|
1
|
+
dotquilt-region:state(unstyled)::part(placeholder),dotquilt-region:state(unstyled)::part(refresh-indicator){visibility:hidden;pointer-events:none}dotquilt-region:state(unstyled)[data-presentation=pending]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=handoff]::part(placeholder),dotquilt-region:state(unstyled)[data-presentation=refreshing]::part(refresh-indicator){visibility:inherit}dotquilt-region:state(unstyled)[data-presentation=pending]::part(content){visibility:hidden}:host{display:grid;position:relative}:host(:focus){outline:none}:host(:focus-visible:not([data-dotquilt-focus=pointer])),:host([data-dotquilt-focus=""]:focus){outline:2px solid currentColor;outline-offset:3px}:host .f{display:grid;min-width:0;min-height:100%}:host [part]{display:block;grid-area:1/1;min-width:0}:host .p,:host .r{visibility:hidden;pointer-events:none}:host([data-presentation=pending]) .p,:host([data-presentation=handoff]) .p,:host([data-presentation=refreshing]) .r{visibility:inherit}:host([data-presentation=pending]) .c{visibility:hidden}:host([hidden]){display:none}:host > svg{position:absolute;inset:0;pointer-events:none}:host .fallback{display:block;min-height:1em;border:1px dotted currentColor}:host([data-dotquilt-waiting]) .p{visibility:hidden}:host{display:inline-grid;vertical-align:baseline;min-height:1em}:host [part]{align-self:baseline}:host .mask{display:block;min-height:1em;white-space:pre;opacity:.3;color:transparent;background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 1px,#0000 0) 0 0/6px 6px}:host([mark=square]) .mask{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/6px 6px repeat;mask:linear-gradient(#0000 1.5px,#000 2.5px,#000 3.5px,#0000 4.5px),linear-gradient(90deg,#0000 1.5px,#000 2.5px,#000 3.5px,#0000 4.5px);mask-size:6px 6px;mask-position:0 0;mask-repeat:repeat;mask-composite:intersect}:host([mark=dash]) .mask{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/6px 6px repeat;mask:radial-gradient(circle at 1.7px 3px,#000 0.3px,#0000 1.3px),radial-gradient(circle at 4.3px 3px,#000 0.3px,#0000 1.3px),linear-gradient(#0000 1.7px,#000 2.7px,#000 3.3px,#0000 4.3px),linear-gradient(90deg,#0000 1.2px,#000 2.2px,#000 3.8px,#0000 4.8px);mask-size:6px 6px;mask-position:0 0;mask-repeat:repeat;mask-composite:add,add,intersect}:host([data-dotquilt-waiting]) .mask,:host([data-dotquilt-waiting])>svg{visibility:hidden}:host ::slotted([slot=placeholder]){display:none}:host([data-custom][data-dotquilt-glyphs]) .mask{visibility:hidden}:host > svg{width:100%;height:100%;overflow:visible}@media(forced-colors:active){:host > svg{display:none}:host .mask{visibility:visible;border:1px dotted CanvasText}}
|
|
2
2
|
dotquilt-text-loader:is(:not(:defined),:state(unstyled)){display:inline-grid;position:relative;min-height:1em}dotquilt-text-loader:is(:not(:defined),:state(unstyled))[hidden]{display:none}dotquilt-text-loader:is(:not(:defined),:state(unstyled))[state=pending]>:not([slot]){visibility:hidden}dotquilt-text-loader:is(:not(:defined),:state(unstyled))>[slot=placeholder]{grid-area:1/1;white-space:pre;color:transparent;opacity:.3;min-height:1em;background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 1px,#0000 0) 0 0/6px 6px}dotquilt-text-loader:is(:not(:defined),:state(unstyled)):not([state=pending])>[slot=placeholder]{display:none}dotquilt-text-loader:is(:not(:defined),:state(unstyled))>:not([slot]){grid-area:1/1}@media(forced-colors:active){dotquilt-text-loader:is(:not(:defined),:state(unstyled))>[slot=placeholder]{border:1px dotted CanvasText}}
|
|
3
3
|
dotquilt-text-loader:is(:not(:defined),:state(unstyled))[mark=square] >[slot=placeholder]{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/6px 6px repeat;mask:linear-gradient(#0000 1.5px,#000 2.5px,#000 3.5px,#0000 4.5px),linear-gradient(90deg,#0000 1.5px,#000 2.5px,#000 3.5px,#0000 4.5px);mask-size:6px 6px;mask-position:0 0;mask-repeat:repeat;mask-composite:intersect}dotquilt-text-loader:is(:not(:defined),:state(unstyled))[mark=dash] >[slot=placeholder]{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/6px 6px repeat;mask:radial-gradient(circle at 1.7px 3px,#000 0.3px,#0000 1.3px),radial-gradient(circle at 4.3px 3px,#000 0.3px,#0000 1.3px),linear-gradient(#0000 1.7px,#000 2.7px,#000 3.3px,#0000 4.3px),linear-gradient(90deg,#0000 1.2px,#000 2.2px,#000 3.8px,#0000 4.8px);mask-size:6px 6px;mask-position:0 0;mask-repeat:repeat;mask-composite:add,add,intersect}
|