@myoc/excalidraw 0.19.516 → 0.19.518

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/CHANGELOG.md CHANGED
@@ -4601,4 +4601,163 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4601
4601
  - Incorrect import for color (was moved to common)
4602
4602
 
4603
4603
  ---
4604
+ ## Excalidraw Library
4605
+
4606
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
4607
+
4608
+ ### Features
4609
+
4610
+ - Add ability to turn off compression for files that are smaller than a given size
4611
+
4612
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
4613
+
4614
+ - Add view mode button
4615
+
4616
+ - Add multiple image copy paste or drag and drop
4617
+
4618
+ - Multiple image additions from clipboard
4619
+
4620
+ - Add arrange elements action
4621
+
4622
+ - Add top picks to appProps for both stoke color and background color
4623
+
4624
+ ### Fixes
4625
+
4626
+ - Issues
4627
+
4628
+ - Make mobile mode more myoc looking
4629
+
4630
+ - Add normalise functionality
4631
+
4632
+ - Update with excalidraw
4633
+
4634
+ - Fix imports
4635
+
4636
+ - Fix mutateGroup to use scene.mutateGroup
4637
+
4638
+ - Imports
4639
+
4640
+ - Ensure that fileId is different for compressed vs uncompressed file
4641
+
4642
+ - Remove not working prop for dontResizeLimitMBs
4643
+
4644
+ - Add smartview for mobile
4645
+
4646
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
4647
+
4648
+ - Use css vars already provided instead of hard coding directly from oc-gray
4649
+
4650
+ - Remove unused variables
4651
+
4652
+ - Pass the new top pick color props properly
4653
+
4654
+ - Incorrect import for color (was moved to common)
4655
+
4656
+ ---
4657
+ ## Excalidraw Library
4658
+
4659
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
4660
+
4661
+ ### Features
4662
+
4663
+ - Add ability to turn off compression for files that are smaller than a given size
4664
+
4665
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
4666
+
4667
+ - Add view mode button
4668
+
4669
+ - Add multiple image copy paste or drag and drop
4670
+
4671
+ - Multiple image additions from clipboard
4672
+
4673
+ - Add arrange elements action
4674
+
4675
+ - Add top picks to appProps for both stoke color and background color
4676
+
4677
+ ### Fixes
4678
+
4679
+ - Issues
4680
+
4681
+ - Make mobile mode more myoc looking
4682
+
4683
+ - Add normalise functionality
4684
+
4685
+ - Update with excalidraw
4686
+
4687
+ - Fix imports
4688
+
4689
+ - Fix mutateGroup to use scene.mutateGroup
4690
+
4691
+ - Imports
4692
+
4693
+ - Ensure that fileId is different for compressed vs uncompressed file
4694
+
4695
+ - Remove not working prop for dontResizeLimitMBs
4696
+
4697
+ - Add smartview for mobile
4698
+
4699
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
4700
+
4701
+ - Use css vars already provided instead of hard coding directly from oc-gray
4702
+
4703
+ - Remove unused variables
4704
+
4705
+ - Pass the new top pick color props properly
4706
+
4707
+ - Incorrect import for color (was moved to common)
4708
+
4709
+ ---
4710
+ ## Excalidraw Library
4711
+
4712
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
4713
+
4714
+ ### Features
4715
+
4716
+ - Add ability to turn off compression for files that are smaller than a given size
4717
+
4718
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
4719
+
4720
+ - Add view mode button
4721
+
4722
+ - Add multiple image copy paste or drag and drop
4723
+
4724
+ - Multiple image additions from clipboard
4725
+
4726
+ - Add arrange elements action
4727
+
4728
+ - Add top picks to appProps for both stoke color and background color
4729
+
4730
+ ### Fixes
4731
+
4732
+ - Issues
4733
+
4734
+ - Make mobile mode more myoc looking
4735
+
4736
+ - Add normalise functionality
4737
+
4738
+ - Update with excalidraw
4739
+
4740
+ - Fix imports
4741
+
4742
+ - Fix mutateGroup to use scene.mutateGroup
4743
+
4744
+ - Imports
4745
+
4746
+ - Ensure that fileId is different for compressed vs uncompressed file
4747
+
4748
+ - Remove not working prop for dontResizeLimitMBs
4749
+
4750
+ - Add smartview for mobile
4751
+
4752
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
4753
+
4754
+ - Use css vars already provided instead of hard coding directly from oc-gray
4755
+
4756
+ - Remove unused variables
4757
+
4758
+ - Pass the new top pick color props properly
4759
+
4760
+ - Incorrect import for color (was moved to common)
4761
+
4762
+ ---
4604
4763
 
