@myoc/excalidraw 0.19.505 → 0.19.508
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 +160 -0
- package/dist/dev/{chunk-D5OSJVKD.js → chunk-4FUVQKPQ.js} +42 -47
- package/dist/dev/chunk-4FUVQKPQ.js.map +7 -0
- package/dist/dev/{chunk-KLM3KPI7.js → chunk-55P7U5EB.js} +4 -1
- package/dist/dev/chunk-55P7U5EB.js.map +7 -0
- package/dist/dev/{chunk-KCN2IL3S.js → chunk-TW3GG6X2.js} +2 -2
- package/dist/dev/data/{image-KFKBCMAI.js → image-BLMJ34ZZ.js} +3 -3
- package/dist/dev/index.css +23 -3
- package/dist/dev/index.css.map +2 -2
- package/dist/dev/index.js +1400 -1028
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-I7VEBYIX.js → en-MHJYLCUG.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-5HKPV526.js +4 -0
- package/dist/prod/{chunk-74H5OWWZ.js → chunk-GYDQTBSQ.js} +1 -1
- package/dist/prod/{chunk-3FGJVPJS.js → chunk-QIZKYIJ7.js} +3 -3
- package/dist/prod/data/image-S4O4TFPQ.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +19 -19
- package/dist/prod/locales/{en-Y2V7YPBM.js → en-YKHOUQAO.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/element/src/Scene.d.ts +5 -3
- package/dist/types/element/src/bounds.d.ts +4 -2
- package/dist/types/element/src/duplicate.d.ts +1 -0
- package/dist/types/element/src/frame.d.ts +7 -6
- package/dist/types/element/src/linearElementEditor.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +2 -2
- package/dist/types/element/src/shape.d.ts +1 -1
- package/dist/types/element/src/typeChecks.d.ts +1 -0
- package/dist/types/element/src/utils.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +11 -11
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +168 -0
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +3 -5
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -3
- package/dist/types/excalidraw/actions/index.d.ts +1 -0
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +1 -0
- package/dist/types/excalidraw/components/App.d.ts +9 -0
- package/dist/types/excalidraw/components/PublishLibrary.d.ts +3 -2
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -0
- package/dist/types/excalidraw/components/shapes.d.ts +7 -0
- package/dist/types/excalidraw/data/blob.d.ts +4 -8
- package/dist/types/excalidraw/data/json.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +1 -1
- package/dist/types/excalidraw/scene/Renderer.d.ts +425 -19
- package/dist/types/excalidraw/scene/types.d.ts +2 -0
- package/dist/types/excalidraw/types.d.ts +15 -2
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +4 -1
- package/package.json +4 -5
- package/dist/dev/chunk-D5OSJVKD.js.map +0 -7
- package/dist/dev/chunk-KLM3KPI7.js.map +0 -7
- package/dist/prod/chunk-USXDRZTP.js +0 -4
- package/dist/prod/data/image-ZMS3YSG4.js +0 -1
- /package/dist/dev/{chunk-KCN2IL3S.js.map → chunk-TW3GG6X2.js.map} +0 -0
- /package/dist/dev/data/{image-KFKBCMAI.js.map → image-BLMJ34ZZ.js.map} +0 -0
- /package/dist/dev/locales/{en-I7VEBYIX.js.map → en-MHJYLCUG.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -64,6 +64,8 @@ Please add the latest change on the top under the correct section.
|
|
|
64
64
|
- Incorrect import for color (was moved to common)
|
|
65
65
|
|
|
66
66
|
---
|
|
67
|
+
|
|
68
|
+
|
|
67
69
|
## 0.19.503 (2026-03-22)
|
|
68
70
|
|
|
69
71
|
## Excalidraw API
|
|
@@ -4016,6 +4018,164 @@ First release of `@excalidraw/excalidraw`## Excalidraw Library
|
|
|
4016
4018
|
|
|
4017
4019
|
- Incorrect import for color (was moved to common)
|
|
4018
4020
|
|
|
4021
|
+
---
|
|
4022
|
+
|
|
4023
|
+
## Excalidraw Library
|
|
4024
|
+
|
|
4025
|
+
**_This section lists the updates made to the excalidraw library and will not affect the integration._**
|
|
4026
|
+
|
|
4027
|
+
### Features
|
|
4028
|
+
|
|
4029
|
+
- Add ability to turn off compression for files that are smaller than a given size
|
|
4030
|
+
|
|
4031
|
+
- Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
|
|
4032
|
+
|
|
4033
|
+
- Add view mode button
|
|
4034
|
+
|
|
4035
|
+
- Add multiple image copy paste or drag and drop
|
|
4036
|
+
|
|
4037
|
+
- Multiple image additions from clipboard
|
|
4038
|
+
|
|
4039
|
+
- Add arrange elements action
|
|
4040
|
+
|
|
4041
|
+
- Add top picks to appProps for both stoke color and background color
|
|
4042
|
+
|
|
4043
|
+
### Fixes
|
|
4044
|
+
|
|
4045
|
+
- Issues
|
|
4046
|
+
|
|
4047
|
+
- Make mobile mode more myoc looking
|
|
4048
|
+
|
|
4049
|
+
- Add normalise functionality
|
|
4050
|
+
|
|
4051
|
+
- Update with excalidraw
|
|
4052
|
+
|
|
4053
|
+
- Fix imports
|
|
4054
|
+
|
|
4055
|
+
- Fix mutateGroup to use scene.mutateGroup
|
|
4056
|
+
|
|
4057
|
+
- Imports
|
|
4058
|
+
|
|
4059
|
+
- Ensure that fileId is different for compressed vs uncompressed file
|
|
4060
|
+
|
|
4061
|
+
- Remove not working prop for dontResizeLimitMBs
|
|
4062
|
+
|
|
4063
|
+
- Add smartview for mobile
|
|
4064
|
+
|
|
4065
|
+
- Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
|
|
4066
|
+
|
|
4067
|
+
- Use css vars already provided instead of hard coding directly from oc-gray
|
|
4068
|
+
|
|
4069
|
+
- Remove unused variables
|
|
4070
|
+
|
|
4071
|
+
- Pass the new top pick color props properly
|
|
4072
|
+
|
|
4073
|
+
- Incorrect import for color (was moved to common)
|
|
4074
|
+
|
|
4075
|
+
---## Excalidraw Library
|
|
4076
|
+
|
|
4077
|
+
**_This section lists the updates made to the excalidraw library and will not affect the integration._**
|
|
4078
|
+
|
|
4079
|
+
### Features
|
|
4080
|
+
|
|
4081
|
+
- Add ability to turn off compression for files that are smaller than a given size
|
|
4082
|
+
|
|
4083
|
+
- Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
|
|
4084
|
+
|
|
4085
|
+
- Add view mode button
|
|
4086
|
+
|
|
4087
|
+
- Add multiple image copy paste or drag and drop
|
|
4088
|
+
|
|
4089
|
+
- Multiple image additions from clipboard
|
|
4090
|
+
|
|
4091
|
+
- Add arrange elements action
|
|
4092
|
+
|
|
4093
|
+
- Add top picks to appProps for both stoke color and background color
|
|
4094
|
+
|
|
4095
|
+
### Fixes
|
|
4096
|
+
|
|
4097
|
+
- Issues
|
|
4098
|
+
|
|
4099
|
+
- Make mobile mode more myoc looking
|
|
4100
|
+
|
|
4101
|
+
- Add normalise functionality
|
|
4102
|
+
|
|
4103
|
+
- Update with excalidraw
|
|
4104
|
+
|
|
4105
|
+
- Fix imports
|
|
4106
|
+
|
|
4107
|
+
- Fix mutateGroup to use scene.mutateGroup
|
|
4108
|
+
|
|
4109
|
+
- Imports
|
|
4110
|
+
|
|
4111
|
+
- Ensure that fileId is different for compressed vs uncompressed file
|
|
4112
|
+
|
|
4113
|
+
- Remove not working prop for dontResizeLimitMBs
|
|
4114
|
+
|
|
4115
|
+
- Add smartview for mobile
|
|
4116
|
+
|
|
4117
|
+
- Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
|
|
4118
|
+
|
|
4119
|
+
- Use css vars already provided instead of hard coding directly from oc-gray
|
|
4120
|
+
|
|
4121
|
+
- Remove unused variables
|
|
4122
|
+
|
|
4123
|
+
- Pass the new top pick color props properly
|
|
4124
|
+
|
|
4125
|
+
- Incorrect import for color (was moved to common)
|
|
4126
|
+
|
|
4127
|
+
---## Excalidraw Library
|
|
4128
|
+
|
|
4129
|
+
**_This section lists the updates made to the excalidraw library and will not affect the integration._**
|
|
4130
|
+
|
|
4131
|
+
### Features
|
|
4132
|
+
|
|
4133
|
+
- Add ability to turn off compression for files that are smaller than a given size
|
|
4134
|
+
|
|
4135
|
+
- Add lock tool to the dropdown and also add the status of the extra tools to be the same icon as the selected tool
|
|
4136
|
+
|
|
4137
|
+
- Add view mode button
|
|
4138
|
+
|
|
4139
|
+
- Add multiple image copy paste or drag and drop
|
|
4140
|
+
|
|
4141
|
+
- Multiple image additions from clipboard
|
|
4142
|
+
|
|
4143
|
+
- Add arrange elements action
|
|
4144
|
+
|
|
4145
|
+
- Add top picks to appProps for both stoke color and background color
|
|
4146
|
+
|
|
4147
|
+
### Fixes
|
|
4148
|
+
|
|
4149
|
+
- Issues
|
|
4150
|
+
|
|
4151
|
+
- Make mobile mode more myoc looking
|
|
4152
|
+
|
|
4153
|
+
- Add normalise functionality
|
|
4154
|
+
|
|
4155
|
+
- Update with excalidraw
|
|
4156
|
+
|
|
4157
|
+
- Fix imports
|
|
4158
|
+
|
|
4159
|
+
- Fix mutateGroup to use scene.mutateGroup
|
|
4160
|
+
|
|
4161
|
+
- Imports
|
|
4162
|
+
|
|
4163
|
+
- Ensure that fileId is different for compressed vs uncompressed file
|
|
4164
|
+
|
|
4165
|
+
- Remove not working prop for dontResizeLimitMBs
|
|
4166
|
+
|
|
4167
|
+
- Add smartview for mobile
|
|
4168
|
+
|
|
4169
|
+
- Hide the alignment buttons if there is only one group selected (they do nothing if only one group is selected)
|
|
4170
|
+
|
|
4171
|
+
- Use css vars already provided instead of hard coding directly from oc-gray
|
|
4172
|
+
|
|
4173
|
+
- Remove unused variables
|
|
4174
|
+
|
|
4175
|
+
- Pass the new top pick color props properly
|
|
4176
|
+
|
|
4177
|
+
- Incorrect import for color (was moved to common)
|
|
4178
|
+
|
|
4019
4179
|
---
|
|
4020
4180
|
## Excalidraw Library
|
|
4021
4181
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TW3GG6X2.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -124,7 +124,6 @@ var getDefaultAppState = () => {
|
|
|
124
124
|
open: false,
|
|
125
125
|
panels: STATS_PANELS.generalStats | STATS_PANELS.elementProperties
|
|
126
126
|
},
|
|
127
|
-
startBoundElement: null,
|
|
128
127
|
suggestedBinding: null,
|
|
129
128
|
frameRendering: { enabled: true, clip: true, name: true, outline: true },
|
|
130
129
|
frameToHighlight: null,
|
|
@@ -152,7 +151,8 @@ var getDefaultAppState = () => {
|
|
|
152
151
|
searchMatches: null,
|
|
153
152
|
lockedMultiSelections: {},
|
|
154
153
|
activeLockedId: null,
|
|
155
|
-
bindMode: "orbit"
|
|
154
|
+
bindMode: "orbit",
|
|
155
|
+
boxSelectionMode: "contain"
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
158
|
var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
@@ -208,6 +208,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
208
208
|
gridModeEnabled: { browser: true, export: true, server: true },
|
|
209
209
|
height: { browser: false, export: false, server: false },
|
|
210
210
|
isBindingEnabled: { browser: true, export: false, server: false },
|
|
211
|
+
boxSelectionMode: { browser: true, export: false, server: false },
|
|
211
212
|
bindingPreference: { browser: true, export: false, server: false },
|
|
212
213
|
isMidpointSnappingEnabled: { browser: true, export: false, server: false },
|
|
213
214
|
defaultSidebarDockedPreference: {
|
|
@@ -244,7 +245,6 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
244
245
|
selectionElement: { browser: false, export: false, server: false },
|
|
245
246
|
shouldCacheIgnoreZoom: { browser: true, export: false, server: false },
|
|
246
247
|
stats: { browser: true, export: false, server: false },
|
|
247
|
-
startBoundElement: { browser: false, export: false, server: false },
|
|
248
248
|
suggestedBinding: { browser: false, export: false, server: false },
|
|
249
249
|
frameRendering: { browser: false, export: false, server: false },
|
|
250
250
|
frameToHighlight: { browser: false, export: false, server: false },
|
|
@@ -3217,7 +3217,7 @@ var GridLineColor = {
|
|
|
3217
3217
|
regular: applyDarkModeFilter2("#e5e5e5")
|
|
3218
3218
|
}
|
|
3219
3219
|
};
|
|
3220
|
-
var strokeGrid = (context, gridSize, gridStep, scrollX, scrollY, zoom,
|
|
3220
|
+
var strokeGrid = (context, gridSize, gridStep, scrollX, scrollY, zoom, gridColorBold, gridColorRegular, width, height) => {
|
|
3221
3221
|
const offsetX = scrollX % gridSize - gridSize;
|
|
3222
3222
|
const offsetY = scrollY % gridSize - gridSize;
|
|
3223
3223
|
const actualGridSize = gridSize * zoom.value;
|
|
@@ -3236,7 +3236,7 @@ var strokeGrid = (context, gridSize, gridStep, scrollX, scrollY, zoom, theme, wi
|
|
|
3236
3236
|
const lineDash = [lineWidth * 3, spaceWidth + (lineWidth + spaceWidth)];
|
|
3237
3237
|
context.beginPath();
|
|
3238
3238
|
context.setLineDash(isBold ? [] : lineDash);
|
|
3239
|
-
context.strokeStyle = isBold ?
|
|
3239
|
+
context.strokeStyle = isBold ? gridColorBold : gridColorRegular;
|
|
3240
3240
|
context.moveTo(x, offsetY - gridSize);
|
|
3241
3241
|
context.lineTo(x, Math.ceil(offsetY + height + gridSize * 2));
|
|
3242
3242
|
context.stroke();
|
|
@@ -3251,7 +3251,7 @@ var strokeGrid = (context, gridSize, gridStep, scrollX, scrollY, zoom, theme, wi
|
|
|
3251
3251
|
const lineDash = [lineWidth * 3, spaceWidth + (lineWidth + spaceWidth)];
|
|
3252
3252
|
context.beginPath();
|
|
3253
3253
|
context.setLineDash(isBold ? [] : lineDash);
|
|
3254
|
-
context.strokeStyle = isBold ?
|
|
3254
|
+
context.strokeStyle = isBold ? gridColorBold : gridColorRegular;
|
|
3255
3255
|
context.moveTo(offsetX - gridSize, y);
|
|
3256
3256
|
context.lineTo(Math.ceil(offsetX + width + gridSize * 2), y);
|
|
3257
3257
|
context.stroke();
|
|
@@ -3365,7 +3365,8 @@ var _renderStaticScene = ({
|
|
|
3365
3365
|
appState.scrollX,
|
|
3366
3366
|
appState.scrollY,
|
|
3367
3367
|
appState.zoom,
|
|
3368
|
-
renderConfig.theme,
|
|
3368
|
+
renderConfig.gridColorBold ?? GridLineColor[renderConfig.theme].bold,
|
|
3369
|
+
renderConfig.gridColorRegular ?? GridLineColor[renderConfig.theme].regular,
|
|
3369
3370
|
normalizedWidth / appState.zoom.value,
|
|
3370
3371
|
normalizedHeight / appState.zoom.value
|
|
3371
3372
|
);
|
|
@@ -4180,7 +4181,11 @@ var prepareElementsForRender = ({
|
|
|
4180
4181
|
}) => {
|
|
4181
4182
|
let nextElements;
|
|
4182
4183
|
if (exportingFrame) {
|
|
4183
|
-
nextElements = getElementsOverlappingFrame(
|
|
4184
|
+
nextElements = getElementsOverlappingFrame(
|
|
4185
|
+
elements,
|
|
4186
|
+
exportingFrame,
|
|
4187
|
+
arrayToMap(elements)
|
|
4188
|
+
);
|
|
4184
4189
|
} else if (frameRendering.enabled && frameRendering.name) {
|
|
4185
4190
|
nextElements = addFrameLabelsAsTextElements(elements, {
|
|
4186
4191
|
exportWithDarkMode
|
|
@@ -4506,6 +4511,7 @@ import { syncInvalidIndices as syncInvalidIndices2 } from "@excalidraw/element";
|
|
|
4506
4511
|
import { refreshTextDimensions } from "@excalidraw/element";
|
|
4507
4512
|
import { getNormalizedDimensions } from "@excalidraw/element";
|
|
4508
4513
|
import { isInvisiblySmallElement } from "@excalidraw/element";
|
|
4514
|
+
var MAX_ARROW_PX = 75e3;
|
|
4509
4515
|
var AllowedExcalidrawActiveTools = {
|
|
4510
4516
|
selection: true,
|
|
4511
4517
|
lasso: true,
|
|
@@ -4763,8 +4769,8 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4763
4769
|
startArrowhead: startArrowhead2,
|
|
4764
4770
|
endArrowhead: endArrowhead2,
|
|
4765
4771
|
points: points2,
|
|
4766
|
-
x: x2,
|
|
4767
|
-
y: y2,
|
|
4772
|
+
x: x2 ?? 0,
|
|
4773
|
+
y: y2 ?? 0,
|
|
4768
4774
|
elbowed: element.elbowed,
|
|
4769
4775
|
...getSizeFromPoints(points2)
|
|
4770
4776
|
};
|
|
@@ -4775,12 +4781,30 @@ var restoreElement = (element, targetElementsMap, existingElementsMap, opts) =>
|
|
|
4775
4781
|
startIsSpecial: element.startIsSpecial,
|
|
4776
4782
|
endIsSpecial: element.endIsSpecial
|
|
4777
4783
|
}) : restoreElementWithProperties(element, base);
|
|
4778
|
-
|
|
4784
|
+
const normalizedRestoredElement = {
|
|
4779
4785
|
...restoredElement,
|
|
4780
4786
|
...LinearElementEditor2.getNormalizeElementPointsAndCoords(
|
|
4781
4787
|
restoredElement
|
|
4782
4788
|
)
|
|
4783
4789
|
};
|
|
4790
|
+
if (normalizedRestoredElement.width > MAX_ARROW_PX || normalizedRestoredElement.height > MAX_ARROW_PX) {
|
|
4791
|
+
console.error(
|
|
4792
|
+
`Removing extremely large arrow ${normalizedRestoredElement.id} (type: ${isElbowArrow(normalizedRestoredElement) ? "elbow" : "simple"}, width: ${normalizedRestoredElement.width}, height: ${normalizedRestoredElement.height}, x: ${normalizedRestoredElement.x}, y: ${normalizedRestoredElement.y})`
|
|
4793
|
+
);
|
|
4794
|
+
return {
|
|
4795
|
+
...normalizedRestoredElement,
|
|
4796
|
+
x: 0,
|
|
4797
|
+
y: 0,
|
|
4798
|
+
width: 100,
|
|
4799
|
+
height: 100,
|
|
4800
|
+
points: [
|
|
4801
|
+
pointFrom2(0, 0),
|
|
4802
|
+
pointFrom2(100, 100)
|
|
4803
|
+
],
|
|
4804
|
+
isDeleted: true
|
|
4805
|
+
};
|
|
4806
|
+
}
|
|
4807
|
+
return normalizedRestoredElement;
|
|
4784
4808
|
}
|
|
4785
4809
|
case "ellipse":
|
|
4786
4810
|
case "rectangle":
|
|
@@ -5005,6 +5029,10 @@ var restoreAppState = (appState, localAppState) => {
|
|
|
5005
5029
|
const localValue = localAppState ? localAppState[key] : void 0;
|
|
5006
5030
|
nextAppState[key] = suppliedValue !== void 0 ? suppliedValue : localValue !== void 0 ? localValue : defaultValue;
|
|
5007
5031
|
}
|
|
5032
|
+
const boxSelectionMode = appState.boxSelectionMode ?? localAppState?.boxSelectionMode;
|
|
5033
|
+
if (boxSelectionMode !== void 0) {
|
|
5034
|
+
nextAppState.boxSelectionMode = boxSelectionMode;
|
|
5035
|
+
}
|
|
5008
5036
|
return {
|
|
5009
5037
|
...nextAppState,
|
|
5010
5038
|
cursorButton: localAppState?.cursorButton || "up",
|
|
@@ -5078,7 +5106,7 @@ var parseFileContents = async (blob) => {
|
|
|
5078
5106
|
let contents;
|
|
5079
5107
|
if (blob.type === MIME_TYPES6.png) {
|
|
5080
5108
|
try {
|
|
5081
|
-
return await (await import("./data/image-
|
|
5109
|
+
return await (await import("./data/image-BLMJ34ZZ.js")).decodePngMetadata(blob);
|
|
5082
5110
|
} catch (error) {
|
|
5083
5111
|
if (error.message === "INVALID") {
|
|
5084
5112
|
throw new ImageSceneDataError(
|
|
@@ -5265,38 +5293,6 @@ var getDataURL_sync = (data, mimeType) => {
|
|
|
5265
5293
|
var dataURLToString = (dataURL) => {
|
|
5266
5294
|
return base64ToString(dataURL.slice(dataURL.indexOf(",") + 1));
|
|
5267
5295
|
};
|
|
5268
|
-
var resizeImageFile = async (file, opts) => {
|
|
5269
|
-
if (file.type === MIME_TYPES6.svg) {
|
|
5270
|
-
return file;
|
|
5271
|
-
}
|
|
5272
|
-
const [pica, imageBlobReduce] = await Promise.all([
|
|
5273
|
-
import("pica").then((res) => res.default),
|
|
5274
|
-
// a wrapper for pica for better API
|
|
5275
|
-
import("image-blob-reduce").then((res) => res.default)
|
|
5276
|
-
]);
|
|
5277
|
-
const reduce = imageBlobReduce({
|
|
5278
|
-
pica: pica({ features: ["js", "wasm"] })
|
|
5279
|
-
});
|
|
5280
|
-
if (opts.outputType) {
|
|
5281
|
-
const { outputType } = opts;
|
|
5282
|
-
reduce._create_blob = function(env) {
|
|
5283
|
-
return this.pica.toBlob(env.out_canvas, outputType, 0.8).then((blob) => {
|
|
5284
|
-
env.out_blob = blob;
|
|
5285
|
-
return env;
|
|
5286
|
-
});
|
|
5287
|
-
};
|
|
5288
|
-
}
|
|
5289
|
-
if (!isSupportedImageFile(file)) {
|
|
5290
|
-
throw new Error("Error: unsupported file type", { cause: "UNSUPPORTED" });
|
|
5291
|
-
}
|
|
5292
|
-
return new File(
|
|
5293
|
-
[await reduce.toBlob(file, { max: opts.maxWidthOrHeight, alpha: true })],
|
|
5294
|
-
file.name,
|
|
5295
|
-
{
|
|
5296
|
-
type: opts.outputType || file.type
|
|
5297
|
-
}
|
|
5298
|
-
);
|
|
5299
|
-
};
|
|
5300
5296
|
var SVGStringToFile = (SVGString, filename = "") => {
|
|
5301
5297
|
return new File([new TextEncoder().encode(SVGString)], filename, {
|
|
5302
5298
|
type: MIME_TYPES6.svg
|
|
@@ -5504,11 +5500,10 @@ export {
|
|
|
5504
5500
|
getDataURL,
|
|
5505
5501
|
getDataURL_sync,
|
|
5506
5502
|
dataURLToString,
|
|
5507
|
-
resizeImageFile,
|
|
5508
5503
|
SVGStringToFile,
|
|
5509
5504
|
ImageURLToFile,
|
|
5510
5505
|
getFileHandle,
|
|
5511
5506
|
createFile,
|
|
5512
5507
|
normalizeFile
|
|
5513
5508
|
};
|
|
5514
|
-
//# sourceMappingURL=chunk-
|
|
5509
|
+
//# sourceMappingURL=chunk-4FUVQKPQ.js.map
|