microboard-ui-temp 0.0.32 → 0.0.34
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/board.html +3 -3
- package/dist/customWebComponents.js +5 -5
- package/dist/index.js +12 -19
- package/package.json +2 -2
package/dist/board.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
crossorigin
|
|
14
|
-
href="https://unpkg.com/microboard-ui-temp@0.0.
|
|
14
|
+
href="https://unpkg.com/microboard-ui-temp@0.0.34/dist/board.css"
|
|
15
15
|
/>
|
|
16
16
|
<body style="overflow-x: hidden; overflow-y: hidden">
|
|
17
17
|
<div id="items">
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
</div>
|
|
85
85
|
<script
|
|
86
86
|
type="module"
|
|
87
|
-
src="https://unpkg.com/microboard-ui-temp@0.0.
|
|
87
|
+
src="https://unpkg.com/microboard-ui-temp@0.0.34/dist/customWebComponents.js"
|
|
88
88
|
></script>
|
|
89
89
|
<script
|
|
90
90
|
defer
|
|
91
|
-
src="https://unpkg.com/microboard-ui-temp@0.0.
|
|
91
|
+
src="https://unpkg.com/microboard-ui-temp@0.0.34/dist/loadLinksImages.js"
|
|
92
92
|
></script>
|
|
93
93
|
</body>
|
|
94
94
|
</head>
|
|
@@ -275,9 +275,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
275
275
|
translateY = 0;
|
|
276
276
|
scale = 1;
|
|
277
277
|
updateTransform();
|
|
278
|
-
const { initInter } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.
|
|
278
|
+
const { initInter } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.34/dist/index.js");
|
|
279
279
|
initInter();
|
|
280
|
-
const { createApp } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.
|
|
280
|
+
const { createApp } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.34/dist/index.js");
|
|
281
281
|
const app = createApp();
|
|
282
282
|
window.app = app;
|
|
283
283
|
const stringed = await app.openAndEditFile();
|
|
@@ -286,12 +286,12 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
286
286
|
app.getBoard().deserializeHTML(stringed);
|
|
287
287
|
app.localRender("items");
|
|
288
288
|
}
|
|
289
|
-
const response = await fetch("https://www.unpkg.com/microboard-ui-temp@0.0.
|
|
289
|
+
const response = await fetch("https://www.unpkg.com/microboard-ui-temp@0.0.34/dist/index.css");
|
|
290
290
|
const cssText = await response.text();
|
|
291
291
|
const styleEl = document.createElement("style");
|
|
292
292
|
styleEl.textContent = cssText;
|
|
293
293
|
document.body.appendChild(styleEl);
|
|
294
|
-
const responseSvg = await fetch("https://www.unpkg.com/microboard-ui-temp@0.0.
|
|
294
|
+
const responseSvg = await fetch("https://www.unpkg.com/microboard-ui-temp@0.0.34/dist/sprite.svg");
|
|
295
295
|
const svgText = await responseSvg.text();
|
|
296
296
|
const div = document.createElement("div");
|
|
297
297
|
div.style.display = "none";
|
|
@@ -308,7 +308,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
308
308
|
ev.stopPropagation();
|
|
309
309
|
const htmlContent = document.documentElement.innerHTML;
|
|
310
310
|
const boardName2 = document.title?.trim() || "shared-board";
|
|
311
|
-
const { boardsApi, createApp, conf } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.
|
|
311
|
+
const { boardsApi, createApp, conf } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.34/dist/index.js");
|
|
312
312
|
conf.apiURL = "https://dev-app.microboard.io/api/v1/";
|
|
313
313
|
const boardId = await boardsApi.createBoardUnAuthed(boardName2);
|
|
314
314
|
const app = createApp();
|
package/dist/index.js
CHANGED
|
@@ -255869,8 +255869,10 @@ class Card extends BaseItem {
|
|
|
255869
255869
|
this.throttledBringToFront = throttle2(() => {
|
|
255870
255870
|
this.board.bringToFront(this);
|
|
255871
255871
|
}, 1000);
|
|
255872
|
-
this.transformation.subject.subscribe(() => {
|
|
255873
|
-
this.
|
|
255872
|
+
this.transformation.subject.subscribe((_, op) => {
|
|
255873
|
+
if (this.parent === "Board" && op.method === "translateBy" || op.method === "transformMany" && !Object.keys(op.items).length) {
|
|
255874
|
+
this.throttledBringToFront();
|
|
255875
|
+
}
|
|
255874
255876
|
this.updateMbr();
|
|
255875
255877
|
this.subject.publish(this);
|
|
255876
255878
|
});
|
|
@@ -353029,10 +353031,7 @@ function ContextMenu() {
|
|
|
353029
353031
|
app.getBoard().deserializeHTML(stringedHTML);
|
|
353030
353032
|
}
|
|
353031
353033
|
app.render();
|
|
353032
|
-
const sumMbr =
|
|
353033
|
-
...app.getBoard().items.listAll(),
|
|
353034
|
-
...app.getBoard().items.listFrames()
|
|
353035
|
-
].reduce((acc, item) => {
|
|
353034
|
+
const sumMbr = app.getBoard().items.listAll().reduce((acc, item) => {
|
|
353036
353035
|
if (!acc) {
|
|
353037
353036
|
return item.getMbr();
|
|
353038
353037
|
}
|
|
@@ -420501,27 +420500,21 @@ function CreateCardsModal() {
|
|
|
420501
420500
|
const handleCardsClick = () => cardsInputRef.current?.click();
|
|
420502
420501
|
const createDeck = (backsideUrl, faceUrls) => {
|
|
420503
420502
|
const cards2 = [];
|
|
420504
|
-
const { left: left2, top: top2, bottom: bottom2, right: right2 } = board.camera.getMbr();
|
|
420505
|
-
const x10 = (left2 + right2) / 2;
|
|
420506
|
-
const y14 = (top2 + bottom2) / 2;
|
|
420507
420503
|
faceUrls.forEach((faceUrl, index4) => {
|
|
420508
420504
|
const card = new Card(board, index4 + faceUrl, {
|
|
420509
420505
|
backsideUrl,
|
|
420510
420506
|
faceUrl
|
|
420511
420507
|
});
|
|
420512
|
-
card.transformation.apply({
|
|
420513
|
-
class: "Transformation",
|
|
420514
|
-
method: "translateTo",
|
|
420515
|
-
item: [card.getId()],
|
|
420516
|
-
x: x10,
|
|
420517
|
-
y: y14
|
|
420518
|
-
});
|
|
420519
420508
|
cards2.push(card);
|
|
420520
420509
|
});
|
|
420521
420510
|
const itemsMap = {};
|
|
420522
420511
|
cards2.forEach((card) => {
|
|
420523
420512
|
itemsMap[card.getId()] = card.serialize();
|
|
420524
420513
|
});
|
|
420514
|
+
const { left: left2, top: top2, bottom: bottom2, right: right2 } = board.camera.getMbr();
|
|
420515
|
+
const x10 = (left2 + right2) / 2 - cards2[0].getWidth() / 2;
|
|
420516
|
+
const y14 = (top2 + bottom2) / 2 - cards2[0].getHeight() / 2;
|
|
420517
|
+
board.pointer.pointTo(x10, y14);
|
|
420525
420518
|
board.paste(itemsMap, false, false);
|
|
420526
420519
|
};
|
|
420527
420520
|
const handleCoverChange = (e15) => {
|
|
@@ -423668,7 +423661,7 @@ function ZoomPanel() {
|
|
|
423668
423661
|
const { t: t11 } = useTranslation();
|
|
423669
423662
|
const isMobile2 = useMediaQuery("screen and (max-width: 1200px)");
|
|
423670
423663
|
const zoomToFit = () => {
|
|
423671
|
-
const items =
|
|
423664
|
+
const items = board.items.listAll();
|
|
423672
423665
|
if (items.length > 0) {
|
|
423673
423666
|
const rect = new Mbr(1e6, 1e6, -1e6, -1e6);
|
|
423674
423667
|
items.forEach((item) => rect.combine([item.getMbr()]));
|
|
@@ -423943,7 +423936,7 @@ var LinksProvider = () => {
|
|
|
423943
423936
|
}
|
|
423944
423937
|
window.open(url3, "_blank");
|
|
423945
423938
|
}, []);
|
|
423946
|
-
return /* @__PURE__ */ import_react396.default.createElement(import_react396.default.Fragment, null,
|
|
423939
|
+
return /* @__PURE__ */ import_react396.default.createElement(import_react396.default.Fragment, null, board.items.listAll().filter((item) => item.getLinkTo() && !item.transformationRenderBlock).map((item) => {
|
|
423947
423940
|
return /* @__PURE__ */ import_react396.default.createElement(LinkToButton, {
|
|
423948
423941
|
item,
|
|
423949
423942
|
key: item.getId(),
|
|
@@ -446836,7 +446829,7 @@ function createApp(isHistory = true) {
|
|
|
446836
446829
|
newBoard.camera.zoomToFit(itemsMbr);
|
|
446837
446830
|
}
|
|
446838
446831
|
}
|
|
446839
|
-
const isItemsOnBoard = newBoard.items.listAll().length > 0
|
|
446832
|
+
const isItemsOnBoard = newBoard.items.listAll().length > 0;
|
|
446840
446833
|
if (newBoard.items.getItemsInView().length === 0 && isItemsOnBoard) {
|
|
446841
446834
|
newBoard.camera.zoomToFit(newBoard.items.getMbr());
|
|
446842
446835
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microboard-ui-temp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
51
51
|
"js-cookie": "^3.0.5",
|
|
52
52
|
"jwt-decode": "^4.0.0",
|
|
53
|
-
"microboard-temp": "^0.4.
|
|
53
|
+
"microboard-temp": "^0.4.89",
|
|
54
54
|
"nanoid": "^5.1.5",
|
|
55
55
|
"prop-types": "^15.8.1",
|
|
56
56
|
"react-hot-toast": "2.4.1",
|