dotquilt 0.0.0-stage → 0.1.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.
Files changed (183) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -2
  3. package/dist/animations.d.ts +105 -0
  4. package/dist/animations.js +107 -0
  5. package/dist/catalog-styles.d.ts +4 -0
  6. package/dist/catalog-styles.js +12 -0
  7. package/dist/chart-animations.d.ts +36 -0
  8. package/dist/chart-animations.js +25 -0
  9. package/dist/chart-styles.d.ts +3 -0
  10. package/dist/chart-styles.js +23 -0
  11. package/dist/chart.css +4 -0
  12. package/dist/chart.d.ts +73 -0
  13. package/dist/chart.js +80 -0
  14. package/dist/circle.css +5 -0
  15. package/dist/index.d.ts +11 -0
  16. package/dist/index.js +9 -0
  17. package/dist/internal/binding.d.ts +13 -0
  18. package/dist/internal/binding.js +21 -0
  19. package/dist/internal/capture.d.ts +4 -0
  20. package/dist/internal/capture.js +13 -0
  21. package/dist/internal/chart-appearance.d.ts +12 -0
  22. package/dist/internal/chart-appearance.js +2 -0
  23. package/dist/internal/chart-definitions.d.ts +19 -0
  24. package/dist/internal/chart-definitions.js +149 -0
  25. package/dist/internal/chart-factory.d.ts +12 -0
  26. package/dist/internal/chart-factory.js +31 -0
  27. package/dist/internal/chart-field.d.ts +22 -0
  28. package/dist/internal/chart-field.js +74 -0
  29. package/dist/internal/chart-idle.d.ts +3 -0
  30. package/dist/internal/chart-idle.js +96 -0
  31. package/dist/internal/chart-math.d.ts +8 -0
  32. package/dist/internal/chart-math.js +19 -0
  33. package/dist/internal/chart-participant.d.ts +8 -0
  34. package/dist/internal/chart-participant.js +4 -0
  35. package/dist/internal/chart-projection.d.ts +11 -0
  36. package/dist/internal/chart-projection.js +69 -0
  37. package/dist/internal/content-box.d.ts +11 -0
  38. package/dist/internal/content-box.js +36 -0
  39. package/dist/internal/coordinated-handoff.d.ts +4 -0
  40. package/dist/internal/coordinated-handoff.js +158 -0
  41. package/dist/internal/count.d.ts +3 -0
  42. package/dist/internal/count.js +20 -0
  43. package/dist/internal/defaults.d.ts +11 -0
  44. package/dist/internal/defaults.js +11 -0
  45. package/dist/internal/dense/managed-painter.d.ts +4 -0
  46. package/dist/internal/dense/managed-painter.js +361 -0
  47. package/dist/internal/dense/runner.d.ts +2 -0
  48. package/dist/internal/dense/runner.js +5 -0
  49. package/dist/internal/dense-loader.d.ts +83 -0
  50. package/dist/internal/dense-loader.js +331 -0
  51. package/dist/internal/dissolve.d.ts +27 -0
  52. package/dist/internal/dissolve.js +216 -0
  53. package/dist/internal/dom.d.ts +23 -0
  54. package/dist/internal/dom.js +104 -0
  55. package/dist/internal/effect.d.ts +2 -0
  56. package/dist/internal/effect.js +17 -0
  57. package/dist/internal/element.d.ts +89 -0
  58. package/dist/internal/element.js +384 -0
  59. package/dist/internal/event-element.d.ts +8 -0
  60. package/dist/internal/event-element.js +20 -0
  61. package/dist/internal/frames.d.ts +1 -0
  62. package/dist/internal/frames.js +51 -0
  63. package/dist/internal/handoff.d.ts +56 -0
  64. package/dist/internal/handoff.js +102 -0
  65. package/dist/internal/ledger.d.ts +13 -0
  66. package/dist/internal/ledger.js +78 -0
  67. package/dist/internal/loading-controller.d.ts +62 -0
  68. package/dist/internal/loading-controller.js +694 -0
  69. package/dist/internal/marks.d.ts +153 -0
  70. package/dist/internal/marks.js +227 -0
  71. package/dist/internal/math.d.ts +2 -0
  72. package/dist/internal/math.js +2 -0
  73. package/dist/internal/morph-marks.d.ts +62 -0
  74. package/dist/internal/morph-marks.js +205 -0
  75. package/dist/internal/morph.d.ts +35 -0
  76. package/dist/internal/morph.js +488 -0
  77. package/dist/internal/paint.d.ts +29 -0
  78. package/dist/internal/paint.js +1 -0
  79. package/dist/internal/painter.d.ts +20 -0
  80. package/dist/internal/painter.js +155 -0
  81. package/dist/internal/preset-data.d.ts +12 -0
  82. package/dist/internal/preset-data.js +31 -0
  83. package/dist/internal/preset.d.ts +22 -0
  84. package/dist/internal/preset.js +86 -0
  85. package/dist/internal/pulse.d.ts +7 -0
  86. package/dist/internal/pulse.js +74 -0
  87. package/dist/internal/reveal-effect.d.ts +7 -0
  88. package/dist/internal/reveal-effect.js +24 -0
  89. package/dist/internal/reveal.d.ts +5 -0
  90. package/dist/internal/reveal.js +11 -0
  91. package/dist/internal/runner.d.ts +9 -0
  92. package/dist/internal/runner.js +70 -0
  93. package/dist/internal/services.d.ts +12 -0
  94. package/dist/internal/services.js +159 -0
  95. package/dist/internal/skeleton-handoff.d.ts +26 -0
  96. package/dist/internal/skeleton-handoff.js +6 -0
  97. package/dist/internal/skeleton-source.d.ts +5 -0
  98. package/dist/internal/skeleton-source.js +106 -0
  99. package/dist/internal/surface.d.ts +4 -0
  100. package/dist/internal/surface.js +21 -0
  101. package/dist/internal/table-definitions.d.ts +27 -0
  102. package/dist/internal/table-definitions.js +139 -0
  103. package/dist/internal/table-factory.d.ts +12 -0
  104. package/dist/internal/table-factory.js +44 -0
  105. package/dist/internal/table-field.d.ts +12 -0
  106. package/dist/internal/table-field.js +75 -0
  107. package/dist/internal/table-model.d.ts +21 -0
  108. package/dist/internal/table-model.js +117 -0
  109. package/dist/internal/table-projection.d.ts +7 -0
  110. package/dist/internal/table-projection.js +110 -0
  111. package/dist/internal/target-changes.d.ts +3 -0
  112. package/dist/internal/target-changes.js +2 -0
  113. package/dist/internal/target-tracker.d.ts +18 -0
  114. package/dist/internal/target-tracker.js +33 -0
  115. package/dist/internal/targets.d.ts +3 -0
  116. package/dist/internal/targets.js +15 -0
  117. package/dist/internal/text-definitions.d.ts +141 -0
  118. package/dist/internal/text-definitions.js +228 -0
  119. package/dist/internal/text-glyphs.d.ts +4 -0
  120. package/dist/internal/text-glyphs.js +32 -0
  121. package/dist/internal/text-morph.d.ts +32 -0
  122. package/dist/internal/text-morph.js +113 -0
  123. package/dist/internal/text-playback.d.ts +4 -0
  124. package/dist/internal/text-playback.js +119 -0
  125. package/dist/internal/text-scramble.d.ts +18 -0
  126. package/dist/internal/text-scramble.js +47 -0
  127. package/dist/internal/time.d.ts +9 -0
  128. package/dist/internal/time.js +13 -0
  129. package/dist/internal/unstyled.d.ts +8 -0
  130. package/dist/internal/unstyled.js +8 -0
  131. package/dist/line.css +5 -0
  132. package/dist/region-css.d.ts +1 -0
  133. package/dist/region-css.js +6 -0
  134. package/dist/region-styles.d.ts +3 -0
  135. package/dist/region-styles.js +15 -0
  136. package/dist/region.css +1 -0
  137. package/dist/region.d.ts +31 -0
  138. package/dist/region.js +100 -0
  139. package/dist/register-all.d.ts +2 -0
  140. package/dist/register-all.js +33 -0
  141. package/dist/server.d.ts +63 -0
  142. package/dist/server.js +141 -0
  143. package/dist/skeleton-animations.d.ts +10 -0
  144. package/dist/skeleton-animations.js +35 -0
  145. package/dist/skeleton-block.d.ts +50 -0
  146. package/dist/skeleton-block.js +260 -0
  147. package/dist/skeleton-circle.d.ts +5 -0
  148. package/dist/skeleton-circle.js +11 -0
  149. package/dist/skeleton-family.css +13 -0
  150. package/dist/skeleton-line.d.ts +5 -0
  151. package/dist/skeleton-line.js +11 -0
  152. package/dist/skeleton-text.css +5 -0
  153. package/dist/skeleton-text.d.ts +22 -0
  154. package/dist/skeleton-text.js +115 -0
  155. package/dist/skeleton.css +4 -0
  156. package/dist/skeleton.d.ts +5 -0
  157. package/dist/skeleton.js +4 -0
  158. package/dist/static-catalog-styles.d.ts +8 -0
  159. package/dist/static-catalog-styles.js +44 -0
  160. package/dist/styles.d.ts +4 -0
  161. package/dist/styles.js +18 -0
  162. package/dist/table-animations.d.ts +11 -0
  163. package/dist/table-animations.js +4 -0
  164. package/dist/table-styles.d.ts +2 -0
  165. package/dist/table-styles.js +12 -0
  166. package/dist/table.css +3 -0
  167. package/dist/table.d.ts +88 -0
  168. package/dist/table.js +126 -0
  169. package/dist/text-animations.d.ts +31 -0
  170. package/dist/text-animations.js +40 -0
  171. package/dist/text-styles.d.ts +3 -0
  172. package/dist/text-styles.js +24 -0
  173. package/dist/text.css +3 -0
  174. package/dist/text.d.ts +42 -0
  175. package/dist/text.js +402 -0
  176. package/dist/types.d.ts +56 -0
  177. package/dist/types.js +18 -0
  178. package/dist/typing-styles.d.ts +1 -0
  179. package/dist/typing-styles.js +7 -0
  180. package/dist/typing.css +4 -0
  181. package/dist/typing.d.ts +35 -0
  182. package/dist/typing.js +164 -0
  183. package/package.json +100 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Derenik Khachatryan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,65 @@
