@univerjs/drawing 1.0.0-rc.0 → 1.0.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.
package/lib/es/index.js CHANGED
@@ -1,5 +1,4 @@
1
- import { CommandType, Disposable, DrawingTypeEnum, ICommandService, IConfigService, IImageIoService, IURLImageService, ImageSourceType, ImageUploadStatusType, Inject, Injector, Plugin, createIdentifier, generateRandomId, merge, mergeOverrideWithDependencies, normalizeDrawingOrderIndex, sortRules, sortRulesByDesc, toDisposable } from "@univerjs/core";
2
- import * as json1 from "ot-json1";
1
+ import { CommandType, Disposable, DrawingTypeEnum, ICommandService, IConfigService, IImageIoService, IURLImageService, ImageSourceType, ImageUploadStatusType, Inject, Injector, JSON1, Plugin, createIdentifier, generateRandomId, merge, mergeOverrideWithDependencies, normalizeDrawingOrderIndex, sortRules, sortRulesByDesc, toDisposable } from "@univerjs/core";
3
2
  import { Subject } from "rxjs";
4
3
 
5
4
  //#region src/basics/config.ts
@@ -21,7 +20,7 @@ import { Subject } from "rxjs";
21
20
  const DRAWING_IMAGE_WIDTH_LIMIT = 500;
22
21
  const DRAWING_IMAGE_HEIGHT_LIMIT = 500;
23
22
  const DRAWING_IMAGE_COUNT_LIMIT = 10;
24
- let DRAWING_IMAGE_ALLOW_SIZE = 5 * 1024 * 1024;
23
+ let DRAWING_IMAGE_ALLOW_SIZE = 5242880;
25
24
  function setDrawingImageAllowSize(size) {
26
25
  DRAWING_IMAGE_ALLOW_SIZE = size;
27
26
  }
