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/cjs/node.js
CHANGED
|
@@ -141380,7 +141380,7 @@ __export(exports_node, {
|
|
|
141380
141380
|
cursors: () => defaultCursors,
|
|
141381
141381
|
createVideoItem: () => createVideoItem,
|
|
141382
141382
|
createEvents: () => createEvents,
|
|
141383
|
-
conf: () =>
|
|
141383
|
+
conf: () => conf2,
|
|
141384
141384
|
checkHotkeys: () => checkHotkeys,
|
|
141385
141385
|
catmullRomInterpolate: () => catmullRomInterpolate,
|
|
141386
141386
|
catchErrorResponse: () => catchErrorResponse,
|
|
@@ -144337,7 +144337,7 @@ var ExportQuality;
|
|
|
144337
144337
|
ExportQuality2[ExportQuality2["STANDARD"] = 2] = "STANDARD";
|
|
144338
144338
|
ExportQuality2[ExportQuality2["LOW"] = 3] = "LOW";
|
|
144339
144339
|
})(ExportQuality ||= {});
|
|
144340
|
-
var
|
|
144340
|
+
var conf2 = {
|
|
144341
144341
|
connection: undefined,
|
|
144342
144342
|
path2DFactory: typeof Path2D !== "undefined" ? BrowserPath2D : MockPath2D,
|
|
144343
144343
|
documentFactory: typeof document !== "undefined" ? new BrowserDocumentFactory : undefined,
|
|
@@ -144657,7 +144657,11 @@ var conf = {
|
|
|
144657
144657
|
overline: false,
|
|
144658
144658
|
subscript: false,
|
|
144659
144659
|
superscript: false
|
|
144660
|
-
}
|
|
144660
|
+
},
|
|
144661
|
+
LOG_HOTKEYS: false,
|
|
144662
|
+
FORCE_HOTKEYS: "auto",
|
|
144663
|
+
debug: false,
|
|
144664
|
+
FALLBACK_LNG: "en"
|
|
144661
144665
|
};
|
|
144662
144666
|
|
|
144663
144667
|
// src/Items/Transformation/Matrix.ts
|
|
@@ -145379,7 +145383,7 @@ class DrawingContext {
|
|
|
145379
145383
|
this.setCamera(camera);
|
|
145380
145384
|
}
|
|
145381
145385
|
dpi() {
|
|
145382
|
-
return
|
|
145386
|
+
return conf2.getDPI();
|
|
145383
145387
|
}
|
|
145384
145388
|
setCamera(camera) {
|
|
145385
145389
|
this.camera = camera;
|
|
@@ -145389,7 +145393,7 @@ class DrawingContext {
|
|
|
145389
145393
|
}
|
|
145390
145394
|
clear() {
|
|
145391
145395
|
this.ctx.setTransform(1 * this.dpi(), 0, 0, 1 * this.dpi(), 0, 0);
|
|
145392
|
-
this.ctx.clearRect(0, 0,
|
|
145396
|
+
this.ctx.clearRect(0, 0, conf2.getDocumentWidth(), conf2.getDocumentHeight());
|
|
145393
145397
|
this.matrix.applyToContext(this.ctx);
|
|
145394
145398
|
}
|
|
145395
145399
|
clearCursor() {
|
|
@@ -145397,7 +145401,7 @@ class DrawingContext {
|
|
|
145397
145401
|
return;
|
|
145398
145402
|
}
|
|
145399
145403
|
this.cursorCtx.setTransform(1 * this.dpi(), 0, 0, 1 * this.dpi(), 0, 0);
|
|
145400
|
-
this.cursorCtx.clearRect(0, 0,
|
|
145404
|
+
this.cursorCtx.clearRect(0, 0, conf2.getDocumentWidth(), conf2.getDocumentHeight());
|
|
145401
145405
|
this.matrix.applyToContext(this.cursorCtx);
|
|
145402
145406
|
}
|
|
145403
145407
|
applyChanges() {
|
|
@@ -145500,7 +145504,7 @@ class Path {
|
|
|
145500
145504
|
this.width = this.getMbr().getWidth();
|
|
145501
145505
|
this.height = this.getMbr().getHeight();
|
|
145502
145506
|
this.maxDimension = Math.max(mbr.getWidth(), mbr.getHeight());
|
|
145503
|
-
this.path2d = new
|
|
145507
|
+
this.path2d = new conf2.path2DFactory;
|
|
145504
145508
|
this.updateCache();
|
|
145505
145509
|
}
|
|
145506
145510
|
getBackgroundColor() {
|
|
@@ -145577,7 +145581,7 @@ class Path {
|
|
|
145577
145581
|
this.y = top - this.paddingTop;
|
|
145578
145582
|
this.width = right - left + this.paddingLeft + this.paddingRight;
|
|
145579
145583
|
this.height = bottom - top + this.paddingTop + this.paddingBottom;
|
|
145580
|
-
const path2d = new
|
|
145584
|
+
const path2d = new conf2.path2DFactory;
|
|
145581
145585
|
if (this.segments.length === 0) {
|
|
145582
145586
|
return;
|
|
145583
145587
|
}
|
|
@@ -146643,7 +146647,7 @@ var parsersHTML = {
|
|
|
146643
146647
|
"comment-item": parseHTMLComment
|
|
146644
146648
|
};
|
|
146645
146649
|
var decodeHtml = (htmlString) => {
|
|
146646
|
-
const parser =
|
|
146650
|
+
const parser = conf2.getDOMParser();
|
|
146647
146651
|
const doc = parser.parseFromString(htmlString, "text/html");
|
|
146648
146652
|
return doc.documentElement.textContent || "";
|
|
146649
146653
|
};
|
|
@@ -146672,10 +146676,10 @@ function parseHTMLRichText(el, options) {
|
|
|
146672
146676
|
italic: node.style.fontStyle === "italic",
|
|
146673
146677
|
underline: node.style.textDecoration.includes("underline"),
|
|
146674
146678
|
"line-through": node.style.textDecoration.includes("line-through"),
|
|
146675
|
-
fontColor: node.style.color ||
|
|
146676
|
-
fontHighlight: node.style.backgroundColor ||
|
|
146677
|
-
fontSize: parseFloat(node.style.fontSize) ||
|
|
146678
|
-
fontFamily: node.style.fontFamily ||
|
|
146679
|
+
fontColor: node.style.color || conf2.DEFAULT_TEXT_STYLES.fontColor,
|
|
146680
|
+
fontHighlight: node.style.backgroundColor || conf2.DEFAULT_TEXT_STYLES.fontHighlight,
|
|
146681
|
+
fontSize: parseFloat(node.style.fontSize) || conf2.DEFAULT_TEXT_STYLES.fontSize,
|
|
146682
|
+
fontFamily: node.style.fontFamily || conf2.DEFAULT_TEXT_STYLES.fontFamily,
|
|
146679
146683
|
overline: false,
|
|
146680
146684
|
subscript: false,
|
|
146681
146685
|
superscript: false
|
|
@@ -146740,7 +146744,7 @@ function parseHTMLRichText(el, options) {
|
|
|
146740
146744
|
return {
|
|
146741
146745
|
type: "paragraph",
|
|
146742
146746
|
...extractCommonProps(),
|
|
146743
|
-
lineHeight: parseFloat(node.style.lineHeight) ||
|
|
146747
|
+
lineHeight: parseFloat(node.style.lineHeight) || conf2.DEFAULT_TEXT_STYLES.lineHeight,
|
|
146744
146748
|
children: children2
|
|
146745
146749
|
};
|
|
146746
146750
|
default:
|
|
@@ -147113,8 +147117,8 @@ class LinkTo {
|
|
|
147113
147117
|
const ctx = context.ctx;
|
|
147114
147118
|
ctx.save();
|
|
147115
147119
|
ctx.globalCompositeOperation = "destination-out";
|
|
147116
|
-
const size =
|
|
147117
|
-
const offset =
|
|
147120
|
+
const size = conf2.LINK_BTN_SIZE / scale;
|
|
147121
|
+
const offset = conf2.LINK_BTN_OFFSET / scale;
|
|
147118
147122
|
ctx.fillRect(right - size - offset, top + offset, size, size);
|
|
147119
147123
|
ctx.restore();
|
|
147120
147124
|
}
|
|
@@ -147265,7 +147269,7 @@ function getBlockNode(data, maxWidth, isFrame, listData, listMark, newLine = fal
|
|
|
147265
147269
|
} else if (node.type === "ul_list" && !listData) {
|
|
147266
147270
|
listData = { level: 0, isNumberedList: false };
|
|
147267
147271
|
}
|
|
147268
|
-
const listMarks =
|
|
147272
|
+
const listMarks = conf2[getListMarkType((listData?.level || 0) + 1)];
|
|
147269
147273
|
for (let i = 0;i < data.children.length; i++) {
|
|
147270
147274
|
const child = structuredClone(data.children[i]);
|
|
147271
147275
|
switch (child.type) {
|
|
@@ -147670,8 +147674,8 @@ function measureText(text, style, paddingTop = 0, marginLeft = 0) {
|
|
|
147670
147674
|
rect2.height += paddingTop;
|
|
147671
147675
|
}
|
|
147672
147676
|
}
|
|
147673
|
-
|
|
147674
|
-
const measure =
|
|
147677
|
+
conf2.measureCtx.font = style.font;
|
|
147678
|
+
const measure = conf2.measureCtx.measureText(text);
|
|
147675
147679
|
const actualBoundingBoxAscent = toFiniteNumber2(measure.actualBoundingBoxAscent);
|
|
147676
147680
|
const actualBoundingBoxDescent = toFiniteNumber2(measure.actualBoundingBoxDescent);
|
|
147677
147681
|
const actualBoundingBoxLeft = toFiniteNumber2(measure.actualBoundingBoxLeft);
|
|
@@ -156311,7 +156315,7 @@ var convertLinkNodeToTextNode = (node2) => {
|
|
|
156311
156315
|
const link = node2.link;
|
|
156312
156316
|
const text3 = node2.children.map((child) => child.text).join("");
|
|
156313
156317
|
return {
|
|
156314
|
-
...
|
|
156318
|
+
...conf2.DEFAULT_TEXT_STYLES,
|
|
156315
156319
|
type: "text",
|
|
156316
156320
|
text: text3,
|
|
156317
156321
|
link,
|
|
@@ -156327,9 +156331,9 @@ function setNodeChildrenStyles({
|
|
|
156327
156331
|
horisontalAlignment,
|
|
156328
156332
|
node: node2
|
|
156329
156333
|
}) {
|
|
156330
|
-
let fontStyles =
|
|
156334
|
+
let fontStyles = conf2.DEFAULT_TEXT_STYLES;
|
|
156331
156335
|
if (editor) {
|
|
156332
|
-
fontStyles = import_slate18.Editor.marks(editor) ||
|
|
156336
|
+
fontStyles = import_slate18.Editor.marks(editor) || conf2.DEFAULT_TEXT_STYLES;
|
|
156333
156337
|
}
|
|
156334
156338
|
switch (node2.type) {
|
|
156335
156339
|
case "heading_one":
|
|
@@ -156361,7 +156365,7 @@ function setNodeChildrenStyles({
|
|
|
156361
156365
|
children.text += " ";
|
|
156362
156366
|
}
|
|
156363
156367
|
let fontColor = fontStyles.fontColor;
|
|
156364
|
-
if (fontColor ===
|
|
156368
|
+
if (fontColor === conf2.DEFAULT_TEXT_STYLES.fontColor && children.link) {
|
|
156365
156369
|
fontColor = "rgba(71, 120, 245, 1)";
|
|
156366
156370
|
}
|
|
156367
156371
|
return {
|
|
@@ -156401,7 +156405,7 @@ function setNodeStyles({
|
|
|
156401
156405
|
}
|
|
156402
156406
|
|
|
156403
156407
|
// src/Items/RichText/editorHelpers/markdown/markdownProcessor.ts
|
|
156404
|
-
var { i18n: i18n2 } =
|
|
156408
|
+
var { i18n: i18n2 } = conf2;
|
|
156405
156409
|
|
|
156406
156410
|
class MarkdownProcessor {
|
|
156407
156411
|
chunksQueue = [];
|
|
@@ -157404,7 +157408,7 @@ function setEditorFocus(editor, selectionContext) {
|
|
|
157404
157408
|
}
|
|
157405
157409
|
|
|
157406
157410
|
// src/Items/RichText/RichText.ts
|
|
157407
|
-
var { i18n: i18n3 } =
|
|
157411
|
+
var { i18n: i18n3 } = conf2;
|
|
157408
157412
|
var isEditInProcessValue = false;
|
|
157409
157413
|
var counter = 0;
|
|
157410
157414
|
|
|
@@ -157427,7 +157431,7 @@ class RichText extends Mbr {
|
|
|
157427
157431
|
isContainerSet = false;
|
|
157428
157432
|
isRenderEnabled = true;
|
|
157429
157433
|
layoutNodes;
|
|
157430
|
-
clipPath = new
|
|
157434
|
+
clipPath = new conf2.path2DFactory;
|
|
157431
157435
|
updateRequired = false;
|
|
157432
157436
|
autoSizeScale = 1;
|
|
157433
157437
|
containerMaxWidth;
|
|
@@ -157442,7 +157446,7 @@ class RichText extends Mbr {
|
|
|
157442
157446
|
shrinkWidth = false;
|
|
157443
157447
|
prevMbr = null;
|
|
157444
157448
|
rtCounter = 0;
|
|
157445
|
-
constructor(board, container, id = "", transformation = new Transformation(id, board.events), linkTo, placeholderText = i18n3?.t("board.textPlaceholder"), isInShape = false, autoSize = false, insideOf, initialTextStyles =
|
|
157449
|
+
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) {
|
|
157446
157450
|
super();
|
|
157447
157451
|
this.board = board;
|
|
157448
157452
|
this.container = container;
|
|
@@ -157575,11 +157579,11 @@ class RichText extends Mbr {
|
|
|
157575
157579
|
return;
|
|
157576
157580
|
}
|
|
157577
157581
|
try {
|
|
157578
|
-
|
|
157582
|
+
conf2.reactEditorFocus(this.editor.editor);
|
|
157579
157583
|
} catch {}
|
|
157580
157584
|
};
|
|
157581
157585
|
updateElement = () => {
|
|
157582
|
-
if (
|
|
157586
|
+
if (conf2.isNode()) {
|
|
157583
157587
|
return;
|
|
157584
157588
|
}
|
|
157585
157589
|
if (this.updateRequired) {
|
|
@@ -157708,7 +157712,7 @@ class RichText extends Mbr {
|
|
|
157708
157712
|
const container = this.getTransformedContainer();
|
|
157709
157713
|
const width = container.getWidth();
|
|
157710
157714
|
const height = container.getHeight();
|
|
157711
|
-
this.clipPath = new
|
|
157715
|
+
this.clipPath = new conf2.path2DFactory;
|
|
157712
157716
|
this.clipPath.rect(0, 0, width, height);
|
|
157713
157717
|
}
|
|
157714
157718
|
setContainer(container) {
|
|
@@ -157985,24 +157989,24 @@ class RichText extends Mbr {
|
|
|
157985
157989
|
this.clearLastClickPoint();
|
|
157986
157990
|
const domMbr = ref.getBoundingClientRect();
|
|
157987
157991
|
const refMbr = new Mbr(domMbr.left, domMbr.top, domMbr.right, domMbr.bottom);
|
|
157988
|
-
if (refMbr.isInside(point3) && (
|
|
157989
|
-
const domRange =
|
|
157990
|
-
const textNode =
|
|
157991
|
-
const offset =
|
|
157992
|
-
const slatePoint =
|
|
157992
|
+
if (refMbr.isInside(point3) && (conf2.documentFactory.caretPositionFromPoint || conf2.documentFactory.caretRangeFromPoint)) {
|
|
157993
|
+
const domRange = conf2.documentFactory.caretPositionFromPoint ? conf2.documentFactory.caretPositionFromPoint(point3.x, point3.y) : conf2.documentFactory.caretRangeFromPoint(point3.x, point3.y);
|
|
157994
|
+
const textNode = conf2.documentFactory.caretPositionFromPoint ? domRange.offsetNode : domRange.startContainer;
|
|
157995
|
+
const offset = conf2.documentFactory.caretPositionFromPoint ? domRange.offset : domRange.startOffset;
|
|
157996
|
+
const slatePoint = conf2.reactEditorToSlatePoint(this.editor.editor, textNode, offset, {
|
|
157993
157997
|
exactMatch: false,
|
|
157994
157998
|
suppressThrow: false
|
|
157995
157999
|
});
|
|
157996
158000
|
if (slatePoint) {
|
|
157997
158001
|
const nRange = { anchor: slatePoint, focus: slatePoint };
|
|
157998
158002
|
this.editorTransforms.select(this.editor.editor, nRange);
|
|
157999
|
-
|
|
158003
|
+
conf2.reactEditorFocus(this.editor.editor);
|
|
158000
158004
|
}
|
|
158001
158005
|
} else {
|
|
158002
|
-
if (!(
|
|
158006
|
+
if (!(conf2.documentFactory.caretPositionFromPoint || conf2.documentFactory.caretRangeFromPoint)) {
|
|
158003
158007
|
console.error("document.caretPositionFromPoint and document.caretRangeFromPoint are not available!");
|
|
158004
158008
|
}
|
|
158005
|
-
|
|
158009
|
+
conf2.reactEditorFocus(this.editor.editor);
|
|
158006
158010
|
}
|
|
158007
158011
|
}
|
|
158008
158012
|
}
|
|
@@ -158109,11 +158113,11 @@ class RichText extends Mbr {
|
|
|
158109
158113
|
if (node2.type === "text" || "text" in node2) {
|
|
158110
158114
|
node2 = node2;
|
|
158111
158115
|
const text3 = node2.text.trim() !== "" ? decodeHtml(escapeHtml(node2.text)) : " ";
|
|
158112
|
-
const textElement = node2.link ? Object.assign(
|
|
158116
|
+
const textElement = node2.link ? Object.assign(conf2.documentFactory.createElement("a"), {
|
|
158113
158117
|
href: node2.link,
|
|
158114
158118
|
target: "_blank",
|
|
158115
158119
|
rel: "noreferrer"
|
|
158116
|
-
}) :
|
|
158120
|
+
}) : conf2.documentFactory.createElement("span");
|
|
158117
158121
|
Object.assign(textElement.style, {
|
|
158118
158122
|
fontWeight: node2.bold ? "700" : "400",
|
|
158119
158123
|
fontStyle: node2.italic ? "italic" : "",
|
|
@@ -158121,10 +158125,10 @@ class RichText extends Mbr {
|
|
|
158121
158125
|
node2.underline ? "underline" : "",
|
|
158122
158126
|
node2["line-through"] ? "line-through" : ""
|
|
158123
158127
|
].filter(Boolean).join(" "),
|
|
158124
|
-
color: node2.fontColor ||
|
|
158125
|
-
backgroundColor: node2.fontHighlight ||
|
|
158126
|
-
fontSize: node2.fontSize ? `${node2.fontSize}px` : `${
|
|
158127
|
-
fontFamily: node2.fontFamily ||
|
|
158128
|
+
color: node2.fontColor || conf2.DEFAULT_TEXT_STYLES.fontColor,
|
|
158129
|
+
backgroundColor: node2.fontHighlight || conf2.DEFAULT_TEXT_STYLES.fontHighlight,
|
|
158130
|
+
fontSize: node2.fontSize ? `${node2.fontSize}px` : `${conf2.DEFAULT_TEXT_STYLES.fontSize}px`,
|
|
158131
|
+
fontFamily: node2.fontFamily || conf2.DEFAULT_TEXT_STYLES.fontFamily
|
|
158128
158132
|
});
|
|
158129
158133
|
if (this.insideOf === "Frame") {
|
|
158130
158134
|
Object.assign(textElement.style, {
|
|
@@ -158159,14 +158163,14 @@ class RichText extends Mbr {
|
|
|
158159
158163
|
four: 4,
|
|
158160
158164
|
five: 5
|
|
158161
158165
|
};
|
|
158162
|
-
const header =
|
|
158166
|
+
const header = conf2.documentFactory.createElement(`h${levels[level]}`);
|
|
158163
158167
|
applyCommonStyles(header);
|
|
158164
158168
|
header.append(...children);
|
|
158165
158169
|
return header;
|
|
158166
158170
|
}
|
|
158167
158171
|
case "code_block": {
|
|
158168
|
-
const pre =
|
|
158169
|
-
const code =
|
|
158172
|
+
const pre = conf2.documentFactory.createElement("pre");
|
|
158173
|
+
const code = conf2.documentFactory.createElement("code");
|
|
158170
158174
|
applyCommonStyles(pre);
|
|
158171
158175
|
if (node2.language) {
|
|
158172
158176
|
code.classList.add(`language-${node2.language}`);
|
|
@@ -158180,35 +158184,35 @@ class RichText extends Mbr {
|
|
|
158180
158184
|
return pre;
|
|
158181
158185
|
}
|
|
158182
158186
|
case "block-quote": {
|
|
158183
|
-
const blockquote =
|
|
158187
|
+
const blockquote = conf2.documentFactory.createElement("blockquote");
|
|
158184
158188
|
applyCommonStyles(blockquote);
|
|
158185
158189
|
blockquote.append(...children);
|
|
158186
158190
|
return blockquote;
|
|
158187
158191
|
}
|
|
158188
158192
|
case "ul_list": {
|
|
158189
|
-
const ul =
|
|
158193
|
+
const ul = conf2.documentFactory.createElement("ul");
|
|
158190
158194
|
applyCommonStyles(ul);
|
|
158191
158195
|
ul.append(...children);
|
|
158192
158196
|
return ul;
|
|
158193
158197
|
}
|
|
158194
158198
|
case "ol_list": {
|
|
158195
|
-
const ol =
|
|
158199
|
+
const ol = conf2.documentFactory.createElement("ol");
|
|
158196
158200
|
applyCommonStyles(ol);
|
|
158197
158201
|
ol.append(...children);
|
|
158198
158202
|
return ol;
|
|
158199
158203
|
}
|
|
158200
158204
|
case "list_item": {
|
|
158201
|
-
const li =
|
|
158205
|
+
const li = conf2.documentFactory.createElement("li");
|
|
158202
158206
|
applyCommonStyles(li);
|
|
158203
158207
|
li.append(...children);
|
|
158204
158208
|
return li;
|
|
158205
158209
|
}
|
|
158206
158210
|
case "paragraph":
|
|
158207
158211
|
default: {
|
|
158208
|
-
const par =
|
|
158212
|
+
const par = conf2.documentFactory.createElement("p");
|
|
158209
158213
|
applyCommonStyles(par);
|
|
158210
158214
|
Object.assign(par.style, {
|
|
158211
|
-
lineHeight: node2.lineHeight ? `${node2.lineHeight}` :
|
|
158215
|
+
lineHeight: node2.lineHeight ? `${node2.lineHeight}` : conf2.DEFAULT_TEXT_STYLES.lineHeight,
|
|
158212
158216
|
margin: "0"
|
|
158213
158217
|
});
|
|
158214
158218
|
par.append(...children);
|
|
@@ -158216,7 +158220,7 @@ class RichText extends Mbr {
|
|
|
158216
158220
|
}
|
|
158217
158221
|
}
|
|
158218
158222
|
}
|
|
158219
|
-
return
|
|
158223
|
+
return conf2.documentFactory.createElement("div");
|
|
158220
158224
|
};
|
|
158221
158225
|
const escapeHtml = (unsafe) => {
|
|
158222
158226
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -171280,7 +171284,7 @@ var transformHtmlOrTextToMarkdown = async (text5, html4) => {
|
|
|
171280
171284
|
markdownString = String(file).trim();
|
|
171281
171285
|
}
|
|
171282
171286
|
let slateNodes = [];
|
|
171283
|
-
if (
|
|
171287
|
+
if (conf2.URL_REGEX.test(text5)) {
|
|
171284
171288
|
slateNodes = [createLinkNode(text5)];
|
|
171285
171289
|
} else {
|
|
171286
171290
|
slateNodes = await convertMarkdownToSlate(markdownString.replace(/<!--(Start|End)Fragment-->/g, ""));
|
|
@@ -171296,7 +171300,7 @@ function createLinkNode(link2) {
|
|
|
171296
171300
|
type: "text",
|
|
171297
171301
|
link: link2,
|
|
171298
171302
|
text: link2,
|
|
171299
|
-
...
|
|
171303
|
+
...conf2.DEFAULT_TEXT_STYLES,
|
|
171300
171304
|
fontColor: "rgba(71, 120, 245, 1)"
|
|
171301
171305
|
};
|
|
171302
171306
|
}
|
|
@@ -171408,7 +171412,7 @@ class AINode {
|
|
|
171408
171412
|
constructor(board, isUserRequest = false, parentNodeId, contextItems = [], threadDirection, id = "") {
|
|
171409
171413
|
this.board = board;
|
|
171410
171414
|
this.id = id;
|
|
171411
|
-
this.buttonIcon =
|
|
171415
|
+
this.buttonIcon = conf2.documentFactory.createElement("img");
|
|
171412
171416
|
this.buttonIcon.src = ICON_SRC;
|
|
171413
171417
|
this.contextItems = contextItems;
|
|
171414
171418
|
this.isUserRequest = isUserRequest;
|
|
@@ -172580,7 +172584,7 @@ function getLine(lineStyle, start, end, middle) {
|
|
|
172580
172584
|
}
|
|
172581
172585
|
|
|
172582
172586
|
// src/Items/Connector/Connector.ts
|
|
172583
|
-
var { i18n: i18n4 } =
|
|
172587
|
+
var { i18n: i18n4 } = conf2;
|
|
172584
172588
|
var ConnectionLineWidths = [1, 2, 3, 4, 5, 6, 7, 8, 12];
|
|
172585
172589
|
var CONNECTOR_COLOR = "rgb(20, 21, 26)";
|
|
172586
172590
|
var CONNECTOR_LINE_WIDTH = 1;
|
|
@@ -172640,9 +172644,9 @@ class Connector {
|
|
|
172640
172644
|
this.text = new RichText(board, this.getMbr(), this.id, new Transformation, this.linkTo, i18n4.t("connector.textPlaceholder", {
|
|
172641
172645
|
ns: "default"
|
|
172642
172646
|
}), true, false, "Connector", {
|
|
172643
|
-
...
|
|
172644
|
-
fontSize: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextSize") ? Number(localStorage.getItem("lastConnectorTextSize")) :
|
|
172645
|
-
fontColor: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextColor") ? localStorage.getItem("lastConnectorTextColor") :
|
|
172647
|
+
...conf2.DEFAULT_TEXT_STYLES,
|
|
172648
|
+
fontSize: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextSize") ? Number(localStorage.getItem("lastConnectorTextSize")) : conf2.DEFAULT_TEXT_STYLES.fontSize,
|
|
172649
|
+
fontColor: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextColor") ? localStorage.getItem("lastConnectorTextColor") : conf2.DEFAULT_TEXT_STYLES.fontColor
|
|
172646
172650
|
});
|
|
172647
172651
|
this.startPointer = getStartPointer(this.startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.3);
|
|
172648
172652
|
this.endPointer = getEndPointer(this.endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.3);
|
|
@@ -173092,7 +173096,7 @@ class Connector {
|
|
|
173092
173096
|
this.text.transformation.applyTranslateTo(x - textWidth / 2, y - textHeight / 2);
|
|
173093
173097
|
this.text.render(context);
|
|
173094
173098
|
if (DRAW_TEXT_BORDER && (selectionContext === "EditUnderPointer" || selectionContext === "EditTextUnderPointer") && this.board.selection.items.list().includes(this)) {
|
|
173095
|
-
ctx.strokeStyle =
|
|
173099
|
+
ctx.strokeStyle = conf2.SELECTION_COLOR;
|
|
173096
173100
|
ctx.lineWidth = 1;
|
|
173097
173101
|
ctx.beginPath();
|
|
173098
173102
|
ctx.rect(textMbr.left - TEXT_BORDER_PADDING, textMbr.top - TEXT_BORDER_PADDING, textMbr.getWidth() + TEXT_BORDER_PADDING * 2, textMbr.getHeight() + TEXT_BORDER_PADDING * 2);
|
|
@@ -173319,7 +173323,7 @@ class Connector {
|
|
|
173319
173323
|
}
|
|
173320
173324
|
}
|
|
173321
173325
|
updatePaths() {
|
|
173322
|
-
if (
|
|
173326
|
+
if (conf2.isNode()) {
|
|
173323
173327
|
return;
|
|
173324
173328
|
}
|
|
173325
173329
|
const startPoint = this.startPoint;
|
|
@@ -174130,7 +174134,7 @@ class DefaultShapeData {
|
|
|
174130
174134
|
text;
|
|
174131
174135
|
linkTo;
|
|
174132
174136
|
itemType = "Shape";
|
|
174133
|
-
constructor(shapeType = "Rectangle", backgroundColor = "none", backgroundOpacity = 1, borderColor =
|
|
174137
|
+
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) {
|
|
174134
174138
|
this.shapeType = shapeType;
|
|
174135
174139
|
this.backgroundColor = backgroundColor;
|
|
174136
174140
|
this.backgroundOpacity = backgroundOpacity;
|
|
@@ -175417,7 +175421,7 @@ class Shape {
|
|
|
175417
175421
|
this.text.updateElement();
|
|
175418
175422
|
}
|
|
175419
175423
|
transformPath() {
|
|
175420
|
-
if (
|
|
175424
|
+
if (conf2.isNode()) {
|
|
175421
175425
|
return;
|
|
175422
175426
|
}
|
|
175423
175427
|
this.path = Shapes[this.shapeType].createPath(this.mbr);
|
|
@@ -175646,7 +175650,7 @@ class Sticker {
|
|
|
175646
175650
|
return this;
|
|
175647
175651
|
}
|
|
175648
175652
|
transformPath() {
|
|
175649
|
-
if (
|
|
175653
|
+
if (conf2.isNode()) {
|
|
175650
175654
|
return;
|
|
175651
175655
|
}
|
|
175652
175656
|
this.stickerPath = StickerShape.stickerPath.copy();
|
|
@@ -176197,7 +176201,7 @@ class Frame {
|
|
|
176197
176201
|
this.path = Frames[this.shapeType].path.copy();
|
|
176198
176202
|
this.transformation = new Transformation(this.id, this.board.events);
|
|
176199
176203
|
this.linkTo = new LinkTo(this.id, this.board.events);
|
|
176200
|
-
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...
|
|
176204
|
+
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 });
|
|
176201
176205
|
this.text.setSelectionHorisontalAlignment("left");
|
|
176202
176206
|
this.transformation.subject.subscribe(() => {
|
|
176203
176207
|
this.transformPath();
|
|
@@ -176759,10 +176763,10 @@ class VideoCommand {
|
|
|
176759
176763
|
|
|
176760
176764
|
// src/Items/Video/Video.ts
|
|
176761
176765
|
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";
|
|
176762
|
-
var videoIcon =
|
|
176766
|
+
var videoIcon = conf2.documentFactory.createElement("img");
|
|
176763
176767
|
videoIcon.src = VIDEO_ICON_SRC;
|
|
176764
176768
|
var createPlaceholderImage = (width2, height2) => {
|
|
176765
|
-
const canvas =
|
|
176769
|
+
const canvas = conf2.documentFactory.createElement("canvas");
|
|
176766
176770
|
canvas.width = width2;
|
|
176767
176771
|
canvas.height = height2;
|
|
176768
176772
|
const ctx = canvas.getContext("2d");
|
|
@@ -176806,7 +176810,7 @@ class VideoItem extends Mbr {
|
|
|
176806
176810
|
this.events = events;
|
|
176807
176811
|
this.id = id;
|
|
176808
176812
|
this.extension = extension2;
|
|
176809
|
-
this.isStorageUrl = !
|
|
176813
|
+
this.isStorageUrl = !conf2.getYouTubeId(url);
|
|
176810
176814
|
this.preview = createPlaceholderImage(videoDimension.width, videoDimension.height);
|
|
176811
176815
|
this.linkTo = new LinkTo(this.id, events);
|
|
176812
176816
|
this.board = board;
|
|
@@ -177176,59 +177180,59 @@ async function fileTosha256(file) {
|
|
|
177176
177180
|
var catchErrorResponse = async (response, mediaType) => {
|
|
177177
177181
|
if (response.status === 403) {
|
|
177178
177182
|
const data = await response.json();
|
|
177179
|
-
let errorBody =
|
|
177183
|
+
let errorBody = conf2.i18n.t("toolsPanel.addMedia.limitReached.bodyWithoutLimit");
|
|
177180
177184
|
if (!data.isOwnerRequest) {
|
|
177181
|
-
errorBody =
|
|
177185
|
+
errorBody = conf2.i18n.t("toolsPanel.addMedia.limitReached.bodyOwner");
|
|
177182
177186
|
} else if (data.currentUsage && data.storageLimit) {
|
|
177183
|
-
errorBody =
|
|
177187
|
+
errorBody = conf2.i18n.t(`toolsPanel.addMedia.limitReached.body.${parseInt(data.storageLimit) < 1e5 ? "basic" : "plus"}`);
|
|
177184
177188
|
}
|
|
177185
|
-
|
|
177189
|
+
conf2.notify({
|
|
177186
177190
|
variant: "warning",
|
|
177187
|
-
header:
|
|
177191
|
+
header: conf2.i18n.t("toolsPanel.addMedia.limitReached.header"),
|
|
177188
177192
|
body: errorBody,
|
|
177189
177193
|
button: data.isOwnerRequest && data.storageLimit <= 100 ? {
|
|
177190
|
-
text:
|
|
177191
|
-
onClick: () =>
|
|
177194
|
+
text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
|
|
177195
|
+
onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
|
|
177192
177196
|
} : undefined,
|
|
177193
177197
|
duration: 8000
|
|
177194
177198
|
});
|
|
177195
177199
|
} else if (response.status === 413) {
|
|
177196
177200
|
const data = await response.json();
|
|
177197
|
-
let errorBody =
|
|
177201
|
+
let errorBody = conf2.i18n.t("toolsPanel.addMedia.tooLarge.bodyWithoutLimit");
|
|
177198
177202
|
let isBasicPlan = false;
|
|
177199
177203
|
if (data.fileSizeLimit && data.fileSize) {
|
|
177200
177204
|
if (mediaType === "image") {
|
|
177201
177205
|
isBasicPlan = parseInt(data.fileSizeLimit) < 20;
|
|
177202
|
-
errorBody =
|
|
177206
|
+
errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.imageBody.${isBasicPlan ? "basic" : "plus"}`);
|
|
177203
177207
|
} else {
|
|
177204
177208
|
isBasicPlan = parseInt(data.fileSizeLimit) < 1000;
|
|
177205
|
-
errorBody =
|
|
177209
|
+
errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.audioOrVideoBody.${isBasicPlan ? "basic" : "plus"}`);
|
|
177206
177210
|
}
|
|
177207
177211
|
}
|
|
177208
|
-
|
|
177212
|
+
conf2.notify({
|
|
177209
177213
|
variant: "warning",
|
|
177210
|
-
header:
|
|
177214
|
+
header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
|
|
177211
177215
|
body: errorBody,
|
|
177212
177216
|
button: isBasicPlan ? {
|
|
177213
|
-
text:
|
|
177214
|
-
onClick: () =>
|
|
177217
|
+
text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
|
|
177218
|
+
onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
|
|
177215
177219
|
} : undefined,
|
|
177216
177220
|
duration: 4000
|
|
177217
177221
|
});
|
|
177218
177222
|
} else if (response.status === 401) {
|
|
177219
|
-
|
|
177223
|
+
conf2.openModal("MEDIA_UNAVAILABLE_MODAL_ID");
|
|
177220
177224
|
} else if (response.status === 415) {
|
|
177221
|
-
|
|
177225
|
+
conf2.notify({
|
|
177222
177226
|
variant: "warning",
|
|
177223
|
-
header:
|
|
177224
|
-
body:
|
|
177227
|
+
header: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.header"),
|
|
177228
|
+
body: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.body"),
|
|
177225
177229
|
duration: 4000
|
|
177226
177230
|
});
|
|
177227
177231
|
} else {
|
|
177228
|
-
|
|
177232
|
+
conf2.notify({
|
|
177229
177233
|
variant: "error",
|
|
177230
|
-
header:
|
|
177231
|
-
body:
|
|
177234
|
+
header: conf2.i18n.t("toolsPanel.addMedia.unhandled.header"),
|
|
177235
|
+
body: conf2.i18n.t("toolsPanel.addMedia.unhandled.body"),
|
|
177232
177236
|
duration: 4000
|
|
177233
177237
|
});
|
|
177234
177238
|
}
|
|
@@ -177236,17 +177240,17 @@ var catchErrorResponse = async (response, mediaType) => {
|
|
|
177236
177240
|
};
|
|
177237
177241
|
var catchDuplicateErrorResponse = async (response) => {
|
|
177238
177242
|
if (response.status === 403) {
|
|
177239
|
-
|
|
177243
|
+
conf2.notify({
|
|
177240
177244
|
variant: "warning",
|
|
177241
|
-
header:
|
|
177242
|
-
body:
|
|
177245
|
+
header: conf2.i18n.t("toolsPanel.addMedia.limitReached.header"),
|
|
177246
|
+
body: conf2.i18n.t("toolsPanel.addMedia.limitReached.duplicateBody"),
|
|
177243
177247
|
duration: 4000
|
|
177244
177248
|
});
|
|
177245
177249
|
} else {
|
|
177246
|
-
|
|
177250
|
+
conf2.notify({
|
|
177247
177251
|
variant: "error",
|
|
177248
|
-
header:
|
|
177249
|
-
body:
|
|
177252
|
+
header: conf2.i18n.t("toolsPanel.addMedia.unhandled.header"),
|
|
177253
|
+
body: conf2.i18n.t("toolsPanel.addMedia.unhandled.body"),
|
|
177250
177254
|
duration: 4000
|
|
177251
177255
|
});
|
|
177252
177256
|
}
|
|
@@ -177254,40 +177258,40 @@ var catchDuplicateErrorResponse = async (response) => {
|
|
|
177254
177258
|
};
|
|
177255
177259
|
var validateMediaFile = (file, account2) => {
|
|
177256
177260
|
const fileExtension = file.name.split(".").pop()?.toLowerCase() || "";
|
|
177257
|
-
if (!file.type.startsWith("image") && !
|
|
177258
|
-
|
|
177261
|
+
if (!file.type.startsWith("image") && !conf2.AUDIO_FORMATS.includes(fileExtension) && !conf2.VIDEO_FORMATS.includes(fileExtension)) {
|
|
177262
|
+
conf2.notify({
|
|
177259
177263
|
variant: "warning",
|
|
177260
|
-
header:
|
|
177261
|
-
body:
|
|
177264
|
+
header: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.header"),
|
|
177265
|
+
body: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.body"),
|
|
177262
177266
|
duration: 4000
|
|
177263
177267
|
});
|
|
177264
177268
|
return false;
|
|
177265
177269
|
}
|
|
177266
177270
|
const isBasicPlan = account2.billingInfo?.plan.name === "basic";
|
|
177267
|
-
let errorBody =
|
|
177268
|
-
if (
|
|
177269
|
-
errorBody =
|
|
177271
|
+
let errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.imageBody.${isBasicPlan ? "basic" : "plus"}`);
|
|
177272
|
+
if (conf2.AUDIO_FORMATS.includes(fileExtension) || conf2.VIDEO_FORMATS.includes(fileExtension)) {
|
|
177273
|
+
errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.audioOrVideoBody.${isBasicPlan ? "basic" : "plus"}`);
|
|
177270
177274
|
if (file.size / 1024 ** 2 > (account2.billingInfo?.storage.maxMediaSize || Infinity)) {
|
|
177271
|
-
|
|
177275
|
+
conf2.notify({
|
|
177272
177276
|
variant: "warning",
|
|
177273
|
-
header:
|
|
177277
|
+
header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
|
|
177274
177278
|
body: errorBody,
|
|
177275
177279
|
button: isBasicPlan ? {
|
|
177276
|
-
text:
|
|
177277
|
-
onClick: () =>
|
|
177280
|
+
text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
|
|
177281
|
+
onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
|
|
177278
177282
|
} : undefined,
|
|
177279
177283
|
duration: 4000
|
|
177280
177284
|
});
|
|
177281
177285
|
return false;
|
|
177282
177286
|
}
|
|
177283
177287
|
} else if (file.size / 1024 ** 2 > (account2.billingInfo?.storage.maxImageSize || Infinity)) {
|
|
177284
|
-
|
|
177288
|
+
conf2.notify({
|
|
177285
177289
|
variant: "warning",
|
|
177286
|
-
header:
|
|
177290
|
+
header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
|
|
177287
177291
|
body: errorBody,
|
|
177288
177292
|
button: isBasicPlan ? {
|
|
177289
|
-
text:
|
|
177290
|
-
onClick: () =>
|
|
177293
|
+
text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
|
|
177294
|
+
onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
|
|
177291
177295
|
} : undefined,
|
|
177292
177296
|
duration: 4000
|
|
177293
177297
|
});
|
|
@@ -177366,7 +177370,7 @@ var resizeAndConvertToPng = async (inp) => {
|
|
|
177366
177370
|
};
|
|
177367
177371
|
if (base64String.startsWith("data:image/svg+xml")) {
|
|
177368
177372
|
image2.onload = async () => {
|
|
177369
|
-
const parser =
|
|
177373
|
+
const parser = conf2.getDOMParser();
|
|
177370
177374
|
const svgDoc = parser.parseFromString(atob(base64String.split(",")[1]), "image/svg+xml");
|
|
177371
177375
|
const svgElement = svgDoc.documentElement;
|
|
177372
177376
|
svgElement.removeAttribute("width");
|
|
@@ -177597,8 +177601,8 @@ class AudioItem extends Mbr {
|
|
|
177597
177601
|
this.subject.publish(this);
|
|
177598
177602
|
});
|
|
177599
177603
|
this.transformation.subject.subscribe(this.onTransform);
|
|
177600
|
-
this.right = this.left +
|
|
177601
|
-
this.bottom = this.top +
|
|
177604
|
+
this.right = this.left + conf2.AUDIO_DIMENSIONS.width;
|
|
177605
|
+
this.bottom = this.top + conf2.AUDIO_DIMENSIONS.height;
|
|
177602
177606
|
}
|
|
177603
177607
|
setCurrentTime(time) {
|
|
177604
177608
|
this.currentTime = time;
|
|
@@ -177665,8 +177669,8 @@ class AudioItem extends Mbr {
|
|
|
177665
177669
|
const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
|
|
177666
177670
|
this.left = translateX;
|
|
177667
177671
|
this.top = translateY;
|
|
177668
|
-
this.right = this.left +
|
|
177669
|
-
this.bottom = this.top +
|
|
177672
|
+
this.right = this.left + conf2.AUDIO_DIMENSIONS.width * scaleX;
|
|
177673
|
+
this.bottom = this.top + conf2.AUDIO_DIMENSIONS.height * scaleY;
|
|
177670
177674
|
}
|
|
177671
177675
|
render(context) {
|
|
177672
177676
|
if (this.transformationRenderBlock) {
|
|
@@ -177695,8 +177699,8 @@ class AudioItem extends Mbr {
|
|
|
177695
177699
|
const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
|
|
177696
177700
|
const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
|
|
177697
177701
|
div.id = this.getId();
|
|
177698
|
-
div.style.width = `${
|
|
177699
|
-
div.style.height = `${
|
|
177702
|
+
div.style.width = `${conf2.AUDIO_DIMENSIONS.width}px`;
|
|
177703
|
+
div.style.height = `${conf2.AUDIO_DIMENSIONS.height}px`;
|
|
177700
177704
|
div.style.transformOrigin = "top left";
|
|
177701
177705
|
div.style.transform = transform;
|
|
177702
177706
|
div.style.position = "absolute";
|
|
@@ -177815,7 +177819,7 @@ class AudioItem extends Mbr {
|
|
|
177815
177819
|
}
|
|
177816
177820
|
download() {
|
|
177817
177821
|
if (this.extension) {
|
|
177818
|
-
const linkElem =
|
|
177822
|
+
const linkElem = conf2.documentFactory.createElement("a");
|
|
177819
177823
|
linkElem.href = this.url;
|
|
177820
177824
|
linkElem.setAttribute("download", `${this.board.getBoardId()}.${this.extension}`);
|
|
177821
177825
|
linkElem.click();
|
|
@@ -178217,7 +178221,7 @@ class ImageCommand {
|
|
|
178217
178221
|
|
|
178218
178222
|
// src/Items/Image/Image.ts
|
|
178219
178223
|
function getPlaceholderImage(board, imageDimension) {
|
|
178220
|
-
const placeholderCanvas =
|
|
178224
|
+
const placeholderCanvas = conf2.documentFactory.createElement("canvas");
|
|
178221
178225
|
const placeholderContext = placeholderCanvas.getContext("2d");
|
|
178222
178226
|
const context = new DrawingContext(board.camera, placeholderContext);
|
|
178223
178227
|
const placeholder = new Placeholder;
|
|
@@ -178568,7 +178572,7 @@ class Drawing extends Mbr {
|
|
|
178568
178572
|
itemType = "Drawing";
|
|
178569
178573
|
parent = "Board";
|
|
178570
178574
|
transformation;
|
|
178571
|
-
path2d = new
|
|
178575
|
+
path2d = new conf2.path2DFactory;
|
|
178572
178576
|
subject = new Subject;
|
|
178573
178577
|
untransformedMbr = new Mbr;
|
|
178574
178578
|
lines = [];
|
|
@@ -178645,7 +178649,7 @@ class Drawing extends Mbr {
|
|
|
178645
178649
|
this.bottom = mbr.bottom;
|
|
178646
178650
|
}
|
|
178647
178651
|
updatePath2d() {
|
|
178648
|
-
this.path2d = new
|
|
178652
|
+
this.path2d = new conf2.path2DFactory;
|
|
178649
178653
|
const context = this.path2d;
|
|
178650
178654
|
const points = this.points;
|
|
178651
178655
|
if (points.length < 3) {
|
|
@@ -179817,9 +179821,9 @@ class Camera {
|
|
|
179817
179821
|
matrix = new Matrix2;
|
|
179818
179822
|
pointer = new Point;
|
|
179819
179823
|
window = {
|
|
179820
|
-
width:
|
|
179821
|
-
height:
|
|
179822
|
-
dpi:
|
|
179824
|
+
width: conf2.getDocumentWidth(),
|
|
179825
|
+
height: conf2.getDocumentHeight(),
|
|
179826
|
+
dpi: conf2.getDPI(),
|
|
179823
179827
|
getMbr: () => {
|
|
179824
179828
|
return new Mbr(0, 0, this.window.width, this.window.height);
|
|
179825
179829
|
}
|
|
@@ -180195,9 +180199,9 @@ class Camera {
|
|
|
180195
180199
|
this.updateBoardPointer();
|
|
180196
180200
|
}
|
|
180197
180201
|
onWindowResize() {
|
|
180198
|
-
this.window.width =
|
|
180199
|
-
this.window.height =
|
|
180200
|
-
this.window.dpi =
|
|
180202
|
+
this.window.width = conf2.getDocumentWidth();
|
|
180203
|
+
this.window.height = conf2.getDocumentHeight();
|
|
180204
|
+
this.window.dpi = conf2.getDPI();
|
|
180201
180205
|
this.resizeSubject.publish(this);
|
|
180202
180206
|
this.subject.publish(this);
|
|
180203
180207
|
}
|
|
@@ -180210,10 +180214,10 @@ class Camera {
|
|
|
180210
180214
|
let y = 0;
|
|
180211
180215
|
const { activeKeys } = keyboard;
|
|
180212
180216
|
const directions = {
|
|
180213
|
-
ArrowRight: [-
|
|
180214
|
-
ArrowLeft: [
|
|
180215
|
-
ArrowDown: [0, -
|
|
180216
|
-
ArrowUp: [0,
|
|
180217
|
+
ArrowRight: [-conf2.NAVIGATION_STEP, 0],
|
|
180218
|
+
ArrowLeft: [conf2.NAVIGATION_STEP, 0],
|
|
180219
|
+
ArrowDown: [0, -conf2.NAVIGATION_STEP],
|
|
180220
|
+
ArrowUp: [0, conf2.NAVIGATION_STEP]
|
|
180217
180221
|
};
|
|
180218
180222
|
const activeArrowKeys = Array.from(activeKeys).filter((key) => (key in directions)).sort();
|
|
180219
180223
|
if (activeArrowKeys.length === 2) {
|
|
@@ -180746,7 +180750,7 @@ var isMacos = () => navigator.platform.toUpperCase().includes("MAC");
|
|
|
180746
180750
|
|
|
180747
180751
|
// src/Keyboard/logHotkey.ts
|
|
180748
180752
|
function logHotkey(hotkeyConfig, hotkeyName, status, context) {
|
|
180749
|
-
if (!
|
|
180753
|
+
if (!conf.LOG_HOTKEYS) {
|
|
180750
180754
|
return;
|
|
180751
180755
|
}
|
|
180752
180756
|
const isFunction = typeof hotkeyConfig === "function";
|
|
@@ -180838,7 +180842,7 @@ function checkHotkeys(hotkeyMap, event, board) {
|
|
|
180838
180842
|
// src/Keyboard/getHotkeyLabel.ts
|
|
180839
180843
|
function getHotkeyLabel(hotkey) {
|
|
180840
180844
|
const hotkeyLabel = hotkeys_default[hotkey].label;
|
|
180841
|
-
switch (
|
|
180845
|
+
switch (conf2.FORCE_HOTKEYS || "auto") {
|
|
180842
180846
|
case "windows":
|
|
180843
180847
|
return hotkeyLabel.windows;
|
|
180844
180848
|
case "macos":
|
|
@@ -182748,7 +182752,7 @@ class SpatialIndex {
|
|
|
182748
182752
|
this.itemsArray.push(item);
|
|
182749
182753
|
this.itemsIndex.insert(item);
|
|
182750
182754
|
}
|
|
182751
|
-
if (
|
|
182755
|
+
if (conf2.isNode()) {
|
|
182752
182756
|
return;
|
|
182753
182757
|
}
|
|
182754
182758
|
if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
|
|
@@ -183315,8 +183319,8 @@ class Tool {
|
|
|
183315
183319
|
|
|
183316
183320
|
// src/Tools/ExportSnapshot/getDecorationResizeType.ts
|
|
183317
183321
|
function getDecorationResizeType(point5, mbr, tolerance = 10) {
|
|
183318
|
-
for (const key in
|
|
183319
|
-
const decoration =
|
|
183322
|
+
for (const key in conf2.EXPORT_FRAME_DECORATIONS) {
|
|
183323
|
+
const decoration = conf2.EXPORT_FRAME_DECORATIONS[key];
|
|
183320
183324
|
const decorationBounds = {
|
|
183321
183325
|
left: mbr.left + (decoration.offsetX ?? 0),
|
|
183322
183326
|
top: mbr.top + (decoration.offsetY ?? 0),
|
|
@@ -183357,7 +183361,7 @@ class ExportSnapshot extends Tool {
|
|
|
183357
183361
|
super();
|
|
183358
183362
|
this.board = board;
|
|
183359
183363
|
const cameraCenter = this.board.camera.getMbr().getCenter();
|
|
183360
|
-
this.mbr = new Mbr(cameraCenter.x -
|
|
183364
|
+
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);
|
|
183361
183365
|
this.board.selection.disable();
|
|
183362
183366
|
this.tempDrawingContext = new DrawingContext(board.camera, this.tempCtx);
|
|
183363
183367
|
}
|
|
@@ -183369,11 +183373,11 @@ class ExportSnapshot extends Tool {
|
|
|
183369
183373
|
resize() {
|
|
183370
183374
|
if (this.resizeType && this.mbr && this.oppositePoint) {
|
|
183371
183375
|
const resize = getResize(this.resizeType, this.board.pointer.point, this.mbr, this.oppositePoint);
|
|
183372
|
-
if (resize.mbr.getWidth() >
|
|
183376
|
+
if (resize.mbr.getWidth() > conf2.EXPORT_MIN_WIDTH) {
|
|
183373
183377
|
this.mbr.left = resize.mbr.left;
|
|
183374
183378
|
this.mbr.right = resize.mbr.right;
|
|
183375
183379
|
}
|
|
183376
|
-
if (resize.mbr.getHeight() >
|
|
183380
|
+
if (resize.mbr.getHeight() > conf2.EXPORT_MIN_HEIGHT) {
|
|
183377
183381
|
this.mbr.top = resize.mbr.top;
|
|
183378
183382
|
this.mbr.bottom = resize.mbr.bottom;
|
|
183379
183383
|
}
|
|
@@ -183462,7 +183466,7 @@ class ExportSnapshot extends Tool {
|
|
|
183462
183466
|
}
|
|
183463
183467
|
const res = await exportBoardSnapshot({
|
|
183464
183468
|
board: this.board,
|
|
183465
|
-
bgColor:
|
|
183469
|
+
bgColor: conf2.CANVAS_BG_COLOR,
|
|
183466
183470
|
selection: this.mbr,
|
|
183467
183471
|
upscaleTo: 4000,
|
|
183468
183472
|
nameToExport: this.board.getName()
|
|
@@ -183486,18 +183490,18 @@ class ExportSnapshot extends Tool {
|
|
|
183486
183490
|
const cameraMbr = context.camera.getMbr();
|
|
183487
183491
|
this.tempDrawingContext.setCamera(this.board.camera);
|
|
183488
183492
|
this.tempDrawingContext.clear();
|
|
183489
|
-
cameraMbr.backgroundColor =
|
|
183493
|
+
cameraMbr.backgroundColor = conf2.EXPORT_BLUR_BACKGROUND_COLOR;
|
|
183490
183494
|
cameraMbr.strokeWidth = 0;
|
|
183491
183495
|
cameraMbr.render(this.tempDrawingContext);
|
|
183492
183496
|
this.tempCtx.clearRect(this.mbr.left, this.mbr.top, this.mbr.getWidth(), this.mbr.getHeight());
|
|
183493
|
-
if (
|
|
183494
|
-
const topLeft =
|
|
183497
|
+
if (conf2.EXPORT_FRAME_DECORATIONS) {
|
|
183498
|
+
const topLeft = conf2.EXPORT_FRAME_DECORATIONS["top-left"];
|
|
183495
183499
|
this.renderDecoration(this.tempDrawingContext, topLeft.path, this.mbr.left + (topLeft.offsetX ?? 0), this.mbr.top + (topLeft.offsetY ?? 0), topLeft.color, topLeft.lineWidth);
|
|
183496
|
-
const topRight =
|
|
183500
|
+
const topRight = conf2.EXPORT_FRAME_DECORATIONS["top-right"];
|
|
183497
183501
|
this.renderDecoration(this.tempDrawingContext, topRight.path, this.mbr.right + (topRight.offsetX ?? 0), this.mbr.top + (topRight.offsetY ?? 0), topRight.color, topRight.lineWidth);
|
|
183498
|
-
const bottomLeft =
|
|
183502
|
+
const bottomLeft = conf2.EXPORT_FRAME_DECORATIONS["bottom-left"];
|
|
183499
183503
|
this.renderDecoration(this.tempDrawingContext, bottomLeft.path, this.mbr.left + (bottomLeft.offsetX ?? 0), this.mbr.bottom + (bottomLeft.offsetY ?? 0), bottomLeft.color, bottomLeft.lineWidth);
|
|
183500
|
-
const bottomRight =
|
|
183504
|
+
const bottomRight = conf2.EXPORT_FRAME_DECORATIONS["bottom-right"];
|
|
183501
183505
|
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);
|
|
183502
183506
|
}
|
|
183503
183507
|
}
|
|
@@ -184006,14 +184010,14 @@ class AddConnector extends BoardTool {
|
|
|
184006
184010
|
class AddDrawing extends BoardTool {
|
|
184007
184011
|
drawing = null;
|
|
184008
184012
|
isDown = false;
|
|
184009
|
-
strokeWidth =
|
|
184010
|
-
strokeColor =
|
|
184011
|
-
strokeStyle =
|
|
184013
|
+
strokeWidth = conf2.PEN_INITIAL_STROKE_WIDTH;
|
|
184014
|
+
strokeColor = conf2.PEN_DEFAULT_COLOR;
|
|
184015
|
+
strokeStyle = conf2.PEN_STROKE_STYLE;
|
|
184012
184016
|
constructor(board) {
|
|
184013
184017
|
super(board);
|
|
184014
184018
|
this.setCursor();
|
|
184015
|
-
if (
|
|
184016
|
-
const drawingSettings = localStorage.getItem(
|
|
184019
|
+
if (conf2.PEN_SETTINGS_KEY) {
|
|
184020
|
+
const drawingSettings = localStorage.getItem(conf2.PEN_SETTINGS_KEY);
|
|
184017
184021
|
if (drawingSettings) {
|
|
184018
184022
|
const { strokeWidth, strokeColor, strokeStyle } = JSON.parse(drawingSettings);
|
|
184019
184023
|
this.strokeWidth = strokeWidth;
|
|
@@ -184023,7 +184027,7 @@ class AddDrawing extends BoardTool {
|
|
|
184023
184027
|
}
|
|
184024
184028
|
}
|
|
184025
184029
|
updateSettings() {
|
|
184026
|
-
localStorage.setItem(
|
|
184030
|
+
localStorage.setItem(conf2.PEN_SETTINGS_KEY, JSON.stringify({
|
|
184027
184031
|
strokeWidth: this.strokeWidth,
|
|
184028
184032
|
strokeColor: this.strokeColor,
|
|
184029
184033
|
strokeStyle: this.strokeStyle
|
|
@@ -184053,7 +184057,7 @@ class AddDrawing extends BoardTool {
|
|
|
184053
184057
|
ctx.beginPath();
|
|
184054
184058
|
ctx.arc(point5.x, point5.y, this.strokeWidth / 2, 0, 2 * Math.PI, false);
|
|
184055
184059
|
ctx.lineWidth = 1;
|
|
184056
|
-
ctx.strokeStyle =
|
|
184060
|
+
ctx.strokeStyle = conf2.PEN_POINTER_CIRCLE_COLOR;
|
|
184057
184061
|
ctx.stroke();
|
|
184058
184062
|
}
|
|
184059
184063
|
setCursor() {
|
|
@@ -184135,7 +184139,7 @@ class AddDrawing extends BoardTool {
|
|
|
184135
184139
|
this.setCursor();
|
|
184136
184140
|
};
|
|
184137
184141
|
render(context) {
|
|
184138
|
-
if (
|
|
184142
|
+
if (conf2.PEN_RENDER_POINTER_CIRCLE) {
|
|
184139
184143
|
this.renderPointerCircle(this.board.pointer.point, context);
|
|
184140
184144
|
}
|
|
184141
184145
|
if (!this.drawing) {
|
|
@@ -184150,14 +184154,14 @@ class AddDrawing extends BoardTool {
|
|
|
184150
184154
|
}
|
|
184151
184155
|
// src/Tools/AddDrawing/AddHighlighter.ts
|
|
184152
184156
|
class AddHighlighter extends AddDrawing {
|
|
184153
|
-
strokeWidth =
|
|
184154
|
-
strokeColor =
|
|
184155
|
-
strokeStyle =
|
|
184157
|
+
strokeWidth = conf2.HIGHLIGHTER_INITIAL_STROKE_WIDTH;
|
|
184158
|
+
strokeColor = conf2.HIGHLIGHTER_DEFAULT_COLOR;
|
|
184159
|
+
strokeStyle = conf2.PEN_STROKE_STYLE;
|
|
184156
184160
|
constructor(board) {
|
|
184157
184161
|
super(board);
|
|
184158
184162
|
this.setCursor();
|
|
184159
|
-
if (
|
|
184160
|
-
const highlighterSettings = localStorage.getItem(
|
|
184163
|
+
if (conf2.HIGHLIGHTER_SETTINGS_KEY) {
|
|
184164
|
+
const highlighterSettings = localStorage.getItem(conf2.HIGHLIGHTER_SETTINGS_KEY);
|
|
184161
184165
|
if (highlighterSettings) {
|
|
184162
184166
|
const { strokeWidth, strokeColor, strokeStyle } = JSON.parse(highlighterSettings);
|
|
184163
184167
|
this.strokeWidth = strokeWidth;
|
|
@@ -184170,7 +184174,7 @@ class AddHighlighter extends AddDrawing {
|
|
|
184170
184174
|
return true;
|
|
184171
184175
|
}
|
|
184172
184176
|
updateSettings() {
|
|
184173
|
-
localStorage.setItem(
|
|
184177
|
+
localStorage.setItem(conf2.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
|
|
184174
184178
|
strokeWidth: this.strokeWidth,
|
|
184175
184179
|
strokeColor: this.strokeColor,
|
|
184176
184180
|
strokeStyle: this.strokeStyle
|
|
@@ -184494,7 +184498,7 @@ class AddShape extends BoardTool {
|
|
|
184494
184498
|
const point5 = this.board.pointer.point;
|
|
184495
184499
|
this.line = new Line(point5.copy(), point5.copy());
|
|
184496
184500
|
this.bounds = this.line.getMbr();
|
|
184497
|
-
this.bounds.borderColor =
|
|
184501
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
184498
184502
|
this.shape.apply({
|
|
184499
184503
|
class: "Shape",
|
|
184500
184504
|
method: "setShapeType",
|
|
@@ -184518,7 +184522,7 @@ class AddShape extends BoardTool {
|
|
|
184518
184522
|
}
|
|
184519
184523
|
this.line = new Line(startPoint, endPoint);
|
|
184520
184524
|
this.bounds = this.line.getMbr();
|
|
184521
|
-
this.bounds.borderColor =
|
|
184525
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
184522
184526
|
this.initTransformation();
|
|
184523
184527
|
this.board.tools.publish();
|
|
184524
184528
|
return true;
|
|
@@ -184590,7 +184594,7 @@ class AddShape extends BoardTool {
|
|
|
184590
184594
|
const y = (top + bottom) / 2 - 50;
|
|
184591
184595
|
this.bounds = new Mbr(x, y, x, y);
|
|
184592
184596
|
this.line = new Line(new Point(x, y), new Point(x, y));
|
|
184593
|
-
this.bounds.borderColor =
|
|
184597
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
184594
184598
|
this.shape.apply({
|
|
184595
184599
|
class: "Shape",
|
|
184596
184600
|
method: "setShapeType",
|
|
@@ -184623,8 +184627,8 @@ class AddSticker extends BoardTool {
|
|
|
184623
184627
|
this.setCursor(this.sticker.getBackgroundColor());
|
|
184624
184628
|
}
|
|
184625
184629
|
setCursor(color2) {
|
|
184626
|
-
if (
|
|
184627
|
-
const colorName = color2 ?
|
|
184630
|
+
if (conf2.STICKER_COLOR_NAMES) {
|
|
184631
|
+
const colorName = color2 ? conf2.STICKER_COLOR_NAMES[conf2.STICKER_COLORS.indexOf(color2)] : undefined;
|
|
184628
184632
|
this.board.pointer.setCursor(colorName ? `sticker-${colorName}` : "crosshair");
|
|
184629
184633
|
} else {
|
|
184630
184634
|
this.board.pointer.setCursor("crosshair");
|
|
@@ -184648,7 +184652,7 @@ class AddSticker extends BoardTool {
|
|
|
184648
184652
|
const point5 = this.board.pointer.point;
|
|
184649
184653
|
this.line = new Line(point5.copy(), point5.copy());
|
|
184650
184654
|
this.bounds = this.line.getMbr();
|
|
184651
|
-
this.bounds.borderColor =
|
|
184655
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
184652
184656
|
this.board.tools.publish();
|
|
184653
184657
|
return true;
|
|
184654
184658
|
}
|
|
@@ -184657,7 +184661,7 @@ class AddSticker extends BoardTool {
|
|
|
184657
184661
|
this.line = new Line(this.line.start.copy(), this.board.pointer.point.copy());
|
|
184658
184662
|
this.sticker.applyDiagonal(this.line);
|
|
184659
184663
|
this.bounds = this.sticker.getMbr();
|
|
184660
|
-
this.bounds.borderColor =
|
|
184664
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
184661
184665
|
this.board.tools.publish();
|
|
184662
184666
|
return true;
|
|
184663
184667
|
}
|
|
@@ -184757,7 +184761,7 @@ class AddText extends BoardTool {
|
|
|
184757
184761
|
const point5 = this.board.pointer.point;
|
|
184758
184762
|
this.line = new Line(point5.copy(), point5.copy());
|
|
184759
184763
|
this.bounds = this.line.getMbr();
|
|
184760
|
-
this.bounds.borderColor =
|
|
184764
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
184761
184765
|
this.board.tools.publish();
|
|
184762
184766
|
return true;
|
|
184763
184767
|
}
|
|
@@ -184768,7 +184772,7 @@ class AddText extends BoardTool {
|
|
|
184768
184772
|
const end = new Point(cursorPoint.x, start.y + height2);
|
|
184769
184773
|
this.line = new Line(start, end);
|
|
184770
184774
|
this.bounds = this.line.getMbr();
|
|
184771
|
-
this.bounds.borderColor =
|
|
184775
|
+
this.bounds.borderColor = conf2.SELECTION_COLOR;
|
|
184772
184776
|
this.board.tools.publish();
|
|
184773
184777
|
return true;
|
|
184774
184778
|
}
|
|
@@ -184833,11 +184837,11 @@ class AddText extends BoardTool {
|
|
|
184833
184837
|
class Eraser extends BoardTool {
|
|
184834
184838
|
itemType = "Eraser";
|
|
184835
184839
|
isDown = false;
|
|
184836
|
-
strokeWidth =
|
|
184837
|
-
strokeColor =
|
|
184838
|
-
strokeStyle =
|
|
184840
|
+
strokeWidth = conf2.ERASER_STROKE_WIDTH;
|
|
184841
|
+
strokeColor = conf2.ERASER_DEFAULT_COLOR;
|
|
184842
|
+
strokeStyle = conf2.PEN_STROKE_STYLE;
|
|
184839
184843
|
drawing = new Drawing(this.board, []);
|
|
184840
|
-
maxPointsInLine =
|
|
184844
|
+
maxPointsInLine = conf2.ERASER_MAX_LINE_LENGTH;
|
|
184841
184845
|
constructor(board) {
|
|
184842
184846
|
super(board);
|
|
184843
184847
|
this.setCursor();
|
|
@@ -184999,7 +185003,7 @@ function createCanvasDrawer(board) {
|
|
|
184999
185003
|
borderDiv.id = "canvasBorder";
|
|
185000
185004
|
borderDiv.style.position = "absolute";
|
|
185001
185005
|
borderDiv.style.transformOrigin = "left top";
|
|
185002
|
-
borderDiv.style.border = `1px solid ${
|
|
185006
|
+
borderDiv.style.border = `1px solid ${conf2.SELECTION_COLOR}`;
|
|
185003
185007
|
borderDiv.style.boxSizing = "border-box";
|
|
185004
185008
|
borderDiv.style.left = `${leftOffset}px`;
|
|
185005
185009
|
borderDiv.style.top = `${topOffset}px`;
|
|
@@ -185009,7 +185013,7 @@ function createCanvasDrawer(board) {
|
|
|
185009
185013
|
canvas.style.boxSizing = "border-box";
|
|
185010
185014
|
container.appendChild(borderDiv);
|
|
185011
185015
|
} else {
|
|
185012
|
-
canvas.style.border = `1px solid ${
|
|
185016
|
+
canvas.style.border = `1px solid ${conf2.SELECTION_COLOR}`;
|
|
185013
185017
|
canvas.style.boxSizing = "border-box";
|
|
185014
185018
|
}
|
|
185015
185019
|
const createAnchorDiv = (left, top, radius) => {
|
|
@@ -185017,8 +185021,8 @@ function createCanvasDrawer(board) {
|
|
|
185017
185021
|
anchorDiv.style.position = "absolute";
|
|
185018
185022
|
anchorDiv.style.width = `${2 * radius}px`;
|
|
185019
185023
|
anchorDiv.style.height = `${2 * radius}px`;
|
|
185020
|
-
anchorDiv.style.backgroundColor = `${
|
|
185021
|
-
anchorDiv.style.border = `${
|
|
185024
|
+
anchorDiv.style.backgroundColor = `${conf2.SELECTION_ANCHOR_COLOR}`;
|
|
185025
|
+
anchorDiv.style.border = `${conf2.SELECTION_ANCHOR_WIDTH}px solid ${conf2.SELECTION_COLOR}`;
|
|
185022
185026
|
anchorDiv.style.borderRadius = "2px";
|
|
185023
185027
|
anchorDiv.style.left = `calc(${left} - ${radius}px)`;
|
|
185024
185028
|
anchorDiv.style.top = `calc(${top} - ${radius}px)`;
|
|
@@ -185026,10 +185030,10 @@ function createCanvasDrawer(board) {
|
|
|
185026
185030
|
return anchorDiv;
|
|
185027
185031
|
};
|
|
185028
185032
|
const anchors = [
|
|
185029
|
-
createAnchorDiv("0%", "0%",
|
|
185030
|
-
createAnchorDiv("100% + 1px", "0%",
|
|
185031
|
-
createAnchorDiv("0%", "100% + 1px",
|
|
185032
|
-
createAnchorDiv("100% + 1px", "100% + 1px",
|
|
185033
|
+
createAnchorDiv("0%", "0%", conf2.SELECTION_ANCHOR_RADIUS),
|
|
185034
|
+
createAnchorDiv("100% + 1px", "0%", conf2.SELECTION_ANCHOR_RADIUS),
|
|
185035
|
+
createAnchorDiv("0%", "100% + 1px", conf2.SELECTION_ANCHOR_RADIUS),
|
|
185036
|
+
createAnchorDiv("100% + 1px", "100% + 1px", conf2.SELECTION_ANCHOR_RADIUS)
|
|
185033
185037
|
];
|
|
185034
185038
|
const canvasBorder = Array.from(container.children).find((child) => child.id === "canvasBorder");
|
|
185035
185039
|
for (const anchor of anchors) {
|
|
@@ -186371,8 +186375,8 @@ class Select extends Tool {
|
|
|
186371
186375
|
const { x, y } = pointer.point;
|
|
186372
186376
|
this.line = new Line(new Point(x, y), new Point(x, y));
|
|
186373
186377
|
this.rect = this.line.getMbr();
|
|
186374
|
-
this.rect.borderColor =
|
|
186375
|
-
this.rect.backgroundColor =
|
|
186378
|
+
this.rect.borderColor = conf2.SELECTION_COLOR;
|
|
186379
|
+
this.rect.backgroundColor = conf2.SELECTION_BACKGROUND;
|
|
186376
186380
|
this.board.tools.publish();
|
|
186377
186381
|
this.board.presence.throttledEmit({
|
|
186378
186382
|
method: "DrawSelect",
|
|
@@ -186457,8 +186461,8 @@ class Select extends Tool {
|
|
|
186457
186461
|
const point5 = this.board.pointer.point.copy();
|
|
186458
186462
|
this.line = new Line(this.line.start, point5);
|
|
186459
186463
|
this.rect = this.line.getMbr();
|
|
186460
|
-
this.rect.borderColor =
|
|
186461
|
-
this.rect.backgroundColor =
|
|
186464
|
+
this.rect.borderColor = conf2.SELECTION_COLOR;
|
|
186465
|
+
this.rect.backgroundColor = conf2.SELECTION_BACKGROUND;
|
|
186462
186466
|
this.board.tools.publish();
|
|
186463
186467
|
this.board.presence.throttledEmit({
|
|
186464
186468
|
method: "DrawSelect",
|
|
@@ -187592,7 +187596,7 @@ class Board {
|
|
|
187592
187596
|
const loadLinksImagesScript = LOAD_LINKS_IMAGES_JS;
|
|
187593
187597
|
const css = INDEX_CSS;
|
|
187594
187598
|
const boardName = this.getName() || this.getBoardId();
|
|
187595
|
-
const items = this.items.getWholeHTML(
|
|
187599
|
+
const items = this.items.getWholeHTML(conf2.documentFactory);
|
|
187596
187600
|
const itemsDiv = `<div id="items">${items}</div>`;
|
|
187597
187601
|
const scripts = `
|
|
187598
187602
|
<script type="module">${customTagsScript}</script>
|
|
@@ -187632,7 +187636,7 @@ class Board {
|
|
|
187632
187636
|
return `${head}${body}`;
|
|
187633
187637
|
}
|
|
187634
187638
|
deserializeHTMLAndEmit(stringedHTML) {
|
|
187635
|
-
const parser =
|
|
187639
|
+
const parser = conf2.getDOMParser();
|
|
187636
187640
|
const doc = parser.parseFromString(stringedHTML, "text/html");
|
|
187637
187641
|
const items = doc.body.querySelector("#items");
|
|
187638
187642
|
if (items) {
|
|
@@ -187684,7 +187688,7 @@ class Board {
|
|
|
187684
187688
|
return [];
|
|
187685
187689
|
}
|
|
187686
187690
|
deserializeHTML(stringedHTML) {
|
|
187687
|
-
const parser =
|
|
187691
|
+
const parser = conf2.getDOMParser();
|
|
187688
187692
|
const doc = parser.parseFromString(stringedHTML, "text/html");
|
|
187689
187693
|
const itemsDiv = doc.body.querySelector("#items");
|
|
187690
187694
|
if (!itemsDiv) {
|
|
@@ -188246,7 +188250,7 @@ class RichTextCommand {
|
|
|
188246
188250
|
item: id,
|
|
188247
188251
|
operation: {
|
|
188248
188252
|
...this.operation,
|
|
188249
|
-
fontColor: this.board.items.getById(id)?.getRichText()?.getFontColor() ||
|
|
188253
|
+
fontColor: this.board.items.getById(id)?.getRichText()?.getFontColor() || conf2.DEFAULT_TEXT_STYLES.fontColor
|
|
188250
188254
|
}
|
|
188251
188255
|
}));
|
|
188252
188256
|
case "setBlockType":
|
|
@@ -188270,7 +188274,7 @@ class RichTextCommand {
|
|
|
188270
188274
|
item: id,
|
|
188271
188275
|
operation: {
|
|
188272
188276
|
...this.operation,
|
|
188273
|
-
fontFamily: this.board.items.getById(id)?.getRichText()?.getFontFamily() ||
|
|
188277
|
+
fontFamily: this.board.items.getById(id)?.getRichText()?.getFontFamily() || conf2.DEFAULT_TEXT_STYLES.fontFamily
|
|
188274
188278
|
}
|
|
188275
188279
|
}));
|
|
188276
188280
|
case "setFontSize":
|
|
@@ -188278,7 +188282,7 @@ class RichTextCommand {
|
|
|
188278
188282
|
item: id,
|
|
188279
188283
|
operation: {
|
|
188280
188284
|
...this.operation,
|
|
188281
|
-
fontSize: this.board.items.getById(id)?.getRichText()?.getFontSize() ||
|
|
188285
|
+
fontSize: this.board.items.getById(id)?.getRichText()?.getFontSize() || conf2.DEFAULT_TEXT_STYLES.fontSize
|
|
188282
188286
|
}
|
|
188283
188287
|
}));
|
|
188284
188288
|
case "setFontHighlight":
|
|
@@ -188286,7 +188290,7 @@ class RichTextCommand {
|
|
|
188286
188290
|
item: id,
|
|
188287
188291
|
operation: {
|
|
188288
188292
|
...this.operation,
|
|
188289
|
-
fontHighlight: this.board.items.getById(id)?.getRichText()?.getFontHighlight() ||
|
|
188293
|
+
fontHighlight: this.board.items.getById(id)?.getRichText()?.getFontHighlight() || conf2.DEFAULT_TEXT_STYLES.fontHighlight
|
|
188290
188294
|
}
|
|
188291
188295
|
}));
|
|
188292
188296
|
case "setHorisontalAlignment":
|
|
@@ -189627,7 +189631,7 @@ class Transformer extends Tool {
|
|
|
189627
189631
|
const isLockedItems = this.selection.getIsLockedSelection();
|
|
189628
189632
|
if (mbr) {
|
|
189629
189633
|
mbr.strokeWidth = 1 / context.matrix.scaleX;
|
|
189630
|
-
const selectionColor = isLockedItems ?
|
|
189634
|
+
const selectionColor = isLockedItems ? conf2.SELECTION_LOCKED_COLOR : conf2.SELECTION_COLOR;
|
|
189631
189635
|
mbr.borderColor = selectionColor;
|
|
189632
189636
|
mbr.render(context);
|
|
189633
189637
|
}
|
|
@@ -189653,7 +189657,7 @@ class Transformer extends Tool {
|
|
|
189653
189657
|
new Point(right, bottom)
|
|
189654
189658
|
];
|
|
189655
189659
|
for (const point5 of points) {
|
|
189656
|
-
const circle = new Anchor(point5.x, point5.y,
|
|
189660
|
+
const circle = new Anchor(point5.x, point5.y, conf2.SELECTION_ANCHOR_RADIUS, conf2.SELECTION_COLOR, conf2.SELECTION_ANCHOR_COLOR, conf2.SELECTION_ANCHOR_WIDTH);
|
|
189657
189661
|
anchors.push(circle);
|
|
189658
189662
|
}
|
|
189659
189663
|
}
|
|
@@ -190857,7 +190861,7 @@ class Selection2 {
|
|
|
190857
190861
|
renderItemMbr(context, item, customScale) {
|
|
190858
190862
|
const mbr = item.getMbr();
|
|
190859
190863
|
mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
|
|
190860
|
-
const selectionColor = item.transformation.isLocked ?
|
|
190864
|
+
const selectionColor = item.transformation.isLocked ? conf2.SELECTION_LOCKED_COLOR : conf2.SELECTION_COLOR;
|
|
190861
190865
|
mbr.borderColor = selectionColor;
|
|
190862
190866
|
mbr.render(context);
|
|
190863
190867
|
}
|
|
@@ -191725,19 +191729,19 @@ function removeNode_removeNode(confirmed, toTransform) {
|
|
|
191725
191729
|
var import_slate45 = __toESM(require_dist());
|
|
191726
191730
|
function splitNode_insertNode(confirmed, toTransform) {
|
|
191727
191731
|
const transformed = { ...toTransform };
|
|
191728
|
-
const
|
|
191732
|
+
const conf3 = confirmed.path;
|
|
191729
191733
|
const path = transformed.path;
|
|
191730
|
-
if (import_slate45.Path.equals(
|
|
191734
|
+
if (import_slate45.Path.equals(conf3, path)) {
|
|
191731
191735
|
return transformed;
|
|
191732
191736
|
}
|
|
191733
|
-
const isDescendant = path.length >
|
|
191737
|
+
const isDescendant = path.length > conf3.length && path.slice(0, conf3.length).every((seg, i) => seg === conf3[i]);
|
|
191734
191738
|
if (isDescendant) {
|
|
191735
191739
|
const newPath = [...path];
|
|
191736
191740
|
newPath[0] = newPath[0] + 1;
|
|
191737
191741
|
transformed.path = newPath;
|
|
191738
191742
|
return transformed;
|
|
191739
191743
|
}
|
|
191740
|
-
if (import_slate45.Path.isBefore(
|
|
191744
|
+
if (import_slate45.Path.isBefore(conf3, path)) {
|
|
191741
191745
|
transformPath(confirmed, transformed);
|
|
191742
191746
|
}
|
|
191743
191747
|
return transformed;
|
|
@@ -191747,23 +191751,23 @@ function splitNode_insertNode(confirmed, toTransform) {
|
|
|
191747
191751
|
var import_slate46 = __toESM(require_dist());
|
|
191748
191752
|
function splitNode_removeNode(confirmed, toTransform) {
|
|
191749
191753
|
const transformed = { ...toTransform };
|
|
191750
|
-
const
|
|
191754
|
+
const conf3 = confirmed.path;
|
|
191751
191755
|
const path = transformed.path;
|
|
191752
|
-
if (import_slate46.Path.equals(
|
|
191756
|
+
if (import_slate46.Path.equals(conf3, path)) {
|
|
191753
191757
|
return transformed;
|
|
191754
191758
|
}
|
|
191755
|
-
if (path.length ===
|
|
191759
|
+
if (path.length === conf3.length + 1 && path.slice(0, conf3.length).every((seg, i) => seg === conf3[i])) {
|
|
191756
191760
|
const newPath = [...path];
|
|
191757
|
-
if (
|
|
191761
|
+
if (conf3.length === 1) {
|
|
191758
191762
|
newPath[0] = newPath[0] + 1;
|
|
191759
191763
|
} else {
|
|
191760
|
-
newPath[
|
|
191764
|
+
newPath[conf3.length] = newPath[conf3.length] + 1;
|
|
191761
191765
|
}
|
|
191762
191766
|
transformed.path = newPath;
|
|
191763
191767
|
return transformed;
|
|
191764
191768
|
}
|
|
191765
|
-
const isDescendant = path.length >
|
|
191766
|
-
if (import_slate46.Path.isBefore(
|
|
191769
|
+
const isDescendant = path.length > conf3.length && path.slice(0, conf3.length).every((seg, i) => seg === conf3[i]);
|
|
191770
|
+
if (import_slate46.Path.isBefore(conf3, path) && !isDescendant) {
|
|
191767
191771
|
transformPath(confirmed, transformed);
|
|
191768
191772
|
}
|
|
191769
191773
|
return transformed;
|
|
@@ -192356,8 +192360,8 @@ function transformEvents(confirmed, toTransform) {
|
|
|
192356
192360
|
const transformed = [];
|
|
192357
192361
|
for (const transf of toTransform) {
|
|
192358
192362
|
let actualyTransformed = { ...transf };
|
|
192359
|
-
for (const
|
|
192360
|
-
const { operation: confOp } =
|
|
192363
|
+
for (const conf3 of confirmed) {
|
|
192364
|
+
const { operation: confOp } = conf3.body;
|
|
192361
192365
|
const { operation: transfOp } = actualyTransformed.body;
|
|
192362
192366
|
const transformedOp = transfromOperation(confOp, transfOp);
|
|
192363
192367
|
if (transformedOp) {
|
|
@@ -192989,7 +192993,7 @@ class Events2 {
|
|
|
192989
192993
|
return record !== null;
|
|
192990
192994
|
}
|
|
192991
192995
|
sendPresenceEvent(event) {
|
|
192992
|
-
|
|
192996
|
+
conf2.connection.publishPresenceEvent(this.board.getBoardId(), event);
|
|
192993
192997
|
}
|
|
192994
192998
|
canUndoEvent(op, byUserId) {
|
|
192995
192999
|
if (op.method === "undo") {
|
|
@@ -193098,7 +193102,7 @@ function handleChatChunk(chunk, board) {
|
|
|
193098
193102
|
if (chunk.isExternalApiError) {
|
|
193099
193103
|
const editor = item2.getRichText().editor;
|
|
193100
193104
|
editor.clearText();
|
|
193101
|
-
editor.insertCopiedText(
|
|
193105
|
+
editor.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
|
|
193102
193106
|
}
|
|
193103
193107
|
}
|
|
193104
193108
|
board.camera.zoomToFit(item2.getMbr(), 20);
|
|
@@ -193106,9 +193110,9 @@ function handleChatChunk(chunk, board) {
|
|
|
193106
193110
|
}
|
|
193107
193111
|
console.log("Error AI generate", chunk.error);
|
|
193108
193112
|
if (!chunk.isExternalApiError) {
|
|
193109
|
-
|
|
193110
|
-
header:
|
|
193111
|
-
body:
|
|
193113
|
+
conf2.notify({
|
|
193114
|
+
header: conf2.i18n.t("AIInput.textGenerationError.header"),
|
|
193115
|
+
body: conf2.i18n.t("AIInput.textGenerationError.body"),
|
|
193112
193116
|
variant: "error",
|
|
193113
193117
|
duration: 4000
|
|
193114
193118
|
});
|
|
@@ -193118,9 +193122,9 @@ function handleChatChunk(chunk, board) {
|
|
|
193118
193122
|
default:
|
|
193119
193123
|
board.camera.unsubscribeFromItem();
|
|
193120
193124
|
if (!chunk.isExternalApiError) {
|
|
193121
|
-
|
|
193122
|
-
header:
|
|
193123
|
-
body:
|
|
193125
|
+
conf2.notify({
|
|
193126
|
+
header: conf2.i18n.t("AIInput.textGenerationError.header"),
|
|
193127
|
+
body: conf2.i18n.t("AIInput.textGenerationError.body"),
|
|
193124
193128
|
variant: "error",
|
|
193125
193129
|
duration: 4000
|
|
193126
193130
|
});
|
|
@@ -193135,7 +193139,7 @@ function handleChatChunk(chunk, board) {
|
|
|
193135
193139
|
if (chunk.isExternalApiError) {
|
|
193136
193140
|
const editor = item2.getRichText().editor;
|
|
193137
193141
|
editor.clearText();
|
|
193138
|
-
editor.insertCopiedText(
|
|
193142
|
+
editor.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
|
|
193139
193143
|
}
|
|
193140
193144
|
}
|
|
193141
193145
|
board.camera.zoomToFit(item2.getMbr(), 20);
|
|
@@ -193162,7 +193166,7 @@ function handleAudioGenerate(response, board) {
|
|
|
193162
193166
|
}
|
|
193163
193167
|
const audio = new AudioItem(board, true, audioUrl2, board.events, "", "wav");
|
|
193164
193168
|
const { left, top, right } = placeholderNode.getMbr();
|
|
193165
|
-
audio.transformation.applyTranslateTo(left + (right - left -
|
|
193169
|
+
audio.transformation.applyTranslateTo(left + (right - left - conf2.AUDIO_DIMENSIONS.width) / 2, top);
|
|
193166
193170
|
audio.updateMbr();
|
|
193167
193171
|
const threadDirection = placeholderNode.getThreadDirection();
|
|
193168
193172
|
board.remove(placeholderNode, false);
|
|
@@ -193184,7 +193188,7 @@ function handleAudioGenerate(response, board) {
|
|
|
193184
193188
|
type: "audio/wav"
|
|
193185
193189
|
});
|
|
193186
193190
|
const audioUrl2 = URL.createObjectURL(audioBlob);
|
|
193187
|
-
const linkElem =
|
|
193191
|
+
const linkElem = conf2.documentFactory.createElement("a");
|
|
193188
193192
|
linkElem.href = audioUrl2;
|
|
193189
193193
|
linkElem.setAttribute("download", `${board.getBoardId()}-generated.wav`);
|
|
193190
193194
|
linkElem.click();
|
|
@@ -193203,9 +193207,9 @@ function handleAudioGenerate(response, board) {
|
|
|
193203
193207
|
board.selection.add(placeholderNode);
|
|
193204
193208
|
}
|
|
193205
193209
|
console.error("Audio generation error:", response.message);
|
|
193206
|
-
|
|
193207
|
-
header:
|
|
193208
|
-
body:
|
|
193210
|
+
conf2.notify({
|
|
193211
|
+
header: conf2.i18n.t("AIInput.audioGenerationError.header"),
|
|
193212
|
+
body: conf2.i18n.t("AIInput.audioGenerationError.body"),
|
|
193209
193213
|
variant: "error",
|
|
193210
193214
|
duration: 4000
|
|
193211
193215
|
});
|
|
@@ -193268,14 +193272,14 @@ function handleImageGenerate(response, board) {
|
|
|
193268
193272
|
board.selection.add(item);
|
|
193269
193273
|
const editor = item.getRichText()?.editor;
|
|
193270
193274
|
editor?.clearText();
|
|
193271
|
-
editor?.insertCopiedText(
|
|
193275
|
+
editor?.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
|
|
193272
193276
|
board.camera.zoomToFit(item.getMbr(), 20);
|
|
193273
193277
|
}
|
|
193274
193278
|
}
|
|
193275
193279
|
} else {
|
|
193276
|
-
|
|
193277
|
-
header:
|
|
193278
|
-
body:
|
|
193280
|
+
conf2.notify({
|
|
193281
|
+
header: conf2.i18n.t("AIInput.imageGenerationError.header"),
|
|
193282
|
+
body: conf2.i18n.t("AIInput.imageGenerationError.body"),
|
|
193279
193283
|
variant: "error",
|
|
193280
193284
|
duration: 4000
|
|
193281
193285
|
});
|
|
@@ -193342,10 +193346,10 @@ function startIntervals(board) {
|
|
|
193342
193346
|
}
|
|
193343
193347
|
log.publishIntervalTimer = setInterval(() => {
|
|
193344
193348
|
tryPublishEvent(board);
|
|
193345
|
-
},
|
|
193349
|
+
}, conf2.EVENTS_PUBLISH_INTERVAL);
|
|
193346
193350
|
log.resendIntervalTimer = setInterval(() => {
|
|
193347
193351
|
tryResendEvent(board);
|
|
193348
|
-
},
|
|
193352
|
+
}, conf2.EVENTS_RESEND_INTERVAL);
|
|
193349
193353
|
}
|
|
193350
193354
|
function tryPublishEvent(board) {
|
|
193351
193355
|
const { log } = board.events;
|
|
@@ -193364,14 +193368,14 @@ function tryResendEvent(board) {
|
|
|
193364
193368
|
return;
|
|
193365
193369
|
}
|
|
193366
193370
|
const date = Date.now();
|
|
193367
|
-
const isTimeToSendPendingEvent = date - log.pendingEvent.lastSentTime >=
|
|
193371
|
+
const isTimeToSendPendingEvent = date - log.pendingEvent.lastSentTime >= conf2.EVENTS_RESEND_INTERVAL;
|
|
193368
193372
|
if (!isTimeToSendPendingEvent) {
|
|
193369
193373
|
return;
|
|
193370
193374
|
}
|
|
193371
|
-
const isProbablyLostConnection = log.firstSentTime && date - log.firstSentTime >=
|
|
193375
|
+
const isProbablyLostConnection = log.firstSentTime && date - log.firstSentTime >= conf2.EVENTS_RESEND_INTERVAL * 5;
|
|
193372
193376
|
if (isProbablyLostConnection) {
|
|
193373
193377
|
board.presence.clear();
|
|
193374
|
-
|
|
193378
|
+
conf2.connection?.notifyAboutLostConnection();
|
|
193375
193379
|
}
|
|
193376
193380
|
sendBoardEvent(board, log.pendingEvent.event, log.currentSequenceNumber);
|
|
193377
193381
|
}
|
|
@@ -193402,12 +193406,12 @@ function sendBoardEvent(board, event, sequenceNumber) {
|
|
|
193402
193406
|
lastKnownOrder: log.getLastIndex()
|
|
193403
193407
|
}
|
|
193404
193408
|
};
|
|
193405
|
-
|
|
193409
|
+
conf2.connection.send({
|
|
193406
193410
|
type: "BoardEvent",
|
|
193407
193411
|
boardId: board.getBoardId(),
|
|
193408
193412
|
event: toSend,
|
|
193409
193413
|
sequenceNumber,
|
|
193410
|
-
userId:
|
|
193414
|
+
userId: conf2.connection.getCurrentUser()
|
|
193411
193415
|
});
|
|
193412
193416
|
const date = Date.now();
|
|
193413
193417
|
log.pendingEvent = {
|
|
@@ -193453,7 +193457,7 @@ function handleConfirmation(msg, board) {
|
|
|
193453
193457
|
if (!isPendingEventConfirmation) {
|
|
193454
193458
|
return;
|
|
193455
193459
|
}
|
|
193456
|
-
|
|
193460
|
+
conf2.connection?.dismissNotificationAboutLostConnection();
|
|
193457
193461
|
log.currentSequenceNumber++;
|
|
193458
193462
|
log.pendingEvent.event.order = msg.order;
|
|
193459
193463
|
log.confirmSentLocalEvent(log.pendingEvent.event);
|
|
@@ -193465,7 +193469,7 @@ function handleConfirmation(msg, board) {
|
|
|
193465
193469
|
// src/Events/MessageRouter/handleCreateSnapshotRequestMessage.ts
|
|
193466
193470
|
function handleCreateSnapshotRequestMessage(msg, board) {
|
|
193467
193471
|
const { boardId, snapshot, lastOrder } = getSnapshotToPublish(board);
|
|
193468
|
-
|
|
193472
|
+
conf2.connection.send({
|
|
193469
193473
|
type: "BoardSnapshot",
|
|
193470
193474
|
boardId,
|
|
193471
193475
|
snapshot,
|
|
@@ -193496,9 +193500,9 @@ function handleModeMessage(message, board) {
|
|
|
193496
193500
|
if (isTemplateView()) {
|
|
193497
193501
|
return;
|
|
193498
193502
|
}
|
|
193499
|
-
|
|
193500
|
-
header:
|
|
193501
|
-
body: message.mode === "edit" ?
|
|
193503
|
+
conf2.notify({
|
|
193504
|
+
header: conf2.i18n.t("sharing.settingsChanged.heading"),
|
|
193505
|
+
body: message.mode === "edit" ? conf2.i18n.t("sharing.settingsChanged.bodyEdit") : conf2.i18n.t("sharing.settingsChanged.bodyView"),
|
|
193502
193506
|
duration: 5000
|
|
193503
193507
|
});
|
|
193504
193508
|
}
|
|
@@ -193616,7 +193620,7 @@ class NodePath2D extends Path2DFactory {
|
|
|
193616
193620
|
|
|
193617
193621
|
// src/api/initPaths.ts
|
|
193618
193622
|
function initPaths(path2D) {
|
|
193619
|
-
|
|
193623
|
+
conf2.EXPORT_FRAME_DECORATIONS = {
|
|
193620
193624
|
"top-left": {
|
|
193621
193625
|
path: new path2D("M13 1H1V13"),
|
|
193622
193626
|
lineWidth: 2,
|
|
@@ -193659,7 +193663,7 @@ function initPaths(path2D) {
|
|
|
193659
193663
|
// src/api/getMeasureCtx.ts
|
|
193660
193664
|
function getMeasureCtx() {
|
|
193661
193665
|
if (typeof document !== "undefined") {
|
|
193662
|
-
const measureCanvas =
|
|
193666
|
+
const measureCanvas = conf2.documentFactory.createElement("canvas");
|
|
193663
193667
|
const measureCtx = measureCanvas.getContext("2d");
|
|
193664
193668
|
if (!measureCtx) {
|
|
193665
193669
|
throw new Error("Failde to create canvas and get 2d context");
|
|
@@ -193677,12 +193681,12 @@ function getMeasureCtx() {
|
|
|
193677
193681
|
var import_css = __toESM(require_css_escape());
|
|
193678
193682
|
function initNodeSettings() {
|
|
193679
193683
|
const documentFactory = new NodeDocumentFactory;
|
|
193680
|
-
|
|
193681
|
-
|
|
193682
|
-
|
|
193683
|
-
|
|
193684
|
+
conf2.documentFactory = documentFactory;
|
|
193685
|
+
conf2.path2DFactory = NodePath2D;
|
|
193686
|
+
conf2.measureCtx = getMeasureCtx();
|
|
193687
|
+
conf2.getDOMParser = getNodeDOMParser;
|
|
193684
193688
|
initPaths(NodePath2D);
|
|
193685
|
-
return
|
|
193689
|
+
return conf2;
|
|
193686
193690
|
}
|
|
193687
193691
|
|
|
193688
193692
|
// src/node.ts
|