@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.
Files changed (96) hide show
  1. package/README.md +8 -12
  2. package/dist/dev/{chunk-23ZG3JRJ.js → chunk-UV7ECD7A.js} +17 -4
  3. package/dist/dev/chunk-UV7ECD7A.js.map +7 -0
  4. package/dist/dev/chunk-X2WWSILD.js +7 -0
  5. package/dist/dev/chunk-X2WWSILD.js.map +7 -0
  6. package/dist/dev/data/{image-D63IS3GP.js → image-H4O52A73.js} +3 -3
  7. package/dist/dev/index.css +1355 -0
  8. package/dist/dev/index.css.map +3 -3
  9. package/dist/dev/index.js +2881 -1233
  10. package/dist/dev/index.js.map +4 -4
  11. package/dist/dev/subset-shared.chunk.js +1 -1
  12. package/dist/dev/subset-worker.chunk.js +1 -1
  13. package/dist/prod/{chunk-6XBRNJFC.js → chunk-DOJFO2UO.js} +3 -3
  14. package/dist/prod/{chunk-TDN63PPO.js → chunk-O3WJMHIE.js} +1 -1
  15. package/dist/prod/data/image-43FV5SMF.js +1 -0
  16. package/dist/prod/index.css +2 -1
  17. package/dist/prod/index.js +28 -28
  18. package/dist/prod/subset-shared.chunk.js +1 -1
  19. package/dist/prod/subset-worker.chunk.js +1 -1
  20. package/dist/types/element/src/arrows/focus.d.ts +1 -1
  21. package/dist/types/element/src/binding.d.ts +3 -3
  22. package/dist/types/element/src/bounds.d.ts +1 -1
  23. package/dist/types/element/src/collision.d.ts +1 -1
  24. package/dist/types/element/src/delta.d.ts +2 -2
  25. package/dist/types/element/src/dragElements.d.ts +1 -1
  26. package/dist/types/element/src/duplicate.d.ts +1 -1
  27. package/dist/types/element/src/embeddable.d.ts +1 -1
  28. package/dist/types/element/src/flowchart.d.ts +1 -1
  29. package/dist/types/element/src/frame.d.ts +1 -1
  30. package/dist/types/element/src/groups.d.ts +1 -1
  31. package/dist/types/element/src/renderElement.d.ts +1 -1
  32. package/dist/types/element/src/selection.d.ts +1 -1
  33. package/dist/types/element/src/shape.d.ts +2 -2
  34. package/dist/types/element/src/store.d.ts +2 -2
  35. package/dist/types/element/src/textElement.d.ts +1 -1
  36. package/dist/types/element/src/transform.d.ts +1 -1
  37. package/dist/types/element/src/utils.d.ts +1 -1
  38. package/dist/types/element/src/zindex.d.ts +1 -1
  39. package/dist/types/excalidraw/actions/actionCanvas.d.ts +7 -7
  40. package/dist/types/excalidraw/actions/actionExport.d.ts +9 -9
  41. package/dist/types/excalidraw/actions/actionProperties.d.ts +1 -1
  42. package/dist/types/excalidraw/appState.d.ts +4 -4
  43. package/dist/types/excalidraw/components/AIChatPanel.d.ts +10 -0
  44. package/dist/types/excalidraw/components/Actions.d.ts +1 -1
  45. package/dist/types/excalidraw/components/App.d.ts +13 -2
  46. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +2 -2
  47. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +1 -1
  48. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
  49. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +1 -1
  50. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +2 -2
  51. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
  52. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +1 -1
  53. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +1 -1
  54. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +1 -1
  55. package/dist/types/excalidraw/components/ImageExportDialog.d.ts +1 -1
  56. package/dist/types/excalidraw/components/ImageGeneratorPanel.d.ts +38 -0
  57. package/dist/types/excalidraw/components/ImageQuickEditPanel.d.ts +7 -0
  58. package/dist/types/excalidraw/components/JSONExportDialog.d.ts +1 -1
  59. package/dist/types/excalidraw/components/LayerUI.d.ts +1 -1
  60. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
  61. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  62. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  63. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  64. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  65. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +2 -2
  66. package/dist/types/excalidraw/components/ai-chat/agentLoop.d.ts +60 -0
  67. package/dist/types/excalidraw/components/ai-chat/canvasTools.d.ts +288 -0
  68. package/dist/types/excalidraw/components/image-generation/pendingGenerations.d.ts +30 -0
  69. package/dist/types/excalidraw/components/ui/avatar.d.ts +6 -0
  70. package/dist/types/excalidraw/components/ui/button.d.ts +11 -0
  71. package/dist/types/excalidraw/components/ui/chat-container.d.ts +17 -0
  72. package/dist/types/excalidraw/components/ui/code-block.d.ts +16 -0
  73. package/dist/types/excalidraw/components/ui/markdown.d.ts +10 -0
  74. package/dist/types/excalidraw/components/ui/message.d.ts +35 -0
  75. package/dist/types/excalidraw/components/ui/prompt-input.d.ts +28 -0
  76. package/dist/types/excalidraw/components/ui/scroll-button.d.ts +10 -0
  77. package/dist/types/excalidraw/components/ui/select.d.ts +13 -0
  78. package/dist/types/excalidraw/components/ui/textarea.d.ts +3 -0
  79. package/dist/types/excalidraw/components/ui/tooltip.d.ts +7 -0
  80. package/dist/types/excalidraw/data/blob.d.ts +19 -17
  81. package/dist/types/excalidraw/data/json.d.ts +8 -8
  82. package/dist/types/excalidraw/data/library.d.ts +1 -1
  83. package/dist/types/excalidraw/fonts/Fonts.d.ts +2 -2
  84. package/dist/types/excalidraw/i18n.d.ts +1 -1
  85. package/dist/types/excalidraw/index.d.ts +1 -0
  86. package/dist/types/excalidraw/lib/utils.d.ts +2 -0
  87. package/dist/types/excalidraw/types.d.ts +9 -0
  88. package/dist/types/excalidraw/utils/geminiApiKey.d.ts +1 -0
  89. package/package.json +33 -15
  90. package/CHANGELOG.md +0 -34
  91. package/dist/dev/chunk-23ZG3JRJ.js.map +0 -7
  92. package/dist/dev/chunk-L5IYTQZ4.js +0 -7
  93. package/dist/dev/chunk-L5IYTQZ4.js.map +0 -7
  94. package/dist/prod/data/image-H66RFTQG.js +0 -1
  95. package/history.ts +0 -249
  96. /package/dist/dev/data/{image-D63IS3GP.js.map → image-H4O52A73.js.map} +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Excalidraw
