@twick/studio 0.15.12 → 0.15.13

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.js CHANGED
@@ -113,49 +113,49 @@ const createLucideIcon = (iconName, iconNode) => {
113
113
  * This source code is licensed under the ISC license.
114
114
  * See the LICENSE file in the root directory of this source tree.
115
115
  */
116
- const __iconNode$s = [
116
+ const __iconNode$u = [
117
117
  ["rect", { width: "18", height: "14", x: "3", y: "5", rx: "2", ry: "2", key: "12ruh7" }],
118
118
  ["path", { d: "M7 15h4M15 15h2M7 11h2M13 11h4", key: "1ueiar" }]
119
119
  ];
120
- const Captions = createLucideIcon("captions", __iconNode$s);
120
+ const Captions = createLucideIcon("captions", __iconNode$u);
121
121
  /**
122
122
  * @license lucide-react v0.511.0 - ISC
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
126
  */
127
- const __iconNode$r = [
127
+ const __iconNode$t = [
128
128
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
129
129
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
130
130
  ];
131
- const CircleCheck = createLucideIcon("circle-check", __iconNode$r);
131
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$t);
132
132
  /**
133
133
  * @license lucide-react v0.511.0 - ISC
134
134
  *
135
135
  * This source code is licensed under the ISC license.
136
136
  * See the LICENSE file in the root directory of this source tree.
137
137
  */
138
- const __iconNode$q = [
138
+ const __iconNode$s = [
139
139
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
140
140
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
141
141
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
142
142
  ];
143
- const CircleX = createLucideIcon("circle-x", __iconNode$q);
143
+ const CircleX = createLucideIcon("circle-x", __iconNode$s);
144
144
  /**
145
145
  * @license lucide-react v0.511.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
149
  */
150
- const __iconNode$p = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
151
- const Circle = createLucideIcon("circle", __iconNode$p);
150
+ const __iconNode$r = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
151
+ const Circle = createLucideIcon("circle", __iconNode$r);
152
152
  /**
153
153
  * @license lucide-react v0.511.0 - ISC
154
154
  *
155
155
  * This source code is licensed under the ISC license.
156
156
  * See the LICENSE file in the root directory of this source tree.
157
157
  */
158
- const __iconNode$o = [
158
+ const __iconNode$q = [
159
159
  [
160
160
  "path",
161
161
  { d: "M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z", key: "1tn4o7" }
@@ -164,112 +164,132 @@ const __iconNode$o = [
164
164
  ["path", { d: "m12.4 3.4 3.1 4", key: "6hsd6n" }],
165
165
  ["path", { d: "M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z", key: "ltgou9" }]
166
166
  ];
167
- const Clapperboard = createLucideIcon("clapperboard", __iconNode$o);
167
+ const Clapperboard = createLucideIcon("clapperboard", __iconNode$q);
168
168
  /**
169
169
  * @license lucide-react v0.511.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
173
  */
174
- const __iconNode$n = [
174
+ const __iconNode$p = [
175
175
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
176
176
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
177
177
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
178
178
  ];
179
- const Download = createLucideIcon("download", __iconNode$n);
179
+ const Download = createLucideIcon("download", __iconNode$p);
180
180
  /**
181
181
  * @license lucide-react v0.511.0 - ISC
182
182
  *
183
183
  * This source code is licensed under the ISC license.
184
184
  * See the LICENSE file in the root directory of this source tree.
185
185
  */
186
- const __iconNode$m = [
186
+ const __iconNode$o = [
187
187
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
188
188
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
189
189
  ];
190
- const File = createLucideIcon("file", __iconNode$m);
190
+ const File = createLucideIcon("file", __iconNode$o);
191
191
  /**
192
192
  * @license lucide-react v0.511.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
196
  */
197
- const __iconNode$l = [
197
+ const __iconNode$n = [
198
198
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
199
199
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
200
200
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
201
201
  ];
202
- const Image = createLucideIcon("image", __iconNode$l);
202
+ const Image = createLucideIcon("image", __iconNode$n);
203
203
  /**
204
204
  * @license lucide-react v0.511.0 - ISC
205
205
  *
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */
209
- const __iconNode$k = [
209
+ const __iconNode$m = [
210
210
  ["path", { d: "M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8", key: "18ogeb" }]
211
211
  ];
212
- const Infinity = createLucideIcon("infinity", __iconNode$k);
212
+ const Infinity = createLucideIcon("infinity", __iconNode$m);
213
213
  /**
214
214
  * @license lucide-react v0.511.0 - ISC
215
215
  *
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
218
  */
219
- const __iconNode$j = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
220
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$j);
219
+ const __iconNode$l = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
220
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$l);
221
221
  /**
222
222
  * @license lucide-react v0.511.0 - ISC
223
223
  *
224
224
  * This source code is licensed under the ISC license.
225
225
  * See the LICENSE file in the root directory of this source tree.
226
226
  */
227
- const __iconNode$i = [
227
+ const __iconNode$k = [
228
228
  ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }]
229
229
  ];
230
- const MessageSquare = createLucideIcon("message-square", __iconNode$i);
230
+ const MessageSquare = createLucideIcon("message-square", __iconNode$k);
231
231
  /**
232
232
  * @license lucide-react v0.511.0 - ISC
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
236
  */
237
- const __iconNode$h = [
237
+ const __iconNode$j = [
238
238
  ["path", { d: "M9 18V5l12-2v13", key: "1jmyc2" }],
239
239
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
240
240
  ["circle", { cx: "18", cy: "16", r: "3", key: "1hluhg" }]
241
241
  ];
242
- const Music = createLucideIcon("music", __iconNode$h);
242
+ const Music = createLucideIcon("music", __iconNode$j);
243
243
  /**
244
244
  * @license lucide-react v0.511.0 - ISC
245
245
  *
246
246
  * This source code is licensed under the ISC license.
247
247
  * See the LICENSE file in the root directory of this source tree.
248
248
  */
249
- const __iconNode$g = [
249
+ const __iconNode$i = [
250
250
  ["rect", { x: "14", y: "4", width: "4", height: "16", rx: "1", key: "zuxfzm" }],
251
251
  ["rect", { x: "6", y: "4", width: "4", height: "16", rx: "1", key: "1okwgv" }]
252
252
  ];
253
- const Pause = createLucideIcon("pause", __iconNode$g);
253
+ const Pause = createLucideIcon("pause", __iconNode$i);
254
254
  /**
255
255
  * @license lucide-react v0.511.0 - ISC
256
256
  *
257
257
  * This source code is licensed under the ISC license.
258
258
  * See the LICENSE file in the root directory of this source tree.
259
259
  */
260
- const __iconNode$f = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
261
- const Play = createLucideIcon("play", __iconNode$f);
260
+ const __iconNode$h = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
261
+ const Play = createLucideIcon("play", __iconNode$h);
262
262
  /**
263
263
  * @license lucide-react v0.511.0 - ISC
264
264
  *
265
265
  * This source code is licensed under the ISC license.
266
266
  * See the LICENSE file in the root directory of this source tree.
267
267
  */
268
- const __iconNode$e = [
268
+ const __iconNode$g = [
269
269
  ["path", { d: "M5 12h14", key: "1ays0h" }],
270
270
  ["path", { d: "M12 5v14", key: "s699le" }]
271
271
  ];
272
- const Plus = createLucideIcon("plus", __iconNode$e);
272
+ const Plus = createLucideIcon("plus", __iconNode$g);
273
+ /**
274
+ * @license lucide-react v0.511.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */
279
+ const __iconNode$f = [
280
+ ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }]
281
+ ];
282
+ const RectangleHorizontal = createLucideIcon("rectangle-horizontal", __iconNode$f);
283
+ /**
284
+ * @license lucide-react v0.511.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */
289
+ const __iconNode$e = [
290
+ ["rect", { width: "12", height: "20", x: "6", y: "2", rx: "2", key: "1oxtiu" }]
291
+ ];
292
+ const RectangleVertical = createLucideIcon("rectangle-vertical", __iconNode$e);
273
293
  /**
274
294
  * @license lucide-react v0.511.0 - ISC
275
295
  *
@@ -566,6 +586,15 @@ const StudioHeader = ({
566
586
  setOrientation(orientation2);
567
587
  }
568
588
  }, []);
589
+ const handleOrientationChange = (nextOrientation) => {
590
+ if (nextOrientation === orientation) return;
591
+ const confirmMessage = "Changing orientation will create a new project with the new resolution. Do you want to continue?";
592
+ if (!window.confirm(confirmMessage)) {
593
+ return;
594
+ }
595
+ onNewProject();
596
+ setOrientation(nextOrientation);
597
+ };
569
598
  react.useEffect(() => {
570
599
  if (orientation === "horizontal") {
571
600
  localStorage.setItem("orientation", "horizontal");
@@ -576,10 +605,31 @@ const StudioHeader = ({
576
605
  }
577
606
  }, [orientation]);
578
607
  return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "header", children: [
579
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-container", children: [
608
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-container", children: [
580
609
  /* @__PURE__ */ jsxRuntime.jsx(Clapperboard, { className: "icon-lg accent-purple" }),
581
610
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-gradient", children: "Twick Studio" })
582
- ] }) }),
611
+ ] }),
612
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-container", style: { gap: "0.5rem" }, children: [
613
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm opacity-80", children: "Orientation" }),
614
+ /* @__PURE__ */ jsxRuntime.jsx(
615
+ "button",
616
+ {
617
+ className: `btn-ghost ${orientation === "vertical" ? "btn-primary" : ""}`,
618
+ title: "Portrait (720×1280)",
619
+ onClick: () => handleOrientationChange("vertical"),
620
+ children: /* @__PURE__ */ jsxRuntime.jsx(RectangleVertical, { className: "icon-sm" })
621
+ }
622
+ ),
623
+ /* @__PURE__ */ jsxRuntime.jsx(
624
+ "button",
625
+ {
626
+ className: `btn-ghost ${orientation === "horizontal" ? "btn-primary" : ""}`,
627
+ title: "Landscape (1280×720)",
628
+ onClick: () => handleOrientationChange("horizontal"),
629
+ children: /* @__PURE__ */ jsxRuntime.jsx(RectangleHorizontal, { className: "icon-sm" })
630
+ }
631
+ )
632
+ ] }),
583
633
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-container", children: [
584
634
  /* @__PURE__ */ jsxRuntime.jsxs(
585
635
  "button",
@@ -3525,7 +3575,7 @@ function PropertiesPanelContainer({
3525
3575
  ] });
3526
3576
  }
3527
3577
  const useStudioOperation = (studioConfig) => {
3528
- const { editor, present } = timeline.useTimelineContext();
3578
+ const { editor, present, videoResolution } = timeline.useTimelineContext();
3529
3579
  const { setSeekTime, setPlayerState } = livePlayer.useLivePlayerContext();
3530
3580
  const [projectName, setProjectName] = react.useState("");
3531
3581
  const onNewProject = () => {
@@ -3573,14 +3623,13 @@ const useStudioOperation = (studioConfig) => {
3573
3623
  }
3574
3624
  };
3575
3625
  const onExportVideo = async () => {
3576
- var _a, _b;
3577
3626
  if ((studioConfig == null ? void 0 : studioConfig.exportVideo) && present) {
3578
3627
  await studioConfig.exportVideo(present, {
3579
3628
  outFile: "output.mp4",
3580
3629
  fps: 30,
3581
3630
  resolution: {
3582
- width: (_a = studioConfig.videoProps) == null ? void 0 : _a.width,
3583
- height: (_b = studioConfig.videoProps) == null ? void 0 : _b.height
3631
+ width: videoResolution.width,
3632
+ height: videoResolution.height
3584
3633
  }
3585
3634
  });
3586
3635
  } else {