@hyperframes/core 0.9.102 → 0.9.104
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/atomicFile.d.ts +1 -0
- package/dist/atomicFile.js +1 -1
- package/dist/compiler/compositionScoping.js +3 -3
- package/dist/compiler/svgIdNamespacing.js +2 -2
- package/dist/fonts/authoredGoogleFonts.js +2 -2
- package/dist/fonts/deterministicFonts.js +2 -2
- package/dist/generated/position-edits-render-inline.js +1 -1
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/hyperframe.runtime.iife.js +71 -71
- package/dist/index.d.ts +1 -1
- package/dist/runtime/domRealm.d.ts +1 -0
- package/dist/runtime/domRealm.js +3 -0
- package/dist/runtime/editing/canvasKeys.d.ts +63 -0
- package/dist/runtime/editing/canvasKeys.js +471 -0
- package/dist/runtime/editing/pausedFrames.js +7 -7
- package/dist/runtime/editing/removeElements.d.ts +10 -0
- package/dist/runtime/editing/removeElements.js +35 -0
- package/dist/runtime/editing/stageAct.d.ts +116 -0
- package/dist/runtime/editing/stageAct.js +531 -0
- package/dist/runtime/editing/stageGhost.d.ts +10 -0
- package/dist/runtime/editing/stageGhost.js +64 -0
- package/dist/runtime/editing/stageMeasure.d.ts +5 -0
- package/dist/runtime/editing/stageMeasure.js +35 -1
- package/dist/runtime/editing/textEdit.d.ts +14 -0
- package/dist/runtime/editing/textEdit.js +67 -9
- package/dist/runtime/editing/transformValues.d.ts +6 -0
- package/dist/runtime/editing/transformValues.js +39 -0
- package/dist/runtime/editing/watchGeometry.js +8 -8
- package/dist/runtime/editingGestureStart.d.ts +2 -0
- package/dist/runtime/editingGestureStart.js +1 -1
- package/dist/runtime/editingPort.d.ts +35 -3
- package/dist/runtime/editingPort.js +78 -16
- package/dist/runtime/playbackHealth.d.ts +8 -1
- package/dist/runtime/playbackHealth.js +118 -18
- package/dist/runtime/runtimePort.d.ts +21 -0
- package/dist/runtime/runtimePort.js +122 -0
- package/dist/runtime/types.d.ts +18 -0
- package/dist/studioPreviewMark.d.ts +1 -0
- package/dist/studioPreviewMark.js +1 -0
- package/package.json +4 -4
package/dist/atomicFile.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare function refuseReadOnly(filePath: string): void;
|
|
|
14
14
|
export declare function createFileAtomically(filePath: string, content: string | Uint8Array, operations?: DirectFileSystem & Pick<typeof fs, "linkSync">): void;
|
|
15
15
|
/** The file a write to `filePath` lands on: folder links and file links followed as the system does. */
|
|
16
16
|
export declare function resolveWritePath(filePath: string): string;
|
|
17
|
+
export declare function toWin32LongPath(path: string): string;
|
|
17
18
|
/** `prefix` + 6 random characters in `parent`, made private; Windows past 260 characters needs the long path. */
|
|
18
19
|
export declare function createStagingDir(parent: string, prefix: string): string;
|
|
19
20
|
export {};
|
package/dist/atomicFile.js
CHANGED
|
@@ -218,7 +218,7 @@ function errorCode(error) {
|
|
|
218
218
|
const WIN32_LONG_PREFIX = "\\\\?\\";
|
|
219
219
|
const WIN32_ABSOLUTE = /^([A-Za-z]:\\|\\\\)/;
|
|
220
220
|
const WIN32_DOS_DEVICE = /^\\\\[.?]\\/;
|
|
221
|
-
function toWin32LongPath(path) {
|
|
221
|
+
export function toWin32LongPath(path) {
|
|
222
222
|
const full = resolve(path);
|
|
223
223
|
if (!WIN32_ABSOLUTE.test(full) || WIN32_DOS_DEVICE.test(full))
|
|
224
224
|
return path;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSvgSelectorAliasesScript } from "../generated/svg-selector-aliases-inline.js";
|
|
2
|
-
import
|
|
2
|
+
import { parseCss as parseProjectCss } from "@hyperframes/parsers/postcss";
|
|
3
3
|
import { escapeCssIdentifier, replaceSelectorIdTokens } from "./selectorIdTokens.js";
|
|
4
4
|
import { SCENE_PARTS_META } from "../sceneParts.js";
|
|
5
5
|
const AUTHORED_ROOT_ID_ATTR = "data-hf-authored-id";
|
|
@@ -169,7 +169,7 @@ function scopedSelectorsBound(selectors, scope, authoredRootId) {
|
|
|
169
169
|
}
|
|
170
170
|
function parseCss(css) {
|
|
171
171
|
try {
|
|
172
|
-
return
|
|
172
|
+
return parseProjectCss(css);
|
|
173
173
|
}
|
|
174
174
|
catch {
|
|
175
175
|
return null;
|
|
@@ -287,7 +287,7 @@ function dropFontFaces(styleTexts, hoisted) {
|
|
|
287
287
|
return css;
|
|
288
288
|
let root;
|
|
289
289
|
try {
|
|
290
|
-
root =
|
|
290
|
+
root = parseProjectCss(css);
|
|
291
291
|
}
|
|
292
292
|
catch {
|
|
293
293
|
return css; // unparseable text ships as authored and takes no part
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* data-hf-authored-id for script lookup compatibility.
|
|
7
7
|
*/
|
|
8
8
|
import { replaceMatches, urlHashRefMatches } from "@hyperframes/parsers/css-url-scans";
|
|
9
|
-
import
|
|
9
|
+
import { parseCss } from "@hyperframes/parsers/postcss";
|
|
10
10
|
import { fnv1a32 } from "../canary.js";
|
|
11
11
|
import { escapeCssIdentifier, selectorIdTokens } from "./selectorIdTokens.js";
|
|
12
12
|
import { SVG_REFERENCE_ALIASES_ATTR, readSvgReferenceAliases, recordedSvgIds, rewriteSvgSelectors, } from "./svgSelectorAliases.js";
|
|
@@ -422,7 +422,7 @@ export function rewriteSvgIdReferencesInCss(css, idMap, references = [], charge)
|
|
|
422
422
|
return css;
|
|
423
423
|
let root;
|
|
424
424
|
try {
|
|
425
|
-
root =
|
|
425
|
+
root = parseCss(css);
|
|
426
426
|
}
|
|
427
427
|
catch {
|
|
428
428
|
// Unparseable CSS is the caller's problem to report; leaving it untouched
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readPage } from "./pageTree.js";
|
|
2
|
-
import
|
|
2
|
+
import { parseCss } from "@hyperframes/parsers/postcss";
|
|
3
3
|
function screenStylesheet(media) {
|
|
4
4
|
return !media?.trim() || media.split(",").some((query) => /^(all|screen)$/i.test(query.trim()));
|
|
5
5
|
}
|
|
@@ -24,7 +24,7 @@ function importUrls(css) {
|
|
|
24
24
|
return [];
|
|
25
25
|
let root;
|
|
26
26
|
try {
|
|
27
|
-
root =
|
|
27
|
+
root = parseCss(css);
|
|
28
28
|
}
|
|
29
29
|
catch {
|
|
30
30
|
return [];
|
|
@@ -7,7 +7,7 @@ import { FONT_ALIAS_MAP, resolveAliasDisplayName } from "./aliases.js";
|
|
|
7
7
|
import { extractSfntFace } from "./sfntNames.js";
|
|
8
8
|
import { locateSystemFontVariants, SYSTEM_FONT_SIZE_LIMIT } from "./systemFontLocator.js";
|
|
9
9
|
import { forgetPage, readPage, takePage } from "./pageTree.js";
|
|
10
|
-
import
|
|
10
|
+
import { parseCss } from "@hyperframes/parsers/postcss";
|
|
11
11
|
import { EMBEDDED_FONT_DATA } from "./fontData.generated.js";
|
|
12
12
|
import { fontToDataUri } from "./fontCompression.js";
|
|
13
13
|
import { authoredGoogleFontStylesheets, withPageText } from "./authoredGoogleFonts.js";
|
|
@@ -112,7 +112,7 @@ function systemPrimaryReplacement(value, deterministicPrimary, customProperties)
|
|
|
112
112
|
}
|
|
113
113
|
function parseCssRoot(css) {
|
|
114
114
|
try {
|
|
115
|
-
return
|
|
115
|
+
return parseCss(css);
|
|
116
116
|
}
|
|
117
117
|
catch {
|
|
118
118
|
return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/build-position-edits-render.ts; do not edit.
|
|
2
|
-
const POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function x(){return globalThis}function R(e,t){if(typeof window>"u")return;let o=x(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var T=null;function P(e,t){if(T)try{T({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){R("runtime.analytics.site1",o)}}var I="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function
|
|
2
|
+
const POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function x(){return globalThis}function R(e,t){if(typeof window>"u")return;let o=x(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var T=null;function P(e,t){if(T)try{T({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){R("runtime.analytics.site1",o)}}var I="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===I||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},C=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},$=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>$.test(e)&&$.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,O=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=C(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${E(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${E(r,t)} ${E(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},B=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},b=new WeakMap;function V(e,t){let o=b.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){P("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(w)),s=k(e.getAttribute("data-y"))-k(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,B(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=O(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),b.set(e,e.style.getPropertyValue("translate"))}function h(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!_(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),b.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!_(i)||(V(i,t),s+=1)}return s}var L="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,F=new WeakMap,H=new WeakMap;function W(e){let t=e,o=()=>{try{h(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[L]),s=n=>{D.add(n);try{Object.defineProperty(n,L,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=F.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),F.set(n,u),o(),!0},g=(n,l)=>{let u=H.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),H.set(t,u)}let p=t[n];return p?i(p,l):!1},S=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(S())return;let v=120,A=t.setInterval(()=>{if(S()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function M(){document.querySelector(`[${w}], [${y}]`)&&(h(document),W(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M,{once:!0}):M();})();\n';
|
|
3
3
|
/** Returns the pre-built position-edits render IIFE as a string constant. */
|
|
4
4
|
export function getPositionEditsRenderScript() {
|
|
5
5
|
return POSITION_EDITS_RENDER_IIFE;
|