@plitzi/sdk-shared 0.38.3 → 0.38.5

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 (86) hide show
  1. package/CHANGELOG.md +522 -0
  2. package/dist/actions/functions.d.ts +10 -0
  3. package/dist/actions/functions.mjs +10 -10
  4. package/dist/actions/index.d.ts +1 -1
  5. package/dist/actions/index.mjs +6 -6
  6. package/dist/authoring/elementCallbacks.d.ts +2 -2
  7. package/dist/dataSource/getBindingsDetails.mjs +1 -1
  8. package/dist/devTools/chrome.d.ts +8 -0
  9. package/dist/devTools/chrome.mjs +4 -0
  10. package/dist/devTools/index.d.ts +1 -0
  11. package/dist/devTools/index.mjs +5 -4
  12. package/dist/helpers/images.d.ts +5 -0
  13. package/dist/helpers/images.mjs +2 -2
  14. package/dist/helpers/twigWrapper/inspectTemplate.mjs +14 -7
  15. package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +4 -3
  16. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +32 -22
  17. package/dist/history/types.d.ts +4 -4
  18. package/dist/index.mjs +56 -54
  19. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.d.ts +10 -0
  20. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +4 -0
  21. package/dist/network/graphql/builder/Mutations/index.d.ts +2 -0
  22. package/dist/network/graphql/builder/Mutations/index.mjs +124 -122
  23. package/dist/network/graphql/builder/Queries/InitQuery.d.ts +1 -3
  24. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -1
  25. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.d.ts +6 -0
  26. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +4 -0
  27. package/dist/network/graphql/builder/Queries/index.d.ts +2 -0
  28. package/dist/network/graphql/builder/Queries/index.mjs +22 -20
  29. package/dist/network/spaceEvents.d.ts +2 -2
  30. package/dist/plugins/bundle.d.ts +26 -0
  31. package/dist/plugins/bundle.mjs +62 -0
  32. package/dist/plugins/declaration.d.ts +12 -0
  33. package/dist/plugins/declaration.mjs +9 -0
  34. package/dist/queries/queryCache.d.ts +7 -0
  35. package/dist/queries/queryCache.mjs +14 -7
  36. package/dist/queries/useQuery.d.ts +2 -0
  37. package/dist/queries/useQuery.mjs +5 -2
  38. package/dist/schema/anchor.d.ts +11 -0
  39. package/dist/schema/anchor.mjs +6 -2
  40. package/dist/schema/index.mjs +6 -6
  41. package/dist/schema/markdownHeadings.d.ts +13 -0
  42. package/dist/schema/markdownHeadings.mjs +24 -0
  43. package/dist/schema/motion.d.ts +47 -15
  44. package/dist/schema/motion.mjs +208 -32
  45. package/dist/schema/motionReveal.d.ts +10 -0
  46. package/dist/schema/motionReveal.mjs +23 -0
  47. package/dist/schema/pageElements.d.ts +12 -0
  48. package/dist/schema/pageElements.mjs +41 -0
  49. package/dist/schema/wire.mjs +4 -3
  50. package/dist/server/index.mjs +4 -4
  51. package/dist/server/rsc/projectData.d.ts +6 -0
  52. package/dist/server/rsc/projectData.mjs +4 -0
  53. package/dist/server/rsc/refreshRsc.d.ts +18 -5
  54. package/dist/server/rsc/refreshRsc.mjs +80 -20
  55. package/dist/server/rsc/useRscSync.mjs +26 -15
  56. package/dist/server/usePluginRoute.d.ts +18 -0
  57. package/dist/server/usePluginRoute.mjs +14 -0
  58. package/dist/source/export.d.ts +18 -0
  59. package/dist/source/import.d.ts +55 -0
  60. package/dist/source/import.mjs +4 -0
  61. package/dist/source/index.d.ts +2 -0
  62. package/dist/source/index.mjs +3 -2
  63. package/dist/store/index.d.ts +45 -45
  64. package/dist/style/cssLayers.d.ts +18 -0
  65. package/dist/style/cssLayers.mjs +14 -0
  66. package/dist/style/index.d.ts +1 -0
  67. package/dist/style/index.mjs +11 -10
  68. package/dist/style/styleConstants.d.ts +10 -2
  69. package/dist/style/styleConstants.mjs +16 -0
  70. package/dist/style/useDisplayMode.d.ts +11 -0
  71. package/dist/style/useDisplayMode.mjs +18 -0
  72. package/dist/types/ActionTypes.d.ts +3 -3
  73. package/dist/types/ComponentTypes.d.ts +13 -0
  74. package/dist/types/DataTypes.d.ts +36 -0
  75. package/dist/types/InteractionTypes.d.ts +16 -2
  76. package/dist/types/SchemaTypes.d.ts +10 -2
  77. package/dist/types/SchemaTypes.mjs +2 -1
  78. package/dist/types/ServerTypes.d.ts +60 -8
  79. package/dist/types/StoreTypes.d.ts +19 -6
  80. package/dist/types/index.d.ts +1 -2
  81. package/package.json +58 -28
  82. package/setupTests.ts +16 -13
  83. package/dist/types/AITypes.d.ts +0 -80
  84. package/dist/types/McpTypes/index.d.ts +0 -56
  85. package/dist/types/McpTypes/index.mjs +0 -0
  86. /package/dist/types/{AITypes.mjs → DataTypes.mjs} +0 -0
