@hyperframes/parsers 0.7.37 → 0.7.38
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/hfIds.d.ts +10 -1
- package/dist/hfIds.js +18 -6
- package/dist/hfIds.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/hfIds.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ declare const EXCLUDED_TAGS: Set<string>;
|
|
|
13
13
|
* never re-exposes the ordering after first persist.
|
|
14
14
|
*/
|
|
15
15
|
declare function mintHfId(el: Element, assigned: Set<string>): string;
|
|
16
|
+
/**
|
|
17
|
+
* True for a `<template data-composition-id>` — the sub-composition authoring
|
|
18
|
+
* pattern whose content the studio preview unwraps into the served body. Only
|
|
19
|
+
* these templates are treated as transparent containers for hf-id purposes.
|
|
20
|
+
* A plain `<template>` (runtime clone-source: list item, particle, etc.) must
|
|
21
|
+
* NOT get inner ids: its content is cloned N times into the live DOM, so a
|
|
22
|
+
* persisted inner id would be duplicated across every clone.
|
|
23
|
+
*/
|
|
24
|
+
declare function isCompositionTemplate(el: Element): boolean;
|
|
16
25
|
declare function ensureHfIds(html: string): string;
|
|
17
26
|
|
|
18
|
-
export { EXCLUDED_TAGS, ensureHfIds, mintHfId };
|
|
27
|
+
export { EXCLUDED_TAGS, ensureHfIds, isCompositionTemplate, mintHfId };
|
package/dist/hfIds.js
CHANGED
|
@@ -48,6 +48,17 @@ function mintHfId(el, assigned) {
|
|
|
48
48
|
assigned.add(id);
|
|
49
49
|
return id;
|
|
50
50
|
}
|
|
51
|
+
function isCompositionTemplate(el) {
|
|
52
|
+
return el.tagName.toLowerCase() === "template" && el.getAttribute("data-composition-id") !== null;
|
|
53
|
+
}
|
|
54
|
+
function walkElements(root, visit) {
|
|
55
|
+
for (const child of Array.from(root.children)) {
|
|
56
|
+
const isTemplate = child.tagName.toLowerCase() === "template";
|
|
57
|
+
if (isTemplate && !isCompositionTemplate(child)) continue;
|
|
58
|
+
visit(child);
|
|
59
|
+
walkElements(child, visit);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
51
62
|
function ensureHfIds(html) {
|
|
52
63
|
const hasDocumentShell = /<!doctype|<html[\s>]/i.test(html);
|
|
53
64
|
const wrapped = !hasDocumentShell;
|
|
@@ -55,20 +66,21 @@ function ensureHfIds(html) {
|
|
|
55
66
|
const body = document.body;
|
|
56
67
|
if (!body) return html;
|
|
57
68
|
const assigned = /* @__PURE__ */ new Set();
|
|
58
|
-
|
|
69
|
+
walkElements(body, (el) => {
|
|
59
70
|
const existing = el.getAttribute("data-hf-id");
|
|
60
71
|
if (existing) assigned.add(existing);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (EXCLUDED_TAGS.has(el.tagName.toLowerCase()))
|
|
64
|
-
if (el.getAttribute("data-hf-id"))
|
|
72
|
+
});
|
|
73
|
+
walkElements(body, (el) => {
|
|
74
|
+
if (EXCLUDED_TAGS.has(el.tagName.toLowerCase())) return;
|
|
75
|
+
if (el.getAttribute("data-hf-id")) return;
|
|
65
76
|
el.setAttribute("data-hf-id", mintHfId(el, assigned));
|
|
66
|
-
}
|
|
77
|
+
});
|
|
67
78
|
return wrapped ? document.body.innerHTML || "" : document.toString();
|
|
68
79
|
}
|
|
69
80
|
export {
|
|
70
81
|
EXCLUDED_TAGS,
|
|
71
82
|
ensureHfIds,
|
|
83
|
+
isCompositionTemplate,
|
|
72
84
|
mintHfId
|
|
73
85
|
};
|
|
74
86
|
//# sourceMappingURL=hfIds.js.map
|
package/dist/hfIds.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hfIds.ts"],"sourcesContent":["/**\n * Stable hf- element id minting (R1). Node-safe (linkedom only, not browser DOM).\n *\n * Two surfaces share these helpers:\n * - ensureHfIds(html): node-id surface — mints data-hf-id on every element.\n * - mintHfId(el, assigned): shared by htmlParser for clip ids.\n *\n * Hash is CONTENT ONLY (tag + sorted attrs + own text) — no sibling position,\n * so inserting a non-identical sibling never shifts another element's id.\n */\nimport { parseHTML } from \"linkedom\";\n\n// Non-editable / non-visual elements that should never receive a stable id.\nexport const EXCLUDED_TAGS = new Set([\n \"script\",\n \"style\",\n \"template\",\n \"meta\",\n \"link\",\n \"noscript\",\n \"base\",\n]);\n\n// 32-bit FNV-1a. Pure, deterministic, no crypto, no Math.random.\nfunction fnv1a(str: string): number {\n let h = 0x811c9dc5;\n for (let i = 0; i < str.length; i++) {\n h ^= str.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return h >>> 0;\n}\n\n// 4 base-36 chars · 36^4 ≈ 1.68M ids per document. Birthday-paradox collision\n// ≈ N²/(2·36^4): well under 1% per document after dup rehash at realistic\n// clip-model sizes (≤ a few hundred elements). The dup-rehash in mintHfId\n// resolves the rare collision; width is deliberately small for readable ids.\nfunction toHfId(hash: number): string {\n const s = (hash >>> 0).toString(36);\n // Use suffix (most-avalanched bits) for better distribution within the 4-char window.\n const four = s.length >= 4 ? s.slice(-4) : s.padStart(4, \"0\");\n return `hf-${four}`;\n}\n\n// Element's own direct text (TEXT_NODE children), not descendants'.\nfunction ownText(el: Element): string {\n let text = \"\";\n el.childNodes.forEach((n) => {\n if (n.nodeType === 3) text += (n as Text).nodeValue ?? \"\";\n });\n return text.trim();\n}\n\nfunction contentKey(el: Element): string {\n // Exclude all data-hf-* attrs (ids, studio state) — they must not influence the hash.\n // Use \\x00 / \\x01 separators (invalid in HTML attrs) to prevent ambiguous serialization.\n const attrs = Array.from(el.attributes)\n .filter((a) => !a.name.startsWith(\"data-hf-\"))\n .map((a) => `${a.name}\\x00${a.value}`)\n .sort()\n .join(\"\\x01\");\n return `${el.tagName.toLowerCase()}|${attrs}|${ownText(el)}`;\n}\n\n/**\n * Collision tiebreak for byte-identical siblings: document-order dup counter\n * (`hash(key#N)`). This IS order-dependent — two identical `<span></span>`\n * get different ids based on which comes first in the DOM. This is unavoidable:\n * unique ids for byte-identical elements require a positional signal.\n *\n * Why this is safe in practice: once `ensureHfIds` write-back persists\n * `data-hf-id` to source the attribute is physically bound to its element.\n * Reordering identical siblings carries the attribute along → zero\n * order-dependence post-persist. `ensureHfIds` skips pinned elements\n * (`if (el.getAttribute(\"data-hf-id\")) continue`), so normal operation\n * never re-exposes the ordering after first persist.\n */\n// WIRE CONTRACT: id minting is content-keyed (FNV1a of innerHTML + tag). R7's\n// preview route relies on mintHfId producing identical ids across mint contexts\n// (disk-persist pass vs. in-memory bundle pass) — see preview.test.ts\n// \"bundle returning untagged HTML gets same ids as disk\". Any change that adds\n// positional, session, or random input to the hash breaks that invariant and\n// makes hf- ids diverge between disk and served HTML, silently corrupting\n// drag-to-edit targeting.\nexport function mintHfId(el: Element, assigned: Set<string>): string {\n const key = contentKey(el);\n let id = toHfId(fnv1a(key));\n let dup = 0;\n while (assigned.has(id)) {\n dup += 1;\n // Graceful fallback instead of a hard throw: rehashing only fails to find a\n // free 4-char slot in a pathological document (~1.6M identical elements).\n // Rather than crash the whole parse, widen the id with the dup counter —\n // still deterministic and unique, just longer than the 4-char norm.\n if (dup > 10000) {\n id = `hf-${(fnv1a(key) >>> 0).toString(36)}-${dup}`;\n break;\n }\n id = toHfId(fnv1a(`${key}#${dup}`));\n }\n assigned.add(id);\n return id;\n}\n\nexport function ensureHfIds(html: string): string {\n // Mirror parseSourceDocument's fragment-wrapping so bare fragments don't land\n // outside <body> in linkedom, which would cause body.querySelectorAll to return [].\n const hasDocumentShell = /<!doctype|<html[\\s>]/i.test(html);\n const wrapped = !hasDocumentShell;\n const { document } = wrapped\n ? parseHTML(`<!DOCTYPE html><html><head></head><body>${html}</body></html>`)\n : parseHTML(html);\n const body = document.body;\n if (!body) return html;\n\n const assigned = new Set<string>();\n // Seed with already-present ids (pin) so fresh mints never collide with them.\n // Scope to <body> to match the mint walk below — a stray data-hf-id in <head>\n // must not pin an id into the set that a body element would then be bumped off.\n
|
|
1
|
+
{"version":3,"sources":["../src/hfIds.ts"],"sourcesContent":["/**\n * Stable hf- element id minting (R1). Node-safe (linkedom only, not browser DOM).\n *\n * Two surfaces share these helpers:\n * - ensureHfIds(html): node-id surface — mints data-hf-id on every element.\n * - mintHfId(el, assigned): shared by htmlParser for clip ids.\n *\n * Hash is CONTENT ONLY (tag + sorted attrs + own text) — no sibling position,\n * so inserting a non-identical sibling never shifts another element's id.\n */\nimport { parseHTML } from \"linkedom\";\n\n// Non-editable / non-visual elements that should never receive a stable id.\nexport const EXCLUDED_TAGS = new Set([\n \"script\",\n \"style\",\n \"template\",\n \"meta\",\n \"link\",\n \"noscript\",\n \"base\",\n]);\n\n// 32-bit FNV-1a. Pure, deterministic, no crypto, no Math.random.\nfunction fnv1a(str: string): number {\n let h = 0x811c9dc5;\n for (let i = 0; i < str.length; i++) {\n h ^= str.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return h >>> 0;\n}\n\n// 4 base-36 chars · 36^4 ≈ 1.68M ids per document. Birthday-paradox collision\n// ≈ N²/(2·36^4): well under 1% per document after dup rehash at realistic\n// clip-model sizes (≤ a few hundred elements). The dup-rehash in mintHfId\n// resolves the rare collision; width is deliberately small for readable ids.\nfunction toHfId(hash: number): string {\n const s = (hash >>> 0).toString(36);\n // Use suffix (most-avalanched bits) for better distribution within the 4-char window.\n const four = s.length >= 4 ? s.slice(-4) : s.padStart(4, \"0\");\n return `hf-${four}`;\n}\n\n// Element's own direct text (TEXT_NODE children), not descendants'.\nfunction ownText(el: Element): string {\n let text = \"\";\n el.childNodes.forEach((n) => {\n if (n.nodeType === 3) text += (n as Text).nodeValue ?? \"\";\n });\n return text.trim();\n}\n\nfunction contentKey(el: Element): string {\n // Exclude all data-hf-* attrs (ids, studio state) — they must not influence the hash.\n // Use \\x00 / \\x01 separators (invalid in HTML attrs) to prevent ambiguous serialization.\n const attrs = Array.from(el.attributes)\n .filter((a) => !a.name.startsWith(\"data-hf-\"))\n .map((a) => `${a.name}\\x00${a.value}`)\n .sort()\n .join(\"\\x01\");\n return `${el.tagName.toLowerCase()}|${attrs}|${ownText(el)}`;\n}\n\n/**\n * Collision tiebreak for byte-identical siblings: document-order dup counter\n * (`hash(key#N)`). This IS order-dependent — two identical `<span></span>`\n * get different ids based on which comes first in the DOM. This is unavoidable:\n * unique ids for byte-identical elements require a positional signal.\n *\n * Why this is safe in practice: once `ensureHfIds` write-back persists\n * `data-hf-id` to source the attribute is physically bound to its element.\n * Reordering identical siblings carries the attribute along → zero\n * order-dependence post-persist. `ensureHfIds` skips pinned elements\n * (`if (el.getAttribute(\"data-hf-id\")) continue`), so normal operation\n * never re-exposes the ordering after first persist.\n */\n// WIRE CONTRACT: id minting is content-keyed (FNV1a of innerHTML + tag). R7's\n// preview route relies on mintHfId producing identical ids across mint contexts\n// (disk-persist pass vs. in-memory bundle pass) — see preview.test.ts\n// \"bundle returning untagged HTML gets same ids as disk\". Any change that adds\n// positional, session, or random input to the hash breaks that invariant and\n// makes hf- ids diverge between disk and served HTML, silently corrupting\n// drag-to-edit targeting.\nexport function mintHfId(el: Element, assigned: Set<string>): string {\n const key = contentKey(el);\n let id = toHfId(fnv1a(key));\n let dup = 0;\n while (assigned.has(id)) {\n dup += 1;\n // Graceful fallback instead of a hard throw: rehashing only fails to find a\n // free 4-char slot in a pathological document (~1.6M identical elements).\n // Rather than crash the whole parse, widen the id with the dup counter —\n // still deterministic and unique, just longer than the 4-char norm.\n if (dup > 10000) {\n id = `hf-${(fnv1a(key) >>> 0).toString(36)}-${dup}`;\n break;\n }\n id = toHfId(fnv1a(`${key}#${dup}`));\n }\n assigned.add(id);\n return id;\n}\n\n/**\n * True for a `<template data-composition-id>` — the sub-composition authoring\n * pattern whose content the studio preview unwraps into the served body. Only\n * these templates are treated as transparent containers for hf-id purposes.\n * A plain `<template>` (runtime clone-source: list item, particle, etc.) must\n * NOT get inner ids: its content is cloned N times into the live DOM, so a\n * persisted inner id would be duplicated across every clone.\n */\nexport function isCompositionTemplate(el: Element): boolean {\n return el.tagName.toLowerCase() === \"template\" && el.getAttribute(\"data-composition-id\") !== null;\n}\n\n/**\n * Document-order walk of every element under `root`, descending into\n * composition `<template>` subtrees — linkedom's querySelectorAll does not, so\n * template-based sub-comps would otherwise never get inner ids (the preview\n * unwraps the template and stamps the SAME content, so skipping here splits\n * the id space between the served DOM and the raw file). Plain templates are\n * skipped entirely (see isCompositionTemplate).\n */\nfunction walkElements(root: Element, visit: (el: Element) => void): void {\n for (const child of Array.from(root.children)) {\n const isTemplate = child.tagName.toLowerCase() === \"template\";\n if (isTemplate && !isCompositionTemplate(child)) continue;\n visit(child);\n walkElements(child, visit);\n }\n}\n\nexport function ensureHfIds(html: string): string {\n // Mirror parseSourceDocument's fragment-wrapping so bare fragments don't land\n // outside <body> in linkedom, which would cause body.querySelectorAll to return [].\n const hasDocumentShell = /<!doctype|<html[\\s>]/i.test(html);\n const wrapped = !hasDocumentShell;\n const { document } = wrapped\n ? parseHTML(`<!DOCTYPE html><html><head></head><body>${html}</body></html>`)\n : parseHTML(html);\n const body = document.body;\n if (!body) return html;\n\n const assigned = new Set<string>();\n // Seed with already-present ids (pin) so fresh mints never collide with them.\n // Scope to <body> to match the mint walk below — a stray data-hf-id in <head>\n // must not pin an id into the set that a body element would then be bumped off.\n walkElements(body, (el) => {\n const existing = el.getAttribute(\"data-hf-id\");\n if (existing) assigned.add(existing);\n });\n\n walkElements(body, (el) => {\n if (EXCLUDED_TAGS.has(el.tagName.toLowerCase())) return;\n if (el.getAttribute(\"data-hf-id\")) return; // pinned\n el.setAttribute(\"data-hf-id\", mintHfId(el, assigned));\n });\n\n return wrapped ? document.body.innerHTML || \"\" : document.toString();\n}\n"],"mappings":";AAUA,SAAS,iBAAiB;AAGnB,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,SAAS,MAAM,KAAqB;AAClC,MAAI,IAAI;AACR,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,SAAK,IAAI,WAAW,CAAC;AACrB,QAAI,KAAK,KAAK,GAAG,QAAU;AAAA,EAC7B;AACA,SAAO,MAAM;AACf;AAMA,SAAS,OAAO,MAAsB;AACpC,QAAM,KAAK,SAAS,GAAG,SAAS,EAAE;AAElC,QAAM,OAAO,EAAE,UAAU,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,GAAG;AAC5D,SAAO,MAAM,IAAI;AACnB;AAGA,SAAS,QAAQ,IAAqB;AACpC,MAAI,OAAO;AACX,KAAG,WAAW,QAAQ,CAAC,MAAM;AAC3B,QAAI,EAAE,aAAa,EAAG,SAAS,EAAW,aAAa;AAAA,EACzD,CAAC;AACD,SAAO,KAAK,KAAK;AACnB;AAEA,SAAS,WAAW,IAAqB;AAGvC,QAAM,QAAQ,MAAM,KAAK,GAAG,UAAU,EACnC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,WAAW,UAAU,CAAC,EAC5C,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,KAAO,EAAE,KAAK,EAAE,EACpC,KAAK,EACL,KAAK,GAAM;AACd,SAAO,GAAG,GAAG,QAAQ,YAAY,CAAC,IAAI,KAAK,IAAI,QAAQ,EAAE,CAAC;AAC5D;AAsBO,SAAS,SAAS,IAAa,UAA+B;AACnE,QAAM,MAAM,WAAW,EAAE;AACzB,MAAI,KAAK,OAAO,MAAM,GAAG,CAAC;AAC1B,MAAI,MAAM;AACV,SAAO,SAAS,IAAI,EAAE,GAAG;AACvB,WAAO;AAKP,QAAI,MAAM,KAAO;AACf,WAAK,OAAO,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,CAAC,IAAI,GAAG;AACjD;AAAA,IACF;AACA,SAAK,OAAO,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;AAAA,EACpC;AACA,WAAS,IAAI,EAAE;AACf,SAAO;AACT;AAUO,SAAS,sBAAsB,IAAsB;AAC1D,SAAO,GAAG,QAAQ,YAAY,MAAM,cAAc,GAAG,aAAa,qBAAqB,MAAM;AAC/F;AAUA,SAAS,aAAa,MAAe,OAAoC;AACvE,aAAW,SAAS,MAAM,KAAK,KAAK,QAAQ,GAAG;AAC7C,UAAM,aAAa,MAAM,QAAQ,YAAY,MAAM;AACnD,QAAI,cAAc,CAAC,sBAAsB,KAAK,EAAG;AACjD,UAAM,KAAK;AACX,iBAAa,OAAO,KAAK;AAAA,EAC3B;AACF;AAEO,SAAS,YAAY,MAAsB;AAGhD,QAAM,mBAAmB,wBAAwB,KAAK,IAAI;AAC1D,QAAM,UAAU,CAAC;AACjB,QAAM,EAAE,SAAS,IAAI,UACjB,UAAU,2CAA2C,IAAI,gBAAgB,IACzE,UAAU,IAAI;AAClB,QAAM,OAAO,SAAS;AACtB,MAAI,CAAC,KAAM,QAAO;AAElB,QAAM,WAAW,oBAAI,IAAY;AAIjC,eAAa,MAAM,CAAC,OAAO;AACzB,UAAM,WAAW,GAAG,aAAa,YAAY;AAC7C,QAAI,SAAU,UAAS,IAAI,QAAQ;AAAA,EACrC,CAAC;AAED,eAAa,MAAM,CAAC,OAAO;AACzB,QAAI,cAAc,IAAI,GAAG,QAAQ,YAAY,CAAC,EAAG;AACjD,QAAI,GAAG,aAAa,YAAY,EAAG;AACnC,OAAG,aAAa,cAAc,SAAS,IAAI,QAAQ,CAAC;AAAA,EACtD,CAAC;AAED,SAAO,UAAU,SAAS,KAAK,aAAa,KAAK,SAAS,SAAS;AACrE;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { isStudioHoldSet } from './gsapParser.js';
|
|
|
5
5
|
export { PROPERTY_GROUPS, PropertyGroupName, SUPPORTED_EASES, SUPPORTED_PROPS, classifyPropertyGroup, classifyTweenPropertyGroup } from './gsapConstants.js';
|
|
6
6
|
export { SPRING_PRESETS, SpringPreset, generateSpringEaseData } from './springEase.js';
|
|
7
7
|
export { parseGsapScriptAcorn as parseGsapScript } from './gsapParserAcorn.js';
|
|
8
|
-
export { EXCLUDED_TAGS, ensureHfIds, mintHfId } from './hfIds.js';
|
|
8
|
+
export { EXCLUDED_TAGS, ensureHfIds, isCompositionTemplate, mintHfId } from './hfIds.js';
|
|
9
9
|
export { ParsableDocumentLike, SubCompositionValidity, SubCompositionValidityReason, checkSubCompositionUsability } from './subCompositionValidity.js';
|
|
10
10
|
export { CANONICAL_FONT_DISPLAY_NAMES, FONT_ALIAS_KEYS, FONT_ALIAS_MAP, decodeUrlPathVariants, resolveAliasDisplayName } from './composition.js';
|
|
11
11
|
|
package/dist/index.js
CHANGED
|
@@ -1986,6 +1986,17 @@ function mintHfId(el, assigned) {
|
|
|
1986
1986
|
assigned.add(id);
|
|
1987
1987
|
return id;
|
|
1988
1988
|
}
|
|
1989
|
+
function isCompositionTemplate(el) {
|
|
1990
|
+
return el.tagName.toLowerCase() === "template" && el.getAttribute("data-composition-id") !== null;
|
|
1991
|
+
}
|
|
1992
|
+
function walkElements(root, visit) {
|
|
1993
|
+
for (const child of Array.from(root.children)) {
|
|
1994
|
+
const isTemplate = child.tagName.toLowerCase() === "template";
|
|
1995
|
+
if (isTemplate && !isCompositionTemplate(child)) continue;
|
|
1996
|
+
visit(child);
|
|
1997
|
+
walkElements(child, visit);
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
1989
2000
|
function ensureHfIds(html) {
|
|
1990
2001
|
const hasDocumentShell = /<!doctype|<html[\s>]/i.test(html);
|
|
1991
2002
|
const wrapped = !hasDocumentShell;
|
|
@@ -1993,15 +2004,15 @@ function ensureHfIds(html) {
|
|
|
1993
2004
|
const body = document.body;
|
|
1994
2005
|
if (!body) return html;
|
|
1995
2006
|
const assigned = /* @__PURE__ */ new Set();
|
|
1996
|
-
|
|
2007
|
+
walkElements(body, (el) => {
|
|
1997
2008
|
const existing = el.getAttribute("data-hf-id");
|
|
1998
2009
|
if (existing) assigned.add(existing);
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
if (EXCLUDED_TAGS.has(el.tagName.toLowerCase()))
|
|
2002
|
-
if (el.getAttribute("data-hf-id"))
|
|
2010
|
+
});
|
|
2011
|
+
walkElements(body, (el) => {
|
|
2012
|
+
if (EXCLUDED_TAGS.has(el.tagName.toLowerCase())) return;
|
|
2013
|
+
if (el.getAttribute("data-hf-id")) return;
|
|
2003
2014
|
el.setAttribute("data-hf-id", mintHfId(el, assigned));
|
|
2004
|
-
}
|
|
2015
|
+
});
|
|
2005
2016
|
return wrapped ? document.body.innerHTML || "" : document.toString();
|
|
2006
2017
|
}
|
|
2007
2018
|
|
|
@@ -3059,6 +3070,7 @@ export {
|
|
|
3059
3070
|
getDefaultStageZoom,
|
|
3060
3071
|
gsapAnimationsToKeyframes,
|
|
3061
3072
|
isCompositionElement,
|
|
3073
|
+
isCompositionTemplate,
|
|
3062
3074
|
isMediaElement,
|
|
3063
3075
|
isStudioHoldSet,
|
|
3064
3076
|
isTextElement,
|