microboard-temp 0.1.27 → 0.2.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.
- package/dist/cjs/browser.js +38 -33
- package/dist/cjs/index.js +38 -33
- package/dist/cjs/node.js +38 -33
- package/dist/esm/browser.js +38 -33
- package/dist/esm/index.js +38 -33
- package/dist/esm/node.js +38 -33
- package/dist/types/Events/SyncLog.d.ts +3 -3
- package/dist/types/Keyboard/types.d.ts +2 -2
- package/dist/types/Settings.d.ts +2 -1
- package/dist/types/Tools/Eraser/Eraser.d.ts +5 -5
- package/dist/types/api/isIfarme.d.ts +1 -0
- package/dist/types/ts-error-prioritizer.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -8441,7 +8441,7 @@ if (typeof window !== "undefined" && window.sessionStorage) {
|
|
|
8441
8441
|
_sessionStorage = new NodeStoragePolyfill;
|
|
8442
8442
|
}
|
|
8443
8443
|
|
|
8444
|
-
class
|
|
8444
|
+
class SessionStorage {
|
|
8445
8445
|
set(key, value) {
|
|
8446
8446
|
const boardId = this.getBoardId() || "";
|
|
8447
8447
|
_sessionStorage.setItem(boardId + "_" + key, JSON.stringify(value));
|
|
@@ -8573,7 +8573,7 @@ class SessionStorage2 {
|
|
|
8573
8573
|
return window.location.href.split("/").pop()?.split("?")[0];
|
|
8574
8574
|
}
|
|
8575
8575
|
}
|
|
8576
|
-
var
|
|
8576
|
+
var tempStorage = new SessionStorage;
|
|
8577
8577
|
|
|
8578
8578
|
// src/HTMLRender/HTMLRender.ts
|
|
8579
8579
|
function getTranslationFromHTML(el) {
|
|
@@ -18158,7 +18158,7 @@ class RichText extends Mbr {
|
|
|
18158
18158
|
counter = counter + 1;
|
|
18159
18159
|
this.rtCounter = counter;
|
|
18160
18160
|
this.linkTo = linkTo || new LinkTo(this.id, this.board.events);
|
|
18161
|
-
let textSizeFromStorage = new
|
|
18161
|
+
let textSizeFromStorage = new SessionStorage().getFontSize(insideOf || "RichText");
|
|
18162
18162
|
if (!textSizeFromStorage || textSizeFromStorage === "auto") {
|
|
18163
18163
|
textSizeFromStorage = initialTextStyles.fontSize;
|
|
18164
18164
|
}
|
|
@@ -37043,7 +37043,7 @@ class Shape extends BaseItem {
|
|
|
37043
37043
|
this.updateMbr();
|
|
37044
37044
|
}
|
|
37045
37045
|
saveShapeData() {
|
|
37046
|
-
|
|
37046
|
+
tempStorage.setShapeData({
|
|
37047
37047
|
shapeType: this.shapeType,
|
|
37048
37048
|
backgroundColor: this.backgroundColor,
|
|
37049
37049
|
backgroundOpacity: this.backgroundOpacity,
|
|
@@ -37584,7 +37584,7 @@ class Sticker extends BaseItem {
|
|
|
37584
37584
|
}
|
|
37585
37585
|
}
|
|
37586
37586
|
saveStickerData() {
|
|
37587
|
-
const storage = new
|
|
37587
|
+
const storage = new SessionStorage;
|
|
37588
37588
|
storage.setStickerData(this.serialize());
|
|
37589
37589
|
}
|
|
37590
37590
|
serialize() {
|
|
@@ -38097,8 +38097,8 @@ class Frame extends BaseItem {
|
|
|
38097
38097
|
this.borderWidth = borderWidth;
|
|
38098
38098
|
this.textContainer = Frames[this.shapeType].textBounds.copy();
|
|
38099
38099
|
this.path = Frames[this.shapeType].path.copy();
|
|
38100
|
-
this.transformation = new Transformation(this.id,
|
|
38101
|
-
this.linkTo = new LinkTo(this.id,
|
|
38100
|
+
this.transformation = new Transformation(this.id, board.events);
|
|
38101
|
+
this.linkTo = new LinkTo(this.id, board.events);
|
|
38102
38102
|
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 });
|
|
38103
38103
|
this.text.setSelectionHorisontalAlignment("left");
|
|
38104
38104
|
this.transformation.subject.subscribe(() => {
|
|
@@ -39009,7 +39009,7 @@ function calculatePosition(boardImage, board) {
|
|
|
39009
39009
|
const centerPoint = viewportMbr.getCenter();
|
|
39010
39010
|
const imageWidth = boardImage.getWidth();
|
|
39011
39011
|
const imageHeight = boardImage.getHeight();
|
|
39012
|
-
const prevDimensions =
|
|
39012
|
+
const prevDimensions = tempStorage.getImageDimensions();
|
|
39013
39013
|
if (prevDimensions) {
|
|
39014
39014
|
const scaleX2 = prevDimensions.width / imageWidth;
|
|
39015
39015
|
const scaleY2 = prevDimensions.height / imageHeight;
|
|
@@ -39030,7 +39030,7 @@ function calculatePosition(boardImage, board) {
|
|
|
39030
39030
|
const finalScale = scaleToFit;
|
|
39031
39031
|
const scaledImageWidth = imageWidth * finalScale;
|
|
39032
39032
|
const scaledImageHeight = imageHeight * finalScale;
|
|
39033
|
-
|
|
39033
|
+
tempStorage.setImageDimensions({
|
|
39034
39034
|
width: scaledImageWidth,
|
|
39035
39035
|
height: scaledImageHeight
|
|
39036
39036
|
});
|
|
@@ -42073,7 +42073,7 @@ class AddShape extends BoardTool {
|
|
|
42073
42073
|
constructor(board) {
|
|
42074
42074
|
super(board);
|
|
42075
42075
|
this.setCursor();
|
|
42076
|
-
const data =
|
|
42076
|
+
const data = tempStorage.getShapeData();
|
|
42077
42077
|
if (data) {
|
|
42078
42078
|
this.shape = new Shape(board, "", data.shapeType, data.backgroundColor, data.backgroundOpacity, data.borderColor, data.borderOpacity, data.borderStyle, data.borderWidth);
|
|
42079
42079
|
this.setShapeType(data.shapeType);
|
|
@@ -42154,13 +42154,13 @@ class AddShape extends BoardTool {
|
|
|
42154
42154
|
if (this.type === "None") {
|
|
42155
42155
|
return false;
|
|
42156
42156
|
}
|
|
42157
|
-
const width2 = this.bounds.getWidth() < 2 ?
|
|
42158
|
-
const height2 = this.bounds.getHeight() < 2 ?
|
|
42157
|
+
const width2 = this.bounds.getWidth() < 2 ? tempStorage.getShapeWidth() || 100 : this.bounds.getWidth();
|
|
42158
|
+
const height2 = this.bounds.getHeight() < 2 ? tempStorage.getShapeHeight() || 100 : this.bounds.getHeight();
|
|
42159
42159
|
if (this.bounds.getWidth() > 2) {
|
|
42160
|
-
|
|
42160
|
+
tempStorage.setShapeWidth(this.bounds.getWidth());
|
|
42161
42161
|
}
|
|
42162
42162
|
if (this.bounds.getHeight() > 2) {
|
|
42163
|
-
|
|
42163
|
+
tempStorage.setShapeHeight(this.bounds.getHeight());
|
|
42164
42164
|
}
|
|
42165
42165
|
this.initTransformation(width2 / 100, height2 / 100);
|
|
42166
42166
|
const shape = this.board.add(this.shape);
|
|
@@ -43348,7 +43348,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
43348
43348
|
let htmlButtons = undefined;
|
|
43349
43349
|
let quickAddItems = undefined;
|
|
43350
43350
|
function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
|
|
43351
|
-
const connectorStorage = new
|
|
43351
|
+
const connectorStorage = new SessionStorage;
|
|
43352
43352
|
const currMbr = selectedItem.getMbr();
|
|
43353
43353
|
const selectedItemData = selectedItem.serialize();
|
|
43354
43354
|
const width2 = selectedItem.itemType === "Shape" ? selectedItem.getPath().getMbr().getWidth() : currMbr.getWidth();
|
|
@@ -43411,7 +43411,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
43411
43411
|
const fontSize = selectedItem.itemType === "RichText" ? selectedItem.getFontSize() : 14;
|
|
43412
43412
|
const newItem = board.createItem(board.getNewItemId(), newItemData);
|
|
43413
43413
|
if (newItem.itemType === "RichText") {
|
|
43414
|
-
const storage = new
|
|
43414
|
+
const storage = new SessionStorage;
|
|
43415
43415
|
storage.setFontSize("RichText", fontSize);
|
|
43416
43416
|
newItem.editor.selectWholeText();
|
|
43417
43417
|
newItem.applySelectionFontSize(fontSize);
|
|
@@ -44958,6 +44958,11 @@ class StickerTool extends CustomTool {
|
|
|
44958
44958
|
}
|
|
44959
44959
|
}
|
|
44960
44960
|
|
|
44961
|
+
// src/api/isIfarme.ts
|
|
44962
|
+
var isIframe = () => {
|
|
44963
|
+
return window.self !== window.top;
|
|
44964
|
+
};
|
|
44965
|
+
|
|
44961
44966
|
// src/Tools/Tools.ts
|
|
44962
44967
|
var registeredTools = {};
|
|
44963
44968
|
|
|
@@ -47859,7 +47864,7 @@ class Presence {
|
|
|
47859
47864
|
if (!ctx) {
|
|
47860
47865
|
return;
|
|
47861
47866
|
}
|
|
47862
|
-
const anonTranslate = i18n.t("presence.anonymous");
|
|
47867
|
+
const anonTranslate = conf.i18n.t("presence.anonymous");
|
|
47863
47868
|
const label = cursor.nickname === "Anonymous" ? anonTranslate : cursor.nickname;
|
|
47864
47869
|
const textWidth = ctx.measureText(label).width;
|
|
47865
47870
|
const labelHeight = 20 * scale;
|
|
@@ -50201,7 +50206,7 @@ function transformItems({
|
|
|
50201
50206
|
return null;
|
|
50202
50207
|
}
|
|
50203
50208
|
if (single instanceof ImageItem) {
|
|
50204
|
-
|
|
50209
|
+
tempStorage.setImageDimensions({
|
|
50205
50210
|
width: resize.mbr.getWidth(),
|
|
50206
50211
|
height: resize.mbr.getHeight()
|
|
50207
50212
|
});
|
|
@@ -50960,12 +50965,12 @@ class BoardSelection {
|
|
|
50960
50965
|
return;
|
|
50961
50966
|
}
|
|
50962
50967
|
if (text5.isEmpty()) {
|
|
50963
|
-
const textColor =
|
|
50964
|
-
const textSize =
|
|
50965
|
-
const highlightColor =
|
|
50966
|
-
const styles =
|
|
50967
|
-
const horizontalAlignment =
|
|
50968
|
-
const verticalAlignment =
|
|
50968
|
+
const textColor = tempStorage.getFontColor(item.itemType);
|
|
50969
|
+
const textSize = tempStorage.getFontSize(item.itemType);
|
|
50970
|
+
const highlightColor = tempStorage.getFontHighlight(item.itemType);
|
|
50971
|
+
const styles = tempStorage.getFontStyles(item.itemType);
|
|
50972
|
+
const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
|
|
50973
|
+
const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
|
|
50969
50974
|
if (textColor) {
|
|
50970
50975
|
text5.setSelectionFontColor(textColor, "None");
|
|
50971
50976
|
}
|
|
@@ -51508,9 +51513,9 @@ class BoardSelection {
|
|
|
51508
51513
|
ops
|
|
51509
51514
|
});
|
|
51510
51515
|
if (item.itemType === "Sticker" && fontSize === "auto") {
|
|
51511
|
-
|
|
51516
|
+
tempStorage.remove(`fontSize_${item.itemType}`);
|
|
51512
51517
|
} else if (item.itemType !== "AINode") {
|
|
51513
|
-
|
|
51518
|
+
tempStorage.setFontSize(item.itemType, fontSize);
|
|
51514
51519
|
}
|
|
51515
51520
|
}
|
|
51516
51521
|
const emptyOps = itemsOps.filter((op) => !op.ops.length);
|
|
@@ -51548,7 +51553,7 @@ class BoardSelection {
|
|
|
51548
51553
|
ops
|
|
51549
51554
|
});
|
|
51550
51555
|
if (item.itemType !== "AINode") {
|
|
51551
|
-
|
|
51556
|
+
tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
|
|
51552
51557
|
}
|
|
51553
51558
|
}
|
|
51554
51559
|
this.emitApplied({
|
|
@@ -51574,7 +51579,7 @@ class BoardSelection {
|
|
|
51574
51579
|
selection: text5.editor.getSelection(),
|
|
51575
51580
|
ops
|
|
51576
51581
|
});
|
|
51577
|
-
|
|
51582
|
+
tempStorage.setFontColor(item.itemType, fontColor);
|
|
51578
51583
|
}
|
|
51579
51584
|
this.emitApplied({
|
|
51580
51585
|
class: "RichText",
|
|
@@ -51618,7 +51623,7 @@ class BoardSelection {
|
|
|
51618
51623
|
ops
|
|
51619
51624
|
});
|
|
51620
51625
|
if (item.itemType !== "AINode") {
|
|
51621
|
-
|
|
51626
|
+
tempStorage.setFontHighlight(item.itemType, fontHighlight);
|
|
51622
51627
|
}
|
|
51623
51628
|
}
|
|
51624
51629
|
this.emitApplied({
|
|
@@ -51644,7 +51649,7 @@ class BoardSelection {
|
|
|
51644
51649
|
selection: text5.editor.getSelection(),
|
|
51645
51650
|
ops
|
|
51646
51651
|
});
|
|
51647
|
-
|
|
51652
|
+
tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
|
|
51648
51653
|
}
|
|
51649
51654
|
this.emitApplied({
|
|
51650
51655
|
class: "RichText",
|
|
@@ -51668,7 +51673,7 @@ class BoardSelection {
|
|
|
51668
51673
|
if (!text5) {
|
|
51669
51674
|
return;
|
|
51670
51675
|
}
|
|
51671
|
-
|
|
51676
|
+
tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
|
|
51672
51677
|
if (item instanceof RichText) {
|
|
51673
51678
|
item.setEditorFocus(this.context);
|
|
51674
51679
|
}
|
|
@@ -55265,7 +55270,7 @@ export {
|
|
|
55265
55270
|
transformHtmlOrTextToMarkdown,
|
|
55266
55271
|
toRelativePoint,
|
|
55267
55272
|
toFiniteNumber,
|
|
55268
|
-
|
|
55273
|
+
tempStorage,
|
|
55269
55274
|
tagByType,
|
|
55270
55275
|
stickerColors,
|
|
55271
55276
|
sha256,
|
|
@@ -55336,7 +55341,7 @@ export {
|
|
|
55336
55341
|
Shapes,
|
|
55337
55342
|
ShapeCommand,
|
|
55338
55343
|
Shape,
|
|
55339
|
-
|
|
55344
|
+
SessionStorage,
|
|
55340
55345
|
BoardSelection as Selection,
|
|
55341
55346
|
STEP_STROKE_WIDTH,
|
|
55342
55347
|
SHAPE_LAST_TYPE_KEY,
|
package/dist/esm/node.js
CHANGED
|
@@ -9225,7 +9225,7 @@ if (typeof window !== "undefined" && window.sessionStorage) {
|
|
|
9225
9225
|
_sessionStorage = new NodeStoragePolyfill;
|
|
9226
9226
|
}
|
|
9227
9227
|
|
|
9228
|
-
class
|
|
9228
|
+
class SessionStorage {
|
|
9229
9229
|
set(key, value) {
|
|
9230
9230
|
const boardId = this.getBoardId() || "";
|
|
9231
9231
|
_sessionStorage.setItem(boardId + "_" + key, JSON.stringify(value));
|
|
@@ -9357,7 +9357,7 @@ class SessionStorage2 {
|
|
|
9357
9357
|
return window.location.href.split("/").pop()?.split("?")[0];
|
|
9358
9358
|
}
|
|
9359
9359
|
}
|
|
9360
|
-
var
|
|
9360
|
+
var tempStorage = new SessionStorage;
|
|
9361
9361
|
|
|
9362
9362
|
// src/HTMLRender/HTMLRender.ts
|
|
9363
9363
|
function getTranslationFromHTML(el) {
|
|
@@ -20693,7 +20693,7 @@ class RichText extends Mbr {
|
|
|
20693
20693
|
counter = counter + 1;
|
|
20694
20694
|
this.rtCounter = counter;
|
|
20695
20695
|
this.linkTo = linkTo || new LinkTo(this.id, this.board.events);
|
|
20696
|
-
let textSizeFromStorage = new
|
|
20696
|
+
let textSizeFromStorage = new SessionStorage().getFontSize(insideOf || "RichText");
|
|
20697
20697
|
if (!textSizeFromStorage || textSizeFromStorage === "auto") {
|
|
20698
20698
|
textSizeFromStorage = initialTextStyles.fontSize;
|
|
20699
20699
|
}
|
|
@@ -39578,7 +39578,7 @@ class Shape extends BaseItem {
|
|
|
39578
39578
|
this.updateMbr();
|
|
39579
39579
|
}
|
|
39580
39580
|
saveShapeData() {
|
|
39581
|
-
|
|
39581
|
+
tempStorage.setShapeData({
|
|
39582
39582
|
shapeType: this.shapeType,
|
|
39583
39583
|
backgroundColor: this.backgroundColor,
|
|
39584
39584
|
backgroundOpacity: this.backgroundOpacity,
|
|
@@ -40119,7 +40119,7 @@ class Sticker extends BaseItem {
|
|
|
40119
40119
|
}
|
|
40120
40120
|
}
|
|
40121
40121
|
saveStickerData() {
|
|
40122
|
-
const storage = new
|
|
40122
|
+
const storage = new SessionStorage;
|
|
40123
40123
|
storage.setStickerData(this.serialize());
|
|
40124
40124
|
}
|
|
40125
40125
|
serialize() {
|
|
@@ -40632,8 +40632,8 @@ class Frame extends BaseItem {
|
|
|
40632
40632
|
this.borderWidth = borderWidth;
|
|
40633
40633
|
this.textContainer = Frames[this.shapeType].textBounds.copy();
|
|
40634
40634
|
this.path = Frames[this.shapeType].path.copy();
|
|
40635
|
-
this.transformation = new Transformation(this.id,
|
|
40636
|
-
this.linkTo = new LinkTo(this.id,
|
|
40635
|
+
this.transformation = new Transformation(this.id, board.events);
|
|
40636
|
+
this.linkTo = new LinkTo(this.id, board.events);
|
|
40637
40637
|
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 });
|
|
40638
40638
|
this.text.setSelectionHorisontalAlignment("left");
|
|
40639
40639
|
this.transformation.subject.subscribe(() => {
|
|
@@ -41544,7 +41544,7 @@ function calculatePosition(boardImage, board) {
|
|
|
41544
41544
|
const centerPoint = viewportMbr.getCenter();
|
|
41545
41545
|
const imageWidth = boardImage.getWidth();
|
|
41546
41546
|
const imageHeight = boardImage.getHeight();
|
|
41547
|
-
const prevDimensions =
|
|
41547
|
+
const prevDimensions = tempStorage.getImageDimensions();
|
|
41548
41548
|
if (prevDimensions) {
|
|
41549
41549
|
const scaleX2 = prevDimensions.width / imageWidth;
|
|
41550
41550
|
const scaleY2 = prevDimensions.height / imageHeight;
|
|
@@ -41565,7 +41565,7 @@ function calculatePosition(boardImage, board) {
|
|
|
41565
41565
|
const finalScale = scaleToFit;
|
|
41566
41566
|
const scaledImageWidth = imageWidth * finalScale;
|
|
41567
41567
|
const scaledImageHeight = imageHeight * finalScale;
|
|
41568
|
-
|
|
41568
|
+
tempStorage.setImageDimensions({
|
|
41569
41569
|
width: scaledImageWidth,
|
|
41570
41570
|
height: scaledImageHeight
|
|
41571
41571
|
});
|
|
@@ -44608,7 +44608,7 @@ class AddShape extends BoardTool {
|
|
|
44608
44608
|
constructor(board) {
|
|
44609
44609
|
super(board);
|
|
44610
44610
|
this.setCursor();
|
|
44611
|
-
const data =
|
|
44611
|
+
const data = tempStorage.getShapeData();
|
|
44612
44612
|
if (data) {
|
|
44613
44613
|
this.shape = new Shape(board, "", data.shapeType, data.backgroundColor, data.backgroundOpacity, data.borderColor, data.borderOpacity, data.borderStyle, data.borderWidth);
|
|
44614
44614
|
this.setShapeType(data.shapeType);
|
|
@@ -44689,13 +44689,13 @@ class AddShape extends BoardTool {
|
|
|
44689
44689
|
if (this.type === "None") {
|
|
44690
44690
|
return false;
|
|
44691
44691
|
}
|
|
44692
|
-
const width2 = this.bounds.getWidth() < 2 ?
|
|
44693
|
-
const height2 = this.bounds.getHeight() < 2 ?
|
|
44692
|
+
const width2 = this.bounds.getWidth() < 2 ? tempStorage.getShapeWidth() || 100 : this.bounds.getWidth();
|
|
44693
|
+
const height2 = this.bounds.getHeight() < 2 ? tempStorage.getShapeHeight() || 100 : this.bounds.getHeight();
|
|
44694
44694
|
if (this.bounds.getWidth() > 2) {
|
|
44695
|
-
|
|
44695
|
+
tempStorage.setShapeWidth(this.bounds.getWidth());
|
|
44696
44696
|
}
|
|
44697
44697
|
if (this.bounds.getHeight() > 2) {
|
|
44698
|
-
|
|
44698
|
+
tempStorage.setShapeHeight(this.bounds.getHeight());
|
|
44699
44699
|
}
|
|
44700
44700
|
this.initTransformation(width2 / 100, height2 / 100);
|
|
44701
44701
|
const shape = this.board.add(this.shape);
|
|
@@ -45883,7 +45883,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
45883
45883
|
let htmlButtons = undefined;
|
|
45884
45884
|
let quickAddItems = undefined;
|
|
45885
45885
|
function calculateQuickAddPosition(index2, selectedItem, connectorStartPoint) {
|
|
45886
|
-
const connectorStorage = new
|
|
45886
|
+
const connectorStorage = new SessionStorage;
|
|
45887
45887
|
const currMbr = selectedItem.getMbr();
|
|
45888
45888
|
const selectedItemData = selectedItem.serialize();
|
|
45889
45889
|
const width2 = selectedItem.itemType === "Shape" ? selectedItem.getPath().getMbr().getWidth() : currMbr.getWidth();
|
|
@@ -45946,7 +45946,7 @@ function getQuickAddButtons(selection, board) {
|
|
|
45946
45946
|
const fontSize = selectedItem.itemType === "RichText" ? selectedItem.getFontSize() : 14;
|
|
45947
45947
|
const newItem = board.createItem(board.getNewItemId(), newItemData);
|
|
45948
45948
|
if (newItem.itemType === "RichText") {
|
|
45949
|
-
const storage = new
|
|
45949
|
+
const storage = new SessionStorage;
|
|
45950
45950
|
storage.setFontSize("RichText", fontSize);
|
|
45951
45951
|
newItem.editor.selectWholeText();
|
|
45952
45952
|
newItem.applySelectionFontSize(fontSize);
|
|
@@ -47493,6 +47493,11 @@ class StickerTool extends CustomTool {
|
|
|
47493
47493
|
}
|
|
47494
47494
|
}
|
|
47495
47495
|
|
|
47496
|
+
// src/api/isIfarme.ts
|
|
47497
|
+
var isIframe = () => {
|
|
47498
|
+
return window.self !== window.top;
|
|
47499
|
+
};
|
|
47500
|
+
|
|
47496
47501
|
// src/Tools/Tools.ts
|
|
47497
47502
|
var registeredTools = {};
|
|
47498
47503
|
|
|
@@ -50394,7 +50399,7 @@ class Presence {
|
|
|
50394
50399
|
if (!ctx) {
|
|
50395
50400
|
return;
|
|
50396
50401
|
}
|
|
50397
|
-
const anonTranslate = i18n.t("presence.anonymous");
|
|
50402
|
+
const anonTranslate = conf.i18n.t("presence.anonymous");
|
|
50398
50403
|
const label = cursor.nickname === "Anonymous" ? anonTranslate : cursor.nickname;
|
|
50399
50404
|
const textWidth = ctx.measureText(label).width;
|
|
50400
50405
|
const labelHeight = 20 * scale;
|
|
@@ -52669,7 +52674,7 @@ function transformItems({
|
|
|
52669
52674
|
return null;
|
|
52670
52675
|
}
|
|
52671
52676
|
if (single instanceof ImageItem) {
|
|
52672
|
-
|
|
52677
|
+
tempStorage.setImageDimensions({
|
|
52673
52678
|
width: resize.mbr.getWidth(),
|
|
52674
52679
|
height: resize.mbr.getHeight()
|
|
52675
52680
|
});
|
|
@@ -53428,12 +53433,12 @@ class BoardSelection {
|
|
|
53428
53433
|
return;
|
|
53429
53434
|
}
|
|
53430
53435
|
if (text5.isEmpty()) {
|
|
53431
|
-
const textColor =
|
|
53432
|
-
const textSize =
|
|
53433
|
-
const highlightColor =
|
|
53434
|
-
const styles =
|
|
53435
|
-
const horizontalAlignment =
|
|
53436
|
-
const verticalAlignment =
|
|
53436
|
+
const textColor = tempStorage.getFontColor(item.itemType);
|
|
53437
|
+
const textSize = tempStorage.getFontSize(item.itemType);
|
|
53438
|
+
const highlightColor = tempStorage.getFontHighlight(item.itemType);
|
|
53439
|
+
const styles = tempStorage.getFontStyles(item.itemType);
|
|
53440
|
+
const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
|
|
53441
|
+
const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
|
|
53437
53442
|
if (textColor) {
|
|
53438
53443
|
text5.setSelectionFontColor(textColor, "None");
|
|
53439
53444
|
}
|
|
@@ -53976,9 +53981,9 @@ class BoardSelection {
|
|
|
53976
53981
|
ops
|
|
53977
53982
|
});
|
|
53978
53983
|
if (item.itemType === "Sticker" && fontSize === "auto") {
|
|
53979
|
-
|
|
53984
|
+
tempStorage.remove(`fontSize_${item.itemType}`);
|
|
53980
53985
|
} else if (item.itemType !== "AINode") {
|
|
53981
|
-
|
|
53986
|
+
tempStorage.setFontSize(item.itemType, fontSize);
|
|
53982
53987
|
}
|
|
53983
53988
|
}
|
|
53984
53989
|
const emptyOps = itemsOps.filter((op) => !op.ops.length);
|
|
@@ -54016,7 +54021,7 @@ class BoardSelection {
|
|
|
54016
54021
|
ops
|
|
54017
54022
|
});
|
|
54018
54023
|
if (item.itemType !== "AINode") {
|
|
54019
|
-
|
|
54024
|
+
tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
|
|
54020
54025
|
}
|
|
54021
54026
|
}
|
|
54022
54027
|
this.emitApplied({
|
|
@@ -54042,7 +54047,7 @@ class BoardSelection {
|
|
|
54042
54047
|
selection: text5.editor.getSelection(),
|
|
54043
54048
|
ops
|
|
54044
54049
|
});
|
|
54045
|
-
|
|
54050
|
+
tempStorage.setFontColor(item.itemType, fontColor);
|
|
54046
54051
|
}
|
|
54047
54052
|
this.emitApplied({
|
|
54048
54053
|
class: "RichText",
|
|
@@ -54086,7 +54091,7 @@ class BoardSelection {
|
|
|
54086
54091
|
ops
|
|
54087
54092
|
});
|
|
54088
54093
|
if (item.itemType !== "AINode") {
|
|
54089
|
-
|
|
54094
|
+
tempStorage.setFontHighlight(item.itemType, fontHighlight);
|
|
54090
54095
|
}
|
|
54091
54096
|
}
|
|
54092
54097
|
this.emitApplied({
|
|
@@ -54112,7 +54117,7 @@ class BoardSelection {
|
|
|
54112
54117
|
selection: text5.editor.getSelection(),
|
|
54113
54118
|
ops
|
|
54114
54119
|
});
|
|
54115
|
-
|
|
54120
|
+
tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
|
|
54116
54121
|
}
|
|
54117
54122
|
this.emitApplied({
|
|
54118
54123
|
class: "RichText",
|
|
@@ -54136,7 +54141,7 @@ class BoardSelection {
|
|
|
54136
54141
|
if (!text5) {
|
|
54137
54142
|
return;
|
|
54138
54143
|
}
|
|
54139
|
-
|
|
54144
|
+
tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
|
|
54140
54145
|
if (item instanceof RichText) {
|
|
54141
54146
|
item.setEditorFocus(this.context);
|
|
54142
54147
|
}
|
|
@@ -57888,7 +57893,7 @@ export {
|
|
|
57888
57893
|
transformHtmlOrTextToMarkdown,
|
|
57889
57894
|
toRelativePoint,
|
|
57890
57895
|
toFiniteNumber,
|
|
57891
|
-
|
|
57896
|
+
tempStorage,
|
|
57892
57897
|
tagByType,
|
|
57893
57898
|
stickerColors,
|
|
57894
57899
|
sha256,
|
|
@@ -57959,7 +57964,7 @@ export {
|
|
|
57959
57964
|
Shapes,
|
|
57960
57965
|
ShapeCommand,
|
|
57961
57966
|
Shape,
|
|
57962
|
-
|
|
57967
|
+
SessionStorage,
|
|
57963
57968
|
BoardSelection as Selection,
|
|
57964
57969
|
STEP_STROKE_WIDTH,
|
|
57965
57970
|
SHAPE_LAST_TYPE_KEY,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Subject } from
|
|
2
|
-
import { HistoryRecord } from
|
|
1
|
+
import { Subject } from "Subject";
|
|
2
|
+
import type { HistoryRecord } from "./Log";
|
|
3
3
|
export interface SyncLogMsg {
|
|
4
|
-
msg:
|
|
4
|
+
msg: "addedNew" | "confirmed" | "toSend" | "revertUnconfirmed" | "applyUnconfirmed";
|
|
5
5
|
records: HistoryRecord[];
|
|
6
6
|
}
|
|
7
7
|
export type SyncLog = SyncLogMsg[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SelectionContext } from
|
|
2
|
-
import hotkeys from
|
|
1
|
+
import type { SelectionContext } from "Selection/Selection";
|
|
2
|
+
import hotkeys from "hotkeys.json";
|
|
3
3
|
export type Hotkey = {
|
|
4
4
|
key: {
|
|
5
5
|
button: string | string[];
|
package/dist/types/Settings.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { BrowserDocumentFactory } from "./api/BrowserDocumentFactory";
|
|
|
4
4
|
import { BrowserPath2D } from "./api/BrowserPath2DFactory";
|
|
5
5
|
import { MockDocumentFactory } from "./api/MockDocumentFactory";
|
|
6
6
|
import { MockPath2D } from "api/MockPath2D";
|
|
7
|
+
import { BorderStyle } from "Items";
|
|
7
8
|
export interface Connection {
|
|
8
9
|
connectionId: number;
|
|
9
10
|
getCurrentUser: () => string;
|
|
@@ -182,7 +183,7 @@ export declare const conf: {
|
|
|
182
183
|
HIGHLIGHTER_MAX_STROKE_WIDTH: number;
|
|
183
184
|
ERASER_STROKE_WIDTH: number;
|
|
184
185
|
PEN_RENDER_POINTER_CIRCLE: boolean;
|
|
185
|
-
PEN_STROKE_STYLE:
|
|
186
|
+
PEN_STROKE_STYLE: BorderStyle;
|
|
186
187
|
PEN_POINTER_CIRCLE_COLOR: string;
|
|
187
188
|
PEN_SETTINGS_KEY: string;
|
|
188
189
|
HIGHLIGHTER_SETTINGS_KEY: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Board } from
|
|
2
|
-
import { Drawing } from
|
|
3
|
-
import { DrawingContext } from
|
|
4
|
-
import { BorderStyle } from
|
|
5
|
-
import { BoardTool } from
|
|
1
|
+
import { Board } from "Board";
|
|
2
|
+
import { Drawing } from "Items/Drawing";
|
|
3
|
+
import { DrawingContext } from "Items/DrawingContext";
|
|
4
|
+
import { BorderStyle } from "Items/Path";
|
|
5
|
+
import { BoardTool } from "Tools/BoardTool";
|
|
6
6
|
export declare class Eraser extends BoardTool {
|
|
7
7
|
itemType: string;
|
|
8
8
|
isDown: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isIframe: () => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|