microboard-temp 0.4.8 → 0.4.10

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.
@@ -37328,12 +37328,19 @@ class Shape extends BaseItem {
37328
37328
  this.shapeType = data.shapeType;
37329
37329
  this.initPath();
37330
37330
  }
37331
+ if (data.linkTo) {
37332
+ this.linkTo.deserialize(data.linkTo);
37333
+ }
37331
37334
  this.backgroundColor = data.backgroundColor ?? this.backgroundColor;
37332
37335
  this.backgroundOpacity = data.backgroundOpacity ?? this.backgroundOpacity;
37333
37336
  this.borderColor = data.borderColor ?? this.borderColor;
37334
37337
  this.borderOpacity = data.borderOpacity ?? this.borderOpacity;
37335
37338
  this.borderStyle = data.borderStyle ?? this.borderStyle;
37336
37339
  this.borderWidth = data.borderWidth ?? this.borderWidth;
37340
+ if (data.transformation) {
37341
+ this.transformation.deserialize(data.transformation);
37342
+ this.transformPath();
37343
+ }
37337
37344
  if (data.text) {
37338
37345
  this.text.deserialize(data.text);
37339
37346
  }
@@ -42485,12 +42492,10 @@ class AddSticker extends BoardTool {
42485
42492
  var height2 = 16;
42486
42493
 
42487
42494
  class AddText extends BoardTool {
42488
- board;
42489
42495
  line;
42490
42496
  bounds = new Mbr;
42491
42497
  constructor(board) {
42492
42498
  super(board);
42493
- this.board = board;
42494
42499
  this.setCursor();
42495
42500
  }
42496
42501
  setCursor() {
@@ -42517,7 +42522,7 @@ class AddText extends BoardTool {
42517
42522
  }
42518
42523
  return false;
42519
42524
  }
42520
- async leftButtonUp() {
42525
+ leftButtonUp() {
42521
42526
  if (this.line) {
42522
42527
  const board = this.board;
42523
42528
  const richText = new RichText(this.board, new Mbr);
@@ -42525,7 +42530,7 @@ class AddText extends BoardTool {
42525
42530
  richText.transformation.applyScaleBy(1, 1);
42526
42531
  richText.editor.maxWidth = 600;
42527
42532
  richText.insideOf = richText.itemType;
42528
- const text5 = await board.add(richText);
42533
+ const text5 = board.add(richText);
42529
42534
  this.board.selection.removeAll();
42530
42535
  this.board.selection.add(text5);
42531
42536
  this.board.selection.editText();
@@ -53643,7 +53648,7 @@ function mergeRichTextOperations(opA, opB) {
53643
53648
  return;
53644
53649
  }
53645
53650
  function mergeRichTextCreation(opA, opB) {
53646
- if (opA.method === "add" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
53651
+ if (opA.method === "add" && opA.data.itemType === "RichText" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
53647
53652
  const op = {
53648
53653
  ...opA,
53649
53654
  data: {
package/dist/cjs/index.js CHANGED
@@ -37328,12 +37328,19 @@ class Shape extends BaseItem {
37328
37328
  this.shapeType = data.shapeType;
37329
37329
  this.initPath();
37330
37330
  }
37331
+ if (data.linkTo) {
37332
+ this.linkTo.deserialize(data.linkTo);
37333
+ }
37331
37334
  this.backgroundColor = data.backgroundColor ?? this.backgroundColor;
37332
37335
  this.backgroundOpacity = data.backgroundOpacity ?? this.backgroundOpacity;
37333
37336
  this.borderColor = data.borderColor ?? this.borderColor;
37334
37337
  this.borderOpacity = data.borderOpacity ?? this.borderOpacity;
37335
37338
  this.borderStyle = data.borderStyle ?? this.borderStyle;
37336
37339
  this.borderWidth = data.borderWidth ?? this.borderWidth;
37340
+ if (data.transformation) {
37341
+ this.transformation.deserialize(data.transformation);
37342
+ this.transformPath();
37343
+ }
37337
37344
  if (data.text) {
37338
37345
  this.text.deserialize(data.text);
37339
37346
  }
@@ -42485,12 +42492,10 @@ class AddSticker extends BoardTool {
42485
42492
  var height2 = 16;
42486
42493
 
42487
42494
  class AddText extends BoardTool {
42488
- board;
42489
42495
  line;
42490
42496
  bounds = new Mbr;
42491
42497
  constructor(board) {
42492
42498
  super(board);
42493
- this.board = board;
42494
42499
  this.setCursor();
42495
42500
  }
42496
42501
  setCursor() {
@@ -42517,7 +42522,7 @@ class AddText extends BoardTool {
42517
42522
  }
42518
42523
  return false;
42519
42524
  }
42520
- async leftButtonUp() {
42525
+ leftButtonUp() {
42521
42526
  if (this.line) {
42522
42527
  const board = this.board;
42523
42528
  const richText = new RichText(this.board, new Mbr);
@@ -42525,7 +42530,7 @@ class AddText extends BoardTool {
42525
42530
  richText.transformation.applyScaleBy(1, 1);
42526
42531
  richText.editor.maxWidth = 600;
42527
42532
  richText.insideOf = richText.itemType;
42528
- const text5 = await board.add(richText);
42533
+ const text5 = board.add(richText);
42529
42534
  this.board.selection.removeAll();
42530
42535
  this.board.selection.add(text5);
42531
42536
  this.board.selection.editText();
@@ -53643,7 +53648,7 @@ function mergeRichTextOperations(opA, opB) {
53643
53648
  return;
53644
53649
  }
53645
53650
  function mergeRichTextCreation(opA, opB) {
53646
- if (opA.method === "add" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
53651
+ if (opA.method === "add" && opA.data.itemType === "RichText" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
53647
53652
  const op = {
53648
53653
  ...opA,
53649
53654
  data: {
package/dist/cjs/node.js CHANGED
@@ -39868,12 +39868,19 @@ class Shape extends BaseItem {
39868
39868
  this.shapeType = data.shapeType;
39869
39869
  this.initPath();
39870
39870
  }
39871
+ if (data.linkTo) {
39872
+ this.linkTo.deserialize(data.linkTo);
39873
+ }
39871
39874
  this.backgroundColor = data.backgroundColor ?? this.backgroundColor;
39872
39875
  this.backgroundOpacity = data.backgroundOpacity ?? this.backgroundOpacity;
39873
39876
  this.borderColor = data.borderColor ?? this.borderColor;
39874
39877
  this.borderOpacity = data.borderOpacity ?? this.borderOpacity;
39875
39878
  this.borderStyle = data.borderStyle ?? this.borderStyle;
39876
39879
  this.borderWidth = data.borderWidth ?? this.borderWidth;
39880
+ if (data.transformation) {
39881
+ this.transformation.deserialize(data.transformation);
39882
+ this.transformPath();
39883
+ }
39877
39884
  if (data.text) {
39878
39885
  this.text.deserialize(data.text);
39879
39886
  }
@@ -45025,12 +45032,10 @@ class AddSticker extends BoardTool {
45025
45032
  var height2 = 16;
45026
45033
 
45027
45034
  class AddText extends BoardTool {
45028
- board;
45029
45035
  line;
45030
45036
  bounds = new Mbr;
45031
45037
  constructor(board) {
45032
45038
  super(board);
45033
- this.board = board;
45034
45039
  this.setCursor();
45035
45040
  }
45036
45041
  setCursor() {
@@ -45057,7 +45062,7 @@ class AddText extends BoardTool {
45057
45062
  }
45058
45063
  return false;
45059
45064
  }
45060
- async leftButtonUp() {
45065
+ leftButtonUp() {
45061
45066
  if (this.line) {
45062
45067
  const board = this.board;
45063
45068
  const richText = new RichText(this.board, new Mbr);
@@ -45065,7 +45070,7 @@ class AddText extends BoardTool {
45065
45070
  richText.transformation.applyScaleBy(1, 1);
45066
45071
  richText.editor.maxWidth = 600;
45067
45072
  richText.insideOf = richText.itemType;
45068
- const text5 = await board.add(richText);
45073
+ const text5 = board.add(richText);
45069
45074
  this.board.selection.removeAll();
45070
45075
  this.board.selection.add(text5);
45071
45076
  this.board.selection.editText();
@@ -56116,7 +56121,7 @@ function mergeRichTextOperations(opA, opB) {
56116
56121
  return;
56117
56122
  }
56118
56123
  function mergeRichTextCreation(opA, opB) {
56119
- if (opA.method === "add" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
56124
+ if (opA.method === "add" && opA.data.itemType === "RichText" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
56120
56125
  const op = {
56121
56126
  ...opA,
56122
56127
  data: {
@@ -37181,12 +37181,19 @@ class Shape extends BaseItem {
37181
37181
  this.shapeType = data.shapeType;
37182
37182
  this.initPath();
37183
37183
  }
37184
+ if (data.linkTo) {
37185
+ this.linkTo.deserialize(data.linkTo);
37186
+ }
37184
37187
  this.backgroundColor = data.backgroundColor ?? this.backgroundColor;
37185
37188
  this.backgroundOpacity = data.backgroundOpacity ?? this.backgroundOpacity;
37186
37189
  this.borderColor = data.borderColor ?? this.borderColor;
37187
37190
  this.borderOpacity = data.borderOpacity ?? this.borderOpacity;
37188
37191
  this.borderStyle = data.borderStyle ?? this.borderStyle;
37189
37192
  this.borderWidth = data.borderWidth ?? this.borderWidth;
37193
+ if (data.transformation) {
37194
+ this.transformation.deserialize(data.transformation);
37195
+ this.transformPath();
37196
+ }
37190
37197
  if (data.text) {
37191
37198
  this.text.deserialize(data.text);
37192
37199
  }
@@ -42338,12 +42345,10 @@ class AddSticker extends BoardTool {
42338
42345
  var height2 = 16;
42339
42346
 
42340
42347
  class AddText extends BoardTool {
42341
- board;
42342
42348
  line;
42343
42349
  bounds = new Mbr;
42344
42350
  constructor(board) {
42345
42351
  super(board);
42346
- this.board = board;
42347
42352
  this.setCursor();
42348
42353
  }
42349
42354
  setCursor() {
@@ -42370,7 +42375,7 @@ class AddText extends BoardTool {
42370
42375
  }
42371
42376
  return false;
42372
42377
  }
42373
- async leftButtonUp() {
42378
+ leftButtonUp() {
42374
42379
  if (this.line) {
42375
42380
  const board = this.board;
42376
42381
  const richText = new RichText(this.board, new Mbr);
@@ -42378,7 +42383,7 @@ class AddText extends BoardTool {
42378
42383
  richText.transformation.applyScaleBy(1, 1);
42379
42384
  richText.editor.maxWidth = 600;
42380
42385
  richText.insideOf = richText.itemType;
42381
- const text5 = await board.add(richText);
42386
+ const text5 = board.add(richText);
42382
42387
  this.board.selection.removeAll();
42383
42388
  this.board.selection.add(text5);
42384
42389
  this.board.selection.editText();
@@ -53496,7 +53501,7 @@ function mergeRichTextOperations(opA, opB) {
53496
53501
  return;
53497
53502
  }
53498
53503
  function mergeRichTextCreation(opA, opB) {
53499
- if (opA.method === "add" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
53504
+ if (opA.method === "add" && opA.data.itemType === "RichText" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
53500
53505
  const op = {
53501
53506
  ...opA,
53502
53507
  data: {
package/dist/esm/index.js CHANGED
@@ -37174,12 +37174,19 @@ class Shape extends BaseItem {
37174
37174
  this.shapeType = data.shapeType;
37175
37175
  this.initPath();
37176
37176
  }
37177
+ if (data.linkTo) {
37178
+ this.linkTo.deserialize(data.linkTo);
37179
+ }
37177
37180
  this.backgroundColor = data.backgroundColor ?? this.backgroundColor;
37178
37181
  this.backgroundOpacity = data.backgroundOpacity ?? this.backgroundOpacity;
37179
37182
  this.borderColor = data.borderColor ?? this.borderColor;
37180
37183
  this.borderOpacity = data.borderOpacity ?? this.borderOpacity;
37181
37184
  this.borderStyle = data.borderStyle ?? this.borderStyle;
37182
37185
  this.borderWidth = data.borderWidth ?? this.borderWidth;
37186
+ if (data.transformation) {
37187
+ this.transformation.deserialize(data.transformation);
37188
+ this.transformPath();
37189
+ }
37183
37190
  if (data.text) {
37184
37191
  this.text.deserialize(data.text);
37185
37192
  }
@@ -42331,12 +42338,10 @@ class AddSticker extends BoardTool {
42331
42338
  var height2 = 16;
42332
42339
 
42333
42340
  class AddText extends BoardTool {
42334
- board;
42335
42341
  line;
42336
42342
  bounds = new Mbr;
42337
42343
  constructor(board) {
42338
42344
  super(board);
42339
- this.board = board;
42340
42345
  this.setCursor();
42341
42346
  }
42342
42347
  setCursor() {
@@ -42363,7 +42368,7 @@ class AddText extends BoardTool {
42363
42368
  }
42364
42369
  return false;
42365
42370
  }
42366
- async leftButtonUp() {
42371
+ leftButtonUp() {
42367
42372
  if (this.line) {
42368
42373
  const board = this.board;
42369
42374
  const richText = new RichText(this.board, new Mbr);
@@ -42371,7 +42376,7 @@ class AddText extends BoardTool {
42371
42376
  richText.transformation.applyScaleBy(1, 1);
42372
42377
  richText.editor.maxWidth = 600;
42373
42378
  richText.insideOf = richText.itemType;
42374
- const text5 = await board.add(richText);
42379
+ const text5 = board.add(richText);
42375
42380
  this.board.selection.removeAll();
42376
42381
  this.board.selection.add(text5);
42377
42382
  this.board.selection.editText();
@@ -53489,7 +53494,7 @@ function mergeRichTextOperations(opA, opB) {
53489
53494
  return;
53490
53495
  }
53491
53496
  function mergeRichTextCreation(opA, opB) {
53492
- if (opA.method === "add" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
53497
+ if (opA.method === "add" && opA.data.itemType === "RichText" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
53493
53498
  const op = {
53494
53499
  ...opA,
53495
53500
  data: {
package/dist/esm/node.js CHANGED
@@ -39709,12 +39709,19 @@ class Shape extends BaseItem {
39709
39709
  this.shapeType = data.shapeType;
39710
39710
  this.initPath();
39711
39711
  }
39712
+ if (data.linkTo) {
39713
+ this.linkTo.deserialize(data.linkTo);
39714
+ }
39712
39715
  this.backgroundColor = data.backgroundColor ?? this.backgroundColor;
39713
39716
  this.backgroundOpacity = data.backgroundOpacity ?? this.backgroundOpacity;
39714
39717
  this.borderColor = data.borderColor ?? this.borderColor;
39715
39718
  this.borderOpacity = data.borderOpacity ?? this.borderOpacity;
39716
39719
  this.borderStyle = data.borderStyle ?? this.borderStyle;
39717
39720
  this.borderWidth = data.borderWidth ?? this.borderWidth;
39721
+ if (data.transformation) {
39722
+ this.transformation.deserialize(data.transformation);
39723
+ this.transformPath();
39724
+ }
39718
39725
  if (data.text) {
39719
39726
  this.text.deserialize(data.text);
39720
39727
  }
@@ -44866,12 +44873,10 @@ class AddSticker extends BoardTool {
44866
44873
  var height2 = 16;
44867
44874
 
44868
44875
  class AddText extends BoardTool {
44869
- board;
44870
44876
  line;
44871
44877
  bounds = new Mbr;
44872
44878
  constructor(board) {
44873
44879
  super(board);
44874
- this.board = board;
44875
44880
  this.setCursor();
44876
44881
  }
44877
44882
  setCursor() {
@@ -44898,7 +44903,7 @@ class AddText extends BoardTool {
44898
44903
  }
44899
44904
  return false;
44900
44905
  }
44901
- async leftButtonUp() {
44906
+ leftButtonUp() {
44902
44907
  if (this.line) {
44903
44908
  const board = this.board;
44904
44909
  const richText = new RichText(this.board, new Mbr);
@@ -44906,7 +44911,7 @@ class AddText extends BoardTool {
44906
44911
  richText.transformation.applyScaleBy(1, 1);
44907
44912
  richText.editor.maxWidth = 600;
44908
44913
  richText.insideOf = richText.itemType;
44909
- const text5 = await board.add(richText);
44914
+ const text5 = board.add(richText);
44910
44915
  this.board.selection.removeAll();
44911
44916
  this.board.selection.add(text5);
44912
44917
  this.board.selection.editText();
@@ -55957,7 +55962,7 @@ function mergeRichTextOperations(opA, opB) {
55957
55962
  return;
55958
55963
  }
55959
55964
  function mergeRichTextCreation(opA, opB) {
55960
- if (opA.method === "add" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
55965
+ if (opA.method === "add" && opA.data.itemType === "RichText" && opB.method === "edit" && opA.item === opB.item[0] && opB.ops[0].type === "insert_text") {
55961
55966
  const op = {
55962
55967
  ...opA,
55963
55968
  data: {
@@ -5,7 +5,7 @@ export interface LayoutBlockNodes {
5
5
  width: number;
6
6
  height: number;
7
7
  didBreakWords: boolean;
8
- render: (ctx: CanvasRenderingContext2D, scale?: number) => void;
8
+ render: (ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, scale?: number) => void;
9
9
  realign: (newMaxWidht: number) => void;
10
10
  recoordinate: (newMaxWidth?: number) => void;
11
11
  linkPositions: {
@@ -3,14 +3,13 @@ import { Line, Mbr } from 'Items';
3
3
  import { DrawingContext } from 'Items/DrawingContext';
4
4
  import { BoardTool } from 'Tools/BoardTool';
5
5
  export declare class AddText extends BoardTool {
6
- private board;
7
6
  line: Line | undefined;
8
7
  bounds: Mbr;
9
8
  constructor(board: Board);
10
9
  setCursor(): void;
11
10
  leftButtonDown(): boolean;
12
11
  pointerMoveBy(_x: number, _y: number): boolean;
13
- leftButtonUp(): Promise<boolean>;
12
+ leftButtonUp(): boolean;
14
13
  keyDown(key: string): boolean;
15
14
  middleButtonDown(): boolean;
16
15
  rightButtonDown(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",