Skip to content

Commit d2db3a5

Browse files
committed
refactor(studio): strip the variable-host mark by the same name core stamps
1 parent a335439 commit d2db3a5

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎packages/core/package-subpaths.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,12 @@
302302
"types": "./dist/runtime/domRealm.d.ts",
303303
"environments": ["browser", "bun", "node"]
304304
},
305+
"./runtime/variable-scope": {
306+
"source": "./src/runtime/variableScope.ts",
307+
"runtime": "./dist/runtime/variableScope.js",
308+
"types": "./dist/runtime/variableScope.d.ts",
309+
"environments": ["browser", "bun", "node"]
310+
},
305311
"./runtime/custom-ease": {
306312
"source": "./src/runtime/customEase.ts",
307313
"runtime": "./dist/runtime/customEase.js",

‎packages/core/package.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,12 @@
311311
"import": "./src/runtime/domRealm.ts",
312312
"types": "./src/runtime/domRealm.ts"
313313
},
314+
"./runtime/variable-scope": {
315+
"bun": "./src/runtime/variableScope.ts",
316+
"node": "./dist/runtime/variableScope.js",
317+
"import": "./src/runtime/variableScope.ts",
318+
"types": "./src/runtime/variableScope.ts"
319+
},
314320
"./runtime/custom-ease": {
315321
"bun": "./src/runtime/customEase.ts",
316322
"node": "./dist/runtime/customEase.js",
@@ -721,6 +727,10 @@
721727
"import": "./dist/runtime/domRealm.js",
722728
"types": "./dist/runtime/domRealm.d.ts"
723729
},
730+
"./runtime/variable-scope": {
731+
"import": "./dist/runtime/variableScope.js",
732+
"types": "./dist/runtime/variableScope.d.ts"
733+
},
724734
"./runtime/custom-ease": {
725735
"import": "./dist/runtime/customEase.js",
726736
"types": "./dist/runtime/customEase.d.ts"

‎packages/studio/src/utils/authoredSource.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
STUDIO_PREVIEW_LAZY_ATTR,
44
STUDIO_PREVIEW_UPCOMING_ATTR,
55
} from "@hyperframes/core/studio-preview-mark";
6+
import { VARIABLE_HOST_ATTR } from "@hyperframes/core/runtime/variable-scope";
67

78
// Stamped as the preview stamps the files it serves, so a live element's hf-id finds its source.
89
export function parseSavedSource(html: string): Document {
@@ -98,7 +99,7 @@ export function authoredMarkup(authored: Element, live: Element, sourceFile: str
9899
export function liveMarkupWithoutPreviewMarks(live: Element): string {
99100
const copy = live.cloneNode(true) as Element;
100101
for (const el of [copy, ...Array.from(copy.querySelectorAll("*"))]) {
101-
el.removeAttribute("data-hf-variable-host");
102+
el.removeAttribute(VARIABLE_HOST_ATTR);
102103
el.removeAttribute(STUDIO_PREVIEW_UPCOMING_ATTR);
103104
if (!el.hasAttribute(STUDIO_PREVIEW_LAZY_ATTR)) continue;
104105
el.removeAttribute("loading");

0 commit comments

Comments
 (0)