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.
@@ -637,7 +637,7 @@ __export(exports_browser, {
637
637
  transformHtmlOrTextToMarkdown: () => transformHtmlOrTextToMarkdown,
638
638
  toRelativePoint: () => toRelativePoint,
639
639
  toFiniteNumber: () => toFiniteNumber,
640
- tempStorage: () => tempStorage2,
640
+ tempStorage: () => tempStorage,
641
641
  tagByType: () => tagByType,
642
642
  stickerColors: () => stickerColors,
643
643
  sha256: () => sha256,
@@ -708,7 +708,7 @@ __export(exports_browser, {
708
708
  Shapes: () => Shapes,
709
709
  ShapeCommand: () => ShapeCommand,
710
710
  Shape: () => Shape,
711
- SessionStorage: () => SessionStorage2,
711
+ SessionStorage: () => SessionStorage,
712
712
  Selection: () => BoardSelection,
713
713
  STEP_STROKE_WIDTH: () => STEP_STROKE_WIDTH,
714
714
  SHAPE_LAST_TYPE_KEY: () => SHAPE_LAST_TYPE_KEY,
@@ -8609,7 +8609,7 @@ if (typeof window !== "undefined" && window.sessionStorage) {
8609
8609
  _sessionStorage = new NodeStoragePolyfill;
8610
8610
  }
8611
8611
 
8612
- class SessionStorage2 {
8612
+ class SessionStorage {
8613
8613
  set(key, value) {
8614
8614
  const boardId = this.getBoardId() || "";
8615
8615
  _sessionStorage.setItem(boardId + "_" + key, JSON.stringify(value));
@@ -8741,7 +8741,7 @@ class SessionStorage2 {
8741
8741
  return window.location.href.split("/").pop()?.split("?")[0];
8742
8742
  }
8743
8743
  }
8744
- var tempStorage2 = new SessionStorage2;
8744
+ var tempStorage = new SessionStorage;
8745
8745
 
8746
8746
  // src/HTMLRender/HTMLRender.ts
8747
8747
  function getTranslationFromHTML(el) {
@@ -18317,7 +18317,7 @@ class RichText extends Mbr {
18317
18317
  counter = counter + 1;
18318
18318
  this.rtCounter = counter;
18319
18319
  this.linkTo = linkTo || new LinkTo(this.id, this.board.events);
18320
- let textSizeFromStorage = new SessionStorage2().getFontSize(insideOf || "RichText");
18320
+ let textSizeFromStorage = new SessionStorage().getFontSize(insideOf || "RichText");
18321
18321
  if (!textSizeFromStorage || textSizeFromStorage === "auto") {
18322
18322
  textSizeFromStorage = initialTextStyles.fontSize;
18323
18323
  }
@@ -37202,7 +37202,7 @@ class Shape extends BaseItem {
37202
37202
  this.updateMbr();
37203
37203
  }
37204
37204
  saveShapeData() {
37205
- tempStorage2.setShapeData({
37205
+ tempStorage.setShapeData({
37206
37206
  shapeType: this.shapeType,
37207
37207
  backgroundColor: this.backgroundColor,
37208
37208
  backgroundOpacity: this.backgroundOpacity,
@@ -37743,7 +37743,7 @@ class Sticker extends BaseItem {
37743
37743
  }
37744
37744
  }
37745
37745
  saveStickerData() {
37746
- const storage = new SessionStorage2;
37746
+ const storage = new SessionStorage;
37747
37747
  storage.setStickerData(this.serialize());
37748
37748
  }
37749
37749
  serialize() {
@@ -38256,8 +38256,8 @@ class Frame extends BaseItem {
38256
38256
  this.borderWidth = borderWidth;
38257
38257
  this.textContainer = Frames[this.shapeType].textBounds.copy();
38258
38258
  this.path = Frames[this.shapeType].path.copy();
38259
- this.transformation = new Transformation(this.id, this.board.events);
38260
- this.linkTo = new LinkTo(this.id, this.board.events);
38259
+ this.transformation = new Transformation(this.id, board.events);
38260
+ this.linkTo = new LinkTo(this.id, board.events);
38261
38261
  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 });
38262
38262
  this.text.setSelectionHorisontalAlignment("left");
38263
38263
  this.transformation.subject.subscribe(() => {
@@ -39168,7 +39168,7 @@ function calculatePosition(boardImage, board) {
39168
39168
  const centerPoint = viewportMbr.getCenter();
39169
39169
  const imageWidth = boardImage.getWidth();
39170
39170
  const imageHeight = boardImage.getHeight();
39171
- const prevDimensions = tempStorage2.getImageDimensions();
39171
+ const prevDimensions = tempStorage.getImageDimensions();
39172
39172
  if (prevDimensions) {
39173
39173
  const scaleX2 = prevDimensions.width / imageWidth;
39174
39174
  const scaleY2 = prevDimensions.height / imageHeight;
@@ -39189,7 +39189,7 @@ function calculatePosition(boardImage, board) {
39189
39189
  const finalScale = scaleToFit;
39190
39190
  const scaledImageWidth = imageWidth * finalScale;
39191
39191
  const scaledImageHeight = imageHeight * finalScale;
39192
- tempStorage2.setImageDimensions({
39192
+ tempStorage.setImageDimensions({
39193
39193
  width: scaledImageWidth,
39194
39194
  height: scaledImageHeight
39195
39195
  });
@@ -40446,7 +40446,7 @@ class ImageItem extends BaseItem {
40446
40446
  }
40447
40447
  }
40448
40448
  // src/isSafari.ts
40449
- function isSafari2() {
40449
+ function isSafari() {
40450
40450
  if (typeof navigator === "undefined") {
40451
40451
  return false;
40452
40452
  }
@@ -40552,8 +40552,8 @@ class Drawing extends BaseItem {
40552
40552
  const cy = (points[j].y + points[j + 1].y) / 2;
40553
40553
  context.quadraticCurveTo(points[j].x, points[j].y, cx, cy);
40554
40554
  }
40555
- const x = points[j].x === points[j + 1].x && isSafari2() ? points[j + 1].x + 0.01 : points[j + 1].x;
40556
- const y = points[j].y === points[j + 1].y && isSafari2() ? points[j + 1].y + 0.01 : points[j + 1].y;
40555
+ const x = points[j].x === points[j + 1].x && isSafari() ? points[j + 1].x + 0.01 : points[j + 1].x;
40556
+ const y = points[j].y === points[j + 1].y && isSafari() ? points[j + 1].y + 0.01 : points[j + 1].y;
40557
40557
  context.quadraticCurveTo(points[j].x, points[j].y, x, y);
40558
40558
  }
40559
40559
  let left = Number.MAX_SAFE_INTEGER;
@@ -40684,8 +40684,8 @@ class Drawing extends BaseItem {
40684
40684
  const cy = (points[j].y + points[j + 1].y) / 2;
40685
40685
  pathData += ` Q ${points[j].x} ${points[j].y} ${cx} ${cy}`;
40686
40686
  }
40687
- const x = points[j].x === points[j + 1].x && isSafari2() ? points[j + 1].x + 0.01 : points[j + 1].x;
40688
- const y = points[j].y === points[j + 1].y && isSafari2() ? points[j + 1].y + 0.01 : points[j + 1].y;
40687
+ const x = points[j].x === points[j + 1].x && isSafari() ? points[j + 1].x + 0.01 : points[j + 1].x;
40688
+ const y = points[j].y === points[j + 1].y && isSafari() ? points[j + 1].y + 0.01 : points[j + 1].y;
40689
40689
  pathData += ` Q ${points[j].x} ${points[j].y} ${x} ${y}`;
40690
40690
  }
40691
40691
  return pathData;
@@ -42232,7 +42232,7 @@ class AddShape extends BoardTool {
42232
42232
  constructor(board) {
42233
42233
  super(board);
42234
42234
  this.setCursor();
42235
- const data = tempStorage2.getShapeData();
42235
+ const data = tempStorage.getShapeData();
42236
42236
  if (data) {
42237
42237
  this.shape = new Shape(board, "", data.shapeType, data.backgroundColor, data.backgroundOpacity, data.borderColor, data.borderOpacity, data.borderStyle, data.borderWidth);
42238
42238
  this.setShapeType(data.shapeType);
@@ -42313,13 +42313,13 @@ class AddShape extends BoardTool {
42313
42313
  if (this.type === "None") {
42314
42314
  return false;
42315
42315
  }
42316
- const width2 = this.bounds.getWidth() < 2 ? tempStorage2.getShapeWidth() || 100 : this.bounds.getWidth();
42317
- const height2 = this.bounds.getHeight() < 2 ? tempStorage2.getShapeHeight() || 100 : this.bounds.getHeight();
42316
+ const width2 = this.bounds.getWidth() < 2 ? tempStorage.getShapeWidth() || 100 : this.bounds.getWidth();
42317
+ const height2 = this.bounds.getHeight() < 2 ? tempStorage.getShapeHeight() || 100 : this.bounds.getHeight();
42318
42318
  if (this.bounds.getWidth() > 2) {
42319
- tempStorage2.setShapeWidth(this.bounds.getWidth());
42319
+ tempStorage.setShapeWidth(this.bounds.getWidth());
42320
42320
  }
42321
42321
  if (this.bounds.getHeight() > 2) {
42322
- tempStorage2.setShapeHeight(this.bounds.getHeight());
42322
+ tempStorage.setShapeHeight(this.bounds.getHeight());
42323
42323
  }
42324
42324
  this.initTransformation(width2 / 100, height2 / 100);
42325
42325
  const shape = this.board.add(this.shape);
@@ -43507,7 +43507,7 @@ function getQuickAddButtons(selection, board) {
43507
43507
  let htmlButtons = undefined;
43508
43508
  let quickAddItems = undefined;
43509
43509
  function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
43510
- const connectorStorage = new SessionStorage2;
43510
+ const connectorStorage = new SessionStorage;
43511
43511
  const currMbr = selectedItem.getMbr();
43512
43512
  const selectedItemData = selectedItem.serialize();
43513
43513
  const width2 = selectedItem.itemType === "Shape" ? selectedItem.getPath().getMbr().getWidth() : currMbr.getWidth();
@@ -43570,7 +43570,7 @@ function getQuickAddButtons(selection, board) {
43570
43570
  const fontSize = selectedItem.itemType === "RichText" ? selectedItem.getFontSize() : 14;
43571
43571
  const newItem = board.createItem(board.getNewItemId(), newItemData);
43572
43572
  if (newItem.itemType === "RichText") {
43573
- const storage = new SessionStorage2;
43573
+ const storage = new SessionStorage;
43574
43574
  storage.setFontSize("RichText", fontSize);
43575
43575
  newItem.editor.selectWholeText();
43576
43576
  newItem.applySelectionFontSize(fontSize);
@@ -45117,6 +45117,11 @@ class StickerTool extends CustomTool {
45117
45117
  }
45118
45118
  }
45119
45119
 
45120
+ // src/api/isIfarme.ts
45121
+ var isIframe = () => {
45122
+ return window.self !== window.top;
45123
+ };
45124
+
45120
45125
  // src/Tools/Tools.ts
45121
45126
  var registeredTools = {};
45122
45127
 
@@ -48018,7 +48023,7 @@ class Presence {
48018
48023
  if (!ctx) {
48019
48024
  return;
48020
48025
  }
48021
- const anonTranslate = i18n.t("presence.anonymous");
48026
+ const anonTranslate = conf.i18n.t("presence.anonymous");
48022
48027
  const label = cursor.nickname === "Anonymous" ? anonTranslate : cursor.nickname;
48023
48028
  const textWidth = ctx.measureText(label).width;
48024
48029
  const labelHeight = 20 * scale;
@@ -50360,7 +50365,7 @@ function transformItems({
50360
50365
  return null;
50361
50366
  }
50362
50367
  if (single instanceof ImageItem) {
50363
- tempStorage2.setImageDimensions({
50368
+ tempStorage.setImageDimensions({
50364
50369
  width: resize.mbr.getWidth(),
50365
50370
  height: resize.mbr.getHeight()
50366
50371
  });
@@ -51119,12 +51124,12 @@ class BoardSelection {
51119
51124
  return;
51120
51125
  }
51121
51126
  if (text5.isEmpty()) {
51122
- const textColor = tempStorage2.getFontColor(item.itemType);
51123
- const textSize = tempStorage2.getFontSize(item.itemType);
51124
- const highlightColor = tempStorage2.getFontHighlight(item.itemType);
51125
- const styles = tempStorage2.getFontStyles(item.itemType);
51126
- const horizontalAlignment = tempStorage2.getHorizontalAlignment(item.itemType);
51127
- const verticalAlignment = tempStorage2.getVerticalAlignment(item.itemType);
51127
+ const textColor = tempStorage.getFontColor(item.itemType);
51128
+ const textSize = tempStorage.getFontSize(item.itemType);
51129
+ const highlightColor = tempStorage.getFontHighlight(item.itemType);
51130
+ const styles = tempStorage.getFontStyles(item.itemType);
51131
+ const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
51132
+ const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
51128
51133
  if (textColor) {
51129
51134
  text5.setSelectionFontColor(textColor, "None");
51130
51135
  }
@@ -51667,9 +51672,9 @@ class BoardSelection {
51667
51672
  ops
51668
51673
  });
51669
51674
  if (item.itemType === "Sticker" && fontSize === "auto") {
51670
- tempStorage2.remove(`fontSize_${item.itemType}`);
51675
+ tempStorage.remove(`fontSize_${item.itemType}`);
51671
51676
  } else if (item.itemType !== "AINode") {
51672
- tempStorage2.setFontSize(item.itemType, fontSize);
51677
+ tempStorage.setFontSize(item.itemType, fontSize);
51673
51678
  }
51674
51679
  }
51675
51680
  const emptyOps = itemsOps.filter((op) => !op.ops.length);
@@ -51707,7 +51712,7 @@ class BoardSelection {
51707
51712
  ops
51708
51713
  });
51709
51714
  if (item.itemType !== "AINode") {
51710
- tempStorage2.setFontStyles(item.itemType, text5.getFontStyles());
51715
+ tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
51711
51716
  }
51712
51717
  }
51713
51718
  this.emitApplied({
@@ -51733,7 +51738,7 @@ class BoardSelection {
51733
51738
  selection: text5.editor.getSelection(),
51734
51739
  ops
51735
51740
  });
51736
- tempStorage2.setFontColor(item.itemType, fontColor);
51741
+ tempStorage.setFontColor(item.itemType, fontColor);
51737
51742
  }
51738
51743
  this.emitApplied({
51739
51744
  class: "RichText",
@@ -51777,7 +51782,7 @@ class BoardSelection {
51777
51782
  ops
51778
51783
  });
51779
51784
  if (item.itemType !== "AINode") {
51780
- tempStorage2.setFontHighlight(item.itemType, fontHighlight);
51785
+ tempStorage.setFontHighlight(item.itemType, fontHighlight);
51781
51786
  }
51782
51787
  }
51783
51788
  this.emitApplied({
@@ -51803,7 +51808,7 @@ class BoardSelection {
51803
51808
  selection: text5.editor.getSelection(),
51804
51809
  ops
51805
51810
  });
51806
- tempStorage2.setHorizontalAlignment(item.itemType, horisontalAlignment);
51811
+ tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
51807
51812
  }
51808
51813
  this.emitApplied({
51809
51814
  class: "RichText",
@@ -51827,7 +51832,7 @@ class BoardSelection {
51827
51832
  if (!text5) {
51828
51833
  return;
51829
51834
  }
51830
- tempStorage2.setVerticalAlignment(item.itemType, verticalAlignment);
51835
+ tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
51831
51836
  if (item instanceof RichText) {
51832
51837
  item.setEditorFocus(this.context);
51833
51838
  }
package/dist/cjs/index.js CHANGED
@@ -637,7 +637,7 @@ __export(exports_src, {
637
637
  transformHtmlOrTextToMarkdown: () => transformHtmlOrTextToMarkdown,
638
638
  toRelativePoint: () => toRelativePoint,
639
639
  toFiniteNumber: () => toFiniteNumber,
640
- tempStorage: () => tempStorage2,
640
+ tempStorage: () => tempStorage,
641
641
  tagByType: () => tagByType,
642
642
  stickerColors: () => stickerColors,
643
643
  sha256: () => sha256,
@@ -708,7 +708,7 @@ __export(exports_src, {
708
708
  Shapes: () => Shapes,
709
709
  ShapeCommand: () => ShapeCommand,
710
710
  Shape: () => Shape,
711
- SessionStorage: () => SessionStorage2,
711
+ SessionStorage: () => SessionStorage,
712
712
  Selection: () => BoardSelection,
713
713
  STEP_STROKE_WIDTH: () => STEP_STROKE_WIDTH,
714
714
  SHAPE_LAST_TYPE_KEY: () => SHAPE_LAST_TYPE_KEY,
@@ -8609,7 +8609,7 @@ if (typeof window !== "undefined" && window.sessionStorage) {
8609
8609
  _sessionStorage = new NodeStoragePolyfill;
8610
8610
  }
8611
8611
 
8612
- class SessionStorage2 {
8612
+ class SessionStorage {
8613
8613
  set(key, value) {
8614
8614
  const boardId = this.getBoardId() || "";
8615
8615
  _sessionStorage.setItem(boardId + "_" + key, JSON.stringify(value));
@@ -8741,7 +8741,7 @@ class SessionStorage2 {
8741
8741
  return window.location.href.split("/").pop()?.split("?")[0];
8742
8742
  }
8743
8743
  }
8744
- var tempStorage2 = new SessionStorage2;
8744
+ var tempStorage = new SessionStorage;
8745
8745
 
8746
8746
  // src/HTMLRender/HTMLRender.ts
8747
8747
  function getTranslationFromHTML(el) {
@@ -18317,7 +18317,7 @@ class RichText extends Mbr {
18317
18317
  counter = counter + 1;
18318
18318
  this.rtCounter = counter;
18319
18319
  this.linkTo = linkTo || new LinkTo(this.id, this.board.events);
18320
- let textSizeFromStorage = new SessionStorage2().getFontSize(insideOf || "RichText");
18320
+ let textSizeFromStorage = new SessionStorage().getFontSize(insideOf || "RichText");
18321
18321
  if (!textSizeFromStorage || textSizeFromStorage === "auto") {
18322
18322
  textSizeFromStorage = initialTextStyles.fontSize;
18323
18323
  }
@@ -37202,7 +37202,7 @@ class Shape extends BaseItem {
37202
37202
  this.updateMbr();
37203
37203
  }
37204
37204
  saveShapeData() {
37205
- tempStorage2.setShapeData({
37205
+ tempStorage.setShapeData({
37206
37206
  shapeType: this.shapeType,
37207
37207
  backgroundColor: this.backgroundColor,
37208
37208
  backgroundOpacity: this.backgroundOpacity,
@@ -37743,7 +37743,7 @@ class Sticker extends BaseItem {
37743
37743
  }
37744
37744
  }
37745
37745
  saveStickerData() {
37746
- const storage = new SessionStorage2;
37746
+ const storage = new SessionStorage;
37747
37747
  storage.setStickerData(this.serialize());
37748
37748
  }
37749
37749
  serialize() {
@@ -38256,8 +38256,8 @@ class Frame extends BaseItem {
38256
38256
  this.borderWidth = borderWidth;
38257
38257
  this.textContainer = Frames[this.shapeType].textBounds.copy();
38258
38258
  this.path = Frames[this.shapeType].path.copy();
38259
- this.transformation = new Transformation(this.id, this.board.events);
38260
- this.linkTo = new LinkTo(this.id, this.board.events);
38259
+ this.transformation = new Transformation(this.id, board.events);
38260
+ this.linkTo = new LinkTo(this.id, board.events);
38261
38261
  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 });
38262
38262
  this.text.setSelectionHorisontalAlignment("left");
38263
38263
  this.transformation.subject.subscribe(() => {
@@ -39168,7 +39168,7 @@ function calculatePosition(boardImage, board) {
39168
39168
  const centerPoint = viewportMbr.getCenter();
39169
39169
  const imageWidth = boardImage.getWidth();
39170
39170
  const imageHeight = boardImage.getHeight();
39171
- const prevDimensions = tempStorage2.getImageDimensions();
39171
+ const prevDimensions = tempStorage.getImageDimensions();
39172
39172
  if (prevDimensions) {
39173
39173
  const scaleX2 = prevDimensions.width / imageWidth;
39174
39174
  const scaleY2 = prevDimensions.height / imageHeight;
@@ -39189,7 +39189,7 @@ function calculatePosition(boardImage, board) {
39189
39189
  const finalScale = scaleToFit;
39190
39190
  const scaledImageWidth = imageWidth * finalScale;
39191
39191
  const scaledImageHeight = imageHeight * finalScale;
39192
- tempStorage2.setImageDimensions({
39192
+ tempStorage.setImageDimensions({
39193
39193
  width: scaledImageWidth,
39194
39194
  height: scaledImageHeight
39195
39195
  });
@@ -40446,7 +40446,7 @@ class ImageItem extends BaseItem {
40446
40446
  }
40447
40447
  }
40448
40448
  // src/isSafari.ts
40449
- function isSafari2() {
40449
+ function isSafari() {
40450
40450
  if (typeof navigator === "undefined") {
40451
40451
  return false;
40452
40452
  }
@@ -40552,8 +40552,8 @@ class Drawing extends BaseItem {
40552
40552
  const cy = (points[j].y + points[j + 1].y) / 2;
40553
40553
  context.quadraticCurveTo(points[j].x, points[j].y, cx, cy);
40554
40554
  }
40555
- const x = points[j].x === points[j + 1].x && isSafari2() ? points[j + 1].x + 0.01 : points[j + 1].x;
40556
- const y = points[j].y === points[j + 1].y && isSafari2() ? points[j + 1].y + 0.01 : points[j + 1].y;
40555
+ const x = points[j].x === points[j + 1].x && isSafari() ? points[j + 1].x + 0.01 : points[j + 1].x;
40556
+ const y = points[j].y === points[j + 1].y && isSafari() ? points[j + 1].y + 0.01 : points[j + 1].y;
40557
40557
  context.quadraticCurveTo(points[j].x, points[j].y, x, y);
40558
40558
  }
40559
40559
  let left = Number.MAX_SAFE_INTEGER;
@@ -40684,8 +40684,8 @@ class Drawing extends BaseItem {
40684
40684
  const cy = (points[j].y + points[j + 1].y) / 2;
40685
40685
  pathData += ` Q ${points[j].x} ${points[j].y} ${cx} ${cy}`;
40686
40686
  }
40687
- const x = points[j].x === points[j + 1].x && isSafari2() ? points[j + 1].x + 0.01 : points[j + 1].x;
40688
- const y = points[j].y === points[j + 1].y && isSafari2() ? points[j + 1].y + 0.01 : points[j + 1].y;
40687
+ const x = points[j].x === points[j + 1].x && isSafari() ? points[j + 1].x + 0.01 : points[j + 1].x;
40688
+ const y = points[j].y === points[j + 1].y && isSafari() ? points[j + 1].y + 0.01 : points[j + 1].y;
40689
40689
  pathData += ` Q ${points[j].x} ${points[j].y} ${x} ${y}`;
40690
40690
  }
40691
40691
  return pathData;
@@ -42232,7 +42232,7 @@ class AddShape extends BoardTool {
42232
42232
  constructor(board) {
42233
42233
  super(board);
42234
42234
  this.setCursor();
42235
- const data = tempStorage2.getShapeData();
42235
+ const data = tempStorage.getShapeData();
42236
42236
  if (data) {
42237
42237
  this.shape = new Shape(board, "", data.shapeType, data.backgroundColor, data.backgroundOpacity, data.borderColor, data.borderOpacity, data.borderStyle, data.borderWidth);
42238
42238
  this.setShapeType(data.shapeType);
@@ -42313,13 +42313,13 @@ class AddShape extends BoardTool {
42313
42313
  if (this.type === "None") {
42314
42314
  return false;
42315
42315
  }
42316
- const width2 = this.bounds.getWidth() < 2 ? tempStorage2.getShapeWidth() || 100 : this.bounds.getWidth();
42317
- const height2 = this.bounds.getHeight() < 2 ? tempStorage2.getShapeHeight() || 100 : this.bounds.getHeight();
42316
+ const width2 = this.bounds.getWidth() < 2 ? tempStorage.getShapeWidth() || 100 : this.bounds.getWidth();
42317
+ const height2 = this.bounds.getHeight() < 2 ? tempStorage.getShapeHeight() || 100 : this.bounds.getHeight();
42318
42318
  if (this.bounds.getWidth() > 2) {
42319
- tempStorage2.setShapeWidth(this.bounds.getWidth());
42319
+ tempStorage.setShapeWidth(this.bounds.getWidth());
42320
42320
  }
42321
42321
  if (this.bounds.getHeight() > 2) {
42322
- tempStorage2.setShapeHeight(this.bounds.getHeight());
42322
+ tempStorage.setShapeHeight(this.bounds.getHeight());
42323
42323
  }
42324
42324
  this.initTransformation(width2 / 100, height2 / 100);
42325
42325
  const shape = this.board.add(this.shape);
@@ -43507,7 +43507,7 @@ function getQuickAddButtons(selection, board) {
43507
43507
  let htmlButtons = undefined;
43508
43508
  let quickAddItems = undefined;
43509
43509
  function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
43510
- const connectorStorage = new SessionStorage2;
43510
+ const connectorStorage = new SessionStorage;
43511
43511
  const currMbr = selectedItem.getMbr();
43512
43512
  const selectedItemData = selectedItem.serialize();
43513
43513
  const width2 = selectedItem.itemType === "Shape" ? selectedItem.getPath().getMbr().getWidth() : currMbr.getWidth();
@@ -43570,7 +43570,7 @@ function getQuickAddButtons(selection, board) {
43570
43570
  const fontSize = selectedItem.itemType === "RichText" ? selectedItem.getFontSize() : 14;
43571
43571
  const newItem = board.createItem(board.getNewItemId(), newItemData);
43572
43572
  if (newItem.itemType === "RichText") {
43573
- const storage = new SessionStorage2;
43573
+ const storage = new SessionStorage;
43574
43574
  storage.setFontSize("RichText", fontSize);
43575
43575
  newItem.editor.selectWholeText();
43576
43576
  newItem.applySelectionFontSize(fontSize);
@@ -45117,6 +45117,11 @@ class StickerTool extends CustomTool {
45117
45117
  }
45118
45118
  }
45119
45119
 
45120
+ // src/api/isIfarme.ts
45121
+ var isIframe = () => {
45122
+ return window.self !== window.top;
45123
+ };
45124
+
45120
45125
  // src/Tools/Tools.ts
45121
45126
  var registeredTools = {};
45122
45127
 
@@ -48018,7 +48023,7 @@ class Presence {
48018
48023
  if (!ctx) {
48019
48024
  return;
48020
48025
  }
48021
- const anonTranslate = i18n.t("presence.anonymous");
48026
+ const anonTranslate = conf.i18n.t("presence.anonymous");
48022
48027
  const label = cursor.nickname === "Anonymous" ? anonTranslate : cursor.nickname;
48023
48028
  const textWidth = ctx.measureText(label).width;
48024
48029
  const labelHeight = 20 * scale;
@@ -50360,7 +50365,7 @@ function transformItems({
50360
50365
  return null;
50361
50366
  }
50362
50367
  if (single instanceof ImageItem) {
50363
- tempStorage2.setImageDimensions({
50368
+ tempStorage.setImageDimensions({
50364
50369
  width: resize.mbr.getWidth(),
50365
50370
  height: resize.mbr.getHeight()
50366
50371
  });
@@ -51119,12 +51124,12 @@ class BoardSelection {
51119
51124
  return;
51120
51125
  }
51121
51126
  if (text5.isEmpty()) {
51122
- const textColor = tempStorage2.getFontColor(item.itemType);
51123
- const textSize = tempStorage2.getFontSize(item.itemType);
51124
- const highlightColor = tempStorage2.getFontHighlight(item.itemType);
51125
- const styles = tempStorage2.getFontStyles(item.itemType);
51126
- const horizontalAlignment = tempStorage2.getHorizontalAlignment(item.itemType);
51127
- const verticalAlignment = tempStorage2.getVerticalAlignment(item.itemType);
51127
+ const textColor = tempStorage.getFontColor(item.itemType);
51128
+ const textSize = tempStorage.getFontSize(item.itemType);
51129
+ const highlightColor = tempStorage.getFontHighlight(item.itemType);
51130
+ const styles = tempStorage.getFontStyles(item.itemType);
51131
+ const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
51132
+ const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
51128
51133
  if (textColor) {
51129
51134
  text5.setSelectionFontColor(textColor, "None");
51130
51135
  }
@@ -51667,9 +51672,9 @@ class BoardSelection {
51667
51672
  ops
51668
51673
  });
51669
51674
  if (item.itemType === "Sticker" && fontSize === "auto") {
51670
- tempStorage2.remove(`fontSize_${item.itemType}`);
51675
+ tempStorage.remove(`fontSize_${item.itemType}`);
51671
51676
  } else if (item.itemType !== "AINode") {
51672
- tempStorage2.setFontSize(item.itemType, fontSize);
51677
+ tempStorage.setFontSize(item.itemType, fontSize);
51673
51678
  }
51674
51679
  }
51675
51680
  const emptyOps = itemsOps.filter((op) => !op.ops.length);
@@ -51707,7 +51712,7 @@ class BoardSelection {
51707
51712
  ops
51708
51713
  });
51709
51714
  if (item.itemType !== "AINode") {
51710
- tempStorage2.setFontStyles(item.itemType, text5.getFontStyles());
51715
+ tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
51711
51716
  }
51712
51717
  }
51713
51718
  this.emitApplied({
@@ -51733,7 +51738,7 @@ class BoardSelection {
51733
51738
  selection: text5.editor.getSelection(),
51734
51739
  ops
51735
51740
  });
51736
- tempStorage2.setFontColor(item.itemType, fontColor);
51741
+ tempStorage.setFontColor(item.itemType, fontColor);
51737
51742
  }
51738
51743
  this.emitApplied({
51739
51744
  class: "RichText",
@@ -51777,7 +51782,7 @@ class BoardSelection {
51777
51782
  ops
51778
51783
  });
51779
51784
  if (item.itemType !== "AINode") {
51780
- tempStorage2.setFontHighlight(item.itemType, fontHighlight);
51785
+ tempStorage.setFontHighlight(item.itemType, fontHighlight);
51781
51786
  }
51782
51787
  }
51783
51788
  this.emitApplied({
@@ -51803,7 +51808,7 @@ class BoardSelection {
51803
51808
  selection: text5.editor.getSelection(),
51804
51809
  ops
51805
51810
  });
51806
- tempStorage2.setHorizontalAlignment(item.itemType, horisontalAlignment);
51811
+ tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
51807
51812
  }
51808
51813
  this.emitApplied({
51809
51814
  class: "RichText",
@@ -51827,7 +51832,7 @@ class BoardSelection {
51827
51832
  if (!text5) {
51828
51833
  return;
51829
51834
  }
51830
- tempStorage2.setVerticalAlignment(item.itemType, verticalAlignment);
51835
+ tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
51831
51836
  if (item instanceof RichText) {
51832
51837
  item.setEditorFocus(this.context);
51833
51838
  }