@hyperframes/sdk 0.7.46 → 0.7.48
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/adapters/types.d.ts +8 -0
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/engine/apply-patches.d.ts.map +1 -1
- package/dist/engine/apply-patches.js +46 -39
- package/dist/engine/apply-patches.js.map +1 -1
- package/dist/engine/model.d.ts +8 -0
- package/dist/engine/model.d.ts.map +1 -1
- package/dist/engine/model.js +17 -2
- package/dist/engine/model.js.map +1 -1
- package/dist/engine/mutate.d.ts.map +1 -1
- package/dist/engine/mutate.js +193 -66
- package/dist/engine/mutate.js.map +1 -1
- package/dist/engine/patches.d.ts +4 -2
- package/dist/engine/patches.d.ts.map +1 -1
- package/dist/engine/patches.js +14 -3
- package/dist/engine/patches.js.map +1 -1
- package/dist/engine/variableModel.d.ts +41 -33
- package/dist/engine/variableModel.d.ts.map +1 -1
- package/dist/engine/variableModel.js +96 -75
- package/dist/engine/variableModel.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +125 -13
- package/dist/session.js.map +1 -1
- package/dist/types.d.ts +94 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patches.d.ts","sourceRoot":"","sources":["../../src/engine/patches.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"patches.d.ts","sourceRoot":"","sources":["../../src/engine/patches.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAmB3D,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAA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,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAErD;AAED,uFAAuF;AACvF,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EACtD,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAClC;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAIhD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,GAChB;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAIhD;AAED,wDAAwD;AACxD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAClC;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAKhD"}
|
package/dist/engine/patches.js
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* /elements/{hfId}/timing/{start|end|duration|trackIndex} ← end = computed absolute data-end
|
|
9
9
|
* /elements/{hfId}/hold/{start|end|fill}
|
|
10
10
|
* /elements/{hfId} ← whole subtree (removeElement)
|
|
11
|
-
* /variables/{variableId}
|
|
11
|
+
* /variables/{variableId} ← declaration's default value
|
|
12
|
+
* /variableDeclarations/{variableId} ← whole declaration object
|
|
12
13
|
* /metadata/{width|height|duration}
|
|
13
14
|
* /script/gsap ← GSAP inline script textContent
|
|
14
15
|
* /style/css ← <style> element textContent
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
* /elements/hf-x/hold/start → "hf-x.hold.start"
|
|
22
23
|
* /elements/hf-x → "hf-x" (null = removal marker)
|
|
23
24
|
* /variables/brand-color-primary → "var.brand-color-primary"
|
|
25
|
+
* /variableDeclarations/brand-color-primary → "varDecl.brand-color-primary"
|
|
24
26
|
* /metadata/width → "meta.width"
|
|
25
27
|
* /script/gsap → "script.gsap"
|
|
26
28
|
* /style/css → "style.css"
|
|
@@ -62,9 +64,9 @@ export function elementPath(id) {
|
|
|
62
64
|
export function variablePath(id) {
|
|
63
65
|
return `/variables/${id}`;
|
|
64
66
|
}
|
|
65
|
-
/**
|
|
67
|
+
/** Whole-declaration path — distinct from /variables/{id}, which is the default *value*. */
|
|
66
68
|
export function variableDeclPath(id) {
|
|
67
|
-
return `/
|
|
69
|
+
return `/variableDeclarations/${id}`;
|
|
68
70
|
}
|
|
69
71
|
export function metaPath(field) {
|
|
70
72
|
return `/metadata/${field}`;
|
|
@@ -107,6 +109,10 @@ export function pathToKey(path) {
|
|
|
107
109
|
const elemMatch = /^\/elements\/([^/]+)$/.exec(path);
|
|
108
110
|
if (elemMatch)
|
|
109
111
|
return decodePathSegment(elemMatch[1]);
|
|
112
|
+
// /variableDeclarations/{id} → "varDecl.{id}" (checked before /variables/)
|
|
113
|
+
const varDeclMatch = /^\/variableDeclarations\/(.+)$/.exec(path);
|
|
114
|
+
if (varDeclMatch)
|
|
115
|
+
return `varDecl.${varDeclMatch[1]}`;
|
|
110
116
|
// /variables/{id} → "var.{id}"
|
|
111
117
|
const varMatch = /^\/variables\/(.+)$/.exec(path);
|
|
112
118
|
if (varMatch)
|
|
@@ -127,6 +133,8 @@ export function pathToKey(path) {
|
|
|
127
133
|
* Inverse of pathToKey — maps an override-set key back to its RFC 6902 path.
|
|
128
134
|
* Used to replay a stored override-set onto a fresh base document (T3 init).
|
|
129
135
|
*/
|
|
136
|
+
// Exhaustive key-family dispatcher — same shape as apply-patches.ts parsePath.
|
|
137
|
+
// fallow-ignore-next-line complexity
|
|
130
138
|
export function keyToPath(key) {
|
|
131
139
|
const style = /^([^.]+)\.style\.(.+)$/.exec(key);
|
|
132
140
|
if (style?.[1] && style[2])
|
|
@@ -146,6 +154,9 @@ export function keyToPath(key) {
|
|
|
146
154
|
const hold = /^([^.]+)\.hold\.(start|end|fill)$/.exec(key);
|
|
147
155
|
if (hold?.[1])
|
|
148
156
|
return holdPath(hold[1], hold[2]);
|
|
157
|
+
const varDecl = /^varDecl\.(.+)$/.exec(key);
|
|
158
|
+
if (varDecl?.[1])
|
|
159
|
+
return variableDeclPath(varDecl[1]);
|
|
149
160
|
const variable = /^var\.(.+)$/.exec(key);
|
|
150
161
|
if (variable?.[1])
|
|
151
162
|
return variablePath(variable[1]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patches.js","sourceRoot":"","sources":["../../src/engine/patches.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"patches.js","sourceRoot":"","sources":["../../src/engine/patches.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,iFAAiF;AAEjF;;;;GAIG;AACH,SAAS,eAAe,CAAC,EAAU;IACjC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,2FAA2F;AAC3F,SAAS,iBAAiB,CAAC,OAAe;IACxC,4DAA4D;IAC5D,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAU,EAAE,IAAY;IAChD,OAAO,aAAa,eAAe,CAAC,EAAE,CAAC,iBAAiB,IAAI,EAAE,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAU;IACjC,OAAO,aAAa,eAAe,CAAC,EAAE,CAAC,OAAO,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAU,EAAE,IAAY;IAC/C,wCAAwC;IACxC,MAAM,WAAW,GAAG,IAA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CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,YAAY,CAC1B,IAAY,EACZ,QAAmC;IAEnC,OAAO;QACL,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC;QAC1B,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared helpers for the composition variable JSON model
|
|
3
|
-
* (`data-composition-variables`
|
|
3
|
+
* (`data-composition-variables`). The declaration-carrying element is resolved
|
|
4
|
+
* by the caller (`declarationElement` in model.ts): `<html>` for full-document
|
|
5
|
+
* comps, the composition root div for wrapped template/fragment comps.
|
|
4
6
|
*
|
|
5
7
|
* Single source for the parse → find-by-id → read/write/clear logic so the
|
|
6
8
|
* forward-mutation path (engine/mutate.ts) and the patch-replay path
|
|
7
9
|
* (engine/apply-patches.ts) can never disagree on the model's shape.
|
|
8
10
|
*/
|
|
11
|
+
import type { CompositionVariable } from "@hyperframes/core/variables";
|
|
9
12
|
export type VariableDecl = {
|
|
10
13
|
id: string;
|
|
11
14
|
default?: unknown;
|
|
12
15
|
[key: string]: unknown;
|
|
13
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Read the typed variable declarations from `data-composition-variables`.
|
|
19
|
+
* Delegates to the canonical parser (same filter the render pipeline uses),
|
|
20
|
+
* so malformed entries are dropped rather than surfaced. Returns `[]` when
|
|
21
|
+
* the declaration element is absent or has no declarations.
|
|
22
|
+
*/
|
|
23
|
+
export declare function readVariableDeclarations(declEl: Element | null): CompositionVariable[];
|
|
24
|
+
/**
|
|
25
|
+
* Find the raw declaration entry for a variable id, verbatim (unvalidated).
|
|
26
|
+
* Returns undefined when the attribute is absent, the JSON is invalid, or no
|
|
27
|
+
* entry matches the id.
|
|
28
|
+
*/
|
|
29
|
+
export declare function findVariableDeclaration(declEl: Element | null, id: string): VariableDecl | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Upsert a whole variable declaration by its id. Creates the
|
|
32
|
+
* `data-composition-variables` attribute when absent; replaces an unparseable
|
|
33
|
+
* attribute with a fresh single-entry array (the prior content was invisible
|
|
34
|
+
* to every reader anyway). Returns false only when there is no declaration
|
|
35
|
+
* element to carry the attribute.
|
|
36
|
+
*
|
|
37
|
+
* Accepts raw (unvalidated) entries as well as typed declarations: the patch
|
|
38
|
+
* REPLAY path must faithfully restore whatever entry the inverse patch
|
|
39
|
+
* captured — including loose hand-authored declarations the strict parser
|
|
40
|
+
* would drop — or undo silently diverges from history.
|
|
41
|
+
*/
|
|
42
|
+
export declare function writeVariableDeclaration(declEl: Element | null, declaration: CompositionVariable | ({
|
|
43
|
+
id: string;
|
|
44
|
+
} & Record<string, unknown>)): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Remove a variable declaration by id. Drops the whole attribute when the
|
|
47
|
+
* last declaration is removed (an empty `[]` is noise in authored HTML).
|
|
48
|
+
* No-ops (returns false) when the attribute or the entry is absent.
|
|
49
|
+
*/
|
|
50
|
+
export declare function removeVariableDeclarationEntry(declEl: Element | null, id: string): boolean;
|
|
14
51
|
/**
|
|
15
52
|
* Read the current `default` value for a variable id. Returns undefined when
|
|
16
53
|
* the attribute is absent, the JSON is invalid, or no entry matches the id.
|
|
17
54
|
*/
|
|
18
|
-
export declare function readVariableDefault(
|
|
55
|
+
export declare function readVariableDefault(declEl: Element | null, id: string): unknown;
|
|
19
56
|
/**
|
|
20
57
|
* Upsert a variable's `default`. No-ops (returns false) when the attribute is
|
|
21
58
|
* absent or contains no declaration for the id — we never auto-add declarations
|
|
22
59
|
* for undeclared variables, keeping the schema authoritative. Returns true when
|
|
23
60
|
* the attribute was updated.
|
|
24
61
|
*/
|
|
25
|
-
export declare function writeVariableDefault(
|
|
62
|
+
export declare function writeVariableDefault(declEl: Element | null, id: string, newDefault: unknown): boolean;
|
|
26
63
|
/**
|
|
27
64
|
* Remove the `default` key from a variable declaration, restoring its
|
|
28
65
|
* "no authored default" state. This is the exact inverse of writeVariableDefault
|
|
@@ -30,34 +67,5 @@ export declare function writeVariableDefault(document: Document, id: string, new
|
|
|
30
67
|
* default-less variable round-trips. No-ops when the decl or key is absent.
|
|
31
68
|
* Returns true when the attribute was updated.
|
|
32
69
|
*/
|
|
33
|
-
export declare function clearVariableDefault(
|
|
34
|
-
/** All declared variables, or [] when the attribute is absent/invalid. */
|
|
35
|
-
export declare function listVariableDecls(document: Document): VariableDecl[];
|
|
36
|
-
/**
|
|
37
|
-
* Upsert a full variable declaration (id/type/label/default/…), unlike
|
|
38
|
-
* writeVariableDefault which only ever touches the `default` field of an
|
|
39
|
-
* ALREADY-declared variable and refuses to create new ones. This is the
|
|
40
|
-
* "let someone add a variable" path a declarations panel needs — creates the
|
|
41
|
-
* `data-composition-variables` attribute from scratch when absent.
|
|
42
|
-
*
|
|
43
|
-
* Replaces the whole existing decl when `decl.id` is already declared (so
|
|
44
|
-
* editing a variable's type/label/options goes through the same call as
|
|
45
|
-
* creating one). Returns the previous decl (for inverse-patch capture) or
|
|
46
|
-
* null when this was a fresh create.
|
|
47
|
-
*/
|
|
48
|
-
export declare function declareVariableDecl(document: Document, decl: VariableDecl, opts?: {
|
|
49
|
-
atIndex?: number;
|
|
50
|
-
}): VariableDecl | null;
|
|
51
|
-
/**
|
|
52
|
-
* Remove a variable's declaration entirely (not just its default — the whole
|
|
53
|
-
* schema entry). Live `var.{id}` overrides and any data-var-* DOM references
|
|
54
|
-
* are left untouched; removing the declaration doesn't reach into either.
|
|
55
|
-
* Returns the removed decl AND its array index (for inverse-patch capture, so
|
|
56
|
-
* undo can reinsert at the original position — mirrors handleRemoveElement's
|
|
57
|
-
* siblingIndex), or null when the attribute/decl was absent.
|
|
58
|
-
*/
|
|
59
|
-
export declare function removeVariableDecl(document: Document, id: string): {
|
|
60
|
-
decl: VariableDecl;
|
|
61
|
-
index: number;
|
|
62
|
-
} | null;
|
|
70
|
+
export declare function clearVariableDefault(declEl: Element | null, id: string): boolean;
|
|
63
71
|
//# sourceMappingURL=variableModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variableModel.d.ts","sourceRoot":"","sources":["../../src/engine/variableModel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"variableModel.d.ts","sourceRoot":"","sources":["../../src/engine/variableModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAqBrF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,mBAAmB,EAAE,CAGtF;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,GAAG,IAAI,EACtB,EAAE,EAAE,MAAM,GACT,YAAY,GAAG,SAAS,CAK1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,GAAG,IAAI,EACtB,WAAW,EAAE,mBAAmB,GAAG,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAC5E,OAAO,CAaT;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAY1F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAK/E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,GAAG,IAAI,EACtB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,GAClB,OAAO,CAQT;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAShF"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared helpers for the composition variable JSON model
|
|
3
|
-
* (`data-composition-variables`
|
|
3
|
+
* (`data-composition-variables`). The declaration-carrying element is resolved
|
|
4
|
+
* by the caller (`declarationElement` in model.ts): `<html>` for full-document
|
|
5
|
+
* comps, the composition root div for wrapped template/fragment comps.
|
|
4
6
|
*
|
|
5
7
|
* Single source for the parse → find-by-id → read/write/clear logic so the
|
|
6
8
|
* forward-mutation path (engine/mutate.ts) and the patch-replay path
|
|
7
9
|
* (engine/apply-patches.ts) can never disagree on the model's shape.
|
|
8
10
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
11
|
+
// Browser-safe subpath — the core/parsers root entries pull Node-only modules
|
|
12
|
+
// and would break browser bundles that include the SDK (e.g. Studio).
|
|
13
|
+
import { parseCompositionVariables } from "@hyperframes/core/variables";
|
|
12
14
|
/** Parse the variable declaration array, or null when absent/invalid. */
|
|
13
|
-
function readDecls(
|
|
14
|
-
|
|
15
|
-
if (!htmlEl)
|
|
15
|
+
function readDecls(declEl) {
|
|
16
|
+
if (!declEl)
|
|
16
17
|
return null;
|
|
17
|
-
const raw =
|
|
18
|
+
const raw = declEl.getAttribute("data-composition-variables");
|
|
18
19
|
if (!raw)
|
|
19
20
|
return null;
|
|
20
21
|
let parsed;
|
|
@@ -26,17 +27,89 @@ function readDecls(document) {
|
|
|
26
27
|
}
|
|
27
28
|
if (!Array.isArray(parsed))
|
|
28
29
|
return null;
|
|
29
|
-
return {
|
|
30
|
+
return { declEl, arr: parsed };
|
|
30
31
|
}
|
|
31
32
|
function indexOfId(arr, id) {
|
|
32
33
|
return arr.findIndex((v) => typeof v === "object" && v !== null && v.id === id);
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Read the typed variable declarations from `data-composition-variables`.
|
|
37
|
+
* Delegates to the canonical parser (same filter the render pipeline uses),
|
|
38
|
+
* so malformed entries are dropped rather than surfaced. Returns `[]` when
|
|
39
|
+
* the declaration element is absent or has no declarations.
|
|
40
|
+
*/
|
|
41
|
+
export function readVariableDeclarations(declEl) {
|
|
42
|
+
if (!declEl)
|
|
43
|
+
return [];
|
|
44
|
+
return parseCompositionVariables(declEl);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Find the raw declaration entry for a variable id, verbatim (unvalidated).
|
|
48
|
+
* Returns undefined when the attribute is absent, the JSON is invalid, or no
|
|
49
|
+
* entry matches the id.
|
|
50
|
+
*/
|
|
51
|
+
export function findVariableDeclaration(declEl, id) {
|
|
52
|
+
const decls = readDecls(declEl);
|
|
53
|
+
if (!decls)
|
|
54
|
+
return undefined;
|
|
55
|
+
const idx = indexOfId(decls.arr, id);
|
|
56
|
+
return idx < 0 ? undefined : decls.arr[idx];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Upsert a whole variable declaration by its id. Creates the
|
|
60
|
+
* `data-composition-variables` attribute when absent; replaces an unparseable
|
|
61
|
+
* attribute with a fresh single-entry array (the prior content was invisible
|
|
62
|
+
* to every reader anyway). Returns false only when there is no declaration
|
|
63
|
+
* element to carry the attribute.
|
|
64
|
+
*
|
|
65
|
+
* Accepts raw (unvalidated) entries as well as typed declarations: the patch
|
|
66
|
+
* REPLAY path must faithfully restore whatever entry the inverse patch
|
|
67
|
+
* captured — including loose hand-authored declarations the strict parser
|
|
68
|
+
* would drop — or undo silently diverges from history.
|
|
69
|
+
*/
|
|
70
|
+
export function writeVariableDeclaration(declEl, declaration) {
|
|
71
|
+
if (!declEl)
|
|
72
|
+
return false;
|
|
73
|
+
const decls = readDecls(declEl);
|
|
74
|
+
const arr = decls?.arr ?? [];
|
|
75
|
+
const idx = indexOfId(arr, declaration.id);
|
|
76
|
+
const entry = { ...declaration };
|
|
77
|
+
if (idx < 0) {
|
|
78
|
+
arr.push(entry);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
arr[idx] = entry;
|
|
82
|
+
}
|
|
83
|
+
declEl.setAttribute("data-composition-variables", JSON.stringify(arr));
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Remove a variable declaration by id. Drops the whole attribute when the
|
|
88
|
+
* last declaration is removed (an empty `[]` is noise in authored HTML).
|
|
89
|
+
* No-ops (returns false) when the attribute or the entry is absent.
|
|
90
|
+
*/
|
|
91
|
+
export function removeVariableDeclarationEntry(declEl, id) {
|
|
92
|
+
const decls = readDecls(declEl);
|
|
93
|
+
if (!decls)
|
|
94
|
+
return false;
|
|
95
|
+
const idx = indexOfId(decls.arr, id);
|
|
96
|
+
if (idx < 0)
|
|
97
|
+
return false;
|
|
98
|
+
decls.arr.splice(idx, 1);
|
|
99
|
+
if (decls.arr.length === 0) {
|
|
100
|
+
decls.declEl.removeAttribute("data-composition-variables");
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
decls.declEl.setAttribute("data-composition-variables", JSON.stringify(decls.arr));
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
34
107
|
/**
|
|
35
108
|
* Read the current `default` value for a variable id. Returns undefined when
|
|
36
109
|
* the attribute is absent, the JSON is invalid, or no entry matches the id.
|
|
37
110
|
*/
|
|
38
|
-
export function readVariableDefault(
|
|
39
|
-
const decls = readDecls(
|
|
111
|
+
export function readVariableDefault(declEl, id) {
|
|
112
|
+
const decls = readDecls(declEl);
|
|
40
113
|
if (!decls)
|
|
41
114
|
return undefined;
|
|
42
115
|
const idx = indexOfId(decls.arr, id);
|
|
@@ -48,15 +121,15 @@ export function readVariableDefault(document, id) {
|
|
|
48
121
|
* for undeclared variables, keeping the schema authoritative. Returns true when
|
|
49
122
|
* the attribute was updated.
|
|
50
123
|
*/
|
|
51
|
-
export function writeVariableDefault(
|
|
52
|
-
const decls = readDecls(
|
|
124
|
+
export function writeVariableDefault(declEl, id, newDefault) {
|
|
125
|
+
const decls = readDecls(declEl);
|
|
53
126
|
if (!decls)
|
|
54
127
|
return false;
|
|
55
128
|
const idx = indexOfId(decls.arr, id);
|
|
56
129
|
if (idx < 0)
|
|
57
130
|
return false; // variable not declared — don't auto-add
|
|
58
131
|
decls.arr[idx] = { ...decls.arr[idx], default: newDefault };
|
|
59
|
-
decls.
|
|
132
|
+
decls.declEl.setAttribute("data-composition-variables", JSON.stringify(decls.arr));
|
|
60
133
|
return true;
|
|
61
134
|
}
|
|
62
135
|
/**
|
|
@@ -66,8 +139,8 @@ export function writeVariableDefault(document, id, newDefault) {
|
|
|
66
139
|
* default-less variable round-trips. No-ops when the decl or key is absent.
|
|
67
140
|
* Returns true when the attribute was updated.
|
|
68
141
|
*/
|
|
69
|
-
export function clearVariableDefault(
|
|
70
|
-
const decls = readDecls(
|
|
142
|
+
export function clearVariableDefault(declEl, id) {
|
|
143
|
+
const decls = readDecls(declEl);
|
|
71
144
|
if (!decls)
|
|
72
145
|
return false;
|
|
73
146
|
const idx = indexOfId(decls.arr, id);
|
|
@@ -75,65 +148,13 @@ export function clearVariableDefault(document, id) {
|
|
|
75
148
|
return false;
|
|
76
149
|
const { default: _drop, ...rest } = decls.arr[idx];
|
|
77
150
|
decls.arr[idx] = rest;
|
|
78
|
-
decls.
|
|
151
|
+
decls.declEl.setAttribute("data-composition-variables", JSON.stringify(decls.arr));
|
|
79
152
|
return true;
|
|
80
153
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
* writeVariableDefault which only ever touches the `default` field of an
|
|
88
|
-
* ALREADY-declared variable and refuses to create new ones. This is the
|
|
89
|
-
* "let someone add a variable" path a declarations panel needs — creates the
|
|
90
|
-
* `data-composition-variables` attribute from scratch when absent.
|
|
91
|
-
*
|
|
92
|
-
* Replaces the whole existing decl when `decl.id` is already declared (so
|
|
93
|
-
* editing a variable's type/label/options goes through the same call as
|
|
94
|
-
* creating one). Returns the previous decl (for inverse-patch capture) or
|
|
95
|
-
* null when this was a fresh create.
|
|
96
|
-
*/
|
|
97
|
-
export function declareVariableDecl(document, decl, opts) {
|
|
98
|
-
const htmlEl = getHtmlEl(document);
|
|
99
|
-
if (!htmlEl)
|
|
100
|
-
return null;
|
|
101
|
-
const existing = readDecls(document);
|
|
102
|
-
const arr = existing?.arr ?? [];
|
|
103
|
-
const idx = indexOfId(arr, decl.id);
|
|
104
|
-
const previous = idx < 0 ? null : arr[idx];
|
|
105
|
-
if (idx >= 0) {
|
|
106
|
-
arr[idx] = decl; // edit in place — position is already preserved
|
|
107
|
-
}
|
|
108
|
-
else if (opts?.atIndex !== undefined) {
|
|
109
|
-
// Undo of removeVariable: reinsert at the exact index it was removed
|
|
110
|
-
// from, so a remove-then-undo round-trips the array order, not just
|
|
111
|
-
// set-membership (mirrors handleRemoveElement's siblingIndex).
|
|
112
|
-
arr.splice(opts.atIndex, 0, decl);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
arr.push(decl); // a genuinely new declaration goes to the end of the list
|
|
116
|
-
}
|
|
117
|
-
htmlEl.setAttribute("data-composition-variables", JSON.stringify(arr));
|
|
118
|
-
return previous;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Remove a variable's declaration entirely (not just its default — the whole
|
|
122
|
-
* schema entry). Live `var.{id}` overrides and any data-var-* DOM references
|
|
123
|
-
* are left untouched; removing the declaration doesn't reach into either.
|
|
124
|
-
* Returns the removed decl AND its array index (for inverse-patch capture, so
|
|
125
|
-
* undo can reinsert at the original position — mirrors handleRemoveElement's
|
|
126
|
-
* siblingIndex), or null when the attribute/decl was absent.
|
|
127
|
-
*/
|
|
128
|
-
export function removeVariableDecl(document, id) {
|
|
129
|
-
const decls = readDecls(document);
|
|
130
|
-
if (!decls)
|
|
131
|
-
return null;
|
|
132
|
-
const idx = indexOfId(decls.arr, id);
|
|
133
|
-
if (idx < 0)
|
|
134
|
-
return null;
|
|
135
|
-
const [removed] = decls.arr.splice(idx, 1);
|
|
136
|
-
decls.htmlEl.setAttribute("data-composition-variables", JSON.stringify(decls.arr));
|
|
137
|
-
return removed ? { decl: removed, index: idx } : null;
|
|
138
|
-
}
|
|
154
|
+
// NOTE: #2098's Document-based helpers (listVariableDecls / declareVariableDecl /
|
|
155
|
+
// removeVariableDecl) were removed in the #2098-reconciliation — they duplicated
|
|
156
|
+
// the canonical declEl-based readVariableDeclarations / writeVariableDeclaration /
|
|
157
|
+
// removeVariableDeclarationEntry below and predate template/fragment declaration
|
|
158
|
+
// scope. The session conveniences (listVariables / removeVariable) delegate to
|
|
159
|
+
// the canonical methods instead.
|
|
139
160
|
//# sourceMappingURL=variableModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variableModel.js","sourceRoot":"","sources":["../../src/engine/variableModel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"variableModel.js","sourceRoot":"","sources":["../../src/engine/variableModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,8EAA8E;AAC9E,sEAAsE;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAMxE,yEAAyE;AACzE,SAAS,SAAS,CAAC,MAAsB;IACvC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;IAC9D,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,IAAI,MAAe,CAAC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AAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,IAAI,SAAS,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IAChF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;IACpD,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAoB,CAAC;IACtC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,4BAA4B,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACnF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,kFAAkF;AAClF,iFAAiF;AACjF,mFAAmF;AACnF,iFAAiF;AACjF,+EAA+E;AAC/E,iCAAiC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { HyperFramesElement, SdkDocument, OverrideSet, EditOp, ElasticHold, FontValue, ImageValue, GsapTweenSpec, HfId, JsonPatchOp, PatchEvent, PersistErrorEvent, ElementSnapshot, ElementTimingSnapshot, FindQuery, SelectionProxy, ElementHandle, Composition, CanResult, } from "./types.js";
|
|
2
|
-
export type { CompositionVariable } from "@hyperframes/core";
|
|
3
2
|
export { ORIGIN_APPLY_PATCHES, ORIGIN_LOCAL } from "./types.js";
|
|
3
|
+
export type { CompositionVariable, CompositionVariableType, CompositionVariableBase, StringVariable, NumberVariable, ColorVariable, BooleanVariable, EnumVariable, FontVariable, ImageVariable, VariableValidationIssue, VariableUsageScan, } from "@hyperframes/core/variables";
|
|
4
|
+
export type { VariableUsageReport } from "./types.js";
|
|
4
5
|
export { UnsupportedOpError } from "./engine/mutate.js";
|
|
5
6
|
export { buildDocument, buildRoots, flatElements } from "./document.js";
|
|
6
7
|
export { isNewHostBoundary, bareId, resolveScoped, findById, escapeHfId } from "./engine/model.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,MAAM,EACN,WAAW,EACX,SAAS,EACT,UAAU,EACV,aAAa,EACb,IAAI,EACJ,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,aAAa,EACb,WAAW,EACX,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,MAAM,EACN,WAAW,EACX,SAAS,EACT,UAAU,EACV,aAAa,EACb,IAAI,EACJ,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,aAAa,EACb,WAAW,EACX,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAIhE,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAElF,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAoBhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAKxD,kGAAkG;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAEV,WAAW,EAYX,WAAW,
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAEV,WAAW,EAYX,WAAW,EAMZ,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAuB1E,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,iHAAiH;IACjH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,mFAAmF;IACnF,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC;IAC3B,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AA+wBD;;;;;;GAMG;AAEH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,sBAAsB,GAC5B,OAAO,CAAC,WAAW,CAAC,CAmCtB"}
|