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/node.js
CHANGED
|
@@ -55343,416 +55343,6 @@ class BoardSelection {
|
|
|
55343
55343
|
});
|
|
55344
55344
|
}
|
|
55345
55345
|
}
|
|
55346
|
-
// src/public/customWebComponents.js
|
|
55347
|
-
var customWebComponents_default = `/* eslint-disable max-classes-per-file, @typescript-eslint/no-useless-constructor */
|
|
55348
|
-
class RichTextElement extends HTMLElement {
|
|
55349
|
-
constructor() {
|
|
55350
|
-
super();
|
|
55351
|
-
}
|
|
55352
|
-
}
|
|
55353
|
-
|
|
55354
|
-
class ShapeItemElement extends HTMLElement {
|
|
55355
|
-
constructor() {
|
|
55356
|
-
super();
|
|
55357
|
-
}
|
|
55358
|
-
}
|
|
55359
|
-
|
|
55360
|
-
class StickerElement extends HTMLElement {
|
|
55361
|
-
constructor() {
|
|
55362
|
-
super();
|
|
55363
|
-
}
|
|
55364
|
-
}
|
|
55365
|
-
|
|
55366
|
-
class DrawingElement extends HTMLElement {
|
|
55367
|
-
constructor() {
|
|
55368
|
-
super();
|
|
55369
|
-
}
|
|
55370
|
-
}
|
|
55371
|
-
|
|
55372
|
-
class ConnectorElement extends HTMLElement {
|
|
55373
|
-
constructor() {
|
|
55374
|
-
super();
|
|
55375
|
-
}
|
|
55376
|
-
}
|
|
55377
|
-
|
|
55378
|
-
class FrameItemElement extends HTMLElement {
|
|
55379
|
-
constructor() {
|
|
55380
|
-
super();
|
|
55381
|
-
}
|
|
55382
|
-
}
|
|
55383
|
-
|
|
55384
|
-
class ImageItemElement extends HTMLElement {
|
|
55385
|
-
constructor() {
|
|
55386
|
-
super();
|
|
55387
|
-
}
|
|
55388
|
-
}
|
|
55389
|
-
|
|
55390
|
-
class LinkItemElement extends HTMLElement {
|
|
55391
|
-
constructor() {
|
|
55392
|
-
super();
|
|
55393
|
-
}
|
|
55394
|
-
}
|
|
55395
|
-
|
|
55396
|
-
class AINodeItemElement extends HTMLElement {
|
|
55397
|
-
constructor() {
|
|
55398
|
-
super();
|
|
55399
|
-
}
|
|
55400
|
-
}
|
|
55401
|
-
|
|
55402
|
-
class VideoItemElement extends HTMLElement {
|
|
55403
|
-
constructor() {
|
|
55404
|
-
super();
|
|
55405
|
-
}
|
|
55406
|
-
}
|
|
55407
|
-
|
|
55408
|
-
class CommentElement extends HTMLElement {
|
|
55409
|
-
constructor() {
|
|
55410
|
-
super();
|
|
55411
|
-
}
|
|
55412
|
-
}
|
|
55413
|
-
|
|
55414
|
-
class AudioItemElement extends HTMLElement {
|
|
55415
|
-
constructor() {
|
|
55416
|
-
super();
|
|
55417
|
-
}
|
|
55418
|
-
}
|
|
55419
|
-
|
|
55420
|
-
customElements.define("rich-text", RichTextElement);
|
|
55421
|
-
customElements.define("shape-item", ShapeItemElement);
|
|
55422
|
-
customElements.define("sticker-item", StickerElement);
|
|
55423
|
-
customElements.define("drawing-item", DrawingElement);
|
|
55424
|
-
customElements.define("connector-item", ConnectorElement);
|
|
55425
|
-
customElements.define("frame-item", FrameItemElement);
|
|
55426
|
-
customElements.define("image-item", ImageItemElement);
|
|
55427
|
-
customElements.define("link-item", LinkItemElement);
|
|
55428
|
-
customElements.define("ainode-item", AINodeItemElement);
|
|
55429
|
-
customElements.define("video-item", VideoItemElement);
|
|
55430
|
-
customElements.define("comment-item", CommentElement);
|
|
55431
|
-
customElements.define("audio-item", AudioItemElement);
|
|
55432
|
-
|
|
55433
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
55434
|
-
const itemsDiv = document.querySelector("#items");
|
|
55435
|
-
if (!itemsDiv) {
|
|
55436
|
-
console.error("ITEMS DIV NOT FOUND!");
|
|
55437
|
-
return;
|
|
55438
|
-
}
|
|
55439
|
-
let isDragging = false;
|
|
55440
|
-
let startX, startY;
|
|
55441
|
-
let translateX = 0;
|
|
55442
|
-
let translateY = 0;
|
|
55443
|
-
let scale = 1;
|
|
55444
|
-
|
|
55445
|
-
itemsDiv.style.transformOrigin = "0 0";
|
|
55446
|
-
document.body.style.cursor = "grab";
|
|
55447
|
-
|
|
55448
|
-
function updateTransform() {
|
|
55449
|
-
itemsDiv.style.transform =
|
|
55450
|
-
"translate(" +
|
|
55451
|
-
translateX +
|
|
55452
|
-
"px, " +
|
|
55453
|
-
translateY +
|
|
55454
|
-
"px) scale(" +
|
|
55455
|
-
scale +
|
|
55456
|
-
")";
|
|
55457
|
-
}
|
|
55458
|
-
|
|
55459
|
-
function handleMouseDown(ev) {
|
|
55460
|
-
isDragging = true;
|
|
55461
|
-
startX = ev.clientX;
|
|
55462
|
-
startY = ev.clientY;
|
|
55463
|
-
itemsDiv.style.cursor = "grabbing";
|
|
55464
|
-
}
|
|
55465
|
-
|
|
55466
|
-
function handleMouseMove(ev) {
|
|
55467
|
-
if (!isDragging) {
|
|
55468
|
-
return;
|
|
55469
|
-
}
|
|
55470
|
-
const dx = ev.clientX - startX;
|
|
55471
|
-
const dy = ev.clientY - startY;
|
|
55472
|
-
startX += dx;
|
|
55473
|
-
startY += dy;
|
|
55474
|
-
translateX += dx;
|
|
55475
|
-
translateY += dy;
|
|
55476
|
-
updateTransform();
|
|
55477
|
-
}
|
|
55478
|
-
|
|
55479
|
-
function handleMouseUp(ev) {
|
|
55480
|
-
if (!isDragging) {
|
|
55481
|
-
return;
|
|
55482
|
-
}
|
|
55483
|
-
isDragging = false;
|
|
55484
|
-
itemsDiv.style.cursor = "grab";
|
|
55485
|
-
}
|
|
55486
|
-
|
|
55487
|
-
function handleWheel(ev) {
|
|
55488
|
-
ev.preventDefault();
|
|
55489
|
-
const factor = ev.deltaY < 0 ? 1.1 : 0.9;
|
|
55490
|
-
translateX = ev.clientX - (ev.clientX - translateX) * factor;
|
|
55491
|
-
translateY = ev.clientY - (ev.clientY - translateY) * factor;
|
|
55492
|
-
scale *= factor;
|
|
55493
|
-
updateTransform();
|
|
55494
|
-
}
|
|
55495
|
-
|
|
55496
|
-
document.addEventListener("mousedown", handleMouseDown);
|
|
55497
|
-
document.addEventListener("mousemove", handleMouseMove);
|
|
55498
|
-
document.addEventListener("mouseup", handleMouseUp);
|
|
55499
|
-
document.addEventListener("wheel", handleWheel, { passive: false });
|
|
55500
|
-
|
|
55501
|
-
const titlePanel = document.createElement("div");
|
|
55502
|
-
titlePanel.style.boxShadow = "0px 10px 16px -3px rgba(20, 21, 26, 0.08)";
|
|
55503
|
-
titlePanel.style.position = "fixed";
|
|
55504
|
-
titlePanel.style.left = "12px";
|
|
55505
|
-
titlePanel.style.top = "12px";
|
|
55506
|
-
titlePanel.style.borderRadius = "12px";
|
|
55507
|
-
titlePanel.style.backgroundColor = "#ffff";
|
|
55508
|
-
titlePanel.style.display = "flex";
|
|
55509
|
-
titlePanel.style.alignItems = "center";
|
|
55510
|
-
titlePanel.style.gap = "8px";
|
|
55511
|
-
titlePanel.style.padding = "0 12px";
|
|
55512
|
-
titlePanel.style.height = "48px";
|
|
55513
|
-
const editButton = document.createElement("button");
|
|
55514
|
-
const editIcon = document.createElementNS(
|
|
55515
|
-
"http://www.w3.org/2000/svg",
|
|
55516
|
-
"svg",
|
|
55517
|
-
);
|
|
55518
|
-
editIcon.setAttribute("width", "13");
|
|
55519
|
-
editIcon.setAttribute("height", "13");
|
|
55520
|
-
editIcon.setAttribute("viewBox", "0 0 13 13");
|
|
55521
|
-
editIcon.setAttribute("fill", "none");
|
|
55522
|
-
editIcon.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
55523
|
-
const editIconPath = document.createElementNS(
|
|
55524
|
-
"http://www.w3.org/2000/svg",
|
|
55525
|
-
"path",
|
|
55526
|
-
);
|
|
55527
|
-
editIconPath.setAttribute(
|
|
55528
|
-
"d",
|
|
55529
|
-
"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",
|
|
55530
|
-
);
|
|
55531
|
-
editIconPath.setAttribute("fill", "#ffff");
|
|
55532
|
-
editIcon.appendChild(editIconPath);
|
|
55533
|
-
editButton.appendChild(editIcon);
|
|
55534
|
-
const editFileText = document.createElement("p");
|
|
55535
|
-
const isSnapshotInIframe =
|
|
55536
|
-
window.parent &&
|
|
55537
|
-
window.parent !== window &&
|
|
55538
|
-
window.parent.location.href.includes("/snapshots/");
|
|
55539
|
-
editFileText.textContent = isSnapshotInIframe ? "Edit copy" : "Edit file";
|
|
55540
|
-
editButton.appendChild(editFileText);
|
|
55541
|
-
|
|
55542
|
-
editButton.style.backgroundColor = "rgba(20, 21, 26, 1)";
|
|
55543
|
-
editButton.style.cursor = "pointer";
|
|
55544
|
-
editButton.style.boxShadow = "0px 1px 2px 0px rgba(20, 21, 26, 0.05)";
|
|
55545
|
-
editButton.style.color = "#ffff";
|
|
55546
|
-
editButton.style.fontSize = "14px";
|
|
55547
|
-
editButton.style.lineHeight = "20px";
|
|
55548
|
-
editButton.style.display = "flex";
|
|
55549
|
-
editButton.style.alignItems = "center";
|
|
55550
|
-
editButton.style.gap = "8px";
|
|
55551
|
-
editButton.style.padding = "8px";
|
|
55552
|
-
editButton.style.borderRadius = "10px";
|
|
55553
|
-
const separator = document.createElement("div");
|
|
55554
|
-
separator.style.borderRight = "1px solid rgba(222, 224, 227, 1)";
|
|
55555
|
-
separator.style.height = "100%";
|
|
55556
|
-
const boardName = document.createElement("div");
|
|
55557
|
-
const fileIcon = document.createElementNS(
|
|
55558
|
-
"http://www.w3.org/2000/svg",
|
|
55559
|
-
"svg",
|
|
55560
|
-
);
|
|
55561
|
-
fileIcon.setAttribute("width", "16");
|
|
55562
|
-
fileIcon.setAttribute("height", "18");
|
|
55563
|
-
fileIcon.setAttribute("viewBox", "0 0 16 18");
|
|
55564
|
-
fileIcon.setAttribute("fill", "none");
|
|
55565
|
-
fileIcon.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
55566
|
-
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
55567
|
-
path.setAttribute(
|
|
55568
|
-
"d",
|
|
55569
|
-
"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",
|
|
55570
|
-
);
|
|
55571
|
-
path.setAttribute("fill", "#696B76");
|
|
55572
|
-
fileIcon.appendChild(path);
|
|
55573
|
-
boardName.appendChild(fileIcon);
|
|
55574
|
-
const boardNameTag = document.querySelector('meta[name="board-name"]');
|
|
55575
|
-
let boardNameStr = "Untitled";
|
|
55576
|
-
if (boardNameTag) {
|
|
55577
|
-
boardNameStr = boardNameTag.getAttribute("content");
|
|
55578
|
-
}
|
|
55579
|
-
const p = document.createElement("p");
|
|
55580
|
-
p.textContent = boardNameStr;
|
|
55581
|
-
p.style.fontSize = "16px";
|
|
55582
|
-
p.style.lineHeight = "24px";
|
|
55583
|
-
boardName.appendChild(p);
|
|
55584
|
-
const cloudIcon = document.createElementNS(
|
|
55585
|
-
"http://www.w3.org/2000/svg",
|
|
55586
|
-
"svg",
|
|
55587
|
-
);
|
|
55588
|
-
cloudIcon.setAttribute("width", "20");
|
|
55589
|
-
cloudIcon.setAttribute("height", "18");
|
|
55590
|
-
cloudIcon.setAttribute("viewBox", "0 0 20 18");
|
|
55591
|
-
cloudIcon.setAttribute("fill", "none");
|
|
55592
|
-
cloudIcon.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
55593
|
-
const cloudIconPath = document.createElementNS(
|
|
55594
|
-
"http://www.w3.org/2000/svg",
|
|
55595
|
-
"path",
|
|
55596
|
-
);
|
|
55597
|
-
cloudIconPath.setAttribute(
|
|
55598
|
-
"d",
|
|
55599
|
-
"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",
|
|
55600
|
-
);
|
|
55601
|
-
cloudIconPath.setAttribute("fill", "#696B76");
|
|
55602
|
-
cloudIcon.appendChild(cloudIconPath);
|
|
55603
|
-
boardName.appendChild(cloudIcon);
|
|
55604
|
-
boardName.style.display = "flex";
|
|
55605
|
-
boardName.style.alignItems = "center";
|
|
55606
|
-
boardName.style.gap = "8px";
|
|
55607
|
-
titlePanel.appendChild(boardName);
|
|
55608
|
-
titlePanel.appendChild(separator);
|
|
55609
|
-
titlePanel.appendChild(editButton);
|
|
55610
|
-
document.body.appendChild(titlePanel);
|
|
55611
|
-
|
|
55612
|
-
editButton.onclick = async () => {
|
|
55613
|
-
editButton.disabled = true;
|
|
55614
|
-
editButton.textContent = "Loading...";
|
|
55615
|
-
|
|
55616
|
-
try {
|
|
55617
|
-
document.removeEventListener("mousedown", handleMouseDown);
|
|
55618
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
55619
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
55620
|
-
document.removeEventListener("wheel", handleWheel, {
|
|
55621
|
-
passive: false,
|
|
55622
|
-
});
|
|
55623
|
-
translateX = 0;
|
|
55624
|
-
translateY = 0;
|
|
55625
|
-
scale = 1;
|
|
55626
|
-
updateTransform();
|
|
55627
|
-
|
|
55628
|
-
const { initBrowserSettings } = await import(
|
|
55629
|
-
"https://www.unpkg.com/test_package_board@0.0.99/dist/bundle.js"
|
|
55630
|
-
);
|
|
55631
|
-
initBrowserSettings();
|
|
55632
|
-
|
|
55633
|
-
const { createApp } = await import(
|
|
55634
|
-
"https://www.unpkg.com/test_package_board@0.0.99/dist/bundle.js"
|
|
55635
|
-
);
|
|
55636
|
-
|
|
55637
|
-
const app = createApp();
|
|
55638
|
-
window.app = app;
|
|
55639
|
-
const stringed = await app.openAndEditFile();
|
|
55640
|
-
|
|
55641
|
-
if (stringed) {
|
|
55642
|
-
await app.openBoardFromFile();
|
|
55643
|
-
app.getBoard().deserializeHTML(stringed);
|
|
55644
|
-
app.localRender("items");
|
|
55645
|
-
}
|
|
55646
|
-
|
|
55647
|
-
const response = await fetch(
|
|
55648
|
-
"https://www.unpkg.com/test_package_board@0.0.99/dist/bundle.css",
|
|
55649
|
-
);
|
|
55650
|
-
const cssText = await response.text();
|
|
55651
|
-
const styleEl = document.createElement("style");
|
|
55652
|
-
styleEl.textContent = cssText;
|
|
55653
|
-
document.body.appendChild(styleEl);
|
|
55654
|
-
|
|
55655
|
-
const responseSvg = await fetch(
|
|
55656
|
-
"https://www.unpkg.com/test_package_board@0.0.99/dist/sprite.svg",
|
|
55657
|
-
);
|
|
55658
|
-
const svgText = await responseSvg.text();
|
|
55659
|
-
const div = document.createElement("div");
|
|
55660
|
-
div.style.display = "none";
|
|
55661
|
-
div.id = "sprite";
|
|
55662
|
-
div.innerHTML = svgText;
|
|
55663
|
-
document.body.appendChild(div);
|
|
55664
|
-
} finally {
|
|
55665
|
-
editButton.disabled = false;
|
|
55666
|
-
editButton.textContent = "Edit board";
|
|
55667
|
-
}
|
|
55668
|
-
};
|
|
55669
|
-
});
|
|
55670
|
-
`;
|
|
55671
|
-
|
|
55672
|
-
// src/public/index.css
|
|
55673
|
-
var public_default = `@import "https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap";
|
|
55674
|
-
@import "https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap";
|
|
55675
|
-
|
|
55676
|
-
/* ../src/index.css */
|
|
55677
|
-
:root {
|
|
55678
|
-
--background-surface-default: rgb(255, 255, 255);
|
|
55679
|
-
--background-button-secondary: rgb(255, 255, 255);
|
|
55680
|
-
--background-button-secondary-hover: rgb(247, 247, 248);
|
|
55681
|
-
--background-badge-purple-disabled: rgb(247, 241, 253);
|
|
55682
|
-
--background-badge-gray: rgb(233, 234, 236);
|
|
55683
|
-
--background-accent-purple: rgb(146, 79, 232);
|
|
55684
|
-
--border-action-normal: rgb(222, 223, 227);
|
|
55685
|
-
--border-action-focus: rgb(146, 79, 232);
|
|
55686
|
-
--border-select-primary: rgb(146, 79, 232);
|
|
55687
|
-
--text-base-primary: rgb(20, 21, 26);
|
|
55688
|
-
--text-base-secondary: rgba(15, 19, 36, 0.6);
|
|
55689
|
-
--text-base-quaternary: rgb(10, 15, 41, 0.25);
|
|
55690
|
-
--text-accent-purple: rgb(152, 89, 233);
|
|
55691
|
-
--icon-base-primary: rgb(20, 21, 26);
|
|
55692
|
-
--icon-base-secondary: rgb(105, 107, 118);
|
|
55693
|
-
--icon-accent-purple: rgb(146, 79, 232);
|
|
55694
|
-
--absolute-position-panel-padding: 12px;
|
|
55695
|
-
}
|
|
55696
|
-
* {
|
|
55697
|
-
box-sizing: border-box;
|
|
55698
|
-
padding: 0;
|
|
55699
|
-
margin: 0;
|
|
55700
|
-
border: none;
|
|
55701
|
-
background: none;
|
|
55702
|
-
font-family: inherit;
|
|
55703
|
-
}
|
|
55704
|
-
html {
|
|
55705
|
-
font-size: 62.5%;
|
|
55706
|
-
}
|
|
55707
|
-
body {
|
|
55708
|
-
color: var(--text-base-primary);
|
|
55709
|
-
font-size: 1.6rem;
|
|
55710
|
-
font-optical-sizing: auto;
|
|
55711
|
-
font-style: normal;
|
|
55712
|
-
font-family: "Manrope", sans-serif;
|
|
55713
|
-
}
|
|
55714
|
-
html,
|
|
55715
|
-
body {
|
|
55716
|
-
overscroll-behavior-x: none;
|
|
55717
|
-
-webkit-user-select: none;
|
|
55718
|
-
}
|
|
55719
|
-
input:-webkit-autofill,
|
|
55720
|
-
input:-webkit-autofill:hover,
|
|
55721
|
-
input:-webkit-autofill:focus,
|
|
55722
|
-
input:-webkit-autofill:active {
|
|
55723
|
-
-webkit-box-shadow: 0 0 0 30px white inset !important;
|
|
55724
|
-
}
|
|
55725
|
-
`;
|
|
55726
|
-
|
|
55727
|
-
// src/public/loadLinkImages.js
|
|
55728
|
-
var loadLinkImages_default = `document.addEventListener("DOMContentLoaded", function () {
|
|
55729
|
-
document.querySelectorAll(".link-object").forEach(linkItem => {
|
|
55730
|
-
const linkImage = linkItem.querySelector(".link-image");
|
|
55731
|
-
const linkContainer = linkItem.querySelector("a");
|
|
55732
|
-
linkImage.onerror = () => {
|
|
55733
|
-
linkImage.onerror = null;
|
|
55734
|
-
linkImage.style.display = "none";
|
|
55735
|
-
const svgNamespace = "http://www.w3.org/2000/svg";
|
|
55736
|
-
const svg = document.createElementNS(svgNamespace, "svg");
|
|
55737
|
-
svg.setAttribute("width", "20");
|
|
55738
|
-
svg.setAttribute("height", "20");
|
|
55739
|
-
svg.setAttribute("viewBox", "0 0 13 14");
|
|
55740
|
-
svg.setAttribute("fill", "none");
|
|
55741
|
-
|
|
55742
|
-
const path = document.createElementNS(svgNamespace, "path");
|
|
55743
|
-
path.setAttribute(
|
|
55744
|
-
"d",
|
|
55745
|
-
"M11.0054 3.414L2.39838 12.021L0.984375 10.607L9.59037 2H2.00538V0H13.0054V11H11.0054V3.414Z",
|
|
55746
|
-
);
|
|
55747
|
-
path.setAttribute("fill", "#924FE8");
|
|
55748
|
-
svg.appendChild(path);
|
|
55749
|
-
|
|
55750
|
-
linkContainer.appendChild(svg);
|
|
55751
|
-
};
|
|
55752
|
-
});
|
|
55753
|
-
});
|
|
55754
|
-
`;
|
|
55755
|
-
|
|
55756
55346
|
// src/Board.ts
|
|
55757
55347
|
class Board {
|
|
55758
55348
|
boardId;
|
|
@@ -56135,47 +55725,29 @@ class Board {
|
|
|
56135
55725
|
return this.copy();
|
|
56136
55726
|
}
|
|
56137
55727
|
serializeHTML() {
|
|
56138
|
-
const customTagsScript = customWebComponents_default;
|
|
56139
|
-
const loadLinksImagesScript = loadLinkImages_default;
|
|
56140
|
-
const css = public_default;
|
|
56141
55728
|
const boardName = this.getName() || this.getBoardId();
|
|
56142
55729
|
const items = this.items.getWholeHTML(conf.documentFactory);
|
|
56143
55730
|
const itemsDiv = `<div id="items">${items}</div>`;
|
|
56144
55731
|
const scripts = `
|
|
56145
|
-
<script type="module"
|
|
56146
|
-
|
|
55732
|
+
<script type="module" src="https://unpkg.com/microboard-ui-temp/dist/customWebComponents.js"></script>
|
|
55733
|
+
<script type="module" src="https://unpkg.com/microboard-ui-temp/dist/controlsHandlers.js"></script>
|
|
55734
|
+
<script type="module" src="https://unpkg.com/microboard-ui-temp/dist/titlePanel.js"></script>
|
|
55735
|
+
<script defer src="https://unpkg.com/microboard-ui-temp/dist/loadLinksImages.js"></script>
|
|
56147
55736
|
`;
|
|
56148
55737
|
const body = `<body style="overflow-x: hidden; overflow-y: hidden;">${itemsDiv}${scripts}</body>`;
|
|
56149
55738
|
const head = `
|
|
56150
|
-
|
|
56151
|
-
|
|
56152
|
-
|
|
56153
|
-
|
|
56154
|
-
|
|
56155
|
-
|
|
56156
|
-
|
|
56157
|
-
|
|
56158
|
-
|
|
56159
|
-
|
|
56160
|
-
|
|
56161
|
-
|
|
56162
|
-
appearance: none;
|
|
56163
|
-
width: 3px;
|
|
56164
|
-
height: 3px
|
|
56165
|
-
}
|
|
56166
|
-
::-webkit-scrollbar-button {
|
|
56167
|
-
display: none;
|
|
56168
|
-
}
|
|
56169
|
-
::-webkit-scrollbar-thumb {
|
|
56170
|
-
display: block;
|
|
56171
|
-
background-color: black;
|
|
56172
|
-
border-radius: 2px;
|
|
56173
|
-
}
|
|
56174
|
-
body {
|
|
56175
|
-
background-color: rgba(200, 200, 200, 0.2);
|
|
56176
|
-
}
|
|
56177
|
-
</style>
|
|
56178
|
-
</head>`.replace(/\t|\n/g, "");
|
|
55739
|
+
<head>
|
|
55740
|
+
<meta charset="utf-8" />
|
|
55741
|
+
<meta name="last-event-order" content="${this.events?.log.getLastIndex()}" />
|
|
55742
|
+
<title>Microboard ${boardName}</title>
|
|
55743
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
55744
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
55745
|
+
<link
|
|
55746
|
+
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap"
|
|
55747
|
+
rel="stylesheet"
|
|
55748
|
+
/>
|
|
55749
|
+
<link rel="stylesheet" crossorigin href="https://unpkg.com/microboard-ui-temp/dist/board.css" />
|
|
55750
|
+
</head>`.replace(/\t|\n/g, "");
|
|
56179
55751
|
return `${head}${body}`;
|
|
56180
55752
|
}
|
|
56181
55753
|
deserializeHTMLAndEmit(stringedHTML) {
|
|
@@ -56245,7 +55817,10 @@ class Board {
|
|
|
56245
55817
|
const addItem = (itemData) => {
|
|
56246
55818
|
const item = this.createItem(itemData.id, itemData);
|
|
56247
55819
|
if (item instanceof Connector2) {
|
|
56248
|
-
createdConnectors[itemData.id] = {
|
|
55820
|
+
createdConnectors[itemData.id] = {
|
|
55821
|
+
item,
|
|
55822
|
+
itemData
|
|
55823
|
+
};
|
|
56249
55824
|
}
|
|
56250
55825
|
if ("index" in item && item.index) {
|
|
56251
55826
|
createdGroups[item.getId()] = { item, itemData };
|
|
@@ -56280,10 +55855,16 @@ class Board {
|
|
|
56280
55855
|
for (const itemData of items) {
|
|
56281
55856
|
const item = this.createItem(itemData.id, itemData);
|
|
56282
55857
|
if (item instanceof Connector2) {
|
|
56283
|
-
createdConnectors[itemData.id] = {
|
|
55858
|
+
createdConnectors[itemData.id] = {
|
|
55859
|
+
item,
|
|
55860
|
+
itemData
|
|
55861
|
+
};
|
|
56284
55862
|
}
|
|
56285
55863
|
if ("index" in item && item.index) {
|
|
56286
|
-
createdGroups[item.getId()] = {
|
|
55864
|
+
createdGroups[item.getId()] = {
|
|
55865
|
+
item,
|
|
55866
|
+
itemData
|
|
55867
|
+
};
|
|
56287
55868
|
}
|
|
56288
55869
|
this.index.insert(item);
|
|
56289
55870
|
}
|
|
@@ -56525,7 +56106,7 @@ class Board {
|
|
|
56525
56106
|
itemData.transformation.translateX = translateX - minX + x;
|
|
56526
56107
|
itemData.transformation.translateY = translateY - minY + y;
|
|
56527
56108
|
}
|
|
56528
|
-
if ("children" in itemData && itemData.children) {
|
|
56109
|
+
if ("children" in itemData && itemData.children?.length) {
|
|
56529
56110
|
itemData.children = itemData.children.map((childId) => newItemIdMap[childId]);
|
|
56530
56111
|
}
|
|
56531
56112
|
newMap[newItemId] = itemData;
|
|
@@ -56657,7 +56238,7 @@ class Board {
|
|
|
56657
56238
|
itemData.transformation.translateX = translateX + width2 * 10 + 10;
|
|
56658
56239
|
}
|
|
56659
56240
|
}
|
|
56660
|
-
if (itemData
|
|
56241
|
+
if ("children" in itemData && itemData.children?.length) {
|
|
56661
56242
|
itemData.children = itemData.children.map((childId) => newItemIdMap[childId]);
|
|
56662
56243
|
}
|
|
56663
56244
|
newMap[newItemId] = itemData;
|
package/dist/microboard.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.microboard-quickAddButton{transform-origin:50%;z-index:2;background-color:#93aff6;border:1px solid #fff;-webkit-border-radius:50%;border-radius:50%;margin:auto;padding:14px;transition:transform .2s,border 0s .2s;position:absolute;transform:translate(-50%,-50%)scale(.25)}.microboard-invisible{display:none}.microboard-quickAddButtonActive{background-color:#924fe8;border:none;transform:translate(-50%,-50%)scale(1)}.microboard-quickAddButton:after{content:"";opacity:1;-webkit-border-radius:50%;border-radius:50%;transition:all .2s .2s;position:absolute;top:0;bottom:0;left:0;right:0;transform:scale(4)}.microboard-quickAddButtonActive:after{opacity:0;transform:none}.microboard-quickAddButton:before{content:"";--quick-add-button-width:17px;--quick-add-button-height:10px;width:var(--quick-add-button-width);height:var(--quick-add-button-height);opacity:0;transform-origin:50%;background:url("data:image/svg+xml;utf8,<svg width=\"var(--quick-add-button-width)\" height=\"var(--quick-add-button-height)\" viewBox=\"0 0 17 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16.7593 5.00009L10.5339 9.58329L9.68819 8.30677L12.9245 5.83329H0.0415039V4.16663H12.9241L9.68819 1.69341L10.5339 0.416626L16.7593 5.00009Z\" fill=\"white\"/></svg>") no-repeat;transition:opacity .2s;position:absolute;top:35%;left:20%}.microboard-quickAddButtonActive:before{opacity:1}.microboard-quickAddButton.microboard-left:before{rotate:180deg}.microboard-quickAddButton.microboard-right:before{rotate:none}.microboard-quickAddButton.microboard-top:before{rotate:270deg}.microboard-quickAddButton.microboard-bottom:before{rotate:90deg}
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
declare class RichTextElement extends HTMLElement {
|
|
2
|
-
}
|
|
3
|
-
declare class ShapeItemElement extends HTMLElement {
|
|
4
|
-
}
|
|
5
|
-
declare class StickerElement extends HTMLElement {
|
|
6
|
-
}
|
|
7
|
-
declare class DrawingElement extends HTMLElement {
|
|
8
|
-
}
|
|
9
|
-
declare class ConnectorElement extends HTMLElement {
|
|
10
|
-
}
|
|
11
|
-
declare class FrameItemElement extends HTMLElement {
|
|
12
|
-
}
|
|
13
|
-
declare class ImageItemElement extends HTMLElement {
|
|
14
|
-
}
|
|
15
|
-
declare class LinkItemElement extends HTMLElement {
|
|
16
|
-
}
|
|
17
|
-
declare class AINodeItemElement extends HTMLElement {
|
|
18
|
-
}
|
|
19
|
-
declare class VideoItemElement extends HTMLElement {
|
|
20
|
-
}
|
|
21
|
-
declare class CommentElement extends HTMLElement {
|
|
22
|
-
}
|
|
23
|
-
declare class AudioItemElement extends HTMLElement {
|
|
24
|
-
}
|
|
File without changes
|