@orangecatai/adgen-canvas 0.0.25 → 0.0.26
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/dev/{chunk-QEU5XBGX.js → chunk-HAGQZMXY.js} +3 -3
- package/dist/dev/{chunk-RPBS5GNJ.js → chunk-M6SLPQMN.js} +2 -2
- package/dist/dev/data/{image-3SGMKXEK.js → image-TSTRTL65.js} +3 -3
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +977 -329
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-JVKQD63G.js → chunk-FABLWJ5B.js} +1 -1
- package/dist/prod/{chunk-Q6JGYK3N.js → chunk-PIJUOUUJ.js} +2 -2
- package/dist/prod/data/image-D6B2C7FH.js +1 -0
- package/dist/prod/index.js +57 -56
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/keys.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionGenerators.d.ts +34 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/components/App.d.ts +1 -0
- package/dist/types/excalidraw/components/VideoElement.d.ts +1 -1
- package/dist/types/excalidraw/components/auto-resize/AutoResizePanel.d.ts +3 -1
- package/dist/types/excalidraw/components/auto-resize/autoResizeEngine.d.ts +9 -0
- package/dist/types/excalidraw/types.d.ts +27 -0
- package/package.json +1 -1
- package/dist/prod/data/image-ZZTLAGXX.js +0 -1
- /package/dist/dev/{chunk-QEU5XBGX.js.map → chunk-HAGQZMXY.js.map} +0 -0
- /package/dist/dev/{chunk-RPBS5GNJ.js.map → chunk-M6SLPQMN.js.map} +0 -0
- /package/dist/dev/data/{image-3SGMKXEK.js.map → image-TSTRTL65.js.map} +0 -0
package/dist/dev/index.js
CHANGED
|
@@ -66,10 +66,10 @@ import {
|
|
|
66
66
|
serializeAsJSON,
|
|
67
67
|
serializeLibraryAsJSON,
|
|
68
68
|
strokeRectWithRotation_simple
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-HAGQZMXY.js";
|
|
70
70
|
import {
|
|
71
71
|
define_import_meta_env_default
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-M6SLPQMN.js";
|
|
73
73
|
import {
|
|
74
74
|
en_default
|
|
75
75
|
} from "./chunk-LIELFD5T.js";
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
shouldMaintainAspectRatio,
|
|
112
112
|
shouldRotateWithDiscreteAngle as shouldRotateWithDiscreteAngle3,
|
|
113
113
|
isArrowKey as isArrowKey2,
|
|
114
|
-
KEYS as
|
|
114
|
+
KEYS as KEYS56,
|
|
115
115
|
APP_NAME as APP_NAME2,
|
|
116
116
|
CURSOR_TYPE as CURSOR_TYPE4,
|
|
117
117
|
DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
|
|
@@ -318,7 +318,7 @@ import {
|
|
|
318
318
|
isNonDeletedElement,
|
|
319
319
|
Scene,
|
|
320
320
|
Store,
|
|
321
|
-
CaptureUpdateAction as
|
|
321
|
+
CaptureUpdateAction as CaptureUpdateAction40,
|
|
322
322
|
hitElementBoundingBox as hitElementBoundingBox2,
|
|
323
323
|
isLineElement as isLineElement8,
|
|
324
324
|
isSimpleArrow,
|
|
@@ -8793,6 +8793,7 @@ import {
|
|
|
8793
8793
|
} from "@orangecatai/common";
|
|
8794
8794
|
import { getNonDeletedElements as getNonDeletedElements7 } from "@orangecatai/element";
|
|
8795
8795
|
import { CaptureUpdateAction as CaptureUpdateAction9 } from "@orangecatai/element";
|
|
8796
|
+
import { viewportCoordsToSceneCoords as viewportCoordsToSceneCoords2 } from "@orangecatai/common";
|
|
8796
8797
|
|
|
8797
8798
|
// components/CheckboxItem.tsx
|
|
8798
8799
|
import clsx17 from "clsx";
|
|
@@ -9795,7 +9796,7 @@ var exportCanvas = async (type, elements, appState, files, {
|
|
|
9795
9796
|
let blob = canvasToBlob(tempCanvas);
|
|
9796
9797
|
if (appState.exportEmbedScene) {
|
|
9797
9798
|
blob = blob.then(
|
|
9798
|
-
(blob2) => import("./data/image-
|
|
9799
|
+
(blob2) => import("./data/image-TSTRTL65.js").then(
|
|
9799
9800
|
({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
|
|
9800
9801
|
blob: blob2,
|
|
9801
9802
|
metadata: serializeAsJSON(elements, appState, files, "local")
|
|
@@ -9836,9 +9837,6 @@ ${t(
|
|
|
9836
9837
|
}
|
|
9837
9838
|
};
|
|
9838
9839
|
|
|
9839
|
-
// actions/actionExport.tsx
|
|
9840
|
-
import { viewportCoordsToSceneCoords as viewportCoordsToSceneCoords2 } from "@orangecatai/common";
|
|
9841
|
-
|
|
9842
9840
|
// data/resave.ts
|
|
9843
9841
|
var resaveAsImageWithScene = async (elements, appState, files, name) => {
|
|
9844
9842
|
const { exportBackground, viewBackgroundColor, fileHandle } = appState;
|
|
@@ -10071,15 +10069,24 @@ var actionLoadScene = register({
|
|
|
10071
10069
|
},
|
|
10072
10070
|
perform: async (elements, appState, _, app) => {
|
|
10073
10071
|
try {
|
|
10074
|
-
const file2 = await fileOpen({
|
|
10072
|
+
const file2 = await fileOpen({
|
|
10073
|
+
description: "Excalidraw or video files"
|
|
10074
|
+
});
|
|
10075
10075
|
if (isSupportedVideoFile(file2)) {
|
|
10076
10076
|
const clientX = appState.width / 2 + appState.offsetLeft;
|
|
10077
10077
|
const clientY = appState.height / 2 + appState.offsetTop;
|
|
10078
|
-
const { x, y } = viewportCoordsToSceneCoords2(
|
|
10078
|
+
const { x, y } = viewportCoordsToSceneCoords2(
|
|
10079
|
+
{ clientX, clientY },
|
|
10080
|
+
appState
|
|
10081
|
+
);
|
|
10079
10082
|
await app.insertVideos([file2], x, y);
|
|
10080
10083
|
return false;
|
|
10081
10084
|
}
|
|
10082
|
-
const {
|
|
10085
|
+
const {
|
|
10086
|
+
elements: loadedElements,
|
|
10087
|
+
appState: loadedAppState,
|
|
10088
|
+
files
|
|
10089
|
+
} = await loadFromBlob(file2, appState, elements, file2.handle ?? null);
|
|
10083
10090
|
return {
|
|
10084
10091
|
elements: loadedElements,
|
|
10085
10092
|
appState: loadedAppState,
|
|
@@ -13372,6 +13379,8 @@ var shortcutMap = {
|
|
|
13372
13379
|
toggleHandTool: [getShortcutKey("H")],
|
|
13373
13380
|
setFrameAsActiveTool: [getShortcutKey("F")],
|
|
13374
13381
|
cycleThroughFrameChildren: [getShortcutKey("CtrlOrCmd+J")],
|
|
13382
|
+
openImageGenerator: [getShortcutKey("G")],
|
|
13383
|
+
openVideoGenerator: [getShortcutKey("M")],
|
|
13375
13384
|
saveFileToDisk: [getShortcutKey("CtrlOrCmd+S")],
|
|
13376
13385
|
saveToActiveFile: [getShortcutKey("CtrlOrCmd+S")],
|
|
13377
13386
|
toggleShortcuts: [getShortcutKey("?")],
|
|
@@ -17850,8 +17859,8 @@ var ShapesSwitcher = ({
|
|
|
17850
17859
|
icon: imageGeneratorToolIcon,
|
|
17851
17860
|
checked: false,
|
|
17852
17861
|
name: "editor-current-shape",
|
|
17853
|
-
title: `Image Generator \u2014
|
|
17854
|
-
keyBindingLabel: "
|
|
17862
|
+
title: `Image Generator \u2014 G`,
|
|
17863
|
+
keyBindingLabel: "G",
|
|
17855
17864
|
"aria-label": "Image Generator",
|
|
17856
17865
|
"data-testid": "toolbar-image-generator",
|
|
17857
17866
|
onChange: () => {
|
|
@@ -17868,8 +17877,8 @@ var ShapesSwitcher = ({
|
|
|
17868
17877
|
icon: videoGeneratorToolIcon,
|
|
17869
17878
|
checked: false,
|
|
17870
17879
|
name: "editor-current-shape",
|
|
17871
|
-
title: "Video Generator \u2014
|
|
17872
|
-
keyBindingLabel: "
|
|
17880
|
+
title: "Video Generator \u2014 M",
|
|
17881
|
+
keyBindingLabel: "M",
|
|
17873
17882
|
"aria-label": "Video Generator",
|
|
17874
17883
|
"data-testid": "toolbar-video-generator",
|
|
17875
17884
|
onChange: () => {
|
|
@@ -20759,21 +20768,57 @@ var actionWrapSelectionInFrame = register({
|
|
|
20759
20768
|
}
|
|
20760
20769
|
});
|
|
20761
20770
|
|
|
20771
|
+
// actions/actionGenerators.ts
|
|
20772
|
+
import { KEYS as KEYS42 } from "@orangecatai/common";
|
|
20773
|
+
import { CaptureUpdateAction as CaptureUpdateAction33 } from "@orangecatai/element";
|
|
20774
|
+
var actionOpenImageGenerator = register({
|
|
20775
|
+
name: "openImageGenerator",
|
|
20776
|
+
label: "Image Generator",
|
|
20777
|
+
icon: imageGeneratorToolIcon,
|
|
20778
|
+
viewMode: false,
|
|
20779
|
+
trackEvent: { category: "toolbar" },
|
|
20780
|
+
perform: (elements, appState, _, app) => {
|
|
20781
|
+
app.onImageGeneratorSelect();
|
|
20782
|
+
return {
|
|
20783
|
+
elements: null,
|
|
20784
|
+
appState: null,
|
|
20785
|
+
captureUpdate: CaptureUpdateAction33.EVENTUALLY
|
|
20786
|
+
};
|
|
20787
|
+
},
|
|
20788
|
+
keyTest: (event) => !event[KEYS42.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS42.G
|
|
20789
|
+
});
|
|
20790
|
+
var actionOpenVideoGenerator = register({
|
|
20791
|
+
name: "openVideoGenerator",
|
|
20792
|
+
label: "Video Generator",
|
|
20793
|
+
icon: videoGeneratorToolIcon,
|
|
20794
|
+
viewMode: false,
|
|
20795
|
+
trackEvent: { category: "toolbar" },
|
|
20796
|
+
perform: (elements, appState, _, app) => {
|
|
20797
|
+
app.onVideoGeneratorSelect();
|
|
20798
|
+
return {
|
|
20799
|
+
elements: null,
|
|
20800
|
+
appState: null,
|
|
20801
|
+
captureUpdate: CaptureUpdateAction33.EVENTUALLY
|
|
20802
|
+
};
|
|
20803
|
+
},
|
|
20804
|
+
keyTest: (event) => !event[KEYS42.CTRL_OR_CMD] && !event.shiftKey && !event.altKey && event.key.toLocaleLowerCase() === KEYS42.M
|
|
20805
|
+
});
|
|
20806
|
+
|
|
20762
20807
|
// actions/actionHistory.tsx
|
|
20763
20808
|
import {
|
|
20764
20809
|
isWindows,
|
|
20765
|
-
KEYS as
|
|
20810
|
+
KEYS as KEYS43,
|
|
20766
20811
|
matchKey,
|
|
20767
20812
|
arrayToMap as arrayToMap21,
|
|
20768
20813
|
MOBILE_ACTION_BUTTON_BG as MOBILE_ACTION_BUTTON_BG4
|
|
20769
20814
|
} from "@orangecatai/common";
|
|
20770
|
-
import { CaptureUpdateAction as
|
|
20815
|
+
import { CaptureUpdateAction as CaptureUpdateAction35 } from "@orangecatai/element";
|
|
20771
20816
|
import { orderByFractionalIndex } from "@orangecatai/element";
|
|
20772
20817
|
|
|
20773
20818
|
// history.ts
|
|
20774
20819
|
import { Emitter as Emitter2 } from "@orangecatai/common";
|
|
20775
20820
|
import {
|
|
20776
|
-
CaptureUpdateAction as
|
|
20821
|
+
CaptureUpdateAction as CaptureUpdateAction34,
|
|
20777
20822
|
StoreChange,
|
|
20778
20823
|
StoreDelta
|
|
20779
20824
|
} from "@orangecatai/element";
|
|
@@ -20887,7 +20932,7 @@ var History = class _History {
|
|
|
20887
20932
|
if (historyDelta === null) {
|
|
20888
20933
|
return;
|
|
20889
20934
|
}
|
|
20890
|
-
const action =
|
|
20935
|
+
const action = CaptureUpdateAction34.IMMEDIATELY;
|
|
20891
20936
|
let prevSnapshot = this.store.snapshot;
|
|
20892
20937
|
let nextElements = elements;
|
|
20893
20938
|
let nextAppState = appState;
|
|
@@ -20968,7 +21013,7 @@ var executeHistoryAction = (app, appState, updater) => {
|
|
|
20968
21013
|
if (!appState.multiElement && !appState.resizingElement && !appState.editingTextElement && !appState.newElement && !appState.selectedElementsAreBeingDragged && !appState.selectionElement && !app.flowChartCreator.isCreatingChart) {
|
|
20969
21014
|
const result = updater();
|
|
20970
21015
|
if (!result) {
|
|
20971
|
-
return { captureUpdate:
|
|
21016
|
+
return { captureUpdate: CaptureUpdateAction35.EVENTUALLY };
|
|
20972
21017
|
}
|
|
20973
21018
|
const [nextElementsMap, nextAppState] = result;
|
|
20974
21019
|
const nextElements = orderByFractionalIndex(
|
|
@@ -20977,10 +21022,10 @@ var executeHistoryAction = (app, appState, updater) => {
|
|
|
20977
21022
|
return {
|
|
20978
21023
|
appState: nextAppState,
|
|
20979
21024
|
elements: nextElements,
|
|
20980
|
-
captureUpdate:
|
|
21025
|
+
captureUpdate: CaptureUpdateAction35.NEVER
|
|
20981
21026
|
};
|
|
20982
21027
|
}
|
|
20983
|
-
return { captureUpdate:
|
|
21028
|
+
return { captureUpdate: CaptureUpdateAction35.EVENTUALLY };
|
|
20984
21029
|
};
|
|
20985
21030
|
var createUndoAction = (history) => ({
|
|
20986
21031
|
name: "undo",
|
|
@@ -20993,7 +21038,7 @@ var createUndoAction = (history) => ({
|
|
|
20993
21038
|
appState,
|
|
20994
21039
|
() => history.undo(arrayToMap21(elements), appState)
|
|
20995
21040
|
),
|
|
20996
|
-
keyTest: (event) => event[
|
|
21041
|
+
keyTest: (event) => event[KEYS43.CTRL_OR_CMD] && matchKey(event, KEYS43.Z) && !event.shiftKey,
|
|
20997
21042
|
PanelComponent: ({ appState, updateData, data, app }) => {
|
|
20998
21043
|
const { isUndoStackEmpty } = useEmitter(
|
|
20999
21044
|
history.onHistoryChangedEmitter,
|
|
@@ -21031,7 +21076,7 @@ var createRedoAction = (history) => ({
|
|
|
21031
21076
|
appState,
|
|
21032
21077
|
() => history.redo(arrayToMap21(elements), appState)
|
|
21033
21078
|
),
|
|
21034
|
-
keyTest: (event) => event[
|
|
21079
|
+
keyTest: (event) => event[KEYS43.CTRL_OR_CMD] && event.shiftKey && matchKey(event, KEYS43.Z) || isWindows && event.ctrlKey && !event.shiftKey && matchKey(event, KEYS43.Y),
|
|
21035
21080
|
PanelComponent: ({ appState, updateData, data, app }) => {
|
|
21036
21081
|
const { isRedoStackEmpty } = useEmitter(
|
|
21037
21082
|
history.onHistoryChangedEmitter,
|
|
@@ -21064,7 +21109,7 @@ import { getFontString as getFontString6 } from "@orangecatai/common";
|
|
|
21064
21109
|
import { newElementWith as newElementWith10 } from "@orangecatai/element";
|
|
21065
21110
|
import { measureText as measureText4 } from "@orangecatai/element";
|
|
21066
21111
|
import { isTextElement as isTextElement9 } from "@orangecatai/element";
|
|
21067
|
-
import { CaptureUpdateAction as
|
|
21112
|
+
import { CaptureUpdateAction as CaptureUpdateAction36 } from "@orangecatai/element";
|
|
21068
21113
|
var actionTextAutoResize = register({
|
|
21069
21114
|
name: "autoResize",
|
|
21070
21115
|
label: "labels.autoResize",
|
|
@@ -21094,7 +21139,7 @@ var actionTextAutoResize = register({
|
|
|
21094
21139
|
}
|
|
21095
21140
|
return element;
|
|
21096
21141
|
}),
|
|
21097
|
-
captureUpdate:
|
|
21142
|
+
captureUpdate: CaptureUpdateAction36.IMMEDIATELY
|
|
21098
21143
|
};
|
|
21099
21144
|
}
|
|
21100
21145
|
});
|
|
@@ -21302,7 +21347,7 @@ import {
|
|
|
21302
21347
|
rangeIntersection,
|
|
21303
21348
|
rangesOverlap
|
|
21304
21349
|
} from "@orangecatai/math";
|
|
21305
|
-
import { TOOL_TYPE, KEYS as
|
|
21350
|
+
import { TOOL_TYPE, KEYS as KEYS44 } from "@orangecatai/common";
|
|
21306
21351
|
import {
|
|
21307
21352
|
getCommonBounds as getCommonBounds4,
|
|
21308
21353
|
getDraggedElementsBounds,
|
|
@@ -21348,7 +21393,7 @@ var isSnappingEnabled = ({
|
|
|
21348
21393
|
}) => {
|
|
21349
21394
|
if (event) {
|
|
21350
21395
|
const isLassoDragging = app.state.activeTool.type === "lasso" && app.state.selectedElementsAreBeingDragged;
|
|
21351
|
-
return (app.state.activeTool.type !== "lasso" || isLassoDragging) && (app.state.objectsSnapModeEnabled && !event[
|
|
21396
|
+
return (app.state.activeTool.type !== "lasso" || isLassoDragging) && (app.state.objectsSnapModeEnabled && !event[KEYS44.CTRL_OR_CMD] || !app.state.objectsSnapModeEnabled && event[KEYS44.CTRL_OR_CMD] && !isGridModeEnabled(app));
|
|
21352
21397
|
}
|
|
21353
21398
|
if (selectedElements.length === 1 && selectedElements[0].type === "arrow") {
|
|
21354
21399
|
return false;
|
|
@@ -23970,6 +24015,70 @@ var GEMINI_RATIOS = {
|
|
|
23970
24015
|
"8:1": 8 / 1,
|
|
23971
24016
|
"1:8": 1 / 8
|
|
23972
24017
|
};
|
|
24018
|
+
var CUSTOM_RESIZE_DELTA_THRESHOLD = 0.2;
|
|
24019
|
+
var EXTREME_AR_THRESHOLD = 4;
|
|
24020
|
+
function ratioLogDelta(a, b) {
|
|
24021
|
+
return Math.abs(Math.log(a / b));
|
|
24022
|
+
}
|
|
24023
|
+
function isBigAspectRatioDelta(targetW, targetH) {
|
|
24024
|
+
const targetAR = targetW / targetH;
|
|
24025
|
+
if (targetAR >= EXTREME_AR_THRESHOLD || targetAR <= 1 / EXTREME_AR_THRESHOLD) {
|
|
24026
|
+
return true;
|
|
24027
|
+
}
|
|
24028
|
+
let minDelta = Infinity;
|
|
24029
|
+
for (const value of Object.values(GEMINI_RATIOS)) {
|
|
24030
|
+
const delta = ratioLogDelta(value, targetAR);
|
|
24031
|
+
if (delta < minDelta) {
|
|
24032
|
+
minDelta = delta;
|
|
24033
|
+
}
|
|
24034
|
+
}
|
|
24035
|
+
return minDelta > CUSTOM_RESIZE_DELTA_THRESHOLD;
|
|
24036
|
+
}
|
|
24037
|
+
async function callCustomResizeProxy(customResizeUrl, sourceImageDataUrl, targetWidth, targetHeight, signal) {
|
|
24038
|
+
const res = await fetch(customResizeUrl, {
|
|
24039
|
+
method: "POST",
|
|
24040
|
+
headers: { "Content-Type": "application/json" },
|
|
24041
|
+
body: JSON.stringify({
|
|
24042
|
+
imageDataUrl: sourceImageDataUrl,
|
|
24043
|
+
targetWidth,
|
|
24044
|
+
targetHeight
|
|
24045
|
+
}),
|
|
24046
|
+
signal
|
|
24047
|
+
});
|
|
24048
|
+
if (!res.ok) {
|
|
24049
|
+
const body = await res.text().catch(() => "");
|
|
24050
|
+
throw new Error(
|
|
24051
|
+
`Custom resize failed ${res.status}: ${body.slice(0, 300)}`
|
|
24052
|
+
);
|
|
24053
|
+
}
|
|
24054
|
+
const data = await res.json();
|
|
24055
|
+
if (typeof data?.dataUrl !== "string") {
|
|
24056
|
+
throw new Error("Custom resize response missing dataUrl");
|
|
24057
|
+
}
|
|
24058
|
+
return data.dataUrl;
|
|
24059
|
+
}
|
|
24060
|
+
async function callTier1CropProxy(tier1CropUrl, generatedImageDataUrl, sourceImageDataUrl, targetWidth, targetHeight, signal) {
|
|
24061
|
+
const res = await fetch(tier1CropUrl, {
|
|
24062
|
+
method: "POST",
|
|
24063
|
+
headers: { "Content-Type": "application/json" },
|
|
24064
|
+
body: JSON.stringify({
|
|
24065
|
+
generatedImageDataUrl,
|
|
24066
|
+
sourceImageDataUrl,
|
|
24067
|
+
targetWidth,
|
|
24068
|
+
targetHeight
|
|
24069
|
+
}),
|
|
24070
|
+
signal
|
|
24071
|
+
});
|
|
24072
|
+
if (!res.ok) {
|
|
24073
|
+
const body = await res.text().catch(() => "");
|
|
24074
|
+
throw new Error(`Tier-1 crop failed ${res.status}: ${body.slice(0, 300)}`);
|
|
24075
|
+
}
|
|
24076
|
+
const data = await res.json();
|
|
24077
|
+
if (typeof data?.dataUrl !== "string") {
|
|
24078
|
+
throw new Error("Tier-1 crop response missing dataUrl");
|
|
24079
|
+
}
|
|
24080
|
+
return data.dataUrl;
|
|
24081
|
+
}
|
|
23973
24082
|
function nearestGeminiAspectRatio(w, h) {
|
|
23974
24083
|
const target = w / h;
|
|
23975
24084
|
let best = "1:1";
|
|
@@ -24209,6 +24318,7 @@ HARD REQUIREMENTS:
|
|
|
24209
24318
|
\u2022 LOGO INTEGRITY: The brand logo must appear exactly as supplied \u2014 same shape, colours, and proportions. Do NOT alter, recolour, distort, or replace it. Do NOT squish or stretch the logo horizontally or vertically.
|
|
24210
24319
|
\u2022 Do NOT squish, stretch, or distort any element horizontally or vertically \u2014 maintain the natural aspect ratio of every visual, logo, product image, and text block.
|
|
24211
24320
|
\u2022 RE-ARRANGE the composition to suit the new aspect ratio \u2014 reposition and rescale elements so the layout feels native to ${tgtW}\xD7${tgtH}. Do NOT simply stretch, squash, or letterbox the original. If the new aspect ratio leaves empty areas after placing all elements, those areas should be filled with the background colour or a natural extension of the background \u2014 never with repeated ad content.
|
|
24321
|
+
\u2022 NO BORDER OR FRAME: the ad's background must extend all the way to every edge of the ${tgtW}\xD7${tgtH} canvas. Do NOT add a decorative border, outline, frame, vignette, or dim band around the ad \u2014 even as a stylistic flourish. The output should look like a single continuous ad filling the canvas, not a smaller ad pasted onto a bordered/framed backdrop.
|
|
24212
24322
|
\u2022 Maintain professional advertising quality: balanced layout, clear visual hierarchy, generous but purposeful spacing.
|
|
24213
24323
|
|
|
24214
24324
|
Output ONLY the final recomposed ad image at ${tgtW}\xD7${tgtH}.`;
|
|
@@ -24221,6 +24331,8 @@ async function runAutoResizeForDimension(opts) {
|
|
|
24221
24331
|
placementY,
|
|
24222
24332
|
app,
|
|
24223
24333
|
autoResizeUrl,
|
|
24334
|
+
customResizeUrl,
|
|
24335
|
+
tier1CropUrl,
|
|
24224
24336
|
agentImageModel,
|
|
24225
24337
|
sourceFrame,
|
|
24226
24338
|
sourceScreenshot,
|
|
@@ -24259,34 +24371,65 @@ async function runAutoResizeForDimension(opts) {
|
|
|
24259
24371
|
if (!sourceScreenshot) {
|
|
24260
24372
|
throw new Error("Source frame screenshot unavailable");
|
|
24261
24373
|
}
|
|
24262
|
-
const
|
|
24263
|
-
|
|
24264
|
-
|
|
24265
|
-
|
|
24266
|
-
|
|
24267
|
-
|
|
24268
|
-
|
|
24269
|
-
|
|
24270
|
-
|
|
24271
|
-
|
|
24272
|
-
|
|
24273
|
-
|
|
24274
|
-
|
|
24275
|
-
|
|
24276
|
-
|
|
24277
|
-
|
|
24278
|
-
|
|
24279
|
-
|
|
24280
|
-
|
|
24281
|
-
|
|
24282
|
-
|
|
24283
|
-
|
|
24284
|
-
|
|
24285
|
-
|
|
24286
|
-
|
|
24287
|
-
|
|
24288
|
-
|
|
24289
|
-
|
|
24374
|
+
const useBigDeltaPipeline = !!customResizeUrl && isBigAspectRatioDelta(tgtW, tgtH);
|
|
24375
|
+
let generatedDataUrl;
|
|
24376
|
+
let placedAtExactTargetSize = false;
|
|
24377
|
+
if (useBigDeltaPipeline) {
|
|
24378
|
+
debug(
|
|
24379
|
+
`[AutoResize] ${debugLabel} \u2014 big AR delta, routing to Tier-2 custom-resize`
|
|
24380
|
+
);
|
|
24381
|
+
onProgress?.("Recomposing for extreme aspect ratio\u2026");
|
|
24382
|
+
generatedDataUrl = await callCustomResizeProxy(
|
|
24383
|
+
customResizeUrl,
|
|
24384
|
+
sourceScreenshot,
|
|
24385
|
+
tgtW,
|
|
24386
|
+
tgtH,
|
|
24387
|
+
signal
|
|
24388
|
+
);
|
|
24389
|
+
placedAtExactTargetSize = true;
|
|
24390
|
+
} else {
|
|
24391
|
+
const aspectRatio = nearestGeminiAspectRatio(tgtW, tgtH);
|
|
24392
|
+
const resolution = clampResolutionForModel(
|
|
24393
|
+
selectOptimalResolution(tgtW, tgtH, aspectRatio),
|
|
24394
|
+
imageModel
|
|
24395
|
+
);
|
|
24396
|
+
debug(
|
|
24397
|
+
`[AutoResize] ${debugLabel} \u2014 image-gen recompose (model=${imageModel}, ar=${aspectRatio}, res=${resolution}, logo=${!!brandImages?.logo}, fontPreview=${!!brandImages?.fontPreview})`
|
|
24398
|
+
);
|
|
24399
|
+
onProgress?.("Generating ad\u2026");
|
|
24400
|
+
const prompt = buildAutoResizeImagePrompt(
|
|
24401
|
+
Math.round(sourceFrame.width),
|
|
24402
|
+
Math.round(sourceFrame.height),
|
|
24403
|
+
tgtW,
|
|
24404
|
+
tgtH,
|
|
24405
|
+
aspectRatio,
|
|
24406
|
+
brandImages
|
|
24407
|
+
);
|
|
24408
|
+
generatedDataUrl = await callOpenRouterImageAPI(
|
|
24409
|
+
prompt,
|
|
24410
|
+
imageModel,
|
|
24411
|
+
aspectRatio,
|
|
24412
|
+
resolution,
|
|
24413
|
+
false,
|
|
24414
|
+
autoResizeUrl,
|
|
24415
|
+
sourceScreenshot,
|
|
24416
|
+
signal,
|
|
24417
|
+
brandImages
|
|
24418
|
+
);
|
|
24419
|
+
if (tier1CropUrl) {
|
|
24420
|
+
debug(`[AutoResize] ${debugLabel} \u2014 Tier-1 element-aware crop`);
|
|
24421
|
+
onProgress?.("Fitting ad to frame\u2026");
|
|
24422
|
+
generatedDataUrl = await callTier1CropProxy(
|
|
24423
|
+
tier1CropUrl,
|
|
24424
|
+
generatedDataUrl,
|
|
24425
|
+
sourceScreenshot,
|
|
24426
|
+
tgtW,
|
|
24427
|
+
tgtH,
|
|
24428
|
+
signal
|
|
24429
|
+
);
|
|
24430
|
+
placedAtExactTargetSize = true;
|
|
24431
|
+
}
|
|
24432
|
+
}
|
|
24290
24433
|
onProgress?.("Placing ad\u2026");
|
|
24291
24434
|
const { width: imgNatW, height: imgNatH } = await getImageNaturalDimensions(
|
|
24292
24435
|
generatedDataUrl
|
|
@@ -24296,7 +24439,7 @@ async function runAutoResizeForDimension(opts) {
|
|
|
24296
24439
|
relY,
|
|
24297
24440
|
width: imgW,
|
|
24298
24441
|
height: imgH
|
|
24299
|
-
} = fitImageToFrame(imgNatW, imgNatH, tgtW, tgtH);
|
|
24442
|
+
} = placedAtExactTargetSize ? { relX: 0, relY: 0, width: tgtW, height: tgtH } : fitImageToFrame(imgNatW, imgNatH, tgtW, tgtH);
|
|
24300
24443
|
const currentPos = getCurrentFramePosition();
|
|
24301
24444
|
const fileId = nanoid();
|
|
24302
24445
|
const imgEl = newImageElement({
|
|
@@ -24372,6 +24515,8 @@ async function runAutoResize(opts) {
|
|
|
24372
24515
|
targetDimensions,
|
|
24373
24516
|
app,
|
|
24374
24517
|
autoResizeUrl,
|
|
24518
|
+
customResizeUrl,
|
|
24519
|
+
tier1CropUrl,
|
|
24375
24520
|
agentImageModel,
|
|
24376
24521
|
onBeforeAutoResize,
|
|
24377
24522
|
onAfterAutoResize,
|
|
@@ -24438,6 +24583,8 @@ async function runAutoResize(opts) {
|
|
|
24438
24583
|
existingFrameId: preCreatedFrameInfos?.[i]?.frameId,
|
|
24439
24584
|
app,
|
|
24440
24585
|
autoResizeUrl,
|
|
24586
|
+
customResizeUrl,
|
|
24587
|
+
tier1CropUrl,
|
|
24441
24588
|
agentImageModel,
|
|
24442
24589
|
sourceFrame,
|
|
24443
24590
|
sourceScreenshot,
|
|
@@ -24625,6 +24772,8 @@ var AutoResizePanel = ({
|
|
|
24625
24772
|
onAfterAutoResize,
|
|
24626
24773
|
onRunningChange,
|
|
24627
24774
|
autoResizeUrl,
|
|
24775
|
+
customResizeUrl,
|
|
24776
|
+
tier1CropUrl,
|
|
24628
24777
|
chatModel,
|
|
24629
24778
|
agentImageModel
|
|
24630
24779
|
}) => {
|
|
@@ -24733,6 +24882,8 @@ var AutoResizePanel = ({
|
|
|
24733
24882
|
preCreatedFrameInfos: preCreatedFrames.length > 0 ? preCreatedFrames : void 0,
|
|
24734
24883
|
app,
|
|
24735
24884
|
autoResizeUrl,
|
|
24885
|
+
customResizeUrl,
|
|
24886
|
+
tier1CropUrl,
|
|
24736
24887
|
chatModel,
|
|
24737
24888
|
agentImageModel,
|
|
24738
24889
|
customFontMap,
|
|
@@ -24781,6 +24932,8 @@ var AutoResizePanel = ({
|
|
|
24781
24932
|
onBeforeAutoResize,
|
|
24782
24933
|
onAfterAutoResize,
|
|
24783
24934
|
autoResizeUrl,
|
|
24935
|
+
customResizeUrl,
|
|
24936
|
+
tier1CropUrl,
|
|
24784
24937
|
chatModel,
|
|
24785
24938
|
agentImageModel
|
|
24786
24939
|
]);
|
|
@@ -25063,6 +25216,8 @@ var AutoResizePanelHost = ({ app }) => {
|
|
|
25063
25216
|
onBeforeAutoResize: app.props.onBeforeAutoResize,
|
|
25064
25217
|
onAfterAutoResize: app.props.onAfterAutoResize,
|
|
25065
25218
|
autoResizeUrl: app.props.autoResizeUrl ?? "",
|
|
25219
|
+
customResizeUrl: app.props.customResizeUrl,
|
|
25220
|
+
tier1CropUrl: app.props.tier1CropUrl,
|
|
25066
25221
|
chatModel: app.props.chatModel ?? "google/gemini-3.1-flash-lite-preview",
|
|
25067
25222
|
agentImageModel: app.props.agentImageModel
|
|
25068
25223
|
}
|
|
@@ -25502,7 +25657,7 @@ var TemplateBuilderPanelHost = ({
|
|
|
25502
25657
|
import { useCallback as useCallback16, useEffect as useEffect35, useRef as useRef28, useState as useState32 } from "react";
|
|
25503
25658
|
import { sceneCoordsToViewportCoords as sceneCoordsToViewportCoords8 } from "@orangecatai/common";
|
|
25504
25659
|
import {
|
|
25505
|
-
CaptureUpdateAction as
|
|
25660
|
+
CaptureUpdateAction as CaptureUpdateAction37,
|
|
25506
25661
|
getElementAbsoluteCoords as getElementAbsoluteCoords10
|
|
25507
25662
|
} from "@orangecatai/element";
|
|
25508
25663
|
import { ArrowUp, ImagePlus, X } from "lucide-react";
|
|
@@ -26679,7 +26834,7 @@ var ImageGeneratorPanel = ({
|
|
|
26679
26834
|
ratio: newRatio,
|
|
26680
26835
|
resolution: newRes
|
|
26681
26836
|
});
|
|
26682
|
-
app.syncActionResult({ captureUpdate:
|
|
26837
|
+
app.syncActionResult({ captureUpdate: CaptureUpdateAction37.IMMEDIATELY });
|
|
26683
26838
|
}, [selectedModel, app, element, persistFrameSettings]);
|
|
26684
26839
|
const [isGenerating, setIsGenerating] = useState32(
|
|
26685
26840
|
() => hasPendingGeneration(element.id)
|
|
@@ -26744,7 +26899,7 @@ var ImageGeneratorPanel = ({
|
|
|
26744
26899
|
}
|
|
26745
26900
|
});
|
|
26746
26901
|
appRef.current.syncActionResult({
|
|
26747
|
-
captureUpdate:
|
|
26902
|
+
captureUpdate: CaptureUpdateAction37.IMMEDIATELY
|
|
26748
26903
|
});
|
|
26749
26904
|
},
|
|
26750
26905
|
[selectedModel, selectedResolution]
|
|
@@ -26767,7 +26922,7 @@ var ImageGeneratorPanel = ({
|
|
|
26767
26922
|
}
|
|
26768
26923
|
});
|
|
26769
26924
|
appRef.current.syncActionResult({
|
|
26770
|
-
captureUpdate:
|
|
26925
|
+
captureUpdate: CaptureUpdateAction37.IMMEDIATELY
|
|
26771
26926
|
});
|
|
26772
26927
|
},
|
|
26773
26928
|
[selectedModel, selectedRatio]
|
|
@@ -27124,7 +27279,7 @@ var ImageGeneratorPanel = ({
|
|
|
27124
27279
|
import { useCallback as useCallback17, useEffect as useEffect36, useRef as useRef29, useState as useState33 } from "react";
|
|
27125
27280
|
import { sceneCoordsToViewportCoords as sceneCoordsToViewportCoords9 } from "@orangecatai/common";
|
|
27126
27281
|
import {
|
|
27127
|
-
CaptureUpdateAction as
|
|
27282
|
+
CaptureUpdateAction as CaptureUpdateAction38,
|
|
27128
27283
|
getElementAbsoluteCoords as getElementAbsoluteCoords11
|
|
27129
27284
|
} from "@orangecatai/element";
|
|
27130
27285
|
import { ArrowUp as ArrowUp2, Volume2, X as X2 } from "lucide-react";
|
|
@@ -27138,7 +27293,9 @@ async function submitVideoJob(params, videoGenUrl) {
|
|
|
27138
27293
|
});
|
|
27139
27294
|
if (!res.ok) {
|
|
27140
27295
|
const data2 = await res.json().catch(() => ({}));
|
|
27141
|
-
throw new Error(
|
|
27296
|
+
throw new Error(
|
|
27297
|
+
data2.error || `Submission failed (${res.status})`
|
|
27298
|
+
);
|
|
27142
27299
|
}
|
|
27143
27300
|
const data = await res.json();
|
|
27144
27301
|
return { jobId: data.jobId };
|
|
@@ -27155,14 +27312,18 @@ async function pollVideoJob(jobId, videoGenStatusUrl, onProgress, signal) {
|
|
|
27155
27312
|
const timer = setTimeout(resolve, POLL_INTERVAL_MS);
|
|
27156
27313
|
signal?.addEventListener("abort", () => {
|
|
27157
27314
|
clearTimeout(timer);
|
|
27158
|
-
reject(
|
|
27315
|
+
reject(
|
|
27316
|
+
Object.assign(new Error("AbortError"), { name: "AbortError" })
|
|
27317
|
+
);
|
|
27159
27318
|
});
|
|
27160
27319
|
});
|
|
27161
27320
|
}
|
|
27162
27321
|
const res = await fetch(`${videoGenStatusUrl}/${jobId}`, { signal });
|
|
27163
27322
|
if (!res.ok) {
|
|
27164
27323
|
const data2 = await res.json().catch(() => ({}));
|
|
27165
|
-
throw new Error(
|
|
27324
|
+
throw new Error(
|
|
27325
|
+
data2.error || `Status check failed (${res.status})`
|
|
27326
|
+
);
|
|
27166
27327
|
}
|
|
27167
27328
|
const data = await res.json();
|
|
27168
27329
|
if (data.status === "done" && data.videoPresignedUrl) {
|
|
@@ -27257,7 +27418,15 @@ var VIDEO_MODEL_CONFIG = {
|
|
|
27257
27418
|
supportsResolution: true,
|
|
27258
27419
|
supportedResolutions: ["480p", "720p", "1080p", "4K"],
|
|
27259
27420
|
supportsNegativePrompt: false,
|
|
27260
|
-
supportedRatios: [
|
|
27421
|
+
supportedRatios: [
|
|
27422
|
+
"16:9",
|
|
27423
|
+
"9:16",
|
|
27424
|
+
"1:1",
|
|
27425
|
+
"4:3",
|
|
27426
|
+
"3:4",
|
|
27427
|
+
"21:9",
|
|
27428
|
+
"9:21"
|
|
27429
|
+
],
|
|
27261
27430
|
frameInputMode: "dual-frame",
|
|
27262
27431
|
supportsInputReferences: true,
|
|
27263
27432
|
supportsSeed: true
|
|
@@ -27274,7 +27443,15 @@ var VIDEO_MODEL_CONFIG = {
|
|
|
27274
27443
|
supportsResolution: true,
|
|
27275
27444
|
supportedResolutions: ["480p", "720p"],
|
|
27276
27445
|
supportsNegativePrompt: false,
|
|
27277
|
-
supportedRatios: [
|
|
27446
|
+
supportedRatios: [
|
|
27447
|
+
"16:9",
|
|
27448
|
+
"9:16",
|
|
27449
|
+
"1:1",
|
|
27450
|
+
"4:3",
|
|
27451
|
+
"3:4",
|
|
27452
|
+
"21:9",
|
|
27453
|
+
"9:21"
|
|
27454
|
+
],
|
|
27278
27455
|
frameInputMode: "dual-frame",
|
|
27279
27456
|
supportsInputReferences: true,
|
|
27280
27457
|
supportsSeed: true
|
|
@@ -27291,7 +27468,15 @@ var VIDEO_MODEL_CONFIG = {
|
|
|
27291
27468
|
supportsResolution: true,
|
|
27292
27469
|
supportedResolutions: ["720p", "1080p"],
|
|
27293
27470
|
supportsNegativePrompt: false,
|
|
27294
|
-
supportedRatios: [
|
|
27471
|
+
supportedRatios: [
|
|
27472
|
+
"16:9",
|
|
27473
|
+
"9:16",
|
|
27474
|
+
"1:1",
|
|
27475
|
+
"4:3",
|
|
27476
|
+
"3:4",
|
|
27477
|
+
"21:9",
|
|
27478
|
+
"9:21"
|
|
27479
|
+
],
|
|
27295
27480
|
frameInputMode: "start-only",
|
|
27296
27481
|
supportsInputReferences: false,
|
|
27297
27482
|
supportsSeed: true
|
|
@@ -27308,13 +27493,23 @@ var VIDEO_MODEL_CONFIG = {
|
|
|
27308
27493
|
supportsResolution: true,
|
|
27309
27494
|
supportedResolutions: ["480p", "720p"],
|
|
27310
27495
|
supportsNegativePrompt: false,
|
|
27311
|
-
supportedRatios: [
|
|
27496
|
+
supportedRatios: [
|
|
27497
|
+
"16:9",
|
|
27498
|
+
"9:16",
|
|
27499
|
+
"1:1",
|
|
27500
|
+
"4:3",
|
|
27501
|
+
"3:4",
|
|
27502
|
+
"3:2",
|
|
27503
|
+
"2:3"
|
|
27504
|
+
],
|
|
27312
27505
|
frameInputMode: "start-only",
|
|
27313
27506
|
supportsInputReferences: false,
|
|
27314
27507
|
supportsSeed: true
|
|
27315
27508
|
}
|
|
27316
27509
|
};
|
|
27317
|
-
var VIDEO_MODEL_NAMES = Object.keys(
|
|
27510
|
+
var VIDEO_MODEL_NAMES = Object.keys(
|
|
27511
|
+
VIDEO_MODEL_CONFIG
|
|
27512
|
+
);
|
|
27318
27513
|
var RATIO_DIMS = {
|
|
27319
27514
|
"16:9": [1280, 720],
|
|
27320
27515
|
"9:16": [720, 1280],
|
|
@@ -27334,41 +27529,252 @@ var CAMERA_MOVEMENTS = [
|
|
|
27334
27529
|
{ label: "Fixed lens", phrase: "static fixed camera, no camera movement" },
|
|
27335
27530
|
{ label: "Handheld", phrase: "handheld camera with natural subtle shake" },
|
|
27336
27531
|
{ label: "Zoom out", phrase: "camera slowly zooms out from the subject" },
|
|
27337
|
-
{
|
|
27532
|
+
{
|
|
27533
|
+
label: "Advance",
|
|
27534
|
+
phrase: "camera slowly moves forward toward the subject"
|
|
27535
|
+
},
|
|
27338
27536
|
{ label: "Follow", phrase: "camera tracks and follows the subject" },
|
|
27339
27537
|
{ label: "Orbit", phrase: "camera slowly orbits around the subject" },
|
|
27340
|
-
{
|
|
27538
|
+
{
|
|
27539
|
+
label: "Surround",
|
|
27540
|
+
phrase: "camera circles the subject in a 360-degree sweep"
|
|
27541
|
+
},
|
|
27341
27542
|
{ label: "Shake right", phrase: "camera shakes and pans to the right" },
|
|
27342
27543
|
{ label: "Shake left", phrase: "camera shakes and pans to the left" },
|
|
27343
27544
|
{ label: "Shake up", phrase: "camera shakes upward" }
|
|
27344
27545
|
];
|
|
27345
|
-
var ChevronDownIcon3 = () => /* @__PURE__ */ jsx94("svg", { width: "9", height: "9", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27346
|
-
|
|
27546
|
+
var ChevronDownIcon3 = () => /* @__PURE__ */ jsx94("svg", { width: "9", height: "9", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27547
|
+
"path",
|
|
27548
|
+
{
|
|
27549
|
+
d: "M2.5 3.75L5 6.25L7.5 3.75",
|
|
27550
|
+
stroke: "currentColor",
|
|
27551
|
+
strokeWidth: "1.6",
|
|
27552
|
+
strokeLinecap: "round",
|
|
27553
|
+
strokeLinejoin: "round"
|
|
27554
|
+
}
|
|
27555
|
+
) });
|
|
27556
|
+
var CheckIcon4 = () => /* @__PURE__ */ jsx94("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27557
|
+
"path",
|
|
27558
|
+
{
|
|
27559
|
+
d: "M2.5 7.5L5.5 10.5L11.5 3.5",
|
|
27560
|
+
stroke: "currentColor",
|
|
27561
|
+
strokeWidth: "1.6",
|
|
27562
|
+
strokeLinecap: "round",
|
|
27563
|
+
strokeLinejoin: "round"
|
|
27564
|
+
}
|
|
27565
|
+
) });
|
|
27347
27566
|
var CameraMovementIcon = () => /* @__PURE__ */ jsxs51("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", children: [
|
|
27348
27567
|
/* @__PURE__ */ jsx94("circle", { cx: "8", cy: "8", r: "2.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
27349
|
-
/* @__PURE__ */ jsx94(
|
|
27568
|
+
/* @__PURE__ */ jsx94(
|
|
27569
|
+
"path",
|
|
27570
|
+
{
|
|
27571
|
+
d: "M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M3.93 3.93l1.06 1.06M11.01 11.01l1.06 1.06M3.93 12.07l1.06-1.06M11.01 4.99l1.06-1.06",
|
|
27572
|
+
stroke: "currentColor",
|
|
27573
|
+
strokeWidth: "1.4",
|
|
27574
|
+
strokeLinecap: "round"
|
|
27575
|
+
}
|
|
27576
|
+
)
|
|
27350
27577
|
] });
|
|
27351
|
-
var ModelIcon2 = () => /* @__PURE__ */ jsx94("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27352
|
-
|
|
27578
|
+
var ModelIcon2 = () => /* @__PURE__ */ jsx94("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27579
|
+
"path",
|
|
27580
|
+
{
|
|
27581
|
+
d: "M8 2L10.5 5.5H13.5L11.5 8L13 11.5L8 9.5L3 11.5L4.5 8L2.5 5.5H5.5L8 2Z",
|
|
27582
|
+
stroke: "currentColor",
|
|
27583
|
+
strokeWidth: "1.3",
|
|
27584
|
+
strokeLinejoin: "round"
|
|
27585
|
+
}
|
|
27586
|
+
) });
|
|
27587
|
+
var SpinnerIcon3 = () => /* @__PURE__ */ jsx94(
|
|
27588
|
+
"svg",
|
|
27589
|
+
{
|
|
27590
|
+
width: "14",
|
|
27591
|
+
height: "14",
|
|
27592
|
+
viewBox: "0 0 14 14",
|
|
27593
|
+
fill: "none",
|
|
27594
|
+
className: "vgp-spinner",
|
|
27595
|
+
children: /* @__PURE__ */ jsx94(
|
|
27596
|
+
"circle",
|
|
27597
|
+
{
|
|
27598
|
+
cx: "7",
|
|
27599
|
+
cy: "7",
|
|
27600
|
+
r: "5.5",
|
|
27601
|
+
stroke: "currentColor",
|
|
27602
|
+
strokeWidth: "1.5",
|
|
27603
|
+
strokeLinecap: "round",
|
|
27604
|
+
strokeDasharray: "20 14"
|
|
27605
|
+
}
|
|
27606
|
+
)
|
|
27607
|
+
}
|
|
27608
|
+
);
|
|
27353
27609
|
var ImageUploadIcon = () => /* @__PURE__ */ jsxs51("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", children: [
|
|
27354
|
-
/* @__PURE__ */ jsx94(
|
|
27610
|
+
/* @__PURE__ */ jsx94(
|
|
27611
|
+
"rect",
|
|
27612
|
+
{
|
|
27613
|
+
x: "2",
|
|
27614
|
+
y: "2",
|
|
27615
|
+
width: "12",
|
|
27616
|
+
height: "12",
|
|
27617
|
+
rx: "2",
|
|
27618
|
+
stroke: "currentColor",
|
|
27619
|
+
strokeWidth: "1.3"
|
|
27620
|
+
}
|
|
27621
|
+
),
|
|
27355
27622
|
/* @__PURE__ */ jsx94("circle", { cx: "5.5", cy: "6", r: "1.2", fill: "currentColor" }),
|
|
27356
|
-
/* @__PURE__ */ jsx94(
|
|
27623
|
+
/* @__PURE__ */ jsx94(
|
|
27624
|
+
"path",
|
|
27625
|
+
{
|
|
27626
|
+
d: "M2 11l3.5-3.5 2.5 2.5 2-2 3 3",
|
|
27627
|
+
stroke: "currentColor",
|
|
27628
|
+
strokeWidth: "1.3",
|
|
27629
|
+
strokeLinecap: "round",
|
|
27630
|
+
strokeLinejoin: "round"
|
|
27631
|
+
}
|
|
27632
|
+
)
|
|
27357
27633
|
] });
|
|
27358
27634
|
var FramesIcon = () => /* @__PURE__ */ jsxs51("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", children: [
|
|
27359
|
-
/* @__PURE__ */ jsx94(
|
|
27360
|
-
|
|
27361
|
-
|
|
27635
|
+
/* @__PURE__ */ jsx94(
|
|
27636
|
+
"rect",
|
|
27637
|
+
{
|
|
27638
|
+
x: "1",
|
|
27639
|
+
y: "3",
|
|
27640
|
+
width: "14",
|
|
27641
|
+
height: "10",
|
|
27642
|
+
rx: "2",
|
|
27643
|
+
stroke: "currentColor",
|
|
27644
|
+
strokeWidth: "1.3"
|
|
27645
|
+
}
|
|
27646
|
+
),
|
|
27647
|
+
/* @__PURE__ */ jsx94(
|
|
27648
|
+
"line",
|
|
27649
|
+
{
|
|
27650
|
+
x1: "5",
|
|
27651
|
+
y1: "3",
|
|
27652
|
+
x2: "5",
|
|
27653
|
+
y2: "13",
|
|
27654
|
+
stroke: "currentColor",
|
|
27655
|
+
strokeWidth: "1.3"
|
|
27656
|
+
}
|
|
27657
|
+
),
|
|
27658
|
+
/* @__PURE__ */ jsx94(
|
|
27659
|
+
"line",
|
|
27660
|
+
{
|
|
27661
|
+
x1: "11",
|
|
27662
|
+
y1: "3",
|
|
27663
|
+
x2: "11",
|
|
27664
|
+
y2: "13",
|
|
27665
|
+
stroke: "currentColor",
|
|
27666
|
+
strokeWidth: "1.3"
|
|
27667
|
+
}
|
|
27668
|
+
)
|
|
27362
27669
|
] });
|
|
27363
|
-
var RatioIcon169 = () => /* @__PURE__ */ jsx94("svg", { width: "16", height: "11", viewBox: "0 0 16 11", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27364
|
-
|
|
27365
|
-
|
|
27366
|
-
|
|
27367
|
-
|
|
27368
|
-
|
|
27369
|
-
|
|
27370
|
-
|
|
27371
|
-
|
|
27670
|
+
var RatioIcon169 = () => /* @__PURE__ */ jsx94("svg", { width: "16", height: "11", viewBox: "0 0 16 11", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27671
|
+
"rect",
|
|
27672
|
+
{
|
|
27673
|
+
x: "0.75",
|
|
27674
|
+
y: "0.75",
|
|
27675
|
+
width: "14.5",
|
|
27676
|
+
height: "9.5",
|
|
27677
|
+
rx: "1.5",
|
|
27678
|
+
stroke: "currentColor",
|
|
27679
|
+
strokeWidth: "1.5"
|
|
27680
|
+
}
|
|
27681
|
+
) });
|
|
27682
|
+
var RatioIcon916 = () => /* @__PURE__ */ jsx94("svg", { width: "11", height: "16", viewBox: "0 0 11 16", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27683
|
+
"rect",
|
|
27684
|
+
{
|
|
27685
|
+
x: "0.75",
|
|
27686
|
+
y: "0.75",
|
|
27687
|
+
width: "9.5",
|
|
27688
|
+
height: "14.5",
|
|
27689
|
+
rx: "1.5",
|
|
27690
|
+
stroke: "currentColor",
|
|
27691
|
+
strokeWidth: "1.5"
|
|
27692
|
+
}
|
|
27693
|
+
) });
|
|
27694
|
+
var RatioIcon11 = () => /* @__PURE__ */ jsx94("svg", { width: "13", height: "13", viewBox: "0 0 13 13", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27695
|
+
"rect",
|
|
27696
|
+
{
|
|
27697
|
+
x: "0.75",
|
|
27698
|
+
y: "0.75",
|
|
27699
|
+
width: "11.5",
|
|
27700
|
+
height: "11.5",
|
|
27701
|
+
rx: "1.5",
|
|
27702
|
+
stroke: "currentColor",
|
|
27703
|
+
strokeWidth: "1.5"
|
|
27704
|
+
}
|
|
27705
|
+
) });
|
|
27706
|
+
var RatioIcon43 = () => /* @__PURE__ */ jsx94("svg", { width: "16", height: "12", viewBox: "0 0 16 12", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27707
|
+
"rect",
|
|
27708
|
+
{
|
|
27709
|
+
x: "0.75",
|
|
27710
|
+
y: "0.75",
|
|
27711
|
+
width: "14.5",
|
|
27712
|
+
height: "10.5",
|
|
27713
|
+
rx: "1.5",
|
|
27714
|
+
stroke: "currentColor",
|
|
27715
|
+
strokeWidth: "1.5"
|
|
27716
|
+
}
|
|
27717
|
+
) });
|
|
27718
|
+
var RatioIcon34 = () => /* @__PURE__ */ jsx94("svg", { width: "12", height: "16", viewBox: "0 0 12 16", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27719
|
+
"rect",
|
|
27720
|
+
{
|
|
27721
|
+
x: "0.75",
|
|
27722
|
+
y: "0.75",
|
|
27723
|
+
width: "10.5",
|
|
27724
|
+
height: "14.5",
|
|
27725
|
+
rx: "1.5",
|
|
27726
|
+
stroke: "currentColor",
|
|
27727
|
+
strokeWidth: "1.5"
|
|
27728
|
+
}
|
|
27729
|
+
) });
|
|
27730
|
+
var RatioIcon219 = () => /* @__PURE__ */ jsx94("svg", { width: "18", height: "8", viewBox: "0 0 18 8", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27731
|
+
"rect",
|
|
27732
|
+
{
|
|
27733
|
+
x: "0.75",
|
|
27734
|
+
y: "0.75",
|
|
27735
|
+
width: "16.5",
|
|
27736
|
+
height: "6.5",
|
|
27737
|
+
rx: "1.5",
|
|
27738
|
+
stroke: "currentColor",
|
|
27739
|
+
strokeWidth: "1.5"
|
|
27740
|
+
}
|
|
27741
|
+
) });
|
|
27742
|
+
var RatioIcon921 = () => /* @__PURE__ */ jsx94("svg", { width: "8", height: "18", viewBox: "0 0 8 18", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27743
|
+
"rect",
|
|
27744
|
+
{
|
|
27745
|
+
x: "0.75",
|
|
27746
|
+
y: "0.75",
|
|
27747
|
+
width: "6.5",
|
|
27748
|
+
height: "16.5",
|
|
27749
|
+
rx: "1.5",
|
|
27750
|
+
stroke: "currentColor",
|
|
27751
|
+
strokeWidth: "1.5"
|
|
27752
|
+
}
|
|
27753
|
+
) });
|
|
27754
|
+
var RatioIcon32 = () => /* @__PURE__ */ jsx94("svg", { width: "15", height: "10", viewBox: "0 0 15 10", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27755
|
+
"rect",
|
|
27756
|
+
{
|
|
27757
|
+
x: "0.75",
|
|
27758
|
+
y: "0.75",
|
|
27759
|
+
width: "13.5",
|
|
27760
|
+
height: "8.5",
|
|
27761
|
+
rx: "1.5",
|
|
27762
|
+
stroke: "currentColor",
|
|
27763
|
+
strokeWidth: "1.5"
|
|
27764
|
+
}
|
|
27765
|
+
) });
|
|
27766
|
+
var RatioIcon23 = () => /* @__PURE__ */ jsx94("svg", { width: "10", height: "15", viewBox: "0 0 10 15", fill: "none", children: /* @__PURE__ */ jsx94(
|
|
27767
|
+
"rect",
|
|
27768
|
+
{
|
|
27769
|
+
x: "0.75",
|
|
27770
|
+
y: "0.75",
|
|
27771
|
+
width: "8.5",
|
|
27772
|
+
height: "13.5",
|
|
27773
|
+
rx: "1.5",
|
|
27774
|
+
stroke: "currentColor",
|
|
27775
|
+
strokeWidth: "1.5"
|
|
27776
|
+
}
|
|
27777
|
+
) });
|
|
27372
27778
|
var RATIO_ICONS = {
|
|
27373
27779
|
"16:9": /* @__PURE__ */ jsx94(RatioIcon169, {}),
|
|
27374
27780
|
"9:16": /* @__PURE__ */ jsx94(RatioIcon916, {}),
|
|
@@ -27391,8 +27797,9 @@ var VideoGeneratorPanel = ({
|
|
|
27391
27797
|
const videoGenStatusUrl = app.props.videoGenStatusUrl;
|
|
27392
27798
|
const getStoredSettings = (frame) => {
|
|
27393
27799
|
const stored2 = frame.customData?.videoGenerator;
|
|
27394
|
-
if (!stored2)
|
|
27800
|
+
if (!stored2) {
|
|
27395
27801
|
return null;
|
|
27802
|
+
}
|
|
27396
27803
|
return {
|
|
27397
27804
|
model: stored2.model,
|
|
27398
27805
|
ratio: stored2.ratio,
|
|
@@ -27407,20 +27814,25 @@ var VideoGeneratorPanel = ({
|
|
|
27407
27814
|
const defaultRatio = stored?.ratio ?? "16:9";
|
|
27408
27815
|
const defaultResolution = stored?.resolution ?? (modelCfg.supportsResolution ? VIDEO_MODEL_CONFIG[defaultModel].supportedResolutions?.[1] ?? void 0 : void 0);
|
|
27409
27816
|
const defaultDuration = (() => {
|
|
27410
|
-
if (stored?.duration != null)
|
|
27817
|
+
if (stored?.duration != null) {
|
|
27411
27818
|
return stored.duration;
|
|
27412
|
-
|
|
27819
|
+
}
|
|
27820
|
+
if (!modelCfg.supportsDuration) {
|
|
27413
27821
|
return void 0;
|
|
27822
|
+
}
|
|
27414
27823
|
const cfg2 = modelCfg;
|
|
27415
|
-
if (cfg2.durationMode === "choices")
|
|
27824
|
+
if (cfg2.durationMode === "choices") {
|
|
27416
27825
|
return cfg2.durationValues?.[0];
|
|
27826
|
+
}
|
|
27417
27827
|
return cfg2.minDuration ?? 5;
|
|
27418
27828
|
})();
|
|
27419
27829
|
const [prompt, setPrompt] = useState33("");
|
|
27420
27830
|
const [selectedModel, setSelectedModel] = useState33(defaultModel);
|
|
27421
27831
|
const [selectedRatio, setSelectedRatio] = useState33(defaultRatio);
|
|
27422
27832
|
const [selectedResolution, setSelectedResolution] = useState33(defaultResolution);
|
|
27423
|
-
const [selectedDuration, setSelectedDuration] = useState33(
|
|
27833
|
+
const [selectedDuration, setSelectedDuration] = useState33(
|
|
27834
|
+
defaultDuration
|
|
27835
|
+
);
|
|
27424
27836
|
const [generateAudio, setGenerateAudio] = useState33(true);
|
|
27425
27837
|
const [negativePrompt, setNegativePrompt] = useState33("");
|
|
27426
27838
|
const [firstFrame, setFirstFrame] = useState33(null);
|
|
@@ -27428,7 +27840,9 @@ var VideoGeneratorPanel = ({
|
|
|
27428
27840
|
const [inputReferences, setInputReferences] = useState33([]);
|
|
27429
27841
|
const [seed, setSeed] = useState33(void 0);
|
|
27430
27842
|
const [inputMode, setInputMode] = useState33("frames");
|
|
27431
|
-
const [cameraMovement, setCameraMovement] = useState33(
|
|
27843
|
+
const [cameraMovement, setCameraMovement] = useState33(
|
|
27844
|
+
stored?.cameraMovement ?? null
|
|
27845
|
+
);
|
|
27432
27846
|
const [genStatus, setGenStatus] = useState33("idle");
|
|
27433
27847
|
const [progress, setProgress] = useState33(0);
|
|
27434
27848
|
const [generateError, setGenerateError] = useState33(null);
|
|
@@ -27479,7 +27893,9 @@ var VideoGeneratorPanel = ({
|
|
|
27479
27893
|
} else {
|
|
27480
27894
|
const min = ncfg.minDuration ?? 3;
|
|
27481
27895
|
const max = ncfg.maxDuration ?? 15;
|
|
27482
|
-
setSelectedDuration(
|
|
27896
|
+
setSelectedDuration(
|
|
27897
|
+
Math.min(max, Math.max(min, selectedDuration ?? min))
|
|
27898
|
+
);
|
|
27483
27899
|
}
|
|
27484
27900
|
} else {
|
|
27485
27901
|
setSelectedDuration(void 0);
|
|
@@ -27511,13 +27927,15 @@ var VideoGeneratorPanel = ({
|
|
|
27511
27927
|
return () => document.removeEventListener("mousedown", handler);
|
|
27512
27928
|
}, []);
|
|
27513
27929
|
useEffect36(() => {
|
|
27514
|
-
if (!element.customData?.videoGeneratorAutoFitPending)
|
|
27930
|
+
if (!element.customData?.videoGeneratorAutoFitPending) {
|
|
27515
27931
|
return;
|
|
27932
|
+
}
|
|
27516
27933
|
let frameId = 0;
|
|
27517
27934
|
let cancelled = false;
|
|
27518
27935
|
const run = () => {
|
|
27519
|
-
if (cancelled)
|
|
27936
|
+
if (cancelled) {
|
|
27520
27937
|
return;
|
|
27938
|
+
}
|
|
27521
27939
|
app.scrollToContent(element, {
|
|
27522
27940
|
fitToViewport: true,
|
|
27523
27941
|
viewportZoomFactor: 0.8,
|
|
@@ -27546,12 +27964,19 @@ var VideoGeneratorPanel = ({
|
|
|
27546
27964
|
videoGenerator: settings
|
|
27547
27965
|
}
|
|
27548
27966
|
});
|
|
27549
|
-
appRef.current.syncActionResult({
|
|
27967
|
+
appRef.current.syncActionResult({
|
|
27968
|
+
captureUpdate: CaptureUpdateAction38.IMMEDIATELY
|
|
27969
|
+
});
|
|
27550
27970
|
}, []);
|
|
27551
27971
|
const applyRatioResize = useCallback17((newRatio) => {
|
|
27552
27972
|
const [w, h] = RATIO_DIMS[newRatio] ?? [1280, 720];
|
|
27553
|
-
appRef.current.scene.mutateElement(elementRef.current, {
|
|
27554
|
-
|
|
27973
|
+
appRef.current.scene.mutateElement(elementRef.current, {
|
|
27974
|
+
width: w,
|
|
27975
|
+
height: h
|
|
27976
|
+
});
|
|
27977
|
+
appRef.current.syncActionResult({
|
|
27978
|
+
captureUpdate: CaptureUpdateAction38.IMMEDIATELY
|
|
27979
|
+
});
|
|
27555
27980
|
window.requestAnimationFrame(() => {
|
|
27556
27981
|
appRef.current.scrollToContent(elementRef.current, {
|
|
27557
27982
|
fitToViewport: true,
|
|
@@ -27564,31 +27989,39 @@ var VideoGeneratorPanel = ({
|
|
|
27564
27989
|
const handleFrameUpload = useCallback17(
|
|
27565
27990
|
(which) => (e) => {
|
|
27566
27991
|
const file2 = e.target.files?.[0];
|
|
27567
|
-
if (!file2)
|
|
27992
|
+
if (!file2) {
|
|
27568
27993
|
return;
|
|
27994
|
+
}
|
|
27569
27995
|
const reader = new FileReader();
|
|
27570
27996
|
reader.onload = () => {
|
|
27571
|
-
if (which === "first")
|
|
27997
|
+
if (which === "first") {
|
|
27572
27998
|
setFirstFrame(reader.result);
|
|
27573
|
-
else
|
|
27999
|
+
} else {
|
|
27574
28000
|
setLastFrame(reader.result);
|
|
28001
|
+
}
|
|
28002
|
+
};
|
|
28003
|
+
reader.readAsDataURL(file2);
|
|
28004
|
+
e.target.value = "";
|
|
28005
|
+
},
|
|
28006
|
+
[]
|
|
28007
|
+
);
|
|
28008
|
+
const handleRefUpload = useCallback17(
|
|
28009
|
+
(e) => {
|
|
28010
|
+
const file2 = e.target.files?.[0];
|
|
28011
|
+
if (!file2) {
|
|
28012
|
+
return;
|
|
28013
|
+
}
|
|
28014
|
+
const reader = new FileReader();
|
|
28015
|
+
reader.onload = () => {
|
|
28016
|
+
setInputReferences(
|
|
28017
|
+
(prev) => [...prev, reader.result].slice(0, 3)
|
|
28018
|
+
);
|
|
27575
28019
|
};
|
|
27576
28020
|
reader.readAsDataURL(file2);
|
|
27577
28021
|
e.target.value = "";
|
|
27578
28022
|
},
|
|
27579
28023
|
[]
|
|
27580
28024
|
);
|
|
27581
|
-
const handleRefUpload = useCallback17((e) => {
|
|
27582
|
-
const file2 = e.target.files?.[0];
|
|
27583
|
-
if (!file2)
|
|
27584
|
-
return;
|
|
27585
|
-
const reader = new FileReader();
|
|
27586
|
-
reader.onload = () => {
|
|
27587
|
-
setInputReferences((prev) => [...prev, reader.result].slice(0, 3));
|
|
27588
|
-
};
|
|
27589
|
-
reader.readAsDataURL(file2);
|
|
27590
|
-
e.target.value = "";
|
|
27591
|
-
}, []);
|
|
27592
28025
|
const isGenerating = genStatus === "submitting" || genStatus === "polling";
|
|
27593
28026
|
const handleStop = useCallback17(() => {
|
|
27594
28027
|
abortControllerRef.current?.abort();
|
|
@@ -27611,7 +28044,9 @@ var VideoGeneratorPanel = ({
|
|
|
27611
28044
|
try {
|
|
27612
28045
|
const { allowed, error } = await onBeforeVideoGen();
|
|
27613
28046
|
if (!allowed) {
|
|
27614
|
-
setGenerateError(
|
|
28047
|
+
setGenerateError(
|
|
28048
|
+
error || "Insufficient credits for video generation"
|
|
28049
|
+
);
|
|
27615
28050
|
setGenStatus("error");
|
|
27616
28051
|
return;
|
|
27617
28052
|
}
|
|
@@ -27635,7 +28070,9 @@ var VideoGeneratorPanel = ({
|
|
|
27635
28070
|
...selectedDuration != null && { duration: selectedDuration },
|
|
27636
28071
|
...selectedResolution != null && { resolution: selectedResolution },
|
|
27637
28072
|
...firstFrame && { firstFrameDataUrl: firstFrame },
|
|
27638
|
-
...lastFrame && currentCfg.supportsLastFrame && currentCfg.frameInputMode === "dual-frame" && {
|
|
28073
|
+
...lastFrame && currentCfg.supportsLastFrame && currentCfg.frameInputMode === "dual-frame" && {
|
|
28074
|
+
lastFrameDataUrl: lastFrame
|
|
28075
|
+
},
|
|
27639
28076
|
...currentCfg.audioMode === "toggle" && { audio: generateAudio },
|
|
27640
28077
|
...negativePrompt.trim() && currentCfg.supportsNegativePrompt && {
|
|
27641
28078
|
negativePrompt: negativePrompt.trim()
|
|
@@ -27654,7 +28091,10 @@ var VideoGeneratorPanel = ({
|
|
|
27654
28091
|
(p) => setProgress(p),
|
|
27655
28092
|
controller.signal
|
|
27656
28093
|
);
|
|
27657
|
-
appRef.current.insertGeneratedVideoIntoFrame(
|
|
28094
|
+
appRef.current.insertGeneratedVideoIntoFrame(
|
|
28095
|
+
videoPresignedUrl,
|
|
28096
|
+
elementRef.current
|
|
28097
|
+
);
|
|
27658
28098
|
persistSettings({
|
|
27659
28099
|
model: selectedModel,
|
|
27660
28100
|
ratio: selectedRatio,
|
|
@@ -27671,7 +28111,9 @@ var VideoGeneratorPanel = ({
|
|
|
27671
28111
|
if (err instanceof Error && err.name === "AbortError") {
|
|
27672
28112
|
setGenStatus("idle");
|
|
27673
28113
|
} else {
|
|
27674
|
-
setGenerateError(
|
|
28114
|
+
setGenerateError(
|
|
28115
|
+
err instanceof Error ? err.message : "Generation failed"
|
|
28116
|
+
);
|
|
27675
28117
|
setGenStatus("error");
|
|
27676
28118
|
}
|
|
27677
28119
|
} finally {
|
|
@@ -27743,9 +28185,36 @@ var VideoGeneratorPanel = ({
|
|
|
27743
28185
|
const durationMax = cfgDuration.maxDuration ?? 15;
|
|
27744
28186
|
const currentDuration = selectedDuration ?? (isDurationChoices ? durationChoices[0] : durationMin);
|
|
27745
28187
|
return /* @__PURE__ */ jsxs51(Fragment15, { children: [
|
|
27746
|
-
/* @__PURE__ */ jsx94(
|
|
27747
|
-
|
|
27748
|
-
|
|
28188
|
+
/* @__PURE__ */ jsx94(
|
|
28189
|
+
"input",
|
|
28190
|
+
{
|
|
28191
|
+
ref: firstFrameInputRef,
|
|
28192
|
+
type: "file",
|
|
28193
|
+
accept: "image/*",
|
|
28194
|
+
onChange: handleFrameUpload("first"),
|
|
28195
|
+
style: { display: "none" }
|
|
28196
|
+
}
|
|
28197
|
+
),
|
|
28198
|
+
/* @__PURE__ */ jsx94(
|
|
28199
|
+
"input",
|
|
28200
|
+
{
|
|
28201
|
+
ref: lastFrameInputRef,
|
|
28202
|
+
type: "file",
|
|
28203
|
+
accept: "image/*",
|
|
28204
|
+
onChange: handleFrameUpload("last"),
|
|
28205
|
+
style: { display: "none" }
|
|
28206
|
+
}
|
|
28207
|
+
),
|
|
28208
|
+
/* @__PURE__ */ jsx94(
|
|
28209
|
+
"input",
|
|
28210
|
+
{
|
|
28211
|
+
ref: inputRefUploadRef,
|
|
28212
|
+
type: "file",
|
|
28213
|
+
accept: "image/*",
|
|
28214
|
+
onChange: handleRefUpload,
|
|
28215
|
+
style: { display: "none" }
|
|
28216
|
+
}
|
|
28217
|
+
),
|
|
27749
28218
|
isGenerating && /* @__PURE__ */ jsx94(
|
|
27750
28219
|
"div",
|
|
27751
28220
|
{
|
|
@@ -27827,22 +28296,32 @@ var VideoGeneratorPanel = ({
|
|
|
27827
28296
|
))
|
|
27828
28297
|
] }),
|
|
27829
28298
|
showRefChips && /* @__PURE__ */ jsxs51("div", { className: "vgp-chips-row", children: [
|
|
27830
|
-
inputReferences.map((ref, i) => /* @__PURE__ */ jsxs51(
|
|
27831
|
-
|
|
27832
|
-
|
|
27833
|
-
"
|
|
27834
|
-
i + 1
|
|
27835
|
-
|
|
27836
|
-
|
|
27837
|
-
|
|
27838
|
-
|
|
27839
|
-
|
|
27840
|
-
|
|
27841
|
-
|
|
27842
|
-
|
|
27843
|
-
|
|
27844
|
-
|
|
27845
|
-
|
|
28299
|
+
inputReferences.map((ref, i) => /* @__PURE__ */ jsxs51(
|
|
28300
|
+
"div",
|
|
28301
|
+
{
|
|
28302
|
+
className: "vgp-chip vgp-chip--set",
|
|
28303
|
+
title: `Reference ${i + 1}`,
|
|
28304
|
+
children: [
|
|
28305
|
+
/* @__PURE__ */ jsx94("img", { src: ref, alt: "", className: "vgp-chip-thumb" }),
|
|
28306
|
+
/* @__PURE__ */ jsxs51("span", { className: "vgp-chip-label", children: [
|
|
28307
|
+
"Ref ",
|
|
28308
|
+
i + 1
|
|
28309
|
+
] }),
|
|
28310
|
+
/* @__PURE__ */ jsx94(
|
|
28311
|
+
"button",
|
|
28312
|
+
{
|
|
28313
|
+
className: "vgp-chip-remove",
|
|
28314
|
+
onClick: () => setInputReferences(
|
|
28315
|
+
(prev) => prev.filter((_, j) => j !== i)
|
|
28316
|
+
),
|
|
28317
|
+
disabled: isGenerating,
|
|
28318
|
+
children: /* @__PURE__ */ jsx94(X2, { size: 9 })
|
|
28319
|
+
}
|
|
28320
|
+
)
|
|
28321
|
+
]
|
|
28322
|
+
},
|
|
28323
|
+
i
|
|
28324
|
+
)),
|
|
27846
28325
|
inputReferences.length < 3 && /* @__PURE__ */ jsxs51(
|
|
27847
28326
|
"button",
|
|
27848
28327
|
{
|
|
@@ -27868,7 +28347,13 @@ var VideoGeneratorPanel = ({
|
|
|
27868
28347
|
isGenerating && /* @__PURE__ */ jsxs51("div", { className: "vgp-status", children: [
|
|
27869
28348
|
/* @__PURE__ */ jsx94(SpinnerIcon3, {}),
|
|
27870
28349
|
/* @__PURE__ */ jsx94("span", { className: "vgp-status-text", children: genStatus === "submitting" ? "Submitting\u2026" : progress > 0 ? `Generating\u2026 ${Math.round(progress * 100)}%` : "Generating\u2026" }),
|
|
27871
|
-
progress > 0 && /* @__PURE__ */ jsx94("div", { className: "vgp-progress-wrap", children: /* @__PURE__ */ jsx94(
|
|
28350
|
+
progress > 0 && /* @__PURE__ */ jsx94("div", { className: "vgp-progress-wrap", children: /* @__PURE__ */ jsx94(
|
|
28351
|
+
"div",
|
|
28352
|
+
{
|
|
28353
|
+
className: "vgp-progress-bar",
|
|
28354
|
+
style: { width: `${Math.round(progress * 100)}%` }
|
|
28355
|
+
}
|
|
28356
|
+
) })
|
|
27872
28357
|
] }),
|
|
27873
28358
|
/* @__PURE__ */ jsxs51(PromptInputActions, { className: "vgp-actions", children: [
|
|
27874
28359
|
/* @__PURE__ */ jsxs51("div", { className: "vgp-actions-left", children: [
|
|
@@ -27944,10 +28429,17 @@ var VideoGeneratorPanel = ({
|
|
|
27944
28429
|
]
|
|
27945
28430
|
}
|
|
27946
28431
|
),
|
|
27947
|
-
frameTypeOpen && /* @__PURE__ */ jsx94("div", { className: "vgp-dropdown vgp-dropdown--up vgp-dropdown--left", children: /* @__PURE__ */ jsxs51(
|
|
27948
|
-
|
|
27949
|
-
|
|
27950
|
-
|
|
28432
|
+
frameTypeOpen && /* @__PURE__ */ jsx94("div", { className: "vgp-dropdown vgp-dropdown--up vgp-dropdown--left", children: /* @__PURE__ */ jsxs51(
|
|
28433
|
+
"button",
|
|
28434
|
+
{
|
|
28435
|
+
className: "vgp-dropdown-item",
|
|
28436
|
+
onClick: () => setFrameTypeOpen(false),
|
|
28437
|
+
children: [
|
|
28438
|
+
/* @__PURE__ */ jsx94("span", { style: { flex: 1 }, children: frameTypeLabel }),
|
|
28439
|
+
/* @__PURE__ */ jsx94("span", { className: "vgp-check", children: /* @__PURE__ */ jsx94(CheckIcon4, {}) })
|
|
28440
|
+
]
|
|
28441
|
+
}
|
|
28442
|
+
) })
|
|
27951
28443
|
] }),
|
|
27952
28444
|
/* @__PURE__ */ jsxs51("div", { className: "vgp-dropdown-root", ref: cameraDropdownRef, children: [
|
|
27953
28445
|
/* @__PURE__ */ jsxs51(
|
|
@@ -27976,7 +28468,13 @@ var VideoGeneratorPanel = ({
|
|
|
27976
28468
|
onClick: () => {
|
|
27977
28469
|
setCameraMovement(null);
|
|
27978
28470
|
setCameraOpen(false);
|
|
27979
|
-
persistSettings({
|
|
28471
|
+
persistSettings({
|
|
28472
|
+
model: selectedModel,
|
|
28473
|
+
ratio: selectedRatio,
|
|
28474
|
+
resolution: selectedResolution,
|
|
28475
|
+
duration: selectedDuration,
|
|
28476
|
+
cameraMovement: void 0
|
|
28477
|
+
});
|
|
27980
28478
|
},
|
|
27981
28479
|
children: [
|
|
27982
28480
|
/* @__PURE__ */ jsx94("span", { style: { flex: 1 }, children: "None" }),
|
|
@@ -27992,7 +28490,13 @@ var VideoGeneratorPanel = ({
|
|
|
27992
28490
|
onClick: () => {
|
|
27993
28491
|
setCameraMovement(label);
|
|
27994
28492
|
setCameraOpen(false);
|
|
27995
|
-
persistSettings({
|
|
28493
|
+
persistSettings({
|
|
28494
|
+
model: selectedModel,
|
|
28495
|
+
ratio: selectedRatio,
|
|
28496
|
+
resolution: selectedResolution,
|
|
28497
|
+
duration: selectedDuration,
|
|
28498
|
+
cameraMovement: label
|
|
28499
|
+
});
|
|
27996
28500
|
},
|
|
27997
28501
|
children: [
|
|
27998
28502
|
/* @__PURE__ */ jsx94("span", { style: { flex: 1 }, children: label }),
|
|
@@ -28031,7 +28535,12 @@ var VideoGeneratorPanel = ({
|
|
|
28031
28535
|
className: `vgp-pill${selectedResolution === res ? " vgp-pill--active" : ""}`,
|
|
28032
28536
|
onClick: () => {
|
|
28033
28537
|
setSelectedResolution(res);
|
|
28034
|
-
persistSettings({
|
|
28538
|
+
persistSettings({
|
|
28539
|
+
model: selectedModel,
|
|
28540
|
+
ratio: selectedRatio,
|
|
28541
|
+
resolution: res,
|
|
28542
|
+
duration: selectedDuration
|
|
28543
|
+
});
|
|
28035
28544
|
},
|
|
28036
28545
|
children: res
|
|
28037
28546
|
},
|
|
@@ -28046,7 +28555,12 @@ var VideoGeneratorPanel = ({
|
|
|
28046
28555
|
className: `vgp-pill vgp-pill--ratio${selectedRatio === r ? " vgp-pill--active" : ""}`,
|
|
28047
28556
|
onClick: () => {
|
|
28048
28557
|
setSelectedRatio(r);
|
|
28049
|
-
persistSettings({
|
|
28558
|
+
persistSettings({
|
|
28559
|
+
model: selectedModel,
|
|
28560
|
+
ratio: r,
|
|
28561
|
+
resolution: selectedResolution,
|
|
28562
|
+
duration: selectedDuration
|
|
28563
|
+
});
|
|
28050
28564
|
applyRatioResize(r);
|
|
28051
28565
|
},
|
|
28052
28566
|
children: [
|
|
@@ -28065,7 +28579,12 @@ var VideoGeneratorPanel = ({
|
|
|
28065
28579
|
className: `vgp-pill${currentDuration === v ? " vgp-pill--active" : ""}`,
|
|
28066
28580
|
onClick: () => {
|
|
28067
28581
|
setSelectedDuration(v);
|
|
28068
|
-
persistSettings({
|
|
28582
|
+
persistSettings({
|
|
28583
|
+
model: selectedModel,
|
|
28584
|
+
ratio: selectedRatio,
|
|
28585
|
+
resolution: selectedResolution,
|
|
28586
|
+
duration: v
|
|
28587
|
+
});
|
|
28069
28588
|
},
|
|
28070
28589
|
children: [
|
|
28071
28590
|
v,
|
|
@@ -28094,7 +28613,12 @@ var VideoGeneratorPanel = ({
|
|
|
28094
28613
|
onChange: (e) => {
|
|
28095
28614
|
const v = Number(e.target.value);
|
|
28096
28615
|
setSelectedDuration(v);
|
|
28097
|
-
persistSettings({
|
|
28616
|
+
persistSettings({
|
|
28617
|
+
model: selectedModel,
|
|
28618
|
+
ratio: selectedRatio,
|
|
28619
|
+
resolution: selectedResolution,
|
|
28620
|
+
duration: v
|
|
28621
|
+
});
|
|
28098
28622
|
}
|
|
28099
28623
|
}
|
|
28100
28624
|
)
|
|
@@ -28106,7 +28630,18 @@ var VideoGeneratorPanel = ({
|
|
|
28106
28630
|
{
|
|
28107
28631
|
className: "vgp-toggle-btn",
|
|
28108
28632
|
onClick: () => setGenerateAudio((v) => !v),
|
|
28109
|
-
children: /* @__PURE__ */ jsx94(
|
|
28633
|
+
children: /* @__PURE__ */ jsx94(
|
|
28634
|
+
"div",
|
|
28635
|
+
{
|
|
28636
|
+
className: `vgp-toggle-track${generateAudio ? " vgp-toggle-track--on" : ""}`,
|
|
28637
|
+
children: /* @__PURE__ */ jsx94(
|
|
28638
|
+
"div",
|
|
28639
|
+
{
|
|
28640
|
+
className: `vgp-toggle-thumb${generateAudio ? " vgp-toggle-thumb--on" : ""}`
|
|
28641
|
+
}
|
|
28642
|
+
)
|
|
28643
|
+
}
|
|
28644
|
+
)
|
|
28110
28645
|
}
|
|
28111
28646
|
)
|
|
28112
28647
|
] }),
|
|
@@ -28142,7 +28677,9 @@ var VideoGeneratorPanel = ({
|
|
|
28142
28677
|
min: 0,
|
|
28143
28678
|
onChange: (e) => {
|
|
28144
28679
|
const v = e.target.value;
|
|
28145
|
-
setSeed(
|
|
28680
|
+
setSeed(
|
|
28681
|
+
v === "" ? void 0 : Math.max(0, parseInt(v, 10))
|
|
28682
|
+
);
|
|
28146
28683
|
}
|
|
28147
28684
|
}
|
|
28148
28685
|
)
|
|
@@ -28184,7 +28721,12 @@ var VideoGeneratorPanel = ({
|
|
|
28184
28721
|
className: "vgp-dropdown-item",
|
|
28185
28722
|
onClick: () => {
|
|
28186
28723
|
setSelectedModel(m);
|
|
28187
|
-
persistSettings({
|
|
28724
|
+
persistSettings({
|
|
28725
|
+
model: m,
|
|
28726
|
+
ratio: selectedRatio,
|
|
28727
|
+
resolution: selectedResolution,
|
|
28728
|
+
duration: selectedDuration
|
|
28729
|
+
});
|
|
28188
28730
|
setModelOpen(false);
|
|
28189
28731
|
},
|
|
28190
28732
|
children: [
|
|
@@ -29467,7 +30009,7 @@ var isRenderThrottlingEnabled = (() => {
|
|
|
29467
30009
|
// wysiwyg/textWysiwyg.tsx
|
|
29468
30010
|
import {
|
|
29469
30011
|
CODES as CODES12,
|
|
29470
|
-
KEYS as
|
|
30012
|
+
KEYS as KEYS45,
|
|
29471
30013
|
CLASSES as CLASSES7,
|
|
29472
30014
|
POINTER_BUTTON,
|
|
29473
30015
|
THEME as THEME11,
|
|
@@ -29782,7 +30324,7 @@ var textWysiwyg = ({
|
|
|
29782
30324
|
app.actionManager.executeAction(actionDecreaseFontSize);
|
|
29783
30325
|
} else if (actionIncreaseFontSize.keyTest(event)) {
|
|
29784
30326
|
app.actionManager.executeAction(actionIncreaseFontSize);
|
|
29785
|
-
} else if (event.key ===
|
|
30327
|
+
} else if (event.key === KEYS45.ESCAPE) {
|
|
29786
30328
|
event.preventDefault();
|
|
29787
30329
|
submittedViaKeyboard = true;
|
|
29788
30330
|
handleSubmit();
|
|
@@ -29790,14 +30332,14 @@ var textWysiwyg = ({
|
|
|
29790
30332
|
event.preventDefault();
|
|
29791
30333
|
handleSubmit();
|
|
29792
30334
|
app.actionManager.executeAction(actionSaveToActiveFile);
|
|
29793
|
-
} else if (event.key ===
|
|
30335
|
+
} else if (event.key === KEYS45.ENTER && event[KEYS45.CTRL_OR_CMD]) {
|
|
29794
30336
|
event.preventDefault();
|
|
29795
30337
|
if (event.isComposing || event.keyCode === 229) {
|
|
29796
30338
|
return;
|
|
29797
30339
|
}
|
|
29798
30340
|
submittedViaKeyboard = true;
|
|
29799
30341
|
handleSubmit();
|
|
29800
|
-
} else if (event.key ===
|
|
30342
|
+
} else if (event.key === KEYS45.TAB || event[KEYS45.CTRL_OR_CMD] && (event.code === CODES12.BRACKET_LEFT || event.code === CODES12.BRACKET_RIGHT)) {
|
|
29801
30343
|
event.preventDefault();
|
|
29802
30344
|
if (event.isComposing) {
|
|
29803
30345
|
return;
|
|
@@ -30639,7 +31181,7 @@ import React43 from "react";
|
|
|
30639
31181
|
// components/Popover.tsx
|
|
30640
31182
|
import { useLayoutEffect as useLayoutEffect5, useRef as useRef31, useEffect as useEffect38 } from "react";
|
|
30641
31183
|
import { unstable_batchedUpdates as unstable_batchedUpdates2 } from "react-dom";
|
|
30642
|
-
import { KEYS as
|
|
31184
|
+
import { KEYS as KEYS46, queryFocusableElements as queryFocusableElements2 } from "@orangecatai/common";
|
|
30643
31185
|
import clsx38 from "clsx";
|
|
30644
31186
|
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
30645
31187
|
var Popover8 = ({
|
|
@@ -30664,7 +31206,7 @@ var Popover8 = ({
|
|
|
30664
31206
|
container.focus();
|
|
30665
31207
|
}
|
|
30666
31208
|
const handleKeyDown = (event) => {
|
|
30667
|
-
if (event.key ===
|
|
31209
|
+
if (event.key === KEYS46.TAB) {
|
|
30668
31210
|
const focusableElements = queryFocusableElements2(container);
|
|
30669
31211
|
const { activeElement } = document;
|
|
30670
31212
|
const currentIndex = focusableElements.findIndex(
|
|
@@ -30965,11 +31507,11 @@ var LockButton = (props) => {
|
|
|
30965
31507
|
// components/MobileToolBar.tsx
|
|
30966
31508
|
import { useState as useState37, useEffect as useEffect40 } from "react";
|
|
30967
31509
|
import clsx43 from "clsx";
|
|
30968
|
-
import { KEYS as
|
|
31510
|
+
import { KEYS as KEYS48, capitalizeString as capitalizeString4 } from "@orangecatai/common";
|
|
30969
31511
|
|
|
30970
31512
|
// components/HandButton.tsx
|
|
30971
31513
|
import clsx42 from "clsx";
|
|
30972
|
-
import { KEYS as
|
|
31514
|
+
import { KEYS as KEYS47 } from "@orangecatai/common";
|
|
30973
31515
|
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
30974
31516
|
var HandButton = (props) => {
|
|
30975
31517
|
return /* @__PURE__ */ jsx103(
|
|
@@ -30981,9 +31523,9 @@ var HandButton = (props) => {
|
|
|
30981
31523
|
name: "editor-current-shape",
|
|
30982
31524
|
checked: props.checked,
|
|
30983
31525
|
title: `${props.title} \u2014 H`,
|
|
30984
|
-
keyBindingLabel: !props.isMobile ?
|
|
31526
|
+
keyBindingLabel: !props.isMobile ? KEYS47.H.toLocaleUpperCase() : void 0,
|
|
30985
31527
|
"aria-label": `${props.title} \u2014 H`,
|
|
30986
|
-
"aria-keyshortcuts":
|
|
31528
|
+
"aria-keyshortcuts": KEYS47.H,
|
|
30987
31529
|
"data-testid": `toolbar-hand`,
|
|
30988
31530
|
onChange: () => props.onChange?.()
|
|
30989
31531
|
}
|
|
@@ -31301,7 +31843,7 @@ var MobileToolBar = ({
|
|
|
31301
31843
|
{
|
|
31302
31844
|
onSelect: () => app.setActiveTool({ type: "text" }),
|
|
31303
31845
|
icon: TextIcon,
|
|
31304
|
-
shortcut:
|
|
31846
|
+
shortcut: KEYS48.T.toLocaleUpperCase(),
|
|
31305
31847
|
"data-testid": "toolbar-text",
|
|
31306
31848
|
selected: activeTool.type === "text",
|
|
31307
31849
|
children: t("toolBar.text")
|
|
@@ -31322,7 +31864,7 @@ var MobileToolBar = ({
|
|
|
31322
31864
|
{
|
|
31323
31865
|
onSelect: () => app.setActiveTool({ type: "frame" }),
|
|
31324
31866
|
icon: frameToolIcon,
|
|
31325
|
-
shortcut:
|
|
31867
|
+
shortcut: KEYS48.F.toLocaleUpperCase(),
|
|
31326
31868
|
"data-testid": "toolbar-frame",
|
|
31327
31869
|
selected: frameToolSelected,
|
|
31328
31870
|
children: t("toolBar.frame")
|
|
@@ -31345,7 +31887,7 @@ var MobileToolBar = ({
|
|
|
31345
31887
|
icon: laserPointerToolIcon,
|
|
31346
31888
|
"data-testid": "toolbar-laser",
|
|
31347
31889
|
selected: laserToolSelected,
|
|
31348
|
-
shortcut:
|
|
31890
|
+
shortcut: KEYS48.K.toLocaleUpperCase(),
|
|
31349
31891
|
children: t("toolBar.laser")
|
|
31350
31892
|
}
|
|
31351
31893
|
),
|
|
@@ -32547,7 +33089,7 @@ import {
|
|
|
32547
33089
|
CLASSES as CLASSES8,
|
|
32548
33090
|
EVENT as EVENT10,
|
|
32549
33091
|
isDevEnv as isDevEnv7,
|
|
32550
|
-
KEYS as
|
|
33092
|
+
KEYS as KEYS49,
|
|
32551
33093
|
updateObject
|
|
32552
33094
|
} from "@orangecatai/common";
|
|
32553
33095
|
|
|
@@ -32787,7 +33329,7 @@ var SidebarInner = forwardRef6(
|
|
|
32787
33329
|
);
|
|
32788
33330
|
useEffect43(() => {
|
|
32789
33331
|
const handleKeyDown = (event) => {
|
|
32790
|
-
if (event.key ===
|
|
33332
|
+
if (event.key === KEYS49.ESCAPE && (!docked || !editorInterface.canFitSidebar)) {
|
|
32791
33333
|
closeLibrary();
|
|
32792
33334
|
}
|
|
32793
33335
|
};
|
|
@@ -33748,7 +34290,7 @@ import {
|
|
|
33748
34290
|
import { isElementCompletelyInViewport } from "@orangecatai/element";
|
|
33749
34291
|
import { measureText as measureText5 } from "@orangecatai/element";
|
|
33750
34292
|
import {
|
|
33751
|
-
KEYS as
|
|
34293
|
+
KEYS as KEYS50,
|
|
33752
34294
|
randomInteger as randomInteger3,
|
|
33753
34295
|
addEventListener as addEventListener2,
|
|
33754
34296
|
getFontString as getFontString8
|
|
@@ -33921,7 +34463,7 @@ var SearchMenu2 = () => {
|
|
|
33921
34463
|
});
|
|
33922
34464
|
useEffect44(() => {
|
|
33923
34465
|
const eventHandler = (event) => {
|
|
33924
|
-
if (event.key ===
|
|
34466
|
+
if (event.key === KEYS50.ESCAPE && !app.state.openDialog && !app.state.openPopup) {
|
|
33925
34467
|
event.preventDefault();
|
|
33926
34468
|
event.stopPropagation();
|
|
33927
34469
|
setAppState({
|
|
@@ -33929,7 +34471,7 @@ var SearchMenu2 = () => {
|
|
|
33929
34471
|
});
|
|
33930
34472
|
return;
|
|
33931
34473
|
}
|
|
33932
|
-
if (event[
|
|
34474
|
+
if (event[KEYS50.CTRL_OR_CMD] && event.key === KEYS50.F) {
|
|
33933
34475
|
event.preventDefault();
|
|
33934
34476
|
event.stopPropagation();
|
|
33935
34477
|
if (app.state.openDialog) {
|
|
@@ -33947,14 +34489,14 @@ var SearchMenu2 = () => {
|
|
|
33947
34489
|
}
|
|
33948
34490
|
if (event.target instanceof HTMLElement && event.target.closest(".layer-ui__search")) {
|
|
33949
34491
|
if (stableState.searchMatches.items.length) {
|
|
33950
|
-
if (event.key ===
|
|
34492
|
+
if (event.key === KEYS50.ENTER) {
|
|
33951
34493
|
event.stopPropagation();
|
|
33952
34494
|
stableState.goToNextItem();
|
|
33953
34495
|
}
|
|
33954
|
-
if (event.key ===
|
|
34496
|
+
if (event.key === KEYS50.ARROW_UP) {
|
|
33955
34497
|
event.stopPropagation();
|
|
33956
34498
|
stableState.goToPreviousItem();
|
|
33957
|
-
} else if (event.key ===
|
|
34499
|
+
} else if (event.key === KEYS50.ARROW_DOWN) {
|
|
33958
34500
|
event.stopPropagation();
|
|
33959
34501
|
stableState.goToNextItem();
|
|
33960
34502
|
}
|
|
@@ -34431,7 +34973,7 @@ import { EDITOR_LS_KEYS as EDITOR_LS_KEYS3, debounce as debounce3, isDevEnv as i
|
|
|
34431
34973
|
|
|
34432
34974
|
// components/TTDDialog/TTDDialogInput.tsx
|
|
34433
34975
|
import { useEffect as useEffect45, useRef as useRef38 } from "react";
|
|
34434
|
-
import { EVENT as EVENT12, KEYS as
|
|
34976
|
+
import { EVENT as EVENT12, KEYS as KEYS51 } from "@orangecatai/common";
|
|
34435
34977
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
34436
34978
|
var TTDDialogInput = ({
|
|
34437
34979
|
input,
|
|
@@ -34449,7 +34991,7 @@ var TTDDialogInput = ({
|
|
|
34449
34991
|
const textarea = ref.current;
|
|
34450
34992
|
if (textarea) {
|
|
34451
34993
|
const handleKeyDown = (event) => {
|
|
34452
|
-
if (event[
|
|
34994
|
+
if (event[KEYS51.CTRL_OR_CMD] && event.key === KEYS51.ENTER) {
|
|
34453
34995
|
event.preventDefault();
|
|
34454
34996
|
callbackRef.current?.();
|
|
34455
34997
|
}
|
|
@@ -34840,7 +35382,7 @@ import { useRef as useRef44 } from "react";
|
|
|
34840
35382
|
|
|
34841
35383
|
// components/TTDDialog/Chat/ChatInterface.tsx
|
|
34842
35384
|
import { useRef as useRef40, useEffect as useEffect48, useLayoutEffect as useLayoutEffect10 } from "react";
|
|
34843
|
-
import { KEYS as
|
|
35385
|
+
import { KEYS as KEYS52 } from "@orangecatai/common";
|
|
34844
35386
|
|
|
34845
35387
|
// components/TTDDialog/TTDWelcomeMessage.tsx
|
|
34846
35388
|
import { jsx as jsx138, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
@@ -35053,7 +35595,7 @@ var ChatInterface = ({
|
|
|
35053
35595
|
onPromptChange("");
|
|
35054
35596
|
};
|
|
35055
35597
|
const handleKeyDown = (event) => {
|
|
35056
|
-
if (event.key ===
|
|
35598
|
+
if (event.key === KEYS52.ENTER && !event.shiftKey) {
|
|
35057
35599
|
event.preventDefault();
|
|
35058
35600
|
if (!isGenerating) {
|
|
35059
35601
|
handleSubmit();
|
|
@@ -36403,9 +36945,9 @@ import { updateBindings as updateBindings3 } from "@orangecatai/element";
|
|
|
36403
36945
|
// components/Stats/DragInput.tsx
|
|
36404
36946
|
import clsx60 from "clsx";
|
|
36405
36947
|
import { useEffect as useEffect52, useRef as useRef46, useState as useState48 } from "react";
|
|
36406
|
-
import { EVENT as EVENT13, KEYS as
|
|
36948
|
+
import { EVENT as EVENT13, KEYS as KEYS53, cloneJSON as cloneJSON3 } from "@orangecatai/common";
|
|
36407
36949
|
import { deepCopyElement as deepCopyElement4 } from "@orangecatai/element";
|
|
36408
|
-
import { CaptureUpdateAction as
|
|
36950
|
+
import { CaptureUpdateAction as CaptureUpdateAction39 } from "@orangecatai/element";
|
|
36409
36951
|
|
|
36410
36952
|
// components/Stats/utils.ts
|
|
36411
36953
|
import { pointFrom as pointFrom23, pointRotateRads as pointRotateRads16 } from "@orangecatai/math";
|
|
@@ -36615,7 +37157,7 @@ var StatsDragInput = ({
|
|
|
36615
37157
|
setAppState
|
|
36616
37158
|
});
|
|
36617
37159
|
app.syncActionResult({
|
|
36618
|
-
captureUpdate:
|
|
37160
|
+
captureUpdate: CaptureUpdateAction39.IMMEDIATELY
|
|
36619
37161
|
});
|
|
36620
37162
|
}
|
|
36621
37163
|
};
|
|
@@ -36723,7 +37265,7 @@ var StatsDragInput = ({
|
|
|
36723
37265
|
false
|
|
36724
37266
|
);
|
|
36725
37267
|
app.syncActionResult({
|
|
36726
|
-
captureUpdate:
|
|
37268
|
+
captureUpdate: CaptureUpdateAction39.IMMEDIATELY
|
|
36727
37269
|
});
|
|
36728
37270
|
dragFinishedCallback?.({
|
|
36729
37271
|
app,
|
|
@@ -36762,7 +37304,7 @@ var StatsDragInput = ({
|
|
|
36762
37304
|
onKeyDown: (event) => {
|
|
36763
37305
|
if (editable) {
|
|
36764
37306
|
const eventTarget = event.target;
|
|
36765
|
-
if (eventTarget instanceof HTMLInputElement && event.key ===
|
|
37307
|
+
if (eventTarget instanceof HTMLInputElement && event.key === KEYS53.ENTER) {
|
|
36766
37308
|
handleInputValue(eventTarget.value, elements, appState);
|
|
36767
37309
|
app.focusContainer();
|
|
36768
37310
|
}
|
|
@@ -38493,7 +39035,7 @@ var StatsInner = memo5(
|
|
|
38493
39035
|
|
|
38494
39036
|
// components/ElementLinkDialog.tsx
|
|
38495
39037
|
import { useCallback as useCallback26, useEffect as useEffect54, useState as useState50 } from "react";
|
|
38496
|
-
import { normalizeLink as normalizeLink2, KEYS as
|
|
39038
|
+
import { normalizeLink as normalizeLink2, KEYS as KEYS54 } from "@orangecatai/common";
|
|
38497
39039
|
import {
|
|
38498
39040
|
defaultGetElementLinkFromSelection as defaultGetElementLinkFromSelection2,
|
|
38499
39041
|
getLinkIdAndTypeFromSelection as getLinkIdAndTypeFromSelection2
|
|
@@ -38549,10 +39091,10 @@ var ElementLinkDialog = ({
|
|
|
38549
39091
|
}, [sourceElementId, nextLink, elementsMap, linkEdited, scene, onClose]);
|
|
38550
39092
|
useEffect54(() => {
|
|
38551
39093
|
const handleKeyDown = (event) => {
|
|
38552
|
-
if (appState.openDialog?.name === "elementLinkSelector" && event.key ===
|
|
39094
|
+
if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS54.ENTER) {
|
|
38553
39095
|
handleConfirm();
|
|
38554
39096
|
}
|
|
38555
|
-
if (appState.openDialog?.name === "elementLinkSelector" && event.key ===
|
|
39097
|
+
if (appState.openDialog?.name === "elementLinkSelector" && event.key === KEYS54.ESCAPE) {
|
|
38556
39098
|
onClose?.();
|
|
38557
39099
|
}
|
|
38558
39100
|
};
|
|
@@ -38578,7 +39120,7 @@ var ElementLinkDialog = ({
|
|
|
38578
39120
|
setNextLink(value);
|
|
38579
39121
|
},
|
|
38580
39122
|
onKeyDown: (event) => {
|
|
38581
|
-
if (event.key ===
|
|
39123
|
+
if (event.key === KEYS54.ENTER) {
|
|
38582
39124
|
handleConfirm();
|
|
38583
39125
|
}
|
|
38584
39126
|
},
|
|
@@ -38658,7 +39200,7 @@ var ErrorDialog = ({
|
|
|
38658
39200
|
// components/HelpDialog.tsx
|
|
38659
39201
|
import React54 from "react";
|
|
38660
39202
|
import { isDarwin as isDarwin4, isFirefox as isFirefox3, isWindows as isWindows2 } from "@orangecatai/common";
|
|
38661
|
-
import { KEYS as
|
|
39203
|
+
import { KEYS as KEYS55 } from "@orangecatai/common";
|
|
38662
39204
|
import { Fragment as Fragment32, jsx as jsx163, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
38663
39205
|
var Header = () => /* @__PURE__ */ jsxs93("div", { className: "HelpDialog__header", children: [
|
|
38664
39206
|
/* @__PURE__ */ jsxs93(
|
|
@@ -38771,78 +39313,78 @@ var HelpDialog = ({ onClose }) => {
|
|
|
38771
39313
|
className: "HelpDialog__island--tools",
|
|
38772
39314
|
caption: t("helpDialog.tools"),
|
|
38773
39315
|
children: [
|
|
38774
|
-
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.hand"), shortcuts: [
|
|
39316
|
+
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.hand"), shortcuts: [KEYS55.H] }),
|
|
38775
39317
|
/* @__PURE__ */ jsx163(
|
|
38776
39318
|
Shortcut,
|
|
38777
39319
|
{
|
|
38778
39320
|
label: t("toolBar.selection"),
|
|
38779
|
-
shortcuts: [
|
|
39321
|
+
shortcuts: [KEYS55.V, KEYS55["1"]]
|
|
38780
39322
|
}
|
|
38781
39323
|
),
|
|
38782
39324
|
/* @__PURE__ */ jsx163(
|
|
38783
39325
|
Shortcut,
|
|
38784
39326
|
{
|
|
38785
39327
|
label: t("toolBar.rectangle"),
|
|
38786
|
-
shortcuts: [
|
|
39328
|
+
shortcuts: [KEYS55.R, KEYS55["2"]]
|
|
38787
39329
|
}
|
|
38788
39330
|
),
|
|
38789
39331
|
/* @__PURE__ */ jsx163(
|
|
38790
39332
|
Shortcut,
|
|
38791
39333
|
{
|
|
38792
39334
|
label: t("toolBar.diamond"),
|
|
38793
|
-
shortcuts: [
|
|
39335
|
+
shortcuts: [KEYS55.D, KEYS55["3"]]
|
|
38794
39336
|
}
|
|
38795
39337
|
),
|
|
38796
39338
|
/* @__PURE__ */ jsx163(
|
|
38797
39339
|
Shortcut,
|
|
38798
39340
|
{
|
|
38799
39341
|
label: t("toolBar.ellipse"),
|
|
38800
|
-
shortcuts: [
|
|
39342
|
+
shortcuts: [KEYS55.O, KEYS55["4"]]
|
|
38801
39343
|
}
|
|
38802
39344
|
),
|
|
38803
39345
|
/* @__PURE__ */ jsx163(
|
|
38804
39346
|
Shortcut,
|
|
38805
39347
|
{
|
|
38806
39348
|
label: t("toolBar.arrow"),
|
|
38807
|
-
shortcuts: [
|
|
39349
|
+
shortcuts: [KEYS55.A, KEYS55["5"]]
|
|
38808
39350
|
}
|
|
38809
39351
|
),
|
|
38810
39352
|
/* @__PURE__ */ jsx163(
|
|
38811
39353
|
Shortcut,
|
|
38812
39354
|
{
|
|
38813
39355
|
label: t("toolBar.line"),
|
|
38814
|
-
shortcuts: [
|
|
39356
|
+
shortcuts: [KEYS55.L, KEYS55["6"]]
|
|
38815
39357
|
}
|
|
38816
39358
|
),
|
|
38817
39359
|
/* @__PURE__ */ jsx163(
|
|
38818
39360
|
Shortcut,
|
|
38819
39361
|
{
|
|
38820
39362
|
label: t("toolBar.freedraw"),
|
|
38821
|
-
shortcuts: [
|
|
39363
|
+
shortcuts: [KEYS55.P, KEYS55["7"]]
|
|
38822
39364
|
}
|
|
38823
39365
|
),
|
|
38824
39366
|
/* @__PURE__ */ jsx163(
|
|
38825
39367
|
Shortcut,
|
|
38826
39368
|
{
|
|
38827
39369
|
label: t("toolBar.text"),
|
|
38828
|
-
shortcuts: [
|
|
39370
|
+
shortcuts: [KEYS55.T, KEYS55["8"]]
|
|
38829
39371
|
}
|
|
38830
39372
|
),
|
|
38831
|
-
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.image"), shortcuts: [
|
|
39373
|
+
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.image"), shortcuts: [KEYS55["9"]] }),
|
|
38832
39374
|
/* @__PURE__ */ jsx163(
|
|
38833
39375
|
Shortcut,
|
|
38834
39376
|
{
|
|
38835
39377
|
label: t("toolBar.eraser"),
|
|
38836
|
-
shortcuts: [
|
|
39378
|
+
shortcuts: [KEYS55.E, KEYS55["0"]]
|
|
38837
39379
|
}
|
|
38838
39380
|
),
|
|
38839
|
-
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.frame"), shortcuts: [
|
|
38840
|
-
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.laser"), shortcuts: [
|
|
39381
|
+
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.frame"), shortcuts: [KEYS55.F] }),
|
|
39382
|
+
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.laser"), shortcuts: [KEYS55.K] }),
|
|
38841
39383
|
/* @__PURE__ */ jsx163(
|
|
38842
39384
|
Shortcut,
|
|
38843
39385
|
{
|
|
38844
39386
|
label: t("labels.eyeDropper"),
|
|
38845
|
-
shortcuts: [
|
|
39387
|
+
shortcuts: [KEYS55.I, "Shift+S", "Shift+G"]
|
|
38846
39388
|
}
|
|
38847
39389
|
),
|
|
38848
39390
|
/* @__PURE__ */ jsx163(
|
|
@@ -38921,7 +39463,7 @@ var HelpDialog = ({ onClose }) => {
|
|
|
38921
39463
|
isOr: true
|
|
38922
39464
|
}
|
|
38923
39465
|
),
|
|
38924
|
-
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.lock"), shortcuts: [
|
|
39466
|
+
/* @__PURE__ */ jsx163(Shortcut, { label: t("toolBar.lock"), shortcuts: [KEYS55.Q] }),
|
|
38925
39467
|
/* @__PURE__ */ jsx163(
|
|
38926
39468
|
Shortcut,
|
|
38927
39469
|
{
|
|
@@ -40662,40 +41204,108 @@ var PauseIcon = () => /* @__PURE__ */ jsxs99("svg", { width: "15", height: "15",
|
|
|
40662
41204
|
] });
|
|
40663
41205
|
var VolumeIcon = ({ level }) => {
|
|
40664
41206
|
if (level === 0) {
|
|
40665
|
-
return /* @__PURE__ */ jsxs99(
|
|
40666
|
-
|
|
40667
|
-
|
|
40668
|
-
|
|
40669
|
-
|
|
41207
|
+
return /* @__PURE__ */ jsxs99(
|
|
41208
|
+
"svg",
|
|
41209
|
+
{
|
|
41210
|
+
width: "15",
|
|
41211
|
+
height: "15",
|
|
41212
|
+
viewBox: "0 0 24 24",
|
|
41213
|
+
fill: "none",
|
|
41214
|
+
stroke: "currentColor",
|
|
41215
|
+
strokeWidth: "2",
|
|
41216
|
+
strokeLinecap: "round",
|
|
41217
|
+
strokeLinejoin: "round",
|
|
41218
|
+
children: [
|
|
41219
|
+
/* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
41220
|
+
/* @__PURE__ */ jsx172("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
|
|
41221
|
+
/* @__PURE__ */ jsx172("line", { x1: "17", y1: "9", x2: "23", y2: "15" })
|
|
41222
|
+
]
|
|
41223
|
+
}
|
|
41224
|
+
);
|
|
40670
41225
|
}
|
|
40671
41226
|
if (level < 0.5) {
|
|
40672
|
-
return /* @__PURE__ */ jsxs99(
|
|
40673
|
-
|
|
40674
|
-
|
|
40675
|
-
|
|
41227
|
+
return /* @__PURE__ */ jsxs99(
|
|
41228
|
+
"svg",
|
|
41229
|
+
{
|
|
41230
|
+
width: "15",
|
|
41231
|
+
height: "15",
|
|
41232
|
+
viewBox: "0 0 24 24",
|
|
41233
|
+
fill: "none",
|
|
41234
|
+
stroke: "currentColor",
|
|
41235
|
+
strokeWidth: "2",
|
|
41236
|
+
strokeLinecap: "round",
|
|
41237
|
+
strokeLinejoin: "round",
|
|
41238
|
+
children: [
|
|
41239
|
+
/* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
41240
|
+
/* @__PURE__ */ jsx172("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
41241
|
+
]
|
|
41242
|
+
}
|
|
41243
|
+
);
|
|
40676
41244
|
}
|
|
40677
|
-
return /* @__PURE__ */ jsxs99(
|
|
40678
|
-
|
|
40679
|
-
|
|
40680
|
-
|
|
40681
|
-
|
|
41245
|
+
return /* @__PURE__ */ jsxs99(
|
|
41246
|
+
"svg",
|
|
41247
|
+
{
|
|
41248
|
+
width: "15",
|
|
41249
|
+
height: "15",
|
|
41250
|
+
viewBox: "0 0 24 24",
|
|
41251
|
+
fill: "none",
|
|
41252
|
+
stroke: "currentColor",
|
|
41253
|
+
strokeWidth: "2",
|
|
41254
|
+
strokeLinecap: "round",
|
|
41255
|
+
strokeLinejoin: "round",
|
|
41256
|
+
children: [
|
|
41257
|
+
/* @__PURE__ */ jsx172("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
41258
|
+
/* @__PURE__ */ jsx172("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
41259
|
+
/* @__PURE__ */ jsx172("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
41260
|
+
]
|
|
41261
|
+
}
|
|
41262
|
+
);
|
|
40682
41263
|
};
|
|
40683
|
-
var DownloadIcon3 = () => /* @__PURE__ */ jsxs99(
|
|
40684
|
-
|
|
40685
|
-
|
|
40686
|
-
|
|
40687
|
-
|
|
40688
|
-
|
|
40689
|
-
|
|
40690
|
-
|
|
40691
|
-
|
|
40692
|
-
|
|
40693
|
-
|
|
40694
|
-
|
|
40695
|
-
|
|
40696
|
-
|
|
40697
|
-
|
|
40698
|
-
|
|
41264
|
+
var DownloadIcon3 = () => /* @__PURE__ */ jsxs99(
|
|
41265
|
+
"svg",
|
|
41266
|
+
{
|
|
41267
|
+
width: "14",
|
|
41268
|
+
height: "14",
|
|
41269
|
+
viewBox: "0 0 24 24",
|
|
41270
|
+
fill: "none",
|
|
41271
|
+
stroke: "currentColor",
|
|
41272
|
+
strokeWidth: "2",
|
|
41273
|
+
strokeLinecap: "round",
|
|
41274
|
+
strokeLinejoin: "round",
|
|
41275
|
+
children: [
|
|
41276
|
+
/* @__PURE__ */ jsx172("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
41277
|
+
/* @__PURE__ */ jsx172("polyline", { points: "7 10 12 15 17 10" }),
|
|
41278
|
+
/* @__PURE__ */ jsx172("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
41279
|
+
]
|
|
41280
|
+
}
|
|
41281
|
+
);
|
|
41282
|
+
var VideoFilmIcon = () => /* @__PURE__ */ jsxs99(
|
|
41283
|
+
"svg",
|
|
41284
|
+
{
|
|
41285
|
+
width: "32",
|
|
41286
|
+
height: "32",
|
|
41287
|
+
viewBox: "0 0 24 24",
|
|
41288
|
+
fill: "none",
|
|
41289
|
+
stroke: "currentColor",
|
|
41290
|
+
strokeWidth: "1.5",
|
|
41291
|
+
strokeLinecap: "round",
|
|
41292
|
+
strokeLinejoin: "round",
|
|
41293
|
+
children: [
|
|
41294
|
+
/* @__PURE__ */ jsx172("rect", { x: "2", y: "2", width: "20", height: "20", rx: "2" }),
|
|
41295
|
+
/* @__PURE__ */ jsx172("line", { x1: "7", y1: "2", x2: "7", y2: "22" }),
|
|
41296
|
+
/* @__PURE__ */ jsx172("line", { x1: "17", y1: "2", x2: "17", y2: "22" }),
|
|
41297
|
+
/* @__PURE__ */ jsx172("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
|
|
41298
|
+
/* @__PURE__ */ jsx172("line", { x1: "2", y1: "7", x2: "7", y2: "7" }),
|
|
41299
|
+
/* @__PURE__ */ jsx172("line", { x1: "2", y1: "17", x2: "7", y2: "17" }),
|
|
41300
|
+
/* @__PURE__ */ jsx172("line", { x1: "17", y1: "17", x2: "22", y2: "17" }),
|
|
41301
|
+
/* @__PURE__ */ jsx172("line", { x1: "17", y1: "7", x2: "22", y2: "7" })
|
|
41302
|
+
]
|
|
41303
|
+
}
|
|
41304
|
+
);
|
|
41305
|
+
var VideoElement = ({
|
|
41306
|
+
element,
|
|
41307
|
+
videoDownloadProxyUrl
|
|
41308
|
+
}) => {
|
|
40699
41309
|
const {
|
|
40700
41310
|
status,
|
|
40701
41311
|
videoUrl,
|
|
@@ -40723,8 +41333,9 @@ var VideoElement = ({ element, videoDownloadProxyUrl }) => {
|
|
|
40723
41333
|
}
|
|
40724
41334
|
if (v.paused) {
|
|
40725
41335
|
v.play().catch((err) => {
|
|
40726
|
-
if (err.name !== "AbortError")
|
|
41336
|
+
if (err.name !== "AbortError") {
|
|
40727
41337
|
throw err;
|
|
41338
|
+
}
|
|
40728
41339
|
});
|
|
40729
41340
|
setPaused(false);
|
|
40730
41341
|
} else {
|
|
@@ -40760,11 +41371,14 @@ var VideoElement = ({ element, videoDownloadProxyUrl }) => {
|
|
|
40760
41371
|
const handleDownload = useCallback28(
|
|
40761
41372
|
(e) => {
|
|
40762
41373
|
e.stopPropagation();
|
|
40763
|
-
if (!videoUrl)
|
|
41374
|
+
if (!videoUrl) {
|
|
40764
41375
|
return;
|
|
41376
|
+
}
|
|
40765
41377
|
const filename = `video.${element.mimeType === "video/quicktime" ? "mov" : "mp4"}`;
|
|
40766
41378
|
if (videoDownloadProxyUrl && !isBlobUrl) {
|
|
40767
|
-
const proxyHref = `${videoDownloadProxyUrl}?url=${encodeURIComponent(
|
|
41379
|
+
const proxyHref = `${videoDownloadProxyUrl}?url=${encodeURIComponent(
|
|
41380
|
+
videoUrl
|
|
41381
|
+
)}&download=1`;
|
|
40768
41382
|
const a = document.createElement("a");
|
|
40769
41383
|
a.href = proxyHref;
|
|
40770
41384
|
a.download = filename;
|
|
@@ -40780,7 +41394,23 @@ var VideoElement = ({ element, videoDownloadProxyUrl }) => {
|
|
|
40780
41394
|
);
|
|
40781
41395
|
const stopProp = (e) => e.stopPropagation();
|
|
40782
41396
|
const totalDur = videoDuration || duration || 0;
|
|
40783
|
-
const toolbar = /* @__PURE__ */ jsx172(
|
|
41397
|
+
const toolbar = /* @__PURE__ */ jsx172(
|
|
41398
|
+
"div",
|
|
41399
|
+
{
|
|
41400
|
+
className: "video-el__toolbar",
|
|
41401
|
+
onClick: stopProp,
|
|
41402
|
+
onPointerDown: stopProp,
|
|
41403
|
+
children: /* @__PURE__ */ jsx172(
|
|
41404
|
+
"button",
|
|
41405
|
+
{
|
|
41406
|
+
className: "video-el__tool-btn",
|
|
41407
|
+
onClick: handleDownload,
|
|
41408
|
+
title: "Download",
|
|
41409
|
+
children: /* @__PURE__ */ jsx172(DownloadIcon3, {})
|
|
41410
|
+
}
|
|
41411
|
+
)
|
|
41412
|
+
}
|
|
41413
|
+
);
|
|
40784
41414
|
if (status === "uploading" && !videoUrl) {
|
|
40785
41415
|
return /* @__PURE__ */ jsxs99("div", { className: "video-el__uploading", children: [
|
|
40786
41416
|
/* @__PURE__ */ jsx172("div", { className: "video-el__spinner" }),
|
|
@@ -40835,10 +41465,17 @@ var VideoElement = ({ element, videoDownloadProxyUrl }) => {
|
|
|
40835
41465
|
onClick: stopProp,
|
|
40836
41466
|
onPointerDown: stopProp,
|
|
40837
41467
|
children: [
|
|
40838
|
-
/* @__PURE__ */ jsx172(
|
|
40839
|
-
|
|
40840
|
-
|
|
40841
|
-
|
|
41468
|
+
/* @__PURE__ */ jsx172(
|
|
41469
|
+
"button",
|
|
41470
|
+
{
|
|
41471
|
+
className: "video-el__ctrl-btn",
|
|
41472
|
+
onClick: (e) => {
|
|
41473
|
+
e.stopPropagation();
|
|
41474
|
+
togglePlayPause();
|
|
41475
|
+
},
|
|
41476
|
+
children: paused ? /* @__PURE__ */ jsx172(PlayIcon, {}) : /* @__PURE__ */ jsx172(PauseIcon, {})
|
|
41477
|
+
}
|
|
41478
|
+
),
|
|
40842
41479
|
/* @__PURE__ */ jsx172(
|
|
40843
41480
|
"input",
|
|
40844
41481
|
{
|
|
@@ -43447,7 +44084,7 @@ var App = class _App extends React61.Component {
|
|
|
43447
44084
|
onFocus: (e) => e.target.select(),
|
|
43448
44085
|
onBlur: () => this.resetEditingFrame(f),
|
|
43449
44086
|
onKeyDown: (event) => {
|
|
43450
|
-
if (event.key ===
|
|
44087
|
+
if (event.key === KEYS56.ESCAPE || event.key === KEYS56.ENTER) {
|
|
43451
44088
|
this.resetEditingFrame(f);
|
|
43452
44089
|
}
|
|
43453
44090
|
},
|
|
@@ -43757,7 +44394,7 @@ var App = class _App extends React61.Component {
|
|
|
43757
44394
|
this.scene.insertElement(videoEl);
|
|
43758
44395
|
this.scene.mutateElement(videoEl, { frameId: frameElement.id });
|
|
43759
44396
|
}
|
|
43760
|
-
this.syncActionResult({ captureUpdate:
|
|
44397
|
+
this.syncActionResult({ captureUpdate: CaptureUpdateAction40.IMMEDIATELY });
|
|
43761
44398
|
});
|
|
43762
44399
|
/**
|
|
43763
44400
|
* Inserts a generated image near a source element (≥ 25 px clearance).
|
|
@@ -43825,12 +44462,12 @@ var App = class _App extends React61.Component {
|
|
|
43825
44462
|
if (shouldUpdateStrokeColor) {
|
|
43826
44463
|
this.syncActionResult({
|
|
43827
44464
|
appState: { ...this.state, currentItemStrokeColor: color },
|
|
43828
|
-
captureUpdate:
|
|
44465
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
43829
44466
|
});
|
|
43830
44467
|
} else {
|
|
43831
44468
|
this.syncActionResult({
|
|
43832
44469
|
appState: { ...this.state, currentItemBackgroundColor: color },
|
|
43833
|
-
captureUpdate:
|
|
44470
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
43834
44471
|
});
|
|
43835
44472
|
}
|
|
43836
44473
|
} else {
|
|
@@ -43843,7 +44480,7 @@ var App = class _App extends React61.Component {
|
|
|
43843
44480
|
}
|
|
43844
44481
|
return el;
|
|
43845
44482
|
}),
|
|
43846
|
-
captureUpdate:
|
|
44483
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
43847
44484
|
});
|
|
43848
44485
|
}
|
|
43849
44486
|
},
|
|
@@ -44046,7 +44683,7 @@ var App = class _App extends React61.Component {
|
|
|
44046
44683
|
elements: restoredElements,
|
|
44047
44684
|
appState: restoredAppState,
|
|
44048
44685
|
files: initialData?.files,
|
|
44049
|
-
captureUpdate:
|
|
44686
|
+
captureUpdate: CaptureUpdateAction40.NEVER
|
|
44050
44687
|
});
|
|
44051
44688
|
this.clearImageShapeCache();
|
|
44052
44689
|
this.fonts.loadSceneFonts().then((fontFaces) => {
|
|
@@ -44723,7 +45360,7 @@ var App = class _App extends React61.Component {
|
|
|
44723
45360
|
});
|
|
44724
45361
|
}
|
|
44725
45362
|
if (!isInputLike(event.target)) {
|
|
44726
|
-
if ((event.key ===
|
|
45363
|
+
if ((event.key === KEYS56.ESCAPE || event.key === KEYS56.ENTER) && this.state.croppingElementId) {
|
|
44727
45364
|
this.finishImageCropping();
|
|
44728
45365
|
return;
|
|
44729
45366
|
}
|
|
@@ -44731,13 +45368,13 @@ var App = class _App extends React61.Component {
|
|
|
44731
45368
|
this.scene.getNonDeletedElementsMap(),
|
|
44732
45369
|
this.state
|
|
44733
45370
|
);
|
|
44734
|
-
if (selectedElements.length === 1 && isImageElement9(selectedElements[0]) && event.key ===
|
|
45371
|
+
if (selectedElements.length === 1 && isImageElement9(selectedElements[0]) && event.key === KEYS56.ENTER) {
|
|
44735
45372
|
this.startImageCropping(selectedElements[0]);
|
|
44736
45373
|
return;
|
|
44737
45374
|
}
|
|
44738
|
-
if (event.key ===
|
|
45375
|
+
if (event.key === KEYS56.ESCAPE) {
|
|
44739
45376
|
this.updateEditorAtom(convertElementTypePopupAtom, null);
|
|
44740
|
-
} else if (event.key ===
|
|
45377
|
+
} else if (event.key === KEYS56.TAB && (document.activeElement === this.excalidrawContainerRef?.current || document.activeElement?.classList.contains(
|
|
44741
45378
|
CLASSES11.CONVERT_ELEMENT_TYPE_POPUP
|
|
44742
45379
|
))) {
|
|
44743
45380
|
event.preventDefault();
|
|
@@ -44756,13 +45393,13 @@ var App = class _App extends React61.Component {
|
|
|
44756
45393
|
});
|
|
44757
45394
|
}
|
|
44758
45395
|
}
|
|
44759
|
-
if (event.key ===
|
|
45396
|
+
if (event.key === KEYS56.ESCAPE && this.flowChartCreator.isCreatingChart) {
|
|
44760
45397
|
this.flowChartCreator.clear();
|
|
44761
45398
|
this.triggerRender(true);
|
|
44762
45399
|
return;
|
|
44763
45400
|
}
|
|
44764
45401
|
const arrowKeyPressed = isArrowKey2(event.key);
|
|
44765
|
-
if (event[
|
|
45402
|
+
if (event[KEYS56.CTRL_OR_CMD] && arrowKeyPressed && !event.shiftKey) {
|
|
44766
45403
|
event.preventDefault();
|
|
44767
45404
|
const selectedElements2 = getSelectedElements(
|
|
44768
45405
|
this.scene.getNonDeletedElementsMap(),
|
|
@@ -44846,7 +45483,7 @@ var App = class _App extends React61.Component {
|
|
|
44846
45483
|
}
|
|
44847
45484
|
}
|
|
44848
45485
|
}
|
|
44849
|
-
if (event[
|
|
45486
|
+
if (event[KEYS56.CTRL_OR_CMD] && event.key === KEYS56.P && !event.shiftKey && !event.altKey) {
|
|
44850
45487
|
this.setToast({
|
|
44851
45488
|
message: t("commandPalette.shortcutHint", {
|
|
44852
45489
|
shortcut: getShortcutFromShortcutName("commandPalette")
|
|
@@ -44855,19 +45492,19 @@ var App = class _App extends React61.Component {
|
|
|
44855
45492
|
event.preventDefault();
|
|
44856
45493
|
return;
|
|
44857
45494
|
}
|
|
44858
|
-
if (event[
|
|
45495
|
+
if (event[KEYS56.CTRL_OR_CMD] && event.key.toLowerCase() === KEYS56.V) {
|
|
44859
45496
|
IS_PLAIN_PASTE = event.shiftKey;
|
|
44860
45497
|
clearTimeout(IS_PLAIN_PASTE_TIMER);
|
|
44861
45498
|
IS_PLAIN_PASTE_TIMER = window.setTimeout(() => {
|
|
44862
45499
|
IS_PLAIN_PASTE = false;
|
|
44863
45500
|
}, 100);
|
|
44864
45501
|
}
|
|
44865
|
-
if (event[
|
|
45502
|
+
if (event[KEYS56.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === KEYS56.V) {
|
|
44866
45503
|
event.preventDefault();
|
|
44867
45504
|
this.onVideoToolbarButtonClick();
|
|
44868
45505
|
return;
|
|
44869
45506
|
}
|
|
44870
|
-
if (event[
|
|
45507
|
+
if (event[KEYS56.CTRL_OR_CMD] && isWritableElement5(event.target)) {
|
|
44871
45508
|
if (event.code === CODES13.MINUS || event.code === CODES13.EQUAL) {
|
|
44872
45509
|
event.preventDefault();
|
|
44873
45510
|
return;
|
|
@@ -44876,24 +45513,24 @@ var App = class _App extends React61.Component {
|
|
|
44876
45513
|
if (
|
|
44877
45514
|
// inside an input
|
|
44878
45515
|
isWritableElement5(event.target) && // unless pressing escape (finalize action)
|
|
44879
|
-
event.key !==
|
|
45516
|
+
event.key !== KEYS56.ESCAPE || // or unless using arrows (to move between buttons)
|
|
44880
45517
|
isArrowKey2(event.key) && isInputLike(event.target)
|
|
44881
45518
|
) {
|
|
44882
45519
|
return;
|
|
44883
45520
|
}
|
|
44884
|
-
if (event.key ===
|
|
45521
|
+
if (event.key === KEYS56.QUESTION_MARK) {
|
|
44885
45522
|
this.setState({
|
|
44886
45523
|
openDialog: { name: "help" }
|
|
44887
45524
|
});
|
|
44888
45525
|
return;
|
|
44889
|
-
} else if (event.key.toLowerCase() ===
|
|
45526
|
+
} else if (event.key.toLowerCase() === KEYS56.E && event.shiftKey && event[KEYS56.CTRL_OR_CMD]) {
|
|
44890
45527
|
event.preventDefault();
|
|
44891
45528
|
this.setState({ openDialog: { name: "imageExport" } });
|
|
44892
45529
|
return;
|
|
44893
45530
|
}
|
|
44894
|
-
if (event.key ===
|
|
45531
|
+
if (event.key === KEYS56.PAGE_UP || event.key === KEYS56.PAGE_DOWN) {
|
|
44895
45532
|
let offset = (event.shiftKey ? this.state.width : this.state.height) / this.state.zoom.value;
|
|
44896
|
-
if (event.key ===
|
|
45533
|
+
if (event.key === KEYS56.PAGE_DOWN) {
|
|
44897
45534
|
offset = -offset;
|
|
44898
45535
|
}
|
|
44899
45536
|
if (event.shiftKey) {
|
|
@@ -44909,7 +45546,7 @@ var App = class _App extends React61.Component {
|
|
|
44909
45546
|
if (this.state.openDialog?.name === "elementLinkSelector") {
|
|
44910
45547
|
return;
|
|
44911
45548
|
}
|
|
44912
|
-
if (event.key ===
|
|
45549
|
+
if (event.key === KEYS56.ALT) {
|
|
44913
45550
|
if (getFeatureFlag4("COMPLEX_BINDINGS")) {
|
|
44914
45551
|
this.handleSkipBindMode();
|
|
44915
45552
|
} else {
|
|
@@ -44920,7 +45557,7 @@ var App = class _App extends React61.Component {
|
|
|
44920
45557
|
return;
|
|
44921
45558
|
}
|
|
44922
45559
|
const shouldPreventToolSwitching = this.props.viewModeEnabled === true;
|
|
44923
|
-
if (!shouldPreventToolSwitching && this.state.viewModeEnabled && event.key ===
|
|
45560
|
+
if (!shouldPreventToolSwitching && this.state.viewModeEnabled && event.key === KEYS56.ESCAPE) {
|
|
44924
45561
|
this.setActiveTool({ type: "hand" });
|
|
44925
45562
|
return;
|
|
44926
45563
|
}
|
|
@@ -44951,7 +45588,7 @@ var App = class _App extends React61.Component {
|
|
|
44951
45588
|
}
|
|
44952
45589
|
event.stopPropagation();
|
|
44953
45590
|
return;
|
|
44954
|
-
} else if (event.key ===
|
|
45591
|
+
} else if (event.key === KEYS56.Q) {
|
|
44955
45592
|
this.toggleLock("keyboard");
|
|
44956
45593
|
event.stopPropagation();
|
|
44957
45594
|
return;
|
|
@@ -44960,7 +45597,7 @@ var App = class _App extends React61.Component {
|
|
|
44960
45597
|
if (this.state.viewModeEnabled) {
|
|
44961
45598
|
return;
|
|
44962
45599
|
}
|
|
44963
|
-
if (event[
|
|
45600
|
+
if (event[KEYS56.CTRL_OR_CMD] && this.state.isBindingEnabled) {
|
|
44964
45601
|
if (getFeatureFlag4("COMPLEX_BINDINGS")) {
|
|
44965
45602
|
this.resetDelayedBindMode();
|
|
44966
45603
|
}
|
|
@@ -44993,13 +45630,13 @@ var App = class _App extends React61.Component {
|
|
|
44993
45630
|
const step = this.getEffectiveGridSize() && (event.shiftKey ? ELEMENT_TRANSLATE_AMOUNT : this.getEffectiveGridSize()) || (event.shiftKey ? ELEMENT_SHIFT_TRANSLATE_AMOUNT : ELEMENT_TRANSLATE_AMOUNT);
|
|
44994
45631
|
let offsetX = 0;
|
|
44995
45632
|
let offsetY = 0;
|
|
44996
|
-
if (event.key ===
|
|
45633
|
+
if (event.key === KEYS56.ARROW_LEFT) {
|
|
44997
45634
|
offsetX = -step;
|
|
44998
|
-
} else if (event.key ===
|
|
45635
|
+
} else if (event.key === KEYS56.ARROW_RIGHT) {
|
|
44999
45636
|
offsetX = step;
|
|
45000
|
-
} else if (event.key ===
|
|
45637
|
+
} else if (event.key === KEYS56.ARROW_UP) {
|
|
45001
45638
|
offsetY = -step;
|
|
45002
|
-
} else if (event.key ===
|
|
45639
|
+
} else if (event.key === KEYS56.ARROW_DOWN) {
|
|
45003
45640
|
offsetY = step;
|
|
45004
45641
|
}
|
|
45005
45642
|
selectedElements.forEach((element) => {
|
|
@@ -45017,11 +45654,11 @@ var App = class _App extends React61.Component {
|
|
|
45017
45654
|
});
|
|
45018
45655
|
this.scene.triggerUpdate();
|
|
45019
45656
|
event.preventDefault();
|
|
45020
|
-
} else if (event.key ===
|
|
45657
|
+
} else if (event.key === KEYS56.ENTER) {
|
|
45021
45658
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
45022
45659
|
if (selectedElements.length === 1) {
|
|
45023
45660
|
const selectedElement = selectedElements[0];
|
|
45024
|
-
if (event[
|
|
45661
|
+
if (event[KEYS56.CTRL_OR_CMD] || isLineElement8(selectedElement)) {
|
|
45025
45662
|
if (isLinearElement12(selectedElement)) {
|
|
45026
45663
|
if (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedElement.id) {
|
|
45027
45664
|
this.store.scheduleCapture();
|
|
@@ -45056,26 +45693,26 @@ var App = class _App extends React61.Component {
|
|
|
45056
45693
|
}
|
|
45057
45694
|
}
|
|
45058
45695
|
}
|
|
45059
|
-
if (event.key ===
|
|
45696
|
+
if (event.key === KEYS56.SPACE && gesture.pointers.size === 0) {
|
|
45060
45697
|
isHoldingSpace = true;
|
|
45061
45698
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
|
|
45062
45699
|
event.preventDefault();
|
|
45063
45700
|
}
|
|
45064
|
-
if ((event.key ===
|
|
45701
|
+
if ((event.key === KEYS56.G || event.key === KEYS56.S) && !event.altKey && !event[KEYS56.CTRL_OR_CMD]) {
|
|
45065
45702
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
45066
45703
|
if (this.state.activeTool.type === "selection" && !selectedElements.length) {
|
|
45067
45704
|
return;
|
|
45068
45705
|
}
|
|
45069
|
-
if (event.key ===
|
|
45706
|
+
if (event.key === KEYS56.G && (hasBackground(this.state.activeTool.type) || selectedElements.some((element) => hasBackground(element.type)))) {
|
|
45070
45707
|
this.setState({ openPopup: "elementBackground" });
|
|
45071
45708
|
event.stopPropagation();
|
|
45072
45709
|
}
|
|
45073
|
-
if (event.key ===
|
|
45710
|
+
if (event.key === KEYS56.S) {
|
|
45074
45711
|
this.setState({ openPopup: "elementStroke" });
|
|
45075
45712
|
event.stopPropagation();
|
|
45076
45713
|
}
|
|
45077
45714
|
}
|
|
45078
|
-
if (!event[
|
|
45715
|
+
if (!event[KEYS56.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === KEYS56.F) {
|
|
45079
45716
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
|
45080
45717
|
if (this.state.activeTool.type === "selection" && !selectedElements.length) {
|
|
45081
45718
|
return;
|
|
@@ -45090,12 +45727,12 @@ var App = class _App extends React61.Component {
|
|
|
45090
45727
|
this.setState({ openPopup: "fontFamily" });
|
|
45091
45728
|
}
|
|
45092
45729
|
}
|
|
45093
|
-
if (event[
|
|
45730
|
+
if (event[KEYS56.CTRL_OR_CMD] && (event.key === KEYS56.BACKSPACE || event.key === KEYS56.DELETE)) {
|
|
45094
45731
|
this.updateEditorAtom(activeConfirmDialogAtom, "clearCanvas");
|
|
45095
45732
|
}
|
|
45096
45733
|
const lowerCased = event.key.toLocaleLowerCase();
|
|
45097
|
-
const isPickingStroke = lowerCased ===
|
|
45098
|
-
const isPickingBackground = event.key ===
|
|
45734
|
+
const isPickingStroke = lowerCased === KEYS56.S && event.shiftKey;
|
|
45735
|
+
const isPickingBackground = event.key === KEYS56.I || lowerCased === KEYS56.G && event.shiftKey;
|
|
45099
45736
|
if (isPickingStroke || isPickingBackground) {
|
|
45100
45737
|
this.openEyeDropper({
|
|
45101
45738
|
type: isPickingStroke ? "stroke" : "background"
|
|
@@ -45104,7 +45741,7 @@ var App = class _App extends React61.Component {
|
|
|
45104
45741
|
}
|
|
45105
45742
|
));
|
|
45106
45743
|
__publicField(this, "onKeyUp", withBatchedUpdates((event) => {
|
|
45107
|
-
if (event.key ===
|
|
45744
|
+
if (event.key === KEYS56.SPACE) {
|
|
45108
45745
|
if (this.state.viewModeEnabled && this.state.activeTool.type !== "laser" || this.state.openDialog?.name === "elementLinkSelector") {
|
|
45109
45746
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.GRAB);
|
|
45110
45747
|
} else if (isSelectionLikeTool(this.state.activeTool.type)) {
|
|
@@ -45120,10 +45757,10 @@ var App = class _App extends React61.Component {
|
|
|
45120
45757
|
}
|
|
45121
45758
|
isHoldingSpace = false;
|
|
45122
45759
|
}
|
|
45123
|
-
if (event.key ===
|
|
45760
|
+
if (event.key === KEYS56.ALT) {
|
|
45124
45761
|
maybeHandleArrowPointlikeDrag({ app: this, event });
|
|
45125
45762
|
}
|
|
45126
|
-
if (event.key ===
|
|
45763
|
+
if (event.key === KEYS56.ALT && this.state.bindMode === "skip" || !event[KEYS56.CTRL_OR_CMD] && !isBindingEnabled2(this.state)) {
|
|
45127
45764
|
this.setState({
|
|
45128
45765
|
bindMode: "orbit"
|
|
45129
45766
|
});
|
|
@@ -45151,7 +45788,7 @@ var App = class _App extends React61.Component {
|
|
|
45151
45788
|
}
|
|
45152
45789
|
}
|
|
45153
45790
|
}
|
|
45154
|
-
if (!event[
|
|
45791
|
+
if (!event[KEYS56.CTRL_OR_CMD] && !this.state.isBindingEnabled) {
|
|
45155
45792
|
flushSync3(() => {
|
|
45156
45793
|
this.setState({ isBindingEnabled: true });
|
|
45157
45794
|
});
|
|
@@ -45202,11 +45839,11 @@ var App = class _App extends React61.Component {
|
|
|
45202
45839
|
if (this.flowChartNavigator.isExploring) {
|
|
45203
45840
|
this.flowChartNavigator.clear();
|
|
45204
45841
|
this.syncActionResult({
|
|
45205
|
-
captureUpdate:
|
|
45842
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
45206
45843
|
});
|
|
45207
45844
|
}
|
|
45208
45845
|
}
|
|
45209
|
-
if (!event[
|
|
45846
|
+
if (!event[KEYS56.CTRL_OR_CMD]) {
|
|
45210
45847
|
if (this.flowChartCreator.isCreatingChart) {
|
|
45211
45848
|
if (this.flowChartCreator.pendingNodes?.length) {
|
|
45212
45849
|
this.scene.insertElements(this.flowChartCreator.pendingNodes);
|
|
@@ -45244,7 +45881,7 @@ var App = class _App extends React61.Component {
|
|
|
45244
45881
|
}
|
|
45245
45882
|
this.flowChartCreator.clear();
|
|
45246
45883
|
this.syncActionResult({
|
|
45247
|
-
captureUpdate:
|
|
45884
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
45248
45885
|
});
|
|
45249
45886
|
}
|
|
45250
45887
|
}
|
|
@@ -45535,7 +46172,7 @@ var App = class _App extends React61.Component {
|
|
|
45535
46172
|
);
|
|
45536
46173
|
if (selectedElements.length === 1 && isLinearElement12(selectedElements[0])) {
|
|
45537
46174
|
const selectedLinearElement = selectedElements[0];
|
|
45538
|
-
if ((event[
|
|
46175
|
+
if ((event[KEYS56.CTRL_OR_CMD] && isSimpleArrow(selectedLinearElement) || isLineElement8(selectedLinearElement)) && (!this.state.selectedLinearElement?.isEditing || this.state.selectedLinearElement.elementId !== selectedLinearElement.id)) {
|
|
45539
46176
|
this.actionManager.executeAction(actionToggleLinearEditor);
|
|
45540
46177
|
return;
|
|
45541
46178
|
} else if (this.state.selectedLinearElement && isElbowArrow10(selectedElements[0])) {
|
|
@@ -45620,7 +46257,7 @@ var App = class _App extends React61.Component {
|
|
|
45620
46257
|
}
|
|
45621
46258
|
}
|
|
45622
46259
|
resetCursor(this.interactiveCanvas);
|
|
45623
|
-
if (!event[
|
|
46260
|
+
if (!event[KEYS56.CTRL_OR_CMD] && !this.state.viewModeEnabled) {
|
|
45624
46261
|
const hitElement = this.getElementAtPosition(sceneX, sceneY);
|
|
45625
46262
|
if (isIframeLikeElement2(hitElement)) {
|
|
45626
46263
|
this.setState({
|
|
@@ -46169,7 +46806,7 @@ var App = class _App extends React61.Component {
|
|
|
46169
46806
|
setCursor(this.interactiveCanvas, CURSOR_TYPE4.AUTO);
|
|
46170
46807
|
} else if (
|
|
46171
46808
|
// if using cmd/ctrl, we're not dragging
|
|
46172
|
-
!event[
|
|
46809
|
+
!event[KEYS56.CTRL_OR_CMD]
|
|
46173
46810
|
) {
|
|
46174
46811
|
if ((hitElement || this.isHittingCommonBoundingBoxOfSelectedElements(
|
|
46175
46812
|
scenePointer,
|
|
@@ -46288,7 +46925,7 @@ var App = class _App extends React61.Component {
|
|
|
46288
46925
|
this.state
|
|
46289
46926
|
)
|
|
46290
46927
|
},
|
|
46291
|
-
captureUpdate: this.state.openDialog?.name === "elementLinkSelector" ?
|
|
46928
|
+
captureUpdate: this.state.openDialog?.name === "elementLinkSelector" ? CaptureUpdateAction40.EVENTUALLY : CaptureUpdateAction40.NEVER
|
|
46292
46929
|
});
|
|
46293
46930
|
return;
|
|
46294
46931
|
}
|
|
@@ -46842,7 +47479,7 @@ var App = class _App extends React61.Component {
|
|
|
46842
47479
|
) : makeNextSelectedElementIds2({}, prevState)
|
|
46843
47480
|
}));
|
|
46844
47481
|
} else if (hitElement != null) {
|
|
46845
|
-
if (event[
|
|
47482
|
+
if (event[KEYS56.CTRL_OR_CMD]) {
|
|
46846
47483
|
if (event.altKey) {
|
|
46847
47484
|
if (this.state.openDialog?.name === "elementLinkSelector") {
|
|
46848
47485
|
this.setOpenDialog(null);
|
|
@@ -47050,7 +47687,7 @@ var App = class _App extends React61.Component {
|
|
|
47050
47687
|
const [gridX, gridY] = getGridPoint2(
|
|
47051
47688
|
sceneX,
|
|
47052
47689
|
sceneY,
|
|
47053
|
-
this.lastPointerDownEvent?.[
|
|
47690
|
+
this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
47054
47691
|
);
|
|
47055
47692
|
const element = newIframeElement({
|
|
47056
47693
|
type: "iframe",
|
|
@@ -47080,7 +47717,7 @@ var App = class _App extends React61.Component {
|
|
|
47080
47717
|
const [gridX, gridY] = getGridPoint2(
|
|
47081
47718
|
sceneX,
|
|
47082
47719
|
sceneY,
|
|
47083
|
-
this.lastPointerDownEvent?.[
|
|
47720
|
+
this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
47084
47721
|
);
|
|
47085
47722
|
const embedLink = getEmbedLink2(link);
|
|
47086
47723
|
if (!embedLink) {
|
|
@@ -47120,7 +47757,7 @@ var App = class _App extends React61.Component {
|
|
|
47120
47757
|
const [gridX, gridY] = getGridPoint2(
|
|
47121
47758
|
sceneX,
|
|
47122
47759
|
sceneY,
|
|
47123
|
-
this.lastPointerDownEvent?.[
|
|
47760
|
+
this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
47124
47761
|
);
|
|
47125
47762
|
const topLayerFrame = addToFrameUnderCursor ? this.getTopLayerFrameAtSceneCoords({
|
|
47126
47763
|
x: gridX,
|
|
@@ -47224,7 +47861,7 @@ var App = class _App extends React61.Component {
|
|
|
47224
47861
|
const [gridX, gridY] = getGridPoint2(
|
|
47225
47862
|
pointerDownState.origin.x,
|
|
47226
47863
|
pointerDownState.origin.y,
|
|
47227
|
-
event[
|
|
47864
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
47228
47865
|
);
|
|
47229
47866
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
47230
47867
|
x: gridX,
|
|
@@ -47360,7 +47997,7 @@ var App = class _App extends React61.Component {
|
|
|
47360
47997
|
const [gridX, gridY] = getGridPoint2(
|
|
47361
47998
|
pointerDownState.origin.x,
|
|
47362
47999
|
pointerDownState.origin.y,
|
|
47363
|
-
this.lastPointerDownEvent?.[
|
|
48000
|
+
this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
47364
48001
|
);
|
|
47365
48002
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
47366
48003
|
x: gridX,
|
|
@@ -47408,7 +48045,7 @@ var App = class _App extends React61.Component {
|
|
|
47408
48045
|
const [gridX, gridY] = getGridPoint2(
|
|
47409
48046
|
pointerDownState.origin.x,
|
|
47410
48047
|
pointerDownState.origin.y,
|
|
47411
|
-
this.lastPointerDownEvent?.[
|
|
48048
|
+
this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
47412
48049
|
);
|
|
47413
48050
|
const constructorOpts = {
|
|
47414
48051
|
x: gridX,
|
|
@@ -47645,7 +48282,10 @@ var App = class _App extends React61.Component {
|
|
|
47645
48282
|
}
|
|
47646
48283
|
const clientX = this.state.width / 2 + this.state.offsetLeft;
|
|
47647
48284
|
const clientY = this.state.height / 2 + this.state.offsetTop;
|
|
47648
|
-
const { x, y } = viewportCoordsToSceneCoords5(
|
|
48285
|
+
const { x, y } = viewportCoordsToSceneCoords5(
|
|
48286
|
+
{ clientX, clientY },
|
|
48287
|
+
this.state
|
|
48288
|
+
);
|
|
47649
48289
|
await this.insertVideos(files, x, y);
|
|
47650
48290
|
};
|
|
47651
48291
|
input.click();
|
|
@@ -47677,7 +48317,7 @@ var App = class _App extends React61.Component {
|
|
|
47677
48317
|
files
|
|
47678
48318
|
});
|
|
47679
48319
|
if (erroredFiles.size) {
|
|
47680
|
-
this.store.scheduleAction(
|
|
48320
|
+
this.store.scheduleAction(CaptureUpdateAction40.NEVER);
|
|
47681
48321
|
this.scene.replaceAllElements(
|
|
47682
48322
|
this.scene.getElementsIncludingDeleted().map((element) => {
|
|
47683
48323
|
if (isInitializedImageElement3(element) && erroredFiles.has(element.fileId)) {
|
|
@@ -47787,7 +48427,7 @@ var App = class _App extends React61.Component {
|
|
|
47787
48427
|
)
|
|
47788
48428
|
},
|
|
47789
48429
|
elements: nextElements,
|
|
47790
|
-
captureUpdate:
|
|
48430
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
47791
48431
|
});
|
|
47792
48432
|
this.setState({}, () => {
|
|
47793
48433
|
this.actionManager.executeAction(actionFinalize);
|
|
@@ -47807,7 +48447,7 @@ var App = class _App extends React61.Component {
|
|
|
47807
48447
|
const [gridX, gridY] = getGridPoint2(
|
|
47808
48448
|
sceneX,
|
|
47809
48449
|
sceneY,
|
|
47810
|
-
this.lastPointerDownEvent?.[
|
|
48450
|
+
this.lastPointerDownEvent?.[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
47811
48451
|
);
|
|
47812
48452
|
const w = width ?? 320 / this.state.zoom.value;
|
|
47813
48453
|
const h = height ?? 180 / this.state.zoom.value;
|
|
@@ -47924,7 +48564,7 @@ var App = class _App extends React61.Component {
|
|
|
47924
48564
|
)
|
|
47925
48565
|
},
|
|
47926
48566
|
elements: nextElements,
|
|
47927
|
-
captureUpdate:
|
|
48567
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
47928
48568
|
});
|
|
47929
48569
|
this.props.onAfterVideoUpload?.();
|
|
47930
48570
|
});
|
|
@@ -47952,7 +48592,7 @@ var App = class _App extends React61.Component {
|
|
|
47952
48592
|
isLoading: false
|
|
47953
48593
|
},
|
|
47954
48594
|
replaceFiles: true,
|
|
47955
|
-
captureUpdate:
|
|
48595
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
47956
48596
|
});
|
|
47957
48597
|
return;
|
|
47958
48598
|
} catch (error) {
|
|
@@ -48066,7 +48706,7 @@ var App = class _App extends React61.Component {
|
|
|
48066
48706
|
if (ret.type === MIME_TYPES9.excalidraw) {
|
|
48067
48707
|
syncInvalidIndices(elements.concat(ret.data.elements));
|
|
48068
48708
|
this.store.scheduleMicroAction({
|
|
48069
|
-
action:
|
|
48709
|
+
action: CaptureUpdateAction40.NEVER,
|
|
48070
48710
|
elements,
|
|
48071
48711
|
appState: void 0
|
|
48072
48712
|
});
|
|
@@ -48078,7 +48718,7 @@ var App = class _App extends React61.Component {
|
|
|
48078
48718
|
isLoading: false
|
|
48079
48719
|
},
|
|
48080
48720
|
replaceFiles: true,
|
|
48081
|
-
captureUpdate:
|
|
48721
|
+
captureUpdate: CaptureUpdateAction40.IMMEDIATELY
|
|
48082
48722
|
});
|
|
48083
48723
|
} else if (ret.type === MIME_TYPES9.excalidrawlib) {
|
|
48084
48724
|
await this.library.updateLibrary({
|
|
@@ -48171,7 +48811,7 @@ var App = class _App extends React61.Component {
|
|
|
48171
48811
|
let [gridX, gridY] = getGridPoint2(
|
|
48172
48812
|
pointerCoords.x,
|
|
48173
48813
|
pointerCoords.y,
|
|
48174
|
-
event[
|
|
48814
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
48175
48815
|
);
|
|
48176
48816
|
const image = isInitializedImageElement3(newElement8) && this.imageCache.get(newElement8.fileId)?.image;
|
|
48177
48817
|
const aspectRatio = image && !(image instanceof Promise) ? image.width / image.height : null;
|
|
@@ -48237,7 +48877,7 @@ var App = class _App extends React61.Component {
|
|
|
48237
48877
|
const [x, y] = getGridPoint2(
|
|
48238
48878
|
pointerCoords.x - pointerDownState.resize.offset.x,
|
|
48239
48879
|
pointerCoords.y - pointerDownState.resize.offset.y,
|
|
48240
|
-
event[
|
|
48880
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
48241
48881
|
);
|
|
48242
48882
|
const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);
|
|
48243
48883
|
if (transformHandleType && croppingElement && isImageElement9(croppingElement)) {
|
|
@@ -48249,7 +48889,7 @@ var App = class _App extends React61.Component {
|
|
|
48249
48889
|
const [gridX, gridY] = getGridPoint2(
|
|
48250
48890
|
pointerCoords.x,
|
|
48251
48891
|
pointerCoords.y,
|
|
48252
|
-
event[
|
|
48892
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
48253
48893
|
);
|
|
48254
48894
|
const dragOffset = {
|
|
48255
48895
|
x: gridX - pointerDownState.originInGrid.x,
|
|
@@ -48313,7 +48953,7 @@ var App = class _App extends React61.Component {
|
|
|
48313
48953
|
let [resizeX, resizeY] = getGridPoint2(
|
|
48314
48954
|
pointerCoords.x - pointerDownState.resize.offset.x,
|
|
48315
48955
|
pointerCoords.y - pointerDownState.resize.offset.y,
|
|
48316
|
-
event[
|
|
48956
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
48317
48957
|
);
|
|
48318
48958
|
const frameElementsOffsetsMap = /* @__PURE__ */ new Map();
|
|
48319
48959
|
selectedFrames.forEach((frame) => {
|
|
@@ -48332,7 +48972,7 @@ var App = class _App extends React61.Component {
|
|
|
48332
48972
|
const [gridX, gridY] = getGridPoint2(
|
|
48333
48973
|
pointerCoords.x,
|
|
48334
48974
|
pointerCoords.y,
|
|
48335
|
-
event[
|
|
48975
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
48336
48976
|
);
|
|
48337
48977
|
const dragOffset = {
|
|
48338
48978
|
x: gridX - pointerDownState.originInGrid.x,
|
|
@@ -48468,7 +49108,7 @@ var App = class _App extends React61.Component {
|
|
|
48468
49108
|
__publicField(this, "handleWheel", withBatchedUpdates(
|
|
48469
49109
|
(event) => {
|
|
48470
49110
|
if (!(event.target instanceof HTMLCanvasElement || event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLIFrameElement || event.target instanceof HTMLElement && event.target.classList.contains(CLASSES11.FRAME_NAME))) {
|
|
48471
|
-
if (event[
|
|
49111
|
+
if (event[KEYS56.CTRL_OR_CMD]) {
|
|
48472
49112
|
event.preventDefault();
|
|
48473
49113
|
}
|
|
48474
49114
|
return;
|
|
@@ -49313,10 +49953,7 @@ var App = class _App extends React61.Component {
|
|
|
49313
49953
|
pointerEvents: POINTER_EVENTS.enabled,
|
|
49314
49954
|
opacity: getRenderOpacity(
|
|
49315
49955
|
el,
|
|
49316
|
-
getContainingFrame3(
|
|
49317
|
-
el,
|
|
49318
|
-
this.scene.getNonDeletedElementsMap()
|
|
49319
|
-
),
|
|
49956
|
+
getContainingFrame3(el, this.scene.getNonDeletedElementsMap()),
|
|
49320
49957
|
this.elementsPendingErasure,
|
|
49321
49958
|
null,
|
|
49322
49959
|
this.state.openDialog?.name === "elementLinkSelector" ? DEFAULT_REDUCED_GLOBAL_ALPHA2 : 1
|
|
@@ -49332,7 +49969,14 @@ var App = class _App extends React61.Component {
|
|
|
49332
49969
|
transform: `rotate(${el.angle}rad)`,
|
|
49333
49970
|
pointerEvents: POINTER_EVENTS.enabled
|
|
49334
49971
|
},
|
|
49335
|
-
children: /* @__PURE__ */ jsx179(
|
|
49972
|
+
children: /* @__PURE__ */ jsx179(
|
|
49973
|
+
VideoElement,
|
|
49974
|
+
{
|
|
49975
|
+
element: el,
|
|
49976
|
+
isActive: true,
|
|
49977
|
+
videoDownloadProxyUrl: this.props.videoDownloadProxyUrl
|
|
49978
|
+
}
|
|
49979
|
+
)
|
|
49336
49980
|
}
|
|
49337
49981
|
)
|
|
49338
49982
|
},
|
|
@@ -50687,12 +51331,12 @@ var App = class _App extends React61.Component {
|
|
|
50687
51331
|
const isElbowArrowOnly = selectedElements.findIndex(isElbowArrow10) === 0;
|
|
50688
51332
|
return {
|
|
50689
51333
|
origin,
|
|
50690
|
-
withCmdOrCtrl: event[
|
|
51334
|
+
withCmdOrCtrl: event[KEYS56.CTRL_OR_CMD],
|
|
50691
51335
|
originInGrid: tupleToCoors(
|
|
50692
51336
|
getGridPoint2(
|
|
50693
51337
|
origin.x,
|
|
50694
51338
|
origin.y,
|
|
50695
|
-
event[
|
|
51339
|
+
event[KEYS56.CTRL_OR_CMD] || isElbowArrowOnly ? null : this.getEffectiveGridSize()
|
|
50696
51340
|
)
|
|
50697
51341
|
),
|
|
50698
51342
|
scrollbars: isOverScrollBars(
|
|
@@ -50833,7 +51477,7 @@ var App = class _App extends React61.Component {
|
|
|
50833
51477
|
}
|
|
50834
51478
|
onKeyUpFromPointerDownHandler(pointerDownState) {
|
|
50835
51479
|
return withBatchedUpdates((event) => {
|
|
50836
|
-
event.key ===
|
|
51480
|
+
event.key === KEYS56.ALT && event.preventDefault();
|
|
50837
51481
|
if (this.maybeHandleResize(pointerDownState, event)) {
|
|
50838
51482
|
return;
|
|
50839
51483
|
}
|
|
@@ -50855,7 +51499,7 @@ var App = class _App extends React61.Component {
|
|
|
50855
51499
|
const [gridX2, gridY2] = getGridPoint2(
|
|
50856
51500
|
pointerCoords.x,
|
|
50857
51501
|
pointerCoords.y,
|
|
50858
|
-
event[
|
|
51502
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
50859
51503
|
);
|
|
50860
51504
|
let index = this.state.selectedLinearElement.initialState.segmentMidpoint.index;
|
|
50861
51505
|
if (index < 0) {
|
|
@@ -50920,7 +51564,7 @@ var App = class _App extends React61.Component {
|
|
|
50920
51564
|
const [gridX, gridY] = getGridPoint2(
|
|
50921
51565
|
pointerCoords.x,
|
|
50922
51566
|
pointerCoords.y,
|
|
50923
|
-
event[
|
|
51567
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
50924
51568
|
);
|
|
50925
51569
|
if (pointerDownState.resize.isResizing) {
|
|
50926
51570
|
pointerDownState.lastCoords.x = pointerCoords.x;
|
|
@@ -50968,7 +51612,7 @@ var App = class _App extends React61.Component {
|
|
|
50968
51612
|
this.state.selectedLinearElement,
|
|
50969
51613
|
pointerCoords,
|
|
50970
51614
|
this,
|
|
50971
|
-
!event[
|
|
51615
|
+
!event[KEYS56.CTRL_OR_CMD],
|
|
50972
51616
|
this.scene
|
|
50973
51617
|
);
|
|
50974
51618
|
if (!ret) {
|
|
@@ -51166,7 +51810,7 @@ var App = class _App extends React61.Component {
|
|
|
51166
51810
|
dragOffset,
|
|
51167
51811
|
this.scene,
|
|
51168
51812
|
snapOffset,
|
|
51169
|
-
event[
|
|
51813
|
+
event[KEYS56.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()
|
|
51170
51814
|
);
|
|
51171
51815
|
}
|
|
51172
51816
|
this.setState({
|
|
@@ -51784,7 +52428,7 @@ var App = class _App extends React61.Component {
|
|
|
51784
52428
|
appState: {
|
|
51785
52429
|
newElement: null
|
|
51786
52430
|
},
|
|
51787
|
-
captureUpdate:
|
|
52431
|
+
captureUpdate: CaptureUpdateAction40.NEVER
|
|
51788
52432
|
});
|
|
51789
52433
|
return;
|
|
51790
52434
|
}
|
|
@@ -51911,7 +52555,7 @@ var App = class _App extends React61.Component {
|
|
|
51911
52555
|
if (resizingElement && isInvisiblySmallElement3(resizingElement)) {
|
|
51912
52556
|
this.updateScene({
|
|
51913
52557
|
elements: this.scene.getElementsIncludingDeleted().filter((el) => el.id !== resizingElement.id),
|
|
51914
|
-
captureUpdate:
|
|
52558
|
+
captureUpdate: CaptureUpdateAction40.NEVER
|
|
51915
52559
|
});
|
|
51916
52560
|
}
|
|
51917
52561
|
if (pointerDownState.resize.isResizing) {
|
|
@@ -53281,7 +53925,7 @@ import {
|
|
|
53281
53925
|
newElementWith as newElementWith12,
|
|
53282
53926
|
bumpVersion
|
|
53283
53927
|
} from "@orangecatai/element";
|
|
53284
|
-
import { CaptureUpdateAction as
|
|
53928
|
+
import { CaptureUpdateAction as CaptureUpdateAction41 } from "@orangecatai/element";
|
|
53285
53929
|
|
|
53286
53930
|
// components/TTDDialog/TTDDialogTrigger.tsx
|
|
53287
53931
|
import { jsx as jsx188 } from "react/jsx-runtime";
|
|
@@ -58629,6 +59273,8 @@ var ExcalidrawBase = (props) => {
|
|
|
58629
59273
|
showDeprecatedFonts,
|
|
58630
59274
|
imageGenUrl,
|
|
58631
59275
|
autoResizeUrl,
|
|
59276
|
+
customResizeUrl,
|
|
59277
|
+
tier1CropUrl,
|
|
58632
59278
|
removeBgUrl,
|
|
58633
59279
|
renderScrollbars,
|
|
58634
59280
|
onBeforeImageGen,
|
|
@@ -58735,6 +59381,8 @@ var ExcalidrawBase = (props) => {
|
|
|
58735
59381
|
showDeprecatedFonts,
|
|
58736
59382
|
imageGenUrl,
|
|
58737
59383
|
autoResizeUrl,
|
|
59384
|
+
customResizeUrl,
|
|
59385
|
+
tier1CropUrl,
|
|
58738
59386
|
removeBgUrl,
|
|
58739
59387
|
renderScrollbars,
|
|
58740
59388
|
onBeforeImageGen,
|
|
@@ -58809,7 +59457,7 @@ Excalidraw.displayName = "Excalidraw";
|
|
|
58809
59457
|
export {
|
|
58810
59458
|
AIChatPanel,
|
|
58811
59459
|
Button,
|
|
58812
|
-
|
|
59460
|
+
CaptureUpdateAction41 as CaptureUpdateAction,
|
|
58813
59461
|
CommandPalette,
|
|
58814
59462
|
DEFAULT_LASER_COLOR2 as DEFAULT_LASER_COLOR,
|
|
58815
59463
|
DefaultSidebar,
|