@@ -6,3 +6,14 @@
6
6
  */
7
7
  export declare const ANCHOR_PATTERN: RegExp;
8
8
  export declare const isAnchor: (value: unknown) => value is string;
9
+ /**
10
+ * The anchor a piece of text reads as: its words, accents dropped and lowercased, a hyphen for every run of anything
11
+ * else, and nothing before the first letter — `Server-resolved data` is `server-resolved-data`. What a Markdown
12
+ * heading's `id` is, and what authoring offers an element that needs an anchor.
13
+ */
14
+ export declare const anchorOf: (text: string) => string;
15
+ /**
16
+ * The anchor `text` takes on a page that already carries `taken` — `faq`, then `faq-2`, `faq-3` — recorded in `taken`,
17
+ * so the next heading of the same words gets the next one. A page renders its headings in order, and so numbers them.
18
+ */
19
+ export declare const uniqueAnchor: (text: string, taken: Set<string>) => string;
@@ -1,4 +1,8 @@
1
1
  //#region src/schema/anchor.ts
2
- var e = /^[a-z][a-z0-9-]*$/, t = (t) => typeof t == "string" && e.test(t);
2
+ var e = /^[a-z][a-z0-9-]*$/, t = (t) => typeof t == "string" && e.test(t), n = (e) => e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^[^a-z]+|-+$/g, "") || "section", r = (e, t) => {
3
+ let r = n(e), i = r;
4
+ for (let e = 2; t.has(i); e += 1) i = `${r}-${String(e)}`;
5
+ return t.add(i), i;
6
+ };
3
7
  //#endregion
4
- export { e as ANCHOR_PATTERN, t as isAnchor };
8
+ export { e as ANCHOR_PATTERN, n as anchorOf, t as isAnchor, r as uniqueAnchor };
@@ -1,7 +1,7 @@
1
1
  import e from "./SchemaContext.mjs";
