microboard-temp 0.4.4 → 0.4.5

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.
@@ -17771,15 +17771,17 @@ class EditorContainer {
17771
17771
  if (isRecordingOperations) {
17772
17772
  const isSettingNodeFontSize = operation.type === "set_node" && "fontSize" in operation.newProperties && "fontSize" in operation.properties;
17773
17773
  if (isSettingNodeFontSize) {
17774
- const isSettingNodeFontSizeToAuto = operation.newProperties.fontSize === "auto";
17774
+ const newProperties = operation.newProperties;
17775
+ const properties = operation.properties;
17776
+ const isSettingNodeFontSizeToAuto = newProperties.fontSize === "auto";
17775
17777
  if (isSettingNodeFontSizeToAuto) {
17776
- operation.newProperties.fontSize = 14;
17777
- operation.newProperties.enableAuto = true;
17778
- operation.properties.enableAuto = false;
17778
+ newProperties.fontSize = 14;
17779
+ newProperties.enableAuto = true;
17780
+ properties.enableAuto = false;
17779
17781
  } else {
17780
- operation.newProperties.enableAuto = false;
17782
+ newProperties.enableAuto = false;
17781
17783
  if (this.getAutosize()) {
17782
- operation.properties.enableAuto = true;
17784
+ properties.enableAuto = true;
17783
17785
  }
17784
17786
  }
17785
17787
  }
@@ -17862,7 +17864,7 @@ class EditorContainer {
17862
17864
  stopOpRecordingAndGetOps() {
17863
17865
  const op = this.recordedOps;
17864
17866
  this.recordedOps = null;
17865
- const opsArr = op?.ops ?? op ?? [];
17867
+ const opsArr = op ? "ops" in op ? op.ops : op : [];
17866
17868
  return opsArr.filter((op2) => op2.type !== "set_selection");
17867
17869
  }
17868
17870
  applyRichTextOp(op) {
@@ -17885,7 +17887,6 @@ class EditorContainer {
17885
17887
  case "setSelectionHorizontalAlignment":
17886
17888
  this.applySelectionOp(op);
17887
17889
  break;
17888
- case "setBlockType":
17889
17890
  case "setFontStyle":
17890
17891
  case "setFontColor":
17891
17892
  case "setFontFamily":
@@ -17900,7 +17901,11 @@ class EditorContainer {
17900
17901
  }
17901
17902
  } catch (error) {
17902
17903
  console.error("Error in applying RichText Operation in Item: ", this.id, error);
17903
- console.error("Error applying this type operation: ", op.ops?.map((op2) => op2.type));
17904
+ const operations2 = [];
17905
+ if ("ops" in op && Array.isArray(op.ops)) {
17906
+ operations2.push(...op.ops.map((op2) => op2.type));
17907
+ }
17908
+ console.error("Error applying this type operation: ", operations2);
17904
17909
  }
17905
17910
  }
17906
17911
  applySelectionEdit(op) {
@@ -17930,7 +17935,6 @@ class EditorContainer {
17930
17935
  this.setSelectionFontColor(op.fontColor);
17931
17936
  break;
17932
17937
  case "setFontFamily":
17933
- this.setSelectionFontFamily(op.fontFamily);
17934
17938
  break;
17935
17939
  case "setFontSize":
17936
17940
  this.textScale = Number(op.fontSize) / this.getScale() / this.initialTextStyles.fontSize;
package/dist/cjs/index.js CHANGED
@@ -17771,15 +17771,17 @@ class EditorContainer {
17771
17771
  if (isRecordingOperations) {
17772
17772
  const isSettingNodeFontSize = operation.type === "set_node" && "fontSize" in operation.newProperties && "fontSize" in operation.properties;
17773
17773
  if (isSettingNodeFontSize) {
17774
- const isSettingNodeFontSizeToAuto = operation.newProperties.fontSize === "auto";
17774
+ const newProperties = operation.newProperties;
17775
+ const properties = operation.properties;
17776
+ const isSettingNodeFontSizeToAuto = newProperties.fontSize === "auto";
17775
17777
  if (isSettingNodeFontSizeToAuto) {
17776
- operation.newProperties.fontSize = 14;
17777
- operation.newProperties.enableAuto = true;
17778
- operation.properties.enableAuto = false;
17778
+ newProperties.fontSize = 14;
17779
+ newProperties.enableAuto = true;
17780
+ properties.enableAuto = false;
17779
17781
  } else {
17780
- operation.newProperties.enableAuto = false;
17782
+ newProperties.enableAuto = false;
17781
17783
  if (this.getAutosize()) {
17782
- operation.properties.enableAuto = true;
17784
+ properties.enableAuto = true;
17783
17785
  }
17784
17786
  }
17785
17787
  }
@@ -17862,7 +17864,7 @@ class EditorContainer {
17862
17864
  stopOpRecordingAndGetOps() {
17863
17865
  const op = this.recordedOps;
17864
17866
  this.recordedOps = null;
17865
- const opsArr = op?.ops ?? op ?? [];
17867
+ const opsArr = op ? "ops" in op ? op.ops : op : [];
17866
17868
  return opsArr.filter((op2) => op2.type !== "set_selection");
17867
17869
  }
17868
17870
  applyRichTextOp(op) {
@@ -17885,7 +17887,6 @@ class EditorContainer {
17885
17887
  case "setSelectionHorizontalAlignment":
17886
17888
  this.applySelectionOp(op);
17887
17889
  break;
17888
- case "setBlockType":
17889
17890
  case "setFontStyle":
17890
17891
  case "setFontColor":
17891
17892
  case "setFontFamily":
@@ -17900,7 +17901,11 @@ class EditorContainer {
17900
17901
  }
17901
17902
  } catch (error) {
17902
17903
  console.error("Error in applying RichText Operation in Item: ", this.id, error);
17903
- console.error("Error applying this type operation: ", op.ops?.map((op2) => op2.type));
17904
+ const operations2 = [];
17905
+ if ("ops" in op && Array.isArray(op.ops)) {
17906
+ operations2.push(...op.ops.map((op2) => op2.type));
17907
+ }
17908
+ console.error("Error applying this type operation: ", operations2);
17904
17909
  }
17905
17910
  }
17906
17911
  applySelectionEdit(op) {
@@ -17930,7 +17935,6 @@ class EditorContainer {
17930
17935
  this.setSelectionFontColor(op.fontColor);
17931
17936
  break;
17932
17937
  case "setFontFamily":
17933
- this.setSelectionFontFamily(op.fontFamily);
17934
17938
  break;
17935
17939
  case "setFontSize":
17936
17940
  this.textScale = Number(op.fontSize) / this.getScale() / this.initialTextStyles.fontSize;
package/dist/cjs/node.js CHANGED
@@ -20311,15 +20311,17 @@ class EditorContainer {
20311
20311
  if (isRecordingOperations) {
20312
20312
  const isSettingNodeFontSize = operation.type === "set_node" && "fontSize" in operation.newProperties && "fontSize" in operation.properties;
20313
20313
  if (isSettingNodeFontSize) {
20314
- const isSettingNodeFontSizeToAuto = operation.newProperties.fontSize === "auto";
20314
+ const newProperties = operation.newProperties;
20315
+ const properties = operation.properties;
20316
+ const isSettingNodeFontSizeToAuto = newProperties.fontSize === "auto";
20315
20317
  if (isSettingNodeFontSizeToAuto) {
20316
- operation.newProperties.fontSize = 14;
20317
- operation.newProperties.enableAuto = true;
20318
- operation.properties.enableAuto = false;
20318
+ newProperties.fontSize = 14;
20319
+ newProperties.enableAuto = true;
20320
+ properties.enableAuto = false;
20319
20321
  } else {
20320
- operation.newProperties.enableAuto = false;
20322
+ newProperties.enableAuto = false;
20321
20323
  if (this.getAutosize()) {
20322
- operation.properties.enableAuto = true;
20324
+ properties.enableAuto = true;
20323
20325
  }
20324
20326
  }
20325
20327
  }
@@ -20402,7 +20404,7 @@ class EditorContainer {
20402
20404
  stopOpRecordingAndGetOps() {
20403
20405
  const op = this.recordedOps;
20404
20406
  this.recordedOps = null;
20405
- const opsArr = op?.ops ?? op ?? [];
20407
+ const opsArr = op ? "ops" in op ? op.ops : op : [];
20406
20408
  return opsArr.filter((op2) => op2.type !== "set_selection");
20407
20409
  }
20408
20410
  applyRichTextOp(op) {
@@ -20425,7 +20427,6 @@ class EditorContainer {
20425
20427
  case "setSelectionHorizontalAlignment":
20426
20428
  this.applySelectionOp(op);
20427
20429
  break;
20428
- case "setBlockType":
20429
20430
  case "setFontStyle":
20430
20431
  case "setFontColor":
20431
20432
  case "setFontFamily":
@@ -20440,7 +20441,11 @@ class EditorContainer {
20440
20441
  }
20441
20442
  } catch (error) {
20442
20443
  console.error("Error in applying RichText Operation in Item: ", this.id, error);
20443
- console.error("Error applying this type operation: ", op.ops?.map((op2) => op2.type));
20444
+ const operations2 = [];
20445
+ if ("ops" in op && Array.isArray(op.ops)) {
20446
+ operations2.push(...op.ops.map((op2) => op2.type));
20447
+ }
20448
+ console.error("Error applying this type operation: ", operations2);
20444
20449
  }
20445
20450
  }
20446
20451
  applySelectionEdit(op) {
@@ -20470,7 +20475,6 @@ class EditorContainer {
20470
20475
  this.setSelectionFontColor(op.fontColor);
20471
20476
  break;
20472
20477
  case "setFontFamily":
20473
- this.setSelectionFontFamily(op.fontFamily);
20474
20478
  break;
20475
20479
  case "setFontSize":
20476
20480
  this.textScale = Number(op.fontSize) / this.getScale() / this.initialTextStyles.fontSize;
@@ -17624,15 +17624,17 @@ class EditorContainer {
17624
17624
  if (isRecordingOperations) {
17625
17625
  const isSettingNodeFontSize = operation.type === "set_node" && "fontSize" in operation.newProperties && "fontSize" in operation.properties;
17626
17626
  if (isSettingNodeFontSize) {
17627
- const isSettingNodeFontSizeToAuto = operation.newProperties.fontSize === "auto";
17627
+ const newProperties = operation.newProperties;
17628
+ const properties = operation.properties;
17629
+ const isSettingNodeFontSizeToAuto = newProperties.fontSize === "auto";
17628
17630
  if (isSettingNodeFontSizeToAuto) {
17629
- operation.newProperties.fontSize = 14;
17630
- operation.newProperties.enableAuto = true;
17631
- operation.properties.enableAuto = false;
17631
+ newProperties.fontSize = 14;
17632
+ newProperties.enableAuto = true;
17633
+ properties.enableAuto = false;
17632
17634
  } else {
17633
- operation.newProperties.enableAuto = false;
17635
+ newProperties.enableAuto = false;
17634
17636
  if (this.getAutosize()) {
17635
- operation.properties.enableAuto = true;
17637
+ properties.enableAuto = true;
17636
17638
  }
17637
17639
  }
17638
17640
  }
@@ -17715,7 +17717,7 @@ class EditorContainer {
17715
17717
  stopOpRecordingAndGetOps() {
17716
17718
  const op = this.recordedOps;
17717
17719
  this.recordedOps = null;
17718
- const opsArr = op?.ops ?? op ?? [];
17720
+ const opsArr = op ? "ops" in op ? op.ops : op : [];
17719
17721
  return opsArr.filter((op2) => op2.type !== "set_selection");
17720
17722
  }
17721
17723
  applyRichTextOp(op) {
@@ -17738,7 +17740,6 @@ class EditorContainer {
17738
17740
  case "setSelectionHorizontalAlignment":
17739
17741
  this.applySelectionOp(op);
17740
17742
  break;
17741
- case "setBlockType":
17742
17743
  case "setFontStyle":
17743
17744
  case "setFontColor":
17744
17745
  case "setFontFamily":
@@ -17753,7 +17754,11 @@ class EditorContainer {
17753
17754
  }
17754
17755
  } catch (error) {
17755
17756
  console.error("Error in applying RichText Operation in Item: ", this.id, error);
17756
- console.error("Error applying this type operation: ", op.ops?.map((op2) => op2.type));
17757
+ const operations2 = [];
17758
+ if ("ops" in op && Array.isArray(op.ops)) {
17759
+ operations2.push(...op.ops.map((op2) => op2.type));
17760
+ }
17761
+ console.error("Error applying this type operation: ", operations2);
17757
17762
  }
17758
17763
  }
17759
17764
  applySelectionEdit(op) {
@@ -17783,7 +17788,6 @@ class EditorContainer {
17783
17788
  this.setSelectionFontColor(op.fontColor);
17784
17789
  break;
17785
17790
  case "setFontFamily":
17786
- this.setSelectionFontFamily(op.fontFamily);
17787
17791
  break;
17788
17792
  case "setFontSize":
17789
17793
  this.textScale = Number(op.fontSize) / this.getScale() / this.initialTextStyles.fontSize;
package/dist/esm/index.js CHANGED
@@ -17617,15 +17617,17 @@ class EditorContainer {
17617
17617
  if (isRecordingOperations) {
17618
17618
  const isSettingNodeFontSize = operation.type === "set_node" && "fontSize" in operation.newProperties && "fontSize" in operation.properties;
17619
17619
  if (isSettingNodeFontSize) {
17620
- const isSettingNodeFontSizeToAuto = operation.newProperties.fontSize === "auto";
17620
+ const newProperties = operation.newProperties;
17621
+ const properties = operation.properties;
17622
+ const isSettingNodeFontSizeToAuto = newProperties.fontSize === "auto";
17621
17623
  if (isSettingNodeFontSizeToAuto) {
17622
- operation.newProperties.fontSize = 14;
17623
- operation.newProperties.enableAuto = true;
17624
- operation.properties.enableAuto = false;
17624
+ newProperties.fontSize = 14;
17625
+ newProperties.enableAuto = true;
17626
+ properties.enableAuto = false;
17625
17627
  } else {
17626
- operation.newProperties.enableAuto = false;
17628
+ newProperties.enableAuto = false;
17627
17629
  if (this.getAutosize()) {
17628
- operation.properties.enableAuto = true;
17630
+ properties.enableAuto = true;
17629
17631
  }
17630
17632
  }
17631
17633
  }
@@ -17708,7 +17710,7 @@ class EditorContainer {
17708
17710
  stopOpRecordingAndGetOps() {
17709
17711
  const op = this.recordedOps;
17710
17712
  this.recordedOps = null;
17711
- const opsArr = op?.ops ?? op ?? [];
17713
+ const opsArr = op ? "ops" in op ? op.ops : op : [];
17712
17714
  return opsArr.filter((op2) => op2.type !== "set_selection");
17713
17715
  }
17714
17716
  applyRichTextOp(op) {
@@ -17731,7 +17733,6 @@ class EditorContainer {
17731
17733
  case "setSelectionHorizontalAlignment":
17732
17734
  this.applySelectionOp(op);
17733
17735
  break;
17734
- case "setBlockType":
17735
17736
  case "setFontStyle":
17736
17737
  case "setFontColor":
17737
17738
  case "setFontFamily":
@@ -17746,7 +17747,11 @@ class EditorContainer {
17746
17747
  }
17747
17748
  } catch (error) {
17748
17749
  console.error("Error in applying RichText Operation in Item: ", this.id, error);
17749
- console.error("Error applying this type operation: ", op.ops?.map((op2) => op2.type));
17750
+ const operations2 = [];
17751
+ if ("ops" in op && Array.isArray(op.ops)) {
17752
+ operations2.push(...op.ops.map((op2) => op2.type));
17753
+ }
17754
+ console.error("Error applying this type operation: ", operations2);
17750
17755
  }
17751
17756
  }
17752
17757
  applySelectionEdit(op) {
@@ -17776,7 +17781,6 @@ class EditorContainer {
17776
17781
  this.setSelectionFontColor(op.fontColor);
17777
17782
  break;
17778
17783
  case "setFontFamily":
17779
- this.setSelectionFontFamily(op.fontFamily);
17780
17784
  break;
17781
17785
  case "setFontSize":
17782
17786
  this.textScale = Number(op.fontSize) / this.getScale() / this.initialTextStyles.fontSize;
package/dist/esm/node.js CHANGED
@@ -20152,15 +20152,17 @@ class EditorContainer {
20152
20152
  if (isRecordingOperations) {
20153
20153
  const isSettingNodeFontSize = operation.type === "set_node" && "fontSize" in operation.newProperties && "fontSize" in operation.properties;
20154
20154
  if (isSettingNodeFontSize) {
20155
- const isSettingNodeFontSizeToAuto = operation.newProperties.fontSize === "auto";
20155
+ const newProperties = operation.newProperties;
20156
+ const properties = operation.properties;
20157
+ const isSettingNodeFontSizeToAuto = newProperties.fontSize === "auto";
20156
20158
  if (isSettingNodeFontSizeToAuto) {
20157
- operation.newProperties.fontSize = 14;
20158
- operation.newProperties.enableAuto = true;
20159
- operation.properties.enableAuto = false;
20159
+ newProperties.fontSize = 14;
20160
+ newProperties.enableAuto = true;
20161
+ properties.enableAuto = false;
20160
20162
  } else {
20161
- operation.newProperties.enableAuto = false;
20163
+ newProperties.enableAuto = false;
20162
20164
  if (this.getAutosize()) {
20163
- operation.properties.enableAuto = true;
20165
+ properties.enableAuto = true;
20164
20166
  }
20165
20167
  }
20166
20168
  }
@@ -20243,7 +20245,7 @@ class EditorContainer {
20243
20245
  stopOpRecordingAndGetOps() {
20244
20246
  const op = this.recordedOps;
20245
20247
  this.recordedOps = null;
20246
- const opsArr = op?.ops ?? op ?? [];
20248
+ const opsArr = op ? "ops" in op ? op.ops : op : [];
20247
20249
  return opsArr.filter((op2) => op2.type !== "set_selection");
20248
20250
  }
20249
20251
  applyRichTextOp(op) {
@@ -20266,7 +20268,6 @@ class EditorContainer {
20266
20268
  case "setSelectionHorizontalAlignment":
20267
20269
  this.applySelectionOp(op);
20268
20270
  break;
20269
- case "setBlockType":
20270
20271
  case "setFontStyle":
20271
20272
  case "setFontColor":
20272
20273
  case "setFontFamily":
@@ -20281,7 +20282,11 @@ class EditorContainer {
20281
20282
  }
20282
20283
  } catch (error) {
20283
20284
  console.error("Error in applying RichText Operation in Item: ", this.id, error);
20284
- console.error("Error applying this type operation: ", op.ops?.map((op2) => op2.type));
20285
+ const operations2 = [];
20286
+ if ("ops" in op && Array.isArray(op.ops)) {
20287
+ operations2.push(...op.ops.map((op2) => op2.type));
20288
+ }
20289
+ console.error("Error applying this type operation: ", operations2);
20285
20290
  }
20286
20291
  }
20287
20292
  applySelectionEdit(op) {
@@ -20311,7 +20316,6 @@ class EditorContainer {
20311
20316
  this.setSelectionFontColor(op.fontColor);
20312
20317
  break;
20313
20318
  case "setFontFamily":
20314
- this.setSelectionFontFamily(op.fontFamily);
20315
20319
  break;
20316
20320
  case "setFontSize":
20317
20321
  this.textScale = Number(op.fontSize) / this.getScale() / this.initialTextStyles.fontSize;
@@ -1,3 +1,3 @@
1
1
  import { Path } from "../../Path";
2
- import { BoardPoint, ControlPoint } from "../ControlPoint";
3
- export declare function getCurvedLine(start: ControlPoint, end: ControlPoint, middle: BoardPoint | null): Path;
2
+ import { ControlPoint } from "../ControlPoint";
3
+ export declare function getCurvedLine(start: ControlPoint, end: ControlPoint, middle: ControlPoint | null): Path;
@@ -1,3 +1,3 @@
1
1
  import { Path } from 'Items';
2
- import { ControlPoint, BoardPoint } from '../ControlPoint';
3
- export declare function getOrthogonalLine(start: ControlPoint, end: ControlPoint, middle: BoardPoint | null, skipObstacles?: boolean): Path;
2
+ import { ControlPoint } from '../ControlPoint';
3
+ export declare function getOrthogonalLine(start: ControlPoint, end: ControlPoint, middle: ControlPoint | null, skipObstacles?: boolean): Path;
@@ -38,8 +38,8 @@ export declare class EditorContainer {
38
38
  constructor(id: string, emit: (op: RichTextOperation) => void, emitWithoutApplying: (op: RichTextOperation) => void, undo: () => void, redo: () => void, getScale: () => number, horisontalAlignment: HorisontalAlignment, initialTextStyles: DefaultTextStyles, fontSize: number, getAutosize: () => boolean, autosizeEnable: () => void, autosizeDisable: () => void, getFontSize: () => number, getMatrixScale: () => number, getOnLimitReached: () => () => void, calcAutoSize: (textNodes?: BlockNode[]) => number, applyAutoSizeScale: (textScale: number, blockNodes?: BlockNode[]) => void, updateElement: () => void);
39
39
  setId(id: string): this;
40
40
  startOpRecording(op?: SlateOp): void;
41
- getTextFromNode(node: BlockNode): string;
42
- getEndNodePath(node: BlockNode, nodePath: number[]): {
41
+ getTextFromNode(node: BlockNode | TextNode): string;
42
+ getEndNodePath(node: BlockNode | TextNode, nodePath: number[]): {
43
43
  path: number[];
44
44
  offset: number;
45
45
  } | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",