@@ -56,7 +55,7 @@ const SetDrawingSelectedOperation = {
56
55
  //#endregion
57
56
  //#region package.json
58
57
  var name = "@univerjs/drawing";
59
- var version = "1.0.0-rc.0";
58
+ var version = "1.0.0";
60
59
 
61
60
  //#endregion
62
61
  //#region src/config/config.ts
@@ -65,7 +64,7 @@ const configSymbol = Symbol(DRAWING_PLUGIN_CONFIG_KEY);
65
64
  const defaultPluginConfig = {};
66
65
 
67
66
  //#endregion
68
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
67
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js
69
68
  function _typeof(o) {
70
69
  "@babel/helpers - typeof";
71
70
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -76,7 +75,7 @@ function _typeof(o) {
76
75
  }
77
76
 
78
77
  //#endregion
79
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
78
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPrimitive.js
80
79
  function toPrimitive(t, r) {
81
80
  if ("object" != _typeof(t) || !t) return t;
82
81
  var e = t[Symbol.toPrimitive];
@@ -89,14 +88,14 @@ function toPrimitive(t, r) {
89
88
  }
90
89
 
91
90
  //#endregion
92
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
91
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPropertyKey.js
93
92
  function toPropertyKey(t) {
94
93
  var i = toPrimitive(t, "string");
95
94
  return "symbol" == _typeof(i) ? i : i + "";
96
95
  }
97
96
 
98
97
  //#endregion
99
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
98
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/defineProperty.js
100
99
  function _defineProperty(e, r, t) {
101
100
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
102
101
  value: t,
@@ -130,7 +129,7 @@ function hasOnlyEnumerableOwnProperties(value) {
130
129
  return Object.getOwnPropertyNames(value).every((key) => Object.prototype.propertyIsEnumerable.call(value, key));
131
130
  }
132
131
  function createJsonRemoveOp(path, value) {
133
- return json1.type.writeCursor().writeAtPath(path, "r", value).get();
132
+ return JSON1.type.writeCursor().writeAtPath(path, "r", value).get();
134
133
  }
135
134
  function normalizeJsonDocument(value) {
136
135
  if (value === void 0) return;
@@ -150,12 +149,26 @@ function appendJsonUpdateOps(ops, path, newValue, oldValue, hasOldValue) {
150
149
  const hasNormalizedOldValue = hasOldValue && normalizedOldValue !== void 0;
151
150
  if (hasNormalizedOldValue && isJsonValueEqual(normalizedOldValue, normalizedNewValue)) return;
152
151
  if (hasNormalizedOldValue && isPlainObject(oldValue) && isPlainObject(newValue) && hasOnlyEnumerableOwnProperties(oldValue) && hasOnlyEnumerableOwnProperties(newValue)) {
153
- (/* @__PURE__ */ new Set([...Object.keys(oldValue), ...Object.keys(newValue)])).forEach((key) => appendJsonUpdateOps(ops, [...path, key], newValue[key], oldValue[key], Object.prototype.hasOwnProperty.call(oldValue, key) && oldValue[key] !== void 0));
152
+ for (const key of /* @__PURE__ */ new Set([...Object.keys(oldValue), ...Object.keys(newValue)])) appendJsonUpdateOps(ops, [...path, key], newValue[key], oldValue[key], Object.prototype.hasOwnProperty.call(oldValue, key) && oldValue[key] !== void 0);
154
153
  return;
155
154
  }
156
- const op = !hasNormalizedOldValue ? normalizedNewValue === void 0 ? null : json1.insertOp(path, normalizedNewValue) : normalizedNewValue === void 0 ? createJsonRemoveOp(path, normalizedOldValue) : json1.replaceOp(path, normalizedOldValue, normalizedNewValue);
155
+ const op = !hasNormalizedOldValue ? normalizedNewValue === void 0 ? null : JSON1.insertOp(path, normalizedNewValue) : normalizedNewValue === void 0 ? createJsonRemoveOp(path, normalizedOldValue) : JSON1.replaceOp(path, normalizedOldValue, normalizedNewValue);
157
156
  if (op && isNonEmptyOp(op)) ops.push(op);
158
157
  }
158
+ function assertSafeDrawingKeys(...keys) {
159
+ for (const key of keys) if (key === "__proto__" || key === "constructor" || key === "prototype") throw new Error("Invalid drawing key");
160
+ }
161
+ function getOwn(record, key) {
162
+ return record != null && Object.prototype.hasOwnProperty.call(record, key) ? record[key] : void 0;
163
+ }
164
+ function validateDrawingData(data) {
165
+ for (const subUnitId of Object.keys(data)) {
166
+ assertSafeDrawingKeys(subUnitId);
167
+ const subUnit = data[subUnitId];
168
+ if (subUnit === null || subUnit === void 0 ? void 0 : subUnit.data) Object.keys(subUnit.data).forEach((key) => assertSafeDrawingKeys(key));
169
+ if (subUnit === null || subUnit === void 0 ? void 0 : subUnit.order) subUnit.order.forEach((key) => assertSafeDrawingKeys(key));
170
+ }
171
+ }
159
172
  /**
160
173
  * unitId -> subUnitId -> drawingId -> drawingParam
161
174
  */
@@ -226,10 +239,10 @@ var UnitDrawingService = class {
226
239
  this.refreshTransformNotification(updateParams);
227
240
  }
228
241
  getDrawingDataForUnit(unitId) {
229
- return this.drawingManagerData[unitId] || {};
242
+ return getOwn(this.drawingManagerData, unitId) || {};
230
243
  }
231
244
  removeDrawingDataForUnit(unitId) {
232
- const subUnits = this.drawingManagerData[unitId];
245
+ const subUnits = getOwn(this.drawingManagerData, unitId);
233
246
  if (subUnits == null) return;
234
247
  delete this.drawingManagerData[unitId];
235
248
  const drawings = [];
@@ -247,11 +260,13 @@ var UnitDrawingService = class {
247
260
  if (drawings.length > 0) this.removeNotification(drawings);
248
261
  }
249
262
  registerDrawingData(unitId, data) {
263
+ assertSafeDrawingKeys(unitId);
264
+ validateDrawingData(data);
250
265
  this.drawingManagerData[unitId] = data;
251
266
  }
252
267
  initializeNotification(unitId) {
253
268
  const drawings = [];
254
- const data = this.drawingManagerData[unitId];
269
+ const data = getOwn(this.drawingManagerData, unitId);
255
270
  if (data == null) return;
256
271
  Object.keys(data).forEach((subUnitId) => {
257
272
  this._establishDrawingMap(unitId, subUnitId);
@@ -270,6 +285,9 @@ var UnitDrawingService = class {
270
285
  return this._getDrawingData(unitId, subUnitId);
271
286
  }
272
287
  setDrawingData(unitId, subUnitId, data) {
288
+ assertSafeDrawingKeys(unitId, subUnitId);
289
+ Object.keys(data).forEach((key) => assertSafeDrawingKeys(key));
290
+ this._establishDrawingMap(unitId, subUnitId);
273
291
  const unitData = this.drawingManagerData[unitId];
274
292
  const subUnitData = unitData[subUnitId];
275
293
  this._oldDrawingManagerData = {
@@ -295,8 +313,8 @@ var UnitDrawingService = class {
295
313
  ops.push(op);
296
314
  invertOps.push(invertOp);
297
315
  });
298
- const op = ops.reduce(json1.type.compose, null);
299
- const invertOp = invertOps.reduce(json1.type.compose, null);
316
+ const op = ops.reduce(JSON1.type.compose, null);
317
+ const invertOp = invertOps.reduce(JSON1.type.compose, null);
300
318
  const { unitId, subUnitId } = insertParams[0];
301
319
  return {
302
320
  undo: invertOp,
@@ -391,9 +409,9 @@ var UnitDrawingService = class {
391
409
  ops.unshift(op);
392
410
  invertOps.push(invertOp);
393
411
  });
394
- const op = ops.reduce(json1.type.compose, null);
412
+ const op = ops.reduce(JSON1.type.compose, null);
395
413
  return {
396
- undo: invertOps.reduce(json1.type.compose, null),
414
+ undo: invertOps.reduce(JSON1.type.compose, null),
397
415
  redo: op,
398
416
  unitId,
399
417
  subUnitId,
@@ -425,8 +443,8 @@ var UnitDrawingService = class {
425
443
  objects
426
444
  };
427
445
  }
428
- const op = ops.reduce(json1.type.compose, null);
429
- const invertOp = invertOps.reduce(json1.type.compose, null);
446
+ const op = ops.reduce(JSON1.type.compose, null);
447
+ const invertOp = invertOps.reduce(JSON1.type.compose, null);
430
448
  const { unitId, subUnitId } = updateParams[0];
431
449
  return {
432
450
  undo: invertOp,
@@ -463,9 +481,9 @@ var UnitDrawingService = class {
463
481
  groupParams.forEach((groupParam) => {
464
482
  ops.push(this._getGroupDrawingOp(groupParam));
465
483
  });
466
- const op = ops.reduce(json1.type.compose, null);
484
+ const op = ops.reduce(JSON1.type.compose, null);
467
485
  return {
468
- undo: json1.type.invertWithDoc(op, this.drawingManagerData),
486
+ undo: JSON1.type.invertWithDoc(op, this.drawingManagerData),
469
487
  redo: op,
470
488
  unitId,
471
489
  subUnitId,
@@ -478,9 +496,9 @@ var UnitDrawingService = class {
478
496
  groupParams.forEach((groupParam) => {
479
497
  ops.push(this._getUngroupDrawingOp(groupParam));
480
498
  });
481
- const op = ops.reduce(json1.type.compose, null);
499
+ const op = ops.reduce(JSON1.type.compose, null);
482
500
  return {
483
- undo: json1.type.invertWithDoc(op, this.drawingManagerData),
501
+ undo: JSON1.type.invertWithDoc(op, this.drawingManagerData),
484
502
  redo: op,
485
503
  unitId,
486
504
  subUnitId,
@@ -545,7 +563,7 @@ var UnitDrawingService = class {
545
563
  const { parent, children } = groupParam;
546
564
  const { unitId: groupUnitId, subUnitId: groupSubUnitId, drawingId: groupDrawingId } = parent;
547
565
  const ops = [];
548
- ops.push(json1.insertOp([
566
+ ops.push(JSON1.insertOp([
549
567
  groupUnitId,
550
568
  groupSubUnitId,
551
569
  "data",
@@ -567,13 +585,13 @@ var UnitDrawingService = class {
567
585
  })));
568
586
  });
569
587
  if (maxChildIndex === Number.NEGATIVE_INFINITY) maxChildIndex = this._getDrawingOrder(groupUnitId, groupSubUnitId).length;
570
- ops.push(json1.insertOp([
588
+ ops.push(JSON1.insertOp([
571
589
  groupUnitId,
572
590
  groupSubUnitId,
573
591
  "order",
574
592
  maxChildIndex
575
593
  ], groupDrawingId));
576
- return ops.reduce(json1.type.compose, null);
594
+ return ops.reduce(JSON1.type.compose, null);
577
595
  }
578
596
  _getUngroupDrawingOp(groupParam) {
579
597
  const { parent, children } = groupParam;
@@ -587,24 +605,41 @@ var UnitDrawingService = class {
587
605
  drawingId
588
606
  })));
589
607
  });
590
- ops.push(json1.removeOp([
608
+ ops.push(JSON1.removeOp([
591
609
  groupUnitId,
592
610
  groupSubUnitId,
593
611
  "data",
594
612
  groupDrawingId
595
613
  ], true));
596
- ops.push(json1.removeOp([
614
+ ops.push(JSON1.removeOp([
597
615
  groupUnitId,
598
616
  groupSubUnitId,
599
617
  "order",
600
618
  this._getDrawingOrder(groupUnitId, groupSubUnitId).indexOf(groupDrawingId)
601
619
  ], true));
602
- return ops.reduce(json1.type.compose, null);
620
+ return ops.reduce(JSON1.type.compose, null);
603
621
  }
604
622
  applyJson1(unitId, subUnitId, jsonOp) {
605
- this._establishDrawingMap(unitId, subUnitId);
606
- this._oldDrawingManagerData = { ...this.drawingManagerData };
607
- this.drawingManagerData = json1.type.apply(this.drawingManagerData, jsonOp);
623
+ assertSafeDrawingKeys(unitId, subUnitId);
624
+ JSON1.type.checkValidOp(jsonOp);
625
+ const unitData = getOwn(this.drawingManagerData, unitId);
626
+ const data = {
627
+ ...this.drawingManagerData,
628
+ [unitId]: {
629
+ ...unitData,
630
+ [subUnitId]: getOwn(unitData, subUnitId) ?? {
631
+ data: {},
632
+ order: []
633
+ }
634
+ }
635
+ };
636
+ const nextData = JSON1.type.apply(data, jsonOp);
637
+ for (const id of Object.keys(nextData)) {
638
+ assertSafeDrawingKeys(id);
639
+ validateDrawingData(nextData[id]);
640
+ }
641
+ this._oldDrawingManagerData = this.drawingManagerData;
642
+ this.drawingManagerData = nextData;
608
643
  }
609
644
  featurePluginUpdateNotification(updateParams) {
610
645
  this._featurePluginUpdate$.next(updateParams);
@@ -670,6 +705,9 @@ var UnitDrawingService = class {
670
705
  return this._getDrawingOrder(unitId, subUnitId);
671
706
  }
672
707
  setDrawingOrder(unitId, subUnitId, order) {
708
+ assertSafeDrawingKeys(unitId, subUnitId);
709
+ order.forEach((key) => assertSafeDrawingKeys(key));
710
+ this._establishDrawingMap(unitId, subUnitId);
673
711
  this.drawingManagerData[unitId][subUnitId].order = order;
674
712
  }
675
713
  orderUpdateNotification(orderParams) {
@@ -687,7 +725,7 @@ var UnitDrawingService = class {
687
725
  drawingId
688
726
  });
689
727
  if (index === -1 || index === orders.length - 1) return;
690
- const op = json1.moveOp([
728
+ const op = JSON1.moveOp([
691
729
  unitId,
692
730
  subUnitId,
693
731
  "order",
@@ -701,9 +739,9 @@ var UnitDrawingService = class {
701
739
  ops.push(op);
702
740
  if (!newIds.includes(orders[index + 1])) newIds.push(orders[index + 1]);
703
741
  });
704
- const op = ops.reduce(json1.type.compose, null);
742
+ const op = ops.reduce(JSON1.type.compose, null);
705
743
  return {
706
- undo: json1.type.invertWithDoc(op, this.drawingManagerData),
744
+ undo: JSON1.type.invertWithDoc(op, this.drawingManagerData),
707
745
  redo: op,
708
746
  unitId,
709
747
  subUnitId,
@@ -725,7 +763,7 @@ var UnitDrawingService = class {
725
763
  drawingId
726
764
  });
727
765
  if (index === -1 || index === 0) return;
728
- const op = json1.moveOp([
766
+ const op = JSON1.moveOp([
729
767
  unitId,
730
768
  subUnitId,
731
769
  "order",
@@ -739,9 +777,9 @@ var UnitDrawingService = class {
739
777
  ops.push(op);
740
778
  if (!newIds.includes(orders[index - 1])) newIds.push(orders[index - 1]);
741
779
  });
742
- const op = ops.reduce(json1.type.compose, null);
780
+ const op = ops.reduce(JSON1.type.compose, null);
743
781
  return {
744
- undo: json1.type.invertWithDoc(op, this.drawingManagerData),
782
+ undo: JSON1.type.invertWithDoc(op, this.drawingManagerData),
745
783
  redo: op,
746
784
  unitId,
747
785
  subUnitId,
@@ -760,7 +798,7 @@ var UnitDrawingService = class {
760
798
  orderDrawingIds.forEach((orderDrawingId) => {
761
799
  const { drawingId } = orderDrawingId;
762
800
  const index = this._getDrawingCount(unitId, subUnitId) - 1;
763
- const op = json1.moveOp([
801
+ const op = JSON1.moveOp([
764
802
  unitId,
765
803
  subUnitId,
766
804
  "order",
@@ -774,9 +812,9 @@ var UnitDrawingService = class {
774
812
  ops.push(op);
775
813
  if (!newIds.includes(orders[index])) newIds.push(orders[index]);
776
814
  });
777
- const op = ops.reduce(json1.type.compose, null);
815
+ const op = ops.reduce(JSON1.type.compose, null);
778
816
  return {
779
- undo: json1.type.invertWithDoc(op, this.drawingManagerData),
817
+ undo: JSON1.type.invertWithDoc(op, this.drawingManagerData),
780
818
  redo: op,
781
819
  unitId,
782
820
  subUnitId,
@@ -794,7 +832,7 @@ var UnitDrawingService = class {
794
832
  const ops = [];
795
833
  orderSearchParams.forEach((orderSearchParam) => {
796
834
  const { drawingId } = orderSearchParam;
797
- const op = json1.moveOp([
835
+ const op = JSON1.moveOp([
798
836
  unitId,
799
837
  subUnitId,
800
838
  "order",
@@ -808,9 +846,9 @@ var UnitDrawingService = class {
808
846
  ops.push(op);
809
847
  if (!newIds.includes(orders[0])) newIds.push(orders[0]);
810
848
  });
811
- const op = ops.reduce(json1.type.compose, null);
849
+ const op = ops.reduce(JSON1.type.compose, null);
812
850
  return {
813
- undo: json1.type.invertWithDoc(op, this.drawingManagerData),
851
+ undo: JSON1.type.invertWithDoc(op, this.drawingManagerData),
814
852
  redo: op,
815
853
  unitId,
816
854
  subUnitId,
@@ -828,7 +866,7 @@ var UnitDrawingService = class {
828
866
  const currentIndex = orders.indexOf(drawingId);
829
867
  const targetIndex = normalizeDrawingOrderIndex(zOrder, orders.length);
830
868
  if (currentIndex < 0 || currentIndex === targetIndex) return null;
831
- const op = json1.moveOp([
869
+ const op = JSON1.moveOp([
832
870
  unitId,
833
871
  subUnitId,
834
872
  "order",
@@ -839,7 +877,7 @@ var UnitDrawingService = class {
839
877
  "order",
840
878
  targetIndex
841
879
  ]);
842
- const invertOp = json1.type.invertWithDoc(op, this.drawingManagerData);
880
+ const invertOp = JSON1.type.invertWithDoc(op, this.drawingManagerData);
843
881
  const affectedDrawingIds = orders.slice(Math.min(currentIndex, targetIndex), Math.max(currentIndex, targetIndex) + 1);
844
882
  return {
845
883
  undo: invertOp,
@@ -874,44 +912,45 @@ var UnitDrawingService = class {
874
912
  return this._getDrawingOrder(unitId, subUnitId).indexOf(drawingId);
875
913
  }
876
914
  _getCurrentBySearch(searchParam) {
877
- var _this$drawingManagerD;
915
+ var _getOwn;
878
916
  if (searchParam == null) return;
879
917
  const { unitId, subUnitId, drawingId } = searchParam;
880
- return (_this$drawingManagerD = this.drawingManagerData[unitId]) === null || _this$drawingManagerD === void 0 || (_this$drawingManagerD = _this$drawingManagerD[subUnitId]) === null || _this$drawingManagerD === void 0 || (_this$drawingManagerD = _this$drawingManagerD.data) === null || _this$drawingManagerD === void 0 ? void 0 : _this$drawingManagerD[drawingId];
918
+ return getOwn((_getOwn = getOwn(getOwn(this.drawingManagerData, unitId), subUnitId)) === null || _getOwn === void 0 ? void 0 : _getOwn.data, drawingId);
881
919
  }
882
920
  _getOldBySearch(searchParam) {
883
- var _this$_oldDrawingMana;
921
+ var _getOwn2;
884
922
  if (searchParam == null) return;
885
923
  const { unitId, subUnitId, drawingId } = searchParam;
886
- return (_this$_oldDrawingMana = this._oldDrawingManagerData[unitId]) === null || _this$_oldDrawingMana === void 0 || (_this$_oldDrawingMana = _this$_oldDrawingMana[subUnitId]) === null || _this$_oldDrawingMana === void 0 || (_this$_oldDrawingMana = _this$_oldDrawingMana.data) === null || _this$_oldDrawingMana === void 0 ? void 0 : _this$_oldDrawingMana[drawingId];
924
+ return getOwn((_getOwn2 = getOwn(getOwn(this._oldDrawingManagerData, unitId), subUnitId)) === null || _getOwn2 === void 0 ? void 0 : _getOwn2.data, drawingId);
887
925
  }
888
926
  _establishDrawingMap(unitId, subUnitId, drawingId) {
889
- var _this$drawingManagerD2;
890
- if (!this.drawingManagerData[unitId]) this.drawingManagerData[unitId] = {};
891
- if (!this.drawingManagerData[unitId][subUnitId]) this.drawingManagerData[unitId][subUnitId] = {
927
+ assertSafeDrawingKeys(unitId, subUnitId);
928
+ if (drawingId != null) assertSafeDrawingKeys(drawingId);
929
+ if (!getOwn(this.drawingManagerData, unitId)) this.drawingManagerData[unitId] = {};
930
+ if (!getOwn(this.drawingManagerData[unitId], subUnitId)) this.drawingManagerData[unitId][subUnitId] = {
892
931
  data: {},
893
932
  order: []
894
933
  };
895
934
  if (drawingId == null) return null;
896
- return (_this$drawingManagerD2 = this.drawingManagerData[unitId][subUnitId].data) === null || _this$drawingManagerD2 === void 0 ? void 0 : _this$drawingManagerD2[drawingId];
935
+ return getOwn(this.drawingManagerData[unitId][subUnitId].data, drawingId);
897
936
  }
898
937
  _addByParam(insertParam) {
899
938
  const { unitId, subUnitId, drawingId } = insertParam;
900
939
  this._establishDrawingMap(unitId, subUnitId, drawingId);
901
- const op = [json1.insertOp([
940
+ const op = [JSON1.insertOp([
902
941
  unitId,
903
942
  subUnitId,
904
943
  "data",
905
944
  drawingId
906
- ], insertParam), json1.insertOp([
945
+ ], insertParam), JSON1.insertOp([
907
946
  unitId,
908
947
  subUnitId,
909
948
  "order",
910
949
  this._getDrawingOrder(unitId, subUnitId).length
911
- ], drawingId)].reduce(json1.type.compose, null);
950
+ ], drawingId)].reduce(JSON1.type.compose, null);
912
951
  return {
913
952
  op,
914
- invertOp: json1.type.invertWithDoc(op, this.drawingManagerData)
953
+ invertOp: JSON1.type.invertWithDoc(op, this.drawingManagerData)
915
954
  };
916
955
  }
917
956
  _removeByParam(searchParam) {
@@ -924,20 +963,20 @@ var UnitDrawingService = class {
924
963
  op: [],
925
964
  invertOp: []
926
965
  };
927
- const op = [json1.removeOp([
966
+ const op = [JSON1.removeOp([
928
967
  unitId,
929
968
  subUnitId,
930
969
  "data",
931
970
  drawingId
932
- ], true), json1.removeOp([
971
+ ], true), JSON1.removeOp([
933
972
  unitId,
934
973
  subUnitId,
935
974
  "order",
936
975
  this._getDrawingOrder(unitId, subUnitId).indexOf(drawingId)
937
- ], true)].reduce(json1.type.compose, null);
976
+ ], true)].reduce(JSON1.type.compose, null);
938
977
  return {
939
978
  op,
940
- invertOp: json1.type.invertWithDoc(op, this.drawingManagerData)
979
+ invertOp: JSON1.type.invertWithDoc(op, this.drawingManagerData)
941
980
  };
942
981
  }
943
982
  _updateByParam(updateParam) {
@@ -952,10 +991,10 @@ var UnitDrawingService = class {
952
991
  op: [],
953
992
  invertOp: []
954
993
  };
955
- const op = ops.reduce(json1.type.compose, null);
994
+ const op = ops.reduce(JSON1.type.compose, null);
956
995
  return {
957
996
  op,
958
- invertOp: json1.type.invert(op)
997
+ invertOp: JSON1.type.invert(op)
959
998
  };
960
999
  }
961
1000
  _getUpdateParamCompareOp(newParam, oldParam) {
@@ -976,12 +1015,12 @@ var UnitDrawingService = class {
976
1015
  return ops;
977
1016
  }
978
1017
  _getDrawingData(unitId, subUnitId) {
979
- var _this$drawingManagerD3;
980
- return ((_this$drawingManagerD3 = this.drawingManagerData[unitId]) === null || _this$drawingManagerD3 === void 0 || (_this$drawingManagerD3 = _this$drawingManagerD3[subUnitId]) === null || _this$drawingManagerD3 === void 0 ? void 0 : _this$drawingManagerD3.data) || {};
1018
+ var _getOwn3;
1019
+ return ((_getOwn3 = getOwn(getOwn(this.drawingManagerData, unitId), subUnitId)) === null || _getOwn3 === void 0 ? void 0 : _getOwn3.data) || {};
981
1020
  }
982
1021
  _getDrawingOrder(unitId, subUnitId) {
983
- var _this$drawingManagerD4;
984
- return ((_this$drawingManagerD4 = this.drawingManagerData[unitId]) === null || _this$drawingManagerD4 === void 0 || (_this$drawingManagerD4 = _this$drawingManagerD4[subUnitId]) === null || _this$drawingManagerD4 === void 0 ? void 0 : _this$drawingManagerD4.order) || [];
1022
+ var _getOwn4;
1023
+ return ((_getOwn4 = getOwn(getOwn(this.drawingManagerData, unitId), subUnitId)) === null || _getOwn4 === void 0 ? void 0 : _getOwn4.order) || [];
985
1024
  }
986
1025
  getDrawingVisible() {
987
1026
  return this._visible;
@@ -1102,7 +1141,7 @@ var URLImageService = class extends Disposable {
1102
1141
  };
1103
1142
 
1104
1143
  //#endregion
1105
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
1144
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorateParam.js
1106
1145
  function __decorateParam(paramIndex, decorator) {
1107
1146
  return function(target, key) {
1108
1147
  decorator(target, key, paramIndex);
@@ -1110,7 +1149,7 @@ function __decorateParam(paramIndex, decorator) {
1110
1149
  }
1111
1150
 
1112
1151
  //#endregion
1113
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
1152
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorate.js
1114
1153
  function __decorate(decorators, target, key, desc) {
1115
1154
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1116
1155
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1220,6 +1259,8 @@ const DRAWING_GROUPABLE_TYPES = [
1220
1259
  DrawingTypeEnum.DRAWING_IMAGE,
1221
1260
  DrawingTypeEnum.DRAWING_SHAPE,
1222
1261
  DrawingTypeEnum.DRAWING_CHART,
1262
+ DrawingTypeEnum.DRAWING_SLICER,
1263
+ DrawingTypeEnum.DRAWING_TIMELINE,
1223
1264
  DrawingTypeEnum.DRAWING_GROUP
1224
1265
  ];
1225
1266
  function isGroupableDrawingType(type) {