2
- import { ANCHOR_PATTERN as t, isAnchor as n } from "./anchor.mjs";
3
- import { COMPONENT_PROPS_SOURCE as r, EMPTY_SCHEMA as i, VARIABLE_REGEX as a } from "./schemaConstants.mjs";
4
- import { findLayoutCycle as o, resolveLayoutChain as s } from "./layoutChain.mjs";
5
- import { collectServerElements as c, hasServerElements as l } from "./serverElements.mjs";
6
- import { isSnippet as u } from "./snippet.mjs";
7
- export { t as ANCHOR_PATTERN, r as COMPONENT_PROPS_SOURCE, i as EMPTY_SCHEMA, e as SchemaContext, a as VARIABLE_REGEX, c as collectServerElements, o as findLayoutCycle, l as hasServerElements, n as isAnchor, u as isSnippet, s as resolveLayoutChain };
2
+ import { ANCHOR_PATTERN as t, anchorOf as n, isAnchor as r, uniqueAnchor as i } from "./anchor.mjs";
3
+ import { COMPONENT_PROPS_SOURCE as a, EMPTY_SCHEMA as o, VARIABLE_REGEX as s } from "./schemaConstants.mjs";
4
+ import { findLayoutCycle as c, resolveLayoutChain as l } from "./layoutChain.mjs";
5
+ import { collectServerElements as u, hasServerElements as d } from "./serverElements.mjs";
6
+ import { isSnippet as f } from "./snippet.mjs";
7
+ export { t as ANCHOR_PATTERN, a as COMPONENT_PROPS_SOURCE, o as EMPTY_SCHEMA, e as SchemaContext, s as VARIABLE_REGEX, n as anchorOf, u as collectServerElements, c as findLayoutCycle, d as hasServerElements, r as isAnchor, f as isSnippet, l as resolveLayoutChain, i as uniqueAnchor };
@@ -0,0 +1,13 @@
1
+ export type MarkdownHeading = {
2
+ level: number;
3
+ text: string;
4
+ anchor: string;
5
+ };
6
+ /** A heading's words as a reader sees them: the inline Markdown around them taken away, as the renderer takes it. */
7
+ export declare const headingText: (source: string) => string;
8
+ /**
9
+ * Every heading of a Markdown document, in order, with the anchor its `id` is when it renders — what a table of
10
+ * contents links to, and what a link's `hash` may name. ATX headings (`## Title`), outside fenced code; every level
11
+ * shares one set of anchors, as the rendered page does.
12
+ */
13
+ export declare const markdownHeadings: (source: string) => MarkdownHeading[];
@@ -0,0 +1,24 @@
1
+ import { uniqueAnchor as e } from "./anchor.mjs";
2
+ //#region src/schema/markdownHeadings.ts
3
+ var t = /^ {0,3}(`{3,}|~{3,})/, n = /^ {0,3}(#{1,6})[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/, r = (e) => e.replace(/!\[[^\]]*\]\([^)]*\)/g, "").replace(/<[^>]+>/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`+([^`]*?)`+/g, "$1").replace(/(\*\*|~~)(.+?)\1/g, "$2").replace(/\*(.+?)\*/g, "$1").replace(/\b__(.+?)__\b/g, "$1").replace(/\b_(.+?)_\b/g, "$1").replace(/\\([\\`*_{}[\]()#+\-.!|~>])/g, "$1").trim(), i = (i) => {
4
+ let a = /* @__PURE__ */ new Set(), o = [], s;
5
+ for (let c of i.split("\n")) {
6
+ let i = t.exec(c)?.[1];
7
+ if (i) {
8
+ s ? i[0] === s[0] && i.length >= s.length && (s = void 0) : s = i;
9
+ continue;
10
+ }
11
+ let l = s ? null : n.exec(c);
12
+ if (l) {
13
+ let t = r(l[2]);
14
+ o.push({
15
+ level: l[1].length,
16
+ text: t,
17
+ anchor: e(t, a)
18
+ });
19
+ }
20
+ }
21
+ return o;
22
+ };
23
+ //#endregion
24
+ export { r as headingText, i as markdownHeadings };
@@ -7,20 +7,27 @@
7
7
  * The one description the authoring package, the builder's Motion tab, the MCP and the validator all read; the
8
8
  * stylesheet mirrors its presets and frames, and a test in `apps/sdk` holds the two together.
9
9
  */
10
- export declare const MOTION_ENTERS: readonly ["fade", "fade-up", "fade-down", "slide-left", "slide-right", "scale"];
10
+ export declare const MOTION_ENTERS: readonly ["fade", "fade-up", "fade-down", "slide-left", "slide-right", "slide-up", "scale", "zoom-in", "zoom-out", "pop", "bounce-in", "tilt", "spin-in"];
11
11
  export type MotionEnter = (typeof MOTION_ENTERS)[number];
12
- /** As the page loads, or as the element scrolls into view — tied to the scroll, so it plays at the reader's pace. */
13
- export declare const MOTION_TRIGGERS: readonly ["load", "view"];
12
+ /**
13
+ * When an arrival plays: as the page loads (`load`); once, as the element first comes into view, and then it stays
14
+ * (`view`); or with the scroll itself, at the reader's pace — played backwards when the reader scrolls back up past it
15
+ * (`scroll`).
16
+ */
17
+ export declare const MOTION_TRIGGERS: readonly ["load", "view", "scroll"];
14
18
  export type MotionTrigger = (typeof MOTION_TRIGGERS)[number];
15
- /** A motion that repeats: a gentle rise and fall, a breath, a turn, a sway. Held until the page is live. */
16
- export declare const MOTION_LOOPS: readonly ["float", "pulse", "spin", "sway"];
19
+ /**
20
+ * A motion that repeats: a gentle rise and fall, a breath, a turn, a sway — a bounce, a wobble, a small orbit, a
21
+ * heartbeat, a drift. Held until the page is live.
22
+ */
23
+ export declare const MOTION_LOOPS: readonly ["float", "pulse", "spin", "sway", "bounce", "wobble", "orbit", "heartbeat", "drift"];
17
24
  export type MotionLoop = (typeof MOTION_LOOPS)[number];
18
25
  export interface ElementMotion {
19
26
  /** How it arrives. */
20
27
  enter?: MotionEnter;
21
- /** When it arrives: `load` (the default) or `view`. */
28
+ /** When it arrives: `load` (the default), `view` (once, as it comes into view) or `scroll` (with the scroll). */
22
29
  on?: MotionTrigger;
23
- /** How long it takes to arrive, in ms (600 by default). Ignored under `view`, which follows the scroll. */
30
+ /** How long it takes to arrive, in ms (600 by default). Ignored under `scroll`, which follows the scroll. */
24
31
  duration?: number;
25
32
  /** How long it waits before it does, in ms. */
26
33
  delay?: number;
@@ -35,19 +42,35 @@ export interface ElementMotion {
35
42
  /** How long an arrival takes when it does not say, and the curve every arrival follows: quick out, gentle in. */
36
43
  export declare const MOTION_DEFAULT_DURATION = 600;
37
44
  export declare const MOTION_ENTER_EASING = "cubic-bezier(0.2, 0.7, 0.2, 1)";
38
- /** Where each arrival starts from; it ends where the element is. */
39
- export declare const MOTION_ENTER_FROM: Record<MotionEnter, {
40
- opacity: number;
45
+ /**
46
+ * One frame of an arrival, `at` a percentage of its duration. It moves the individual `translate`, `scale` and `rotate`
47
+ * properties — never `transform` — so it composes with a `transform` the element has of its own and with a loop.
48
+ */
49
+ export interface MotionEnterFrame {
50
+ at: number;
51
+ opacity?: number;
41
52
  translate?: string;
42
53
  scale?: string;
43
- }>;
54
+ rotate?: string;
55
+ }
44
56
  /**
45
- * Each loop's one moving frame — its `transform` halfway through the period and back (`middle`), or at the end of
46
- * one that keeps turning (`end`) — and its period and curve.
57
+ * Each arrival's frames, from where it starts (`at: 0`) through any it passes on the way — an overshoot, a bounce. It
58
+ * always ends where the element is, which is why no frame says so.
47
59
  */
48
- export declare const MOTION_LOOP_FRAMES: Record<MotionLoop, {
60
+ export declare const MOTION_ENTER_FRAMES: Record<MotionEnter, MotionEnterFrame[]>;
61
+ /** Where each arrival starts from — its first frame. */
62
+ export declare const MOTION_ENTER_FROM: Record<MotionEnter, Omit<MotionEnterFrame, "at">>;
63
+ /** One frame of a loop: its `transform` at a percentage of its period. A frame no loop names is the element at rest. */
64
+ export interface MotionLoopFrame {
65
+ at: number;
49
66
  transform: string;
50
- at: 'middle' | 'end';
67
+ }
68
+ /**
69
+ * Each loop's frames, its period and its curve. A loop that swings starts and ends at rest; one that keeps turning
70
+ * (`spin`) ends a full turn on, which is the same place.
71
+ */
72
+ export declare const MOTION_LOOP_FRAMES: Record<MotionLoop, {
73
+ frames: MotionLoopFrame[];
51
74
  periodMs: number;
52
75
  easing: string;
53
76
  }>;
@@ -72,6 +95,15 @@ export declare const MOVING_SELECTOR = "[data-motion-enter], [data-motion-stagge
72
95
  * never is.
73
96
  */
74
97
  export declare const MOTION_STILL_CSS = "[data-motion-enter], [data-motion-stagger] > *, [data-motion-loop] { animation: none !important; }";
98
+ /** The attribute an arrival waiting to be seen (`on: 'view'`) gets once it has been, and then keeps (`revealOnView`). */
99
+ export declare const MOTION_SEEN_ATTRIBUTE = "data-motion-seen";
100
+ /** Every element whose arrival waits to be seen: what `revealOnView` watches. */
101
+ export declare const MOTION_VIEW_SELECTOR = "[data-motion-on=\"view\"]";
102
+ /**
103
+ * Every arrival waiting to be seen, played as if it had been: a surface with nobody scrolling it and no SDK root to
104
+ * watch it — a preview of an element, a thumbnail — would hold it at its start, unseen.
105
+ */
106
+ export declare const MOTION_SEEN_CSS = "[data-motion-on=\"view\"][data-motion-enter], [data-motion-on=\"view\"][data-motion-stagger] > * { animation-play-state: running, running !important; }";
75
107
  export declare const MOTION_PLAY_CSS: string;
76
108
  /** Whether an animation is one of the declared motion's — what replaying the canvas restarts, and nothing else. */
77
109
  export declare const isMotionAnimation: (animation: object) => boolean;
@@ -6,81 +6,253 @@ var t = [
6
6
  "fade-down",
7
7
  "slide-left",
8
8
  "slide-right",
9
- "scale"
10
- ], n = ["load", "view"], r = [
9
+ "slide-up",
10
+ "scale",
11
+ "zoom-in",
12
+ "zoom-out",
13
+ "pop",
14
+ "bounce-in",
15
+ "tilt",
16
+ "spin-in"
17
+ ], n = [
18
+ "load",
19
+ "view",
20
+ "scroll"
21
+ ], r = [
11
22
  "float",
12
23
  "pulse",
13
24
  "spin",
14
- "sway"
25
+ "sway",
26
+ "bounce",
27
+ "wobble",
28
+ "orbit",
29
+ "heartbeat",
30
+ "drift"
15
31
  ], i = 600, a = "cubic-bezier(0.2, 0.7, 0.2, 1)", o = {
16
- fade: { opacity: 0 },
17
- "fade-up": {
32
+ fade: [{
33
+ at: 0,
34
+ opacity: 0
35
+ }],
36
+ "fade-up": [{
37
+ at: 0,
18
38
  opacity: 0,
19
39
  translate: "0 24px"
20
- },
21
- "fade-down": {
40
+ }],
41
+ "fade-down": [{
42
+ at: 0,
22
43
  opacity: 0,
23
44
  translate: "0 -24px"
24
- },
25
- "slide-left": {
45
+ }],
46
+ "slide-left": [{
47
+ at: 0,
26
48
  opacity: 0,
27
49
  translate: "32px 0"
28
- },
29
- "slide-right": {
50
+ }],
51
+ "slide-right": [{
52
+ at: 0,
30
53
  opacity: 0,
31
54
  translate: "-32px 0"
32
- },
33
- scale: {
55
+ }],
56
+ "slide-up": [{
57
+ at: 0,
58
+ opacity: 0,
59
+ translate: "0 72px"
60
+ }],
61
+ scale: [{
62
+ at: 0,
34
63
  opacity: 0,
35
64
  scale: "0.94"
36
- }
37
- }, s = {
65
+ }],
66
+ "zoom-in": [{
67
+ at: 0,
68
+ opacity: 0,
69
+ scale: "0.6"
70
+ }],
71
+ "zoom-out": [{
72
+ at: 0,
73
+ opacity: 0,
74
+ scale: "1.25"
75
+ }],
76
+ pop: [
77
+ {
78
+ at: 0,
79
+ opacity: 0,
80
+ scale: "0.5"
81
+ },
82
+ {
83
+ at: 55,
84
+ opacity: 1,
85
+ scale: "1.08"
86
+ },
87
+ {
88
+ at: 78,
89
+ scale: "0.97"
90
+ }
91
+ ],
92
+ "bounce-in": [
93
+ {
94
+ at: 0,
95
+ opacity: 0,
96
+ translate: "0 -64px"
97
+ },
98
+ {
99
+ at: 55,
100
+ opacity: 1,
101
+ translate: "0 10px"
102
+ },
103
+ {
104
+ at: 75,
105
+ translate: "0 -5px"
106
+ },
107
+ {
108
+ at: 90,
109
+ translate: "0 2px"
110
+ }
111
+ ],
112
+ tilt: [{
113
+ at: 0,
114
+ opacity: 0,
115
+ translate: "0 32px",
116
+ rotate: "-6deg"
117
+ }],
118
+ "spin-in": [{
119
+ at: 0,
120
+ opacity: 0,
121
+ scale: "0.4",
122
+ rotate: "-180deg"
123
+ }]
124
+ }, s = Object.fromEntries(t.map((e) => {
125
+ let [{ at: t, ...n }] = o[e];
126
+ return [e, n];
127
+ })), c = (e, t) => {
128
+ let n = t * 2 * Math.PI, r = Math.round(Math.sin(n) * e * 10) / 10, i = Math.round(-Math.cos(n) * e * 10) / 10;
129
+ return `translate(${String(r)}px, ${String(i)}px)`;
130
+ }, l = {
38
131
  float: {
39
- transform: "translateY(-8px)",
40
- at: "middle",
132
+ frames: [{
133
+ at: 50,
134
+ transform: "translateY(-8px)"
135
+ }],
41
136
  periodMs: 6e3,
42
137
  easing: "ease-in-out"
43
138
  },
44
139
  pulse: {
45
- transform: "scale(1.04)",
46
- at: "middle",
140
+ frames: [{
141
+ at: 50,
142
+ transform: "scale(1.04)"
143
+ }],
47
144
  periodMs: 3e3,
48
145
  easing: "ease-in-out"
49
146
  },
50
147
  spin: {
51
- transform: "rotate(360deg)",
52
- at: "end",
148
+ frames: [{
149
+ at: 100,
150
+ transform: "rotate(360deg)"
151
+ }],
53
152
  periodMs: 12e3,
54
153
  easing: "linear"
55
154
  },
56
155
  sway: {
57
- transform: "rotate(2deg)",
58
- at: "middle",
156
+ frames: [{
157
+ at: 50,
158
+ transform: "rotate(2deg)"
159
+ }],
59
160
  periodMs: 5e3,
60
161
  easing: "ease-in-out"
162
+ },
163
+ bounce: {
164
+ frames: [
165
+ {
166
+ at: 0,
167
+ transform: "translateY(0) scale(1.03, 0.97)"
168
+ },
169
+ {
170
+ at: 45,
171
+ transform: "translateY(-14px) scale(0.98, 1.02)"
172
+ },
173
+ {
174
+ at: 55,
175
+ transform: "translateY(-14px) scale(0.98, 1.02)"
176
+ },
177
+ {
178
+ at: 100,
179
+ transform: "translateY(0) scale(1.03, 0.97)"
180
+ }
181
+ ],
182
+ periodMs: 1400,
183
+ easing: "ease-in-out"
184
+ },
185
+ wobble: {
186
+ frames: [{
187
+ at: 25,
188
+ transform: "rotate(-5deg)"
189
+ }, {
190
+ at: 75,
191
+ transform: "rotate(5deg)"
192
+ }],
193
+ periodMs: 2400,
194
+ easing: "ease-in-out"
195
+ },
196
+ orbit: {
197
+ frames: Array.from({ length: 9 }, (e, t) => ({
198
+ at: t * 100 / 8,
199
+ transform: c(6, t / 8)
200
+ })),
201
+ periodMs: 8e3,
202
+ easing: "linear"
203
+ },
204
+ heartbeat: {
205
+ frames: [
206
+ {
207
+ at: 14,
208
+ transform: "scale(1.1)"
209
+ },
210
+ {
211
+ at: 28,
212
+ transform: "scale(1)"
213
+ },
214
+ {
215
+ at: 42,
216
+ transform: "scale(1.07)"
217
+ },
218
+ {
219
+ at: 70,
220
+ transform: "scale(1)"
221
+ }
222
+ ],
223
+ periodMs: 1600,
224
+ easing: "ease-in-out"
225
+ },
226
+ drift: {
227
+ frames: [{
228
+ at: 50,
229
+ transform: "translateX(12px)"
230
+ }],
231
+ periodMs: 7e3,
232
+ easing: "ease-in-out"
61
233
  }
62
- }, c = 1e4, l = (e, t) => typeof t == "string" && e.includes(t), u = /* @__PURE__ */ new Set([
234
+ }, u = 1e4, d = (e, t) => typeof t == "string" && e.includes(t), f = /* @__PURE__ */ new Set([
63
235
  "enter",
64
236
  "on",
65
237
  "duration",
66
238
  "delay",
67
239
  "stagger",
68
240
  "loop"
69
- ]), d = (i) => {
70
- if (!e(i)) return ["motion is an object: `{ enter: 'fade-up', on: 'view' }`"];
241
+ ]), p = (i) => {
242
+ if (!e(i)) return ["motion is an object: `{ enter: \"fade-up\", on: \"view\" }`"];
71
243
  let a = [];
72
- for (let e of Object.keys(i)) u.has(e) || a.push(`motion has no "${e}" — it takes enter, on, duration, delay, stagger and loop`);
73
- i.enter !== void 0 && !l(t, i.enter) && a.push(`motion.enter is one of ${t.join(", ")}`), i.on !== void 0 && !l(n, i.on) && a.push(`motion.on is ${n.join(" or ")}`), i.loop !== void 0 && !l(r, i.loop) && a.push(`motion.loop is one of ${r.join(", ")}`);
244
+ for (let e of Object.keys(i)) f.has(e) || a.push(`motion has no "${e}" — it takes enter, on, duration, delay, stagger and loop`);
245
+ i.enter !== void 0 && !d(t, i.enter) && a.push(`motion.enter is one of ${t.join(", ")}`), i.on !== void 0 && !d(n, i.on) && a.push(`motion.on is ${n.slice(0, -1).join(", ")} or ${String(n.at(-1))}`), i.loop !== void 0 && !d(r, i.loop) && a.push(`motion.loop is one of ${r.join(", ")}`);
74
246
  for (let e of [
75
247
  "duration",
76
248
  "delay",
77
249
  "stagger"
78
250
  ]) {
79
251
  let t = i[e];
80
- t !== void 0 && (typeof t != "number" || !Number.isFinite(t) || t < 0 || t > 1e4) && a.push(`motion.${e} is a number of ms from 0 to ${String(c)}`);
252
+ t !== void 0 && (typeof t != "number" || !Number.isFinite(t) || t < 0 || t > 1e4) && a.push(`motion.${e} is a number of ms from 0 to ${String(u)}`);
81
253
  }
82
254
  return i.enter === void 0 && i.loop === void 0 && a.push("motion says nothing to play: give it an `enter`, a `loop`, or both"), i.stagger !== void 0 && i.enter === void 0 && a.push("motion.stagger staggers the children’s `enter`: give it one"), a;
83
- }, f = (e) => d(e).length === 0, p = (e) => {
255
+ }, m = (e) => p(e).length === 0, h = (e) => {
84
256
  if (!e) return {
85
257
  attributes: {},
86
258
  style: {}
@@ -90,6 +262,10 @@ var t = [
90
262
  attributes: t,
91
263
  style: n
92
264
  };
93
- }, m = "[data-motion-enter], [data-motion-stagger] > *, [data-motion-loop]", h = `${m} { animation: none !important; }`, g = ["[data-motion-loop] { animation-play-state: running, running !important; }", "[data-motion-on=\"view\"][data-motion-enter], [data-motion-on=\"view\"][data-motion-stagger] > * { animation-timeline: auto, auto !important; }"].join("\n"), _ = (e) => "animationName" in e && typeof e.animationName == "string" && e.animationName.startsWith("plitzi-motion-");
265
+ }, g = "[data-motion-enter], [data-motion-stagger] > *, [data-motion-loop]", _ = `${g} { animation: none !important; }`, v = "data-motion-seen", y = "[data-motion-on=\"view\"]", b = "[data-motion-on=\"view\"][data-motion-enter], [data-motion-on=\"view\"][data-motion-stagger] > * { animation-play-state: running, running !important; }", x = [
266
+ "[data-motion-loop] { animation-play-state: running, running !important; }",
267
+ b,
268
+ "[data-motion-on=\"scroll\"][data-motion-enter], [data-motion-on=\"scroll\"][data-motion-stagger] > * { animation-timeline: auto, auto !important; }"
269
+ ].join("\n"), S = (e) => "animationName" in e && typeof e.animationName == "string" && e.animationName.startsWith("plitzi-motion-");
94
270
  //#endregion
95
- export { i as MOTION_DEFAULT_DURATION, t as MOTION_ENTERS, a as MOTION_ENTER_EASING, o as MOTION_ENTER_FROM, r as MOTION_LOOPS, s as MOTION_LOOP_FRAMES, c as MOTION_MAX_MS, g as MOTION_PLAY_CSS, h as MOTION_STILL_CSS, n as MOTION_TRIGGERS, m as MOVING_SELECTOR, f as isMotion, _ as isMotionAnimation, p as motionAttributes, d as motionProblems };
271
+ export { i as MOTION_DEFAULT_DURATION, t as MOTION_ENTERS, a as MOTION_ENTER_EASING, o as MOTION_ENTER_FRAMES, s as MOTION_ENTER_FROM, r as MOTION_LOOPS, l as MOTION_LOOP_FRAMES, u as MOTION_MAX_MS, x as MOTION_PLAY_CSS, v as MOTION_SEEN_ATTRIBUTE, b as MOTION_SEEN_CSS, _ as MOTION_STILL_CSS, n as MOTION_TRIGGERS, y as MOTION_VIEW_SELECTOR, g as MOVING_SELECTOR, m as isMotion, S as isMotionAnimation, h as motionAttributes, p as motionProblems };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Plays every arrival under `root` that waits to be seen (`motion: { on: 'view' }`) the first time it comes into view,
3
+ * and never again: the stylesheet holds it at its start until the element carries `data-motion-seen`, which this sets
4
+ * and nothing takes off. Elements added later — a page navigated to, a list's new rows — are watched as they arrive.
5
+ * Answers the function that stops watching.
6
+ *
7
+ * One observer for the whole tree rather than one per element: a page of cards is hundreds of them. A browser without
8
+ * `IntersectionObserver` shows each arrival at once, as one that cannot know what is on screen.
9
+ */
10
+ export declare const revealOnView: (root: Element) => (() => void);
@@ -0,0 +1,23 @@
1
+ import { MOTION_SEEN_ATTRIBUTE as e, MOTION_VIEW_SELECTOR as t } from "./motion.mjs";
2
+ //#region src/schema/motionReveal.ts
3
+ var n = `${t}:not([${e}])`, r = (t) => {
4
+ let r = (t) => t.setAttribute(e, ""), i = (e) => [...e.matches(n) ? [e] : [], ...Array.from(e.querySelectorAll(n))];
5
+ if (typeof Reflect.get(globalThis, "IntersectionObserver") != "function") return i(t).forEach(r), () => void 0;
6
+ let a = new IntersectionObserver((e) => {
7
+ for (let t of e) t.isIntersecting && (r(t.target), a.unobserve(t.target));
8
+ }), o = (e) => i(e).forEach((e) => a.observe(e)), s = new MutationObserver((e) => {
9
+ for (let t of e) t.type === "attributes" && t.target instanceof Element && o(t.target), t.addedNodes.forEach((e) => {
10
+ e instanceof Element && o(e);
11
+ });
12
+ });
13
+ return o(t), s.observe(t, {
14
+ childList: !0,
15
+ subtree: !0,
16
+ attributes: !0,
17
+ attributeFilter: ["data-motion-on"]
18
+ }), () => {
19
+ a.disconnect(), s.disconnect();
20
+ };
21
+ };
22
+ //#endregion
23
+ export { r as revealOnView };
@@ -0,0 +1,12 @@
1
+ import { Schema } from '../types';
2
+ /**
3
+ * The element types a page can draw — what decides which plugins a page has to have before it hydrates, and which can
4
+ * wait until a page that draws them is opened.
5
+ *
6
+ * Generous on purpose, because the two mistakes do not cost the same: a type counted that is never drawn only loads a
7
+ * plugin early, while one missed hydrates a page without the component the server drew. So it walks the page and
8
+ * every shell around it, into every component an instance names and every element a reference copies, and it counts
9
+ * what a flag or a visibility binding might hide: those are decided as the page renders, and may change while it is
10
+ * open. A `custom` element counts as the plugin it names (`renderType`), which is what it renders.
11
+ */
12
+ export declare const pageElementTypes: (schema: Schema, pageId: string) => Set<string>;
@@ -0,0 +1,41 @@
1
+ import { resolveLayoutChain as e } from "./layoutChain.mjs";
2
+ //#region src/schema/pageElements.ts
3
+ var t = (e) => typeof e == "string" ? e : "", n = (n, r) => {
4
+ let i = /* @__PURE__ */ new Set(), a = n.flat[r];
5
+ if (!a) return i;
6
+ let o = [r, ...e((e) => n.flat[e], t(a.attributes.layout), t(a.attributes.layoutContainer)).map((e) => e.layout)].map((e) => ({
7
+ flat: n.flat,
8
+ id: e
9
+ })), s = /* @__PURE__ */ new Map();
10
+ for (; o.length > 0;) {
11
+ let e = o.pop();
12
+ if (!e) break;
13
+ let { flat: r, id: a } = e, c = s.get(r) ?? /* @__PURE__ */ new Set();
14
+ s.set(r, c);
15
+ let l = r[a];
16
+ if (!l || c.has(a)) continue;
17
+ c.add(a);
18
+ let { type: u, items: d } = l.definition;
19
+ i.add(u);
20
+ let f = t(l.attributes.renderType);
21
+ u === "custom" && f && i.add(f);
22
+ let p = t(l.attributes.referenceId);
23
+ if (u === "reference" && p) {
24
+ let e = l.attributes.referenceType === "component" ? n.components[p] : void 0;
25
+ o.push(e ? {
26
+ flat: e.flat,
27
+ id: e.rootId
28
+ } : {
29
+ flat: n.flat,
30
+ id: p
31
+ });
32
+ }
33
+ d && o.push(...d.map((e) => ({
34
+ flat: r,
35
+ id: e
36
+ })));
37
+ }
38
+ return i;
39
+ };
40
+ //#endregion
41
+ export { n as pageElementTypes };
@@ -10,11 +10,11 @@ var e = (e) => ({
10
10
  ...typeof e.stagger == "number" ? { stagger: e.stagger } : {},
11
11
  ...e.loop ? { loop: e.loop } : {}
12
12
  }), n = ({ definition: e, ...n }) => {
13
- let { parentId: r, items: i, bindings: a, interactions: o, initialState: s, runtime: c, loadStrategy: l, flag: u, anchor: d, motion: f, ...p } = e;
13
+ let { parentId: r, items: i, bindings: a, interactions: o, initialState: s, runtime: c, loadStrategy: l, flag: u, anchor: d, motion: f, quiet: p, ...m } = e;
14
14
  return {
15
15
  ...n,
16
16
  definition: {
17
- ...p,
17
+ ...m,
18
18
  ...r == null ? {} : { parentId: r },
19
19
  ...i == null ? {} : { items: i },
20
20
  ...a == null ? {} : { bindings: a },
@@ -24,7 +24,8 @@ var e = (e) => ({
24
24
  ...l == null ? {} : { loadStrategy: l },
25
25
  ...u == null ? {} : { flag: u },
26
26
  ...d == null ? {} : { anchor: d },
27
- ...f == null ? {} : { motion: t(f) }
27
+ ...f == null ? {} : { motion: t(f) },
28
+ ...p == null ? {} : { quiet: p }
28
29
  }
29
30
  };
30
31
  }, r = (e) => ({
@@ -1,5 +1,5 @@
1
1
  import e from "./actions/useActionsSync.mjs";
2
- import t, { currentRscLocation as n, rscDataPath as r } from "./rsc/refreshRsc.mjs";
3
- import i from "./rsc/useRscRefresh.mjs";
4
- import a from "./rsc/useRscSync.mjs";
5
- export { n as currentRscLocation, t as refreshRsc, r as rscDataPath, e as useActionsSync, i as useRscRefresh, a as useRscSync };
2
+ import t, { cancelRsc as n, currentRscLocation as r, releaseRscRequests as i, rscDataPath as a } from "./rsc/refreshRsc.mjs";
3
+ import o from "./rsc/useRscRefresh.mjs";
4
+ import s from "./rsc/useRscSync.mjs";
5
+ export { n as cancelRsc, r as currentRscLocation, t as refreshRsc, i as releaseRscRequests, a as rscDataPath, e as useActionsSync, o as useRscRefresh, s as useRscSync };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Where a project's own data answers: a provider whose `query` is `/data/<file>` reads `<file>` from the folder the
3
+ * server keeps it in (`dataDir`), which is never served — so only a provider resolved on the server reads it. The
4
+ * server's resolver and the authoring check that refuses a browser read hold the same prefix.
5
+ */
6
+ export declare const PROJECT_DATA_PREFIX = "/data/";
@@ -0,0 +1,4 @@
1
+ //#region src/server/rsc/projectData.ts
2
+ var e = "/data/";
3
+ //#endregion
4
+ export { e as PROJECT_DATA_PREFIX };