1
+ # adgen-canvas
2
2
 
3
- **Excalidraw** is exported as a component to be directly embedded in your project.
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, Excalidraw will try to download all the used fonts from the [CDN](https://esm.run/@orangecatai/adgen-canvas/dist/prod).
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 Excalidraw
27
+ ### Dimensions of adgen-canvas
28
28
 
29
- Excalidraw takes _100%_ of `width` and `height` of the containing block so make sure the container in which you render Excalidraw has non zero dimensions.
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://docs.excalidraw.com/docs/@orangecatai/adgen-canvas/integration).
33
+ Head over to the [docs](https://orangecat.ai).
38
34
 
39
35
  ## API
40
36
 
41
- Head over to the [docs](https://docs.excalidraw.com/docs/@orangecatai/adgen-canvas/api).
37
+ Head over to the [docs](https://orangecat.ai).
42
38
 
43
39
  ## Contributing
44
40
 
45
- Head over to the [docs](https://docs.excalidraw.com/docs/@orangecatai/adgen-canvas/contributing).
41
+ Head over to the [docs](https://orangecat.ai).
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-L5IYTQZ4.js";
3
+ } from "./chunk-X2WWSILD.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 { getCommonBounds as getCommonBounds2, getElementAbsoluteCoords as getElementAbsoluteCoords4 } from "@orangecatai/element";
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-D63IS3GP.js")).decodePngMetadata(blob);
5108
+ return await (await import("./data/image-H4O52A73.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-23ZG3JRJ.js.map
5552
+ //# sourceMappingURL=chunk-UV7ECD7A.js.map