microboard-ui-temp 0.0.40 → 0.0.42
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 +6 -6
- package/dist/index.js +17 -4
- 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.42/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.42/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.42/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.42/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.42/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.42/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.42/dist/sprite.svg");
|
|
295
295
|
const svgText = await responseSvg.text();
|
|
296
296
|
const div = document.createElement("div");
|
|
297
297
|
div.style.display = "none";
|
|
@@ -308,8 +308,8 @@ 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, frontConf } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.
|
|
312
|
-
|
|
311
|
+
const { boardsApi, createApp, frontConf, api } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.42/dist/index.js");
|
|
312
|
+
api.updateURL("https://dev-app.microboard.io/api/v1/");
|
|
313
313
|
const boardId = await boardsApi.createBoardUnAuthed(boardName2);
|
|
314
314
|
const app = createApp();
|
|
315
315
|
window.app = app;
|
package/dist/index.js
CHANGED
|
@@ -229968,6 +229968,7 @@ class BaseItem extends Mbr {
|
|
|
229968
229968
|
onRemoveCallbacks = [];
|
|
229969
229969
|
shouldUseCustomRender = false;
|
|
229970
229970
|
shouldRenderOutsideViewRect = true;
|
|
229971
|
+
shouldUseRelativeAlignment = true;
|
|
229971
229972
|
itemType = "";
|
|
229972
229973
|
constructor(board, id = "", defaultItemData, isGroupItem) {
|
|
229973
229974
|
super();
|
|
@@ -253765,10 +253766,10 @@ class AlignmentHelper {
|
|
|
253765
253766
|
}
|
|
253766
253767
|
};
|
|
253767
253768
|
nearbyItems.forEach((item) => {
|
|
253768
|
-
if (item === movingItem || item.itemType === "Comment") {
|
|
253769
|
+
if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
|
|
253769
253770
|
return;
|
|
253770
253771
|
}
|
|
253771
|
-
const itemMbr = item.
|
|
253772
|
+
const itemMbr = item.getPathMbr();
|
|
253772
253773
|
const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
|
|
253773
253774
|
const centerXItem = (itemMbr.left + itemMbr.right) / 2;
|
|
253774
253775
|
const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
|
|
@@ -255988,6 +255989,7 @@ class Deck extends BaseItem {
|
|
|
255988
255989
|
});
|
|
255989
255990
|
this.board.items.index.remove(foundItem);
|
|
255990
255991
|
foundItem.parent = this.getId();
|
|
255992
|
+
foundItem.shouldUseRelativeAlignment = false;
|
|
255991
255993
|
this.index?.insert(foundItem);
|
|
255992
255994
|
}
|
|
255993
255995
|
}
|
|
@@ -256012,6 +256014,7 @@ class Deck extends BaseItem {
|
|
|
256012
256014
|
});
|
|
256013
256015
|
this.index?.remove(foundItem);
|
|
256014
256016
|
foundItem.parent = "Board";
|
|
256017
|
+
foundItem.shouldUseRelativeAlignment = true;
|
|
256015
256018
|
this.board.items.index.insert(foundItem);
|
|
256016
256019
|
}
|
|
256017
256020
|
}
|
|
@@ -256099,8 +256102,8 @@ class Deck extends BaseItem {
|
|
|
256099
256102
|
return;
|
|
256100
256103
|
}
|
|
256101
256104
|
const tempCanvas = conf.documentFactory.createElement("canvas");
|
|
256102
|
-
tempCanvas.width =
|
|
256103
|
-
tempCanvas.height =
|
|
256105
|
+
tempCanvas.width = 1e4;
|
|
256106
|
+
tempCanvas.height = 1e4;
|
|
256104
256107
|
const tempCtx = tempCanvas.getContext("2d");
|
|
256105
256108
|
if (!tempCtx)
|
|
256106
256109
|
return;
|
|
@@ -284002,6 +284005,7 @@ function getApiUrl(path4) {
|
|
|
284002
284005
|
path4 = "";
|
|
284003
284006
|
}
|
|
284004
284007
|
console.log("front conf", frontConf);
|
|
284008
|
+
console.log("front conf spread", { ...frontConf });
|
|
284005
284009
|
if (frontConf.apiURL) {
|
|
284006
284010
|
return `${frontConf.apiURL}${path4}`;
|
|
284007
284011
|
}
|
|
@@ -288429,6 +288433,15 @@ class HTTP {
|
|
|
288429
288433
|
this.baseURL = config3.baseURL;
|
|
288430
288434
|
this.headers = config3.headers ?? {};
|
|
288431
288435
|
}
|
|
288436
|
+
updateURL(customURL) {
|
|
288437
|
+
if (frontConf.apiURL) {
|
|
288438
|
+
this.baseURL = frontConf.apiURL;
|
|
288439
|
+
}
|
|
288440
|
+
if (customURL) {
|
|
288441
|
+
this.baseURL = customURL;
|
|
288442
|
+
frontConf.apiURL = customURL;
|
|
288443
|
+
}
|
|
288444
|
+
}
|
|
288432
288445
|
getQuery(query) {
|
|
288433
288446
|
return createSearchParams(query).toString();
|
|
288434
288447
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microboard-ui-temp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
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.95",
|
|
54
54
|
"nanoid": "^5.1.5",
|
|
55
55
|
"prop-types": "^15.8.1",
|
|
56
56
|
"react-hot-toast": "2.4.1",
|