microboard-temp 0.4.106 → 0.4.108
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 +30 -449
- package/dist/cjs/index.js +30 -449
- package/dist/cjs/node.js +30 -449
- package/dist/esm/browser.js +30 -449
- package/dist/esm/index.js +30 -449
- package/dist/esm/node.js +30 -449
- package/dist/microboard.css +1 -1
- package/package.json +1 -1
- package/dist/types/public/customWebComponents.d.ts +0 -24
- package/dist/types/public/loadLinkImages.d.ts +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -52875,416 +52875,6 @@ class BoardSelection {
|
|
|
52875
52875
|
});
|
|
52876
52876
|
}
|
|
52877
52877
|
}
|
|
52878
|
-
// src/public/customWebComponents.js
|
|
52879
|
-
var customWebComponents_default = `/* eslint-disable max-classes-per-file, @typescript-eslint/no-useless-constructor */
|
|
52880
|
-
class RichTextElement extends HTMLElement {
|
|
52881
|
-
constructor() {
|
|
52882
|
-
super();
|
|
52883
|
-
}
|
|
52884
|
-
}
|
|
52885
|
-
|
|
52886
|
-
class ShapeItemElement extends HTMLElement {
|
|
52887
|
-
constructor() {
|
|
52888
|
-
super();
|
|
52889
|
-
}
|
|
52890
|
-
}
|
|
52891
|
-
|
|
52892
|
-
class StickerElement extends HTMLElement {
|
|
52893
|
-
constructor() {
|
|
52894
|
-
super();
|
|
52895
|
-
}
|
|
52896
|
-
}
|
|
52897
|
-
|
|
52898
|
-
class DrawingElement extends HTMLElement {
|
|
52899
|
-
constructor() {
|
|
52900
|
-
super();
|
|
52901
|
-
}
|
|
52902
|
-
}
|
|
52903
|
-
|
|
52904
|
-
class ConnectorElement extends HTMLElement {
|
|
52905
|
-
constructor() {
|
|
52906
|
-
super();
|
|
52907
|
-
}
|
|
52908
|
-
}
|
|
52909
|
-
|
|
52910
|
-
class FrameItemElement extends HTMLElement {
|
|
52911
|
-
constructor() {
|
|
52912
|
-
super();
|
|
52913
|
-
}
|
|
52914
|
-
}
|
|
52915
|
-
|
|
52916
|
-
class ImageItemElement extends HTMLElement {
|
|
52917
|
-
constructor() {
|
|
52918
|
-
super();
|
|
52919
|
-
}
|
|
52920
|
-
}
|
|
52921
|
-
|
|
52922
|
-
class LinkItemElement extends HTMLElement {
|
|
52923
|
-
constructor() {
|
|
52924
|
-
super();
|
|
52925
|
-
}
|
|
52926
|
-
}
|
|
52927
|
-
|
|
52928
|
-
class AINodeItemElement extends HTMLElement {
|
|
52929
|
-
constructor() {
|
|
52930
|
-
super();
|
|
52931
|
-
}
|
|
52932
|
-
}
|
|
52933
|
-
|
|
52934
|
-
class VideoItemElement extends HTMLElement {
|
|
52935
|
-
constructor() {
|
|
52936
|
-
super();
|
|
52937
|
-
}
|
|
52938
|
-
}
|
|
52939
|
-
|
|
52940
|
-
class CommentElement extends HTMLElement {
|
|
52941
|
-
constructor() {
|
|
52942
|
-
super();
|
|
52943
|
-
}
|
|
52944
|
-
}
|
|
52945
|
-
|
|
52946
|
-
class AudioItemElement extends HTMLElement {
|
|
52947
|
-
constructor() {
|
|
52948
|
-
super();
|
|
52949
|
-
}
|
|
52950
|
-
}
|
|
52951
|
-
|
|
52952
|
-
customElements.define("rich-text", RichTextElement);
|
|
52953
|
-
customElements.define("shape-item", ShapeItemElement);
|
|
52954
|
-
customElements.define("sticker-item", StickerElement);
|
|
52955
|
-
customElements.define("drawing-item", DrawingElement);
|
|
52956
|
-
customElements.define("connector-item", ConnectorElement);
|
|
52957
|
-
customElements.define("frame-item", FrameItemElement);
|
|
52958
|
-
customElements.define("image-item", ImageItemElement);
|
|
52959
|
-
customElements.define("link-item", LinkItemElement);
|
|
52960
|
-
customElements.define("ainode-item", AINodeItemElement);
|
|
52961
|
-
customElements.define("video-item", VideoItemElement);
|
|
52962
|
-
customElements.define("comment-item", CommentElement);
|
|
52963
|
-
customElements.define("audio-item", AudioItemElement);
|
|
52964
|
-
|
|
52965
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
52966
|
-
const itemsDiv = document.querySelector("#items");
|
|
52967
|
-
if (!itemsDiv) {
|
|
52968
|
-
console.error("ITEMS DIV NOT FOUND!");
|
|
52969
|
-
return;
|
|
52970
|
-
}
|
|
52971
|
-
let isDragging = false;
|
|
52972
|
-
let startX, startY;
|
|
52973
|
-
let translateX = 0;
|
|
52974
|
-
let translateY = 0;
|
|
52975
|
-
let scale = 1;
|
|
52976
|
-
|
|
52977
|
-
itemsDiv.style.transformOrigin = "0 0";
|
|
52978
|
-
document.body.style.cursor = "grab";
|
|
52979
|
-
|
|
52980
|
-
function updateTransform() {
|
|
52981
|
-
itemsDiv.style.transform =
|
|
52982
|
-
"translate(" +
|
|
52983
|
-
translateX +
|
|
52984
|
-
"px, " +
|
|
52985
|
-
translateY +
|
|
52986
|
-
"px) scale(" +
|
|
52987
|
-
scale +
|
|
52988
|
-
")";
|
|
52989
|
-
}
|
|
52990
|
-
|
|
52991
|
-
function handleMouseDown(ev) {
|
|
52992
|
-
isDragging = true;
|
|
52993
|
-
startX = ev.clientX;
|
|
52994
|
-
startY = ev.clientY;
|
|
52995
|
-
itemsDiv.style.cursor = "grabbing";
|
|
52996
|
-
}
|
|
52997
|
-
|
|
52998
|
-
function handleMouseMove(ev) {
|
|
52999
|
-
if (!isDragging) {
|
|
53000
|
-
return;
|
|
53001
|
-
}
|
|
53002
|
-
const dx = ev.clientX - startX;
|
|
53003
|
-
const dy = ev.clientY - startY;
|
|
53004
|
-
startX += dx;
|
|
53005
|
-
startY += dy;
|
|
53006
|
-
translateX += dx;
|
|
53007
|
-
translateY += dy;
|
|
53008
|
-
updateTransform();
|
|
53009
|
-
}
|
|
53010
|
-
|
|
53011
|
-
function handleMouseUp(ev) {
|
|
53012
|
-
if (!isDragging) {
|
|
53013
|
-
return;
|
|
53014
|
-
}
|
|
53015
|
-
isDragging = false;
|
|
53016
|
-
itemsDiv.style.cursor = "grab";
|
|
53017
|
-
}
|
|
53018
|
-
|
|
53019
|
-
function handleWheel(ev) {
|
|
53020
|
-
ev.preventDefault();
|
|
53021
|
-
const factor = ev.deltaY < 0 ? 1.1 : 0.9;
|
|
53022
|
-
translateX = ev.clientX - (ev.clientX - translateX) * factor;
|
|
53023
|
-
translateY = ev.clientY - (ev.clientY - translateY) * factor;
|
|
53024
|
-
scale *= factor;
|
|
53025
|
-
updateTransform();
|
|
53026
|
-
}
|
|
53027
|
-
|
|
53028
|
-
document.addEventListener("mousedown", handleMouseDown);
|
|
53029
|
-
document.addEventListener("mousemove", handleMouseMove);
|
|
53030
|
-
document.addEventListener("mouseup", handleMouseUp);
|
|
53031
|
-
document.addEventListener("wheel", handleWheel, { passive: false });
|
|
53032
|
-
|
|
53033
|
-
const titlePanel = document.createElement("div");
|
|
53034
|
-
titlePanel.style.boxShadow = "0px 10px 16px -3px rgba(20, 21, 26, 0.08)";
|
|
53035
|
-
titlePanel.style.position = "fixed";
|
|
53036
|
-
titlePanel.style.left = "12px";
|
|
53037
|
-
titlePanel.style.top = "12px";
|
|
53038
|
-
titlePanel.style.borderRadius = "12px";
|
|
53039
|
-
titlePanel.style.backgroundColor = "#ffff";
|
|
53040
|
-
titlePanel.style.display = "flex";
|
|
53041
|
-
titlePanel.style.alignItems = "center";
|
|
53042
|
-
titlePanel.style.gap = "8px";
|
|
53043
|
-
titlePanel.style.padding = "0 12px";
|
|
53044
|
-
titlePanel.style.height = "48px";
|
|
53045
|
-
const editButton = document.createElement("button");
|
|
53046
|
-
const editIcon = document.createElementNS(
|
|
53047
|
-
"http://www.w3.org/2000/svg",
|
|
53048
|
-
"svg",
|
|
53049
|
-
);
|
|
53050
|
-
editIcon.setAttribute("width", "13");
|
|
53051
|
-
editIcon.setAttribute("height", "13");
|
|
53052
|
-
editIcon.setAttribute("viewBox", "0 0 13 13");
|
|
53053
|
-
editIcon.setAttribute("fill", "none");
|
|
53054
|
-
editIcon.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
53055
|
-
const editIconPath = document.createElementNS(
|
|
53056
|
-
"http://www.w3.org/2000/svg",
|
|
53057
|
-
"path",
|
|
53058
|
-
);
|
|
53059
|
-
editIconPath.setAttribute(
|
|
53060
|
-
"d",
|
|
53061
|
-
"M7.838 0.999902V2.33324H1.33333V11.6666H10.6667V5.1619H12V12.3332C12 12.51 11.9298 12.6796 11.8047 12.8046C11.6797 12.9297 11.5101 12.9999 11.3333 12.9999H0.666667C0.489856 12.9999 0.320286 12.9297 0.195262 12.8046C0.0702379 12.6796 0 12.51 0 12.3332V1.66657C0 1.48976 0.0702379 1.32019 0.195262 1.19516C0.320286 1.07014 0.489856 0.999902 0.666667 0.999902H7.838ZM11.1847 0.872018C11.4453 0.611315 11.868 0.611355 12.1285 0.872108C12.3889 1.1327 12.3889 1.55503 12.1284 1.81553L6.472 7.4719L5.53067 7.4739L5.52933 6.52924L11.1847 0.872018Z",
|
|
53062
|
-
);
|
|
53063
|
-
editIconPath.setAttribute("fill", "#ffff");
|
|
53064
|
-
editIcon.appendChild(editIconPath);
|
|
53065
|
-
editButton.appendChild(editIcon);
|
|
53066
|
-
const editFileText = document.createElement("p");
|
|
53067
|
-
const isSnapshotInIframe =
|
|
53068
|
-
window.parent &&
|
|
53069
|
-
window.parent !== window &&
|
|
53070
|
-
window.parent.location.href.includes("/snapshots/");
|
|
53071
|
-
editFileText.textContent = isSnapshotInIframe ? "Edit copy" : "Edit file";
|
|
53072
|
-
editButton.appendChild(editFileText);
|
|
53073
|
-
|
|
53074
|
-
editButton.style.backgroundColor = "rgba(20, 21, 26, 1)";
|
|
53075
|
-
editButton.style.cursor = "pointer";
|
|
53076
|
-
editButton.style.boxShadow = "0px 1px 2px 0px rgba(20, 21, 26, 0.05)";
|
|
53077
|
-
editButton.style.color = "#ffff";
|
|
53078
|
-
editButton.style.fontSize = "14px";
|
|
53079
|
-
editButton.style.lineHeight = "20px";
|
|
53080
|
-
editButton.style.display = "flex";
|
|
53081
|
-
editButton.style.alignItems = "center";
|
|
53082
|
-
editButton.style.gap = "8px";
|
|
53083
|
-
editButton.style.padding = "8px";
|
|
53084
|
-
editButton.style.borderRadius = "10px";
|
|
53085
|
-
const separator = document.createElement("div");
|
|
53086
|
-
separator.style.borderRight = "1px solid rgba(222, 224, 227, 1)";
|
|
53087
|
-
separator.style.height = "100%";
|
|
53088
|
-
const boardName = document.createElement("div");
|
|
53089
|
-
const fileIcon = document.createElementNS(
|
|
53090
|
-
"http://www.w3.org/2000/svg",
|
|
53091
|
-
"svg",
|
|
53092
|
-
);
|
|
53093
|
-
fileIcon.setAttribute("width", "16");
|
|
53094
|
-
fileIcon.setAttribute("height", "18");
|
|
53095
|
-
fileIcon.setAttribute("viewBox", "0 0 16 18");
|
|
53096
|
-
fileIcon.setAttribute("fill", "none");
|
|
53097
|
-
fileIcon.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
53098
|
-
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
53099
|
-
path.setAttribute(
|
|
53100
|
-
"d",
|
|
53101
|
-
"M10.5 2.33341H2.16667V15.6667H13.8333V5.66675H10.5V2.33341ZM0.5 1.49341C0.5 1.03675 0.8725 0.666748 1.3325 0.666748H11.3333L15.5 4.83342V16.4942C15.5008 16.6037 15.48 16.7122 15.4388 16.8136C15.3976 16.915 15.3369 17.0073 15.2601 17.0852C15.1832 17.1631 15.0918 17.2252 14.991 17.2678C14.8902 17.3103 14.7819 17.3327 14.6725 17.3334H1.3275C1.10865 17.3319 0.899181 17.2443 0.744348 17.0897C0.589515 16.935 0.501746 16.7256 0.5 16.5067V1.49341ZM7.16667 8.16675V5.66675H8.83333V8.16675H11.3333V9.83342H8.83333V12.3334H7.16667V9.83342H4.66667V8.16675H7.16667Z",
|
|
53102
|
-
);
|
|
53103
|
-
path.setAttribute("fill", "#696B76");
|
|
53104
|
-
fileIcon.appendChild(path);
|
|
53105
|
-
boardName.appendChild(fileIcon);
|
|
53106
|
-
const boardNameTag = document.querySelector('meta[name="board-name"]');
|
|
53107
|
-
let boardNameStr = "Untitled";
|
|
53108
|
-
if (boardNameTag) {
|
|
53109
|
-
boardNameStr = boardNameTag.getAttribute("content");
|
|
53110
|
-
}
|
|
53111
|
-
const p = document.createElement("p");
|
|
53112
|
-
p.textContent = boardNameStr;
|
|
53113
|
-
p.style.fontSize = "16px";
|
|
53114
|
-
p.style.lineHeight = "24px";
|
|
53115
|
-
boardName.appendChild(p);
|
|
53116
|
-
const cloudIcon = document.createElementNS(
|
|
53117
|
-
"http://www.w3.org/2000/svg",
|
|
53118
|
-
"svg",
|
|
53119
|
-
);
|
|
53120
|
-
cloudIcon.setAttribute("width", "20");
|
|
53121
|
-
cloudIcon.setAttribute("height", "18");
|
|
53122
|
-
cloudIcon.setAttribute("viewBox", "0 0 20 18");
|
|
53123
|
-
cloudIcon.setAttribute("fill", "none");
|
|
53124
|
-
cloudIcon.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
53125
|
-
const cloudIconPath = document.createElementNS(
|
|
53126
|
-
"http://www.w3.org/2000/svg",
|
|
53127
|
-
"path",
|
|
53128
|
-
);
|
|
53129
|
-
cloudIconPath.setAttribute(
|
|
53130
|
-
"d",
|
|
53131
|
-
"M2.92711 0.75009L18.8371 16.6601L17.6579 17.8393L15.9796 16.1601C15.401 16.3854 14.7855 16.5007 14.1646 16.5001H5.83128C4.65063 16.5008 3.50782 16.0838 2.60518 15.3227C1.70255 14.5617 1.09833 13.5058 0.89953 12.342C0.700726 11.1782 0.920157 9.98165 1.51897 8.96413C2.11778 7.94662 3.05734 7.17382 4.17128 6.78259C4.13561 6.05854 4.23538 5.3342 4.46544 4.64676L1.74794 1.92842L2.92711 0.75009ZM5.83128 6.50009C5.83128 6.56759 5.83294 6.63592 5.83628 6.70259L5.89461 7.94259L4.72461 8.35426C3.98336 8.6164 3.35857 9.132 2.96052 9.81003C2.56248 10.4881 2.41678 11.2849 2.54916 12.0599C2.68153 12.8349 3.08347 13.5383 3.684 14.0457C4.28453 14.5532 5.04504 14.8322 5.83128 14.8334H14.1646C14.3196 14.8334 14.4721 14.8226 14.6213 14.8026L5.85628 6.03759C5.83961 6.18926 5.83128 6.34342 5.83128 6.50009ZM9.99794 0.666756C10.7878 0.666732 11.5694 0.827112 12.2954 1.13817C13.0214 1.44923 13.6767 1.90449 14.2215 2.47635C14.7664 3.04821 15.1894 3.72476 15.4649 4.46498C15.7405 5.2052 15.8629 5.99367 15.8246 6.78259C16.5167 7.02639 17.1467 7.41945 17.6699 7.93391C18.1931 8.44837 18.5967 9.07163 18.8521 9.75951C19.1076 10.4474 19.2085 11.183 19.1479 11.9143C19.0873 12.6455 18.8665 13.3545 18.5013 13.9909L17.2571 12.7468C17.5023 12.1401 17.5636 11.4747 17.4331 10.8335C17.3027 10.1924 16.9864 9.60375 16.5237 9.14112C16.061 8.67849 15.4723 8.36232 14.8311 8.23202C14.1899 8.10173 13.5245 8.16308 12.9179 8.40842L11.6729 7.16259C12.4071 6.74176 13.2571 6.50009 14.1646 6.50009C14.1646 5.73714 13.9551 4.98884 13.559 4.33679C13.1629 3.68473 12.5953 3.15396 11.9182 2.80235C11.2411 2.45073 10.4805 2.29177 9.71923 2.34281C8.95799 2.39384 8.22538 2.65291 7.60127 3.09176L6.40961 1.90009C7.43392 1.09887 8.69749 0.664571 9.99794 0.666756Z",
|
|
53132
|
-
);
|
|
53133
|
-
cloudIconPath.setAttribute("fill", "#696B76");
|
|
53134
|
-
cloudIcon.appendChild(cloudIconPath);
|
|
53135
|
-
boardName.appendChild(cloudIcon);
|
|
53136
|
-
boardName.style.display = "flex";
|
|
53137
|
-
boardName.style.alignItems = "center";
|
|
53138
|
-
boardName.style.gap = "8px";
|
|
53139
|
-
titlePanel.appendChild(boardName);
|
|
53140
|
-
titlePanel.appendChild(separator);
|
|
53141
|
-
titlePanel.appendChild(editButton);
|
|
53142
|
-
document.body.appendChild(titlePanel);
|
|
53143
|
-
|
|
53144
|
-
editButton.onclick = async () => {
|
|
53145
|
-
editButton.disabled = true;
|
|
53146
|
-
editButton.textContent = "Loading...";
|
|
53147
|
-
|
|
53148
|
-
try {
|
|
53149
|
-
document.removeEventListener("mousedown", handleMouseDown);
|
|
53150
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
53151
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
53152
|
-
document.removeEventListener("wheel", handleWheel, {
|
|
53153
|
-
passive: false,
|
|
53154
|
-
});
|
|
53155
|
-
translateX = 0;
|
|
53156
|
-
translateY = 0;
|
|
53157
|
-
scale = 1;
|
|
53158
|
-
updateTransform();
|
|
53159
|
-
|
|
53160
|
-
const { initBrowserSettings } = await import(
|
|
53161
|
-
"https://www.unpkg.com/test_package_board@0.0.99/dist/bundle.js"
|
|
53162
|
-
);
|
|
53163
|
-
initBrowserSettings();
|
|
53164
|
-
|
|
53165
|
-
const { createApp } = await import(
|
|
53166
|
-
"https://www.unpkg.com/test_package_board@0.0.99/dist/bundle.js"
|
|
53167
|
-
);
|
|
53168
|
-
|
|
53169
|
-
const app = createApp();
|
|
53170
|
-
window.app = app;
|
|
53171
|
-
const stringed = await app.openAndEditFile();
|
|
53172
|
-
|
|
53173
|
-
if (stringed) {
|
|
53174
|
-
await app.openBoardFromFile();
|
|
53175
|
-
app.getBoard().deserializeHTML(stringed);
|
|
53176
|
-
app.localRender("items");
|
|
53177
|
-
}
|
|
53178
|
-
|
|
53179
|
-
const response = await fetch(
|
|
53180
|
-
"https://www.unpkg.com/test_package_board@0.0.99/dist/bundle.css",
|
|
53181
|
-
);
|
|
53182
|
-
const cssText = await response.text();
|
|
53183
|
-
const styleEl = document.createElement("style");
|
|
53184
|
-
styleEl.textContent = cssText;
|
|
53185
|
-
document.body.appendChild(styleEl);
|
|
53186
|
-
|
|
53187
|
-
const responseSvg = await fetch(
|
|
53188
|
-
"https://www.unpkg.com/test_package_board@0.0.99/dist/sprite.svg",
|
|
53189
|
-
);
|
|
53190
|
-
const svgText = await responseSvg.text();
|
|
53191
|
-
const div = document.createElement("div");
|
|
53192
|
-
div.style.display = "none";
|
|
53193
|
-
div.id = "sprite";
|
|
53194
|
-
div.innerHTML = svgText;
|
|
53195
|
-
document.body.appendChild(div);
|
|
53196
|
-
} finally {
|
|
53197
|
-
editButton.disabled = false;
|
|
53198
|
-
editButton.textContent = "Edit board";
|
|
53199
|
-
}
|
|
53200
|
-
};
|
|
53201
|
-
});
|
|
53202
|
-
`;
|
|
53203
|
-
|
|
53204
|
-
// src/public/index.css
|
|
53205
|
-
var public_default = `@import "https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap";
|
|
53206
|
-
@import "https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap";
|
|
53207
|
-
|
|
53208
|
-
/* ../src/index.css */
|
|
53209
|
-
:root {
|
|
53210
|
-
--background-surface-default: rgb(255, 255, 255);
|
|
53211
|
-
--background-button-secondary: rgb(255, 255, 255);
|
|
53212
|
-
--background-button-secondary-hover: rgb(247, 247, 248);
|
|
53213
|
-
--background-badge-purple-disabled: rgb(247, 241, 253);
|
|
53214
|
-
--background-badge-gray: rgb(233, 234, 236);
|
|
53215
|
-
--background-accent-purple: rgb(146, 79, 232);
|
|
53216
|
-
--border-action-normal: rgb(222, 223, 227);
|
|
53217
|
-
--border-action-focus: rgb(146, 79, 232);
|
|
53218
|
-
--border-select-primary: rgb(146, 79, 232);
|
|
53219
|
-
--text-base-primary: rgb(20, 21, 26);
|
|
53220
|
-
--text-base-secondary: rgba(15, 19, 36, 0.6);
|
|
53221
|
-
--text-base-quaternary: rgb(10, 15, 41, 0.25);
|
|
53222
|
-
--text-accent-purple: rgb(152, 89, 233);
|
|
53223
|
-
--icon-base-primary: rgb(20, 21, 26);
|
|
53224
|
-
--icon-base-secondary: rgb(105, 107, 118);
|
|
53225
|
-
--icon-accent-purple: rgb(146, 79, 232);
|
|
53226
|
-
--absolute-position-panel-padding: 12px;
|
|
53227
|
-
}
|
|
53228
|
-
* {
|
|
53229
|
-
box-sizing: border-box;
|
|
53230
|
-
padding: 0;
|
|
53231
|
-
margin: 0;
|
|
53232
|
-
border: none;
|
|
53233
|
-
background: none;
|
|
53234
|
-
font-family: inherit;
|
|
53235
|
-
}
|
|
53236
|
-
html {
|
|
53237
|
-
font-size: 62.5%;
|
|
53238
|
-
}
|
|
53239
|
-
body {
|
|
53240
|
-
color: var(--text-base-primary);
|
|
53241
|
-
font-size: 1.6rem;
|
|
53242
|
-
font-optical-sizing: auto;
|
|
53243
|
-
font-style: normal;
|
|
53244
|
-
font-family: "Manrope", sans-serif;
|
|
53245
|
-
}
|
|
53246
|
-
html,
|
|
53247
|
-
body {
|
|
53248
|
-
overscroll-behavior-x: none;
|
|
53249
|
-
-webkit-user-select: none;
|
|
53250
|
-
}
|
|
53251
|
-
input:-webkit-autofill,
|
|
53252
|
-
input:-webkit-autofill:hover,
|
|
53253
|
-
input:-webkit-autofill:focus,
|
|
53254
|
-
input:-webkit-autofill:active {
|
|
53255
|
-
-webkit-box-shadow: 0 0 0 30px white inset !important;
|
|
53256
|
-
}
|
|
53257
|
-
`;
|
|
53258
|
-
|
|
53259
|
-
// src/public/loadLinkImages.js
|
|
53260
|
-
var loadLinkImages_default = `document.addEventListener("DOMContentLoaded", function () {
|
|
53261
|
-
document.querySelectorAll(".link-object").forEach(linkItem => {
|
|
53262
|
-
const linkImage = linkItem.querySelector(".link-image");
|
|
53263
|
-
const linkContainer = linkItem.querySelector("a");
|
|
53264
|
-
linkImage.onerror = () => {
|
|
53265
|
-
linkImage.onerror = null;
|
|
53266
|
-
linkImage.style.display = "none";
|
|
53267
|
-
const svgNamespace = "http://www.w3.org/2000/svg";
|
|
53268
|
-
const svg = document.createElementNS(svgNamespace, "svg");
|
|
53269
|
-
svg.setAttribute("width", "20");
|
|
53270
|
-
svg.setAttribute("height", "20");
|
|
53271
|
-
svg.setAttribute("viewBox", "0 0 13 14");
|
|
53272
|
-
svg.setAttribute("fill", "none");
|
|
53273
|
-
|
|
53274
|
-
const path = document.createElementNS(svgNamespace, "path");
|
|
53275
|
-
path.setAttribute(
|
|
53276
|
-
"d",
|
|
53277
|
-
"M11.0054 3.414L2.39838 12.021L0.984375 10.607L9.59037 2H2.00538V0H13.0054V11H11.0054V3.414Z",
|
|
53278
|
-
);
|
|
53279
|
-
path.setAttribute("fill", "#924FE8");
|
|
53280
|
-
svg.appendChild(path);
|
|
53281
|
-
|
|
53282
|
-
linkContainer.appendChild(svg);
|
|
53283
|
-
};
|
|
53284
|
-
});
|
|
53285
|
-
});
|
|
53286
|
-
`;
|
|
53287
|
-
|
|
53288
52878
|
// src/Board.ts
|
|
53289
52879
|
class Board {
|
|
53290
52880
|
boardId;
|
|
@@ -53667,47 +53257,29 @@ class Board {
|
|
|
53667
53257
|
return this.copy();
|
|
53668
53258
|
}
|
|
53669
53259
|
serializeHTML() {
|
|
53670
|
-
const customTagsScript = customWebComponents_default;
|
|
53671
|
-
const loadLinksImagesScript = loadLinkImages_default;
|
|
53672
|
-
const css = public_default;
|
|
53673
53260
|
const boardName = this.getName() || this.getBoardId();
|
|
53674
53261
|
const items = this.items.getWholeHTML(conf.documentFactory);
|
|
53675
53262
|
const itemsDiv = `<div id="items">${items}</div>`;
|
|
53676
53263
|
const scripts = `
|
|
53677
|
-
<script type="module"
|
|
53678
|
-
|
|
53264
|
+
<script type="module" src="https://unpkg.com/microboard-ui-temp/dist/customWebComponents.js"></script>
|
|
53265
|
+
<script type="module" src="https://unpkg.com/microboard-ui-temp/dist/controlsHandlers.js"></script>
|
|
53266
|
+
<script type="module" src="https://unpkg.com/microboard-ui-temp/dist/titlePanel.js"></script>
|
|
53267
|
+
<script defer src="https://unpkg.com/microboard-ui-temp/dist/loadLinksImages.js"></script>
|
|
53679
53268
|
`;
|
|
53680
53269
|
const body = `<body style="overflow-x: hidden; overflow-y: hidden;">${itemsDiv}${scripts}</body>`;
|
|
53681
53270
|
const head = `
|
|
53682
|
-
|
|
53683
|
-
|
|
53684
|
-
|
|
53685
|
-
|
|
53686
|
-
|
|
53687
|
-
|
|
53688
|
-
|
|
53689
|
-
|
|
53690
|
-
|
|
53691
|
-
|
|
53692
|
-
|
|
53693
|
-
|
|
53694
|
-
appearance: none;
|
|
53695
|
-
width: 3px;
|
|
53696
|
-
height: 3px
|
|
53697
|
-
}
|
|
53698
|
-
::-webkit-scrollbar-button {
|
|
53699
|
-
display: none;
|
|
53700
|
-
}
|
|
53701
|
-
::-webkit-scrollbar-thumb {
|
|
53702
|
-
display: block;
|
|
53703
|
-
background-color: black;
|
|
53704
|
-
border-radius: 2px;
|
|
53705
|
-
}
|
|
53706
|
-
body {
|
|
53707
|
-
background-color: rgba(200, 200, 200, 0.2);
|
|
53708
|
-
}
|
|
53709
|
-
</style>
|
|
53710
|
-
</head>`.replace(/\t|\n/g, "");
|
|
53271
|
+
<head>
|
|
53272
|
+
<meta charset="utf-8" />
|
|
53273
|
+
<meta name="last-event-order" content="${this.events?.log.getLastIndex()}" />
|
|
53274
|
+
<title>Microboard ${boardName}</title>
|
|
53275
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
53276
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
53277
|
+
<link
|
|
53278
|
+
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap"
|
|
53279
|
+
rel="stylesheet"
|
|
53280
|
+
/>
|
|
53281
|
+
<link rel="stylesheet" crossorigin href="https://unpkg.com/microboard-ui-temp/dist/board.css" />
|
|
53282
|
+
</head>`.replace(/\t|\n/g, "");
|
|
53711
53283
|
return `${head}${body}`;
|
|
53712
53284
|
}
|
|
53713
53285
|
deserializeHTMLAndEmit(stringedHTML) {
|
|
@@ -53777,7 +53349,10 @@ class Board {
|
|
|
53777
53349
|
const addItem = (itemData) => {
|
|
53778
53350
|
const item = this.createItem(itemData.id, itemData);
|
|
53779
53351
|
if (item instanceof Connector2) {
|
|
53780
|
-
createdConnectors[itemData.id] = {
|
|
53352
|
+
createdConnectors[itemData.id] = {
|
|
53353
|
+
item,
|
|
53354
|
+
itemData
|
|
53355
|
+
};
|
|
53781
53356
|
}
|
|
53782
53357
|
if ("index" in item && item.index) {
|
|
53783
53358
|
createdGroups[item.getId()] = { item, itemData };
|
|
@@ -53812,10 +53387,16 @@ class Board {
|
|
|
53812
53387
|
for (const itemData of items) {
|
|
53813
53388
|
const item = this.createItem(itemData.id, itemData);
|
|
53814
53389
|
if (item instanceof Connector2) {
|
|
53815
|
-
createdConnectors[itemData.id] = {
|
|
53390
|
+
createdConnectors[itemData.id] = {
|
|
53391
|
+
item,
|
|
53392
|
+
itemData
|
|
53393
|
+
};
|
|
53816
53394
|
}
|
|
53817
53395
|
if ("index" in item && item.index) {
|
|
53818
|
-
createdGroups[item.getId()] = {
|
|
53396
|
+
createdGroups[item.getId()] = {
|
|
53397
|
+
item,
|
|
53398
|
+
itemData
|
|
53399
|
+
};
|
|
53819
53400
|
}
|
|
53820
53401
|
this.index.insert(item);
|
|
53821
53402
|
}
|
|
@@ -54057,7 +53638,7 @@ class Board {
|
|
|
54057
53638
|
itemData.transformation.translateX = translateX - minX + x;
|
|
54058
53639
|
itemData.transformation.translateY = translateY - minY + y;
|
|
54059
53640
|
}
|
|
54060
|
-
if ("children" in itemData && itemData.children) {
|
|
53641
|
+
if ("children" in itemData && itemData.children?.length) {
|
|
54061
53642
|
itemData.children = itemData.children.map((childId) => newItemIdMap[childId]);
|
|
54062
53643
|
}
|
|
54063
53644
|
newMap[newItemId] = itemData;
|
|
@@ -54189,7 +53770,7 @@ class Board {
|
|
|
54189
53770
|
itemData.transformation.translateX = translateX + width2 * 10 + 10;
|
|
54190
53771
|
}
|
|
54191
53772
|
}
|
|
54192
|
-
if (itemData
|
|
53773
|
+
if ("children" in itemData && itemData.children?.length) {
|
|
54193
53774
|
itemData.children = itemData.children.map((childId) => newItemIdMap[childId]);
|
|
54194
53775
|
}
|
|
54195
53776
|
newMap[newItemId] = itemData;
|