@myoc/excalidraw 0.19.547 → 0.20.0

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 (46) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +94 -0
  3. package/dist/dev/{chunk-6X722ZMM.js → chunk-JAMVC3FK.js} +2 -2
  4. package/dist/dev/{chunk-OWS32STE.js → chunk-SYLLRP5N.js} +5 -5
  5. package/dist/dev/chunk-SYLLRP5N.js.map +7 -0
  6. package/dist/dev/data/{image-SHO5VNS6.js → image-MIDG6L22.js} +3 -3
  7. package/dist/dev/index.css +270 -34
  8. package/dist/dev/index.css.map +3 -3
  9. package/dist/dev/index.js +1510 -1049
  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-U23VT5B7.js → chunk-7YEIEXKT.js} +1 -1
  14. package/dist/prod/chunk-PITW2T2E.js +4 -0
  15. package/dist/prod/data/image-SFMYPR3Z.js +1 -0
  16. package/dist/prod/index.css +1 -1
  17. package/dist/prod/index.js +20 -20
  18. package/dist/prod/subset-shared.chunk.js +1 -1
  19. package/dist/prod/subset-worker.chunk.js +1 -1
  20. package/dist/types/excalidraw/actions/actionArrange.d.ts +1 -1
  21. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  22. package/dist/types/excalidraw/actions/actionFlipViewpoint.d.ts +2 -2
  23. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +2 -2
  24. package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
  25. package/dist/types/excalidraw/actions/actionNormalise.d.ts +1 -1
  26. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
  27. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  28. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -1
  29. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  30. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
  31. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  32. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  33. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  34. package/dist/types/excalidraw/components/Actions.d.ts +3 -1
  35. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  36. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -2
  37. package/dist/types/excalidraw/components/Toolbar.d.ts +2 -1
  38. package/dist/types/excalidraw/components/UIRegionLayout.d.ts +34 -0
  39. package/dist/types/excalidraw/index.d.ts +3 -1
  40. package/dist/types/excalidraw/types.d.ts +37 -0
  41. package/package.json +4 -4
  42. package/dist/dev/chunk-OWS32STE.js.map +0 -7
  43. package/dist/prod/chunk-FZE33ODQ.js +0 -4
  44. package/dist/prod/data/image-ELTE3WZG.js +0 -1
  45. /package/dist/dev/{chunk-6X722ZMM.js.map → chunk-JAMVC3FK.js.map} +0 -0
  46. /package/dist/dev/data/{image-SHO5VNS6.js.map → image-MIDG6L22.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -6485,3 +6485,109 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
6485
6485
 
6486
6486
  ---
6487
6487
 
6488
+ ## Excalidraw Library
6489
+
6490
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
6491
+
6492
+ ### Features
6493
+
6494
+ - Add ability to turn off compression for files that are smaller than a given size
6495
+
6496
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
6497
+
6498
+ - Add view mode button
6499
+
6500
+ - Add multiple image copy paste or drag and drop
6501
+
6502
+ - Multiple image additions from clipboard
6503
+
6504
+ - Add arrange elements action
6505
+
6506
+ - Add top picks to appProps for both stoke color and background color
6507
+
6508
+ ### Fixes
6509
+
6510
+ - Issues
6511
+
6512
+ - Make mobile mode more myoc looking
6513
+
6514
+ - Add normalise functionality
6515
+
6516
+ - Update with excalidraw
6517
+
6518
+ - Fix imports
6519
+
6520
+ - Fix mutateGroup to use scene.mutateGroup
6521
+
6522
+ - Imports
6523
+
6524
+ - Ensure that fileId is different for compressed vs uncompressed file
6525
+
6526
+ - Remove not working prop for dontResizeLimitMBs
6527
+
6528
+ - Add smartview for mobile
6529
+
6530
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
6531
+
6532
+ - Use css vars already provided instead of hard coding directly from oc-gray
6533
+
6534
+ - Remove unused variables
6535
+
6536
+ - Pass the new top pick color props properly
6537
+
6538
+ - Incorrect import for color (was moved to common)
6539
+
6540
+ ---## Excalidraw Library
6541
+
6542
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
6543
+
6544
+ ### Features
6545
+
6546
+ - Add ability to turn off compression for files that are smaller than a given size
6547
+
6548
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
6549
+
6550
+ - Add view mode button
6551
+
6552
+ - Add multiple image copy paste or drag and drop
6553
+
6554
+ - Multiple image additions from clipboard
6555
+
6556
+ - Add arrange elements action
6557
+
6558
+ - Add top picks to appProps for both stoke color and background color
6559
+
6560
+ ### Fixes
6561
+
6562
+ - Issues
6563
+
6564
+ - Make mobile mode more myoc looking
6565
+
6566
+ - Add normalise functionality
6567
+
6568
+ - Update with excalidraw
6569
+
6570
+ - Fix imports
6571
+
6572
+ - Fix mutateGroup to use scene.mutateGroup
6573
+
6574
+ - Imports
6575
+
6576
+ - Ensure that fileId is different for compressed vs uncompressed file
6577
+
6578
+ - Remove not working prop for dontResizeLimitMBs
6579
+
6580
+ - Add smartview for mobile
6581
+
6582
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
6583
+
6584
+ - Use css vars already provided instead of hard coding directly from oc-gray
6585
+
6586
+ - Remove unused variables
6587
+
6588
+ - Pass the new top pick color props properly
6589
+
6590
+ - Incorrect import for color (was moved to common)
6591
+
6592
+ ---
6593
+
package/README.md CHANGED
@@ -41,6 +41,100 @@ export default function App() {
41
41
 
42
42
  Excalidraw fills `100%` of the width and height of its parent. If the parent has no height, the canvas will not be visible.
43
43
 
44
+ ## Responsive UI layout
45
+
46
+ Use `uiLayout` to independently place or hide built-in controls for desktop, tablet, and mobile form factors. Each form factor starts from its current default layout; omitted overrides keep their defaults. The host owns any persistence.
47
+
48
+ The eight physical regions are:
49
+
50
+ ```text
51
+ topLeft topCenter topRight
52
+ middleLeft [canvas] middleRight
53
+ bottomLeft bottomCenter bottomRight
54
+ ```
55
+
56
+ ```tsx
57
+ import {
58
+ arrowsToEyeIcon,
59
+ Excalidraw,
60
+ RedoIcon,
61
+ UndoIcon,
62
+ } from "@myoc/excalidraw";
63
+ import type { ExcalidrawUICustomItem } from "@myoc/excalidraw";
64
+
65
+ const historyAndZoom: ExcalidrawUICustomItem = {
66
+ id: "host-history-and-zoom",
67
+ region: "bottomLeft" as const,
68
+ render: ({ api }) => (
69
+ <div style={{ display: "flex", gap: 8 }}>
70
+ <button
71
+ aria-label="Undo"
72
+ onClick={() => api.executeCommand("action:undo")}
73
+ >
74
+ <span className="host-tool-icon">{UndoIcon}</span>
75
+ </button>
76
+ <button
77
+ aria-label="Redo"
78
+ onClick={() => api.executeCommand("action:redo")}
79
+ >
80
+ <span className="host-tool-icon">{RedoIcon}</span>
81
+ </button>
82
+ <button
83
+ aria-label="Smart Zoom"
84
+ onClick={() => api.executeCommand("action:smartZoom")}
85
+ >
86
+ <span className="host-tool-icon">{arrowsToEyeIcon}</span>
87
+ </button>
88
+ </div>
89
+ ),
90
+ };
91
+
92
+ export function Editor() {
93
+ return (
94
+ <Excalidraw
95
+ uiLayout={{
96
+ desktop: {
97
+ items: {
98
+ toolbar: { region: "middleLeft" },
99
+ undo: { visible: false },
100
+ redo: { visible: false },
101
+ zoom: { visible: false },
102
+ },
103
+ customItems: [historyAndZoom],
104
+ },
105
+ tablet: {
106
+ items: { toolbar: { region: "topLeft" } },
107
+ },
108
+ mobile: {
109
+ items: {
110
+ toolbar: { region: "bottomLeft" },
111
+ undo: { visible: false },
112
+ redo: { visible: false },
113
+ zoom: { visible: false },
114
+ },
115
+ customItems: [historyAndZoom],
116
+ },
117
+ }}
118
+ />
119
+ );
120
+ }
121
+ ```
122
+
123
+ Import `ExcalidrawUICustomItem` or `ExcalidrawImperativeAPI` from the package for the callback type. A custom item receives the API, current UI state and editor form factor, its resolved region, and its resolved orientation. The region names use physical left and right edges. Top and bottom regions arrange controls horizontally by default; middle side regions arrange them vertically. Set `orientation` to override the suggestion. Hiding a built-in control only hides its button; the matching keyboard shortcut and imperative command remain available.
124
+
125
+ The existing icons are also available as named exports from the package root. Most are React SVG elements, so render them as children (for example, `{UndoIcon}`) and size them with a host-owned class:
126
+
127
+ ```css
128
+ .host-tool-icon,
129
+ .host-tool-icon svg {
130
+ display: inline-flex;
131
+ width: 20px;
132
+ height: 20px;
133
+ }
134
+ ```
135
+
136
+ The host owns the surrounding button styles, accessible label, and command behavior. Theme-aware icons such as `GroupIcon` are React components and accept their documented props.
137
+
44
138
  ## Next.js / SSR frameworks
45
139
 
46
140
  Excalidraw should be rendered on the client. In SSR frameworks such as Next.js, use a client component and load it dynamically with SSR disabled.
@@ -1,7 +1,7 @@
1
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: "@myoc/excalidraw", PKG_VERSION: "0.19.546", DEV: true };
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: "@myoc/excalidraw", PKG_VERSION: "0.19.548", DEV: true };
3
3
 
