@hyperframes/studio 0.6.0-alpha.7 → 0.6.0-alpha.8

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/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
6
  <title>HyperFrames Studio</title>
7
- <script type="module" crossorigin src="/assets/index-CU1QTcAy.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-ClYcrksa.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-14zH9lqh.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/studio",
3
- "version": "0.6.0-alpha.7",
3
+ "version": "0.6.0-alpha.8",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,8 +32,8 @@
32
32
  "@phosphor-icons/react": "^2.1.10",
33
33
  "codemirror": "^6.0.1",
34
34
  "motion": "^12.38.0",
35
- "@hyperframes/core": "0.6.0-alpha.7",
36
- "@hyperframes/player": "0.6.0-alpha.7"
35
+ "@hyperframes/core": "0.6.0-alpha.8",
36
+ "@hyperframes/player": "0.6.0-alpha.8"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/react": "^19.0.0",
@@ -47,7 +47,7 @@
47
47
  "vite": "^6.4.2",
48
48
  "vitest": "^3.2.4",
49
49
  "zustand": "^5.0.0",
50
- "@hyperframes/producer": "0.6.0-alpha.7"
50
+ "@hyperframes/producer": "0.6.0-alpha.8"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "react": "^18.0.0 || ^19.0.0",
package/src/App.tsx CHANGED
@@ -101,6 +101,7 @@ import {
101
101
  type DomEditLayerItem,
102
102
  type DomEditTextField,
103
103
  type DomEditSelection,
104
+ buildDefaultDomEditTextField,
104
105
  } from "./components/editor/domEditing";
105
106
  import {
106
107
  STUDIO_MANUAL_EDITS_PATH,
@@ -3107,6 +3108,48 @@ export function StudioApp() {
3107
3108
  [commitDomTextFields, domEditSelection, handleDomStyleCommit, resolveImportedFontAsset],
3108
3109
  );
3109
3110
 
3111
+ const handleDomAddTextField = useCallback(
3112
+ async (afterFieldKey?: string) => {
3113
+ if (!domEditSelection) return null;
3114
+ if (!domEditSelection.textFields.some((field) => field.source === "child")) return null;
3115
+
3116
+ const insertionIndex = domEditSelection.textFields.findIndex(
3117
+ (field) => field.key === afterFieldKey,
3118
+ );
3119
+ const baseField =
3120
+ domEditSelection.textFields[insertionIndex >= 0 ? insertionIndex : 0] ??
3121
+ domEditSelection.textFields[0];
3122
+ const nextField = buildDefaultDomEditTextField(baseField);
3123
+ const nextTextFields = [...domEditSelection.textFields];
3124
+ nextTextFields.splice(
3125
+ insertionIndex >= 0 ? insertionIndex + 1 : nextTextFields.length,
3126
+ 0,
3127
+ nextField,
3128
+ );
3129
+
3130
+ await commitDomTextFields(domEditSelection, nextTextFields);
3131
+ return nextField.key;
3132
+ },
3133
+ [commitDomTextFields, domEditSelection],
3134
+ );
3135
+
3136
+ const handleDomRemoveTextField = useCallback(
3137
+ async (fieldKey: string) => {
3138
+ if (!domEditSelection) return;
3139
+ const field = domEditSelection.textFields.find((entry) => entry.key === fieldKey);
3140
+ if (!field) return;
3141
+
3142
+ if (field.source === "self") {
3143
+ await handleDomTextCommit("", fieldKey);
3144
+ return;
3145
+ }
3146
+
3147
+ const nextTextFields = domEditSelection.textFields.filter((entry) => entry.key !== fieldKey);
3148
+ await commitDomTextFields(domEditSelection, nextTextFields);
3149
+ },
3150
+ [commitDomTextFields, domEditSelection, handleDomTextCommit],
3151
+ );
3152
+
3110
3153
  const handleAskAgent = useCallback(() => {
3111
3154
  if (!domEditSelection) return;
3112
3155
  setAgentPromptTagSnippet(undefined);
@@ -4226,8 +4269,8 @@ export function StudioApp() {
4226
4269
  onSetManualSize={handleDomBoxSizeCommit}
4227
4270
  onSetText={handleDomTextCommit}
4228
4271
  onSetTextFieldStyle={handleDomTextFieldStyleCommit}
4229
- onAddTextField={() => null}
4230
- onRemoveTextField={() => {}}
4272
+ onAddTextField={handleDomAddTextField}
4273
+ onRemoveTextField={handleDomRemoveTextField}
4231
4274
  onResetManualEdits={handleDomManualEditsReset}
4232
4275
  onAskAgent={handleAskAgent}
4233
4276
  onImportAssets={handleImportFiles}