@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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-FABLWJ5B.js";import"./chunk-SRAX5OIU.js";export{a as Commands,b as subsetToBase64,c as subsetToBinary,d as toBase64};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-
|
|
1
|
+
import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-FABLWJ5B.js";import"./chunk-SRAX5OIU.js";var s=import.meta.url?new URL(import.meta.url):void 0;typeof window>"u"&&typeof self<"u"&&(self.onmessage=async e=>{switch(e.data.command){case r.Subset:let a=await t(e.data.arrayBuffer,e.data.codePoints);self.postMessage(a,{transfer:[a]});break}});export{s as WorkerUrl};
|
|
@@ -55,6 +55,7 @@ export declare const KEYS: {
|
|
|
55
55
|
readonly I: "i";
|
|
56
56
|
readonly J: "j";
|
|
57
57
|
readonly L: "l";
|
|
58
|
+
readonly M: "m";
|
|
58
59
|
readonly O: "o";
|
|
59
60
|
readonly P: "p";
|
|
60
61
|
readonly Q: "q";
|
|
@@ -111,6 +112,7 @@ export declare const KeyCodeMap: Map<ValueOf<{
|
|
|
111
112
|
readonly I: "i";
|
|
112
113
|
readonly J: "j";
|
|
113
114
|
readonly L: "l";
|
|
115
|
+
readonly M: "m";
|
|
114
116
|
readonly O: "o";
|
|
115
117
|
readonly P: "p";
|
|
116
118
|
readonly Q: "q";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const actionOpenImageGenerator: {
|
|
2
|
+
name: "openImageGenerator";
|
|
3
|
+
label: string;
|
|
4
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
viewMode: false;
|
|
6
|
+
trackEvent: {
|
|
7
|
+
category: "toolbar";
|
|
8
|
+
};
|
|
9
|
+
perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
|
|
10
|
+
elements: null;
|
|
11
|
+
appState: null;
|
|
12
|
+
captureUpdate: "EVENTUALLY";
|
|
13
|
+
};
|
|
14
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
15
|
+
} & {
|
|
16
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
17
|
+
};
|
|
18
|
+
export declare const actionOpenVideoGenerator: {
|
|
19
|
+
name: "openVideoGenerator";
|
|
20
|
+
label: string;
|
|
21
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
viewMode: false;
|
|
23
|
+
trackEvent: {
|
|
24
|
+
category: "toolbar";
|
|
25
|
+
};
|
|
26
|
+
perform: (elements: readonly import("@orangecatai/element/types").OrderedExcalidrawElement[], appState: Readonly<import("..").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
|
|
27
|
+
elements: null;
|
|
28
|
+
appState: null;
|
|
29
|
+
captureUpdate: "EVENTUALLY";
|
|
30
|
+
};
|
|
31
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
32
|
+
} & {
|
|
33
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
34
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SubtypeOf } from "@orangecatai/common/utility-types";
|
|
2
2
|
import type { ActionName } from "./types";
|
|
3
|
-
export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock" | "resetZoom" | "zoomOut" | "zoomIn" | "zoomToFit" | "zoomToFitSelectionInViewport" | "zoomToFitSelection" | "toggleEraserTool" | "toggleHandTool" | "setFrameAsActiveTool" | "cycleThroughFrameChildren" | "saveFileToDisk" | "saveToActiveFile" | "toggleShortcuts" | "wrapSelectionInFrame"> | "saveScene" | "imageExport" | "commandPalette" | "searchMenu" | "toolLock";
|
|
3
|
+
export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock" | "resetZoom" | "zoomOut" | "zoomIn" | "zoomToFit" | "zoomToFitSelectionInViewport" | "zoomToFitSelection" | "toggleEraserTool" | "toggleHandTool" | "setFrameAsActiveTool" | "cycleThroughFrameChildren" | "openImageGenerator" | "openVideoGenerator" | "saveFileToDisk" | "saveToActiveFile" | "toggleShortcuts" | "wrapSelectionInFrame"> | "saveScene" | "imageExport" | "commandPalette" | "searchMenu" | "toolLock";
|
|
4
4
|
export declare const getShortcutFromShortcutName: (name: ShortcutName, idx?: number) => string;
|
|
@@ -14,7 +14,7 @@ export type ActionResult = {
|
|
|
14
14
|
type ActionFn<TData = any> = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: TData | undefined, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "scrollBackToContent" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "cycleThroughFrameChildren" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "scrollBackToContent" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "openImageGenerator" | "openVideoGenerator" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "cycleThroughFrameChildren" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@orangecatai/common";
|
|
3
3
|
import { LinearElementEditor, FlowChartCreator, Scene, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@orangecatai/element";
|
|
4
|
+
import "../actions/actionGenerators";
|
|
4
5
|
import { ActionManager } from "../actions/manager";
|
|
5
6
|
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
6
7
|
import { Fonts } from "../fonts";
|
|
@@ -5,5 +5,5 @@ interface VideoElementProps {
|
|
|
5
5
|
isActive: boolean;
|
|
6
6
|
videoDownloadProxyUrl?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const VideoElement: ({ element, videoDownloadProxyUrl }: VideoElementProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const VideoElement: ({ element, videoDownloadProxyUrl, }: VideoElementProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./AutoResizePanel.scss";
|
|
2
2
|
import type { ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@orangecatai/element/types";
|
|
3
3
|
import type { AppClassProperties } from "../../types";
|
|
4
|
-
export declare const AutoResizePanel: ({ element, app, onClose, onBeforeAutoResize, onAfterAutoResize, onRunningChange, autoResizeUrl, chatModel, agentImageModel, }: {
|
|
4
|
+
export declare const AutoResizePanel: ({ element, app, onClose, onBeforeAutoResize, onAfterAutoResize, onRunningChange, autoResizeUrl, customResizeUrl, tier1CropUrl, chatModel, agentImageModel, }: {
|
|
5
5
|
element: NonDeletedExcalidrawElement & ExcalidrawFrameLikeElement;
|
|
6
6
|
app: AppClassProperties;
|
|
7
7
|
onClose: () => void;
|
|
@@ -12,6 +12,8 @@ export declare const AutoResizePanel: ({ element, app, onClose, onBeforeAutoResi
|
|
|
12
12
|
onAfterAutoResize?: () => void;
|
|
13
13
|
onRunningChange?: (running: boolean) => void;
|
|
14
14
|
autoResizeUrl: string;
|
|
15
|
+
customResizeUrl?: string;
|
|
16
|
+
tier1CropUrl?: string;
|
|
15
17
|
chatModel: string;
|
|
16
18
|
agentImageModel?: string;
|
|
17
19
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { ExcalidrawElement, ExcalidrawFrameLikeElement } from "@orangecatai/element/types";
|
|
2
2
|
import type { AppClassProperties } from "../../types";
|
|
3
3
|
import type { BinaryFiles } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* True when (targetW, targetH)'s aspect ratio is far from every ratio the
|
|
6
|
+
* generation model natively supports, OR is an extreme ultra-wide/tall ratio
|
|
7
|
+
* prone to element duplication regardless of native support — routes this
|
|
8
|
+
* dimension to `customResizeUrl` when the host has provided one.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isBigAspectRatioDelta(targetW: number, targetH: number): boolean;
|
|
4
11
|
export type TargetDimension = {
|
|
5
12
|
width: number;
|
|
6
13
|
height: number;
|
|
@@ -158,6 +165,8 @@ export declare function runAutoResize(opts: {
|
|
|
158
165
|
targetDimensions: TargetDimension[];
|
|
159
166
|
app: AppClassProperties;
|
|
160
167
|
autoResizeUrl: string;
|
|
168
|
+
customResizeUrl?: string;
|
|
169
|
+
tier1CropUrl?: string;
|
|
161
170
|
chatModel?: string;
|
|
162
171
|
agentImageModel?: string;
|
|
163
172
|
customFontMap?: Record<string, number>;
|
|
@@ -601,6 +601,33 @@ export interface ExcalidrawProps {
|
|
|
601
601
|
* planning, vision tagging, HTML generation, reviewer). Key stays server-side.
|
|
602
602
|
*/
|
|
603
603
|
autoResizeUrl?: string;
|
|
604
|
+
/**
|
|
605
|
+
* Host proxy URL for the Tier-2 (extreme aspect-ratio) custom-resize
|
|
606
|
+
* pipeline. When a target dimension in Auto Resize is far from every
|
|
607
|
+
* aspect ratio the generation model natively supports, the standard
|
|
608
|
+
* generate+cover-crop flow risks cutting foreground elements — the SDK
|
|
609
|
+
* routes that dimension here instead. The SDK POSTs
|
|
610
|
+
* `{ imageDataUrl, targetWidth, targetHeight }` and expects
|
|
611
|
+
* `{ dataUrl: string }` back, already resized to the exact target pixels.
|
|
612
|
+
* Key/credit-gating and the multi-step pipeline (detect/generate/verify/
|
|
613
|
+
* retry/fallback) all live host-side. Falls back to the standard flow when
|
|
614
|
+
* omitted. See the host's `docs/custom-resize-big-delta-spec.md`.
|
|
615
|
+
*/
|
|
616
|
+
customResizeUrl?: string;
|
|
617
|
+
/**
|
|
618
|
+
* Host proxy URL for the Tier-1 element-aware crop step. After the
|
|
619
|
+
* standard generate+cover-crop flow generates an image at the nearest
|
|
620
|
+
* native ratio, the SDK POSTs
|
|
621
|
+
* `{ generatedImageDataUrl, sourceImageDataUrl, targetWidth, targetHeight }`
|
|
622
|
+
* here instead of doing a blind dead-center crop locally — the host
|
|
623
|
+
* detects element positions in the generated image and picks a crop
|
|
624
|
+
* window that keeps every critical/important element fully inside it,
|
|
625
|
+
* escalating to the Tier-2 pipeline (via `customResizeUrl`) if no safe
|
|
626
|
+
* crop exists. Expects `{ dataUrl: string }` back, already resized to the
|
|
627
|
+
* exact target pixels. Falls back to the local blind-crop behavior when
|
|
628
|
+
* omitted. See the host's `docs/custom-resize-big-delta-spec.md` §4.3.
|
|
629
|
+
*/
|
|
630
|
+
tier1CropUrl?: string;
|
|
604
631
|
/**
|
|
605
632
|
* Host proxy URL for the remove.bg toolbar action. The SDK POSTs
|
|
606
633
|
* `{ imageDataUrl }` and receives `{ imageDataUrl }`. Key stays server-side.
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as a,T as b,U as c}from"../chunk-Q6JGYK3N.js";import"../chunk-JVKQD63G.js";import"../chunk-SRAX5OIU.js";export{c as decodePngMetadata,b as encodePngMetadata,a as getTEXtChunk};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|