4
4
  export {
5
5
  define_import_meta_env_default
6
6
  };
7
- //# sourceMappingURL=chunk-6X722ZMM.js.map
7
+ //# sourceMappingURL=chunk-JAMVC3FK.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-6X722ZMM.js";
3
+ } from "./chunk-JAMVC3FK.js";
4
4
  import {
5
5
  __publicField
6
6
  } from "./chunk-XDFCUUT6.js";
@@ -22,7 +22,6 @@ import {
22
22
 
23
23
  // appState.ts
24
24
  import {
25
- COLOR_PALETTE,
26
25
  ARROW_TYPE,
27
26
  DEFAULT_ELEMENT_PROPS,
28
27
  DEFAULT_FONT_FAMILY,
@@ -138,7 +137,8 @@ var getDefaultAppState = () => {
138
137
  editingFrame: null,
139
138
  elementsToHighlight: null,
140
139
  toast: null,
141
- viewBackgroundColor: COLOR_PALETTE.white,
140
+ // Let host applications provide the visible canvas backdrop.
141
+ viewBackgroundColor: "transparent",
142
142
  zenModeEnabled: false,
143
143
  zoom: {
144
144
  value: 1
@@ -5455,7 +5455,7 @@ var parseFileContents = async (blob) => {
5455
5455
  let contents;
5456
5456
  if (blob.type === MIME_TYPES6.png) {
5457
5457
  try {
5458
- return await (await import("./data/image-SHO5VNS6.js")).decodePngMetadata(blob);
5458
+ return await (await import("./data/image-MIDG6L22.js")).decodePngMetadata(blob);
5459
5459
  } catch (error) {
5460
5460
  if (error.message === "INVALID") {
5461
5461
  throw new ImageSceneDataError(
@@ -5906,4 +5906,4 @@ export {
5906
5906
  createFile,
5907
5907
  normalizeFile
5908
5908
  };
5909
- //# sourceMappingURL=chunk-OWS32STE.js.map
5909
+ //# sourceMappingURL=chunk-SYLLRP5N.js.map