@hyperframes/studio 0.8.114 → 0.8.116
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/assets/{hyperframes-player-aXNJKiIg.js → hyperframes-player-mGYvPVpw.js} +1 -1
- package/dist/assets/{index-Bn2RJNTJ.js → index-BWHt0-ir.js} +1 -1
- package/dist/assets/{index-Dz7doz9l.js → index-DYNaXPVf.js} +203 -203
- package/dist/assets/{index-C9N-DGjC.js → index-Dr3hNpvS.js} +1 -1
- package/dist/assets/{index-BYnsJnJV.css → index-t1LH6H5H.css} +1 -1
- package/dist/{chunk-BIUXP3PG.js → chunk-3F47EFCT.js} +142 -277
- package/dist/chunk-3F47EFCT.js.map +1 -0
- package/dist/{chunk-K47E2ZJA.js → chunk-5EKWJZLM.js} +504 -17
- package/dist/chunk-5EKWJZLM.js.map +1 -0
- package/dist/{chunk-VWT7STY3.js → chunk-J6Q572FA.js} +2 -2
- package/dist/{domEditingLayers-V67MS4WP.js → domEditingLayers-OL7GLSS4.js} +3 -5
- package/dist/index.d.ts +146 -40
- package/dist/index.html +2 -2
- package/dist/index.js +4021 -3591
- package/dist/index.js.map +1 -1
- package/dist/player.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +9 -8
- package/src/App.tsx +2 -2
- package/src/captions/hooks/useCaptionSync.ts +10 -6
- package/src/components/LinkedSelectionToggle.tsx +3 -2
- package/src/components/ProjectUnreachableBanner.tsx +3 -3
- package/src/components/dock/Dock.tsx +5 -7
- package/src/components/editor/CanvasContextMenu.tsx +3 -2
- package/src/components/editor/DomEditCropHandles.test.tsx +27 -0
- package/src/components/editor/DomEditCropHandles.tsx +7 -4
- package/src/components/editor/DomEditOverlay.tsx +5 -1
- package/src/components/editor/FileTreeNodes.tsx +13 -10
- package/src/components/editor/MotionPathOverlay.tsx +7 -2
- package/src/components/editor/PropertyPanelEmptyState.tsx +12 -2
- package/src/components/editor/SnapToolbar.test.tsx +100 -1
- package/src/components/editor/SnapToolbar.tsx +43 -5
- package/src/components/editor/anchoredResizeCommitFeedsOffset.test.ts +48 -1
- package/src/components/editor/audioFxTelemetry.ts +2 -3
- package/src/components/editor/commitPreflightHandles.test.tsx +2 -2
- package/src/components/editor/cropResize.ts +4 -3
- package/src/components/editor/domEditingDom.ts +4 -0
- package/src/components/editor/domEditingLayers.ts +1 -5
- package/src/components/editor/domGroupMoveBy.test.tsx +252 -0
- package/src/components/editor/domGroupMoveBy.ts +95 -0
- package/src/components/editor/dragUndoPaint.test.ts +5 -5
- package/src/components/editor/gestureHoldsPreviewReload.test.tsx +33 -0
- package/src/components/editor/manualEditingAvailability.ts +8 -0
- package/src/components/editor/manualEdits.ts +1 -0
- package/src/components/editor/manualEditsParsing.ts +7 -0
- package/src/components/editor/manualOffsetDrag.ts +5 -6
- package/src/components/editor/marqueeCommit.test.tsx +106 -37
- package/src/components/editor/marqueeCommit.ts +24 -8
- package/src/components/editor/motionPathCommit.test.ts +29 -1
- package/src/components/editor/motionPathCommit.ts +21 -9
- package/src/components/editor/motionPathSelection.test.ts +6 -31
- package/src/components/editor/probeSourceElement.test.ts +45 -0
- package/src/components/editor/probeSourceElement.ts +41 -16
- package/src/components/editor/propertyPanelFlatTextSection.tsx +10 -7
- package/src/components/editor/propertyPanelFont.tsx +3 -2
- package/src/components/editor/propertyPanelFxAddMenu.tsx +11 -2
- package/src/components/editor/propertyPanelFxCarveModule.tsx +15 -5
- package/src/components/editor/propertyPanelFxNodeOpenBody.tsx +3 -0
- package/src/components/editor/propertyPanelFxNodeParams.tsx +15 -2
- package/src/components/editor/propertyPanelFxNodeRow.tsx +3 -0
- package/src/components/editor/propertyPanelFxPresetRun.tsx +10 -2
- package/src/components/editor/propertyPanelFxSection.test.tsx +56 -0
- package/src/components/editor/propertyPanelFxSection.tsx +30 -28
- package/src/components/editor/propertyPanelTypes.ts +6 -3
- package/src/components/editor/useColorGradingController.ts +2 -1
- package/src/components/editor/useDomEditNudge.test.tsx +37 -0
- package/src/components/editor/useDomEditNudge.ts +2 -0
- package/src/components/editor/useDomEditOverlayGestures.ts +5 -0
- package/src/components/editor/useDomEditZOrder.ts +12 -2
- package/src/components/editor/useFxCarveNodes.ts +2 -1
- package/src/components/editor/useFxLevelling.ts +2 -1
- package/src/components/feedback/projectProvenance.ts +2 -1
- package/src/components/nle/NLEContext.test.ts +1 -0
- package/src/components/nle/NLEContext.tsx +2 -1
- package/src/components/nle/NLEPreview.tsx +12 -10
- package/src/components/nle/PreviewPoster.tsx +2 -1
- package/src/components/nle/useTimelineEditCallbacks.test.tsx +1 -0
- package/src/components/nle/useTimelineEditCallbacks.ts +7 -1
- package/src/components/renders/useFfmpegStatus.ts +2 -1
- package/src/components/renders/useRenderQueue.ts +5 -4
- package/src/components/sidebar/AssetContextMenu.tsx +4 -4
- package/src/components/sidebar/AssetsTab.tsx +2 -1
- package/src/components/sidebar/GlobalAssetsView.tsx +2 -1
- package/src/components/ui/menuStyle.test.ts +61 -0
- package/src/components/ui/menuStyle.ts +10 -0
- package/src/contexts/DomEditContext.tsx +5 -1
- package/src/contexts/TimelineEditContext.tsx +1 -0
- package/src/domEditExports.test.tsx +9 -1
- package/src/hooks/domEditCommitRunner.ts +1 -1
- package/src/hooks/domSelectionTestHarness.ts +23 -0
- package/src/hooks/domStyleCommit.propertyNames.test.ts +73 -0
- package/src/hooks/domStyleCommit.ts +8 -1
- package/src/hooks/draggedGsapPosition.ts +10 -0
- package/src/hooks/elementOffsetStager.ts +5 -4
- package/src/hooks/gsapDragCommit.test.ts +75 -164
- package/src/hooks/gsapDragCommit.ts +4 -125
- package/src/hooks/gsapDragPositionCommit.ts +36 -384
- package/src/hooks/gsapEditOutcome.ts +22 -2
- package/src/hooks/gsapGestureOutcome.test.ts +161 -0
- package/src/hooks/gsapGestureOutcome.ts +64 -0
- package/src/hooks/gsapGroupPreflight.ts +34 -0
- package/src/hooks/gsapKeyframeCommit.ts +3 -12
- package/src/hooks/gsapMutationClient.ts +4 -3
- package/src/hooks/gsapParsedTween.test-helpers.ts +75 -0
- package/src/hooks/gsapParsedTween.test.ts +62 -0
- package/src/hooks/gsapParsedTween.ts +243 -0
- package/src/hooks/gsapPositionDetection.test.ts +78 -0
- package/src/hooks/gsapPositionDetection.ts +52 -33
- package/src/hooks/gsapResizeDropPoint.test.ts +4 -3
- package/src/hooks/gsapResizeElementSize.test.tsx +1 -0
- package/src/hooks/gsapResizeGeometrySweep.test.ts +13 -25
- package/src/hooks/gsapResizeIntercept.test.ts +96 -11
- package/src/hooks/gsapResizeIntercept.ts +79 -168
- package/src/hooks/gsapResizeSweep.test.ts +16 -33
- package/src/hooks/gsapRuntimeBridge.sharedTween.test.ts +6 -8
- package/src/hooks/gsapRuntimeBridge.test.ts +41 -6
- package/src/hooks/gsapRuntimeBridge.ts +105 -131
- package/src/hooks/gsapScriptCommitHelpers.ts +2 -1
- package/src/hooks/gsapScriptCommitTypes.ts +13 -0
- package/src/hooks/gsapShared.ts +7 -0
- package/src/hooks/gsapShared.writeTarget.test.ts +45 -57
- package/src/hooks/gsapValueAtPlayhead.browser.test.ts +83 -0
- package/src/hooks/gsapValueAtPlayhead.realGsap.test.ts +179 -0
- package/src/hooks/gsapValueAtPlayhead.test.ts +552 -0
- package/src/hooks/gsapValueAtPlayhead.ts +292 -0
- package/src/hooks/gsapWholePropertyOffsetCommit.test.ts +43 -0
- package/src/hooks/gsapWholePropertyOffsetCommit.ts +2 -3
- package/src/hooks/keyframeCacheAstLoad.ts +8 -6
- package/src/hooks/newTweenTarget.test.ts +41 -76
- package/src/hooks/plainRotation.ts +3 -2
- package/src/hooks/previewPromotionSelection.test.tsx +1 -1
- package/src/hooks/refreshTimelineRowText.test.ts +65 -0
- package/src/hooks/refreshTimelineRowText.ts +29 -0
- package/src/hooks/timelineTimingSync.test.ts +1 -0
- package/src/hooks/timelineTimingSync.ts +2 -1
- package/src/hooks/useAnimatedPropertyCommit.test.tsx +46 -5
- package/src/hooks/useAnimatedPropertyCommit.ts +2 -2
- package/src/hooks/useAskAgentModal.ts +2 -1
- package/src/hooks/useBlockCatalog.ts +2 -1
- package/src/hooks/useBlockedTimelineEditToast.ts +12 -3
- package/src/hooks/useCaptionDetection.ts +2 -1
- package/src/hooks/useCompositionContentLoader.ts +2 -1
- package/src/hooks/useDomEditCommitsHelpers.ts +3 -2
- package/src/hooks/useDomEditPositionPatchCommit.ts +18 -23
- package/src/hooks/useDomEditSession.test.tsx +30 -1
- package/src/hooks/useDomEditSession.ts +10 -0
- package/src/hooks/useDomEditTextCommits.test.tsx +41 -0
- package/src/hooks/useDomEditTextCommits.ts +13 -3
- package/src/hooks/useDomEditWiring.ts +4 -2
- package/src/hooks/useDomGeometryCommit.test.tsx +25 -6
- package/src/hooks/useDomGeometryCommit.ts +8 -4
- package/src/hooks/useDomGeometryCommits.test.tsx +1 -0
- package/src/hooks/useDomGeometryCommits.ts +3 -2
- package/src/hooks/useDomSelection.test.ts +26 -0
- package/src/hooks/useDomSelection.ts +10 -3
- package/src/hooks/useDomSelectionTypes.ts +6 -1
- package/src/hooks/useEditHistoryActions.paint.test.tsx +82 -20
- package/src/hooks/useEditHistoryActions.test.tsx +15 -0
- package/src/hooks/useEditHistoryActions.ts +16 -5
- package/src/hooks/useElementLifecycleOps.ts +2 -1
- package/src/hooks/useEnableKeyframes.test.ts +34 -3
- package/src/hooks/useEnableKeyframes.ts +7 -4
- package/src/hooks/useExternalFileChangeCoordinator.test.tsx +121 -0
- package/src/hooks/useExternalFileChangeCoordinator.ts +35 -8
- package/src/hooks/useFileManager.projectOwnership.test.tsx +6 -1
- package/src/hooks/useFileManager.ts +14 -10
- package/src/hooks/useFileTree.ts +3 -2
- package/src/hooks/useFrameCapture.ts +5 -1
- package/src/hooks/useFreezeFrame.ts +3 -2
- package/src/hooks/useGestureCommit.test.tsx +225 -55
- package/src/hooks/useGestureCommit.ts +86 -55
- package/src/hooks/useGroupCommits.ts +2 -1
- package/src/hooks/useGsapAwareEditing.groupPlan.test.tsx +160 -0
- package/src/hooks/useGsapAwareEditing.test.tsx +28 -35
- package/src/hooks/useGsapAwareEditing.testHelpers.tsx +42 -0
- package/src/hooks/useGsapAwareEditing.ts +101 -195
- package/src/hooks/useGsapAwareGroupMove.ts +179 -0
- package/src/hooks/useGsapInteractionFailureTelemetry.ts +10 -4
- package/src/hooks/useGsapKeyframeOps.sdkUsage.test.tsx +114 -0
- package/src/hooks/useGsapKeyframeOps.ts +36 -10
- package/src/hooks/useGsapScriptCommits.test.tsx +60 -1
- package/src/hooks/useGsapScriptCommits.ts +15 -10
- package/src/hooks/useGsapSelectionHandlers.test.tsx +1 -1
- package/src/hooks/useGsapSelectionHandlers.ts +24 -18
- package/src/hooks/useGsapTweenCache.ts +18 -12
- package/src/hooks/useLintModal.ts +2 -1
- package/src/hooks/usePersistentEditHistory.test.ts +277 -1
- package/src/hooks/usePersistentEditHistory.ts +47 -8
- package/src/hooks/usePopulateKeyframeCacheForFile.test.tsx +76 -2
- package/src/hooks/usePreviewInteraction.test.ts +21 -0
- package/src/hooks/usePreviewInteraction.ts +2 -0
- package/src/hooks/usePreviewPersistence.history.test.tsx +14 -3
- package/src/hooks/usePreviewPersistence.ts +13 -11
- package/src/hooks/useProjectFileWriter.ts +20 -19
- package/src/hooks/useRemoveBackground.ts +2 -1
- package/src/hooks/useRenderClipContent.test.ts +18 -0
- package/src/hooks/useRenderClipContent.ts +4 -5
- package/src/hooks/useSdkSession.ts +2 -1
- package/src/hooks/useServerConnection.ts +4 -3
- package/src/hooks/useStudioSelectionPublisher.ts +2 -1
- package/src/hooks/useThumbnailStill.test.ts +100 -0
- package/src/hooks/useThumbnailStill.ts +37 -0
- package/src/hooks/useTimelineDeleteOps.test.tsx +30 -22
- package/src/hooks/useTimelineDeleteOps.ts +22 -27
- package/src/hooks/useTimelineEditing.test.tsx +1 -1
- package/src/index.ts +4 -0
- package/src/player/components/AudioWaveform.tsx +3 -2
- package/src/player/components/AutomationSelectionMenu.tsx +3 -2
- package/src/player/components/ClipContextMenu.test.tsx +73 -0
- package/src/player/components/ClipContextMenu.tsx +33 -31
- package/src/player/components/CompositionThumbnail.tsx +2 -1
- package/src/player/components/KeyframeDiamondContextMenu.tsx +8 -9
- package/src/player/components/OutOfSyncBadge.tsx +5 -5
- package/src/player/components/TextClipContent.test.ts +19 -0
- package/src/player/components/TextClipContent.tsx +27 -0
- package/src/player/components/TrackGapContextMenu.tsx +3 -6
- package/src/player/components/clipMenuNormalize.ts +2 -1
- package/src/player/components/clipMenuToolItems.test.tsx +23 -0
- package/src/player/components/clipMenuToolItems.tsx +13 -9
- package/src/player/components/clipPeakMap.ts +2 -1
- package/src/player/components/timelineCallbacks.ts +1 -0
- package/src/player/components/timelineClipDragGestureLifecycle.ts +1 -1
- package/src/player/components/timelineClipGestureHandlers.test.ts +94 -0
- package/src/player/components/timelineClipGestureHandlers.ts +20 -2
- package/src/player/components/timelineEditing.ts +3 -1
- package/src/player/components/timelineLinkSelection.ts +35 -1
- package/src/player/components/useTimelineClipDrag.keyboard.test.tsx +14 -0
- package/src/player/components/useTimelineClipDrag.ts +6 -7
- package/src/player/hooks/timelinePlayerSync.test.ts +6 -0
- package/src/player/hooks/timelinePlayerSync.ts +6 -1
- package/src/player/hooks/useTimelinePlayer.ts +5 -1
- package/src/player/lib/thumbnailScheduler.test.ts +16 -0
- package/src/player/lib/thumbnailScheduler.ts +10 -2
- package/src/player/lib/timelineElementHelpers.test.ts +87 -1
- package/src/player/lib/timelineElementHelpers.ts +6 -15
- package/src/player/lib/timelineText.ts +40 -0
- package/src/player/sceneSwap.ts +2 -1
- package/src/player/store/timelineElement.ts +12 -0
- package/src/styles/theme.css +3 -0
- package/src/telemetry/client.ts +2 -1
- package/src/utils/blockInstaller.ts +2 -1
- package/src/utils/elementGsap.test.ts +9 -0
- package/src/utils/elementGsap.ts +7 -0
- package/src/utils/gsapSoftReload.ts +2 -3
- package/src/utils/gsapUndoRestore.browser.test.ts +51 -45
- package/src/utils/gsapUndoRestore.ts +3 -6
- package/src/utils/keyframeUsage.ts +79 -0
- package/src/utils/previewFeatureUsage.test.ts +32 -0
- package/src/utils/previewFeatureUsage.ts +46 -0
- package/src/utils/previewPrefetch.ts +2 -1
- package/src/utils/razorSplitTransaction.ts +12 -8
- package/src/utils/softReloadTargets.ts +1 -3
- package/src/utils/studioApiFetch.test.ts +75 -0
- package/src/utils/studioApiFetch.ts +13 -0
- package/src/utils/studioFileHistory.ts +4 -1
- package/src/utils/studioHelpers.ts +7 -1
- package/src/utils/studioPendingEdits.test.ts +23 -6
- package/src/utils/studioPendingEdits.ts +32 -8
- package/src/utils/studioTelemetry.test.ts +107 -0
- package/src/utils/studioTelemetry.ts +51 -5
- package/src/utils/timelineCompositionInsert.ts +3 -2
- package/src/webmcp/StudioAgentTools.tsx +4 -3
- package/dist/chunk-BIUXP3PG.js.map +0 -1
- package/dist/chunk-K47E2ZJA.js.map +0 -1
- /package/dist/{chunk-VWT7STY3.js.map → chunk-J6Q572FA.js.map} +0 -0
- /package/dist/{domEditingLayers-V67MS4WP.js.map → domEditingLayers-OL7GLSS4.js.map} +0 -0
|
@@ -1,33 +1,155 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildElementLabel,
|
|
2
3
|
buildProjectApiPath,
|
|
3
|
-
|
|
4
|
+
buildStableSelector,
|
|
5
|
+
escapeCssString,
|
|
6
|
+
findClosestByAttribute,
|
|
7
|
+
getCompositionSourceMapRevision,
|
|
8
|
+
getCuratedComputedStyles,
|
|
9
|
+
getDataAttributes,
|
|
10
|
+
getInlineStyles,
|
|
11
|
+
getSelectorIndex,
|
|
12
|
+
getSourceFileForElement,
|
|
4
13
|
isAudibleVideoNode,
|
|
14
|
+
isEditableTextLeaf,
|
|
15
|
+
isElementVisibleThroughAncestors,
|
|
16
|
+
isHtmlElement,
|
|
17
|
+
normalizeTimelineCompositionSource,
|
|
18
|
+
parsePx,
|
|
19
|
+
querySelectorAllSafely,
|
|
5
20
|
withSelectorIndexPass
|
|
6
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5EKWJZLM.js";
|
|
22
|
+
import {
|
|
23
|
+
__export
|
|
24
|
+
} from "./chunk-PZ5AY32C.js";
|
|
25
|
+
|
|
26
|
+
// src/components/editor/manualEditingAvailability.ts
|
|
27
|
+
var manualEditingAvailability_exports = {};
|
|
28
|
+
__export(manualEditingAvailability_exports, {
|
|
29
|
+
STUDIO_API_SAME_ORIGIN_CREDENTIALS: () => STUDIO_API_SAME_ORIGIN_CREDENTIALS,
|
|
30
|
+
STUDIO_FLAT_INSPECTOR_ENABLED: () => STUDIO_FLAT_INSPECTOR_ENABLED,
|
|
31
|
+
STUDIO_SDK_CUTOVER_ENABLED: () => STUDIO_SDK_CUTOVER_ENABLED,
|
|
32
|
+
STUDIO_SDK_CUTOVER_FAMILIES: () => STUDIO_SDK_CUTOVER_FAMILIES,
|
|
33
|
+
STUDIO_SDK_RESOLVER_SHADOW_ENABLED: () => STUDIO_SDK_RESOLVER_SHADOW_ENABLED,
|
|
34
|
+
resolveStudioBooleanEnvFlag: () => resolveStudioBooleanEnvFlag
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// src/utils/sdkCutoverPolicy.ts
|
|
38
|
+
var STUDIO_SDK_OPERATION_FAMILIES = [
|
|
39
|
+
"dom",
|
|
40
|
+
"timing",
|
|
41
|
+
"gsap-animation",
|
|
42
|
+
"gsap-keyframe",
|
|
43
|
+
"lifecycle"
|
|
44
|
+
];
|
|
45
|
+
function resolveEnabledSdkFamilies(env2, masterEnabled) {
|
|
46
|
+
if (!masterEnabled) return /* @__PURE__ */ new Set();
|
|
47
|
+
const raw = env2["VITE_STUDIO_SDK_CUTOVER_FAMILIES"];
|
|
48
|
+
if (typeof raw !== "string" || raw.trim() === "") return new Set(STUDIO_SDK_OPERATION_FAMILIES);
|
|
49
|
+
const requested = raw.split(",").map((family) => family.trim()).filter(Boolean);
|
|
50
|
+
const known = new Set(STUDIO_SDK_OPERATION_FAMILIES);
|
|
51
|
+
const unknown = requested.filter((family) => !known.has(family));
|
|
52
|
+
if (unknown.length > 0) {
|
|
53
|
+
throw new Error(`Unknown Studio SDK cutover families: ${unknown.join(", ")}`);
|
|
54
|
+
}
|
|
55
|
+
return new Set(requested);
|
|
56
|
+
}
|
|
57
|
+
function isSdkFamilyEnabled(masterEnabled, configured, family) {
|
|
58
|
+
return masterEnabled && (configured?.has(family) ?? true);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/components/editor/manualEditingAvailability.ts
|
|
62
|
+
var TRUTHY_ENV_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on", "enabled"]);
|
|
63
|
+
var FALSY_ENV_VALUES = /* @__PURE__ */ new Set(["0", "false", "no", "off", "disabled"]);
|
|
64
|
+
function resolveStudioBooleanEnvFlag(env2, names, fallback) {
|
|
65
|
+
for (const name of names) {
|
|
66
|
+
const value = env2[name];
|
|
67
|
+
if (typeof value === "boolean") return value;
|
|
68
|
+
if (typeof value !== "string") continue;
|
|
69
|
+
const normalized = value.trim().toLowerCase();
|
|
70
|
+
if (!normalized) continue;
|
|
71
|
+
if (TRUTHY_ENV_VALUES.has(normalized)) return true;
|
|
72
|
+
if (FALSY_ENV_VALUES.has(normalized)) return false;
|
|
73
|
+
}
|
|
74
|
+
return fallback;
|
|
75
|
+
}
|
|
76
|
+
var runtimeEnv = typeof window !== "undefined" ? window.__HF_STUDIO_ENV__ ?? {} : {};
|
|
77
|
+
var env = { ...import.meta.env ?? {}, ...runtimeEnv };
|
|
78
|
+
var STUDIO_SDK_CUTOVER_ENABLED = resolveStudioBooleanEnvFlag(
|
|
79
|
+
env,
|
|
80
|
+
["VITE_STUDIO_SDK_CUTOVER_ENABLED"],
|
|
81
|
+
true
|
|
82
|
+
);
|
|
83
|
+
var STUDIO_SDK_CUTOVER_FAMILIES = resolveEnabledSdkFamilies(
|
|
84
|
+
env,
|
|
85
|
+
STUDIO_SDK_CUTOVER_ENABLED
|
|
86
|
+
);
|
|
87
|
+
var STUDIO_SDK_RESOLVER_SHADOW_ENABLED = resolveStudioBooleanEnvFlag(
|
|
88
|
+
env,
|
|
89
|
+
["VITE_STUDIO_SDK_RESOLVER_SHADOW_ENABLED"],
|
|
90
|
+
true
|
|
91
|
+
);
|
|
92
|
+
var STUDIO_FLAT_INSPECTOR_ENABLED = resolveStudioBooleanEnvFlag(
|
|
93
|
+
env,
|
|
94
|
+
["VITE_STUDIO_ENABLE_FLAT_INSPECTOR", "VITE_STUDIO_FLAT_INSPECTOR_ENABLED"],
|
|
95
|
+
true
|
|
96
|
+
);
|
|
97
|
+
var STUDIO_API_SAME_ORIGIN_CREDENTIALS = resolveStudioBooleanEnvFlag(
|
|
98
|
+
env,
|
|
99
|
+
["VITE_STUDIO_API_SAME_ORIGIN_CREDENTIALS"],
|
|
100
|
+
false
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// src/utils/studioApiFetch.ts
|
|
104
|
+
var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
105
|
+
function studioApiCredentials() {
|
|
106
|
+
if (STUDIO_API_SAME_ORIGIN_CREDENTIALS) return "same-origin";
|
|
107
|
+
const host = globalThis.location?.hostname;
|
|
108
|
+
return !host || LOOPBACK_HOSTS.has(host) ? "omit" : "same-origin";
|
|
109
|
+
}
|
|
110
|
+
function studioApiFetch(input, init) {
|
|
111
|
+
return globalThis.fetch(input, { ...init, credentials: studioApiCredentials() });
|
|
112
|
+
}
|
|
7
113
|
|
|
8
114
|
// src/components/editor/probeSourceElement.ts
|
|
9
|
-
|
|
115
|
+
var pending = /* @__PURE__ */ new Map();
|
|
116
|
+
async function sendBatch(projectId, sourceFile, probes) {
|
|
117
|
+
let exists = [];
|
|
10
118
|
try {
|
|
11
|
-
const response = await
|
|
119
|
+
const response = await studioApiFetch(
|
|
12
120
|
buildProjectApiPath(
|
|
13
121
|
projectId,
|
|
14
|
-
`/file-mutations/probe-
|
|
122
|
+
`/file-mutations/probe-elements/${encodeURIComponent(sourceFile)}`
|
|
15
123
|
),
|
|
16
124
|
{
|
|
17
125
|
method: "POST",
|
|
18
126
|
headers: { "Content-Type": "application/json" },
|
|
19
|
-
body: JSON.stringify({ target })
|
|
127
|
+
body: JSON.stringify({ targets: probes.map((probe) => probe.target) })
|
|
20
128
|
}
|
|
21
129
|
);
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return false;
|
|
130
|
+
if (response.ok) {
|
|
131
|
+
const data = await response.json();
|
|
132
|
+
if (Array.isArray(data?.exists)) exists = data.exists;
|
|
26
133
|
}
|
|
27
|
-
return true;
|
|
28
134
|
} catch {
|
|
29
|
-
return true;
|
|
30
135
|
}
|
|
136
|
+
probes.forEach((probe, index) => probe.resolve(exists[index] !== false));
|
|
137
|
+
}
|
|
138
|
+
function probeSourceElement(projectId, sourceFile, target) {
|
|
139
|
+
return new Promise((resolve) => {
|
|
140
|
+
const key = `${projectId}\0${sourceFile}`;
|
|
141
|
+
let probes = pending.get(key);
|
|
142
|
+
if (!probes) {
|
|
143
|
+
const batch = [];
|
|
144
|
+
probes = batch;
|
|
145
|
+
pending.set(key, batch);
|
|
146
|
+
setTimeout(() => {
|
|
147
|
+
pending.delete(key);
|
|
148
|
+
void sendBatch(projectId, sourceFile, batch);
|
|
149
|
+
}, 0);
|
|
150
|
+
}
|
|
151
|
+
probes.push({ target, resolve });
|
|
152
|
+
});
|
|
31
153
|
}
|
|
32
154
|
|
|
33
155
|
// src/components/editor/domEditingLayers.ts
|
|
@@ -36,258 +158,6 @@ import {
|
|
|
36
158
|
resolveEditingSections
|
|
37
159
|
} from "@hyperframes/core/editing";
|
|
38
160
|
|
|
39
|
-
// src/components/editor/domEditingDom.ts
|
|
40
|
-
import { COLOR_GRADING_SOURCE_HIDDEN_ATTR } from "@hyperframes/core/color-grading";
|
|
41
|
-
|
|
42
|
-
// src/components/editor/domEditingTypes.ts
|
|
43
|
-
var CURATED_STYLE_PROPERTIES = [
|
|
44
|
-
"position",
|
|
45
|
-
"display",
|
|
46
|
-
"top",
|
|
47
|
-
"left",
|
|
48
|
-
"right",
|
|
49
|
-
"bottom",
|
|
50
|
-
"inset",
|
|
51
|
-
"width",
|
|
52
|
-
"height",
|
|
53
|
-
"gap",
|
|
54
|
-
"justify-content",
|
|
55
|
-
"align-items",
|
|
56
|
-
"flex-direction",
|
|
57
|
-
"font-size",
|
|
58
|
-
"font-style",
|
|
59
|
-
"font-weight",
|
|
60
|
-
"font-family",
|
|
61
|
-
"line-height",
|
|
62
|
-
"letter-spacing",
|
|
63
|
-
"text-align",
|
|
64
|
-
"text-transform",
|
|
65
|
-
"color",
|
|
66
|
-
"background-color",
|
|
67
|
-
"background-image",
|
|
68
|
-
"opacity",
|
|
69
|
-
"mix-blend-mode",
|
|
70
|
-
"border-radius",
|
|
71
|
-
"border-width",
|
|
72
|
-
"border-style",
|
|
73
|
-
"border-color",
|
|
74
|
-
"border-top-width",
|
|
75
|
-
"border-top-style",
|
|
76
|
-
"border-top-color",
|
|
77
|
-
"outline-color",
|
|
78
|
-
"overflow",
|
|
79
|
-
"clip-path",
|
|
80
|
-
"box-shadow",
|
|
81
|
-
"filter",
|
|
82
|
-
"backdrop-filter",
|
|
83
|
-
"z-index",
|
|
84
|
-
"transform",
|
|
85
|
-
"object-fit",
|
|
86
|
-
"object-position"
|
|
87
|
-
];
|
|
88
|
-
|
|
89
|
-
// src/components/editor/domEditingDom.ts
|
|
90
|
-
import { parsePx } from "@hyperframes/core/editing";
|
|
91
|
-
function isHtmlElement(value) {
|
|
92
|
-
return typeof value === "object" && value !== null && "nodeType" in value && typeof value.nodeType === "number" && value.nodeType === 1;
|
|
93
|
-
}
|
|
94
|
-
function isTextBearingTag(tagName) {
|
|
95
|
-
return ["div", "span", "p", "strong", "h1", "h2", "h3", "h4", "h5", "h6"].includes(tagName);
|
|
96
|
-
}
|
|
97
|
-
function elementRendersItself(win, el) {
|
|
98
|
-
const computed = win.getComputedStyle(el);
|
|
99
|
-
if (computed.display === "none" || computed.visibility === "hidden") return false;
|
|
100
|
-
const opacity = Number.parseFloat(computed.opacity);
|
|
101
|
-
return !(Number.isFinite(opacity) && opacity <= 0.01 && !el.hasAttribute(COLOR_GRADING_SOURCE_HIDDEN_ATTR));
|
|
102
|
-
}
|
|
103
|
-
function isElementVisibleThroughAncestors(el, memo) {
|
|
104
|
-
const win = el.ownerDocument.defaultView;
|
|
105
|
-
if (!win) return true;
|
|
106
|
-
const pending = [];
|
|
107
|
-
let inherited = true;
|
|
108
|
-
for (let node = el; node; node = node.parentElement) {
|
|
109
|
-
const answered = memo?.get(node);
|
|
110
|
-
if (answered !== void 0) {
|
|
111
|
-
inherited = answered;
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
pending.push(node);
|
|
115
|
-
}
|
|
116
|
-
for (let i = pending.length - 1; i >= 0; i -= 1) {
|
|
117
|
-
const node = pending[i];
|
|
118
|
-
inherited = inherited && elementRendersItself(win, node);
|
|
119
|
-
memo?.set(node, inherited);
|
|
120
|
-
}
|
|
121
|
-
return inherited;
|
|
122
|
-
}
|
|
123
|
-
function getCuratedComputedStyles(el) {
|
|
124
|
-
const styles = {};
|
|
125
|
-
const computed = el.ownerDocument.defaultView?.getComputedStyle(el);
|
|
126
|
-
if (!computed) return styles;
|
|
127
|
-
for (const prop of CURATED_STYLE_PROPERTIES) {
|
|
128
|
-
const value = computed.getPropertyValue(prop);
|
|
129
|
-
if (value) styles[prop] = value;
|
|
130
|
-
}
|
|
131
|
-
return styles;
|
|
132
|
-
}
|
|
133
|
-
function getInlineStyles(el) {
|
|
134
|
-
const styles = {};
|
|
135
|
-
for (const property of CURATED_STYLE_PROPERTIES) {
|
|
136
|
-
const value = el.style.getPropertyValue(property);
|
|
137
|
-
if (value) styles[property] = value;
|
|
138
|
-
}
|
|
139
|
-
return styles;
|
|
140
|
-
}
|
|
141
|
-
function getDataAttributes(el) {
|
|
142
|
-
const attrs = {};
|
|
143
|
-
for (const attr of el.attributes) {
|
|
144
|
-
if (attr.name.startsWith("data-")) {
|
|
145
|
-
attrs[attr.name.slice(5)] = attr.value;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return attrs;
|
|
149
|
-
}
|
|
150
|
-
function findClosestByAttribute(el, attributeNames) {
|
|
151
|
-
let current = el;
|
|
152
|
-
while (current) {
|
|
153
|
-
const candidate = current;
|
|
154
|
-
if (attributeNames.some((attribute) => candidate.hasAttribute(attribute))) {
|
|
155
|
-
return candidate;
|
|
156
|
-
}
|
|
157
|
-
current = current.parentElement;
|
|
158
|
-
}
|
|
159
|
-
return null;
|
|
160
|
-
}
|
|
161
|
-
var compositionSourceMap = /* @__PURE__ */ new Map();
|
|
162
|
-
var compositionSourceMapRevision = 0;
|
|
163
|
-
function setCompositionSourceMap(map) {
|
|
164
|
-
compositionSourceMap = map;
|
|
165
|
-
compositionSourceMapRevision += 1;
|
|
166
|
-
}
|
|
167
|
-
function getCompositionSourceMapRevision() {
|
|
168
|
-
return compositionSourceMapRevision;
|
|
169
|
-
}
|
|
170
|
-
function sourceFromCompositionId(ownerRoot) {
|
|
171
|
-
if (!ownerRoot || compositionSourceMap.size === 0) return void 0;
|
|
172
|
-
const authored = ownerRoot.getAttribute("data-hf-original-composition-id");
|
|
173
|
-
const current = ownerRoot.getAttribute("data-composition-id");
|
|
174
|
-
return (authored ? compositionSourceMap.get(authored) : void 0) ?? (current ? compositionSourceMap.get(current) : void 0);
|
|
175
|
-
}
|
|
176
|
-
function getSourceFileForElement(el, activeCompositionPath) {
|
|
177
|
-
const sourceHost = findClosestByAttribute(el, ["data-composition-file", "data-composition-src"]);
|
|
178
|
-
const ownerRoot = findClosestByAttribute(el, ["data-composition-id"]);
|
|
179
|
-
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";
|
|
180
|
-
return {
|
|
181
|
-
sourceFile,
|
|
182
|
-
compositionPath: sourceFile
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function normalizeTimelineCompositionSource(value) {
|
|
186
|
-
const trimmed = value?.trim();
|
|
187
|
-
if (!trimmed) return void 0;
|
|
188
|
-
if (!/^([a-z][a-z0-9+.-]*:|\/)/i.test(trimmed)) return trimmed;
|
|
189
|
-
let pathname = trimmed;
|
|
190
|
-
try {
|
|
191
|
-
pathname = new URL(trimmed, "http://studio.local").pathname;
|
|
192
|
-
} catch {
|
|
193
|
-
pathname = trimmed;
|
|
194
|
-
}
|
|
195
|
-
for (const marker of ["/preview/comp/", "/preview/"]) {
|
|
196
|
-
const markerIndex = pathname.indexOf(marker);
|
|
197
|
-
if (markerIndex < 0) continue;
|
|
198
|
-
const sourcePath = pathname.slice(markerIndex + marker.length).replace(/^\/+/, "");
|
|
199
|
-
return sourcePath || trimmed;
|
|
200
|
-
}
|
|
201
|
-
return trimmed;
|
|
202
|
-
}
|
|
203
|
-
function escapeCssIdentifier(value) {
|
|
204
|
-
const css = globalThis.CSS;
|
|
205
|
-
if (typeof css?.escape === "function") return css.escape(value);
|
|
206
|
-
if (value === "-") return "\\-";
|
|
207
|
-
let escaped = "";
|
|
208
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
209
|
-
const char = value[index] ?? "";
|
|
210
|
-
const code = char.charCodeAt(0);
|
|
211
|
-
if (code === 0) {
|
|
212
|
-
escaped += "\uFFFD";
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
const isDigit = code >= 48 && code <= 57;
|
|
216
|
-
const isUpperAlpha = code >= 65 && code <= 90;
|
|
217
|
-
const isLowerAlpha = code >= 97 && code <= 122;
|
|
218
|
-
const isControl = code >= 1 && code <= 31 || code === 127;
|
|
219
|
-
const isLeadingDigit = index === 0 && isDigit;
|
|
220
|
-
const isSecondDigitAfterDash = index === 1 && value.startsWith("-") && isDigit;
|
|
221
|
-
if (isControl || isLeadingDigit || isSecondDigitAfterDash) {
|
|
222
|
-
escaped += `\\${code.toString(16)} `;
|
|
223
|
-
continue;
|
|
224
|
-
}
|
|
225
|
-
if (isUpperAlpha || isLowerAlpha || isDigit || char === "-" || char === "_" || code >= 128) {
|
|
226
|
-
escaped += char;
|
|
227
|
-
continue;
|
|
228
|
-
}
|
|
229
|
-
escaped += `\\${char}`;
|
|
230
|
-
}
|
|
231
|
-
return escaped;
|
|
232
|
-
}
|
|
233
|
-
function escapeCssString(value) {
|
|
234
|
-
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\a ").replace(/\r/g, "\\d ").replace(/\f/g, "\\c ");
|
|
235
|
-
}
|
|
236
|
-
function querySelectorAllSafely(doc, selector) {
|
|
237
|
-
try {
|
|
238
|
-
return Array.from(doc.querySelectorAll(selector));
|
|
239
|
-
} catch {
|
|
240
|
-
return [];
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
function humanizeIdentifier(value) {
|
|
244
|
-
return value.replace(/\.html$/i, "").replace(/^compositions\//i, "").split("/").at(-1)?.replace(/[-_]+/g, " ").replace(/\b\w/g, (char) => char.toUpperCase()) ?? value;
|
|
245
|
-
}
|
|
246
|
-
function buildStableSelector(el) {
|
|
247
|
-
if (el.id) return `#${escapeCssIdentifier(el.id)}`;
|
|
248
|
-
const compositionId = el.getAttribute("data-composition-id");
|
|
249
|
-
if (compositionId) return `[data-composition-id="${escapeCssString(compositionId)}"]`;
|
|
250
|
-
const group = el.getAttribute("data-hf-group");
|
|
251
|
-
if (group) return `[data-hf-group="${escapeCssString(group)}"]`;
|
|
252
|
-
return getPreferredClassSelector(el);
|
|
253
|
-
}
|
|
254
|
-
function getPreferredClassSelector(el) {
|
|
255
|
-
const classes = Array.from(el.classList).map((value) => value.trim()).filter(Boolean);
|
|
256
|
-
if (classes.length === 0) return void 0;
|
|
257
|
-
const preferred = classes.find((value) => value !== "clip" && !value.startsWith("__hf-")) ?? classes[0];
|
|
258
|
-
return preferred ? `.${escapeCssIdentifier(preferred)}` : void 0;
|
|
259
|
-
}
|
|
260
|
-
function buildElementLabel(el) {
|
|
261
|
-
const compositionId = el.getAttribute("data-hf-original-composition-id") ?? el.getAttribute("data-composition-id");
|
|
262
|
-
if (compositionId && compositionId !== "main") {
|
|
263
|
-
return humanizeIdentifier(compositionId);
|
|
264
|
-
}
|
|
265
|
-
const compositionSrc = el.getAttribute("data-composition-src") ?? el.getAttribute("data-composition-file");
|
|
266
|
-
if (compositionSrc) {
|
|
267
|
-
return humanizeIdentifier(compositionSrc);
|
|
268
|
-
}
|
|
269
|
-
const group = el.getAttribute("data-hf-group");
|
|
270
|
-
if (group) return group;
|
|
271
|
-
if (el.id) return humanizeIdentifier(el.id);
|
|
272
|
-
const preferredClass = getPreferredClassSelector(el);
|
|
273
|
-
if (preferredClass) {
|
|
274
|
-
return humanizeIdentifier(preferredClass.replace(/^\./, ""));
|
|
275
|
-
}
|
|
276
|
-
const text = (el.textContent ?? "").trim().replace(/\s+/g, " ");
|
|
277
|
-
if (text) return text.length > 40 ? `${text.slice(0, 39)}\u2026` : text;
|
|
278
|
-
return el.tagName.toLowerCase();
|
|
279
|
-
}
|
|
280
|
-
function getSelectorIndex(doc, el, selector, sourceFile, activeCompositionPath) {
|
|
281
|
-
if (!selector?.startsWith(".")) return void 0;
|
|
282
|
-
return getSourceScopedSelectorIndex(
|
|
283
|
-
doc,
|
|
284
|
-
el,
|
|
285
|
-
selector,
|
|
286
|
-
sourceFile,
|
|
287
|
-
(candidate) => isHtmlElement(candidate) ? getSourceFileForElement(candidate, activeCompositionPath).sourceFile : void 0
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
161
|
// src/components/editor/domEditingGroups.ts
|
|
292
162
|
function groupScopedLayerRoots(root, activeGroupElement) {
|
|
293
163
|
const els = activeGroupElement?.isConnected ? Array.from(activeGroupElement.children) : [root];
|
|
@@ -660,9 +530,6 @@ function drainPendingLayerMutations(observer, cache) {
|
|
|
660
530
|
}
|
|
661
531
|
|
|
662
532
|
// src/components/editor/domEditingLayers.ts
|
|
663
|
-
function isEditableTextLeaf(el) {
|
|
664
|
-
return isTextBearingTag(el.tagName.toLowerCase()) && el.children.length === 0;
|
|
665
|
-
}
|
|
666
533
|
function sameTagChildIndex(el) {
|
|
667
534
|
let index = 0;
|
|
668
535
|
let sibling = el.previousElementSibling;
|
|
@@ -1024,14 +891,13 @@ function buildDomEditPatchTarget(selection) {
|
|
|
1024
891
|
}
|
|
1025
892
|
|
|
1026
893
|
export {
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
getSelectorIndex,
|
|
894
|
+
isSdkFamilyEnabled,
|
|
895
|
+
STUDIO_SDK_CUTOVER_ENABLED,
|
|
896
|
+
STUDIO_SDK_CUTOVER_FAMILIES,
|
|
897
|
+
STUDIO_SDK_RESOLVER_SHADOW_ENABLED,
|
|
898
|
+
STUDIO_FLAT_INSPECTOR_ENABLED,
|
|
899
|
+
manualEditingAvailability_exports,
|
|
900
|
+
studioApiFetch,
|
|
1035
901
|
isElementComputedVisible,
|
|
1036
902
|
getDomLayerPatchTarget,
|
|
1037
903
|
resolveAllVisualDomEditTargets,
|
|
@@ -1041,7 +907,6 @@ export {
|
|
|
1041
907
|
DOM_EDIT_LAYER_OBSERVER_INIT,
|
|
1042
908
|
createDomEditLayerWalkCache,
|
|
1043
909
|
drainPendingLayerMutations,
|
|
1044
|
-
isEditableTextLeaf,
|
|
1045
910
|
collectDomEditTextFields,
|
|
1046
911
|
serializeDomEditTextFields,
|
|
1047
912
|
buildDefaultDomEditTextField,
|
|
@@ -1063,4 +928,4 @@ export {
|
|
|
1063
928
|
readHfId,
|
|
1064
929
|
buildDomEditPatchTarget
|
|
1065
930
|
};
|
|
1066
|
-
//# sourceMappingURL=chunk-
|
|
931
|
+
//# sourceMappingURL=chunk-3F47EFCT.js.map
|