@myoc/excalidraw 0.19.504 → 0.19.505

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
@@ -3964,4 +3964,110 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
3964
3964
 
3965
3965
  - Docker compose version removed [#10074](https://github.com/excalidraw/excalidraw/pull/10074)
3966
3966
 
3967
+ ---## Excalidraw Library
3968
+
3969
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
3970
+
3971
+ ### Features
3972
+
3973
+ - Add ability to turn off compression for files that are smaller than a given size
3974
+
3975
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
3976
+
3977
+ - Add view mode button
3978
+
3979
+ - Add multiple image copy paste or drag and drop
3980
+
3981
+ - Multiple image additions from clipboard
3982
+
3983
+ - Add arrange elements action
3984
+
3985
+ - Add top picks to appProps for both stoke color and background color
3986
+
3987
+ ### Fixes
3988
+
3989
+ - Issues
3990
+
3991
+ - Make mobile mode more myoc looking
3992
+
3993
+ - Add normalise functionality
3994
+
3995
+ - Update with excalidraw
3996
+
3997
+ - Fix imports
3998
+
3999
+ - Fix mutateGroup to use scene.mutateGroup
4000
+
4001
+ - Imports
4002
+
4003
+ - Ensure that fileId is different for compressed vs uncompressed file
4004
+
4005
+ - Remove not working prop for dontResizeLimitMBs
4006
+
4007
+ - Add smartview for mobile
4008
+
4009
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
4010
+
4011
+ - Use css vars already provided instead of hard coding directly from oc-gray
4012
+
4013
+ - Remove unused variables
4014
+
4015
+ - Pass the new top pick color props properly
4016
+
4017
+ - Incorrect import for color (was moved to common)
4018
+
3967
4019
  ---
4020
+ ## Excalidraw Library
4021
+
4022
+ **_This section lists the updates made to the excalidraw library and will not affect the integration._**
4023
+
4024
+ ### Features
4025
+
4026
+ - Add ability to turn off compression for files that are smaller than a given size
4027
+
4028
+ - Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
4029
+
4030
+ - Add view mode button
4031
+
4032
+ - Add multiple image copy paste or drag and drop
4033
+
4034
+ - Multiple image additions from clipboard
4035
+
4036
+ - Add arrange elements action
4037
+
4038
+ - Add top picks to appProps for both stoke color and background color
4039
+
4040
+ ### Fixes
4041
+
4042
+ - Issues
4043
+
4044
+ - Make mobile mode more myoc looking
4045
+
4046
+ - Add normalise functionality
4047
+
4048
+ - Update with excalidraw
4049
+
4050
+ - Fix imports
4051
+
4052
+ - Fix mutateGroup to use scene.mutateGroup
4053
+
4054
+ - Imports
4055
+
4056
+ - Ensure that fileId is different for compressed vs uncompressed file
4057
+
4058
+ - Remove not working prop for dontResizeLimitMBs
4059
+
4060
+ - Add smartview for mobile
4061
+
4062
+ - Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
4063
+
4064
+ - Use css vars already provided instead of hard coding directly from oc-gray
4065
+
4066
+ - Remove unused variables
4067
+
4068
+ - Pass the new top pick color props properly
4069
+
4070
+ - Incorrect import for color (was moved to common)
4071
+
4072
+ ---
4073
+
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  define_import_meta_env_default
3
- } from "./chunk-OF725VHI.js";
3
+ } from "./chunk-KCN2IL3S.js";
4
4
  import {
5
5
  __publicField
6
6
  } from "./chunk-XDFCUUT6.js";
