@hyperframes/studio 0.9.40 → 0.9.41

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.
Files changed (56) hide show
  1. package/dist/assets/{codec-BPK_2CLL.js → codec-B_mpbc4w.js} +1 -1
  2. package/dist/assets/{hyperframes-player-D7qTTDIp.js → hyperframes-player-Dvi3I_mv.js} +1 -1
  3. package/dist/assets/{index-CdA00Ybn.js → index-B5ExwsOp.js} +146 -146
  4. package/dist/assets/{index-QS-DuxAU.js → index-BrFm9Y5k.js} +1 -1
  5. package/dist/assets/{pausedVideoDecoder-Byzz98Gb.js → pausedVideoDecoder-MHQ57yZ6.js} +1 -1
  6. package/dist/{chunk-KF6YVXJP.js → chunk-4QQMX4BX.js} +6 -3
  7. package/dist/{chunk-VZ5MD32A.js → chunk-GVW7AU57.js} +190 -254
  8. package/dist/{chunk-AV2PV7NE.js → chunk-VHV2ZDKY.js} +4 -40
  9. package/dist/{domEditingLayers-4KRREI5C.js → domEditingLayers-SA5KLSSS.js} +4 -2
  10. package/dist/index.d.ts +4 -0
  11. package/dist/index.html +1 -1
  12. package/dist/index.js +898 -551
  13. package/dist/player.js +2 -2
  14. package/package.json +8 -8
  15. package/src/components/editor/DomEditOverlay.tsx +3 -15
  16. package/src/components/editor/clickAfterPreventedPress.test.tsx +17 -1
  17. package/src/components/editor/domEditOverlayBasis.ts +7 -2
  18. package/src/components/editor/domEditOverlayCrop.test.ts +1 -1
  19. package/src/components/editor/domEditOverlayCrop.ts +17 -3
  20. package/src/components/editor/domEditOverlayGeometry.ts +64 -139
  21. package/src/components/editor/domEditSelectionRules.ts +138 -0
  22. package/src/components/editor/domEditing.test.ts +6 -28
  23. package/src/components/editor/domEditingDom.preview.test.ts +3 -3
  24. package/src/components/editor/domEditingDom.ts +3 -76
  25. package/src/components/editor/domEditingElement.ts +19 -240
  26. package/src/components/editor/domEditingGroups.ts +0 -31
  27. package/src/components/editor/domEditingLayers.ts +95 -100
  28. package/src/components/editor/domEditingRootLayer.ts +35 -30
  29. package/src/components/editor/domEditingTypes.ts +4 -0
  30. package/src/components/editor/previewGestureStarts.ts +73 -10
  31. package/src/components/editor/previewOverlayRects.test.ts +316 -0
  32. package/src/components/editor/previewOverlayRects.ts +123 -0
  33. package/src/components/editor/previewPointerTargets.test.ts +260 -0
  34. package/src/components/editor/previewSelection.test.ts +481 -0
  35. package/src/components/editor/previewSelection.ts +472 -0
  36. package/src/components/editor/probeSourceElement.ts +19 -1
  37. package/src/components/editor/propertyPanelFill.tsx +5 -1
  38. package/src/components/editor/useDomEditOverlayRects.ts +80 -1
  39. package/src/components/editor/useInlineTextEditing.tsx +1 -6
  40. package/src/hooks/domSelectionTestHarness.ts +1 -1
  41. package/src/hooks/useDomEditSession.test.tsx +23 -1
  42. package/src/hooks/useDomEditSession.ts +2 -1
  43. package/src/hooks/useDomSelection.ts +61 -47
  44. package/src/hooks/useGsapSelectionHandlers.test.tsx +17 -0
  45. package/src/hooks/useGsapSelectionHandlers.ts +2 -1
  46. package/src/hooks/usePreviewInteraction.test.ts +10 -2
  47. package/src/hooks/usePreviewInteraction.ts +5 -4
  48. package/src/hooks/useStudioSelectionPublisher.test.tsx +50 -0
  49. package/src/hooks/useStudioSelectionPublisher.ts +9 -7
  50. package/src/player/lib/previewChannel.ts +4 -3
  51. package/src/player/lib/previewElements.ts +112 -3
  52. package/src/styles/hex-baseline.json +1 -2
  53. package/src/utils/studioHelpers.ts +0 -13
  54. package/src/utils/studioPreviewHelpers.test.ts +8 -8
  55. package/src/utils/studioPreviewHelpers.ts +26 -242
  56. package/src/components/editor/domEditOverlayTransform.ts +0 -126
