microboard-temp 0.2.0 → 0.2.2

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/dist/cjs/node.js CHANGED
@@ -1674,7 +1674,7 @@ __export(exports_node, {
1674
1674
  transformHtmlOrTextToMarkdown: () => transformHtmlOrTextToMarkdown,
1675
1675
  toRelativePoint: () => toRelativePoint,
1676
1676
  toFiniteNumber: () => toFiniteNumber,
1677
- tempStorage: () => tempStorage2,
1677
+ tempStorage: () => tempStorage,
1678
1678
  tagByType: () => tagByType,
1679
1679
  stickerColors: () => stickerColors,
1680
1680
  sha256: () => sha256,
@@ -1745,7 +1745,7 @@ __export(exports_node, {
1745
1745
  Shapes: () => Shapes,
1746
1746
  ShapeCommand: () => ShapeCommand,
1747
1747
  Shape: () => Shape,
1748
- SessionStorage: () => SessionStorage2,
1748
+ SessionStorage: () => SessionStorage,
1749
1749
  Selection: () => BoardSelection,
1750
1750
  STEP_STROKE_WIDTH: () => STEP_STROKE_WIDTH,
1751
1751
  SHAPE_LAST_TYPE_KEY: () => SHAPE_LAST_TYPE_KEY,
@@ -9646,7 +9646,7 @@ if (typeof window !== "undefined" && window.sessionStorage) {
9646
9646
  _sessionStorage = new NodeStoragePolyfill;
9647
9647
  }
9648
9648
 
9649
- class SessionStorage2 {
9649
+ class SessionStorage {
9650
9650
  set(key, value) {
9651
9651
  const boardId = this.getBoardId() || "";
9652
9652
  _sessionStorage.setItem(boardId + "_" + key, JSON.stringify(value));
@@ -9778,7 +9778,7 @@ class SessionStorage2 {
9778
9778
  return window.location.href.split("/").pop()?.split("?")[0];
9779
9779
  }
9780
9780
  }
9781
- var tempStorage2 = new SessionStorage2;
9781
+ var tempStorage = new SessionStorage;
9782
9782
 
9783
9783
  // src/HTMLRender/HTMLRender.ts
9784
9784
  function getTranslationFromHTML(el) {
@@ -20857,7 +20857,7 @@ class RichText extends Mbr {
20857
20857
  counter = counter + 1;
20858
20858
  this.rtCounter = counter;
20859
20859
  this.linkTo = linkTo || new LinkTo(this.id, this.board.events);
20860
- let textSizeFromStorage = new SessionStorage2().getFontSize(insideOf || "RichText");
20860
+ let textSizeFromStorage = new SessionStorage().getFontSize(insideOf || "RichText");
20861
20861
  if (!textSizeFromStorage || textSizeFromStorage === "auto") {
20862
20862
  textSizeFromStorage = initialTextStyles.fontSize;
20863
20863
  }
@@ -39742,7 +39742,7 @@ class Shape extends BaseItem {
39742
39742
  this.updateMbr();
39743
39743
  }
39744
39744
  saveShapeData() {
39745
- tempStorage2.setShapeData({
39745
+ tempStorage.setShapeData({
39746
39746
  shapeType: this.shapeType,
39747
39747
  backgroundColor: this.backgroundColor,
39748
39748
  backgroundOpacity: this.backgroundOpacity,
@@ -40283,7 +40283,7 @@ class Sticker extends BaseItem {
40283
40283
  }
40284
40284
  }
40285
40285
  saveStickerData() {
40286
- const storage = new SessionStorage2;
40286
+ const storage = new SessionStorage;
40287
40287
  storage.setStickerData(this.serialize());
40288
40288
  }
40289
40289
  serialize() {
@@ -40796,8 +40796,8 @@ class Frame extends BaseItem {
40796
40796
  this.borderWidth = borderWidth;
40797
40797
  this.textContainer = Frames[this.shapeType].textBounds.copy();
40798
40798
  this.path = Frames[this.shapeType].path.copy();
40799
- this.transformation = new Transformation(this.id, this.board.events);
40800
- this.linkTo = new LinkTo(this.id, this.board.events);
40799
+ this.transformation = new Transformation(this.id, board.events);
40800
+ this.linkTo = new LinkTo(this.id, board.events);
40801
40801
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontColor: FRAME_TITLE_COLOR });
40802
40802
  this.text.setSelectionHorisontalAlignment("left");
40803
40803
  this.transformation.subject.subscribe(() => {
@@ -41708,7 +41708,7 @@ function calculatePosition(boardImage, board) {
41708
41708
  const centerPoint = viewportMbr.getCenter();
41709
41709
  const imageWidth = boardImage.getWidth();
41710
41710
  const imageHeight = boardImage.getHeight();
41711
- const prevDimensions = tempStorage2.getImageDimensions();
41711
+ const prevDimensions = tempStorage.getImageDimensions();
41712
41712
  if (prevDimensions) {
41713
41713
  const scaleX2 = prevDimensions.width / imageWidth;
41714
41714
  const scaleY2 = prevDimensions.height / imageHeight;
@@ -41729,7 +41729,7 @@ function calculatePosition(boardImage, board) {
41729
41729
  const finalScale = scaleToFit;
41730
41730
  const scaledImageWidth = imageWidth * finalScale;
41731
41731
  const scaledImageHeight = imageHeight * finalScale;
41732
- tempStorage2.setImageDimensions({
41732
+ tempStorage.setImageDimensions({
41733
41733
  width: scaledImageWidth,
41734
41734
  height: scaledImageHeight
41735
41735
  });
@@ -42986,7 +42986,7 @@ class ImageItem extends BaseItem {
42986
42986
  }
42987
42987
  }
42988
42988
  // src/isSafari.ts
42989
- function isSafari2() {
42989
+ function isSafari() {
42990
42990
  if (typeof navigator === "undefined") {
42991
42991
  return false;
42992
42992
  }
@@ -43092,8 +43092,8 @@ class Drawing extends BaseItem {
43092
43092
  const cy = (points[j].y + points[j + 1].y) / 2;
43093
43093
  context.quadraticCurveTo(points[j].x, points[j].y, cx, cy);
43094
43094
  }
43095
- const x = points[j].x === points[j + 1].x && isSafari2() ? points[j + 1].x + 0.01 : points[j + 1].x;
43096
- const y = points[j].y === points[j + 1].y && isSafari2() ? points[j + 1].y + 0.01 : points[j + 1].y;
43095
+ const x = points[j].x === points[j + 1].x && isSafari() ? points[j + 1].x + 0.01 : points[j + 1].x;
43096
+ const y = points[j].y === points[j + 1].y && isSafari() ? points[j + 1].y + 0.01 : points[j + 1].y;
43097
43097
  context.quadraticCurveTo(points[j].x, points[j].y, x, y);
43098
43098
  }
43099
43099
  let left = Number.MAX_SAFE_INTEGER;
@@ -43224,8 +43224,8 @@ class Drawing extends BaseItem {
43224
43224
  const cy = (points[j].y + points[j + 1].y) / 2;
43225
43225
  pathData += ` Q ${points[j].x} ${points[j].y} ${cx} ${cy}`;
43226
43226
  }
43227
- const x = points[j].x === points[j + 1].x && isSafari2() ? points[j + 1].x + 0.01 : points[j + 1].x;
43228
- const y = points[j].y === points[j + 1].y && isSafari2() ? points[j + 1].y + 0.01 : points[j + 1].y;
43227
+ const x = points[j].x === points[j + 1].x && isSafari() ? points[j + 1].x + 0.01 : points[j + 1].x;
43228
+ const y = points[j].y === points[j + 1].y && isSafari() ? points[j + 1].y + 0.01 : points[j + 1].y;
43229
43229
  pathData += ` Q ${points[j].x} ${points[j].y} ${x} ${y}`;
43230
43230
  }
43231
43231
  return pathData;
@@ -44772,7 +44772,7 @@ class AddShape extends BoardTool {
44772
44772
  constructor(board) {
44773
44773
  super(board);
44774
44774
  this.setCursor();
44775
- const data = tempStorage2.getShapeData();
44775
+ const data = tempStorage.getShapeData();
44776
44776
  if (data) {
44777
44777
  this.shape = new Shape(board, "", data.shapeType, data.backgroundColor, data.backgroundOpacity, data.borderColor, data.borderOpacity, data.borderStyle, data.borderWidth);
44778
44778
  this.setShapeType(data.shapeType);
@@ -44853,13 +44853,13 @@ class AddShape extends BoardTool {
44853
44853
  if (this.type === "None") {
44854
44854
  return false;
44855
44855
  }
44856
- const width2 = this.bounds.getWidth() < 2 ? tempStorage2.getShapeWidth() || 100 : this.bounds.getWidth();
44857
- const height2 = this.bounds.getHeight() < 2 ? tempStorage2.getShapeHeight() || 100 : this.bounds.getHeight();
44856
+ const width2 = this.bounds.getWidth() < 2 ? tempStorage.getShapeWidth() || 100 : this.bounds.getWidth();
44857
+ const height2 = this.bounds.getHeight() < 2 ? tempStorage.getShapeHeight() || 100 : this.bounds.getHeight();
44858
44858
  if (this.bounds.getWidth() > 2) {
44859
- tempStorage2.setShapeWidth(this.bounds.getWidth());
44859
+ tempStorage.setShapeWidth(this.bounds.getWidth());
44860
44860
  }
44861
44861
  if (this.bounds.getHeight() > 2) {
44862
- tempStorage2.setShapeHeight(this.bounds.getHeight());
44862
+ tempStorage.setShapeHeight(this.bounds.getHeight());
44863
44863
  }
44864
44864
  this.initTransformation(width2 / 100, height2 / 100);
44865
44865
  const shape = this.board.add(this.shape);
@@ -46047,7 +46047,7 @@ function getQuickAddButtons(selection, board) {
46047
46047
  let htmlButtons = undefined;
46048
46048
  let quickAddItems = undefined;
46049
46049
  function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
46050
- const connectorStorage = new SessionStorage2;
46050
+ const connectorStorage = new SessionStorage;
46051
46051
  const currMbr = selectedItem.getMbr();
46052
46052
  const selectedItemData = selectedItem.serialize();
46053
46053
  const width2 = selectedItem.itemType === "Shape" ? selectedItem.getPath().getMbr().getWidth() : currMbr.getWidth();
@@ -46110,7 +46110,7 @@ function getQuickAddButtons(selection, board) {
46110
46110
  const fontSize = selectedItem.itemType === "RichText" ? selectedItem.getFontSize() : 14;
46111
46111
  const newItem = board.createItem(board.getNewItemId(), newItemData);
46112
46112
  if (newItem.itemType === "RichText") {
46113
- const storage = new SessionStorage2;
46113
+ const storage = new SessionStorage;
46114
46114
  storage.setFontSize("RichText", fontSize);
46115
46115
  newItem.editor.selectWholeText();
46116
46116
  newItem.applySelectionFontSize(fontSize);
@@ -47657,6 +47657,11 @@ class StickerTool extends CustomTool {
47657
47657
  }
47658
47658
  }
47659
47659
 
47660
+ // src/api/isIfarme.ts
47661
+ var isIframe = () => {
47662
+ return window.self !== window.top;
47663
+ };
47664
+
47660
47665
  // src/Tools/Tools.ts
47661
47666
  var registeredTools = {};
47662
47667
 
@@ -50558,7 +50563,7 @@ class Presence {
50558
50563
  if (!ctx) {
50559
50564
  return;
50560
50565
  }
50561
- const anonTranslate = i18n.t("presence.anonymous");
50566
+ const anonTranslate = conf.i18n.t("presence.anonymous");
50562
50567
  const label = cursor.nickname === "Anonymous" ? anonTranslate : cursor.nickname;
50563
50568
  const textWidth = ctx.measureText(label).width;
50564
50569
  const labelHeight = 20 * scale;
@@ -52833,7 +52838,7 @@ function transformItems({
52833
52838
  return null;
52834
52839
  }
52835
52840
  if (single instanceof ImageItem) {
52836
- tempStorage2.setImageDimensions({
52841
+ tempStorage.setImageDimensions({
52837
52842
  width: resize.mbr.getWidth(),
52838
52843
  height: resize.mbr.getHeight()
52839
52844
  });
@@ -53592,12 +53597,12 @@ class BoardSelection {
53592
53597
  return;
53593
53598
  }
53594
53599
  if (text5.isEmpty()) {
53595
- const textColor = tempStorage2.getFontColor(item.itemType);
53596
- const textSize = tempStorage2.getFontSize(item.itemType);
53597
- const highlightColor = tempStorage2.getFontHighlight(item.itemType);
53598
- const styles = tempStorage2.getFontStyles(item.itemType);
53599
- const horizontalAlignment = tempStorage2.getHorizontalAlignment(item.itemType);
53600
- const verticalAlignment = tempStorage2.getVerticalAlignment(item.itemType);
53600
+ const textColor = tempStorage.getFontColor(item.itemType);
53601
+ const textSize = tempStorage.getFontSize(item.itemType);
53602
+ const highlightColor = tempStorage.getFontHighlight(item.itemType);
53603
+ const styles = tempStorage.getFontStyles(item.itemType);
53604
+ const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
53605
+ const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
53601
53606
  if (textColor) {
53602
53607
  text5.setSelectionFontColor(textColor, "None");
53603
53608
  }
@@ -54140,9 +54145,9 @@ class BoardSelection {
54140
54145
  ops
54141
54146
  });
54142
54147
  if (item.itemType === "Sticker" && fontSize === "auto") {
54143
- tempStorage2.remove(`fontSize_${item.itemType}`);
54148
+ tempStorage.remove(`fontSize_${item.itemType}`);
54144
54149
  } else if (item.itemType !== "AINode") {
54145
- tempStorage2.setFontSize(item.itemType, fontSize);
54150
+ tempStorage.setFontSize(item.itemType, fontSize);
54146
54151
  }
54147
54152
  }
54148
54153
  const emptyOps = itemsOps.filter((op) => !op.ops.length);
@@ -54180,7 +54185,7 @@ class BoardSelection {
54180
54185
  ops
54181
54186
  });
54182
54187
  if (item.itemType !== "AINode") {
54183
- tempStorage2.setFontStyles(item.itemType, text5.getFontStyles());
54188
+ tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
54184
54189
  }
54185
54190
  }
54186
54191
  this.emitApplied({
@@ -54206,7 +54211,7 @@ class BoardSelection {
54206
54211
  selection: text5.editor.getSelection(),
54207
54212
  ops
54208
54213
  });
54209
- tempStorage2.setFontColor(item.itemType, fontColor);
54214
+ tempStorage.setFontColor(item.itemType, fontColor);
54210
54215
  }
54211
54216
  this.emitApplied({
54212
54217
  class: "RichText",
@@ -54250,7 +54255,7 @@ class BoardSelection {
54250
54255
  ops
54251
54256
  });
54252
54257
  if (item.itemType !== "AINode") {
54253
- tempStorage2.setFontHighlight(item.itemType, fontHighlight);
54258
+ tempStorage.setFontHighlight(item.itemType, fontHighlight);
54254
54259
  }
54255
54260
  }
54256
54261
  this.emitApplied({
@@ -54276,7 +54281,7 @@ class BoardSelection {
54276
54281
  selection: text5.editor.getSelection(),
54277
54282
  ops
54278
54283
  });
54279
- tempStorage2.setHorizontalAlignment(item.itemType, horisontalAlignment);
54284
+ tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
54280
54285
  }
54281
54286
  this.emitApplied({
54282
54287
  class: "RichText",
@@ -54300,7 +54305,7 @@ class BoardSelection {
54300
54305
  if (!text5) {
54301
54306
  return;
54302
54307
  }
54303
- tempStorage2.setVerticalAlignment(item.itemType, verticalAlignment);
54308
+ tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
54304
54309
  if (item instanceof RichText) {
54305
54310
  item.setEditorFocus(this.context);
54306
54311
  }
@@ -8448,7 +8448,7 @@ if (typeof window !== "undefined" && window.sessionStorage) {
8448
8448
  _sessionStorage = new NodeStoragePolyfill;
8449
8449
  }
8450
8450
 
8451
- class SessionStorage2 {
8451
+ class SessionStorage {
8452
8452
  set(key, value) {
8453
8453
  const boardId = this.getBoardId() || "";
8454
8454
  _sessionStorage.setItem(boardId + "_" + key, JSON.stringify(value));
@@ -8580,7 +8580,7 @@ class SessionStorage2 {
8580
8580
  return window.location.href.split("/").pop()?.split("?")[0];
8581
8581
  }
8582
8582
  }
8583
- var tempStorage2 = new SessionStorage2;
8583
+ var tempStorage = new SessionStorage;
8584
8584
 
8585
8585
  // src/HTMLRender/HTMLRender.ts
8586
8586
  function getTranslationFromHTML(el) {
@@ -18165,7 +18165,7 @@ class RichText extends Mbr {
18165
18165
  counter = counter + 1;
18166
18166
  this.rtCounter = counter;
18167
18167
  this.linkTo = linkTo || new LinkTo(this.id, this.board.events);
18168
- let textSizeFromStorage = new SessionStorage2().getFontSize(insideOf || "RichText");
18168
+ let textSizeFromStorage = new SessionStorage().getFontSize(insideOf || "RichText");
18169
18169
  if (!textSizeFromStorage || textSizeFromStorage === "auto") {
18170
18170
  textSizeFromStorage = initialTextStyles.fontSize;
18171
18171
  }
@@ -37050,7 +37050,7 @@ class Shape extends BaseItem {
37050
37050
  this.updateMbr();
37051
37051
  }
37052
37052
  saveShapeData() {
37053
- tempStorage2.setShapeData({
37053
+ tempStorage.setShapeData({
37054
37054
  shapeType: this.shapeType,
37055
37055
  backgroundColor: this.backgroundColor,
37056
37056
  backgroundOpacity: this.backgroundOpacity,
@@ -37591,7 +37591,7 @@ class Sticker extends BaseItem {
37591
37591
  }
37592
37592
  }
37593
37593
  saveStickerData() {
37594
- const storage = new SessionStorage2;
37594
+ const storage = new SessionStorage;
37595
37595
  storage.setStickerData(this.serialize());
37596
37596
  }
37597
37597
  serialize() {
@@ -38104,8 +38104,8 @@ class Frame extends BaseItem {
38104
38104
  this.borderWidth = borderWidth;
38105
38105
  this.textContainer = Frames[this.shapeType].textBounds.copy();
38106
38106
  this.path = Frames[this.shapeType].path.copy();
38107
- this.transformation = new Transformation(this.id, this.board.events);
38108
- this.linkTo = new LinkTo(this.id, this.board.events);
38107
+ this.transformation = new Transformation(this.id, board.events);
38108
+ this.linkTo = new LinkTo(this.id, board.events);
38109
38109
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontColor: FRAME_TITLE_COLOR });
38110
38110
  this.text.setSelectionHorisontalAlignment("left");
38111
38111
  this.transformation.subject.subscribe(() => {
@@ -39016,7 +39016,7 @@ function calculatePosition(boardImage, board) {
39016
39016
  const centerPoint = viewportMbr.getCenter();
39017
39017
  const imageWidth = boardImage.getWidth();
39018
39018
  const imageHeight = boardImage.getHeight();
39019
- const prevDimensions = tempStorage2.getImageDimensions();
39019
+ const prevDimensions = tempStorage.getImageDimensions();
39020
39020
  if (prevDimensions) {
39021
39021
  const scaleX2 = prevDimensions.width / imageWidth;
39022
39022
  const scaleY2 = prevDimensions.height / imageHeight;
@@ -39037,7 +39037,7 @@ function calculatePosition(boardImage, board) {
39037
39037
  const finalScale = scaleToFit;
39038
39038
  const scaledImageWidth = imageWidth * finalScale;
39039
39039
  const scaledImageHeight = imageHeight * finalScale;
39040
- tempStorage2.setImageDimensions({
39040
+ tempStorage.setImageDimensions({
39041
39041
  width: scaledImageWidth,
39042
39042
  height: scaledImageHeight
39043
39043
  });
@@ -40294,7 +40294,7 @@ class ImageItem extends BaseItem {
40294
40294
  }
40295
40295
  }
40296
40296
  // src/isSafari.ts
40297
- function isSafari2() {
40297
+ function isSafari() {
40298
40298
  if (typeof navigator === "undefined") {
40299
40299
  return false;
40300
40300
  }
@@ -40400,8 +40400,8 @@ class Drawing extends BaseItem {
40400
40400
  const cy = (points[j].y + points[j + 1].y) / 2;
40401
40401
  context.quadraticCurveTo(points[j].x, points[j].y, cx, cy);
40402
40402
  }
40403
- const x = points[j].x === points[j + 1].x && isSafari2() ? points[j + 1].x + 0.01 : points[j + 1].x;
40404
- const y = points[j].y === points[j + 1].y && isSafari2() ? points[j + 1].y + 0.01 : points[j + 1].y;
40403
+ const x = points[j].x === points[j + 1].x && isSafari() ? points[j + 1].x + 0.01 : points[j + 1].x;
40404
+ const y = points[j].y === points[j + 1].y && isSafari() ? points[j + 1].y + 0.01 : points[j + 1].y;
40405
40405
  context.quadraticCurveTo(points[j].x, points[j].y, x, y);
40406
40406
  }
40407
40407
  let left = Number.MAX_SAFE_INTEGER;
@@ -40532,8 +40532,8 @@ class Drawing extends BaseItem {
40532
40532
  const cy = (points[j].y + points[j + 1].y) / 2;
40533
40533
  pathData += ` Q ${points[j].x} ${points[j].y} ${cx} ${cy}`;
40534
40534
  }
40535
- const x = points[j].x === points[j + 1].x && isSafari2() ? points[j + 1].x + 0.01 : points[j + 1].x;
40536
- const y = points[j].y === points[j + 1].y && isSafari2() ? points[j + 1].y + 0.01 : points[j + 1].y;
40535
+ const x = points[j].x === points[j + 1].x && isSafari() ? points[j + 1].x + 0.01 : points[j + 1].x;
40536
+ const y = points[j].y === points[j + 1].y && isSafari() ? points[j + 1].y + 0.01 : points[j + 1].y;
40537
40537
  pathData += ` Q ${points[j].x} ${points[j].y} ${x} ${y}`;
40538
40538
  }
40539
40539
  return pathData;
@@ -42080,7 +42080,7 @@ class AddShape extends BoardTool {
42080
42080
  constructor(board) {
42081
42081
  super(board);
42082
42082
  this.setCursor();
42083
- const data = tempStorage2.getShapeData();
42083
+ const data = tempStorage.getShapeData();
42084
42084
  if (data) {
42085
42085
  this.shape = new Shape(board, "", data.shapeType, data.backgroundColor, data.backgroundOpacity, data.borderColor, data.borderOpacity, data.borderStyle, data.borderWidth);
42086
42086
  this.setShapeType(data.shapeType);
@@ -42161,13 +42161,13 @@ class AddShape extends BoardTool {
42161
42161
  if (this.type === "None") {
42162
42162
  return false;
42163
42163
  }
42164
- const width2 = this.bounds.getWidth() < 2 ? tempStorage2.getShapeWidth() || 100 : this.bounds.getWidth();
42165
- const height2 = this.bounds.getHeight() < 2 ? tempStorage2.getShapeHeight() || 100 : this.bounds.getHeight();
42164
+ const width2 = this.bounds.getWidth() < 2 ? tempStorage.getShapeWidth() || 100 : this.bounds.getWidth();
42165
+ const height2 = this.bounds.getHeight() < 2 ? tempStorage.getShapeHeight() || 100 : this.bounds.getHeight();
42166
42166
  if (this.bounds.getWidth() > 2) {
42167
- tempStorage2.setShapeWidth(this.bounds.getWidth());
42167
+ tempStorage.setShapeWidth(this.bounds.getWidth());
42168
42168
  }
42169
42169
  if (this.bounds.getHeight() > 2) {
42170
- tempStorage2.setShapeHeight(this.bounds.getHeight());
42170
+ tempStorage.setShapeHeight(this.bounds.getHeight());
42171
42171
  }
42172
42172
  this.initTransformation(width2 / 100, height2 / 100);
42173
42173
  const shape = this.board.add(this.shape);
@@ -43355,7 +43355,7 @@ function getQuickAddButtons(selection, board) {
43355
43355
  let htmlButtons = undefined;
43356
43356
  let quickAddItems = undefined;
43357
43357
  function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
43358
- const connectorStorage = new SessionStorage2;
43358
+ const connectorStorage = new SessionStorage;
43359
43359
  const currMbr = selectedItem.getMbr();
43360
43360
  const selectedItemData = selectedItem.serialize();
43361
43361
  const width2 = selectedItem.itemType === "Shape" ? selectedItem.getPath().getMbr().getWidth() : currMbr.getWidth();
@@ -43418,7 +43418,7 @@ function getQuickAddButtons(selection, board) {
43418
43418
  const fontSize = selectedItem.itemType === "RichText" ? selectedItem.getFontSize() : 14;
43419
43419
  const newItem = board.createItem(board.getNewItemId(), newItemData);
43420
43420
  if (newItem.itemType === "RichText") {
43421
- const storage = new SessionStorage2;
43421
+ const storage = new SessionStorage;
43422
43422
  storage.setFontSize("RichText", fontSize);
43423
43423
  newItem.editor.selectWholeText();
43424
43424
  newItem.applySelectionFontSize(fontSize);
@@ -44965,6 +44965,11 @@ class StickerTool extends CustomTool {
44965
44965
  }
44966
44966
  }
44967
44967
 
44968
+ // src/api/isIfarme.ts
44969
+ var isIframe = () => {
44970
+ return window.self !== window.top;
44971
+ };
44972
+
44968
44973
  // src/Tools/Tools.ts
44969
44974
  var registeredTools = {};
44970
44975
 
@@ -47866,7 +47871,7 @@ class Presence {
47866
47871
  if (!ctx) {
47867
47872
  return;
47868
47873
  }
47869
- const anonTranslate = i18n.t("presence.anonymous");
47874
+ const anonTranslate = conf.i18n.t("presence.anonymous");
47870
47875
  const label = cursor.nickname === "Anonymous" ? anonTranslate : cursor.nickname;
47871
47876
  const textWidth = ctx.measureText(label).width;
47872
47877
  const labelHeight = 20 * scale;
@@ -50208,7 +50213,7 @@ function transformItems({
50208
50213
  return null;
50209
50214
  }
50210
50215
  if (single instanceof ImageItem) {
50211
- tempStorage2.setImageDimensions({
50216
+ tempStorage.setImageDimensions({
50212
50217
  width: resize.mbr.getWidth(),
50213
50218
  height: resize.mbr.getHeight()
50214
50219
  });
@@ -50967,12 +50972,12 @@ class BoardSelection {
50967
50972
  return;
50968
50973
  }
50969
50974
  if (text5.isEmpty()) {
50970
- const textColor = tempStorage2.getFontColor(item.itemType);
50971
- const textSize = tempStorage2.getFontSize(item.itemType);
50972
- const highlightColor = tempStorage2.getFontHighlight(item.itemType);
50973
- const styles = tempStorage2.getFontStyles(item.itemType);
50974
- const horizontalAlignment = tempStorage2.getHorizontalAlignment(item.itemType);
50975
- const verticalAlignment = tempStorage2.getVerticalAlignment(item.itemType);
50975
+ const textColor = tempStorage.getFontColor(item.itemType);
50976
+ const textSize = tempStorage.getFontSize(item.itemType);
50977
+ const highlightColor = tempStorage.getFontHighlight(item.itemType);
50978
+ const styles = tempStorage.getFontStyles(item.itemType);
50979
+ const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
50980
+ const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
50976
50981
  if (textColor) {
50977
50982
  text5.setSelectionFontColor(textColor, "None");
50978
50983
  }
@@ -51515,9 +51520,9 @@ class BoardSelection {
51515
51520
  ops
51516
51521
  });
51517
51522
  if (item.itemType === "Sticker" && fontSize === "auto") {
51518
- tempStorage2.remove(`fontSize_${item.itemType}`);
51523
+ tempStorage.remove(`fontSize_${item.itemType}`);
51519
51524
  } else if (item.itemType !== "AINode") {
51520
- tempStorage2.setFontSize(item.itemType, fontSize);
51525
+ tempStorage.setFontSize(item.itemType, fontSize);
51521
51526
  }
51522
51527
  }
51523
51528
  const emptyOps = itemsOps.filter((op) => !op.ops.length);
@@ -51555,7 +51560,7 @@ class BoardSelection {
51555
51560
  ops
51556
51561
  });
51557
51562
  if (item.itemType !== "AINode") {
51558
- tempStorage2.setFontStyles(item.itemType, text5.getFontStyles());
51563
+ tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
51559
51564
  }
51560
51565
  }
51561
51566
  this.emitApplied({
@@ -51581,7 +51586,7 @@ class BoardSelection {
51581
51586
  selection: text5.editor.getSelection(),
51582
51587
  ops
51583
51588
  });
51584
- tempStorage2.setFontColor(item.itemType, fontColor);
51589
+ tempStorage.setFontColor(item.itemType, fontColor);
51585
51590
  }
51586
51591
  this.emitApplied({
51587
51592
  class: "RichText",
@@ -51625,7 +51630,7 @@ class BoardSelection {
51625
51630
  ops
51626
51631
  });
51627
51632
  if (item.itemType !== "AINode") {
51628
- tempStorage2.setFontHighlight(item.itemType, fontHighlight);
51633
+ tempStorage.setFontHighlight(item.itemType, fontHighlight);
51629
51634
  }
51630
51635
  }
51631
51636
  this.emitApplied({
@@ -51651,7 +51656,7 @@ class BoardSelection {
51651
51656
  selection: text5.editor.getSelection(),
51652
51657
  ops
51653
51658
  });
51654
- tempStorage2.setHorizontalAlignment(item.itemType, horisontalAlignment);
51659
+ tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
51655
51660
  }
51656
51661
  this.emitApplied({
51657
51662
  class: "RichText",
@@ -51675,7 +51680,7 @@ class BoardSelection {
51675
51680
  if (!text5) {
51676
51681
  return;
51677
51682
  }
51678
- tempStorage2.setVerticalAlignment(item.itemType, verticalAlignment);
51683
+ tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
51679
51684
  if (item instanceof RichText) {
51680
51685
  item.setEditorFocus(this.context);
51681
51686
  }
@@ -55367,7 +55372,7 @@ export {
55367
55372
  transformHtmlOrTextToMarkdown,
55368
55373
  toRelativePoint,
55369
55374
  toFiniteNumber,
55370
- tempStorage2 as tempStorage,
55375
+ tempStorage,
55371
55376
  tagByType,
55372
55377
  stickerColors,
55373
55378
  sha256,
@@ -55438,7 +55443,7 @@ export {
55438
55443
  Shapes,
55439
55444
  ShapeCommand,
55440
55445
  Shape,
55441
- SessionStorage2 as SessionStorage,
55446
+ SessionStorage,
55442
55447
  BoardSelection as Selection,
55443
55448
  STEP_STROKE_WIDTH,
55444
55449
  SHAPE_LAST_TYPE_KEY,