hyperframes 0.8.114 → 0.8.115
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/{add-KCBOVKEU.js → add-ZSLFODRZ.js} +15 -14
- package/dist/{animatedGifPrep-U7FMC7DB.js → animatedGifPrep-72A45YER.js} +5 -5
- package/dist/{asset-AJ4ZZE3K.js → asset-SGDOHBBN.js} +2 -2
- package/dist/{assetCataloger-5LCGR5XU.js → assetCataloger-Q7BCDARF.js} +2 -2
- package/dist/{auth-PSEHAWSA.js → auth-5JGFN7SV.js} +2 -2
- package/dist/{autoUpdate-E32YLKFZ.js → autoUpdate-ZVTMYO7Z.js} +2 -2
- package/dist/{backgroundChecks-FNHBA7YI.js → backgroundChecks-IY3G5G2D.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-QVJ7NEUH.js → batchRender-QVLLL5DN.js} +3 -3
- package/dist/{beats-F67KZC3V.js → beats-66KZIB5V.js} +14 -10
- package/dist/{benchmark-CGD6CPRK.js → benchmark-AWFKSWQH.js} +11 -11
- package/dist/{browser-FPX3Z2AR.js → browser-J54EXMCE.js} +8 -8
- package/dist/{bundleWithLocalizedFonts-4CVITCYK.js → bundleWithLocalizedFonts-BLLHP2TO.js} +2 -2
- package/dist/{capture-GLHK4ST7.js → capture-D4HRSVSK.js} +2 -2
- package/dist/{capture-F2Y7TIHU.js → capture-SLI2I5BS.js} +16 -11
- package/dist/{catalog-4BZX7MQQ.js → catalog-BUMLQU7L.js} +15 -14
- package/dist/{check-IO3HWLLU.js → check-HEZUK62C.js} +31 -29
- package/dist/{checkBrowser-JTQ7ABCL.js → checkBrowser-RVJM6IUO.js} +30 -28
- package/dist/{chunk-MR6BQLGM.js → chunk-2DX6JYL2.js} +2 -2
- package/dist/{chunk-BOUDTDBQ.js → chunk-2GWVY66H.js} +1 -1
- package/dist/{chunk-P3FGUSFK.js → chunk-2H37RGJ2.js} +7 -7
- package/dist/{chunk-7543YIMQ.js → chunk-3J4EBX5M.js} +1 -1
- package/dist/{chunk-MLLBZR2U.js → chunk-3R6P5BIG.js} +2 -2
- package/dist/{chunk-HGMKPPGD.js → chunk-3YTWSGBV.js} +4 -4
- package/dist/{chunk-RKSRXPKV.js → chunk-4HIF3LI3.js} +5 -5
- package/dist/{chunk-HTQR7SUZ.js → chunk-4P2TOD7N.js} +1 -1
- package/dist/{chunk-G2T2X6FZ.js → chunk-5MXN7WM4.js} +2 -2
- package/dist/{chunk-BORVRAHJ.js → chunk-5YSA3YXO.js} +14 -18
- package/dist/{chunk-JH7ZJRDL.js → chunk-6SEUZGID.js} +3 -3
- package/dist/{chunk-VLC7JS4K.js → chunk-74RAXWDF.js} +1 -1
- package/dist/{chunk-MST5JBOR.js → chunk-AXXK3LWL.js} +1 -1
- package/dist/chunk-BDNCUMZM.js +2961 -0
- package/dist/{chunk-E52XEEAA.js → chunk-BQG33YTI.js} +1 -1
- package/dist/{chunk-QPR4N2D4.js → chunk-CVBWF2MD.js} +1 -1
- package/dist/{chunk-7ZR25WGW.js → chunk-HOBR4IHC.js} +7 -7
- package/dist/{chunk-LSSIYIXI.js → chunk-HPWPLV5J.js} +2 -2
- package/dist/{chunk-FCEFKWPM.js → chunk-IEE7GIVX.js} +1 -1
- package/dist/{chunk-L5QASNBN.js → chunk-IOJAVV6J.js} +1 -1
- package/dist/{chunk-IPXPSCWV.js → chunk-KLZ7OCHR.js} +3 -3
- package/dist/{chunk-OCNCK5FQ.js → chunk-M7XTMZF5.js} +1 -1
- package/dist/{chunk-GDJ74GHW.js → chunk-MPB7BQT7.js} +1 -1
- package/dist/{chunk-3SH322X7.js → chunk-ORAISNGN.js} +14 -17
- package/dist/{chunk-IP3XINRB.js → chunk-P6LJ4Y32.js} +23 -2944
- package/dist/chunk-P73WQPSB.js +93 -0
- package/dist/{chunk-LYNBNESS.js → chunk-PLP4K6WZ.js} +122 -47
- package/dist/{chunk-LMC46FK5.js → chunk-QMFCL2ZN.js} +1 -1
- package/dist/{chunk-DR7QW6C5.js → chunk-QXNRRMBQ.js} +2 -2
- package/dist/{chunk-C6AIZOQN.js → chunk-RRPJEHHW.js} +1 -1
- package/dist/{chunk-6U3K3U62.js → chunk-SAO3NQPF.js} +1 -1
- package/dist/{chunk-3IUSKIZW.js → chunk-SC7ICSIU.js} +1 -1
- package/dist/{chunk-SSM2TJYE.js → chunk-SK53U3PF.js} +1 -1
- package/dist/{chunk-XXKBPGPJ.js → chunk-SOEQWMNS.js} +2 -2
- package/dist/{chunk-752X6G7T.js → chunk-SSZYJCAL.js} +2 -2
- package/dist/{chunk-SYQOD3W7.js → chunk-T5HXGUM3.js} +1 -1
- package/dist/{chunk-ENHAGQEP.js → chunk-TMCJPHPP.js} +1 -1
- package/dist/{chunk-XFJXFNJF.js → chunk-TWJT2RGZ.js} +27 -12
- package/dist/{chunk-ZMMSMDCA.js → chunk-VDASTWUM.js} +1 -1
- package/dist/{chunk-T3NMEYGM.js → chunk-WZYHTXZY.js} +1 -1
- package/dist/{chunk-WAS5VEA4.js → chunk-XJQ7TRLG.js} +1 -1
- package/dist/{chunk-LDSWUYZB.js → chunk-Y2Y4LBJD.js} +3 -3
- package/dist/{chunk-SIN32SJB.js → chunk-YNHP6OFJ.js} +2 -2
- package/dist/{chunk-4KGMIOMY.js → chunk-ZBQP54CD.js} +10 -7
- package/dist/{clean-MCL76KQH.js → clean-X6Y252ZC.js} +14 -14
- package/dist/cli.js +53 -52
- package/dist/{cloud-444K6HIK.js → cloud-EE4GALWR.js} +4 -4
- package/dist/{cloudrun-BML6ZG7K.js → cloudrun-Y6A42KHE.js} +3 -3
- package/dist/{compare-CGNTCOR2.js → compare-K6XJZ3OC.js} +25 -23
- package/dist/{compiler-ZHVIEP26.js → compiler-DYACPLUW.js} +2 -2
- package/dist/{component-HTXLOIHR.js → component-T6IYSCFP.js} +3 -3
- package/dist/{compositions-KK46F5AC.js → compositions-4KUTNS5L.js} +10 -10
- package/dist/{delete-SSRZKKWQ.js → delete-C64TWAPE.js} +2 -2
- package/dist/{dist-OKRUIHYU.js → dist-KNGSQALD.js} +2 -2
- package/dist/{doctor-IIOX25KM.js → doctor-WJXZK5QN.js} +9 -9
- package/dist/{events-DCUZBRW6.js → events-FVG3Y6Q4.js} +8 -8
- package/dist/{events-TYMMAKHX.js → events-QRWJBSV4.js} +7 -7
- package/dist/{feedback-RIAGW6LG.js → feedback-NQHRUOZP.js} +9 -9
- package/dist/{figma-VBOUGJNX.js → figma-MEX4CSIM.js} +3 -3
- package/dist/fontLocalizeCli.js +7 -7
- package/dist/{get-LT6NUGNR.js → get-CMJIHGSA.js} +2 -2
- package/dist/{gpuPolicy-LRMOZXFU.js → gpuPolicy-5S4OZDME.js} +5 -5
- package/dist/{grade-compare-WWYQSQUM.js → grade-compare-NIDMIUGZ.js} +25 -23
- package/dist/{help-55ZV2M5U.js → help-G6AWAWJW.js} +1 -1
- package/dist/{history-QCY7CO4P.js → history-ZBOK2JQF.js} +20 -18
- package/dist/hyperframe-runtime.js +36 -36
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +36 -36
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-ROTXHRAH.js → info-2ORQZ6I2.js} +10 -10
- package/dist/{init-5XFOWGGN.js → init-3PSKH6UR.js} +22 -21
- package/dist/{inspect-3UF4VLTM.js → inspect-NR54RMEE.js} +26 -24
- package/dist/{installer-DGYYDGWJ.js → installer-YQUWHYBZ.js} +5 -4
- package/dist/{keyframes-OFZ6XNMC.js → keyframes-KT7T4AEV.js} +11 -11
- package/dist/{lambda-OQBFCEFA.js → lambda-3FF4V3X3.js} +4 -4
- package/dist/{layout-B4XF2734.js → layout-RB3M37ER.js} +26 -24
- package/dist/{lint-3YIJITTC.js → lint-HR57M5YP.js} +11 -11
- package/dist/{list-276FF3QE.js → list-YDXYHXHF.js} +2 -2
- package/dist/{login-SA3MCAIS.js → login-N6UNRVYW.js} +4 -4
- package/dist/{media-treatment-ICA5DWHS.js → media-treatment-UXJOTNRO.js} +11 -11
- package/dist/{models-JF5OOZ5A.js → models-Z3XFMGXB.js} +6 -6
- package/dist/{motionShot-TQBDZZ4M.js → motionShot-KQMCXJ77.js} +15 -12
- package/dist/{normalize-audio-URNASKUV.js → normalize-audio-XJQMDWRV.js} +10 -10
- package/dist/{pipeline-IWPF5ZMK.js → pipeline-U3OISHWV.js} +5 -5
- package/dist/{play-JYBAII35.js → play-XP77PML5.js} +20 -19
- package/dist/{preflight-2GH2Z4GZ.js → preflight-CANFVC4Y.js} +6 -6
- package/dist/{present-WIEZRZET.js → present-MWGA3O4S.js} +15 -15
- package/dist/{preview-YUPU646E.js → preview-X5GWZ3Q6.js} +17 -16
- package/dist/{producer-SL66UNEP.js → producer-B2IHU7MA.js} +1 -1
- package/dist/{projectConfig-7AKXZNNR.js → projectConfig-2A64YU5H.js} +7 -6
- package/dist/{publication-B2OERUY7.js → publication-CFYBPLRS.js} +2 -2
- package/dist/{publish-ZGKT7KED.js → publish-WE6AS77D.js} +8 -7
- package/dist/{remove-background-4LRTT6YL.js → remove-background-XSDOCVN5.js} +6 -6
- package/dist/{render-AX77WC3C.js → render-5TMRIC73.js} +11 -11
- package/dist/{render-F3QVCKKA.js → render-HVZUCLYW.js} +21 -20
- package/dist/{render-TGCDBKMP.js → render-QX6AKB6Y.js} +3 -3
- package/dist/{render-batch-WRQFW4UC.js → render-batch-QJXFVTDE.js} +3 -3
- package/dist/{renderCancellation-BFCQYGVV.js → renderCancellation-WSSSHRFR.js} +5 -5
- package/dist/{resolver-37UOGAMT.js → resolver-WTXO6WXA.js} +5 -4
- package/dist/{sherpa-SDVKYXCX.js → sherpa-S6ZBBEFO.js} +6 -6
- package/dist/skills/hyperframes/SKILL.md +4 -0
- package/dist/skills/hyperframes-cli/SKILL.md +8 -0
- package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +8 -0
- package/dist/skills/media-use/audio/scripts/audio.mjs +4 -1
- package/dist/skills/media-use/audio/scripts/audio.test.mjs +33 -0
- package/dist/skills/media-use/audio/scripts/lib/tts.mjs +1 -0
- package/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +44 -1
- package/dist/{skills-M6ETUUH5.js → skills-CDRSTETB.js} +10 -10
- package/dist/{skillsUpdateCheck-UTX5LT5C.js → skillsUpdateCheck-FKREJXSF.js} +3 -3
- package/dist/{snapshot-HMDAENTY.js → snapshot-T4PFSXTH.js} +26 -24
- package/dist/{src-PLWCT745.js → src-5BZDQAVN.js} +6 -6
- package/dist/{src-PJJ6NISA.js → src-IZMCUYK7.js} +4 -4
- package/dist/{staticProjectServer-XDH5SQV6.js → staticProjectServer-VN4ARAH4.js} +14 -13
- package/dist/{status-LENRPQS5.js → status-OJZWJB53.js} +5 -5
- package/dist/studio/assets/{hyperframes-player-aXNJKiIg.js → hyperframes-player-C-9N8nk0.js} +1 -1
- package/dist/studio/assets/{index-Bn2RJNTJ.js → index-BoUM6Xqb.js} +1 -1
- package/dist/studio/assets/{index-Dz7doz9l.js → index-CAvZ0AA-.js} +201 -201
- package/dist/studio/assets/{index-C9N-DGjC.js → index-CVuorIMv.js} +1 -1
- package/dist/studio/assets/{index-BYnsJnJV.css → index-t1LH6H5H.css} +1 -1
- package/dist/studio/{chunk-K47E2ZJA.js → chunk-5EKWJZLM.js} +504 -17
- package/dist/studio/chunk-5EKWJZLM.js.map +1 -0
- package/dist/studio/{chunk-VWT7STY3.js → chunk-J6Q572FA.js} +2 -2
- package/dist/studio/{chunk-BIUXP3PG.js → chunk-TXZMMOMA.js} +43 -276
- package/dist/studio/chunk-TXZMMOMA.js.map +1 -0
- package/dist/studio/{domEditingLayers-V67MS4WP.js → domEditingLayers-D7VYFJJD.js} +3 -5
- package/dist/studio/index.d.ts +43 -19
- package/dist/studio/index.html +2 -2
- package/dist/studio/index.js +2939 -2596
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/player.js +2 -2
- package/dist/studio/styles.css +1 -1
- package/dist/{studio-api-E5WFZ7YK.js → studio-api-CIO2NKK5.js} +9 -7
- package/dist/{studioServer-C7GTHTRY.js → studioServer-G5GNYWDI.js} +45 -45
- package/dist/{system-4KRSV2B7.js → system-PPNNGVIM.js} +5 -5
- package/dist/{telemetry-XH6D37RL.js → telemetry-GMDMISOX.js} +8 -8
- package/dist/{timeline-4RR7O6QW.js → timeline-5LSQX4OS.js} +14 -14
- package/dist/{tokens-MVTK3RPO.js → tokens-VBXAT7CK.js} +2 -2
- package/dist/{transcribe-I6WDPH7E.js → transcribe-GYCAIIEQ.js} +11 -11
- package/dist/{transcribe-3UXXEDXX.js → transcribe-VGYAWRXS.js} +6 -6
- package/dist/{updateCheck-ELMPFCBF.js → updateCheck-AZEREUQV.js} +2 -2
- package/dist/{upgrade-6UAOGP4D.js → upgrade-S63QN2LA.js} +2 -2
- package/dist/{urlDownloader-4KNER64L.js → urlDownloader-SM6ODN5O.js} +4 -4
- package/dist/usage-EC3KFUIJ.js +2139 -0
- package/dist/{validate-ZMMGUMBD.js → validate-7MNUK5MH.js} +15 -14
- package/dist/{video-GINAMW5I.js → video-JEOHARTC.js} +5 -5
- package/package.json +1 -1
- package/dist/studio/chunk-BIUXP3PG.js.map +0 -1
- package/dist/studio/chunk-K47E2ZJA.js.map +0 -1
- /package/dist/studio/{chunk-VWT7STY3.js.map → chunk-J6Q572FA.js.map} +0 -0
- /package/dist/studio/{domEditingLayers-V67MS4WP.js.map → domEditingLayers-D7VYFJJD.js.map} +0 -0
|
@@ -38,6 +38,473 @@ function getSourceScopedSelectorIndex(doc, el, selector, sourceFile, resolveSour
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// src/components/editor/domEditingDom.ts
|
|
42
|
+
import { COLOR_GRADING_SOURCE_HIDDEN_ATTR } from "@hyperframes/core/color-grading";
|
|
43
|
+
|
|
44
|
+
// src/components/editor/domEditingTypes.ts
|
|
45
|
+
var CURATED_STYLE_PROPERTIES = [
|
|
46
|
+
"position",
|
|
47
|
+
"display",
|
|
48
|
+
"top",
|
|
49
|
+
"left",
|
|
50
|
+
"right",
|
|
51
|
+
"bottom",
|
|
52
|
+
"inset",
|
|
53
|
+
"width",
|
|
54
|
+
"height",
|
|
55
|
+
"gap",
|
|
56
|
+
"justify-content",
|
|
57
|
+
"align-items",
|
|
58
|
+
"flex-direction",
|
|
59
|
+
"font-size",
|
|
60
|
+
"font-style",
|
|
61
|
+
"font-weight",
|
|
62
|
+
"font-family",
|
|
63
|
+
"line-height",
|
|
64
|
+
"letter-spacing",
|
|
65
|
+
"text-align",
|
|
66
|
+
"text-transform",
|
|
67
|
+
"color",
|
|
68
|
+
"background-color",
|
|
69
|
+
"background-image",
|
|
70
|
+
"opacity",
|
|
71
|
+
"mix-blend-mode",
|
|
72
|
+
"border-radius",
|
|
73
|
+
"border-width",
|
|
74
|
+
"border-style",
|
|
75
|
+
"border-color",
|
|
76
|
+
"border-top-width",
|
|
77
|
+
"border-top-style",
|
|
78
|
+
"border-top-color",
|
|
79
|
+
"outline-color",
|
|
80
|
+
"overflow",
|
|
81
|
+
"clip-path",
|
|
82
|
+
"box-shadow",
|
|
83
|
+
"filter",
|
|
84
|
+
"backdrop-filter",
|
|
85
|
+
"z-index",
|
|
86
|
+
"transform",
|
|
87
|
+
"object-fit",
|
|
88
|
+
"object-position"
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
// src/components/editor/domEditingDom.ts
|
|
92
|
+
import { parsePx } from "@hyperframes/core/editing";
|
|
93
|
+
function isHtmlElement(value) {
|
|
94
|
+
return typeof value === "object" && value !== null && "nodeType" in value && typeof value.nodeType === "number" && value.nodeType === 1;
|
|
95
|
+
}
|
|
96
|
+
function isTextBearingTag(tagName) {
|
|
97
|
+
return ["div", "span", "p", "strong", "h1", "h2", "h3", "h4", "h5", "h6"].includes(tagName);
|
|
98
|
+
}
|
|
99
|
+
function isEditableTextLeaf(el) {
|
|
100
|
+
return isTextBearingTag(el.tagName.toLowerCase()) && el.children.length === 0;
|
|
101
|
+
}
|
|
102
|
+
function elementRendersItself(win, el) {
|
|
103
|
+
const computed = win.getComputedStyle(el);
|
|
104
|
+
if (computed.display === "none" || computed.visibility === "hidden") return false;
|
|
105
|
+
const opacity = Number.parseFloat(computed.opacity);
|
|
106
|
+
return !(Number.isFinite(opacity) && opacity <= 0.01 && !el.hasAttribute(COLOR_GRADING_SOURCE_HIDDEN_ATTR));
|
|
107
|
+
}
|
|
108
|
+
function isElementVisibleThroughAncestors(el, memo) {
|
|
109
|
+
const win = el.ownerDocument.defaultView;
|
|
110
|
+
if (!win) return true;
|
|
111
|
+
const pending = [];
|
|
112
|
+
let inherited = true;
|
|
113
|
+
for (let node = el; node; node = node.parentElement) {
|
|
114
|
+
const answered = memo?.get(node);
|
|
115
|
+
if (answered !== void 0) {
|
|
116
|
+
inherited = answered;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
pending.push(node);
|
|
120
|
+
}
|
|
121
|
+
for (let i = pending.length - 1; i >= 0; i -= 1) {
|
|
122
|
+
const node = pending[i];
|
|
123
|
+
inherited = inherited && elementRendersItself(win, node);
|
|
124
|
+
memo?.set(node, inherited);
|
|
125
|
+
}
|
|
126
|
+
return inherited;
|
|
127
|
+
}
|
|
128
|
+
function getCuratedComputedStyles(el) {
|
|
129
|
+
const styles = {};
|
|
130
|
+
const computed = el.ownerDocument.defaultView?.getComputedStyle(el);
|
|
131
|
+
if (!computed) return styles;
|
|
132
|
+
for (const prop of CURATED_STYLE_PROPERTIES) {
|
|
133
|
+
const value = computed.getPropertyValue(prop);
|
|
134
|
+
if (value) styles[prop] = value;
|
|
135
|
+
}
|
|
136
|
+
return styles;
|
|
137
|
+
}
|
|
138
|
+
function getInlineStyles(el) {
|
|
139
|
+
const styles = {};
|
|
140
|
+
for (const property of CURATED_STYLE_PROPERTIES) {
|
|
141
|
+
const value = el.style.getPropertyValue(property);
|
|
142
|
+
if (value) styles[property] = value;
|
|
143
|
+
}
|
|
144
|
+
return styles;
|
|
145
|
+
}
|
|
146
|
+
function getDataAttributes(el) {
|
|
147
|
+
const attrs = {};
|
|
148
|
+
for (const attr of el.attributes) {
|
|
149
|
+
if (attr.name.startsWith("data-")) {
|
|
150
|
+
attrs[attr.name.slice(5)] = attr.value;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return attrs;
|
|
154
|
+
}
|
|
155
|
+
function findClosestByAttribute(el, attributeNames) {
|
|
156
|
+
let current = el;
|
|
157
|
+
while (current) {
|
|
158
|
+
const candidate = current;
|
|
159
|
+
if (attributeNames.some((attribute) => candidate.hasAttribute(attribute))) {
|
|
160
|
+
return candidate;
|
|
161
|
+
}
|
|
162
|
+
current = current.parentElement;
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
var compositionSourceMap = /* @__PURE__ */ new Map();
|
|
167
|
+
var compositionSourceMapRevision = 0;
|
|
168
|
+
function setCompositionSourceMap(map) {
|
|
169
|
+
compositionSourceMap = map;
|
|
170
|
+
compositionSourceMapRevision += 1;
|
|
171
|
+
}
|
|
172
|
+
function getCompositionSourceMapRevision() {
|
|
173
|
+
return compositionSourceMapRevision;
|
|
174
|
+
}
|
|
175
|
+
function sourceFromCompositionId(ownerRoot) {
|
|
176
|
+
if (!ownerRoot || compositionSourceMap.size === 0) return void 0;
|
|
177
|
+
const authored = ownerRoot.getAttribute("data-hf-original-composition-id");
|
|
178
|
+
const current = ownerRoot.getAttribute("data-composition-id");
|
|
179
|
+
return (authored ? compositionSourceMap.get(authored) : void 0) ?? (current ? compositionSourceMap.get(current) : void 0);
|
|
180
|
+
}
|
|
181
|
+
function getSourceFileForElement(el, activeCompositionPath) {
|
|
182
|
+
const sourceHost = findClosestByAttribute(el, ["data-composition-file", "data-composition-src"]);
|
|
183
|
+
const ownerRoot = findClosestByAttribute(el, ["data-composition-id"]);
|
|
184
|
+
const sourceFile = sourceHost?.getAttribute("data-composition-file") ?? sourceHost?.getAttribute("data-composition-src") ?? ownerRoot?.getAttribute("data-composition-file") ?? ownerRoot?.getAttribute("data-composition-src") ?? sourceFromCompositionId(ownerRoot) ?? activeCompositionPath ?? "index.html";
|
|
185
|
+
return {
|
|
186
|
+
sourceFile,
|
|
187
|
+
compositionPath: sourceFile
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function normalizeTimelineCompositionSource(value) {
|
|
191
|
+
const trimmed = value?.trim();
|
|
192
|
+
if (!trimmed) return void 0;
|
|
193
|
+
if (!/^([a-z][a-z0-9+.-]*:|\/)/i.test(trimmed)) return trimmed;
|
|
194
|
+
let pathname = trimmed;
|
|
195
|
+
try {
|
|
196
|
+
pathname = new URL(trimmed, "http://studio.local").pathname;
|
|
197
|
+
} catch {
|
|
198
|
+
pathname = trimmed;
|
|
199
|
+
}
|
|
200
|
+
for (const marker of ["/preview/comp/", "/preview/"]) {
|
|
201
|
+
const markerIndex = pathname.indexOf(marker);
|
|
202
|
+
if (markerIndex < 0) continue;
|
|
203
|
+
const sourcePath = pathname.slice(markerIndex + marker.length).replace(/^\/+/, "");
|
|
204
|
+
return sourcePath || trimmed;
|
|
205
|
+
}
|
|
206
|
+
return trimmed;
|
|
207
|
+
}
|
|
208
|
+
function escapeCssIdentifier(value) {
|
|
209
|
+
const css = globalThis.CSS;
|
|
210
|
+
if (typeof css?.escape === "function") return css.escape(value);
|
|
211
|
+
if (value === "-") return "\\-";
|
|
212
|
+
let escaped = "";
|
|
213
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
214
|
+
const char = value[index] ?? "";
|
|
215
|
+
const code = char.charCodeAt(0);
|
|
216
|
+
if (code === 0) {
|
|
217
|
+
escaped += "\uFFFD";
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
const isDigit = code >= 48 && code <= 57;
|
|
221
|
+
const isUpperAlpha = code >= 65 && code <= 90;
|
|
222
|
+
const isLowerAlpha = code >= 97 && code <= 122;
|
|
223
|
+
const isControl = code >= 1 && code <= 31 || code === 127;
|
|
224
|
+
const isLeadingDigit = index === 0 && isDigit;
|
|
225
|
+
const isSecondDigitAfterDash = index === 1 && value.startsWith("-") && isDigit;
|
|
226
|
+
if (isControl || isLeadingDigit || isSecondDigitAfterDash) {
|
|
227
|
+
escaped += `\\${code.toString(16)} `;
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if (isUpperAlpha || isLowerAlpha || isDigit || char === "-" || char === "_" || code >= 128) {
|
|
231
|
+
escaped += char;
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
escaped += `\\${char}`;
|
|
235
|
+
}
|
|
236
|
+
return escaped;
|
|
237
|
+
}
|
|
238
|
+
function escapeCssString(value) {
|
|
239
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\a ").replace(/\r/g, "\\d ").replace(/\f/g, "\\c ");
|
|
240
|
+
}
|
|
241
|
+
function querySelectorAllSafely(doc, selector) {
|
|
242
|
+
try {
|
|
243
|
+
return Array.from(doc.querySelectorAll(selector));
|
|
244
|
+
} catch {
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function humanizeIdentifier(value) {
|
|
249
|
+
return value.replace(/\.html$/i, "").replace(/^compositions\//i, "").split("/").at(-1)?.replace(/[-_]+/g, " ").replace(/\b\w/g, (char) => char.toUpperCase()) ?? value;
|
|
250
|
+
}
|
|
251
|
+
function buildStableSelector(el) {
|
|
252
|
+
if (el.id) return `#${escapeCssIdentifier(el.id)}`;
|
|
253
|
+
const compositionId = el.getAttribute("data-composition-id");
|
|
254
|
+
if (compositionId) return `[data-composition-id="${escapeCssString(compositionId)}"]`;
|
|
255
|
+
const group = el.getAttribute("data-hf-group");
|
|
256
|
+
if (group) return `[data-hf-group="${escapeCssString(group)}"]`;
|
|
257
|
+
return getPreferredClassSelector(el);
|
|
258
|
+
}
|
|
259
|
+
function getPreferredClassSelector(el) {
|
|
260
|
+
const classes = Array.from(el.classList).map((value) => value.trim()).filter(Boolean);
|
|
261
|
+
if (classes.length === 0) return void 0;
|
|
262
|
+
const preferred = classes.find((value) => value !== "clip" && !value.startsWith("__hf-")) ?? classes[0];
|
|
263
|
+
return preferred ? `.${escapeCssIdentifier(preferred)}` : void 0;
|
|
264
|
+
}
|
|
265
|
+
function buildElementLabel(el) {
|
|
266
|
+
const compositionId = el.getAttribute("data-hf-original-composition-id") ?? el.getAttribute("data-composition-id");
|
|
267
|
+
if (compositionId && compositionId !== "main") {
|
|
268
|
+
return humanizeIdentifier(compositionId);
|
|
269
|
+
}
|
|
270
|
+
const compositionSrc = el.getAttribute("data-composition-src") ?? el.getAttribute("data-composition-file");
|
|
271
|
+
if (compositionSrc) {
|
|
272
|
+
return humanizeIdentifier(compositionSrc);
|
|
273
|
+
}
|
|
274
|
+
const group = el.getAttribute("data-hf-group");
|
|
275
|
+
if (group) return group;
|
|
276
|
+
if (el.id) return humanizeIdentifier(el.id);
|
|
277
|
+
const preferredClass = getPreferredClassSelector(el);
|
|
278
|
+
if (preferredClass) {
|
|
279
|
+
return humanizeIdentifier(preferredClass.replace(/^\./, ""));
|
|
280
|
+
}
|
|
281
|
+
const text = (el.textContent ?? "").trim().replace(/\s+/g, " ");
|
|
282
|
+
if (text) return text.length > 40 ? `${text.slice(0, 39)}\u2026` : text;
|
|
283
|
+
return el.tagName.toLowerCase();
|
|
284
|
+
}
|
|
285
|
+
function getSelectorIndex(doc, el, selector, sourceFile, activeCompositionPath) {
|
|
286
|
+
if (!selector?.startsWith(".")) return void 0;
|
|
287
|
+
return getSourceScopedSelectorIndex(
|
|
288
|
+
doc,
|
|
289
|
+
el,
|
|
290
|
+
selector,
|
|
291
|
+
sourceFile,
|
|
292
|
+
(candidate) => isHtmlElement(candidate) ? getSourceFileForElement(candidate, activeCompositionPath).sourceFile : void 0
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// src/player/lib/timelineText.ts
|
|
297
|
+
import { isHtmlElement as isHtmlElement2 } from "@hyperframes/core/runtime/dom-realm";
|
|
298
|
+
|
|
299
|
+
// src/utils/rounding.ts
|
|
300
|
+
function roundTo3(val) {
|
|
301
|
+
return Math.round(val * 1e3) / 1e3;
|
|
302
|
+
}
|
|
303
|
+
function roundToLayoutPx(val) {
|
|
304
|
+
return Math.round(val);
|
|
305
|
+
}
|
|
306
|
+
function roundToCenti(val) {
|
|
307
|
+
return Math.round(val * 100) / 100;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// src/components/editor/colorValue.ts
|
|
311
|
+
function clampChannel(value) {
|
|
312
|
+
return Math.max(0, Math.min(255, Math.round(value)));
|
|
313
|
+
}
|
|
314
|
+
function clampAlpha(value) {
|
|
315
|
+
return Math.max(0, Math.min(1, value));
|
|
316
|
+
}
|
|
317
|
+
function toHex(value) {
|
|
318
|
+
return clampChannel(value).toString(16).padStart(2, "0");
|
|
319
|
+
}
|
|
320
|
+
function formatAlpha(value) {
|
|
321
|
+
return `${roundToCenti(clampAlpha(value))}`;
|
|
322
|
+
}
|
|
323
|
+
function parseComponent(value, scale) {
|
|
324
|
+
return value.endsWith("%") ? Number(value.slice(0, -1)) * scale / 100 : Number(value);
|
|
325
|
+
}
|
|
326
|
+
var NUMBER = String.raw`(?:\d+(?:\.\d+)?|\.\d+)`;
|
|
327
|
+
var COMMA_RGB = new RegExp(
|
|
328
|
+
String.raw`^rgba?\(\s*(${NUMBER})\s*,\s*(${NUMBER})\s*,\s*(${NUMBER})(?:\s*,\s*(${NUMBER}))?\s*\)$`
|
|
329
|
+
);
|
|
330
|
+
var SPACE_RGB = new RegExp(
|
|
331
|
+
String.raw`^rgba?\(\s*(${NUMBER}%?)\s+(${NUMBER}%?)\s+(${NUMBER}%?)(?:\s*\/\s*(${NUMBER}%?))?\s*\)$`
|
|
332
|
+
);
|
|
333
|
+
function parseSerializedColor(value) {
|
|
334
|
+
const trimmed = value.trim().toLowerCase();
|
|
335
|
+
if (!trimmed) return null;
|
|
336
|
+
if (trimmed === "transparent") {
|
|
337
|
+
return { red: 0, green: 0, blue: 0, alpha: 0 };
|
|
338
|
+
}
|
|
339
|
+
const hex = trimmed.match(/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/);
|
|
340
|
+
if (hex) {
|
|
341
|
+
const digits = hex[1].length <= 4 ? [...hex[1]].map((digit) => digit + digit).join("") : hex[1];
|
|
342
|
+
return {
|
|
343
|
+
red: Number.parseInt(digits.slice(0, 2), 16),
|
|
344
|
+
green: Number.parseInt(digits.slice(2, 4), 16),
|
|
345
|
+
blue: Number.parseInt(digits.slice(4, 6), 16),
|
|
346
|
+
alpha: digits.length === 8 ? Number.parseInt(digits.slice(6, 8), 16) / 255 : 1
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
const rgba = trimmed.match(COMMA_RGB) ?? trimmed.match(SPACE_RGB);
|
|
350
|
+
if (rgba) {
|
|
351
|
+
return {
|
|
352
|
+
red: clampChannel(parseComponent(rgba[1], 255)),
|
|
353
|
+
green: clampChannel(parseComponent(rgba[2], 255)),
|
|
354
|
+
blue: clampChannel(parseComponent(rgba[3], 255)),
|
|
355
|
+
alpha: clampAlpha(rgba[4] != null ? parseComponent(rgba[4], 1) : 1)
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
var colorContext = null;
|
|
361
|
+
function canResolveInBrowser(value) {
|
|
362
|
+
return typeof document !== "undefined" && typeof CSS !== "undefined" && CSS.supports("color", value) && !/\bcurrentcolor\b|\bvar\s*\(|\blight-dark\s*\(/i.test(value);
|
|
363
|
+
}
|
|
364
|
+
function parseBrowserColor(value) {
|
|
365
|
+
try {
|
|
366
|
+
if (!canResolveInBrowser(value)) return null;
|
|
367
|
+
colorContext ??= document.createElement("canvas").getContext("2d");
|
|
368
|
+
if (!colorContext) return null;
|
|
369
|
+
return parseCanvasColor(
|
|
370
|
+
colorContext,
|
|
371
|
+
`color(from ${value} srgb r g b / alpha)`,
|
|
372
|
+
parseSrgbSerialization
|
|
373
|
+
) ?? parseCanvasColor(colorContext, value, parseSerializedColor);
|
|
374
|
+
} catch {
|
|
375
|
+
return null;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function parseCanvasColor(context, value, parse) {
|
|
379
|
+
const serialized = readCanvasColor(context, value);
|
|
380
|
+
return serialized === null ? null : parse(serialized);
|
|
381
|
+
}
|
|
382
|
+
function readCanvasColor(context, value) {
|
|
383
|
+
context.fillStyle = "transparent";
|
|
384
|
+
context.fillStyle = value;
|
|
385
|
+
const first = context.fillStyle;
|
|
386
|
+
context.fillStyle = "white";
|
|
387
|
+
context.fillStyle = value;
|
|
388
|
+
return typeof first === "string" && first === context.fillStyle ? first : null;
|
|
389
|
+
}
|
|
390
|
+
function parseSrgbSerialization(serialized) {
|
|
391
|
+
const match = serialized.match(/^color\(srgb ([^ ]+) ([^ ]+) ([^ /)]+)(?: \/ ([^)]+))?\)$/);
|
|
392
|
+
if (!match) return null;
|
|
393
|
+
const channels = match.slice(1, 4).map(Number);
|
|
394
|
+
const alpha = match[4] === void 0 ? 1 : Number(match[4]);
|
|
395
|
+
if (!channels.every(Number.isFinite) || !Number.isFinite(alpha)) return null;
|
|
396
|
+
return {
|
|
397
|
+
red: clampChannel(channels[0] * 255),
|
|
398
|
+
green: clampChannel(channels[1] * 255),
|
|
399
|
+
blue: clampChannel(channels[2] * 255),
|
|
400
|
+
alpha: clampAlpha(alpha)
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
function parseCssColor(value) {
|
|
404
|
+
return parseSerializedColor(value) ?? parseBrowserColor(value.trim());
|
|
405
|
+
}
|
|
406
|
+
function resolvePickerColor(value, element, fallback) {
|
|
407
|
+
const view = element?.ownerDocument.defaultView;
|
|
408
|
+
const parsed = (value ? parseCssColor(value) : null) ?? (element && view ? parseCssColor(view.getComputedStyle(element).color) : null);
|
|
409
|
+
return parsed ? toHexColor(parsed) : fallback;
|
|
410
|
+
}
|
|
411
|
+
function toHexColor(color) {
|
|
412
|
+
return `#${toHex(color.red)}${toHex(color.green)}${toHex(color.blue)}`;
|
|
413
|
+
}
|
|
414
|
+
function formatCssColor(color) {
|
|
415
|
+
const red = clampChannel(color.red);
|
|
416
|
+
const green = clampChannel(color.green);
|
|
417
|
+
const blue = clampChannel(color.blue);
|
|
418
|
+
const alpha = clampAlpha(color.alpha);
|
|
419
|
+
if (alpha >= 1) {
|
|
420
|
+
return `rgb(${red}, ${green}, ${blue})`;
|
|
421
|
+
}
|
|
422
|
+
return `rgba(${red}, ${green}, ${blue}, ${formatAlpha(alpha)})`;
|
|
423
|
+
}
|
|
424
|
+
function rgbToHsv(color) {
|
|
425
|
+
const red = clampChannel(color.red) / 255;
|
|
426
|
+
const green = clampChannel(color.green) / 255;
|
|
427
|
+
const blue = clampChannel(color.blue) / 255;
|
|
428
|
+
const max = Math.max(red, green, blue);
|
|
429
|
+
const min = Math.min(red, green, blue);
|
|
430
|
+
const delta = max - min;
|
|
431
|
+
let hue = 0;
|
|
432
|
+
if (delta !== 0) {
|
|
433
|
+
if (max === red) {
|
|
434
|
+
hue = 60 * ((green - blue) / delta % 6);
|
|
435
|
+
} else if (max === green) {
|
|
436
|
+
hue = 60 * ((blue - red) / delta + 2);
|
|
437
|
+
} else {
|
|
438
|
+
hue = 60 * ((red - green) / delta + 4);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
if (hue < 0) hue += 360;
|
|
442
|
+
return {
|
|
443
|
+
hue,
|
|
444
|
+
saturation: max === 0 ? 0 : delta / max,
|
|
445
|
+
value: max
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function hsvToRgb(color) {
|
|
449
|
+
const hue = (color.hue % 360 + 360) % 360 / 60;
|
|
450
|
+
const saturation = Math.max(0, Math.min(1, color.saturation));
|
|
451
|
+
const value = Math.max(0, Math.min(1, color.value));
|
|
452
|
+
const chroma = value * saturation;
|
|
453
|
+
const x = chroma * (1 - Math.abs(hue % 2 - 1));
|
|
454
|
+
const m = value - chroma;
|
|
455
|
+
let red = 0;
|
|
456
|
+
let green = 0;
|
|
457
|
+
let blue = 0;
|
|
458
|
+
if (hue >= 0 && hue < 1) {
|
|
459
|
+
red = chroma;
|
|
460
|
+
green = x;
|
|
461
|
+
} else if (hue >= 1 && hue < 2) {
|
|
462
|
+
red = x;
|
|
463
|
+
green = chroma;
|
|
464
|
+
} else if (hue >= 2 && hue < 3) {
|
|
465
|
+
green = chroma;
|
|
466
|
+
blue = x;
|
|
467
|
+
} else if (hue >= 3 && hue < 4) {
|
|
468
|
+
green = x;
|
|
469
|
+
blue = chroma;
|
|
470
|
+
} else if (hue >= 4 && hue < 5) {
|
|
471
|
+
red = x;
|
|
472
|
+
blue = chroma;
|
|
473
|
+
} else {
|
|
474
|
+
red = chroma;
|
|
475
|
+
blue = x;
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
red: clampChannel((red + m) * 255),
|
|
479
|
+
green: clampChannel((green + m) * 255),
|
|
480
|
+
blue: clampChannel((blue + m) * 255)
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// src/player/lib/timelineText.ts
|
|
485
|
+
function readTimelineText(el) {
|
|
486
|
+
if (!isHtmlElement2(el) || !isTextBearingTag(el.localName)) return void 0;
|
|
487
|
+
const children = Array.from(el.children);
|
|
488
|
+
if (!children.every((child) => isHtmlElement2(child) && isEditableTextLeaf(child)))
|
|
489
|
+
return void 0;
|
|
490
|
+
const value = el.textContent?.replace(/\s+/g, " ").trim();
|
|
491
|
+
if (!value) return void 0;
|
|
492
|
+
const style = getCuratedComputedStyles(el);
|
|
493
|
+
if ((style["background-image"] ?? "none") !== "none") return void 0;
|
|
494
|
+
const background = style["background-color"];
|
|
495
|
+
return {
|
|
496
|
+
value,
|
|
497
|
+
fontFamily: style["font-family"],
|
|
498
|
+
fontWeight: style["font-weight"],
|
|
499
|
+
color: style.color,
|
|
500
|
+
background: background && parseCssColor(background)?.alpha === 1 ? background : void 0
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
function sameTimelineText(a, b) {
|
|
504
|
+
if (!a || !b) return a === b;
|
|
505
|
+
return a.value === b.value && a.fontFamily === b.fontFamily && a.fontWeight === b.fontWeight && a.color === b.color && a.background === b.background;
|
|
506
|
+
}
|
|
507
|
+
|
|
41
508
|
// src/player/lib/playbackAdapter.ts
|
|
42
509
|
function isFinitePositive(value) {
|
|
43
510
|
return Number.isFinite(value) && value > 0;
|
|
@@ -173,6 +640,7 @@ function wrapTimeline(tl) {
|
|
|
173
640
|
// src/player/lib/timelineElementHelpers.ts
|
|
174
641
|
import { HF_AUDIO_GROUP_TAG } from "@hyperframes/core/audio-groups";
|
|
175
642
|
import { readElementFades } from "@hyperframes/core/audio-fade";
|
|
643
|
+
import { isHtmlElement as isHtmlElement3, isImageElement, isMediaElement } from "@hyperframes/core/runtime/dom-realm";
|
|
176
644
|
|
|
177
645
|
// src/player/lib/storedVolume.ts
|
|
178
646
|
function parseStoredVolume(text) {
|
|
@@ -253,21 +721,14 @@ function furthestClipEndFromSource(source) {
|
|
|
253
721
|
if (!source) return 0;
|
|
254
722
|
return furthestClipEndFromDocument(new DOMParser().parseFromString(source, "text/html"));
|
|
255
723
|
}
|
|
256
|
-
function isHtmlElement(el) {
|
|
257
|
-
const HtmlElementCtor = el.ownerDocument.defaultView?.HTMLElement ?? globalThis.HTMLElement;
|
|
258
|
-
return typeof HtmlElementCtor !== "undefined" && el instanceof HtmlElementCtor;
|
|
259
|
-
}
|
|
260
724
|
function isCompositionHost(el) {
|
|
261
725
|
return el.hasAttribute("data-composition-id") || el.hasAttribute("data-composition-src") || el.hasAttribute("data-composition-file");
|
|
262
726
|
}
|
|
263
727
|
function resolveMediaElement(el) {
|
|
264
|
-
|
|
265
|
-
const MediaElementCtor = win.HTMLMediaElement ?? globalThis.HTMLMediaElement;
|
|
266
|
-
const ImageElementCtor = win.HTMLImageElement ?? globalThis.HTMLImageElement;
|
|
267
|
-
if (el instanceof MediaElementCtor || el instanceof ImageElementCtor) return el;
|
|
728
|
+
if (isMediaElement(el) || isImageElement(el)) return el;
|
|
268
729
|
if (isCompositionHost(el)) return null;
|
|
269
730
|
const candidate = el.querySelector("video, audio, img");
|
|
270
|
-
return candidate
|
|
731
|
+
return isMediaElement(candidate) || isImageElement(candidate) ? candidate : null;
|
|
271
732
|
}
|
|
272
733
|
function readPlaybackStartAttributes(getAttr) {
|
|
273
734
|
const playbackStartAttr = getAttr("data-playback-start") != null ? "playback-start" : getAttr("data-media-start") != null ? "media-start" : void 0;
|
|
@@ -321,6 +782,7 @@ function applyFadeMetadataFromElement(entry, el) {
|
|
|
321
782
|
setOptional(entry, "fadeOut", fades.fadeOut > 0 ? fades.fadeOut : void 0);
|
|
322
783
|
}
|
|
323
784
|
function applyMediaMetadataFromElement(entry, el) {
|
|
785
|
+
setOptional(entry, "text", readTimelineText(el));
|
|
324
786
|
applyPlaybackMetadataFromElement(entry, el);
|
|
325
787
|
applyAudioMetadataFromElement(entry, el);
|
|
326
788
|
applyFadeMetadataFromElement(entry, el);
|
|
@@ -329,9 +791,7 @@ function applyMediaMetadataFromElement(entry, el) {
|
|
|
329
791
|
entry.tag = mediaEl.tagName.toLowerCase();
|
|
330
792
|
const src = mediaEl.getAttribute("src");
|
|
331
793
|
if (src) entry.src = src;
|
|
332
|
-
|
|
333
|
-
const MediaElementCtor = win.HTMLMediaElement ?? globalThis.HTMLMediaElement;
|
|
334
|
-
if (typeof MediaElementCtor === "undefined" || !(mediaEl instanceof MediaElementCtor)) return;
|
|
794
|
+
if (!isMediaElement(mediaEl)) return;
|
|
335
795
|
const sourceDurationAttr = el.getAttribute("data-source-duration") ?? mediaEl.getAttribute("data-source-duration");
|
|
336
796
|
const sourceDuration = sourceDurationAttr ? parseFloat(sourceDurationAttr) : mediaEl.duration;
|
|
337
797
|
if (Number.isFinite(sourceDuration) && sourceDuration > 0) {
|
|
@@ -351,10 +811,10 @@ function getTimelineElementDisplayLabel(input) {
|
|
|
351
811
|
return tag ? `${tag} clip` : "Timeline clip";
|
|
352
812
|
}
|
|
353
813
|
function getTimelineElementSelector(el) {
|
|
354
|
-
if (
|
|
814
|
+
if (isHtmlElement3(el) && el.id) return `#${CSS.escape(el.id)}`;
|
|
355
815
|
const compId = el.getAttribute("data-composition-id");
|
|
356
816
|
if (compId) return `[data-composition-id="${CSS.escape(compId)}"]`;
|
|
357
|
-
if (
|
|
817
|
+
if (isHtmlElement3(el)) {
|
|
358
818
|
const classes = el.className.split(/\s+/).filter(Boolean);
|
|
359
819
|
const firstClass = classes.find((className) => className !== "clip") ?? classes[0];
|
|
360
820
|
if (firstClass) return `.${CSS.escape(firstClass)}`;
|
|
@@ -575,13 +1035,40 @@ export {
|
|
|
575
1035
|
parseProjectHashRoute,
|
|
576
1036
|
parseProjectIdFromHash,
|
|
577
1037
|
buildProjectApiPath,
|
|
1038
|
+
roundTo3,
|
|
1039
|
+
roundToLayoutPx,
|
|
1040
|
+
roundToCenti,
|
|
1041
|
+
parseCssColor,
|
|
1042
|
+
resolvePickerColor,
|
|
1043
|
+
toHexColor,
|
|
1044
|
+
formatCssColor,
|
|
1045
|
+
rgbToHsv,
|
|
1046
|
+
hsvToRgb,
|
|
1047
|
+
withSelectorIndexPass,
|
|
1048
|
+
isHtmlElement,
|
|
1049
|
+
isEditableTextLeaf,
|
|
1050
|
+
isElementVisibleThroughAncestors,
|
|
1051
|
+
getCuratedComputedStyles,
|
|
1052
|
+
getInlineStyles,
|
|
1053
|
+
getDataAttributes,
|
|
1054
|
+
findClosestByAttribute,
|
|
1055
|
+
setCompositionSourceMap,
|
|
1056
|
+
getCompositionSourceMapRevision,
|
|
1057
|
+
getSourceFileForElement,
|
|
1058
|
+
normalizeTimelineCompositionSource,
|
|
1059
|
+
escapeCssString,
|
|
1060
|
+
querySelectorAllSafely,
|
|
1061
|
+
buildStableSelector,
|
|
1062
|
+
buildElementLabel,
|
|
1063
|
+
getSelectorIndex,
|
|
1064
|
+
parsePx,
|
|
1065
|
+
readTimelineText,
|
|
1066
|
+
sameTimelineText,
|
|
578
1067
|
getAdapterDuration,
|
|
579
1068
|
getDefaultStaticSeekPlaybackClock,
|
|
580
1069
|
releaseStaticSeekCache,
|
|
581
1070
|
resolveStaticSeekFallback,
|
|
582
1071
|
wrapTimeline,
|
|
583
|
-
withSelectorIndexPass,
|
|
584
|
-
getSourceScopedSelectorIndex,
|
|
585
1072
|
parseStoredVolume,
|
|
586
1073
|
elementVolume,
|
|
587
1074
|
LAYER_REVEAL_PRIOR_Z_ATTR,
|
|
@@ -613,4 +1100,4 @@ export {
|
|
|
613
1100
|
findClipElementById,
|
|
614
1101
|
createTimelineDomNodeResolver
|
|
615
1102
|
};
|
|
616
|
-
//# sourceMappingURL=chunk-
|
|
1103
|
+
//# sourceMappingURL=chunk-5EKWJZLM.js.map
|