@hyperframes/core 0.9.92 → 0.9.94
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/clipFacts.d.ts +5 -0
- package/dist/clipFacts.js +21 -6
- package/dist/colorGrading.d.ts +1 -0
- package/dist/colorGrading.js +3 -0
- package/dist/compiler/htmlDocument.js +1 -1
- package/dist/compiler/htmlParityContract.js +1 -1
- package/dist/compiler/standaloneEntry.js +1 -1
- package/dist/figma/sanitizeSvg.js +1 -1
- package/dist/fonts/pageTree.d.ts +1 -1
- package/dist/fonts/pageTree.js +1 -1
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/generators/richTextHtml.js +1 -1
- package/dist/hyperframe.runtime.iife.js +66 -66
- package/dist/mediaGradeAnalyzer.js +3 -3
- package/dist/runtime/clipNodes.d.ts +1 -0
- package/dist/runtime/clipNodes.js +1 -0
- package/dist/runtime/editing/gsapSnapshot.d.ts +1 -0
- package/dist/runtime/editing/gsapSnapshot.js +7 -0
- package/dist/runtime/editing/textEdit.d.ts +23 -0
- package/dist/runtime/editing/textEdit.js +88 -3
- package/dist/runtime/editingDraft.js +31 -9
- package/dist/runtime/editingElement.d.ts +2 -0
- package/dist/runtime/editingElement.js +11 -1
- package/dist/runtime/editingGestureStart.d.ts +5 -1
- package/dist/runtime/editingGestureStart.js +4 -0
- package/dist/runtime/editingPort.d.ts +13 -4
- package/dist/runtime/editingPort.js +14 -3
- package/dist/runtime/timeline.js +14 -1
- package/dist/runtime/types.d.ts +1 -0
- package/dist/utils/inlineTextStyleRange.d.ts +33 -0
- package/dist/utils/inlineTextStyleRange.js +503 -0
- package/dist/utils/inlineTextStyleRead.d.ts +20 -0
- package/dist/utils/inlineTextStyleRead.js +72 -0
- package/package.json +8 -4
package/dist/clipFacts.d.ts
CHANGED
|
@@ -29,4 +29,9 @@ export interface ClipFact {
|
|
|
29
29
|
}
|
|
30
30
|
export declare const byStart: (a: ClipFact, b: ClipFact) => number;
|
|
31
31
|
export { instantTolerance, isInsideSpan, sameInstant, spansOverlap, spansShareTime, } from "@hyperframes/parsers/time-spans";
|
|
32
|
+
export declare const PROMPT_LABEL_MAX = 160;
|
|
33
|
+
/** A project value as one quoted line that reads back to exactly the value, so text around it cannot be imitated. */
|
|
34
|
+
export declare function promptField(value: string): string;
|
|
35
|
+
/** A display label as one quoted line, its whitespace collapsed and its length capped. */
|
|
36
|
+
export declare function promptLabel(value: string): string;
|
|
32
37
|
export declare function formatClipLine(clip: ClipFact): string;
|
package/dist/clipFacts.js
CHANGED
|
@@ -3,20 +3,35 @@ export const byStart = (a, b) => a.start - b.start || a.trackIndex - b.trackInde
|
|
|
3
3
|
const roundTo3 = (n) => Math.round(n * 1000) / 1000;
|
|
4
4
|
const num = (n) => String(roundTo3(n));
|
|
5
5
|
export { instantTolerance, isInsideSpan, sameInstant, spansOverlap, spansShareTime, } from "@hyperframes/parsers/time-spans";
|
|
6
|
+
const CONTROL_BIDI_OR_LINE_SEPARATOR = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu;
|
|
7
|
+
export const PROMPT_LABEL_MAX = 160;
|
|
8
|
+
const escaped = (character) => Array.from({ length: character.length }, (_, i) => `\\u${character.charCodeAt(i).toString(16).padStart(4, "0")}`).join("");
|
|
9
|
+
/** A project value as one quoted line that reads back to exactly the value, so text around it cannot be imitated. */
|
|
10
|
+
export function promptField(value) {
|
|
11
|
+
return JSON.stringify(value).replace(CONTROL_BIDI_OR_LINE_SEPARATOR, escaped);
|
|
12
|
+
}
|
|
13
|
+
/** A display label as one quoted line, its whitespace collapsed and its length capped. */
|
|
14
|
+
export function promptLabel(value) {
|
|
15
|
+
const flat = Array.from(value.replace(CONTROL_BIDI_OR_LINE_SEPARATOR, " ").replace(/\s+/g, " ").trim());
|
|
16
|
+
const kept = flat.length > PROMPT_LABEL_MAX
|
|
17
|
+
? `${flat.slice(0, PROMPT_LABEL_MAX - 1).join("")}…`
|
|
18
|
+
: flat.join("");
|
|
19
|
+
return JSON.stringify(kept);
|
|
20
|
+
}
|
|
6
21
|
export function formatClipLine(clip) {
|
|
7
22
|
const parts = [
|
|
8
|
-
`${clip.kind}
|
|
9
|
-
clip.src && `src=${clip.src}`,
|
|
23
|
+
`${promptField(clip.kind)} ${promptField(clip.id)}`,
|
|
24
|
+
clip.src && `src=${promptField(clip.src)}`,
|
|
10
25
|
`start=${num(clip.start)}`,
|
|
11
26
|
`duration=${num(clip.duration)}`,
|
|
12
27
|
`end=${num(clip.end)}`,
|
|
13
28
|
`track=${clip.trackIndex}`,
|
|
14
29
|
clip.volume !== null && `volume=${num(clip.volume)}`,
|
|
15
30
|
clip.playbackRate !== null && `rate=${num(clip.playbackRate)}`,
|
|
16
|
-
clip.audioGroup && `group=${clip.audioGroup}`,
|
|
17
|
-
clip.role && `role=${clip.role}`,
|
|
18
|
-
clip.sourceFile && `file=${clip.sourceFile}`,
|
|
19
|
-
...clip.lanes.map((lane) =>
|
|
31
|
+
clip.audioGroup && `group=${promptField(clip.audioGroup)}`,
|
|
32
|
+
clip.role && `role=${promptField(clip.role)}`,
|
|
33
|
+
clip.sourceFile && `file=${promptField(clip.sourceFile)}`,
|
|
34
|
+
...clip.lanes.map((lane) => `lane ${promptField(lane.target)}=[${lane.points.map((p) => `${num(p.t)}:${num(p.v)}`).join(", ")}]`),
|
|
20
35
|
];
|
|
21
36
|
return `- ${parts.filter(Boolean).join(" ")}`;
|
|
22
37
|
}
|
package/dist/colorGrading.d.ts
CHANGED
|
@@ -214,6 +214,7 @@ export declare const HF_COLOR_GRADING_HUE_CURVE_KEYS: readonly ["hueVsHue", "hue
|
|
|
214
214
|
export declare const HF_COLOR_GRADING_DETAIL_KEYS: readonly ["vignette", "vignetteMidpoint", "vignetteRoundness", "vignetteFeather", "grain", "grainSize", "grainRoughness"];
|
|
215
215
|
export declare const HF_COLOR_GRADING_EFFECT_KEYS: readonly ["blur", "pixelate", "chromaBleed", "tapeDamage", "tapeTracking", "tapeNoise", "tapeSpeed", "filmArtifacts", "halftone", "halftoneSize", "twoInkPrint", "twoInkPrintSize", "ascii", "asciiSize", "asciiInvert", "asciiStyle", "asciiColor", "asciiRotation", "dither", "ditherSize", "bloom", "bloomRadius", "monoScreen", "monoScreenSize", "monoScreenAngle", "monoScreenSpread", "monoScreenShape", "monoScreenInvert", "scanlines", "scanlineCount", "scanlineSoftness", "chromaticAberration", "chromaticAngle", "crtCurvature", "digitalGlitch", "digitalGlitchColorSplit", "digitalGlitchLineTear", "digitalGlitchPixelate", "digitalGlitchBlockAmount", "digitalGlitchBlockDisplacement", "digitalGlitchBlockOpacity", "digitalGlitchSpeed", "engraving", "engravingSpacing", "engravingMinThickness", "engravingMaxThickness", "engravingAngle", "engravingContrast", "engravingSharpness", "engravingWave", "engravingWaveFrequency", "crosshatch", "crosshatchSpacing", "crosshatchThickness", "crosshatchAngle", "crosshatchContrast", "crosshatchEdges", "crosshatchLineWeight", "crosshatchWave", "crosshatchWaveFrequency", "kuwahara", "kuwaharaRadius", "kuwaharaSharpness", "kuwaharaSaturation"];
|
|
216
216
|
export declare const HF_COLOR_GRADING_PRESETS: readonly HfColorGradingPreset[];
|
|
217
|
+
export declare function isHfColorGradingVariableRef(value: unknown): boolean;
|
|
217
218
|
export declare const HF_COLOR_GRADING_ACTIVE_EFFECT_KEYS: readonly ["blur", "pixelate", "chromaBleed", "tapeDamage", "filmArtifacts", "halftone", "twoInkPrint", "ascii", "dither", "bloom", "monoScreen", "scanlines", "chromaticAberration", "crtCurvature", "digitalGlitch", "engraving", "crosshatch", "kuwahara"];
|
|
218
219
|
export type HfColorGradingActiveEffectKey = (typeof HF_COLOR_GRADING_ACTIVE_EFFECT_KEYS)[number];
|
|
219
220
|
export declare const HF_COLOR_GRADING_EFFECT_PRESETS: HfColorGradingPreset[];
|
package/dist/colorGrading.js
CHANGED
|
@@ -365,6 +365,9 @@ export const HF_COLOR_GRADING_PRESETS = [
|
|
|
365
365
|
];
|
|
366
366
|
const PRESETS_BY_ID = new Map(HF_COLOR_GRADING_PRESETS.map((preset) => [preset.id, preset]));
|
|
367
367
|
const VARIABLE_REF_RE = /^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/;
|
|
368
|
+
export function isHfColorGradingVariableRef(value) {
|
|
369
|
+
return typeof value === "string" && VARIABLE_REF_RE.test(value.trim());
|
|
370
|
+
}
|
|
368
371
|
const ADJUST_LIMITS = {
|
|
369
372
|
exposure: { min: -2, max: 2 },
|
|
370
373
|
contrast: { min: -1, max: 1 },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { acceleratedCanvasTrackerSource } from "../pageMotionBlur.js";
|
|
2
2
|
import { findSceneTemplate, templateContent } from "@hyperframes/parsers/sub-composition-validity";
|
|
3
|
-
import { parseHTML } from "linkedom";
|
|
3
|
+
import { parseHTML } from "@hyperframes/parsers/linkedom";
|
|
4
4
|
import { escapeInlineScriptSource, indexOfLower, lowerAscii, RUNTIME_BOOTSTRAP_ATTR, startsWithLower, } from "./htmlTokens.js";
|
|
5
5
|
export { escapeInlineScriptSource, RUNTIME_BOOTSTRAP_ATTR };
|
|
6
6
|
const RUNTIME_FILES = [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* (linkedom): unknown elements and attributes are dropped by default rather than pattern-matched
|
|
3
3
|
* as dangerous, so a new SVG feature can't reopen a class of bug the way regex denylisting did.
|
|
4
4
|
*/
|
|
5
|
-
import { DOMParser } from "linkedom";
|
|
5
|
+
import { DOMParser } from "@hyperframes/parsers/linkedom";
|
|
6
6
|
import { SVG_ATTRIBUTES as SAFE_ATTRIBUTES, SVG_ELEMENTS as SAFE_ELEMENTS, } from "../utils/svgAllowlist.js";
|
|
7
7
|
function localName(name) {
|
|
8
8
|
const i = name.lastIndexOf(":");
|
package/dist/fonts/pageTree.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseHTML } from "linkedom";
|
|
1
|
+
import { parseHTML } from "@hyperframes/parsers/linkedom";
|
|
2
2
|
export type PageDocument = ReturnType<typeof parseHTML>["document"];
|
|
3
3
|
export declare function readPage(html: string): PageDocument;
|
|
4
4
|
/** The page's tree for a step that edits it: handed over, and no longer the page the readers share. */
|
package/dist/fonts/pageTree.js
CHANGED