microboard-temp 0.13.98 → 0.14.1

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.
@@ -58309,6 +58309,7 @@ var init_Connector = __esm(() => {
58309
58309
  animationFrameId;
58310
58310
  text;
58311
58311
  transformationRenderBlock = undefined;
58312
+ _updatingTitle = false;
58312
58313
  optionalFindItemFn;
58313
58314
  constructor(board, startPoint = new BoardPoint, endPoint = new BoardPoint, lineStyle = "straight", startPointerStyle = "None", endPointerStyle = DEFAULT_END_POINTER, lineColor, lineWidth, strokeStyle, id = "") {
58314
58315
  super(board, id);
@@ -58892,6 +58893,9 @@ var init_Connector = __esm(() => {
58892
58893
  return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
58893
58894
  }
58894
58895
  updateTitle() {
58896
+ if (this._updatingTitle) {
58897
+ return;
58898
+ }
58895
58899
  const selection = this.board.selection;
58896
58900
  const isConnectorSelected = selection.items.findById(this.id);
58897
58901
  if (isConnectorSelected && this.board.selection.getContext() === "EditTextUnderPointer") {
@@ -58905,8 +58909,13 @@ var init_Connector = __esm(() => {
58905
58909
  const { x, y } = this.getMiddlePoint() || this.calculateMiddlePoint();
58906
58910
  const height = this.text.getHeight();
58907
58911
  const width = this.text.getWidth();
58908
- this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
58909
- this.text.updateElement();
58912
+ this._updatingTitle = true;
58913
+ try {
58914
+ this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
58915
+ this.text.updateElement();
58916
+ } finally {
58917
+ this._updatingTitle = false;
58918
+ }
58910
58919
  }
58911
58920
  scalePoints() {
58912
58921
  const origin = new Point(this.getMbr().left, this.getMbr().top);
@@ -76514,6 +76523,19 @@ class Board {
76514
76523
  item: [group.getId()]
76515
76524
  });
76516
76525
  }
76526
+ detachFromGroup(item) {
76527
+ if (item.parent === "Board") {
76528
+ return;
76529
+ }
76530
+ const parentGroup = this.items.getById(item.parent);
76531
+ if (!parentGroup || parentGroup.itemType !== "Group") {
76532
+ return;
76533
+ }
76534
+ parentGroup.removeChildItems([item]);
76535
+ if (parentGroup.getChildrenIds().length === 0) {
76536
+ this.ungroup(parentGroup);
76537
+ }
76538
+ }
76517
76539
  getByZIndex(index2) {
76518
76540
  return this.index.getByZIndex(index2);
76519
76541
  }
package/dist/cjs/index.js CHANGED
@@ -58309,6 +58309,7 @@ var init_Connector = __esm(() => {
58309
58309
  animationFrameId;
58310
58310
  text;
58311
58311
  transformationRenderBlock = undefined;
58312
+ _updatingTitle = false;
58312
58313
  optionalFindItemFn;
58313
58314
  constructor(board, startPoint = new BoardPoint, endPoint = new BoardPoint, lineStyle = "straight", startPointerStyle = "None", endPointerStyle = DEFAULT_END_POINTER, lineColor, lineWidth, strokeStyle, id = "") {
58314
58315
  super(board, id);
@@ -58892,6 +58893,9 @@ var init_Connector = __esm(() => {
58892
58893
  return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
58893
58894
  }
58894
58895
  updateTitle() {
58896
+ if (this._updatingTitle) {
58897
+ return;
58898
+ }
58895
58899
  const selection = this.board.selection;
58896
58900
  const isConnectorSelected = selection.items.findById(this.id);
58897
58901
  if (isConnectorSelected && this.board.selection.getContext() === "EditTextUnderPointer") {
@@ -58905,8 +58909,13 @@ var init_Connector = __esm(() => {
58905
58909
  const { x, y } = this.getMiddlePoint() || this.calculateMiddlePoint();
58906
58910
  const height = this.text.getHeight();
58907
58911
  const width = this.text.getWidth();
58908
- this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
58909
- this.text.updateElement();
58912
+ this._updatingTitle = true;
58913
+ try {
58914
+ this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
58915
+ this.text.updateElement();
58916
+ } finally {
58917
+ this._updatingTitle = false;
58918
+ }
58910
58919
  }
58911
58920
  scalePoints() {
58912
58921
  const origin = new Point(this.getMbr().left, this.getMbr().top);
@@ -76514,6 +76523,19 @@ class Board {
76514
76523
  item: [group.getId()]
76515
76524
  });
76516
76525
  }
76526
+ detachFromGroup(item) {
76527
+ if (item.parent === "Board") {
76528
+ return;
76529
+ }
76530
+ const parentGroup = this.items.getById(item.parent);
76531
+ if (!parentGroup || parentGroup.itemType !== "Group") {
76532
+ return;
76533
+ }
76534
+ parentGroup.removeChildItems([item]);
76535
+ if (parentGroup.getChildrenIds().length === 0) {
76536
+ this.ungroup(parentGroup);
76537
+ }
76538
+ }
76517
76539
  getByZIndex(index2) {
76518
76540
  return this.index.getByZIndex(index2);
76519
76541
  }
package/dist/cjs/node.js CHANGED
@@ -60729,6 +60729,7 @@ var init_Connector = __esm(() => {
60729
60729
  animationFrameId;
60730
60730
  text;
60731
60731
  transformationRenderBlock = undefined;
60732
+ _updatingTitle = false;
60732
60733
  optionalFindItemFn;
60733
60734
  constructor(board, startPoint = new BoardPoint, endPoint = new BoardPoint, lineStyle = "straight", startPointerStyle = "None", endPointerStyle = DEFAULT_END_POINTER, lineColor, lineWidth, strokeStyle, id = "") {
60734
60735
  super(board, id);
@@ -61312,6 +61313,9 @@ var init_Connector = __esm(() => {
61312
61313
  return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
61313
61314
  }
61314
61315
  updateTitle() {
61316
+ if (this._updatingTitle) {
61317
+ return;
61318
+ }
61315
61319
  const selection = this.board.selection;
61316
61320
  const isConnectorSelected = selection.items.findById(this.id);
61317
61321
  if (isConnectorSelected && this.board.selection.getContext() === "EditTextUnderPointer") {
@@ -61325,8 +61329,13 @@ var init_Connector = __esm(() => {
61325
61329
  const { x, y } = this.getMiddlePoint() || this.calculateMiddlePoint();
61326
61330
  const height = this.text.getHeight();
61327
61331
  const width = this.text.getWidth();
61328
- this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
61329
- this.text.updateElement();
61332
+ this._updatingTitle = true;
61333
+ try {
61334
+ this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
61335
+ this.text.updateElement();
61336
+ } finally {
61337
+ this._updatingTitle = false;
61338
+ }
61330
61339
  }
61331
61340
  scalePoints() {
61332
61341
  const origin = new Point(this.getMbr().left, this.getMbr().top);
@@ -78989,6 +78998,19 @@ class Board {
78989
78998
  item: [group.getId()]
78990
78999
  });
78991
79000
  }
79001
+ detachFromGroup(item) {
79002
+ if (item.parent === "Board") {
79003
+ return;
79004
+ }
79005
+ const parentGroup = this.items.getById(item.parent);
79006
+ if (!parentGroup || parentGroup.itemType !== "Group") {
79007
+ return;
79008
+ }
79009
+ parentGroup.removeChildItems([item]);
79010
+ if (parentGroup.getChildrenIds().length === 0) {
79011
+ this.ungroup(parentGroup);
79012
+ }
79013
+ }
78992
79014
  getByZIndex(index2) {
78993
79015
  return this.index.getByZIndex(index2);
78994
79016
  }
@@ -58246,6 +58246,7 @@ var init_Connector = __esm(() => {
58246
58246
  animationFrameId;
58247
58247
  text;
58248
58248
  transformationRenderBlock = undefined;
58249
+ _updatingTitle = false;
58249
58250
  optionalFindItemFn;
58250
58251
  constructor(board, startPoint = new BoardPoint, endPoint = new BoardPoint, lineStyle = "straight", startPointerStyle = "None", endPointerStyle = DEFAULT_END_POINTER, lineColor, lineWidth, strokeStyle, id = "") {
58251
58252
  super(board, id);
@@ -58829,6 +58830,9 @@ var init_Connector = __esm(() => {
58829
58830
  return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
58830
58831
  }
58831
58832
  updateTitle() {
58833
+ if (this._updatingTitle) {
58834
+ return;
58835
+ }
58832
58836
  const selection = this.board.selection;
58833
58837
  const isConnectorSelected = selection.items.findById(this.id);
58834
58838
  if (isConnectorSelected && this.board.selection.getContext() === "EditTextUnderPointer") {
@@ -58842,8 +58846,13 @@ var init_Connector = __esm(() => {
58842
58846
  const { x, y } = this.getMiddlePoint() || this.calculateMiddlePoint();
58843
58847
  const height = this.text.getHeight();
58844
58848
  const width = this.text.getWidth();
58845
- this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
58846
- this.text.updateElement();
58849
+ this._updatingTitle = true;
58850
+ try {
58851
+ this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
58852
+ this.text.updateElement();
58853
+ } finally {
58854
+ this._updatingTitle = false;
58855
+ }
58847
58856
  }
58848
58857
  scalePoints() {
58849
58858
  const origin = new Point(this.getMbr().left, this.getMbr().top);
@@ -76248,6 +76257,19 @@ class Board {
76248
76257
  item: [group.getId()]
76249
76258
  });
76250
76259
  }
76260
+ detachFromGroup(item) {
76261
+ if (item.parent === "Board") {
76262
+ return;
76263
+ }
76264
+ const parentGroup = this.items.getById(item.parent);
76265
+ if (!parentGroup || parentGroup.itemType !== "Group") {
76266
+ return;
76267
+ }
76268
+ parentGroup.removeChildItems([item]);
76269
+ if (parentGroup.getChildrenIds().length === 0) {
76270
+ this.ungroup(parentGroup);
76271
+ }
76272
+ }
76251
76273
  getByZIndex(index2) {
76252
76274
  return this.index.getByZIndex(index2);
76253
76275
  }
package/dist/esm/index.js CHANGED
@@ -58239,6 +58239,7 @@ var init_Connector = __esm(() => {
58239
58239
  animationFrameId;
58240
58240
  text;
58241
58241
  transformationRenderBlock = undefined;
58242
+ _updatingTitle = false;
58242
58243
  optionalFindItemFn;
58243
58244
  constructor(board, startPoint = new BoardPoint, endPoint = new BoardPoint, lineStyle = "straight", startPointerStyle = "None", endPointerStyle = DEFAULT_END_POINTER, lineColor, lineWidth, strokeStyle, id = "") {
58244
58245
  super(board, id);
@@ -58822,6 +58823,9 @@ var init_Connector = __esm(() => {
58822
58823
  return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
58823
58824
  }
58824
58825
  updateTitle() {
58826
+ if (this._updatingTitle) {
58827
+ return;
58828
+ }
58825
58829
  const selection = this.board.selection;
58826
58830
  const isConnectorSelected = selection.items.findById(this.id);
58827
58831
  if (isConnectorSelected && this.board.selection.getContext() === "EditTextUnderPointer") {
@@ -58835,8 +58839,13 @@ var init_Connector = __esm(() => {
58835
58839
  const { x, y } = this.getMiddlePoint() || this.calculateMiddlePoint();
58836
58840
  const height = this.text.getHeight();
58837
58841
  const width = this.text.getWidth();
58838
- this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
58839
- this.text.updateElement();
58842
+ this._updatingTitle = true;
58843
+ try {
58844
+ this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
58845
+ this.text.updateElement();
58846
+ } finally {
58847
+ this._updatingTitle = false;
58848
+ }
58840
58849
  }
58841
58850
  scalePoints() {
58842
58851
  const origin = new Point(this.getMbr().left, this.getMbr().top);
@@ -76241,6 +76250,19 @@ class Board {
76241
76250
  item: [group.getId()]
76242
76251
  });
76243
76252
  }
76253
+ detachFromGroup(item) {
76254
+ if (item.parent === "Board") {
76255
+ return;
76256
+ }
76257
+ const parentGroup = this.items.getById(item.parent);
76258
+ if (!parentGroup || parentGroup.itemType !== "Group") {
76259
+ return;
76260
+ }
76261
+ parentGroup.removeChildItems([item]);
76262
+ if (parentGroup.getChildrenIds().length === 0) {
76263
+ this.ungroup(parentGroup);
76264
+ }
76265
+ }
76244
76266
  getByZIndex(index2) {
76245
76267
  return this.index.getByZIndex(index2);
76246
76268
  }
package/dist/esm/node.js CHANGED
@@ -60648,6 +60648,7 @@ var init_Connector = __esm(() => {
60648
60648
  animationFrameId;
60649
60649
  text;
60650
60650
  transformationRenderBlock = undefined;
60651
+ _updatingTitle = false;
60651
60652
  optionalFindItemFn;
60652
60653
  constructor(board, startPoint = new BoardPoint, endPoint = new BoardPoint, lineStyle = "straight", startPointerStyle = "None", endPointerStyle = DEFAULT_END_POINTER, lineColor, lineWidth, strokeStyle, id = "") {
60653
60654
  super(board, id);
@@ -61231,6 +61232,9 @@ var init_Connector = __esm(() => {
61231
61232
  return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
61232
61233
  }
61233
61234
  updateTitle() {
61235
+ if (this._updatingTitle) {
61236
+ return;
61237
+ }
61234
61238
  const selection = this.board.selection;
61235
61239
  const isConnectorSelected = selection.items.findById(this.id);
61236
61240
  if (isConnectorSelected && this.board.selection.getContext() === "EditTextUnderPointer") {
@@ -61244,8 +61248,13 @@ var init_Connector = __esm(() => {
61244
61248
  const { x, y } = this.getMiddlePoint() || this.calculateMiddlePoint();
61245
61249
  const height = this.text.getHeight();
61246
61250
  const width = this.text.getWidth();
61247
- this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
61248
- this.text.updateElement();
61251
+ this._updatingTitle = true;
61252
+ try {
61253
+ this.text.apply(transformOps.translateTo(this.text, x - width / 2, y - height / 2));
61254
+ this.text.updateElement();
61255
+ } finally {
61256
+ this._updatingTitle = false;
61257
+ }
61249
61258
  }
61250
61259
  scalePoints() {
61251
61260
  const origin = new Point(this.getMbr().left, this.getMbr().top);
@@ -78705,6 +78714,19 @@ class Board {
78705
78714
  item: [group.getId()]
78706
78715
  });
78707
78716
  }
78717
+ detachFromGroup(item) {
78718
+ if (item.parent === "Board") {
78719
+ return;
78720
+ }
78721
+ const parentGroup = this.items.getById(item.parent);
78722
+ if (!parentGroup || parentGroup.itemType !== "Group") {
78723
+ return;
78724
+ }
78725
+ parentGroup.removeChildItems([item]);
78726
+ if (parentGroup.getChildrenIds().length === 0) {
78727
+ this.ungroup(parentGroup);
78728
+ }
78729
+ }
78708
78730
  getByZIndex(index2) {
78709
78731
  return this.index.getByZIndex(index2);
78710
78732
  }
@@ -98,6 +98,12 @@ export declare class Board {
98
98
  * Dissolves a Group, returning its children to the board with world-space transforms.
99
99
  */
100
100
  ungroup(group: Group): void;
101
+ /**
102
+ * Removes a single item from its parent group, placing it back on the board
103
+ * at its current world position. If the group becomes empty after detach, the
104
+ * group itself is dissolved.
105
+ */
106
+ detachFromGroup(item: BaseItem): void;
101
107
  getByZIndex(index: number): Item;
102
108
  getZIndex(item: Item): number;
103
109
  getLastZIndex(): number;
@@ -40,6 +40,7 @@ export declare class Connector extends BaseItem<Connector> {
40
40
  animationFrameId?: number;
41
41
  readonly text: RichText;
42
42
  transformationRenderBlock?: boolean;
43
+ private _updatingTitle;
43
44
  private optionalFindItemFn?;
44
45
  constructor(board: Board, startPoint?: ControlPoint, endPoint?: ControlPoint, lineStyle?: ConnectorLineStyle, startPointerStyle?: ConnectorPointerStyle, endPointerStyle?: ConnectorPointerStyle, lineColor?: ColorValue, lineWidth?: ConnectionLineWidth, strokeStyle?: BorderStyle, id?: string);
45
46
  private initText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.98",
3
+ "version": "0.14.1",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",