@orangecatai/adgen-canvas 0.0.5 → 0.0.7
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-3FGOYDLK.js → chunk-2Q3FNCU4.js} +44 -3
- package/dist/dev/chunk-2Q3FNCU4.js.map +7 -0
- package/dist/dev/{chunk-IRIUFXMO.js → chunk-MW637LK5.js} +2 -2
- package/dist/dev/data/{image-HH4XNQRO.js → image-L2UC5LX5.js} +3 -3
- package/dist/dev/index.css +909 -27
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +6595 -2561
- 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-SG4RCQVC.js → chunk-7AVPHWG7.js} +1 -1
- package/dist/prod/{chunk-LUZI7MFZ.js → chunk-XPV36KCI.js} +3 -3
- package/dist/prod/data/image-6DWEFZH4.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +342 -85
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/components/AIChatPanel.d.ts +26 -0
- package/dist/types/excalidraw/components/CanvasBackgroundSwatch.d.ts +7 -0
- package/dist/types/excalidraw/components/ColorPicker/AdvancedColorPicker.d.ts +8 -0
- package/dist/types/excalidraw/components/ColorPicker/colorConversions.d.ts +27 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/ElementCanvasButtons.d.ts +1 -1
- package/dist/types/excalidraw/components/FrameToolbar.d.ts +1 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +1 -1
- package/dist/types/excalidraw/components/ImageEditToolbar.d.ts +15 -0
- package/dist/types/excalidraw/components/ImageQuickEditPanel.d.ts +5 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/index.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +1 -0
- package/dist/types/excalidraw/components/ToolButton.d.ts +1 -1
- package/dist/types/excalidraw/components/ai-chat/agentLoop.d.ts +16 -1
- package/dist/types/excalidraw/components/ai-chat/audioUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ai-chat/canvasTools.d.ts +236 -1
- package/dist/types/excalidraw/components/ai-chat/htmlToExcalidraw.d.ts +53 -0
- package/dist/types/excalidraw/components/ai-chat/openRouterStream.d.ts +50 -0
- package/dist/types/excalidraw/components/auto-resize/AutoResizePanel.d.ts +16 -0
- package/dist/types/excalidraw/components/auto-resize/AutoResizeShimmerLayer.d.ts +7 -0
- package/dist/types/excalidraw/components/auto-resize/autoResizeEngine.d.ts +89 -0
- package/dist/types/excalidraw/components/auto-resize/autoResizeStore.d.ts +16 -0
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +1 -1
- package/dist/types/excalidraw/components/icons.d.ts +1 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -1
- package/dist/types/excalidraw/components/ui/button.d.ts +1 -1
- package/dist/types/excalidraw/fonts/Fonts.d.ts +11 -0
- package/dist/types/excalidraw/index.d.ts +2 -0
- package/dist/types/excalidraw/types.d.ts +138 -0
- package/dist/types/excalidraw/utils/leonardoApiKey.d.ts +1 -0
- package/dist/types/excalidraw/utils/removeBgApiKey.d.ts +1 -0
- package/package.json +1 -1
- package/dist/dev/chunk-3FGOYDLK.js.map +0 -7
- package/dist/prod/data/image-J2ZJZU4A.js +0 -1
- /package/dist/dev/{chunk-IRIUFXMO.js.map → chunk-MW637LK5.js.map} +0 -0
- /package/dist/dev/data/{image-HH4XNQRO.js.map → image-L2UC5LX5.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MW637LK5.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -2891,6 +2891,35 @@ var _Fonts = class _Fonts {
|
|
|
2891
2891
|
get registered() {
|
|
2892
2892
|
return _Fonts.registered;
|
|
2893
2893
|
}
|
|
2894
|
+
/**
|
|
2895
|
+
* Register a custom font from a URL into the canvas font system.
|
|
2896
|
+
*
|
|
2897
|
+
* Use family IDs >= 1000 to avoid collisions with built-in fonts.
|
|
2898
|
+
*
|
|
2899
|
+
* Note: custom fonts are registered without a weight/style descriptor
|
|
2900
|
+
* because getFontString generates "${size}px ${familyName}" (no weight),
|
|
2901
|
+
* so the browser always requests the normal-weight variant. Pass the font
|
|
2902
|
+
* file that should render by default for this family ID.
|
|
2903
|
+
*/
|
|
2904
|
+
static registerCustomFont(spec) {
|
|
2905
|
+
const { familyId, name, url } = spec;
|
|
2906
|
+
if (!_Fonts._registered) {
|
|
2907
|
+
_Fonts._registered = /* @__PURE__ */ new Map();
|
|
2908
|
+
}
|
|
2909
|
+
if (_Fonts._registered.has(familyId)) {
|
|
2910
|
+
return;
|
|
2911
|
+
}
|
|
2912
|
+
const fontFace = new ExcalidrawFontFace(name, url);
|
|
2913
|
+
const metadata = {
|
|
2914
|
+
metrics: {
|
|
2915
|
+
unitsPerEm: 1e3,
|
|
2916
|
+
ascender: 1011,
|
|
2917
|
+
descender: -353,
|
|
2918
|
+
lineHeight: 1.364
|
|
2919
|
+
}
|
|
2920
|
+
};
|
|
2921
|
+
_Fonts._registered.set(familyId, { metadata, fontFaces: [fontFace] });
|
|
2922
|
+
}
|
|
2894
2923
|
/**
|
|
2895
2924
|
* Generate CSS @font-face declarations for the given elements.
|
|
2896
2925
|
*/
|
|
@@ -5105,7 +5134,7 @@ var parseFileContents = async (blob) => {
|
|
|
5105
5134
|
let contents;
|
|
5106
5135
|
if (blob.type === MIME_TYPES6.png) {
|
|
5107
5136
|
try {
|
|
5108
|
-
return await (await import("./data/image-
|
|
5137
|
+
return await (await import("./data/image-L2UC5LX5.js")).decodePngMetadata(blob);
|
|
5109
5138
|
} catch (error) {
|
|
5110
5139
|
if (error.message === "INVALID") {
|
|
5111
5140
|
throw new ImageSceneDataError(
|
|
@@ -5298,6 +5327,17 @@ var getMimeTypeFromDataURL = (dataURL) => {
|
|
|
5298
5327
|
const mimeType = header.split(":")[1]?.split(";")[0]?.trim();
|
|
5299
5328
|
return isSupportedImageFileType(mimeType) ? mimeType : MIME_TYPES6.png;
|
|
5300
5329
|
};
|
|
5330
|
+
var dataURLToFile = (dataURL, filename = "") => {
|
|
5331
|
+
const dataIndexStart = dataURL.indexOf(",");
|
|
5332
|
+
const byteString = atob(dataURL.slice(dataIndexStart + 1));
|
|
5333
|
+
const mimeType = getMimeTypeFromDataURL(dataURL);
|
|
5334
|
+
const ab = new ArrayBuffer(byteString.length);
|
|
5335
|
+
const ia = new Uint8Array(ab);
|
|
5336
|
+
for (let i = 0; i < byteString.length; i++) {
|
|
5337
|
+
ia[i] = byteString.charCodeAt(i);
|
|
5338
|
+
}
|
|
5339
|
+
return new File([ab], filename, { type: mimeType });
|
|
5340
|
+
};
|
|
5301
5341
|
var dataURLToString = (dataURL) => {
|
|
5302
5342
|
return base64ToString(dataURL.slice(dataURL.indexOf(",") + 1));
|
|
5303
5343
|
};
|
|
@@ -5541,6 +5581,7 @@ export {
|
|
|
5541
5581
|
getDataURL,
|
|
5542
5582
|
getDataURL_sync,
|
|
5543
5583
|
getMimeTypeFromDataURL,
|
|
5584
|
+
dataURLToFile,
|
|
5544
5585
|
dataURLToString,
|
|
5545
5586
|
resizeImageFile,
|
|
5546
5587
|
SVGStringToFile,
|
|
@@ -5549,4 +5590,4 @@ export {
|
|
|
5549
5590
|
createFile,
|
|
5550
5591
|
normalizeFile
|
|
5551
5592
|
};
|
|
5552
|
-
//# sourceMappingURL=chunk-
|
|
5593
|
+
//# sourceMappingURL=chunk-2Q3FNCU4.js.map
|