@@ -5078,7 +5078,7 @@ var parseFileContents = async (blob) => {
5078
5078
  let contents;
5079
5079
  if (blob.type === MIME_TYPES6.png) {
5080
5080
  try {
5081
- return await (await import("./data/image-ZR5DXOGS.js")).decodePngMetadata(blob);
5081
+ return await (await import("./data/image-KFKBCMAI.js")).decodePngMetadata(blob);
5082
5082
  } catch (error) {
5083
5083
  if (error.message === "INVALID") {
5084
5084
  throw new ImageSceneDataError(
@@ -5511,4 +5511,4 @@ export {
5511
5511
  createFile,
5512
5512
  normalizeFile
5513
5513
  };
5514
- //# sourceMappingURL=chunk-Z5DMFRJ5.js.map
5514
+ //# sourceMappingURL=chunk-D5OSJVKD.js.map
@@ -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.503", 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.505", DEV: true };
3
3
 
4
4
  export {
5
5
  define_import_meta_env_default
6
6
  };
7
- //# sourceMappingURL=chunk-OF725VHI.js.map
7
+ //# sourceMappingURL=chunk-KCN2IL3S.js.map
@@ -2,12 +2,12 @@ import {
2
2
  decodePngMetadata,
3
3
  encodePngMetadata,
4
4
  getTEXtChunk
5
- } from "../chunk-Z5DMFRJ5.js";
6
- import "../chunk-OF725VHI.js";
5
+ } from "../chunk-D5OSJVKD.js";
6
+ import "../chunk-KCN2IL3S.js";
7
7
  import "../chunk-XDFCUUT6.js";
8
8
  export {
9
9
  decodePngMetadata,
10
10
  encodePngMetadata,
11
11
  getTEXtChunk
12
12
  };
13
- //# sourceMappingURL=image-ZR5DXOGS.js.map
13
+ //# sourceMappingURL=image-KFKBCMAI.js.map
package/dist/dev/index.js CHANGED
@@ -64,10 +64,10 @@ import {
64
64
  serializeAsJSON,
65
65
  serializeLibraryAsJSON,
66
66
  strokeRectWithRotation_simple
67
- } from "./chunk-Z5DMFRJ5.js";
67
+ } from "./chunk-D5OSJVKD.js";
68
68
  import {
69
69
  define_import_meta_env_default
70
- } from "./chunk-OF725VHI.js";
70
+ } from "./chunk-KCN2IL3S.js";
71
71
  import {
72
72
  en_default
73
73
  } from "./chunk-KLM3KPI7.js";
@@ -9502,7 +9502,7 @@ var exportCanvas = async (type, elements, appState, files, {
9502
9502
  let blob = canvasToBlob(tempCanvas);
9503
9503
  if (appState.exportEmbedScene) {
9504
9504
  blob = blob.then(
9505
- (blob2) => import("./data/image-ZR5DXOGS.js").then(
9505
+ (blob2) => import("./data/image-KFKBCMAI.js").then(
9506
9506
  ({ encodePngMetadata: encodePngMetadata2 }) => encodePngMetadata2({
9507
9507
  blob: blob2,
9508
9508
  metadata: serializeAsJSON(elements, appState, files, "local")
@@ -35812,6 +35812,63 @@ var App = class _App extends React44.Component {
35812
35812
  });
35813
35813
  });
35814
35814
  __publicField(this, "cancelInProgressAnimation", null);
35815
+ __publicField(this, "scrollToViewport", (target, opts) => {
35816
+ this.cancelInProgressAnimation?.();
35817
+ const zoom = { value: getNormalizedZoom(target.zoom) };
35818
+ const animateDuration = opts?.duration ?? 500;
35819
+ if (opts?.animate && animateDuration > 0) {
35820
+ const origScrollX = this.state.scrollX;
35821
+ const origScrollY = this.state.scrollY;
35822
+ const origZoom = this.state.zoom.value;
35823
+ const cancel = easeToValuesRAF({
35824
+ fromValues: {
35825
+ scrollX: origScrollX,
35826
+ scrollY: origScrollY,
35827
+ zoom: origZoom
35828
+ },
35829
+ toValues: {
35830
+ scrollX: target.scrollX,
35831
+ scrollY: target.scrollY,
35832
+ zoom: zoom.value
35833
+ },
35834
+ interpolateValue: (from, to, progress, key) => {
35835
+ if (key === "zoom") {
35836
+ return from * Math.pow(to / from, easeOut4(progress));
35837
+ }
35838
+ return void 0;
35839
+ },
35840
+ onStep: ({ scrollX, scrollY, zoom: zoom2 }) => {
35841
+ this.setState({
35842
+ scrollX,
35843
+ scrollY,
35844
+ zoom: { value: zoom2 }
35845
+ });
35846
+ },
35847
+ onStart: () => {
35848
+ this.setState({ shouldCacheIgnoreZoom: true });
35849
+ },
35850
+ onEnd: () => {
35851
+ this.cancelInProgressAnimation = null;
35852
+ this.setState({ shouldCacheIgnoreZoom: false });
35853
+ },
35854
+ onCancel: () => {
35855
+ this.cancelInProgressAnimation = null;
35856
+ this.setState({ shouldCacheIgnoreZoom: false });
35857
+ },
35858
+ duration: animateDuration
35859
+ });
35860
+ this.cancelInProgressAnimation = () => {
35861
+ cancel();
35862
+ this.cancelInProgressAnimation = null;
35863
+ };
35864
+ } else {
35865
+ this.setState({
35866
+ scrollX: target.scrollX,
35867
+ scrollY: target.scrollY,
35868
+ zoom
35869
+ });
35870
+ }
35871
+ });
35815
35872
  __publicField(this, "scrollToContent", (target = this.scene.getNonDeletedElements(), opts) => {
35816
35873
  if (typeof target === "string") {
35817
35874
  let id;
@@ -35839,7 +35896,6 @@ var App = class _App extends React44.Component {
35839
35896
  }
35840
35897
  return;
35841
35898
  }
35842
- this.cancelInProgressAnimation?.();
35843
35899
  const targetElements = Array.isArray(target) ? target : [target];
35844
35900
  let zoom = this.state.zoom;
35845
35901
  let scrollX = this.state.scrollX;
@@ -35862,48 +35918,17 @@ var App = class _App extends React44.Component {
35862
35918
  scrollX = scroll.scrollX;
35863
35919
  scrollY = scroll.scrollY;
35864
35920
  }
35865
- if (opts?.animate) {
35866
- const origScrollX = this.state.scrollX;
35867
- const origScrollY = this.state.scrollY;
35868
- const origZoom = this.state.zoom.value;
35869
- const cancel = easeToValuesRAF({
35870
- fromValues: {
35871
- scrollX: origScrollX,
35872
- scrollY: origScrollY,
35873
- zoom: origZoom
35874
- },
35875
- toValues: { scrollX, scrollY, zoom: zoom.value },
35876
- interpolateValue: (from, to, progress, key) => {
35877
- if (key === "zoom") {
35878
- return from * Math.pow(to / from, easeOut4(progress));
35879
- }
35880
- return void 0;
35881
- },
35882
- onStep: ({ scrollX: scrollX2, scrollY: scrollY2, zoom: zoom2 }) => {
35883
- this.setState({
35884
- scrollX: scrollX2,
35885
- scrollY: scrollY2,
35886
- zoom: { value: zoom2 }
35887
- });
35888
- },
35889
- onStart: () => {
35890
- this.setState({ shouldCacheIgnoreZoom: true });
35891
- },
35892
- onEnd: () => {
35893
- this.setState({ shouldCacheIgnoreZoom: false });
35894
- },
35895
- onCancel: () => {
35896
- this.setState({ shouldCacheIgnoreZoom: false });
35897
- },
35898
- duration: opts?.duration ?? 500
35899
- });
35900
- this.cancelInProgressAnimation = () => {
35901
- cancel();
35902
- this.cancelInProgressAnimation = null;
35903
- };
35904
- } else {
35905
- this.setState({ scrollX, scrollY, zoom });
35906
- }
35921
+ this.scrollToViewport(
35922
+ {
35923
+ scrollX,
35924
+ scrollY,
35925
+ zoom: zoom.value
35926
+ },
35927
+ {
35928
+ animate: opts?.animate,
35929
+ duration: opts?.duration
35930
+ }
35931
+ );
35907
35932
  });
35908
35933
  __publicField(this, "maybeUnfollowRemoteUser", () => {
35909
35934
  if (this.state.userToFollow) {
@@ -39960,6 +39985,7 @@ var App = class _App extends React44.Component {
39960
39985
  history: {
39961
39986
  clear: this.resetHistory
39962
39987
  },
39988
+ scrollToViewport: this.scrollToViewport,
39963
39989
  scrollToContent: this.scrollToContent,
39964
39990
  getSceneElements: this.getSceneElements,
39965
39991
  getAppState: () => this.state,