@@ -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.515", 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.517", DEV: true };
3
3
 
4
4
  export {
5
5
  define_import_meta_env_default
6
6
  };
7
- //# sourceMappingURL=chunk-IBY5YU6S.js.map
7
+ //# sourceMappingURL=chunk-2ZDXTNY7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-IBY5YU6S.js";
3
+ } from "./chunk-2ZDXTNY7.js";
4
4
  import {
5
5
  __publicField
6
6
  } from "./chunk-XDFCUUT6.js";
@@ -5102,7 +5102,7 @@ var parseFileContents = async (blob) => {
5102
5102
  let contents;
5103
5103
  if (blob.type === MIME_TYPES6.png) {
5104
5104
  try {
5105
- return await (await import("./data/image-VSXYAV2C.js")).decodePngMetadata(blob);
5105
+ return await (await import("./data/image-VHQDH63K.js")).decodePngMetadata(blob);
5106
5106
  } catch (error) {
5107
5107
  if (error.message === "INVALID") {
5108
5108
  throw new ImageSceneDataError(
@@ -5463,4 +5463,4 @@ export {
5463
5463
  createFile,
5464
5464
  normalizeFile
5465
5465
  };
5466
- //# sourceMappingURL=chunk-YWH5H56B.js.map
5466
+ //# sourceMappingURL=chunk-36IX6I7U.js.map
@@ -2,12 +2,12 @@ import {
2
2
  decodePngMetadata,
3
3
  encodePngMetadata,
4
4
  getTEXtChunk
5
- } from "../chunk-YWH5H56B.js";
6
- import "../chunk-IBY5YU6S.js";
5
+ } from "../chunk-36IX6I7U.js";
6
+ import "../chunk-2ZDXTNY7.js";
7
7
  import "../chunk-XDFCUUT6.js";
8
8
  export {
9
9
  decodePngMetadata,
10
10
  encodePngMetadata,
11
11
  getTEXtChunk
12
12
  };
13
- //# sourceMappingURL=image-VSXYAV2C.js.map
13
+ //# sourceMappingURL=image-VHQDH63K.js.map
package/dist/dev/index.js CHANGED
@@ -57,10 +57,10 @@ import {
57
57
  saveAsJSON,
58
58
  serializeAsJSON,
59
59
  strokeRectWithRotation_simple
60
- } from "./chunk-YWH5H56B.js";
60
+ } from "./chunk-36IX6I7U.js";
61
61
  import {
62
62
  define_import_meta_env_default
63
- } from "./chunk-IBY5YU6S.js";
63
+ } from "./chunk-2ZDXTNY7.js";
64
64
  import {
65
65
  en_default
66
66
  } from "./chunk-ZGRXNVW4.js";
@@ -9611,7 +9611,7 @@ var exportCanvas = async (type, elements, appState, files, {
9611
9611
  let blob = canvasToBlob(tempCanvas);
9612
9612
  if (appState.exportEmbedScene) {
9613
9613
  blob = blob.then(
9614
- (blob2) => import("./data/image-VSXYAV2C.js").then(
9614
+ (blob2) => import("./data/image-VHQDH63K.js").then(
9615
9615
  ({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
9616
9616
  blob: blob2,
9617
9617
  metadata: serializeAsJSON(elements, appState, files, "local")
@@ -36103,6 +36103,7 @@ var App = class _App extends React40.Component {
36103
36103
  {
36104
36104
  mimeType,
36105
36105
  id: fileId,
36106
+ fileName,
36106
36107
  dataURL,
36107
36108
  created: Date.now(),
36108
36109
  lastRetrieved: Date.now()
@@ -36368,14 +36369,78 @@ var App = class _App extends React40.Component {
36368
36369
  }
36369
36370
  }
36370
36371
  const imageFiles = fileItems.map((data) => data.file).filter((file2) => isSupportedImageFile(file2));
36371
- if (imageFiles.length > 0 && this.isToolSupported("image")) {
36372
- return this.insertImages(
36373
- imageFiles.map((file2) => ({
36374
- file: file2
36375
- })),
36376
- sceneX,
36377
- sceneY
36378
- );
36372
+ if (imageFiles.length > 0) {
36373
+ if (this.isToolSupported("image")) {
36374
+ const parseDroppedImageDetails = () => {
36375
+ const htmlImageSources = [];
36376
+ const textImageSources = [];
36377
+ const imageAlts = [];
36378
+ const pushUnique = (values, value) => {
36379
+ const trimmedValue = value?.trim();
36380
+ if (trimmedValue && !values.includes(trimmedValue)) {
36381
+ values.push(trimmedValue);
36382
+ }
36383
+ };
36384
+ dataTransferList.forEach((item) => {
36385
+ if (item.kind !== "string") {
36386
+ return;
36387
+ }
36388
+ if (item.type === MIME_TYPES7.html) {
36389
+ try {
36390
+ const doc = new DOMParser().parseFromString(
36391
+ item.value,
36392
+ MIME_TYPES7.html
36393
+ );
36394
+ for (const img of Array.from(
36395
+ doc.body.querySelectorAll("img")
36396
+ )) {
36397
+ pushUnique(htmlImageSources, img.getAttribute("src"));
36398
+ pushUnique(imageAlts, img.getAttribute("alt"));
36399
+ }
36400
+ } catch {
36401
+ }
36402
+ } else if (item.type === MIME_TYPES7.text) {
36403
+ pushUnique(textImageSources, item.value);
36404
+ }
36405
+ });
36406
+ const imageSources = [
36407
+ ...htmlImageSources,
36408
+ ...textImageSources.filter(
36409
+ (src) => !htmlImageSources.includes(src)
36410
+ )
36411
+ ];
36412
+ const imageDetails = imageFiles.map(() => ({}));
36413
+ imageDetails.forEach((detail, index) => {
36414
+ const source = imageSources[index];
36415
+ const alt = imageAlts[index];
36416
+ if (source) {
36417
+ detail.src = source;
36418
+ }
36419
+ if (alt) {
36420
+ detail.alt = alt;
36421
+ }
36422
+ });
36423
+ const additionalUrls = imageSources.slice(imageDetails.length);
36424
+ const firstImageDetails = imageDetails[0];
36425
+ if (firstImageDetails && additionalUrls.length > 0) {
36426
+ additionalUrls.forEach((url, index) => {
36427
+ firstImageDetails[`additionalUrl${index + 1}`] = url;
36428
+ });
36429
+ }
36430
+ return imageDetails;
36431
+ };
36432
+ const droppedImageDetails = parseDroppedImageDetails();
36433
+ return this.insertImages(
36434
+ imageFiles.map((file2, index) => ({
36435
+ file: file2,
36436
+ customData: droppedImageDetails[index] ?? void 0
36437
+ })),
36438
+ sceneX,
36439
+ sceneY
36440
+ );
36441
+ }
36442
+ this.setState({ errorMessage: t("errors.imageToolNotSupported") });
36443
+ return;
36379
36444
  }
36380
36445
  if (fileItems.length > 0) {
36381
36446
  const { file: file2, fileHandle } = fileItems[0];