microboard-temp 0.1.10 → 0.1.12
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 +260 -256
- package/dist/cjs/index.js +244 -240
- package/dist/cjs/node.js +251 -247
- package/dist/esm/browser.js +260 -256
- package/dist/esm/index.js +244 -240
- package/dist/esm/node.js +251 -247
- package/dist/types/Keyboard/getHotkeyLabel.d.ts +1 -1
- package/dist/types/Keyboard/logHotkey.d.ts +3 -3
- package/dist/types/Settings.d.ts +5 -14
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -4955,7 +4955,7 @@ var ExportQuality;
|
|
|
4955
4955
|
ExportQuality2[ExportQuality2["STANDARD"] = 2] = "STANDARD";
|
|
4956
4956
|
ExportQuality2[ExportQuality2["LOW"] = 3] = "LOW";
|
|
4957
4957
|
})(ExportQuality ||= {});
|
|
4958
|
-
var
|
|
4958
|
+
var conf2 = {
|
|
4959
4959
|
connection: undefined,
|
|
4960
4960
|
path2DFactory: typeof Path2D !== "undefined" ? BrowserPath2D : MockPath2D,
|
|
4961
4961
|
documentFactory: typeof document !== "undefined" ? new BrowserDocumentFactory : undefined,
|
|
@@ -5275,7 +5275,11 @@ var conf = {
|
|
|
5275
5275
|
overline: false,
|
|
5276
5276
|
subscript: false,
|
|
5277
5277
|
superscript: false
|
|
5278
|
-
}
|
|
5278
|
+
},
|
|
5279
|
+
LOG_HOTKEYS: false,
|
|
5280
|
+
FORCE_HOTKEYS: "auto",
|
|
5281
|
+
debug: false,
|
|
5282
|
+
FALLBACK_LNG: "en"
|
|
5279
5283
|
};
|
|
5280
5284
|
|
|
5281
5285
|
// src/Items/Transformation/Matrix.ts
|
|
@@ -5997,7 +6001,7 @@ class DrawingContext {
|
|
|
5997
6001
|
this.setCamera(camera);
|
|
5998
6002
|
}
|
|
5999
6003
|
dpi() {
|
|
6000
|
-
return
|
|
6004
|
+
return conf2.getDPI();
|
|
6001
6005
|
}
|
|
6002
6006
|
setCamera(camera) {
|
|
6003
6007
|
this.camera = camera;
|
|
@@ -6007,7 +6011,7 @@ class DrawingContext {
|
|
|
6007
6011
|
}
|
|
6008
6012
|
clear() {
|
|
6009
6013
|
this.ctx.setTransform(1 * this.dpi(), 0, 0, 1 * this.dpi(), 0, 0);
|
|
6010
|
-
this.ctx.clearRect(0, 0,
|
|
6014
|
+
this.ctx.clearRect(0, 0, conf2.getDocumentWidth(), conf2.getDocumentHeight());
|
|
6011
6015
|
this.matrix.applyToContext(this.ctx);
|
|
6012
6016
|
}
|
|
6013
6017
|
clearCursor() {
|
|
@@ -6015,7 +6019,7 @@ class DrawingContext {
|
|
|
6015
6019
|
return;
|
|
6016
6020
|
}
|
|
6017
6021
|
this.cursorCtx.setTransform(1 * this.dpi(), 0, 0, 1 * this.dpi(), 0, 0);
|
|
6018
|
-
this.cursorCtx.clearRect(0, 0,
|
|
6022
|
+
this.cursorCtx.clearRect(0, 0, conf2.getDocumentWidth(), conf2.getDocumentHeight());
|
|
6019
6023
|
this.matrix.applyToContext(this.cursorCtx);
|
|
6020
6024
|
}
|
|
6021
6025
|
applyChanges() {
|
|
@@ -6118,7 +6122,7 @@ class Path {
|
|
|
6118
6122
|
this.width = this.getMbr().getWidth();
|
|
6119
6123
|
this.height = this.getMbr().getHeight();
|
|
6120
6124
|
this.maxDimension = Math.max(mbr.getWidth(), mbr.getHeight());
|
|
6121
|
-
this.path2d = new
|
|
6125
|
+
this.path2d = new conf2.path2DFactory;
|
|
6122
6126
|
this.updateCache();
|
|
6123
6127
|
}
|
|
6124
6128
|
getBackgroundColor() {
|
|
@@ -6195,7 +6199,7 @@ class Path {
|
|
|
6195
6199
|
this.y = top - this.paddingTop;
|
|
6196
6200
|
this.width = right - left + this.paddingLeft + this.paddingRight;
|
|
6197
6201
|
this.height = bottom - top + this.paddingTop + this.paddingBottom;
|
|
6198
|
-
const path2d = new
|
|
6202
|
+
const path2d = new conf2.path2DFactory;
|
|
6199
6203
|
if (this.segments.length === 0) {
|
|
6200
6204
|
return;
|
|
6201
6205
|
}
|
|
@@ -7261,7 +7265,7 @@ var parsersHTML = {
|
|
|
7261
7265
|
"comment-item": parseHTMLComment
|
|
7262
7266
|
};
|
|
7263
7267
|
var decodeHtml = (htmlString) => {
|
|
7264
|
-
const parser =
|
|
7268
|
+
const parser = conf2.getDOMParser();
|
|
7265
7269
|
const doc = parser.parseFromString(htmlString, "text/html");
|
|
7266
7270
|
return doc.documentElement.textContent || "";
|
|
7267
7271
|
};
|
|
@@ -7290,10 +7294,10 @@ function parseHTMLRichText(el, options) {
|
|
|
7290
7294
|
italic: node.style.fontStyle === "italic",
|
|
7291
7295
|
underline: node.style.textDecoration.includes("underline"),
|
|
7292
7296
|
"line-through": node.style.textDecoration.includes("line-through"),
|
|
7293
|
-
fontColor: node.style.color ||
|
|
7294
|
-
fontHighlight: node.style.backgroundColor ||
|
|
7295
|
-
fontSize: parseFloat(node.style.fontSize) ||
|
|
7296
|
-
fontFamily: node.style.fontFamily ||
|
|
7297
|
+
fontColor: node.style.color || conf2.DEFAULT_TEXT_STYLES.fontColor,
|
|
7298
|
+
fontHighlight: node.style.backgroundColor || conf2.DEFAULT_TEXT_STYLES.fontHighlight,
|
|
7299
|
+
fontSize: parseFloat(node.style.fontSize) || conf2.DEFAULT_TEXT_STYLES.fontSize,
|
|
7300
|
+
fontFamily: node.style.fontFamily || conf2.DEFAULT_TEXT_STYLES.fontFamily,
|
|
7297
7301
|
overline: false,
|
|
7298
7302
|
subscript: false,
|
|
7299
7303
|
superscript: false
|
|
@@ -7358,7 +7362,7 @@ function parseHTMLRichText(el, options) {
|
|
|
7358
7362
|
return {
|
|
7359
7363
|
type: "paragraph",
|
|
7360
7364
|
...extractCommonProps(),
|
|
7361
|
-
lineHeight: parseFloat(node.style.lineHeight) ||
|
|
7365
|
+
lineHeight: parseFloat(node.style.lineHeight) || conf2.DEFAULT_TEXT_STYLES.lineHeight,
|
|
7362
7366
|
children: children2
|
|
7363
7367
|
};
|
|
7364
7368
|
default:
|
|
@@ -13838,8 +13842,8 @@ class LinkTo {
|
|
|
13838
13842
|
const ctx = context.ctx;
|
|
13839
13843
|
ctx.save();
|
|
13840
13844
|
ctx.globalCompositeOperation = "destination-out";
|
|
13841
|
-
const size =
|
|
13842
|
-
const offset =
|
|
13845
|
+
const size = conf2.LINK_BTN_SIZE / scale;
|
|
13846
|
+
const offset = conf2.LINK_BTN_OFFSET / scale;
|
|
13843
13847
|
ctx.fillRect(right - size - offset, top + offset, size, size);
|
|
13844
13848
|
ctx.restore();
|
|
13845
13849
|
}
|
|
@@ -13990,7 +13994,7 @@ function getBlockNode(data, maxWidth, isFrame, listData, listMark, newLine = fal
|
|
|
13990
13994
|
} else if (node3.type === "ul_list" && !listData) {
|
|
13991
13995
|
listData = { level: 0, isNumberedList: false };
|
|
13992
13996
|
}
|
|
13993
|
-
const listMarks =
|
|
13997
|
+
const listMarks = conf2[getListMarkType((listData?.level || 0) + 1)];
|
|
13994
13998
|
for (let i = 0;i < data.children.length; i++) {
|
|
13995
13999
|
const child = structuredClone(data.children[i]);
|
|
13996
14000
|
switch (child.type) {
|
|
@@ -14395,8 +14399,8 @@ function measureText(text, style, paddingTop = 0, marginLeft = 0) {
|
|
|
14395
14399
|
rect2.height += paddingTop;
|
|
14396
14400
|
}
|
|
14397
14401
|
}
|
|
14398
|
-
|
|
14399
|
-
const measure =
|
|
14402
|
+
conf2.measureCtx.font = style.font;
|
|
14403
|
+
const measure = conf2.measureCtx.measureText(text);
|
|
14400
14404
|
const actualBoundingBoxAscent = toFiniteNumber2(measure.actualBoundingBoxAscent);
|
|
14401
14405
|
const actualBoundingBoxDescent = toFiniteNumber2(measure.actualBoundingBoxDescent);
|
|
14402
14406
|
const actualBoundingBoxLeft = toFiniteNumber2(measure.actualBoundingBoxLeft);
|
|
@@ -23518,7 +23522,7 @@ var convertLinkNodeToTextNode = (node4) => {
|
|
|
23518
23522
|
const link = node4.link;
|
|
23519
23523
|
const text3 = node4.children.map((child) => child.text).join("");
|
|
23520
23524
|
return {
|
|
23521
|
-
...
|
|
23525
|
+
...conf2.DEFAULT_TEXT_STYLES,
|
|
23522
23526
|
type: "text",
|
|
23523
23527
|
text: text3,
|
|
23524
23528
|
link,
|
|
@@ -23534,9 +23538,9 @@ function setNodeChildrenStyles({
|
|
|
23534
23538
|
horisontalAlignment,
|
|
23535
23539
|
node: node4
|
|
23536
23540
|
}) {
|
|
23537
|
-
let fontStyles =
|
|
23541
|
+
let fontStyles = conf2.DEFAULT_TEXT_STYLES;
|
|
23538
23542
|
if (editor) {
|
|
23539
|
-
fontStyles = Editor.marks(editor) ||
|
|
23543
|
+
fontStyles = Editor.marks(editor) || conf2.DEFAULT_TEXT_STYLES;
|
|
23540
23544
|
}
|
|
23541
23545
|
switch (node4.type) {
|
|
23542
23546
|
case "heading_one":
|
|
@@ -23568,7 +23572,7 @@ function setNodeChildrenStyles({
|
|
|
23568
23572
|
children.text += " ";
|
|
23569
23573
|
}
|
|
23570
23574
|
let fontColor = fontStyles.fontColor;
|
|
23571
|
-
if (fontColor ===
|
|
23575
|
+
if (fontColor === conf2.DEFAULT_TEXT_STYLES.fontColor && children.link) {
|
|
23572
23576
|
fontColor = "rgba(71, 120, 245, 1)";
|
|
23573
23577
|
}
|
|
23574
23578
|
return {
|
|
@@ -23608,7 +23612,7 @@ function setNodeStyles({
|
|
|
23608
23612
|
}
|
|
23609
23613
|
|
|
23610
23614
|
// src/Items/RichText/editorHelpers/markdown/markdownProcessor.ts
|
|
23611
|
-
var { i18n: i18n2 } =
|
|
23615
|
+
var { i18n: i18n2 } = conf2;
|
|
23612
23616
|
|
|
23613
23617
|
class MarkdownProcessor {
|
|
23614
23618
|
chunksQueue = [];
|
|
@@ -24588,7 +24592,7 @@ function setEditorFocus(editor, selectionContext) {
|
|
|
24588
24592
|
}
|
|
24589
24593
|
|
|
24590
24594
|
// src/Items/RichText/RichText.ts
|
|
24591
|
-
var { i18n: i18n3 } =
|
|
24595
|
+
var { i18n: i18n3 } = conf2;
|
|
24592
24596
|
var isEditInProcessValue = false;
|
|
24593
24597
|
var counter = 0;
|
|
24594
24598
|
|
|
@@ -24611,7 +24615,7 @@ class RichText extends Mbr {
|
|
|
24611
24615
|
isContainerSet = false;
|
|
24612
24616
|
isRenderEnabled = true;
|
|
24613
24617
|
layoutNodes;
|
|
24614
|
-
clipPath = new
|
|
24618
|
+
clipPath = new conf2.path2DFactory;
|
|
24615
24619
|
updateRequired = false;
|
|
24616
24620
|
autoSizeScale = 1;
|
|
24617
24621
|
containerMaxWidth;
|
|
@@ -24626,7 +24630,7 @@ class RichText extends Mbr {
|
|
|
24626
24630
|
shrinkWidth = false;
|
|
24627
24631
|
prevMbr = null;
|
|
24628
24632
|
rtCounter = 0;
|
|
24629
|
-
constructor(board, container, id = "", transformation = new Transformation(id, board.events), linkTo, placeholderText = i18n3?.t("board.textPlaceholder"), isInShape = false, autoSize = false, insideOf, initialTextStyles =
|
|
24633
|
+
constructor(board, container, id = "", transformation = new Transformation(id, board.events), linkTo, placeholderText = i18n3?.t("board.textPlaceholder"), isInShape = false, autoSize = false, insideOf, initialTextStyles = conf2.DEFAULT_TEXT_STYLES) {
|
|
24630
24634
|
super();
|
|
24631
24635
|
this.board = board;
|
|
24632
24636
|
this.container = container;
|
|
@@ -24759,11 +24763,11 @@ class RichText extends Mbr {
|
|
|
24759
24763
|
return;
|
|
24760
24764
|
}
|
|
24761
24765
|
try {
|
|
24762
|
-
|
|
24766
|
+
conf2.reactEditorFocus(this.editor.editor);
|
|
24763
24767
|
} catch {}
|
|
24764
24768
|
};
|
|
24765
24769
|
updateElement = () => {
|
|
24766
|
-
if (
|
|
24770
|
+
if (conf2.isNode()) {
|
|
24767
24771
|
return;
|
|
24768
24772
|
}
|
|
24769
24773
|
if (this.updateRequired) {
|
|
@@ -24892,7 +24896,7 @@ class RichText extends Mbr {
|
|
|
24892
24896
|
const container = this.getTransformedContainer();
|
|
24893
24897
|
const width = container.getWidth();
|
|
24894
24898
|
const height = container.getHeight();
|
|
24895
|
-
this.clipPath = new
|
|
24899
|
+
this.clipPath = new conf2.path2DFactory;
|
|
24896
24900
|
this.clipPath.rect(0, 0, width, height);
|
|
24897
24901
|
}
|
|
24898
24902
|
setContainer(container) {
|
|
@@ -25169,24 +25173,24 @@ class RichText extends Mbr {
|
|
|
25169
25173
|
this.clearLastClickPoint();
|
|
25170
25174
|
const domMbr = ref.getBoundingClientRect();
|
|
25171
25175
|
const refMbr = new Mbr(domMbr.left, domMbr.top, domMbr.right, domMbr.bottom);
|
|
25172
|
-
if (refMbr.isInside(point5) && (
|
|
25173
|
-
const domRange =
|
|
25174
|
-
const textNode =
|
|
25175
|
-
const offset =
|
|
25176
|
-
const slatePoint =
|
|
25176
|
+
if (refMbr.isInside(point5) && (conf2.documentFactory.caretPositionFromPoint || conf2.documentFactory.caretRangeFromPoint)) {
|
|
25177
|
+
const domRange = conf2.documentFactory.caretPositionFromPoint ? conf2.documentFactory.caretPositionFromPoint(point5.x, point5.y) : conf2.documentFactory.caretRangeFromPoint(point5.x, point5.y);
|
|
25178
|
+
const textNode = conf2.documentFactory.caretPositionFromPoint ? domRange.offsetNode : domRange.startContainer;
|
|
25179
|
+
const offset = conf2.documentFactory.caretPositionFromPoint ? domRange.offset : domRange.startOffset;
|
|
25180
|
+
const slatePoint = conf2.reactEditorToSlatePoint(this.editor.editor, textNode, offset, {
|
|
25177
25181
|
exactMatch: false,
|
|
25178
25182
|
suppressThrow: false
|
|
25179
25183
|
});
|
|
25180
25184
|
if (slatePoint) {
|
|
25181
25185
|
const nRange = { anchor: slatePoint, focus: slatePoint };
|
|
25182
25186
|
this.editorTransforms.select(this.editor.editor, nRange);
|
|
25183
|
-
|
|
25187
|
+
conf2.reactEditorFocus(this.editor.editor);
|
|
25184
25188
|
}
|
|
25185
25189
|
} else {
|
|
25186
|
-
if (!(
|
|
25190
|
+
if (!(conf2.documentFactory.caretPositionFromPoint || conf2.documentFactory.caretRangeFromPoint)) {
|
|
25187
25191
|
console.error("document.caretPositionFromPoint and document.caretRangeFromPoint are not available!");
|
|
25188
25192
|
}
|
|
25189
|
-
|
|
25193
|
+
conf2.reactEditorFocus(this.editor.editor);
|
|
25190
25194
|
}
|
|
25191
25195
|
}
|
|
25192
25196
|
}
|
|
@@ -25293,11 +25297,11 @@ class RichText extends Mbr {
|
|
|
25293
25297
|
if (node4.type === "text" || "text" in node4) {
|
|
25294
25298
|
node4 = node4;
|
|
25295
25299
|
const text3 = node4.text.trim() !== "" ? decodeHtml(escapeHtml2(node4.text)) : " ";
|
|
25296
|
-
const textElement = node4.link ? Object.assign(
|
|
25300
|
+
const textElement = node4.link ? Object.assign(conf2.documentFactory.createElement("a"), {
|
|
25297
25301
|
href: node4.link,
|
|
25298
25302
|
target: "_blank",
|
|
25299
25303
|
rel: "noreferrer"
|
|
25300
|
-
}) :
|
|
25304
|
+
}) : conf2.documentFactory.createElement("span");
|
|
25301
25305
|
Object.assign(textElement.style, {
|
|
25302
25306
|
fontWeight: node4.bold ? "700" : "400",
|
|
25303
25307
|
fontStyle: node4.italic ? "italic" : "",
|
|
@@ -25305,10 +25309,10 @@ class RichText extends Mbr {
|
|
|
25305
25309
|
node4.underline ? "underline" : "",
|
|
25306
25310
|
node4["line-through"] ? "line-through" : ""
|
|
25307
25311
|
].filter(Boolean).join(" "),
|
|
25308
|
-
color: node4.fontColor ||
|
|
25309
|
-
backgroundColor: node4.fontHighlight ||
|
|
25310
|
-
fontSize: node4.fontSize ? `${node4.fontSize}px` : `${
|
|
25311
|
-
fontFamily: node4.fontFamily ||
|
|
25312
|
+
color: node4.fontColor || conf2.DEFAULT_TEXT_STYLES.fontColor,
|
|
25313
|
+
backgroundColor: node4.fontHighlight || conf2.DEFAULT_TEXT_STYLES.fontHighlight,
|
|
25314
|
+
fontSize: node4.fontSize ? `${node4.fontSize}px` : `${conf2.DEFAULT_TEXT_STYLES.fontSize}px`,
|
|
25315
|
+
fontFamily: node4.fontFamily || conf2.DEFAULT_TEXT_STYLES.fontFamily
|
|
25312
25316
|
});
|
|
25313
25317
|
if (this.insideOf === "Frame") {
|
|
25314
25318
|
Object.assign(textElement.style, {
|
|
@@ -25343,14 +25347,14 @@ class RichText extends Mbr {
|
|
|
25343
25347
|
four: 4,
|
|
25344
25348
|
five: 5
|
|
25345
25349
|
};
|
|
25346
|
-
const header =
|
|
25350
|
+
const header = conf2.documentFactory.createElement(`h${levels2[level]}`);
|
|
25347
25351
|
applyCommonStyles(header);
|
|
25348
25352
|
header.append(...children);
|
|
25349
25353
|
return header;
|
|
25350
25354
|
}
|
|
25351
25355
|
case "code_block": {
|
|
25352
|
-
const pre =
|
|
25353
|
-
const code =
|
|
25356
|
+
const pre = conf2.documentFactory.createElement("pre");
|
|
25357
|
+
const code = conf2.documentFactory.createElement("code");
|
|
25354
25358
|
applyCommonStyles(pre);
|
|
25355
25359
|
if (node4.language) {
|
|
25356
25360
|
code.classList.add(`language-${node4.language}`);
|
|
@@ -25364,35 +25368,35 @@ class RichText extends Mbr {
|
|
|
25364
25368
|
return pre;
|
|
25365
25369
|
}
|
|
25366
25370
|
case "block-quote": {
|
|
25367
|
-
const blockquote =
|
|
25371
|
+
const blockquote = conf2.documentFactory.createElement("blockquote");
|
|
25368
25372
|
applyCommonStyles(blockquote);
|
|
25369
25373
|
blockquote.append(...children);
|
|
25370
25374
|
return blockquote;
|
|
25371
25375
|
}
|
|
25372
25376
|
case "ul_list": {
|
|
25373
|
-
const ul =
|
|
25377
|
+
const ul = conf2.documentFactory.createElement("ul");
|
|
25374
25378
|
applyCommonStyles(ul);
|
|
25375
25379
|
ul.append(...children);
|
|
25376
25380
|
return ul;
|
|
25377
25381
|
}
|
|
25378
25382
|
case "ol_list": {
|
|
25379
|
-
const ol =
|
|
25383
|
+
const ol = conf2.documentFactory.createElement("ol");
|
|
25380
25384
|
applyCommonStyles(ol);
|
|
25381
25385
|
ol.append(...children);
|
|
25382
25386
|
return ol;
|
|
25383
25387
|
}
|
|
25384
25388
|
case "list_item": {
|
|
25385
|
-
const li =
|
|
25389
|
+
const li = conf2.documentFactory.createElement("li");
|
|
25386
25390
|
applyCommonStyles(li);
|
|
25387
25391
|
li.append(...children);
|
|
25388
25392
|
return li;
|
|
25389
25393
|
}
|
|
25390
25394
|
case "paragraph":
|
|
25391
25395
|
default: {
|
|
25392
|
-
const par =
|
|
25396
|
+
const par = conf2.documentFactory.createElement("p");
|
|
25393
25397
|
applyCommonStyles(par);
|
|
25394
25398
|
Object.assign(par.style, {
|
|
25395
|
-
lineHeight: node4.lineHeight ? `${node4.lineHeight}` :
|
|
25399
|
+
lineHeight: node4.lineHeight ? `${node4.lineHeight}` : conf2.DEFAULT_TEXT_STYLES.lineHeight,
|
|
25396
25400
|
margin: "0"
|
|
25397
25401
|
});
|
|
25398
25402
|
par.append(...children);
|
|
@@ -25400,7 +25404,7 @@ class RichText extends Mbr {
|
|
|
25400
25404
|
}
|
|
25401
25405
|
}
|
|
25402
25406
|
}
|
|
25403
|
-
return
|
|
25407
|
+
return conf2.documentFactory.createElement("div");
|
|
25404
25408
|
};
|
|
25405
25409
|
const escapeHtml2 = (unsafe) => {
|
|
25406
25410
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -38463,7 +38467,7 @@ var transformHtmlOrTextToMarkdown = async (text5, html4) => {
|
|
|
38463
38467
|
markdownString = String(file).trim();
|
|
38464
38468
|
}
|
|
38465
38469
|
let slateNodes = [];
|
|
38466
|
-
if (
|
|
38470
|
+
if (conf2.URL_REGEX.test(text5)) {
|
|
38467
38471
|
slateNodes = [createLinkNode(text5)];
|
|
38468
38472
|
} else {
|
|
38469
38473
|
slateNodes = await convertMarkdownToSlate(markdownString.replace(/<!--(Start|End)Fragment-->/g, ""));
|
|
@@ -38479,7 +38483,7 @@ function createLinkNode(link2) {
|
|
|
38479
38483
|
type: "text",
|
|
38480
38484
|
link: link2,
|
|
38481
38485
|
text: link2,
|
|
38482
|
-
...
|
|
38486
|
+
...conf2.DEFAULT_TEXT_STYLES,
|
|
38483
38487
|
fontColor: "rgba(71, 120, 245, 1)"
|
|
38484
38488
|
};
|
|
38485
38489
|
}
|
|
@@ -38591,7 +38595,7 @@ class AINode {
|
|
|
38591
38595
|
constructor(board, isUserRequest = false, parentNodeId, contextItems = [], threadDirection, id = "") {
|
|
38592
38596
|
this.board = board;
|
|
38593
38597
|
this.id = id;
|
|
38594
|
-
this.buttonIcon =
|
|
38598
|
+
this.buttonIcon = conf2.documentFactory.createElement("img");
|
|
38595
38599
|
this.buttonIcon.src = ICON_SRC;
|
|
38596
38600
|
this.contextItems = contextItems;
|
|
38597
38601
|
this.isUserRequest = isUserRequest;
|
|
@@ -39763,7 +39767,7 @@ function getLine(lineStyle, start2, end2, middle) {
|
|
|
39763
39767
|
}
|
|
39764
39768
|
|
|
39765
39769
|
// src/Items/Connector/Connector.ts
|
|
39766
|
-
var { i18n: i18n4 } =
|
|
39770
|
+
var { i18n: i18n4 } = conf2;
|
|
39767
39771
|
var ConnectionLineWidths = [1, 2, 3, 4, 5, 6, 7, 8, 12];
|
|
39768
39772
|
var CONNECTOR_COLOR = "rgb(20, 21, 26)";
|
|
39769
39773
|
var CONNECTOR_LINE_WIDTH = 1;
|
|
@@ -39823,9 +39827,9 @@ class Connector {
|
|
|
39823
39827
|
this.text = new RichText(board, this.getMbr(), this.id, new Transformation, this.linkTo, i18n4.t("connector.textPlaceholder", {
|
|
39824
39828
|
ns: "default"
|
|
39825
39829
|
}), true, false, "Connector", {
|
|
39826
|
-
...
|
|
39827
|
-
fontSize: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextSize") ? Number(localStorage.getItem("lastConnectorTextSize")) :
|
|
39828
|
-
fontColor: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextColor") ? localStorage.getItem("lastConnectorTextColor") :
|
|
39830
|
+
...conf2.DEFAULT_TEXT_STYLES,
|
|
39831
|
+
fontSize: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextSize") ? Number(localStorage.getItem("lastConnectorTextSize")) : conf2.DEFAULT_TEXT_STYLES.fontSize,
|
|
39832
|
+
fontColor: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextColor") ? localStorage.getItem("lastConnectorTextColor") : conf2.DEFAULT_TEXT_STYLES.fontColor
|
|
39829
39833
|
});
|
|
39830
39834
|
this.startPointer = getStartPointer(this.startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.3);
|
|
39831
39835
|
this.endPointer = getEndPointer(this.endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.3);
|
|
@@ -40275,7 +40279,7 @@ class Connector {
|
|
|
40275
40279
|
this.text.transformation.applyTranslateTo(x - textWidth / 2, y - textHeight / 2);
|
|
40276
40280
|
this.text.render(context);
|
|
40277
40281
|
if (DRAW_TEXT_BORDER && (selectionContext === "EditUnderPointer" || selectionContext === "EditTextUnderPointer") && this.board.selection.items.list().includes(this)) {
|
|
40278
|
-
ctx.strokeStyle =
|
|
40282
|
+
ctx.strokeStyle = conf2.SELECTION_COLOR;
|
|
40279
40283
|
ctx.lineWidth = 1;
|
|
40280
40284
|
ctx.beginPath();
|
|
40281
40285
|
ctx.rect(textMbr.left - TEXT_BORDER_PADDING, textMbr.top - TEXT_BORDER_PADDING, textMbr.getWidth() + TEXT_BORDER_PADDING * 2, textMbr.getHeight() + TEXT_BORDER_PADDING * 2);
|
|
@@ -40502,7 +40506,7 @@ class Connector {
|
|
|
40502
40506
|
}
|
|
40503
40507
|
}
|
|
40504
40508
|
updatePaths() {
|
|
40505
|
-
if (
|
|
40509
|
+
if (conf2.isNode()) {
|
|
40506
40510
|
return;
|
|
40507
40511
|
}
|
|
40508
40512
|
const startPoint = this.startPoint;
|
|
@@ -41313,7 +41317,7 @@ class DefaultShapeData {
|
|
|
41313
41317
|
text;
|
|
41314
41318
|
linkTo;
|
|
41315
41319
|
itemType = "Shape";
|
|
41316
|
-
constructor(shapeType = "Rectangle", backgroundColor = "none", backgroundOpacity = 1, borderColor =
|
|
41320
|
+
constructor(shapeType = "Rectangle", backgroundColor = "none", backgroundOpacity = 1, borderColor = conf2.SHAPE_DEFAULT_STROKE_COLOR, borderOpacity = 1, borderStyle = "solid", borderWidth = 1, transformation = new DefaultTransformationData, text5 = new DefaultRichTextData, linkTo) {
|
|
41317
41321
|
this.shapeType = shapeType;
|
|
41318
41322
|
this.backgroundColor = backgroundColor;
|
|
41319
41323
|
this.backgroundOpacity = backgroundOpacity;
|
|
@@ -42600,7 +42604,7 @@ class Shape {
|
|
|
42600
42604
|
this.text.updateElement();
|
|
42601
42605
|
}
|
|
42602
42606
|
transformPath() {
|
|
42603
|
-
if (
|
|
42607
|
+
if (conf2.isNode()) {
|
|
42604
42608
|
return;
|
|
42605
42609
|
}
|
|
42606
42610
|
this.path = Shapes[this.shapeType].createPath(this.mbr);
|
|
@@ -42829,7 +42833,7 @@ class Sticker {
|
|
|
42829
42833
|
return this;
|
|
42830
42834
|
}
|
|
42831
42835
|
transformPath() {
|
|
42832
|
-
if (
|
|
42836
|
+
if (conf2.isNode()) {
|
|
42833
42837
|
return;
|
|
42834
42838
|
}
|
|
42835
42839
|
this.stickerPath = StickerShape.stickerPath.copy();
|
|
@@ -43380,7 +43384,7 @@ class Frame {
|
|
|
43380
43384
|
this.path = Frames[this.shapeType].path.copy();
|
|
43381
43385
|
this.transformation = new Transformation(this.id, this.board.events);
|
|
43382
43386
|
this.linkTo = new LinkTo(this.id, this.board.events);
|
|
43383
|
-
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...
|
|
43387
|
+
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf2.DEFAULT_TEXT_STYLES, fontColor: FRAME_TITLE_COLOR });
|
|
43384
43388
|
this.text.setSelectionHorisontalAlignment("left");
|
|
43385
43389
|
this.transformation.subject.subscribe(() => {
|
|
43386
43390
|
this.transformPath();
|
|
@@ -43942,10 +43946,10 @@ class VideoCommand {
|
|
|
43942
43946
|
|
|
43943
43947
|
// src/Items/Video/Video.ts
|
|
43944
43948
|
var VIDEO_ICON_SRC = "data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 22 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 0C15.2652 0 15.5196 0.105357 15.7071 0.292893C15.8946 0.48043 16 0.734784 16 1V5.2L21.213 1.55C21.288 1.49746 21.3759 1.4665 21.4672 1.4605C21.5586 1.4545 21.6498 1.4737 21.731 1.51599C21.8122 1.55829 21.8802 1.62206 21.9276 1.70035C21.9751 1.77865 22.0001 1.86846 22 1.96V14.04C22.0001 14.1315 21.9751 14.2214 21.9276 14.2996C21.8802 14.3779 21.8122 14.4417 21.731 14.484C21.6498 14.5263 21.5586 14.5455 21.4672 14.5395C21.3759 14.5335 21.288 14.5025 21.213 14.45L16 10.8V15C16 15.2652 15.8946 15.5196 15.7071 15.7071C15.5196 15.8946 15.2652 16 15 16H1C0.734784 16 0.48043 15.8946 0.292893 15.7071C0.105357 15.5196 0 15.2652 0 15V1C0 0.734784 0.105357 0.48043 0.292893 0.292893C0.48043 0.105357 0.734784 0 1 0H15ZM14 2H2V14H14V2ZM6.4 4.829C6.47611 4.82879 6.55069 4.8503 6.615 4.891L10.97 7.663C11.0266 7.69917 11.0731 7.749 11.1054 7.80789C11.1376 7.86679 11.1545 7.93285 11.1545 8C11.1545 8.06715 11.1376 8.13321 11.1054 8.19211C11.0731 8.251 11.0266 8.30083 10.97 8.337L6.615 11.11C6.55434 11.1487 6.48438 11.1703 6.41248 11.1725C6.34059 11.1748 6.26941 11.1576 6.20646 11.1228C6.14351 11.088 6.0911 11.0368 6.05477 10.9747C6.01844 10.9127 5.99951 10.8419 6 10.77V5.23C6 5.009 6.18 4.83 6.4 4.83V4.829ZM20 4.84L16 7.64V8.358L20 11.158V4.84Z' fill='%23FFFFFF'/%3E%3C/svg%3E";
|
|
43945
|
-
var videoIcon =
|
|
43949
|
+
var videoIcon = conf2.documentFactory.createElement("img");
|
|
43946
43950
|
videoIcon.src = VIDEO_ICON_SRC;
|
|
43947
43951
|
var createPlaceholderImage = (width2, height2) => {
|
|
43948
|
-
const canvas =
|
|
43952
|
+
const canvas = conf2.documentFactory.createElement("canvas");
|
|
43949
43953
|
canvas.width = width2;
|
|
43950
43954
|
canvas.height = height2;
|
|
43951
43955
|
const ctx = canvas.getContext("2d");
|
|
@@ -43989,7 +43993,7 @@ class VideoItem extends Mbr {
|
|
|
43989
43993
|
this.events = events2;
|
|
43990
43994
|
this.id = id;
|
|
43991
43995
|
this.extension = extension2;
|
|
43992
|
-
this.isStorageUrl = !
|
|
43996
|
+
this.isStorageUrl = !conf2.getYouTubeId(url);
|
|
43993
43997
|
this.preview = createPlaceholderImage(videoDimension.width, videoDimension.height);
|
|
43994
43998
|
this.linkTo = new LinkTo(this.id, events2);
|
|
43995
43999
|
this.board = board;
|
|
@@ -44359,59 +44363,59 @@ async function fileTosha256(file) {
|
|
|
44359
44363
|
var catchErrorResponse = async (response, mediaType) => {
|
|
44360
44364
|
if (response.status === 403) {
|
|
44361
44365
|
const data = await response.json();
|
|
44362
|
-
let errorBody =
|
|
44366
|
+
let errorBody = conf2.i18n.t("toolsPanel.addMedia.limitReached.bodyWithoutLimit");
|
|
44363
44367
|
if (!data.isOwnerRequest) {
|
|
44364
|
-
errorBody =
|
|
44368
|
+
errorBody = conf2.i18n.t("toolsPanel.addMedia.limitReached.bodyOwner");
|
|
44365
44369
|
} else if (data.currentUsage && data.storageLimit) {
|
|
44366
|
-
errorBody =
|
|
44370
|
+
errorBody = conf2.i18n.t(`toolsPanel.addMedia.limitReached.body.${parseInt(data.storageLimit) < 1e5 ? "basic" : "plus"}`);
|
|
44367
44371
|
}
|
|
44368
|
-
|
|
44372
|
+
conf2.notify({
|
|
44369
44373
|
variant: "warning",
|
|
44370
|
-
header:
|
|
44374
|
+
header: conf2.i18n.t("toolsPanel.addMedia.limitReached.header"),
|
|
44371
44375
|
body: errorBody,
|
|
44372
44376
|
button: data.isOwnerRequest && data.storageLimit <= 100 ? {
|
|
44373
|
-
text:
|
|
44374
|
-
onClick: () =>
|
|
44377
|
+
text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
|
|
44378
|
+
onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
|
|
44375
44379
|
} : undefined,
|
|
44376
44380
|
duration: 8000
|
|
44377
44381
|
});
|
|
44378
44382
|
} else if (response.status === 413) {
|
|
44379
44383
|
const data = await response.json();
|
|
44380
|
-
let errorBody =
|
|
44384
|
+
let errorBody = conf2.i18n.t("toolsPanel.addMedia.tooLarge.bodyWithoutLimit");
|
|
44381
44385
|
let isBasicPlan = false;
|
|
44382
44386
|
if (data.fileSizeLimit && data.fileSize) {
|
|
44383
44387
|
if (mediaType === "image") {
|
|
44384
44388
|
isBasicPlan = parseInt(data.fileSizeLimit) < 20;
|
|
44385
|
-
errorBody =
|
|
44389
|
+
errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.imageBody.${isBasicPlan ? "basic" : "plus"}`);
|
|
44386
44390
|
} else {
|
|
44387
44391
|
isBasicPlan = parseInt(data.fileSizeLimit) < 1000;
|
|
44388
|
-
errorBody =
|
|
44392
|
+
errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.audioOrVideoBody.${isBasicPlan ? "basic" : "plus"}`);
|
|
44389
44393
|
}
|
|
44390
44394
|
}
|
|
44391
|
-
|
|
44395
|
+
conf2.notify({
|
|
44392
44396
|
variant: "warning",
|
|
44393
|
-
header:
|
|
44397
|
+
header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
|
|
44394
44398
|
body: errorBody,
|
|
44395
44399
|
button: isBasicPlan ? {
|
|
44396
|
-
text:
|
|
44397
|
-
onClick: () =>
|
|
44400
|
+
text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
|
|
44401
|
+
onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
|
|
44398
44402
|
} : undefined,
|
|
44399
44403
|
duration: 4000
|
|
44400
44404
|
});
|
|
44401
44405
|
} else if (response.status === 401) {
|
|
44402
|
-
|
|
44406
|
+
conf2.openModal("MEDIA_UNAVAILABLE_MODAL_ID");
|
|
44403
44407
|
} else if (response.status === 415) {
|
|
44404
|
-
|
|
44408
|
+
conf2.notify({
|
|
44405
44409
|
variant: "warning",
|
|
44406
|
-
header:
|
|
44407
|
-
body:
|
|
44410
|
+
header: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.header"),
|
|
44411
|
+
body: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.body"),
|
|
44408
44412
|
duration: 4000
|
|
44409
44413
|
});
|
|
44410
44414
|
} else {
|
|
44411
|
-
|
|
44415
|
+
conf2.notify({
|
|
44412
44416
|
variant: "error",
|
|
44413
|
-
header:
|
|
44414
|
-
body:
|
|
44417
|
+
header: conf2.i18n.t("toolsPanel.addMedia.unhandled.header"),
|
|
44418
|
+
body: conf2.i18n.t("toolsPanel.addMedia.unhandled.body"),
|
|
44415
44419
|
duration: 4000
|
|
44416
44420
|
});
|
|
44417
44421
|
}
|
|
@@ -44419,17 +44423,17 @@ var catchErrorResponse = async (response, mediaType) => {
|
|
|
44419
44423
|
};
|
|
44420
44424
|
var catchDuplicateErrorResponse = async (response) => {
|
|
44421
44425
|
if (response.status === 403) {
|
|
44422
|
-
|
|
44426
|
+
conf2.notify({
|
|
44423
44427
|
variant: "warning",
|
|
44424
|
-
header:
|
|
44425
|
-
body:
|
|
44428
|
+
header: conf2.i18n.t("toolsPanel.addMedia.limitReached.header"),
|
|
44429
|
+
body: conf2.i18n.t("toolsPanel.addMedia.limitReached.duplicateBody"),
|
|
44426
44430
|
duration: 4000
|
|
44427
44431
|
});
|
|
44428
44432
|
} else {
|
|
44429
|
-
|
|
44433
|
+
conf2.notify({
|
|
44430
44434
|
variant: "error",
|
|
44431
|
-
header:
|
|
44432
|
-
body:
|
|
44435
|
+
header: conf2.i18n.t("toolsPanel.addMedia.unhandled.header"),
|
|
44436
|
+
body: conf2.i18n.t("toolsPanel.addMedia.unhandled.body"),
|
|
44433
44437
|
duration: 4000
|
|
44434
44438
|
});
|
|
44435
44439
|
}
|
|
@@ -44437,40 +44441,40 @@ var catchDuplicateErrorResponse = async (response) => {
|
|
|
44437
44441
|
};
|
|
44438
44442
|
var validateMediaFile = (file, account2) => {
|
|
44439
44443
|
const fileExtension = file.name.split(".").pop()?.toLowerCase() || "";
|
|
44440
|
-
if (!file.type.startsWith("image") && !
|
|
44441
|
-
|
|
44444
|
+
if (!file.type.startsWith("image") && !conf2.AUDIO_FORMATS.includes(fileExtension) && !conf2.VIDEO_FORMATS.includes(fileExtension)) {
|
|
44445
|
+
conf2.notify({
|
|
44442
44446
|
variant: "warning",
|
|
44443
|
-
header:
|
|
44444
|
-
body:
|
|
44447
|
+
header: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.header"),
|
|
44448
|
+
body: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.body"),
|
|
44445
44449
|
duration: 4000
|
|
44446
44450
|
});
|
|
44447
44451
|
return false;
|
|
44448
44452
|
}
|
|
44449
44453
|
const isBasicPlan = account2.billingInfo?.plan.name === "basic";
|
|
44450
|
-
let errorBody =
|
|
44451
|
-
if (
|
|
44452
|
-
errorBody =
|
|
44454
|
+
let errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.imageBody.${isBasicPlan ? "basic" : "plus"}`);
|
|
44455
|
+
if (conf2.AUDIO_FORMATS.includes(fileExtension) || conf2.VIDEO_FORMATS.includes(fileExtension)) {
|
|
44456
|
+
errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.audioOrVideoBody.${isBasicPlan ? "basic" : "plus"}`);
|
|
44453
44457
|
if (file.size / 1024 ** 2 > (account2.billingInfo?.storage.maxMediaSize || Infinity)) {
|
|
44454
|
-
|
|
44458
|
+
conf2.notify({
|
|
44455
44459
|
variant: "warning",
|
|
44456
|
-
header:
|
|
44460
|
+
header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
|
|
44457
44461
|
body: errorBody,
|
|
44458
44462
|
button: isBasicPlan ? {
|
|
44459
|
-
text:
|
|
44460
|
-
onClick: () =>
|
|
44463
|
+
text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
|
|
44464
|
+
onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
|
|
44461
44465
|
} : undefined,
|
|
44462
44466
|
duration: 4000
|
|
44463
44467
|
});
|
|
44464
44468
|
return false;
|
|
44465
44469
|
}
|
|
44466
44470
|
} else if (file.size / 1024 ** 2 > (account2.billingInfo?.storage.maxImageSize || Infinity)) {
|
|
44467
|
-
|
|
44471
|
+
conf2.notify({
|
|
44468
44472
|
variant: "warning",
|
|
44469
|
-
header:
|
|
44473
|
+
header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
|
|
44470
44474
|
body: errorBody,
|
|
44471
44475
|
button: isBasicPlan ? {
|
|
44472
|
-
text:
|
|
44473
|
-
onClick: () =>
|
|
44476
|
+
text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
|
|
44477
|
+
onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
|
|
44474
44478
|
} : undefined,
|
|
44475
44479
|
duration: 4000
|
|
44476
44480
|
});
|
|
@@ -44549,7 +44553,7 @@ var resizeAndConvertToPng = async (inp) => {
|
|
|
44549
44553
|
};
|
|
44550
44554
|
if (base64String.startsWith("data:image/svg+xml")) {
|
|
44551
44555
|
image2.onload = async () => {
|
|
44552
|
-
const parser =
|
|
44556
|
+
const parser = conf2.getDOMParser();
|
|
44553
44557
|
const svgDoc = parser.parseFromString(atob(base64String.split(",")[1]), "image/svg+xml");
|
|
44554
44558
|
const svgElement = svgDoc.documentElement;
|
|
44555
44559
|
svgElement.removeAttribute("width");
|
|
@@ -44780,8 +44784,8 @@ class AudioItem extends Mbr {
|
|
|
44780
44784
|
this.subject.publish(this);
|
|
44781
44785
|
});
|
|
44782
44786
|
this.transformation.subject.subscribe(this.onTransform);
|
|
44783
|
-
this.right = this.left +
|
|
44784
|
-
this.bottom = this.top +
|
|
44787
|
+
this.right = this.left + conf2.AUDIO_DIMENSIONS.width;
|
|
44788
|
+
this.bottom = this.top + conf2.AUDIO_DIMENSIONS.height;
|
|
44785
44789
|
}
|
|
44786
44790
|
setCurrentTime(time2) {
|
|
44787
44791
|
this.currentTime = time2;
|
|
@@ -44848,8 +44852,8 @@ class AudioItem extends Mbr {
|
|
|
44848
44852
|
const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
|
|
44849
44853
|
this.left = translateX;
|
|
44850
44854
|
this.top = translateY;
|
|
44851
|
-
this.right = this.left +
|
|
44852
|
-
this.bottom = this.top +
|
|
44855
|
+
this.right = this.left + conf2.AUDIO_DIMENSIONS.width * scaleX;
|
|
44856
|
+
this.bottom = this.top + conf2.AUDIO_DIMENSIONS.height * scaleY;
|
|
44853
44857
|
}
|
|
44854
44858
|
render(context) {
|
|
44855
44859
|
if (this.transformationRenderBlock) {
|
|
@@ -44878,8 +44882,8 @@ class AudioItem extends Mbr {
|
|
|
44878
44882
|
const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
|
|
44879
44883
|
const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
|
|
44880
44884
|
div.id = this.getId();
|
|
44881
|
-
div.style.width = `${
|
|
44882
|
-
div.style.height = `${
|
|
44885
|
+
div.style.width = `${conf2.AUDIO_DIMENSIONS.width}px`;
|
|
44886
|
+
div.style.height = `${conf2.AUDIO_DIMENSIONS.height}px`;
|
|
44883
44887
|
div.style.transformOrigin = "top left";
|
|
44884
44888
|
div.style.transform = transform;
|
|
44885
44889
|
div.style.position = "absolute";
|
|
@@ -44998,7 +45002,7 @@ class AudioItem extends Mbr {
|
|
|
44998
45002
|
}
|
|
44999
45003
|
download() {
|
|
45000
45004
|
if (this.extension) {
|
|
45001
|
-
const linkElem =
|
|
45005
|
+
const linkElem = conf2.documentFactory.createElement("a");
|
|
45002
45006
|
linkElem.href = this.url;
|
|
45003
45007
|
linkElem.setAttribute("download", `${this.board.getBoardId()}.${this.extension}`);
|
|
45004
45008
|
linkElem.click();
|
|
@@ -45400,7 +45404,7 @@ class ImageCommand {
|
|
|
45400
45404
|
|
|
45401
45405
|
// src/Items/Image/Image.ts
|
|
45402
45406
|
function getPlaceholderImage(board, imageDimension) {
|
|
45403
|
-
const placeholderCanvas =
|
|
45407
|
+
const placeholderCanvas = conf2.documentFactory.createElement("canvas");
|
|
45404
45408
|
const placeholderContext = placeholderCanvas.getContext("2d");
|
|
45405
45409
|
const context = new DrawingContext(board.camera, placeholderContext);
|
|
45406
45410
|
const placeholder = new Placeholder;
|
|
@@ -45751,7 +45755,7 @@ class Drawing extends Mbr {
|
|
|
45751
45755
|
itemType = "Drawing";
|
|
45752
45756
|
parent = "Board";
|
|
45753
45757
|
transformation;
|
|
45754
|
-
path2d = new
|
|
45758
|
+
path2d = new conf2.path2DFactory;
|
|
45755
45759
|
subject = new Subject;
|
|
45756
45760
|
untransformedMbr = new Mbr;
|
|
45757
45761
|
lines = [];
|
|
@@ -45828,7 +45832,7 @@ class Drawing extends Mbr {
|
|
|
45828
45832
|
this.bottom = mbr.bottom;
|
|
45829
45833
|
}
|
|
45830
45834
|
updatePath2d() {
|
|
45831
|
-
this.path2d = new
|
|
45835
|
+
this.path2d = new conf2.path2DFactory;
|
|
45832
45836
|
const context = this.path2d;
|
|
45833
45837
|
const points = this.points;
|
|
45834
45838
|
if (points.length < 3) {
|
|
@@ -47001,9 +47005,9 @@ class Camera {
|
|
|
47001
47005
|
matrix = new Matrix2;
|
|
47002
47006
|
pointer = new Point;
|
|
47003
47007
|
window = {
|
|
47004
|
-
width:
|
|
47005
|
-
height:
|
|
47006
|
-
dpi:
|
|
47008
|
+
width: conf2.getDocumentWidth(),
|
|
47009
|
+
height: conf2.getDocumentHeight(),
|
|
47010
|
+
dpi: conf2.getDPI(),
|
|
47007
47011
|
getMbr: () => {
|
|
47008
47012
|
return new Mbr(0, 0, this.window.width, this.window.height);
|
|
47009
47013
|
}
|
|
@@ -47379,9 +47383,9 @@ class Camera {
|
|
|
47379
47383
|
this.updateBoardPointer();
|
|
47380
47384
|
}
|
|
47381
47385
|
onWindowResize() {
|
|
47382
|
-
this.window.width =
|
|
47383
|
-
this.window.height =
|
|
47384
|
-
this.window.dpi =
|
|
47386
|
+
this.window.width = conf2.getDocumentWidth();
|
|
47387
|
+
this.window.height = conf2.getDocumentHeight();
|
|
47388
|
+
this.window.dpi = conf2.getDPI();
|
|
47385
47389
|
this.resizeSubject.publish(this);
|
|
47386
47390
|
this.subject.publish(this);
|
|
47387
47391
|
}
|
|
@@ -47394,10 +47398,10 @@ class Camera {
|
|
|
47394
47398
|
let y = 0;
|
|
47395
47399
|
const { activeKeys } = keyboard;
|
|
47396
47400
|
const directions = {
|
|
47397
|
-
ArrowRight: [-
|
|
47398
|
-
ArrowLeft: [
|
|
47399
|
-
ArrowDown: [0, -
|
|
47400
|
-
ArrowUp: [0,
|
|
47401
|
+
ArrowRight: [-conf2.NAVIGATION_STEP, 0],
|
|
47402
|
+
ArrowLeft: [conf2.NAVIGATION_STEP, 0],
|
|
47403
|
+
ArrowDown: [0, -conf2.NAVIGATION_STEP],
|
|
47404
|
+
ArrowUp: [0, conf2.NAVIGATION_STEP]
|
|
47401
47405
|
};
|
|
47402
47406
|
const activeArrowKeys = Array.from(activeKeys).filter((key) => (key in directions)).sort();
|
|
47403
47407
|
if (activeArrowKeys.length === 2) {
|
|
@@ -47930,7 +47934,7 @@ var isMacos = () => navigator.platform.toUpperCase().includes("MAC");
|
|
|
47930
47934
|
|
|
47931
47935
|
// src/Keyboard/logHotkey.ts
|
|
47932
47936
|
function logHotkey(hotkeyConfig, hotkeyName, status, context) {
|
|
47933
|
-
if (!
|
|
47937
|
+
if (!conf.LOG_HOTKEYS) {
|
|
47934
47938
|
return;
|
|
47935
47939
|
}
|
|
47936
47940
|
const isFunction = typeof hotkeyConfig === "function";
|
|
@@ -48022,7 +48026,7 @@ function checkHotkeys(hotkeyMap, event, board) {
|
|
|
48022
48026
|
// src/Keyboard/getHotkeyLabel.ts
|
|
48023
48027
|
function getHotkeyLabel(hotkey) {
|
|
48024
48028
|
const hotkeyLabel = hotkeys_default[hotkey].label;
|
|
48025
|
-
switch (
|
|
48029
|
+
switch (conf2.FORCE_HOTKEYS || "auto") {
|
|
48026
48030
|
case "windows":
|
|
48027
48031
|
return hotkeyLabel.windows;
|
|
48028
48032
|
case "macos":
|
|
@@ -49999,7 +50003,7 @@ class SpatialIndex {
|
|
|
49999
50003
|
this.itemsArray.push(item);
|
|
50000
50004
|
this.itemsIndex.insert(item);
|
|
50001
50005
|
}
|
|
50002
|
-
if (
|
|
50006
|
+
if (conf2.isNode()) {
|
|
50003
50007
|
return;
|
|
50004
50008
|
}
|
|
50005
50009
|
if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
|
|
@@ -50566,8 +50570,8 @@ class Tool {
|
|
|
50566
50570
|
|
|
50567
50571
|
// src/Tools/ExportSnapshot/getDecorationResizeType.ts
|
|
50568
50572
|
function getDecorationResizeType(point7, mbr, tolerance = 10) {
|
|
50569
|
-
for (const key in
|
|
50570
|
-
const decoration =
|
|
50573
|
+
for (const key in conf2.EXPORT_FRAME_DECORATIONS) {
|
|
50574
|
+
const decoration = conf2.EXPORT_FRAME_DECORATIONS[key];
|
|
50571
50575
|
const decorationBounds = {
|
|
50572
50576
|
left: mbr.left + (decoration.offsetX ?? 0),
|
|
50573
50577
|
top: mbr.top + (decoration.offsetY ?? 0),
|
|
@@ -50608,7 +50612,7 @@ class ExportSnapshot extends Tool {
|
|
|
50608
50612
|
super();
|
|
50609
50613
|
this.board = board;
|
|
50610
50614
|
const cameraCenter = this.board.camera.getMbr().getCenter();
|
|
50611
|
-
this.mbr = new Mbr(cameraCenter.x -
|
|
50615
|
+
this.mbr = new Mbr(cameraCenter.x - conf2.EXPORT_SELECTION_BOX_WIDTH / 2, cameraCenter.y - conf2.EXPORT_SELECTION_BOX_HEIGHT / 2, cameraCenter.x + conf2.EXPORT_SELECTION_BOX_WIDTH / 2, cameraCenter.y + conf2.EXPORT_SELECTION_BOX_HEIGHT / 2, "transparent", "transparent", 1);
|
|
50612
50616
|
this.board.selection.disable();
|
|
50613
50617
|
this.tempDrawingContext = new DrawingContext(board.camera, this.tempCtx);
|
|
50614
50618
|
}
|
|
@@ -50620,11 +50624,11 @@ class ExportSnapshot extends Tool {
|
|
|
50620
50624
|
resize() {
|
|
50621
50625
|
if (this.resizeType && this.mbr && this.oppositePoint) {
|
|
50622
50626
|
const resize = getResize(this.resizeType, this.board.pointer.point, this.mbr, this.oppositePoint);
|
|
50623
|
-
if (resize.mbr.getWidth() >
|
|
50627
|
+
if (resize.mbr.getWidth() > conf2.EXPORT_MIN_WIDTH) {
|
|
50624
50628
|
this.mbr.left = resize.mbr.left;
|
|
50625
50629
|
this.mbr.right = resize.mbr.right;
|
|
50626
50630
|
}
|
|
50627
|
-
if (resize.mbr.getHeight() >
|
|
50631
|
+
if (resize.mbr.getHeight() > conf2.EXPORT_MIN_HEIGHT) {
|
|
50628
50632
|
this.mbr.top = resize.mbr.top;
|
|
50629
50633
|
this.mbr.bottom = resize.mbr.bottom;
|
|
50630
50634
|
}
|
|
@@ -50713,7 +50717,7 @@ class ExportSnapshot extends Tool {
|
|
|
50713
50717
|
}
|
|
50714
50718
|
const res = await exportBoardSnapshot({
|
|
50715
50719
|
board: this.board,
|
|
50716
|
-
bgColor:
|
|
50720
|
+
bgColor: conf2.CANVAS_BG_COLOR,
|
|
50717
50721
|
selection: this.mbr,
|
|
50718
50722
|
upscaleTo: 4000,
|
|
50719
50723
|
nameToExport: this.board.getName()
|
|
@@ -50737,18 +50741,18 @@ class ExportSnapshot extends Tool {
|
|
|
50737
50741
|
const cameraMbr = context.camera.getMbr();
|
|
50738
50742
|
this.tempDrawingContext.setCamera(this.board.camera);
|
|
50739
50743
|
this.tempDrawingContext.clear();
|
|
50740
|
-
cameraMbr.backgroundColor =
|
|
50744
|
+
cameraMbr.backgroundColor = conf2.EXPORT_BLUR_BACKGROUND_COLOR;
|
|
50741
50745
|
cameraMbr.strokeWidth = 0;
|
|
50742
50746
|
cameraMbr.render(this.tempDrawingContext);
|
|
50743
50747
|
this.tempCtx.clearRect(this.mbr.left, this.mbr.top, this.mbr.getWidth(), this.mbr.getHeight());
|
|
50744
|
-
if (
|
|
50745
|
-
const topLeft =
|
|
50748
|
+
if (conf2.EXPORT_FRAME_DECORATIONS) {
|
|
50749
|
+
const topLeft = conf2.EXPORT_FRAME_DECORATIONS["top-left"];
|
|
50746
50750
|
this.renderDecoration(this.tempDrawingContext, topLeft.path, this.mbr.left + (topLeft.offsetX ?? 0), this.mbr.top + (topLeft.offsetY ?? 0), topLeft.color, topLeft.lineWidth);
|
|
50747
|
-
const topRight =
|
|
50751
|
+
const topRight = conf2.EXPORT_FRAME_DECORATIONS["top-right"];
|
|
50748
50752
|
this.renderDecoration(this.tempDrawingContext, topRight.path, this.mbr.right + (topRight.offsetX ?? 0), this.mbr.top + (topRight.offsetY ?? 0), topRight.color, topRight.lineWidth);
|
|
50749
|
-
const bottomLeft =
|
|
50753
|
+
const bottomLeft = conf2.EXPORT_FRAME_DECORATIONS["bottom-left"];
|
|
50750
50754
|
this.renderDecoration(this.tempDrawingContext, bottomLeft.path, this.mbr.left + (bottomLeft.offsetX ?? 0), this.mbr.bottom + (bottomLeft.offsetY ?? 0), bottomLeft.color, bottomLeft.lineWidth);
|
|
50751
|
-
const bottomRight =
|
|
50755
|
+
const bottomRight = conf2.EXPORT_FRAME_DECORATIONS["bottom-right"];
|
|
50752
50756
|
this.renderDecoration(this.tempDrawingContext, bottomRight.path, this.mbr.left + this.mbr.getWidth() - bottomRight.width, this.mbr.top + this.mbr.getHeight() - bottomRight.width, bottomRight.color, bottomRight.lineWidth);
|
|
50753
50757
|
}
|
|
50754
50758
|
}
|
|
@@ -51257,14 +51261,14 @@ class AddConnector extends BoardTool {
|
|
|
51257
51261
|
class AddDrawing extends BoardTool {
|
|
51258
51262
|
drawing = null;
|
|
51259
51263
|
isDown = false;
|
|
51260
|
-
strokeWidth =
|
|
51261
|
-
strokeColor =
|
|
51262
|
-
strokeStyle =
|
|
51264
|
+
strokeWidth = conf2.PEN_INITIAL_STROKE_WIDTH;
|
|
51265
|
+
strokeColor = conf2.PEN_DEFAULT_COLOR;
|
|
51266
|
+
strokeStyle = conf2.PEN_STROKE_STYLE;
|
|
51263
51267
|
constructor(board) {
|
|
51264
51268
|
super(board);
|
|
51265
51269
|
this.setCursor();
|
|
51266
|
-
if (
|
|
51267
|
-
const drawingSettings = localStorage.getItem(
|
|
51270
|
+
if (conf2.PEN_SETTINGS_KEY) {
|
|
51271
|
+
const drawingSettings = localStorage.getItem(conf2.PEN_SETTINGS_KEY);
|
|
51268
51272
|
if (drawingSettings) {
|
|
51269
51273
|
const { strokeWidth, strokeColor, strokeStyle } = JSON.parse(drawingSettings);
|
|
51270
51274
|
this.strokeWidth = strokeWidth;
|
|
@@ -51274,7 +51278,7 @@ class AddDrawing extends BoardTool {
|
|
|
51274
51278
|
}
|
|
51275
51279
|
}
|
|
51276
51280
|
updateSettings() {
|
|
51277
|
-
localStorage.setItem(
|
|
51281
|
+
localStorage.setItem(conf2.PEN_SETTINGS_KEY, JSON.stringify({
|
|
51278
51282
|
strokeWidth: this.strokeWidth,
|
|
51279
51283
|
strokeColor: this.strokeColor,
|
|
51280
51284
|
strokeStyle: this.strokeStyle
|
|
@@ -51304,7 +51308,7 @@ class AddDrawing extends BoardTool {
|
|
|
51304
51308
|
ctx.beginPath();
|
|
51305
51309
|
ctx.arc(point7.x, point7.y, this.strokeWidth / 2, 0, 2 * Math.PI, false);
|
|
51306
51310
|
ctx.lineWidth = 1;
|
|
51307
|
-
ctx.strokeStyle =
|
|
51311
|
+
ctx.strokeStyle = conf2.PEN_POINTER_CIRCLE_COLOR;
|
|
51308
51312
|
ctx.stroke();
|
|
51309
51313
|
}
|
|
51310
51314
|
setCursor() {
|
|
@@ -51386,7 +51390,7 @@ class AddDrawing extends BoardTool {
|
|
|
51386
51390
|
this.setCursor();
|
|
51387
51391
|
};
|
|
51388
51392
|
render(context) {
|
|
51389
|
-
if (
|
|
51393
|
+
if (conf2.PEN_RENDER_POINTER_CIRCLE) {
|
|
51390
51394
|
this.renderPointerCircle(this.board.pointer.point, context);
|
|
51391
51395
|
}
|
|
51392
51396
|
if (!this.drawing) {
|
|
@@ -51401,14 +51405,14 @@ class AddDrawing extends BoardTool {
|
|
|
51401
51405
|
}
|
|
51402
51406
|
// src/Tools/AddDrawing/AddHighlighter.ts
|
|
51403
51407
|
class AddHighlighter extends AddDrawing {
|
|
51404
|
-
strokeWidth =
|
|
51405
|
-
strokeColor =
|
|
51406
|
-
strokeStyle =
|
|
51408
|
+
strokeWidth = conf2.HIGHLIGHTER_INITIAL_STROKE_WIDTH;
|
|
51409
|
+
strokeColor = conf2.HIGHLIGHTER_DEFAULT_COLOR;
|
|
51410
|
+
strokeStyle = conf2.PEN_STROKE_STYLE;
|
|
51407
51411
|
constructor(board) {
|
|
51408
51412
|
super(board);
|
|
51409
51413
|
this.setCursor();
|
|
51410
|
-
if (
|
|
51411
|
-
const highlighterSettings = localStorage.getItem(
|
|
51414
|
+
if (conf2.HIGHLIGHTER_SETTINGS_KEY) {
|
|
51415
|
+
const highlighterSettings = localStorage.getItem(conf2.HIGHLIGHTER_SETTINGS_KEY);
|
|
51412
51416
|
if (highlighterSettings) {
|
|
51413
51417
|
const { strokeWidth, strokeColor, strokeStyle } = JSON.parse(highlighterSettings);
|
|
51414
51418
|
this.strokeWidth = strokeWidth;
|
|
@@ -51421,7 +51425,7 @@ class AddHighlighter extends AddDrawing {
|
|
|
51421
51425
|
return true;
|
|
51422
51426
|
}
|
|
51423
51427
|
updateSettings() {
|
|
51424
|
-
localStorage.setItem(
|
|
51428
|
+
localStorage.setItem(conf2.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
|
|
51425
51429
|
strokeWidth: this.strokeWidth,
|
|
51426
51430
|
strokeColor: this.strokeColor,
|
|
51427
51431
|
strokeStyle: this.strokeStyle
|
|
@@ -51745,7 +51749,7 @@ class AddShape extends BoardTool {
|
|
|
51745
51749
|
const point7 = this.board.pointer.point;
|
|
51746
51750
|
this.line = new Line(point7.copy(), point7.copy());
|
|
51747
51751
|
this.bounds = this.line.getMbr();
|
|
51748
|
-
this.bounds.borderColor =
|
|
51752
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
51749
51753
|
this.shape.apply({
|
|
51750
51754
|
class: "Shape",
|
|
51751
51755
|
method: "setShapeType",
|
|
@@ -51769,7 +51773,7 @@ class AddShape extends BoardTool {
|
|
|
51769
51773
|
}
|
|
51770
51774
|
this.line = new Line(startPoint, endPoint);
|
|
51771
51775
|
this.bounds = this.line.getMbr();
|
|
51772
|
-
this.bounds.borderColor =
|
|
51776
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
51773
51777
|
this.initTransformation();
|
|
51774
51778
|
this.board.tools.publish();
|
|
51775
51779
|
return true;
|
|
@@ -51841,7 +51845,7 @@ class AddShape extends BoardTool {
|
|
|
51841
51845
|
const y = (top + bottom) / 2 - 50;
|
|
51842
51846
|
this.bounds = new Mbr(x, y, x, y);
|
|
51843
51847
|
this.line = new Line(new Point(x, y), new Point(x, y));
|
|
51844
|
-
this.bounds.borderColor =
|
|
51848
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
51845
51849
|
this.shape.apply({
|
|
51846
51850
|
class: "Shape",
|
|
51847
51851
|
method: "setShapeType",
|
|
@@ -51874,8 +51878,8 @@ class AddSticker extends BoardTool {
|
|
|
51874
51878
|
this.setCursor(this.sticker.getBackgroundColor());
|
|
51875
51879
|
}
|
|
51876
51880
|
setCursor(color2) {
|
|
51877
|
-
if (
|
|
51878
|
-
const colorName = color2 ?
|
|
51881
|
+
if (conf2.STICKER_COLOR_NAMES) {
|
|
51882
|
+
const colorName = color2 ? conf2.STICKER_COLOR_NAMES[conf2.STICKER_COLORS.indexOf(color2)] : undefined;
|
|
51879
51883
|
this.board.pointer.setCursor(colorName ? `sticker-${colorName}` : "crosshair");
|
|
51880
51884
|
} else {
|
|
51881
51885
|
this.board.pointer.setCursor("crosshair");
|
|
@@ -51899,7 +51903,7 @@ class AddSticker extends BoardTool {
|
|
|
51899
51903
|
const point7 = this.board.pointer.point;
|
|
51900
51904
|
this.line = new Line(point7.copy(), point7.copy());
|
|
51901
51905
|
this.bounds = this.line.getMbr();
|
|
51902
|
-
this.bounds.borderColor =
|
|
51906
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
51903
51907
|
this.board.tools.publish();
|
|
51904
51908
|
return true;
|
|
51905
51909
|
}
|
|
@@ -51908,7 +51912,7 @@ class AddSticker extends BoardTool {
|
|
|
51908
51912
|
this.line = new Line(this.line.start.copy(), this.board.pointer.point.copy());
|
|
51909
51913
|
this.sticker.applyDiagonal(this.line);
|
|
51910
51914
|
this.bounds = this.sticker.getMbr();
|
|
51911
|
-
this.bounds.borderColor =
|
|
51915
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
51912
51916
|
this.board.tools.publish();
|
|
51913
51917
|
return true;
|
|
51914
51918
|
}
|
|
@@ -52008,7 +52012,7 @@ class AddText extends BoardTool {
|
|
|
52008
52012
|
const point7 = this.board.pointer.point;
|
|
52009
52013
|
this.line = new Line(point7.copy(), point7.copy());
|
|
52010
52014
|
this.bounds = this.line.getMbr();
|
|
52011
|
-
this.bounds.borderColor =
|
|
52015
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
52012
52016
|
this.board.tools.publish();
|
|
52013
52017
|
return true;
|
|
52014
52018
|
}
|
|
@@ -52019,7 +52023,7 @@ class AddText extends BoardTool {
|
|
|
52019
52023
|
const end2 = new Point(cursorPoint.x, start2.y + height2);
|
|
52020
52024
|
this.line = new Line(start2, end2);
|
|
52021
52025
|
this.bounds = this.line.getMbr();
|
|
52022
|
-
this.bounds.borderColor =
|
|
52026
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
52023
52027
|
this.board.tools.publish();
|
|
52024
52028
|
return true;
|
|
52025
52029
|
}
|
|
@@ -52084,11 +52088,11 @@ class AddText extends BoardTool {
|
|
|
52084
52088
|
class Eraser extends BoardTool {
|
|
52085
52089
|
itemType = "Eraser";
|
|
52086
52090
|
isDown = false;
|
|
52087
|
-
strokeWidth =
|
|
52088
|
-
strokeColor =
|
|
52089
|
-
strokeStyle =
|
|
52091
|
+
strokeWidth = conf2.ERASER_STROKE_WIDTH;
|
|
52092
|
+
strokeColor = conf2.ERASER_DEFAULT_COLOR;
|
|
52093
|
+
strokeStyle = conf2.PEN_STROKE_STYLE;
|
|
52090
52094
|
drawing = new Drawing(this.board, []);
|
|
52091
|
-
maxPointsInLine =
|
|
52095
|
+
maxPointsInLine = conf2.ERASER_MAX_LINE_LENGTH;
|
|
52092
52096
|
constructor(board) {
|
|
52093
52097
|
super(board);
|
|
52094
52098
|
this.setCursor();
|
|
@@ -52250,7 +52254,7 @@ function createCanvasDrawer(board) {
|
|
|
52250
52254
|
borderDiv.id = "canvasBorder";
|
|
52251
52255
|
borderDiv.style.position = "absolute";
|
|
52252
52256
|
borderDiv.style.transformOrigin = "left top";
|
|
52253
|
-
borderDiv.style.border = `1px solid ${
|
|
52257
|
+
borderDiv.style.border = `1px solid ${conf2.SELECTION_COLOR}`;
|
|
52254
52258
|
borderDiv.style.boxSizing = "border-box";
|
|
52255
52259
|
borderDiv.style.left = `${leftOffset}px`;
|
|
52256
52260
|
borderDiv.style.top = `${topOffset}px`;
|
|
@@ -52260,7 +52264,7 @@ function createCanvasDrawer(board) {
|
|
|
52260
52264
|
canvas.style.boxSizing = "border-box";
|
|
52261
52265
|
container.appendChild(borderDiv);
|
|
52262
52266
|
} else {
|
|
52263
|
-
canvas.style.border = `1px solid ${
|
|
52267
|
+
canvas.style.border = `1px solid ${conf2.SELECTION_COLOR}`;
|
|
52264
52268
|
canvas.style.boxSizing = "border-box";
|
|
52265
52269
|
}
|
|
52266
52270
|
const createAnchorDiv = (left, top, radius) => {
|
|
@@ -52268,8 +52272,8 @@ function createCanvasDrawer(board) {
|
|
|
52268
52272
|
anchorDiv.style.position = "absolute";
|
|
52269
52273
|
anchorDiv.style.width = `${2 * radius}px`;
|
|
52270
52274
|
anchorDiv.style.height = `${2 * radius}px`;
|
|
52271
|
-
anchorDiv.style.backgroundColor = `${
|
|
52272
|
-
anchorDiv.style.border = `${
|
|
52275
|
+
anchorDiv.style.backgroundColor = `${conf2.SELECTION_ANCHOR_COLOR}`;
|
|
52276
|
+
anchorDiv.style.border = `${conf2.SELECTION_ANCHOR_WIDTH}px solid ${conf2.SELECTION_COLOR}`;
|
|
52273
52277
|
anchorDiv.style.borderRadius = "2px";
|
|
52274
52278
|
anchorDiv.style.left = `calc(${left} - ${radius}px)`;
|
|
52275
52279
|
anchorDiv.style.top = `calc(${top} - ${radius}px)`;
|
|
@@ -52277,10 +52281,10 @@ function createCanvasDrawer(board) {
|
|
|
52277
52281
|
return anchorDiv;
|
|
52278
52282
|
};
|
|
52279
52283
|
const anchors = [
|
|
52280
|
-
createAnchorDiv("0%", "0%",
|
|
52281
|
-
createAnchorDiv("100% + 1px", "0%",
|
|
52282
|
-
createAnchorDiv("0%", "100% + 1px",
|
|
52283
|
-
createAnchorDiv("100% + 1px", "100% + 1px",
|
|
52284
|
+
createAnchorDiv("0%", "0%", conf2.SELECTION_ANCHOR_RADIUS),
|
|
52285
|
+
createAnchorDiv("100% + 1px", "0%", conf2.SELECTION_ANCHOR_RADIUS),
|
|
52286
|
+
createAnchorDiv("0%", "100% + 1px", conf2.SELECTION_ANCHOR_RADIUS),
|
|
52287
|
+
createAnchorDiv("100% + 1px", "100% + 1px", conf2.SELECTION_ANCHOR_RADIUS)
|
|
52284
52288
|
];
|
|
52285
52289
|
const canvasBorder = Array.from(container.children).find((child) => child.id === "canvasBorder");
|
|
52286
52290
|
for (const anchor of anchors) {
|
|
@@ -53622,8 +53626,8 @@ class Select extends Tool {
|
|
|
53622
53626
|
const { x, y } = pointer.point;
|
|
53623
53627
|
this.line = new Line(new Point(x, y), new Point(x, y));
|
|
53624
53628
|
this.rect = this.line.getMbr();
|
|
53625
|
-
this.rect.borderColor =
|
|
53626
|
-
this.rect.backgroundColor =
|
|
53629
|
+
this.rect.borderColor = conf2.SELECTION_COLOR;
|
|
53630
|
+
this.rect.backgroundColor = conf2.SELECTION_BACKGROUND;
|
|
53627
53631
|
this.board.tools.publish();
|
|
53628
53632
|
this.board.presence.throttledEmit({
|
|
53629
53633
|
method: "DrawSelect",
|
|
@@ -53708,8 +53712,8 @@ class Select extends Tool {
|
|
|
53708
53712
|
const point7 = this.board.pointer.point.copy();
|
|
53709
53713
|
this.line = new Line(this.line.start, point7);
|
|
53710
53714
|
this.rect = this.line.getMbr();
|
|
53711
|
-
this.rect.borderColor =
|
|
53712
|
-
this.rect.backgroundColor =
|
|
53715
|
+
this.rect.borderColor = conf2.SELECTION_COLOR;
|
|
53716
|
+
this.rect.backgroundColor = conf2.SELECTION_BACKGROUND;
|
|
53713
53717
|
this.board.tools.publish();
|
|
53714
53718
|
this.board.presence.throttledEmit({
|
|
53715
53719
|
method: "DrawSelect",
|
|
@@ -54843,7 +54847,7 @@ class Board {
|
|
|
54843
54847
|
const loadLinksImagesScript = LOAD_LINKS_IMAGES_JS;
|
|
54844
54848
|
const css = INDEX_CSS;
|
|
54845
54849
|
const boardName = this.getName() || this.getBoardId();
|
|
54846
|
-
const items = this.items.getWholeHTML(
|
|
54850
|
+
const items = this.items.getWholeHTML(conf2.documentFactory);
|
|
54847
54851
|
const itemsDiv = `<div id="items">${items}</div>`;
|
|
54848
54852
|
const scripts = `
|
|
54849
54853
|
<script type="module">${customTagsScript}</script>
|
|
@@ -54883,7 +54887,7 @@ class Board {
|
|
|
54883
54887
|
return `${head}${body}`;
|
|
54884
54888
|
}
|
|
54885
54889
|
deserializeHTMLAndEmit(stringedHTML) {
|
|
54886
|
-
const parser =
|
|
54890
|
+
const parser = conf2.getDOMParser();
|
|
54887
54891
|
const doc = parser.parseFromString(stringedHTML, "text/html");
|
|
54888
54892
|
const items = doc.body.querySelector("#items");
|
|
54889
54893
|
if (items) {
|
|
@@ -54935,7 +54939,7 @@ class Board {
|
|
|
54935
54939
|
return [];
|
|
54936
54940
|
}
|
|
54937
54941
|
deserializeHTML(stringedHTML) {
|
|
54938
|
-
const parser =
|
|
54942
|
+
const parser = conf2.getDOMParser();
|
|
54939
54943
|
const doc = parser.parseFromString(stringedHTML, "text/html");
|
|
54940
54944
|
const itemsDiv = doc.body.querySelector("#items");
|
|
54941
54945
|
if (!itemsDiv) {
|
|
@@ -55496,7 +55500,7 @@ class RichTextCommand {
|
|
|
55496
55500
|
item: id,
|
|
55497
55501
|
operation: {
|
|
55498
55502
|
...this.operation,
|
|
55499
|
-
fontColor: this.board.items.getById(id)?.getRichText()?.getFontColor() ||
|
|
55503
|
+
fontColor: this.board.items.getById(id)?.getRichText()?.getFontColor() || conf2.DEFAULT_TEXT_STYLES.fontColor
|
|
55500
55504
|
}
|
|
55501
55505
|
}));
|
|
55502
55506
|
case "setBlockType":
|
|
@@ -55520,7 +55524,7 @@ class RichTextCommand {
|
|
|
55520
55524
|
item: id,
|
|
55521
55525
|
operation: {
|
|
55522
55526
|
...this.operation,
|
|
55523
|
-
fontFamily: this.board.items.getById(id)?.getRichText()?.getFontFamily() ||
|
|
55527
|
+
fontFamily: this.board.items.getById(id)?.getRichText()?.getFontFamily() || conf2.DEFAULT_TEXT_STYLES.fontFamily
|
|
55524
55528
|
}
|
|
55525
55529
|
}));
|
|
55526
55530
|
case "setFontSize":
|
|
@@ -55528,7 +55532,7 @@ class RichTextCommand {
|
|
|
55528
55532
|
item: id,
|
|
55529
55533
|
operation: {
|
|
55530
55534
|
...this.operation,
|
|
55531
|
-
fontSize: this.board.items.getById(id)?.getRichText()?.getFontSize() ||
|
|
55535
|
+
fontSize: this.board.items.getById(id)?.getRichText()?.getFontSize() || conf2.DEFAULT_TEXT_STYLES.fontSize
|
|
55532
55536
|
}
|
|
55533
55537
|
}));
|
|
55534
55538
|
case "setFontHighlight":
|
|
@@ -55536,7 +55540,7 @@ class RichTextCommand {
|
|
|
55536
55540
|
item: id,
|
|
55537
55541
|
operation: {
|
|
55538
55542
|
...this.operation,
|
|
55539
|
-
fontHighlight: this.board.items.getById(id)?.getRichText()?.getFontHighlight() ||
|
|
55543
|
+
fontHighlight: this.board.items.getById(id)?.getRichText()?.getFontHighlight() || conf2.DEFAULT_TEXT_STYLES.fontHighlight
|
|
55540
55544
|
}
|
|
55541
55545
|
}));
|
|
55542
55546
|
case "setHorisontalAlignment":
|
|
@@ -56877,7 +56881,7 @@ class Transformer extends Tool {
|
|
|
56877
56881
|
const isLockedItems = this.selection.getIsLockedSelection();
|
|
56878
56882
|
if (mbr) {
|
|
56879
56883
|
mbr.strokeWidth = 1 / context.matrix.scaleX;
|
|
56880
|
-
const selectionColor = isLockedItems ?
|
|
56884
|
+
const selectionColor = isLockedItems ? conf2.SELECTION_LOCKED_COLOR : conf2.SELECTION_COLOR;
|
|
56881
56885
|
mbr.borderColor = selectionColor;
|
|
56882
56886
|
mbr.render(context);
|
|
56883
56887
|
}
|
|
@@ -56903,7 +56907,7 @@ class Transformer extends Tool {
|
|
|
56903
56907
|
new Point(right, bottom)
|
|
56904
56908
|
];
|
|
56905
56909
|
for (const point7 of points) {
|
|
56906
|
-
const circle = new Anchor(point7.x, point7.y,
|
|
56910
|
+
const circle = new Anchor(point7.x, point7.y, conf2.SELECTION_ANCHOR_RADIUS, conf2.SELECTION_COLOR, conf2.SELECTION_ANCHOR_COLOR, conf2.SELECTION_ANCHOR_WIDTH);
|
|
56907
56911
|
anchors.push(circle);
|
|
56908
56912
|
}
|
|
56909
56913
|
}
|
|
@@ -58106,7 +58110,7 @@ class Selection2 {
|
|
|
58106
58110
|
renderItemMbr(context, item, customScale) {
|
|
58107
58111
|
const mbr = item.getMbr();
|
|
58108
58112
|
mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
|
|
58109
|
-
const selectionColor = item.transformation.isLocked ?
|
|
58113
|
+
const selectionColor = item.transformation.isLocked ? conf2.SELECTION_LOCKED_COLOR : conf2.SELECTION_COLOR;
|
|
58110
58114
|
mbr.borderColor = selectionColor;
|
|
58111
58115
|
mbr.render(context);
|
|
58112
58116
|
}
|
|
@@ -58961,19 +58965,19 @@ function removeNode_removeNode(confirmed, toTransform) {
|
|
|
58961
58965
|
// src/Events/Transform/splitNode_insertNode.ts
|
|
58962
58966
|
function splitNode_insertNode(confirmed, toTransform) {
|
|
58963
58967
|
const transformed = { ...toTransform };
|
|
58964
|
-
const
|
|
58968
|
+
const conf3 = confirmed.path;
|
|
58965
58969
|
const path3 = transformed.path;
|
|
58966
|
-
if (Path3.equals(
|
|
58970
|
+
if (Path3.equals(conf3, path3)) {
|
|
58967
58971
|
return transformed;
|
|
58968
58972
|
}
|
|
58969
|
-
const isDescendant = path3.length >
|
|
58973
|
+
const isDescendant = path3.length > conf3.length && path3.slice(0, conf3.length).every((seg, i) => seg === conf3[i]);
|
|
58970
58974
|
if (isDescendant) {
|
|
58971
58975
|
const newPath = [...path3];
|
|
58972
58976
|
newPath[0] = newPath[0] + 1;
|
|
58973
58977
|
transformed.path = newPath;
|
|
58974
58978
|
return transformed;
|
|
58975
58979
|
}
|
|
58976
|
-
if (Path3.isBefore(
|
|
58980
|
+
if (Path3.isBefore(conf3, path3)) {
|
|
58977
58981
|
transformPath(confirmed, transformed);
|
|
58978
58982
|
}
|
|
58979
58983
|
return transformed;
|
|
@@ -58982,23 +58986,23 @@ function splitNode_insertNode(confirmed, toTransform) {
|
|
|
58982
58986
|
// src/Events/Transform/splitNode_removeNode.ts
|
|
58983
58987
|
function splitNode_removeNode(confirmed, toTransform) {
|
|
58984
58988
|
const transformed = { ...toTransform };
|
|
58985
|
-
const
|
|
58989
|
+
const conf3 = confirmed.path;
|
|
58986
58990
|
const path3 = transformed.path;
|
|
58987
|
-
if (Path3.equals(
|
|
58991
|
+
if (Path3.equals(conf3, path3)) {
|
|
58988
58992
|
return transformed;
|
|
58989
58993
|
}
|
|
58990
|
-
if (path3.length ===
|
|
58994
|
+
if (path3.length === conf3.length + 1 && path3.slice(0, conf3.length).every((seg, i) => seg === conf3[i])) {
|
|
58991
58995
|
const newPath = [...path3];
|
|
58992
|
-
if (
|
|
58996
|
+
if (conf3.length === 1) {
|
|
58993
58997
|
newPath[0] = newPath[0] + 1;
|
|
58994
58998
|
} else {
|
|
58995
|
-
newPath[
|
|
58999
|
+
newPath[conf3.length] = newPath[conf3.length] + 1;
|
|
58996
59000
|
}
|
|
58997
59001
|
transformed.path = newPath;
|
|
58998
59002
|
return transformed;
|
|
58999
59003
|
}
|
|
59000
|
-
const isDescendant = path3.length >
|
|
59001
|
-
if (Path3.isBefore(
|
|
59004
|
+
const isDescendant = path3.length > conf3.length && path3.slice(0, conf3.length).every((seg, i) => seg === conf3[i]);
|
|
59005
|
+
if (Path3.isBefore(conf3, path3) && !isDescendant) {
|
|
59002
59006
|
transformPath(confirmed, transformed);
|
|
59003
59007
|
}
|
|
59004
59008
|
return transformed;
|
|
@@ -59578,8 +59582,8 @@ function transformEvents(confirmed, toTransform) {
|
|
|
59578
59582
|
const transformed = [];
|
|
59579
59583
|
for (const transf of toTransform) {
|
|
59580
59584
|
let actualyTransformed = { ...transf };
|
|
59581
|
-
for (const
|
|
59582
|
-
const { operation: confOp } =
|
|
59585
|
+
for (const conf3 of confirmed) {
|
|
59586
|
+
const { operation: confOp } = conf3.body;
|
|
59583
59587
|
const { operation: transfOp } = actualyTransformed.body;
|
|
59584
59588
|
const transformedOp = transfromOperation(confOp, transfOp);
|
|
59585
59589
|
if (transformedOp) {
|
|
@@ -60211,7 +60215,7 @@ class Events2 {
|
|
|
60211
60215
|
return record !== null;
|
|
60212
60216
|
}
|
|
60213
60217
|
sendPresenceEvent(event) {
|
|
60214
|
-
|
|
60218
|
+
conf2.connection.publishPresenceEvent(this.board.getBoardId(), event);
|
|
60215
60219
|
}
|
|
60216
60220
|
canUndoEvent(op, byUserId) {
|
|
60217
60221
|
if (op.method === "undo") {
|
|
@@ -60320,7 +60324,7 @@ function handleChatChunk(chunk, board) {
|
|
|
60320
60324
|
if (chunk.isExternalApiError) {
|
|
60321
60325
|
const editor = item2.getRichText().editor;
|
|
60322
60326
|
editor.clearText();
|
|
60323
|
-
editor.insertCopiedText(
|
|
60327
|
+
editor.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
|
|
60324
60328
|
}
|
|
60325
60329
|
}
|
|
60326
60330
|
board.camera.zoomToFit(item2.getMbr(), 20);
|
|
@@ -60328,9 +60332,9 @@ function handleChatChunk(chunk, board) {
|
|
|
60328
60332
|
}
|
|
60329
60333
|
console.log("Error AI generate", chunk.error);
|
|
60330
60334
|
if (!chunk.isExternalApiError) {
|
|
60331
|
-
|
|
60332
|
-
header:
|
|
60333
|
-
body:
|
|
60335
|
+
conf2.notify({
|
|
60336
|
+
header: conf2.i18n.t("AIInput.textGenerationError.header"),
|
|
60337
|
+
body: conf2.i18n.t("AIInput.textGenerationError.body"),
|
|
60334
60338
|
variant: "error",
|
|
60335
60339
|
duration: 4000
|
|
60336
60340
|
});
|
|
@@ -60340,9 +60344,9 @@ function handleChatChunk(chunk, board) {
|
|
|
60340
60344
|
default:
|
|
60341
60345
|
board.camera.unsubscribeFromItem();
|
|
60342
60346
|
if (!chunk.isExternalApiError) {
|
|
60343
|
-
|
|
60344
|
-
header:
|
|
60345
|
-
body:
|
|
60347
|
+
conf2.notify({
|
|
60348
|
+
header: conf2.i18n.t("AIInput.textGenerationError.header"),
|
|
60349
|
+
body: conf2.i18n.t("AIInput.textGenerationError.body"),
|
|
60346
60350
|
variant: "error",
|
|
60347
60351
|
duration: 4000
|
|
60348
60352
|
});
|
|
@@ -60357,7 +60361,7 @@ function handleChatChunk(chunk, board) {
|
|
|
60357
60361
|
if (chunk.isExternalApiError) {
|
|
60358
60362
|
const editor = item2.getRichText().editor;
|
|
60359
60363
|
editor.clearText();
|
|
60360
|
-
editor.insertCopiedText(
|
|
60364
|
+
editor.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
|
|
60361
60365
|
}
|
|
60362
60366
|
}
|
|
60363
60367
|
board.camera.zoomToFit(item2.getMbr(), 20);
|
|
@@ -60384,7 +60388,7 @@ function handleAudioGenerate(response, board) {
|
|
|
60384
60388
|
}
|
|
60385
60389
|
const audio = new AudioItem(board, true, audioUrl2, board.events, "", "wav");
|
|
60386
60390
|
const { left, top, right } = placeholderNode.getMbr();
|
|
60387
|
-
audio.transformation.applyTranslateTo(left + (right - left -
|
|
60391
|
+
audio.transformation.applyTranslateTo(left + (right - left - conf2.AUDIO_DIMENSIONS.width) / 2, top);
|
|
60388
60392
|
audio.updateMbr();
|
|
60389
60393
|
const threadDirection = placeholderNode.getThreadDirection();
|
|
60390
60394
|
board.remove(placeholderNode, false);
|
|
@@ -60406,7 +60410,7 @@ function handleAudioGenerate(response, board) {
|
|
|
60406
60410
|
type: "audio/wav"
|
|
60407
60411
|
});
|
|
60408
60412
|
const audioUrl2 = URL.createObjectURL(audioBlob);
|
|
60409
|
-
const linkElem =
|
|
60413
|
+
const linkElem = conf2.documentFactory.createElement("a");
|
|
60410
60414
|
linkElem.href = audioUrl2;
|
|
60411
60415
|
linkElem.setAttribute("download", `${board.getBoardId()}-generated.wav`);
|
|
60412
60416
|
linkElem.click();
|
|
@@ -60425,9 +60429,9 @@ function handleAudioGenerate(response, board) {
|
|
|
60425
60429
|
board.selection.add(placeholderNode);
|
|
60426
60430
|
}
|
|
60427
60431
|
console.error("Audio generation error:", response.message);
|
|
60428
|
-
|
|
60429
|
-
header:
|
|
60430
|
-
body:
|
|
60432
|
+
conf2.notify({
|
|
60433
|
+
header: conf2.i18n.t("AIInput.audioGenerationError.header"),
|
|
60434
|
+
body: conf2.i18n.t("AIInput.audioGenerationError.body"),
|
|
60431
60435
|
variant: "error",
|
|
60432
60436
|
duration: 4000
|
|
60433
60437
|
});
|
|
@@ -60490,14 +60494,14 @@ function handleImageGenerate(response, board) {
|
|
|
60490
60494
|
board.selection.add(item);
|
|
60491
60495
|
const editor = item.getRichText()?.editor;
|
|
60492
60496
|
editor?.clearText();
|
|
60493
|
-
editor?.insertCopiedText(
|
|
60497
|
+
editor?.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
|
|
60494
60498
|
board.camera.zoomToFit(item.getMbr(), 20);
|
|
60495
60499
|
}
|
|
60496
60500
|
}
|
|
60497
60501
|
} else {
|
|
60498
|
-
|
|
60499
|
-
header:
|
|
60500
|
-
body:
|
|
60502
|
+
conf2.notify({
|
|
60503
|
+
header: conf2.i18n.t("AIInput.imageGenerationError.header"),
|
|
60504
|
+
body: conf2.i18n.t("AIInput.imageGenerationError.body"),
|
|
60501
60505
|
variant: "error",
|
|
60502
60506
|
duration: 4000
|
|
60503
60507
|
});
|
|
@@ -60564,10 +60568,10 @@ function startIntervals(board) {
|
|
|
60564
60568
|
}
|
|
60565
60569
|
log.publishIntervalTimer = setInterval(() => {
|
|
60566
60570
|
tryPublishEvent(board);
|
|
60567
|
-
},
|
|
60571
|
+
}, conf2.EVENTS_PUBLISH_INTERVAL);
|
|
60568
60572
|
log.resendIntervalTimer = setInterval(() => {
|
|
60569
60573
|
tryResendEvent(board);
|
|
60570
|
-
},
|
|
60574
|
+
}, conf2.EVENTS_RESEND_INTERVAL);
|
|
60571
60575
|
}
|
|
60572
60576
|
function tryPublishEvent(board) {
|
|
60573
60577
|
const { log } = board.events;
|
|
@@ -60586,14 +60590,14 @@ function tryResendEvent(board) {
|
|
|
60586
60590
|
return;
|
|
60587
60591
|
}
|
|
60588
60592
|
const date = Date.now();
|
|
60589
|
-
const isTimeToSendPendingEvent = date - log.pendingEvent.lastSentTime >=
|
|
60593
|
+
const isTimeToSendPendingEvent = date - log.pendingEvent.lastSentTime >= conf2.EVENTS_RESEND_INTERVAL;
|
|
60590
60594
|
if (!isTimeToSendPendingEvent) {
|
|
60591
60595
|
return;
|
|
60592
60596
|
}
|
|
60593
|
-
const isProbablyLostConnection = log.firstSentTime && date - log.firstSentTime >=
|
|
60597
|
+
const isProbablyLostConnection = log.firstSentTime && date - log.firstSentTime >= conf2.EVENTS_RESEND_INTERVAL * 5;
|
|
60594
60598
|
if (isProbablyLostConnection) {
|
|
60595
60599
|
board.presence.clear();
|
|
60596
|
-
|
|
60600
|
+
conf2.connection?.notifyAboutLostConnection();
|
|
60597
60601
|
}
|
|
60598
60602
|
sendBoardEvent(board, log.pendingEvent.event, log.currentSequenceNumber);
|
|
60599
60603
|
}
|
|
@@ -60624,12 +60628,12 @@ function sendBoardEvent(board, event, sequenceNumber) {
|
|
|
60624
60628
|
lastKnownOrder: log.getLastIndex()
|
|
60625
60629
|
}
|
|
60626
60630
|
};
|
|
60627
|
-
|
|
60631
|
+
conf2.connection.send({
|
|
60628
60632
|
type: "BoardEvent",
|
|
60629
60633
|
boardId: board.getBoardId(),
|
|
60630
60634
|
event: toSend,
|
|
60631
60635
|
sequenceNumber,
|
|
60632
|
-
userId:
|
|
60636
|
+
userId: conf2.connection.getCurrentUser()
|
|
60633
60637
|
});
|
|
60634
60638
|
const date = Date.now();
|
|
60635
60639
|
log.pendingEvent = {
|
|
@@ -60675,7 +60679,7 @@ function handleConfirmation(msg2, board) {
|
|
|
60675
60679
|
if (!isPendingEventConfirmation) {
|
|
60676
60680
|
return;
|
|
60677
60681
|
}
|
|
60678
|
-
|
|
60682
|
+
conf2.connection?.dismissNotificationAboutLostConnection();
|
|
60679
60683
|
log.currentSequenceNumber++;
|
|
60680
60684
|
log.pendingEvent.event.order = msg2.order;
|
|
60681
60685
|
log.confirmSentLocalEvent(log.pendingEvent.event);
|
|
@@ -60687,7 +60691,7 @@ function handleConfirmation(msg2, board) {
|
|
|
60687
60691
|
// src/Events/MessageRouter/handleCreateSnapshotRequestMessage.ts
|
|
60688
60692
|
function handleCreateSnapshotRequestMessage(msg2, board) {
|
|
60689
60693
|
const { boardId, snapshot, lastOrder } = getSnapshotToPublish(board);
|
|
60690
|
-
|
|
60694
|
+
conf2.connection.send({
|
|
60691
60695
|
type: "BoardSnapshot",
|
|
60692
60696
|
boardId,
|
|
60693
60697
|
snapshot,
|
|
@@ -60718,9 +60722,9 @@ function handleModeMessage(message, board) {
|
|
|
60718
60722
|
if (isTemplateView()) {
|
|
60719
60723
|
return;
|
|
60720
60724
|
}
|
|
60721
|
-
|
|
60722
|
-
header:
|
|
60723
|
-
body: message.mode === "edit" ?
|
|
60725
|
+
conf2.notify({
|
|
60726
|
+
header: conf2.i18n.t("sharing.settingsChanged.heading"),
|
|
60727
|
+
body: message.mode === "edit" ? conf2.i18n.t("sharing.settingsChanged.bodyEdit") : conf2.i18n.t("sharing.settingsChanged.bodyView"),
|
|
60724
60728
|
duration: 5000
|
|
60725
60729
|
});
|
|
60726
60730
|
}
|
|
@@ -60812,7 +60816,7 @@ export {
|
|
|
60812
60816
|
defaultCursors as cursors,
|
|
60813
60817
|
createVideoItem,
|
|
60814
60818
|
createEvents,
|
|
60815
|
-
conf,
|
|
60819
|
+
conf2 as conf,
|
|
60816
60820
|
checkHotkeys,
|
|
60817
60821
|
catmullRomInterpolate,
|
|
60818
60822
|
catchErrorResponse,
|