@myoc/excalidraw 0.19.517 → 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
@@ -4707,4 +4707,57 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
4707
4707
  - Incorrect import for color (was moved to common)
4708
4708
 
4709
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
+ ---
4710
4763
 
package/dist/dev/index.js CHANGED
@@ -36369,14 +36369,78 @@ var App = class _App extends React40.Component {
36369
36369
  }
36370
36370
  }
36371
36371
  const imageFiles = fileItems.map((data) => data.file).filter((file2) => isSupportedImageFile(file2));
36372
- if (imageFiles.length > 0 && this.isToolSupported("image")) {
36373
- return this.insertImages(
36374
- imageFiles.map((file2) => ({
36375
- file: file2
36376
- })),
36377
- sceneX,
36378
- sceneY
36379
- );
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;
36380
36444
  }
36381
36445
  if (fileItems.length > 0) {
36382
36446
  const { file: file2, fileHandle } = fileItems[0];