@orangecatai/adgen-canvas 0.0.1 → 0.0.2
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/README.md +8 -12
- package/dist/dev/{chunk-23ZG3JRJ.js → chunk-UV7ECD7A.js} +17 -4
- package/dist/dev/chunk-UV7ECD7A.js.map +7 -0
- package/dist/dev/chunk-X2WWSILD.js +7 -0
- package/dist/dev/chunk-X2WWSILD.js.map +7 -0
- package/dist/dev/data/{image-D63IS3GP.js → image-H4O52A73.js} +3 -3
- package/dist/dev/index.css +1355 -0
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +2881 -1233
- 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-6XBRNJFC.js → chunk-DOJFO2UO.js} +3 -3
- package/dist/prod/{chunk-TDN63PPO.js → chunk-O3WJMHIE.js} +1 -1
- package/dist/prod/data/image-43FV5SMF.js +1 -0
- package/dist/prod/index.css +2 -1
- package/dist/prod/index.js +28 -28
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/element/src/arrows/focus.d.ts +1 -1
- package/dist/types/element/src/binding.d.ts +3 -3
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/element/src/delta.d.ts +2 -2
- package/dist/types/element/src/dragElements.d.ts +1 -1
- package/dist/types/element/src/duplicate.d.ts +1 -1
- package/dist/types/element/src/embeddable.d.ts +1 -1
- package/dist/types/element/src/flowchart.d.ts +1 -1
- package/dist/types/element/src/frame.d.ts +1 -1
- package/dist/types/element/src/groups.d.ts +1 -1
- package/dist/types/element/src/renderElement.d.ts +1 -1
- package/dist/types/element/src/selection.d.ts +1 -1
- package/dist/types/element/src/shape.d.ts +2 -2
- package/dist/types/element/src/store.d.ts +2 -2
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/transform.d.ts +1 -1
- package/dist/types/element/src/utils.d.ts +1 -1
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +7 -7
- package/dist/types/excalidraw/actions/actionExport.d.ts +9 -9
- package/dist/types/excalidraw/actions/actionProperties.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +4 -4
- package/dist/types/excalidraw/components/AIChatPanel.d.ts +10 -0
- package/dist/types/excalidraw/components/Actions.d.ts +1 -1
- package/dist/types/excalidraw/components/App.d.ts +13 -2
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +2 -2
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/ImageExportDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/ImageGeneratorPanel.d.ts +38 -0
- package/dist/types/excalidraw/components/ImageQuickEditPanel.d.ts +7 -0
- package/dist/types/excalidraw/components/JSONExportDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/types.d.ts +2 -2
- package/dist/types/excalidraw/components/ai-chat/agentLoop.d.ts +60 -0
- package/dist/types/excalidraw/components/ai-chat/canvasTools.d.ts +288 -0
- package/dist/types/excalidraw/components/image-generation/pendingGenerations.d.ts +30 -0
- package/dist/types/excalidraw/components/ui/avatar.d.ts +6 -0
- package/dist/types/excalidraw/components/ui/button.d.ts +11 -0
- package/dist/types/excalidraw/components/ui/chat-container.d.ts +17 -0
- package/dist/types/excalidraw/components/ui/code-block.d.ts +16 -0
- package/dist/types/excalidraw/components/ui/markdown.d.ts +10 -0
- package/dist/types/excalidraw/components/ui/message.d.ts +35 -0
- package/dist/types/excalidraw/components/ui/prompt-input.d.ts +28 -0
- package/dist/types/excalidraw/components/ui/scroll-button.d.ts +10 -0
- package/dist/types/excalidraw/components/ui/select.d.ts +13 -0
- package/dist/types/excalidraw/components/ui/textarea.d.ts +3 -0
- package/dist/types/excalidraw/components/ui/tooltip.d.ts +7 -0
- package/dist/types/excalidraw/data/blob.d.ts +19 -17
- package/dist/types/excalidraw/data/json.d.ts +8 -8
- package/dist/types/excalidraw/data/library.d.ts +1 -1
- package/dist/types/excalidraw/fonts/Fonts.d.ts +2 -2
- package/dist/types/excalidraw/i18n.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +1 -0
- package/dist/types/excalidraw/lib/utils.d.ts +2 -0
- package/dist/types/excalidraw/types.d.ts +9 -0
- package/dist/types/excalidraw/utils/geminiApiKey.d.ts +1 -0
- package/package.json +33 -15
- package/CHANGELOG.md +0 -34
- package/dist/dev/chunk-23ZG3JRJ.js.map +0 -7
- package/dist/dev/chunk-L5IYTQZ4.js +0 -7
- package/dist/dev/chunk-L5IYTQZ4.js.map +0 -7
- package/dist/prod/data/image-H66RFTQG.js +0 -1
- package/history.ts +0 -249
- /package/dist/dev/data/{image-D63IS3GP.js.map → image-H4O52A73.js.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// <define:import.meta.env>
|
|
2
|
-
var define_import_meta_env_default = { MODE: "development", VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "http://localhost:3000", VITE_APP_AI_BACKEND: "http://localhost:3016", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_ENABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3001", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_APP_ENABLE_PWA: "false", VITE_APP_PLUS_EXPORT_PUBLIC_KEY: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\nHQIDAQAB", VITE_APP_DISABLE_PREVENT_UNLOAD: "", PKG_NAME: "@orangecatai/adgen-canvas", PKG_VERSION: "0.0.1", DEV: true };
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
define_import_meta_env_default
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=chunk-L5IYTQZ4.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["<define:import.meta.env>"],
|
|
4
|
-
"sourcesContent": [""],
|
|
5
|
-
"mappings": ";AAAA,uCAAC,MAAO,eAAc,6BAA8B,2CAA0C,8BAA+B,gDAA+C,sBAAuB,oCAAmC,0BAA2B,gFAA+E,wBAAyB,yBAAwB,kBAAmB,+BAA8B,mBAAoB,yBAAwB,qBAAsB,yBAAwB,0BAA2B,mRAA0S,kCAAmC,IAAG,0BAA2B,QAAO,cAAe,SAAQ,eAAgB,QAAO,mDAAoD,IAAG,2BAA4B,QAAO,wBAAyB,QAAO,qBAAsB,SAAQ,iCAAkC,wZAAuZ,iCAAkC,IAAG,UAAW,6BAA4B,aAAc,SAAQ,KAAM,KAAI;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as a,U as b,V as c}from"../chunk-6XBRNJFC.js";import"../chunk-TDN63PPO.js";import"../chunk-SRAX5OIU.js";export{c as decodePngMetadata,b as encodePngMetadata,a as getTEXtChunk};
|
package/history.ts
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { Emitter } from "@orangecatai/common";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
CaptureUpdateAction,
|
|
5
|
-
StoreChange,
|
|
6
|
-
StoreDelta,
|
|
7
|
-
} from "@orangecatai/element";
|
|
8
|
-
|
|
9
|
-
import type { StoreSnapshot, Store } from "@orangecatai/element";
|
|
10
|
-
|
|
11
|
-
import type { SceneElementsMap } from "@orangecatai/element/types";
|
|
12
|
-
|
|
13
|
-
import type { AppState } from "./types";
|
|
14
|
-
|
|
15
|
-
export class HistoryDelta extends StoreDelta {
|
|
16
|
-
/**
|
|
17
|
-
* Apply the delta to the passed elements and appState, does not modify the snapshot.
|
|
18
|
-
*/
|
|
19
|
-
public applyTo(
|
|
20
|
-
elements: SceneElementsMap,
|
|
21
|
-
appState: AppState,
|
|
22
|
-
snapshot: StoreSnapshot,
|
|
23
|
-
): [SceneElementsMap, AppState, boolean] {
|
|
24
|
-
const [nextElements, elementsContainVisibleChange] = this.elements.applyTo(
|
|
25
|
-
elements,
|
|
26
|
-
// used to fallback into local snapshot in case we couldn't apply the delta
|
|
27
|
-
// due to a missing (force deleted) elements in the scene
|
|
28
|
-
snapshot.elements,
|
|
29
|
-
// we don't want to apply the `version` and `versionNonce` properties for history
|
|
30
|
-
// as we always need to end up with a new version due to collaboration,
|
|
31
|
-
// approaching each undo / redo as a new user action
|
|
32
|
-
{
|
|
33
|
-
excludedProperties: new Set(["version", "versionNonce"]),
|
|
34
|
-
},
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
const [nextAppState, appStateContainsVisibleChange] = this.appState.applyTo(
|
|
38
|
-
appState,
|
|
39
|
-
nextElements,
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const appliedVisibleChanges =
|
|
43
|
-
elementsContainVisibleChange || appStateContainsVisibleChange;
|
|
44
|
-
|
|
45
|
-
return [nextElements, nextAppState, appliedVisibleChanges];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Overriding once to avoid type casting everywhere.
|
|
50
|
-
*/
|
|
51
|
-
public static override calculate(
|
|
52
|
-
prevSnapshot: StoreSnapshot,
|
|
53
|
-
nextSnapshot: StoreSnapshot,
|
|
54
|
-
) {
|
|
55
|
-
return super.calculate(prevSnapshot, nextSnapshot) as HistoryDelta;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Overriding once to avoid type casting everywhere.
|
|
60
|
-
*/
|
|
61
|
-
public static override inverse(delta: StoreDelta): HistoryDelta {
|
|
62
|
-
return super.inverse(delta) as HistoryDelta;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Overriding once to avoid type casting everywhere.
|
|
67
|
-
*/
|
|
68
|
-
public static override applyLatestChanges(
|
|
69
|
-
delta: StoreDelta,
|
|
70
|
-
prevElements: SceneElementsMap,
|
|
71
|
-
nextElements: SceneElementsMap,
|
|
72
|
-
modifierOptions?: "deleted" | "inserted",
|
|
73
|
-
) {
|
|
74
|
-
return super.applyLatestChanges(
|
|
75
|
-
delta,
|
|
76
|
-
prevElements,
|
|
77
|
-
nextElements,
|
|
78
|
-
modifierOptions,
|
|
79
|
-
) as HistoryDelta;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export class HistoryChangedEvent {
|
|
84
|
-
constructor(
|
|
85
|
-
public readonly isUndoStackEmpty: boolean = true,
|
|
86
|
-
public readonly isRedoStackEmpty: boolean = true,
|
|
87
|
-
) {}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export class History {
|
|
91
|
-
public readonly onHistoryChangedEmitter = new Emitter<
|
|
92
|
-
[HistoryChangedEvent]
|
|
93
|
-
>();
|
|
94
|
-
|
|
95
|
-
public readonly undoStack: HistoryDelta[] = [];
|
|
96
|
-
public readonly redoStack: HistoryDelta[] = [];
|
|
97
|
-
|
|
98
|
-
public get isUndoStackEmpty() {
|
|
99
|
-
return this.undoStack.length === 0;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
public get isRedoStackEmpty() {
|
|
103
|
-
return this.redoStack.length === 0;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
constructor(private readonly store: Store) {}
|
|
107
|
-
|
|
108
|
-
public clear() {
|
|
109
|
-
this.undoStack.length = 0;
|
|
110
|
-
this.redoStack.length = 0;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Record a non-empty local durable increment, which will go into the undo stack..
|
|
115
|
-
* Do not re-record history entries, which were already pushed to undo / redo stack, as part of history action.
|
|
116
|
-
*/
|
|
117
|
-
public record(delta: StoreDelta) {
|
|
118
|
-
if (delta.isEmpty() || delta instanceof HistoryDelta) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// construct history entry, so once it's emitted, it's not recorded again
|
|
123
|
-
const historyDelta = HistoryDelta.inverse(delta);
|
|
124
|
-
|
|
125
|
-
this.undoStack.push(historyDelta);
|
|
126
|
-
|
|
127
|
-
if (!historyDelta.elements.isEmpty()) {
|
|
128
|
-
// don't reset redo stack on local appState changes,
|
|
129
|
-
// as a simple click (unselect) could lead to losing all the redo entries
|
|
130
|
-
// only reset on non empty elements changes!
|
|
131
|
-
this.redoStack.length = 0;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
this.onHistoryChangedEmitter.trigger(
|
|
135
|
-
new HistoryChangedEvent(this.isUndoStackEmpty, this.isRedoStackEmpty),
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
public undo(elements: SceneElementsMap, appState: AppState) {
|
|
140
|
-
return this.perform(
|
|
141
|
-
elements,
|
|
142
|
-
appState,
|
|
143
|
-
() => History.pop(this.undoStack),
|
|
144
|
-
(entry: HistoryDelta) => History.push(this.redoStack, entry),
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
public redo(elements: SceneElementsMap, appState: AppState) {
|
|
149
|
-
return this.perform(
|
|
150
|
-
elements,
|
|
151
|
-
appState,
|
|
152
|
-
() => History.pop(this.redoStack),
|
|
153
|
-
(entry: HistoryDelta) => History.push(this.undoStack, entry),
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
private perform(
|
|
158
|
-
elements: SceneElementsMap,
|
|
159
|
-
appState: AppState,
|
|
160
|
-
pop: () => HistoryDelta | null,
|
|
161
|
-
push: (entry: HistoryDelta) => void,
|
|
162
|
-
): [SceneElementsMap, AppState] | void {
|
|
163
|
-
try {
|
|
164
|
-
let historyDelta = pop();
|
|
165
|
-
|
|
166
|
-
if (historyDelta === null) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const action = CaptureUpdateAction.IMMEDIATELY;
|
|
171
|
-
|
|
172
|
-
let prevSnapshot = this.store.snapshot;
|
|
173
|
-
|
|
174
|
-
let nextElements = elements;
|
|
175
|
-
let nextAppState = appState;
|
|
176
|
-
let containsVisibleChange = false;
|
|
177
|
-
|
|
178
|
-
// iterate through the history entries in case they result in no visible changes
|
|
179
|
-
while (historyDelta) {
|
|
180
|
-
try {
|
|
181
|
-
[nextElements, nextAppState, containsVisibleChange] =
|
|
182
|
-
historyDelta.applyTo(nextElements, nextAppState, prevSnapshot);
|
|
183
|
-
|
|
184
|
-
const prevElements = prevSnapshot.elements;
|
|
185
|
-
const nextSnapshot = prevSnapshot.maybeClone(
|
|
186
|
-
action,
|
|
187
|
-
nextElements,
|
|
188
|
-
nextAppState,
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
const change = StoreChange.create(prevSnapshot, nextSnapshot);
|
|
192
|
-
const delta = HistoryDelta.applyLatestChanges(
|
|
193
|
-
historyDelta,
|
|
194
|
-
prevElements,
|
|
195
|
-
nextElements,
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
if (!delta.isEmpty()) {
|
|
199
|
-
// schedule immediate capture, so that it's emitted for the sync purposes
|
|
200
|
-
this.store.scheduleMicroAction({
|
|
201
|
-
action,
|
|
202
|
-
change,
|
|
203
|
-
delta,
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
historyDelta = delta;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
prevSnapshot = nextSnapshot;
|
|
210
|
-
} finally {
|
|
211
|
-
push(historyDelta);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (containsVisibleChange) {
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
historyDelta = pop();
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return [nextElements, nextAppState];
|
|
222
|
-
} finally {
|
|
223
|
-
// trigger the history change event before returning completely
|
|
224
|
-
// also trigger it just once, no need doing so on each entry
|
|
225
|
-
this.onHistoryChangedEmitter.trigger(
|
|
226
|
-
new HistoryChangedEvent(this.isUndoStackEmpty, this.isRedoStackEmpty),
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
private static pop(stack: HistoryDelta[]): HistoryDelta | null {
|
|
232
|
-
if (!stack.length) {
|
|
233
|
-
return null;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const entry = stack.pop();
|
|
237
|
-
|
|
238
|
-
if (entry !== undefined) {
|
|
239
|
-
return entry;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
private static push(stack: HistoryDelta[], entry: HistoryDelta) {
|
|
246
|
-
const inversedEntry = HistoryDelta.inverse(entry);
|
|
247
|
-
return stack.push(inversedEntry);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
File without changes
|