@orangecatai/adgen-canvas 0.0.1 → 0.0.3
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-EP27W34X.js +7 -0
- package/dist/dev/chunk-EP27W34X.js.map +7 -0
- package/dist/dev/{chunk-23ZG3JRJ.js → chunk-YOQUQ6O5.js} +17 -4
- package/dist/dev/chunk-YOQUQ6O5.js.map +7 -0
- package/dist/dev/data/{image-D63IS3GP.js → image-IZS5VEYX.js} +3 -3
- package/dist/dev/index.css +2086 -0
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +5175 -1599
- 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-2ALGWY4R.js} +3 -3
- package/dist/prod/{chunk-TDN63PPO.js → chunk-I4SUBR2Z.js} +1 -1
- package/dist/prod/data/image-PKF4YK4A.js +1 -0
- package/dist/prod/index.css +2 -1
- package/dist/prod/index.js +74 -29
- 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 +3 -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-IZS5VEYX.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# adgen-canvas
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**adgen-canvas** is [OrangeCat](https://orangecat.ai)'s canvas component, forked from [Excalidraw](https://excalidraw.com). It is exported as a React component to be directly embedded in your project.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ yarn add react react-dom @orangecatai/adgen-canvas
|
|
|
16
16
|
|
|
17
17
|
#### Self-hosting fonts
|
|
18
18
|
|
|
19
|
-
By default,
|
|
19
|
+
By default, adgen-canvas will try to download all the used fonts from the [CDN](https://esm.run/@orangecatai/adgen-canvas/dist/prod).
|
|
20
20
|
|
|
21
21
|
For self-hosting purposes, you'll have to copy the content of the folder `node_modules/@orangecatai/adgen-canvas/dist/prod/fonts` to the path where your assets should be served from (i.e. `public/` directory in your project). In that case, you should also set `window.EXCALIDRAW_ASSET_PATH` to the very same path, i.e. `/` in case it's in the root:
|
|
22
22
|
|
|
@@ -24,22 +24,18 @@ For self-hosting purposes, you'll have to copy the content of the folder `node_m
|
|
|
24
24
|
<script>window.EXCALIDRAW_ASSET_PATH = "/";</script>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
### Dimensions of
|
|
27
|
+
### Dimensions of adgen-canvas
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Demo
|
|
32
|
-
|
|
33
|
-
Go to [CodeSandbox](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/master/examples/with-script-in-browser) example.
|
|
29
|
+
adgen-canvas takes _100%_ of `width` and `height` of the containing block so make sure the container in which you render adgen-canvas has non zero dimensions.
|
|
34
30
|
|
|
35
31
|
## Integration
|
|
36
32
|
|
|
37
|
-
Head over to the [docs](https://
|
|
33
|
+
Head over to the [docs](https://orangecat.ai).
|
|
38
34
|
|
|
39
35
|
## API
|
|
40
36
|
|
|
41
|
-
Head over to the [docs](https://
|
|
37
|
+
Head over to the [docs](https://orangecat.ai).
|
|
42
38
|
|
|
43
39
|
## Contributing
|
|
44
40
|
|
|
45
|
-
Head over to the [docs](https://
|
|
41
|
+
Head over to the [docs](https://orangecat.ai).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// <define:import.meta.env>
|
|
2
|
+
var define_import_meta_env_default = { MODE: "development", VITE_APP_GEMINI_API_KEY: "", VITE_APP_OPENROUTER_API_KEY: "", 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.3", DEV: true };
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
define_import_meta_env_default
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=chunk-EP27W34X.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["<define:import.meta.env>"],
|
|
4
|
+
"sourcesContent": [""],
|
|
5
|
+
"mappings": ";AAAA,uCAAC,MAAO,eAAc,yBAA0B,IAAG,6BAA8B,IAAG,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,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EP27W34X.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -449,7 +449,10 @@ import {
|
|
|
449
449
|
toBrandedType,
|
|
450
450
|
applyDarkModeFilter as applyDarkModeFilter4
|
|
451
451
|
} from "@orangecatai/common";
|
|
452
|
-
import {
|
|
452
|
+
import {
|
|
453
|
+
getCommonBounds as getCommonBounds2,
|
|
454
|
+
getElementAbsoluteCoords as getElementAbsoluteCoords4
|
|
455
|
+
} from "@orangecatai/element";
|
|
453
456
|
import {
|
|
454
457
|
getInitializedImageElements,
|
|
455
458
|
updateImageCache
|
|
@@ -5102,7 +5105,7 @@ var parseFileContents = async (blob) => {
|
|
|
5102
5105
|
let contents;
|
|
5103
5106
|
if (blob.type === MIME_TYPES6.png) {
|
|
5104
5107
|
try {
|
|
5105
|
-
return await (await import("./data/image-
|
|
5108
|
+
return await (await import("./data/image-IZS5VEYX.js")).decodePngMetadata(blob);
|
|
5106
5109
|
} catch (error) {
|
|
5107
5110
|
if (error.message === "INVALID") {
|
|
5108
5111
|
throw new ImageSceneDataError(
|
|
@@ -5286,6 +5289,15 @@ var getDataURL_sync = (data, mimeType) => {
|
|
|
5286
5289
|
true
|
|
5287
5290
|
)}`;
|
|
5288
5291
|
};
|
|
5292
|
+
var getMimeTypeFromDataURL = (dataURL) => {
|
|
5293
|
+
const dataIndexStart = dataURL.indexOf(",");
|
|
5294
|
+
if (dataIndexStart < 0) {
|
|
5295
|
+
return MIME_TYPES6.png;
|
|
5296
|
+
}
|
|
5297
|
+
const header = dataURL.slice(0, dataIndexStart);
|
|
5298
|
+
const mimeType = header.split(":")[1]?.split(";")[0]?.trim();
|
|
5299
|
+
return isSupportedImageFileType(mimeType) ? mimeType : MIME_TYPES6.png;
|
|
5300
|
+
};
|
|
5289
5301
|
var dataURLToString = (dataURL) => {
|
|
5290
5302
|
return base64ToString(dataURL.slice(dataURL.indexOf(",") + 1));
|
|
5291
5303
|
};
|
|
@@ -5528,6 +5540,7 @@ export {
|
|
|
5528
5540
|
generateIdFromFile,
|
|
5529
5541
|
getDataURL,
|
|
5530
5542
|
getDataURL_sync,
|
|
5543
|
+
getMimeTypeFromDataURL,
|
|
5531
5544
|
dataURLToString,
|
|
5532
5545
|
resizeImageFile,
|
|
5533
5546
|
SVGStringToFile,
|
|
@@ -5536,4 +5549,4 @@ export {
|
|
|
5536
5549
|
createFile,
|
|
5537
5550
|
normalizeFile
|
|
5538
5551
|
};
|
|
5539
|
-
//# sourceMappingURL=chunk-
|
|
5552
|
+
//# sourceMappingURL=chunk-YOQUQ6O5.js.map
|