1
- # Temporary Holding Version
1
+ # Dotquilt
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Loading placeholders that hold the shape of your content, then hand over to it. Marks wait where your content will be. When the data arrives they travel to its real shape (each line's length, the image, the avatar), then the content wipes in as they leave, in about a second.
4
+
5
+ <a href="https://dotquilt.dev"><img src="https://raw.githubusercontent.com/b4rb13/dot-loaders/main/.github/assets/hero-light.gif" alt="A revenue screen loading: its figures take shape in square marks, a chart line draws from a field of dots, and the table rows settle, then everything hands over to the real content." width="100%"></a>
6
+
7
+ Native Web Components with no runtime dependencies, for any framework or none. For React, see `@dotquilt/react`.
8
+
9
+ > **Status:** alpha (0.x). The API may still change before 1.0.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install dotquilt
15
+ ```
16
+
17
+ ## Quick start
18
+
19
+ ```html
20
+ <dotquilt-region state="pending" aria-label="Revenue">
21
+ <dotquilt-skeleton-text slot="placeholder" lines="3"></dotquilt-skeleton-text>
22
+ <p>Your content</p>
23
+ </dotquilt-region>
24
+
25
+ <script type="module">
26
+ import { registerAll } from 'dotquilt/register-all';
27
+
28
+ registerAll();
29
+ const region = document.querySelector('dotquilt-region');
30
+ const data = await fetch('/api/revenue').then((response) => response.json());
31
+ // …render your content, then:
32
+ region.update({ state: 'ready' });
33
+ </script>
34
+ ```
35
+
36
+ Register only what a page uses to keep it small. Each component has its own entry, for example `dotquilt/skeleton` with `registerSkeletonBlock()`.
37
+
38
+ ## Components
39
+
40
+ | Element | Entry | Use it for |
41
+ | --- | --- | --- |
42
+ | `<dotquilt-region>` | `/region` | Wraps content: shows a placeholder while pending, keeps content usable while refreshing, and hands over when ready |
43
+ | `<dotquilt-skeleton-block>`, `-line`, `-circle`, `-text` | `/skeleton` | Images, lines, avatars and paragraphs |
44
+ | `<dotquilt-text-loader>` | `/text` | Numbers and short labels that take shape in marks, then hand over |
45
+ | `<dotquilt-chart-loader>` | `/chart` | Line, bar and scatter charts: marks glide onto your real data |
46
+ | `<dotquilt-table-loader>` | `/table` | Tables: each cell's marks gather into its real text |
47
+ | `<dotquilt-typing-dots>` | `/typing` | A reply that is being written |
48
+
49
+ Animations live in `/animations/<family>` (for example `scan`, `cycle` and `morphWipe` for charts). Server rendering is in `/server` (`renderStatic`), and stylesheets are at `/styles/*.css` for strict CSP setups.
50
+
51
+ ## What it takes care of
52
+
53
+ - **Accessibility.** Pending content is inert and hidden from assistive technology. Focus is kept. Reduced motion stills every loader, and forced-colours mode shows a clear outline.
54
+ - **Server rendering.** Placeholders are in the first HTML, at your content's size, so nothing jumps when JavaScript arrives.
55
+ - **Strict CSP.** No inline style attributes. Allow the stylesheets with a nonce or hashes, or serve them as files.
56
+ - **Calm by design.** The idle motion stops after four seconds. `delay` and `min-display` keep fast loads from flickering.
57
+ - **Cleanup.** Listeners and observers are released when a loader leaves the page.
58
+
59
+ ## Docs
60
+
61
+ Guides, every option and live examples are at [dotquilt.dev](https://dotquilt.dev). You can also try every loader in the [playground](https://dotquilt.dev/playground/).
62
+
63
+ ## License
64
+
65
+ MIT
@@ -0,0 +1,105 @@
1
+ export type AnimationFamily = 'skeleton' | 'region' | 'text' | 'chart' | 'table';
2
+ export type AnimationPhase = 'idle' | 'handoff';
3
+ export interface Rect {
4
+ readonly x: number;
5
+ readonly y: number;
6
+ readonly width: number;
7
+ readonly height: number;
8
+ }
9
+ export interface Dot {
10
+ readonly x: number;
11
+ readonly y: number;
12
+ readonly size: number;
13
+ readonly opacity: number;
14
+ readonly tone: 'base' | 'accent';
15
+ /**
16
+ * Turns a square or dash about its centre, in radians, clockwise from
17
+ * level. Dots ignore it. A chart's dashes use it to follow the line.
18
+ */
19
+ readonly angle?: number | undefined;
20
+ }
21
+ export interface AnimationSurface<F extends AnimationFamily> {
22
+ readonly width: number;
23
+ readonly height: number;
24
+ readonly input: F extends 'chart' ? import('./chart.js').ChartInput : F extends 'table' ? import('./table.js').TableInput : Readonly<{
25
+ shapes: readonly Rect[];
26
+ }> & (F extends 'text' ? Readonly<{
27
+ mask: readonly GlyphCell[];
28
+ value: readonly GlyphCell[];
29
+ precise: boolean;
30
+ }> : object);
31
+ readonly source: readonly Dot[];
32
+ readonly revealTargetIds: readonly string[];
33
+ readonly family: F;
34
+ }
35
+ export interface GlyphCell {
36
+ readonly character: string;
37
+ readonly bounds: Rect;
38
+ }
39
+ export interface AnimationFrame {
40
+ readonly timeMs: number;
41
+ readonly deltaMs: number;
42
+ readonly linearProgress: number;
43
+ readonly progress: number;
44
+ readonly static: boolean;
45
+ }
46
+ export interface RevealFrame {
47
+ readonly opacity: number;
48
+ readonly translateY?: number;
49
+ readonly clipStart?: number;
50
+ }
51
+ export interface DrawContext<F extends AnimationFamily> {
52
+ readonly surface: AnimationSurface<F>;
53
+ readonly frame: AnimationFrame;
54
+ dot(value: Dot): void;
55
+ }
56
+ export interface HandoffContext<F extends AnimationFamily, P = undefined> extends DrawContext<F> {
57
+ readonly prepared: Readonly<P>;
58
+ reveal(value: RevealFrame): void;
59
+ revealTarget(id: string, value: Omit<RevealFrame, 'clipStart'>): void;
60
+ }
61
+ interface Base<F extends AnimationFamily, O extends object> {
62
+ readonly contractVersion: 1;
63
+ readonly id: string;
64
+ readonly family: F;
65
+ readonly options: {
66
+ parse(value: Readonly<Partial<O>>): Readonly<O>;
67
+ };
68
+ }
69
+ export interface IdleDefinition<F extends AnimationFamily, O extends object> extends Base<F, O> {
70
+ readonly phase: 'idle';
71
+ frame(context: DrawContext<F>, options: Readonly<O>): undefined;
72
+ still(context: DrawContext<F>, options: Readonly<O>): undefined;
73
+ }
74
+ export interface HandoffDefinition<F extends AnimationFamily, O extends object, P> extends Base<F, O> {
75
+ readonly phase: 'handoff';
76
+ duration(surface: AnimationSurface<F>, options: Readonly<O>): number;
77
+ prepare(surface: AnimationSurface<F>, options: Readonly<O>): P;
78
+ frame(context: HandoffContext<F, P>, options: Readonly<O>): undefined;
79
+ }
80
+ import { brand } from './internal/binding.js';
81
+ export interface AnimationBinding<F extends AnimationFamily, P extends AnimationPhase, O extends object = object> {
82
+ readonly [brand]: {
83
+ readonly family: F;
84
+ readonly phase: P;
85
+ };
86
+ readonly contractVersion: 1;
87
+ readonly id: string;
88
+ readonly family: F;
89
+ readonly phase: P;
90
+ readonly options: Readonly<O>;
91
+ }
92
+ export type AnimationFactory<F extends AnimationFamily, P extends AnimationPhase, O extends object> = (options?: Readonly<Partial<O>>) => AnimationBinding<F, P, O>;
93
+ export interface Animations<F extends AnimationFamily> {
94
+ readonly idle?: AnimationBinding<F, 'idle'>;
95
+ readonly handoff?: AnimationBinding<F, 'handoff'>;
96
+ }
97
+ export interface RevealTarget {
98
+ readonly id: string;
99
+ readonly element: HTMLElement;
100
+ }
101
+ export declare function defineAnimation<F extends AnimationFamily, O extends object>(definition: IdleDefinition<F, O>): AnimationFactory<F, 'idle', O>;
102
+ export declare function defineAnimation<F extends AnimationFamily, O extends object, P>(definition: HandoffDefinition<F, O, P>): AnimationFactory<F, 'handoff', O>;
103
+ export type { Preset, PresetKind } from './internal/preset.js';
104
+ import { type Preset, type PresetKind } from './internal/preset.js';
105
+ export declare function definePreset<K extends PresetKind>(value: Preset<K>): Readonly<Preset<K>>;
@@ -0,0 +1,107 @@
1
+ import { createHandoff } from './internal/handoff.js';
2
+ import { createReveal } from './internal/reveal.js';
3
+ import { createRunner } from './internal/runner.js';
4
+ import { surface } from './internal/surface.js';
5
+ import { createTargets } from './internal/targets.js';
6
+ import { LoaderConfigurationError } from './types.js';
7
+ import { brand } from './internal/binding.js';
8
+ function copy(value, depth = 0, budget = { remaining: 4096 }) {
9
+ if (--budget.remaining < 0)
10
+ throw new LoaderConfigurationError('options-limit', 'Options exceed 4096 values');
11
+ if (depth > 8)
12
+ throw new LoaderConfigurationError('options-depth', 'Options exceed eight levels');
13
+ if (value === null ||
14
+ typeof value === 'string' ||
15
+ typeof value === 'boolean' ||
16
+ value === undefined)
17
+ return value;
18
+ if (typeof value === 'number' && Number.isFinite(value))
19
+ return value;
20
+ if (typeof value !== 'object' || Object.keys(value).length > 256)
21
+ throw new LoaderConfigurationError('invalid-options', 'Options must be bounded plain data');
22
+ if (Array.isArray(value))
23
+ return Object.freeze(value.map((v) => copy(v, depth + 1, budget)));
24
+ if (Object.getPrototypeOf(value) !== Object.prototype)
25
+ throw new LoaderConfigurationError('invalid-options', 'Options must be plain data');
26
+ return Object.freeze(Object.fromEntries(Object.entries(value).map(([k, v]) => [k, copy(v, depth + 1, budget)])));
27
+ }
28
+ export function defineAnimation(definition) {
29
+ if (definition?.contractVersion !== 1 ||
30
+ !/^[\w.-]+\/[\w./-]+$/.test(definition.id) ||
31
+ !['skeleton', 'region', 'text', 'chart', 'table'].includes(definition.family) ||
32
+ typeof definition.options?.parse !== 'function' ||
33
+ typeof definition.frame !== 'function' ||
34
+ (definition.phase === 'idle'
35
+ ? typeof definition.still !== 'function'
36
+ : definition.phase !== 'handoff' ||
37
+ typeof definition.prepare !== 'function' ||
38
+ typeof definition.duration !== 'function'))
39
+ throw new LoaderConfigurationError('invalid-definition', 'Invalid version-1 animation definition');
40
+ const draw = definition.phase === 'idle'
41
+ ? (({ surface, options, timeMs, still, dot, deltaMs }) => {
42
+ const context = Object.freeze({
43
+ surface,
44
+ frame: Object.freeze({
45
+ timeMs,
46
+ deltaMs,
47
+ linearProgress: 0,
48
+ progress: 0,
49
+ static: still,
50
+ }),
51
+ dot,
52
+ });
53
+ (still
54
+ ? captured.still
55
+ : captured.frame)(context, options);
56
+ })
57
+ : ({ surface, options, prepared, linear: linearProgress, progress, duration, deltaMs, dot, reveal, revealTarget, }) => {
58
+ let active = true;
59
+ try {
60
+ captured.frame(Object.freeze({
61
+ surface,
62
+ prepared: prepared,
63
+ frame: Object.freeze({
64
+ timeMs: duration * linearProgress,
65
+ deltaMs,
66
+ linearProgress,
67
+ progress,
68
+ static: false,
69
+ }),
70
+ dot,
71
+ reveal: (frame) => {
72
+ if (active)
73
+ reveal(frame);
74
+ },
75
+ revealTarget: (id, frame) => {
76
+ if (active)
77
+ revealTarget(id, frame);
78
+ },
79
+ }), options);
80
+ }
81
+ finally {
82
+ active = false;
83
+ }
84
+ };
85
+ const captured = Object.freeze({
86
+ ...definition,
87
+ draw,
88
+ snapshot: surface,
89
+ handoff: createHandoff,
90
+ targets: createTargets,
91
+ reveal: createReveal,
92
+ runner: createRunner,
93
+ options: Object.freeze({ ...definition.options }),
94
+ });
95
+ return (options = {}) => Object.freeze({
96
+ contractVersion: 1,
97
+ id: captured.id,
98
+ family: captured.family,
99
+ phase: captured.phase,
100
+ options: copy(captured.options.parse(copy(options))),
101
+ [brand]: captured,
102
+ });
103
+ }
104
+ import { capturePreset, } from './internal/preset.js';
105
+ export function definePreset(value) {
106
+ return capturePreset(value);
107
+ }
@@ -0,0 +1,4 @@
1
+ export declare const skeletonLineStyles: readonly string[];
2
+ export declare const skeletonCircleStyles: readonly string[];
3
+ export declare const skeletonTextStyles: readonly string[];
4
+ export { typingStyles } from './typing-styles.js';
@@ -0,0 +1,12 @@
1
+ import { circleEdge, dotGrid, lineHeight, lineTrim, markLineHeights, markShapes, } from './internal/marks.js';
2
+ import { skeletonStyles } from './styles.js';
3
+ export const skeletonLineStyles =
4
+ /* @__PURE__ */ Object.freeze(
5
+ /* @__PURE__ */ skeletonStyles.concat(`:host{height:${lineHeight};border-radius:999px}:host .surface{${dotGrid('0 0')}}${markShapes((mark) => `:host([mark=${mark}])`, '.surface', '0 0')}${markLineHeights((mark) => `:host([mark=${mark}])`)}${lineTrim((mark) => (mark ? `:host([mark=${mark}])` : ':host'), '.surface')}`));
6
+ export const skeletonCircleStyles =
7
+ /* @__PURE__ */ Object.freeze(
8
+ /* @__PURE__ */ skeletonStyles.concat(`:host{width:2.5rem;height:auto;aspect-ratio:1;border-radius:50%;${circleEdge}}@media(forced-colors:active){:host{mask:none}}`));
9
+ export const skeletonTextStyles =
10
+ /* @__PURE__ */ Object.freeze(
11
+ /* @__PURE__ */ skeletonStyles.concat(`:host{height:auto;overflow:visible;display:grid;gap:.5em;border-radius:0}:host .lines{display:grid;gap:inherit}:host .lines:is(.pulse,.lift){position:absolute;inset:0}:host .line{box-sizing:border-box;height:${lineHeight};position:relative;border-radius:999px;overflow:hidden;${dotGrid('0 0')}}${markShapes((mark) => `:host([mark=${mark}])`, '.line', '0 0')}${markLineHeights((mark) => `:host([mark=${mark}]) .line`)}${lineTrim((mark) => (mark ? `:host([mark=${mark}])` : ':host'), '.line')}`));
12
+ export { typingStyles } from './typing-styles.js';
@@ -0,0 +1,36 @@
1
+ export type { MorphWipeOptions } from './internal/chart-definitions.js';
2
+ export interface RidgeOptions {
3
+ readonly amplitude: number;
4
+ readonly highlightWidth: number;
5
+ }
6
+ export interface ScanOptions {
7
+ readonly amplitude: number;
8
+ readonly bandWidth: number;
9
+ readonly trail: number;
10
+ }
11
+ export interface TerrainOptions {
12
+ readonly amplitude: number;
13
+ readonly relief: number;
14
+ }
15
+ export interface BarsOptions {
16
+ readonly sway: number;
17
+ }
18
+ export interface ScatterOptions {
19
+ readonly radius: number;
20
+ readonly spread: number;
21
+ readonly sway: number;
22
+ }
23
+ export interface CycleOptions {
24
+ readonly holdMs: number;
25
+ readonly blendMs: number;
26
+ }
27
+ export declare const ridge: import("./animations.js").AnimationFactory<"chart", "idle", {
28
+ amplitude: number;
29
+ highlightWidth: number;
30
+ }>;
31
+ export declare const scan: import("./animations.js").AnimationFactory<"chart", "idle", ScanOptions>;
32
+ export declare const terrain: import("./animations.js").AnimationFactory<"chart", "idle", TerrainOptions>;
33
+ export declare const bars: import("./animations.js").AnimationFactory<"chart", "idle", BarsOptions>;
34
+ export declare const scatter: import("./animations.js").AnimationFactory<"chart", "idle", ScatterOptions>;
35
+ export declare const cycle: import("./animations.js").AnimationFactory<"chart", "idle", CycleOptions>;
36
+ export declare const morphWipe: import("./animations.js").AnimationFactory<"chart", "handoff", import("./chart-animations.js").MorphWipeOptions>;
@@ -0,0 +1,25 @@
1
+ import { morphFactory, ridgeFactory } from './internal/chart-definitions.js';
2
+ import { chartIdle } from './internal/chart-idle.js';
3
+ export const ridge = ridgeFactory;
4
+ export const scan = /* @__PURE__ */ chartIdle('scan', {
5
+ amplitude: [0.24, 0, 0.4],
6
+ bandWidth: [36, 12, 80],
7
+ trail: [160, 40, 240],
8
+ });
9
+ export const terrain = /* @__PURE__ */ chartIdle('terrain', {
10
+ amplitude: [0.24, 0, 0.4],
11
+ relief: [1, 0.4, 1.4],
12
+ });
13
+ export const bars = /* @__PURE__ */ chartIdle('bars', {
14
+ sway: [0.07, 0, 0.12],
15
+ });
16
+ export const scatter = /* @__PURE__ */ chartIdle('scatter', {
17
+ radius: [13, 6, 24],
18
+ spread: [0.24, 0.1, 0.35],
19
+ sway: [0.045, 0, 0.1],
20
+ });
21
+ export const cycle = /* @__PURE__ */ chartIdle('cycle', {
22
+ holdMs: [3200, 800, 3200],
23
+ blendMs: [460, 200, 600],
24
+ });
25
+ export const morphWipe = morphFactory;
@@ -0,0 +1,3 @@
1
+ export declare const chartStyles: readonly string[];
2
+ export declare const staticChartStyles: readonly string[];
3
+ export declare const staticChartMarkStyles: readonly string[];
@@ -0,0 +1,23 @@
1
+ import { dotGrid, markGap, markShapes } from './internal/marks.js';
2
+ import { unstyledHold } from './internal/unstyled.js';
3
+ /**
4
+ * The static field before upgrade: between the idle's faint floor and its
5
+ * shaded area, so upgrading does not flash brighter or darker.
6
+ */
7
+ const staticOpacity = 0.15;
8
+ export const chartStyles = /* @__PURE__ */ Object.freeze([
9
+ `:host{display:block;position:relative;width:100%;height:12rem;overflow:hidden}:host([hidden]){display:none}:host .surface{position:absolute;inset:0;gap:${markGap};${dotGrid('0 0')};opacity:${staticOpacity}}${markShapes((mark) => `:host([mark=${mark}])`, '.surface', '0 0')}:host > svg{position:relative;display:block;width:100%;height:100%;pointer-events:none}:host([data-custom]) .surface{visibility:hidden}:host [data-dotquilt-react-static]{display:none}@media(forced-colors:active){:host .surface{visibility:visible;border:1px dotted CanvasText}:host > svg{display:none}}:host canvas[data-dotquilt-bitmap]{display:block;width:100%;height:100%;pointer-events:none}`,
10
+ unstyledHold,
11
+ ]);
12
+ // Static rules also apply while the element's external stylesheet loads
13
+ // (`:state(unstyled)`); browsers without custom states ignore that part.
14
+ export const staticChartStyles =
15
+ /* @__PURE__ */ Object.freeze([
16
+ `:where(dotquilt-chart-loader:is(:not(:defined),:state(unstyled))){display:block;position:relative;width:100%;height:12rem;overflow:hidden}dotquilt-chart-loader:is(:not(:defined),:state(unstyled))[hidden]{display:none}dotquilt-chart-loader:is(:not(:defined),:state(unstyled)) [data-dotquilt-static]{position:absolute;inset:0;gap:${markGap};${dotGrid('0 0')};opacity:${staticOpacity}}@media(forced-colors:active){dotquilt-chart-loader:is(:not(:defined),:state(unstyled)) [data-dotquilt-static]{border:1px dotted CanvasText}}`,
17
+ ]);
18
+ // A mark's rules ship only with markup that uses it (renderStatic), so pages
19
+ // without squares or dashes don't carry them.
20
+ export const staticChartMarkStyles =
21
+ /* @__PURE__ */ Object.freeze([
22
+ markShapes((mark) => `dotquilt-chart-loader:is(:not(:defined),:state(unstyled))[mark=${mark}]`, '[data-dotquilt-static]', '0 0'),
23
+ ]);
package/dist/chart.css ADDED
@@ -0,0 +1,4 @@
1
+ :host{display:block;position:relative;width:100%;height:12rem;overflow:hidden}:host([hidden]){display:none}:host .surface{position:absolute;inset:0;gap:var(--dotquilt-dot-gap,4.6px);--s:var(--dotquilt-dot-size,4.4px);--g:calc(var(--s) + var(--dotquilt-dot-gap,4.6px));background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) calc(var(--s)/2 - .5px),#0000 calc(var(--s)/2 + .5px)) 0 0/var(--g) var(--g);opacity:0.15}:host([mark=square]) .surface{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/8.5px 8.5px repeat;mask:linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:8.5px 8.5px;mask-position:0 0;mask-repeat:repeat;mask-composite:intersect}:host([mark=dash]) .surface{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/13px 9.5px repeat;mask:radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:13px 9.5px;mask-position:0 0;mask-repeat:repeat;mask-composite:add,add,intersect}:host > svg{position:relative;display:block;width:100%;height:100%;pointer-events:none}:host([data-custom]) .surface{visibility:hidden}:host [data-dotquilt-react-static]{display:none}@media(forced-colors:active){:host .surface{visibility:visible;border:1px dotted CanvasText}:host > svg{display:none}}:host canvas[data-dotquilt-bitmap]{display:block;width:100%;height:100%;pointer-events:none}
2
+ :host(:state(unstyled)) > :not(slot){display:none!important}
3
+ :where(dotquilt-chart-loader:is(:not(:defined),:state(unstyled))){display:block;position:relative;width:100%;height:12rem;overflow:hidden}dotquilt-chart-loader:is(:not(:defined),:state(unstyled))[hidden]{display:none}dotquilt-chart-loader:is(:not(:defined),:state(unstyled)) [data-dotquilt-static]{position:absolute;inset:0;gap:var(--dotquilt-dot-gap,4.6px);--s:var(--dotquilt-dot-size,4.4px);--g:calc(var(--s) + var(--dotquilt-dot-gap,4.6px));background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) calc(var(--s)/2 - .5px),#0000 calc(var(--s)/2 + .5px)) 0 0/var(--g) var(--g);opacity:0.15}@media(forced-colors:active){dotquilt-chart-loader:is(:not(:defined),:state(unstyled)) [data-dotquilt-static]{border:1px dotted CanvasText}}
4
+ dotquilt-chart-loader:is(:not(:defined),:state(unstyled))[mark=square] [data-dotquilt-static]{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/8.5px 8.5px repeat;mask:linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:8.5px 8.5px;mask-position:0 0;mask-repeat:repeat;mask-composite:intersect}dotquilt-chart-loader:is(:not(:defined),:state(unstyled))[mark=dash] [data-dotquilt-static]{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) 0 0/13px 9.5px repeat;mask:radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:13px 9.5px;mask-position:0 0;mask-repeat:repeat;mask-composite:add,add,intersect}
@@ -0,0 +1,73 @@
1
+ import type { Animations, Rect } from './animations.js';
2
+ import { DenseLoader, type PointerResponse, type Projector } from './internal/dense-loader.js';
3
+ import type { Preset } from './internal/preset.js';
4
+ import type { Motion, StylePolicy } from './types.js';
5
+ export type ChartVariant = 'line' | 'bar' | 'scatter';
6
+ export interface Point {
7
+ readonly x: number;
8
+ readonly y: number;
9
+ }
10
+ export type ChartInput = Readonly<{
11
+ kind: 'line';
12
+ points: readonly Point[];
13
+ baseline: number;
14
+ }> | Readonly<{
15
+ kind: 'bar';
16
+ bars: readonly Rect[];
17
+ baseline: number;
18
+ }> | Readonly<{
19
+ kind: 'scatter';
20
+ points: readonly Point[];
21
+ }>;
22
+ export type TargetGeometry = ChartInput | Readonly<{
23
+ kind: 'points';
24
+ points: readonly Point[];
25
+ }> | Readonly<{
26
+ kind: 'rects';
27
+ rects: readonly Rect[];
28
+ }>;
29
+ export type TargetProvider = (bounds: Readonly<{
30
+ width: number;
31
+ height: number;
32
+ }>) => TargetGeometry | null;
33
+ export type ChartPreset = import('./internal/preset.js').Preset<'chart'>;
34
+ export declare class ChartLoader extends DenseLoader<'chart', TargetProvider> {
35
+ static observedAttributes: string[];
36
+ protected readonly family = "chart";
37
+ protected readonly styles: readonly string[];
38
+ protected readonly appearanceKey: symbol;
39
+ protected readonly emptyInput: Readonly<{
40
+ kind: 'scatter';
41
+ points: readonly never[];
42
+ }>;
43
+ protected defaultIdle(): import("./animations.js").AnimationBinding<"chart", "idle", {
44
+ amplitude: number;
45
+ highlightWidth: number;
46
+ }>;
47
+ protected defaultHandoff(): import("./animations.js").AnimationBinding<"chart", "handoff", {
48
+ morphEnd: number;
49
+ wipeStart: number;
50
+ edge: number;
51
+ }>;
52
+ protected createSurface(document: Document): Node;
53
+ protected projector(provider: TargetProvider | undefined): Projector<'chart'>;
54
+ protected upgrade(): void;
55
+ protected capturePreset(value: Preset<'chart'>): Preset<'chart'>;
56
+ protected prepareConnection(): void;
57
+ get variant(): ChartVariant;
58
+ set variant(value: ChartVariant | undefined);
59
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
60
+ update(patch: Readonly<{
61
+ variant?: ChartVariant | undefined;
62
+ speed?: number | undefined;
63
+ pointerResponse?: PointerResponse | undefined;
64
+ animations?: Animations<'chart'> | undefined;
65
+ preset?: ChartPreset | undefined;
66
+ targetProvider?: TargetProvider | undefined;
67
+ motion?: Motion | undefined;
68
+ stylePolicy?: StylePolicy | undefined;
69
+ }>): void;
70
+ protected get optionNames(): readonly string[];
71
+ }
72
+ export declare function registerChartLoader(): void;
73
+ export { refreshStyles } from './internal/element.js';
package/dist/chart.js ADDED
@@ -0,0 +1,80 @@
1
+ import { chartStyles } from './chart-styles.js';
2
+ import { chartAppearance } from './internal/chart-appearance.js';
3
+ import { defaultMorphWipe, defaultRidge, } from './internal/chart-definitions.js';
4
+ import { chartProjection, emptyChartInput, } from './internal/chart-projection.js';
5
+ import { DenseLoader, } from './internal/dense-loader.js';
6
+ import { node, register, upgradeProperties } from './internal/dom.js';
7
+ import { chartPreset } from './internal/preset.js';
8
+ import { capturePresetData } from './internal/preset-data.js';
9
+ export class ChartLoader extends DenseLoader {
10
+ static observedAttributes = [
11
+ ...DenseLoader.observedAttributes,
12
+ 'variant',
13
+ ];
14
+ family = 'chart';
15
+ styles = chartStyles;
16
+ appearanceKey = chartAppearance;
17
+ emptyInput = emptyChartInput;
18
+ defaultIdle() {
19
+ return defaultRidge;
20
+ }
21
+ defaultHandoff() {
22
+ return defaultMorphWipe;
23
+ }
24
+ createSurface(document) {
25
+ return node(document, 'div', {
26
+ class: 'surface',
27
+ part: 'surface',
28
+ 'aria-hidden': 'true',
29
+ });
30
+ }
31
+ projector(provider) {
32
+ const variant = this.variant;
33
+ return (bounds, report) => chartProjection(provider, bounds, variant, report);
34
+ }
35
+ upgrade() {
36
+ super.upgrade();
37
+ upgradeProperties(this, ['variant']);
38
+ }
39
+ capturePreset(value) {
40
+ return capturePresetData(value, 'chart', () => chartPreset);
41
+ }
42
+ prepareConnection() {
43
+ // Remove static preset decoration before replaying explicit caller properties.
44
+ const marker = 'data-dotquilt-preset-variant';
45
+ const decoration = this.getAttribute(marker);
46
+ if (decoration === null)
47
+ return;
48
+ if (!Object.hasOwn(this, 'variant') &&
49
+ this.getAttribute('variant') === decoration)
50
+ this.removeAttribute('variant');
51
+ this.removeAttribute(marker);
52
+ }
53
+ get variant() {
54
+ const value = this.getAttribute('variant') ?? this.preset?.variant;
55
+ return value === 'bar' || value === 'scatter' ? value : 'line';
56
+ }
57
+ set variant(value) {
58
+ if (value === undefined)
59
+ this.removeAttribute('variant');
60
+ else
61
+ this.setAttribute('variant', value);
62
+ }
63
+ attributeChangedCallback(name, old, value) {
64
+ if (name === 'variant' &&
65
+ value !== null &&
66
+ !['line', 'bar', 'scatter'].includes(value))
67
+ this.invalidOption(name);
68
+ super.attributeChangedCallback(name, old, value);
69
+ }
70
+ update(patch) {
71
+ this.applyOptions(patch);
72
+ }
73
+ get optionNames() {
74
+ return [...super.optionNames, 'variant'];
75
+ }
76
+ }
77
+ export function registerChartLoader() {
78
+ register('dotquilt-chart-loader', ChartLoader);
79
+ }
80
+ export { refreshStyles } from './internal/element.js';
@@ -0,0 +1,5 @@
1
+ :host{display:block;width:100%;height:1em;position:relative;border-radius:var(--dotquilt-radius,.375rem);overflow:hidden}:host .surface{position:absolute;inset:0;--s:var(--dotquilt-dot-size,4.4px);--g:calc(var(--s) + var(--dotquilt-dot-gap,4.6px));background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) calc(var(--s)/2 - .5px),#0000 calc(var(--s)/2 + .5px)) center/var(--g) var(--g) space;opacity:0.37}:host .pulse{position:absolute;inset:0;--dotquilt-color:var(--dotquilt-accent-color,light-dark(#4f8f93,#8dc4c5));opacity:0;mask:linear-gradient(104deg,#0000 12.5%,#00000005 18.75%,#0000001b 26.56%,#0000005e 34.38%,#000000c7 42.19%,#000 50%,#000000c7 57.81%,#0000005e 65.63%,#0000001b 73.44%,#00000005 81.25%,#0000 87.5%) 0 0/128% 100% no-repeat}:host .pulse>.surface,:host .lift>.surface{opacity:1}:host .lift{position:absolute;inset:0;--dotquilt-color:var(--dotquilt-accent-color,light-dark(#4f8f93,#8dc4c5));opacity:0;mask:radial-gradient(circle 56px at var(--dotquilt-pointer-x,-999px) var(--dotquilt-pointer-y,-999px),#000,#0000);transition:opacity .32s cubic-bezier(.22,1,.36,1)}:host([mark=square]) .surface{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) center/8.5px 8.5px space;mask:linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:8.5px 8.5px;mask-position:center;mask-repeat:space;mask-composite:intersect}:host([mark=dash]) .surface{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) center/13px 9.5px space;mask:radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:13px 9.5px;mask-position:center;mask-repeat:space;mask-composite:add,add,intersect}:host [data-dotquilt-dissolve] circle{r:calc(var(--dotquilt-dot-size,4.4px)/2)}:host [data-dotquilt-dissolve] pattern>rect{transform-box:fill-box;transform-origin:center}:host(dotquilt-skeleton-text) [data-dotquilt-dissolve] > svg{border-radius:999px}:host([hidden]){display:none}:host > svg{position:absolute;inset:0;width:100%;height:100%;fill:var(--dotquilt-color,light-dark(#6e7889,#a3afc2))}@media(forced-colors:none){:host([data-custom]) .surface{visibility:hidden}}@media(hover:hover) and (pointer:fine){:host([pointer-response=lift][data-pointer]) .lift{opacity:0.9}}@media(forced-colors:active){:host .surface{border:1px dotted CanvasText}:host .pulse,:host .lift,:host > svg{display:none}}
2
+ :host(:state(unstyled)) > :not(slot){display:none!important}
3
+ :host{width:2.5rem;height:auto;aspect-ratio:1;border-radius:50%;mask:radial-gradient(closest-side,#000 calc(100% - var(--dotquilt-dot-size,4.4px)*.7),#0000)}@media(forced-colors:active){:host{mask:none}}
4
+ dotquilt-skeleton-circle{display:block;width:2.5rem;aspect-ratio:1;position:relative;border-radius:50%;overflow:hidden;mask:radial-gradient(closest-side,#000 calc(100% - var(--dotquilt-dot-size,4.4px)*.7),#0000)}@media(forced-colors:active){dotquilt-skeleton-circle{mask:none}}dotquilt-skeleton-circle [data-dotquilt-static]{display:block;position:absolute;inset:0;--s:var(--dotquilt-dot-size,4.4px);--g:calc(var(--s) + var(--dotquilt-dot-gap,4.6px));background:radial-gradient(circle,var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) calc(var(--s)/2 - .5px),#0000 calc(var(--s)/2 + .5px)) center/var(--g) var(--g) space;opacity:0.37}@media(forced-colors:active){dotquilt-skeleton-circle [data-dotquilt-static]{border:1px dotted CanvasText}}
5
+ dotquilt-skeleton-circle[mark=square] [data-dotquilt-static]{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) center/8.5px 8.5px space;mask:linear-gradient(#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px),linear-gradient(90deg,#0000 1.75px,#000 2.75px,#000 5.75px,#0000 6.75px);mask-size:8.5px 8.5px;mask-position:center;mask-repeat:space;mask-composite:intersect}dotquilt-skeleton-circle[mark=dash] [data-dotquilt-static]{background:var(--dotquilt-color,light-dark(#6e7889,#a3afc2)) center/13px 9.5px space;mask:radial-gradient(circle at 3.5px 4.75px,#000 1.2px,#0000 2.2px),radial-gradient(circle at 9.5px 4.75px,#000 1.2px,#0000 2.2px),linear-gradient(#0000 2.55px,#000 3.55px,#000 5.95px,#0000 6.95px),linear-gradient(90deg,#0000 3px,#000 4px,#000 9px,#0000 10px);mask-size:13px 9.5px;mask-position:center;mask-repeat:space;mask-composite:add,add,intersect}
@@ -0,0 +1,11 @@
1
+ export type { AnimationBinding, AnimationFactory, AnimationSurface, Animations, Dot, DrawContext, GlyphCell, HandoffContext, HandoffDefinition, IdleDefinition, Preset, PresetKind, RevealTarget, } from './animations.js';
2
+ export { defineAnimation, definePreset } from './animations.js';
3
+ export { type ChartInput, ChartLoader, type ChartPreset, type ChartVariant, type Point, registerChartLoader, type TargetGeometry, type TargetProvider, } from './chart.js';
4
+ export { refreshStyles } from './internal/element.js';
5
+ export { LoadingRegion, type RegionPreset, registerLoadingRegion, } from './region.js';
6
+ export { registerSkeletonBlock, registerSkeletonCircle, registerSkeletonLine, registerSkeletonText, SkeletonBlock, SkeletonCircle, SkeletonLine, type SkeletonPreset, SkeletonText, } from './skeleton.js';
7
+ export { registerTableLoader, type TableCell, type TableCellKind, type TableColumn, type TableInput, TableLoader, type TablePreset, type TableTargetGeometry, type TableTargetProvider, } from './table.js';
8
+ export { registerTextLoader, TextLoader, type TextPreset } from './text.js';
9
+ export type { DotquiltEventMap, HandoffDetail, LoaderErrorDetail, LoadingState, Mark, Motion, StylePolicy, Timing, } from './types.js';
10
+ export { LoaderConfigurationError, LoaderRegistrationError } from './types.js';
11
+ export { registerTypingDots, TypingDots, type TypingPreset } from './typing.js';
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export { defineAnimation, definePreset } from './animations.js';
2
+ export { ChartLoader, registerChartLoader, } from './chart.js';
3
+ export { refreshStyles } from './internal/element.js';
4
+ export { LoadingRegion, registerLoadingRegion, } from './region.js';
5
+ export { registerSkeletonBlock, registerSkeletonCircle, registerSkeletonLine, registerSkeletonText, SkeletonBlock, SkeletonCircle, SkeletonLine, SkeletonText, } from './skeleton.js';
6
+ export { registerTableLoader, TableLoader, } from './table.js';
7
+ export { registerTextLoader, TextLoader } from './text.js';
8
+ export { LoaderConfigurationError, LoaderRegistrationError } from './types.js';
9
+ export { registerTypingDots, TypingDots } from './typing.js';
@@ -0,0 +1,13 @@
1
+ import type { AnimationBinding, AnimationFamily, AnimationPhase, HandoffDefinition, IdleDefinition } from '../animations.js';
2
+ import type { HandoffFactory } from './handoff.js';
3
+ import type { Runner } from './runner.js';
4
+ export declare const brand: unique symbol;
5
+ type Definition = (IdleDefinition<AnimationFamily, object> | HandoffDefinition<AnimationFamily, object, unknown>) & {
6
+ runner?: (host: HTMLElement, report: (code: string) => void, invalidate: () => void) => Runner;
7
+ handoff?: HandoffFactory;
8
+ dissolve?: boolean;
9
+ };
10
+ export declare function definitionOf(binding: AnimationBinding<AnimationFamily, AnimationPhase>): Definition;
11
+ /** Validate a family map without importing the optional animation authoring runtime. */
12
+ export declare function validateBindings(bindings: import('../animations.js').Animations<AnimationFamily> | undefined, family: AnimationFamily): void;
13
+ export {};