@@ -46,11 +46,11 @@ function getSourceScopedSelectorIndex(doc, el, selector, sourceFile, resolveSour
46
46
 
47
47
  // src/components/editor/domEditingDom.ts
48
48
  import { getLogicalOpacity } from "@hyperframes/core/studio-preview-mark";
49
- import { COLOR_GRADING_SOURCE_HIDDEN_ATTR } from "@hyperframes/core/color-grading";
50
49
  import {
51
50
  buildStableSelector,
52
51
  escapeCssString,
53
52
  getPreferredClassSelector,
53
+ isElementVisibleThroughAncestors,
54
54
  readElementSource
55
55
  } from "@hyperframes/core/runtime/editing-port";
56
56
 
@@ -112,32 +112,6 @@ function isTextBearingTag(tagName) {
112
112
  function isEditableTextLeaf(el) {
113
113
  return isTextBearingTag(el.tagName.toLowerCase()) && el.children.length === 0;
114
114
  }
115
- function elementRendersItself(win, el) {
116
- const computed = win.getComputedStyle(el);
117
- if (computed.display === "none" || computed.visibility === "hidden") return false;
118
- const opacity = Number.parseFloat(getLogicalOpacity(el, computed));
119
- return !(Number.isFinite(opacity) && opacity <= 0.01 && !el.hasAttribute(COLOR_GRADING_SOURCE_HIDDEN_ATTR));
120
- }
121
- function isElementVisibleThroughAncestors(el, memo) {
122
- const win = el.ownerDocument.defaultView;
123
- if (!win) return true;
124
- const pending = [];
125
- let inherited = true;
126
- for (let node = el; node; node = node.parentElement) {
127
- const answered = memo?.get(node);
128
- if (answered !== void 0) {
129
- inherited = answered;
130
- break;
131
- }
132
- pending.push(node);
133
- }
134
- for (let i = pending.length - 1; i >= 0; i -= 1) {
135
- const node = pending[i];
136
- inherited = inherited && elementRendersItself(win, node);
137
- memo?.set(node, inherited);
138
- }
139
- return inherited;
140
- }
141
115
  function getCuratedComputedStyles(el) {
142
116
  const styles = {};
143
117
  const computed = el.ownerDocument.defaultView?.getComputedStyle(el);
@@ -165,17 +139,6 @@ function getDataAttributes(el) {
165
139
  }
166
140
  return attrs;
167
141
  }
168
- function findClosestByAttribute(el, attributeNames) {
169
- let current = el;
170
- while (current) {
171
- const candidate = current;
172
- if (attributeNames.some((attribute) => candidate.hasAttribute(attribute))) {
173
- return candidate;
174
- }
175
- current = current.parentElement;
176
- }
177
- return null;
178
- }
179
142
  var compositionSourceMap = /* @__PURE__ */ new Map();
180
143
  var compositionSourceMapRevision = 0;
181
144
  function setCompositionSourceMap(map) {
@@ -1099,18 +1062,19 @@ export {
1099
1062
  rgbToHsv,
1100
1063
  hsvToRgb,
1101
1064
  withSelectorIndexPass,
1065
+ CURATED_STYLE_PROPERTIES,
1102
1066
  getLogicalOpacity,
1103
1067
  buildStableSelector,
1104
1068
  escapeCssString,
1069
+ isElementVisibleThroughAncestors,
1105
1070
  isHtmlElement,
1106
1071
  isEditableTextLeaf,
1107
- isElementVisibleThroughAncestors,
1108
1072
  getCuratedComputedStyles,
1109
1073
  getInlineStyles,
1110
1074
  getDataAttributes,
1111
- findClosestByAttribute,
1112
1075
  setCompositionSourceMap,
1113
1076
  getCompositionSourceMapRevision,
1077
+ resolveElementSourceFile,
1114
1078
  getSourceFileForElement,
1115
1079
  normalizeTimelineCompositionSource,
1116
1080
  querySelectorAllSafely,
@@ -5,6 +5,7 @@ import {
5
5
  buildDomEditStylePatchOperation,
6
6
  buildDomEditTextPatchOperation,
7
7
  buildTextFieldChildLocator,
8
+ capabilityFacts,
8
9
  collectDomEditLayerItems,
9
10
  collectDomEditTextFields,
10
11
  countDomEditChildLayers,
@@ -19,8 +20,8 @@ import {
19
20
  resolveDomEditCapabilities,
20
21
  resolveDomEditSelection,
21
22
  serializeDomEditTextFields
22
- } from "./chunk-VZ5MD32A.js";
23
- import "./chunk-AV2PV7NE.js";
23
+ } from "./chunk-GVW7AU57.js";
24
+ import "./chunk-VHV2ZDKY.js";
24
25
  import "./chunk-MLKGABMK.js";
25
26
  export {
26
27
  buildDefaultDomEditTextField,
@@ -29,6 +30,7 @@ export {
29
30
  buildDomEditStylePatchOperation,
30
31
  buildDomEditTextPatchOperation,
31
32
  buildTextFieldChildLocator,
33
+ capabilityFacts,
32
34
  collectDomEditLayerItems,
33
35
  collectDomEditTextFields,
34
36
  countDomEditChildLayers,
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { RefObject, MutableRefObject, ReactNode, DragEventHandler, ComponentProp
4
4
  import { RuntimeTimelineClipIdentity, PlaybackHeldBy, HyperframePickerElementInfo } from '@hyperframes/core';
5
5
  import { GsapAnimation, ParsedGsap, PropertyGroupName } from '@hyperframes/core/gsap-parser';
6
6
  import { GsapAnimation as GsapAnimation$1, ArcPathSegment } from '@hyperframes/parsers/gsap-parser';
7
+ import { EditingElementHandle } from '@hyperframes/core/runtime/editing-port';
7
8
  import { Composition } from '@hyperframes/sdk';
8
9
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
10
  import { S as StudioKeys, a as StudioKeyAction } from './keys-CaWcxUST.js';
@@ -772,6 +773,9 @@ interface DomEditTextField {
772
773
  }
773
774
  interface DomEditSelection extends PatchTarget {
774
775
  element: HTMLElement;
776
+ handle?: EditingElementHandle;
777
+ hasAudio?: boolean;
778
+ src?: string | null;
775
779
  label: string;
776
780
  tagName: string;
777
781
  sourceFile: string;
package/dist/index.html CHANGED
@@ -14,7 +14,7 @@
14
14
  document.documentElement.dataset.theme = "paper";
15
15
  }
16
16
  </script>
17
- <script type="module" crossorigin src="/assets/index-CdA00Ybn.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-B5ExwsOp.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-4VGEAZyf.css">
19
19
  </head>
20
20
  <body>