microboard-ui-temp 0.0.31 → 0.0.32
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 +19 -11
- package/package.json +1 -1
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.32/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.32/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.32/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.32/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.32/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.32/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.32/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.32/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
|
@@ -338066,30 +338066,38 @@ function createConnection(getCurrentBoard, getAccount3, getStorage) {
|
|
|
338066
338066
|
}, "*");
|
|
338067
338067
|
}
|
|
338068
338068
|
async function publishAuth() {
|
|
338069
|
+
if (isAuthPublishing.flag && tokenPromise) {
|
|
338070
|
+
return tokenPromise.promise;
|
|
338071
|
+
}
|
|
338072
|
+
let localTokenPromise = tokenPromise;
|
|
338073
|
+
let needsCleanup = false;
|
|
338069
338074
|
try {
|
|
338070
|
-
if (isAuthPublishing.flag) {
|
|
338071
|
-
return tokenPromise?.promise;
|
|
338072
|
-
}
|
|
338073
338075
|
isAuthPublishing.flag = true;
|
|
338074
|
-
|
|
338075
|
-
if (!
|
|
338076
|
-
|
|
338076
|
+
needsCleanup = true;
|
|
338077
|
+
if (!localTokenPromise) {
|
|
338078
|
+
localTokenPromise = createPromiseWithResolvers();
|
|
338079
|
+
tokenPromise = localTokenPromise;
|
|
338077
338080
|
}
|
|
338081
|
+
const account = getAccount3();
|
|
338078
338082
|
await account.refreshTokens();
|
|
338079
338083
|
const jwt = account.accessToken;
|
|
338080
338084
|
if (!jwt) {
|
|
338085
|
+
localTokenPromise.resolve();
|
|
338081
338086
|
return;
|
|
338082
338087
|
}
|
|
338083
338088
|
ws4.send({
|
|
338084
338089
|
type: "Auth",
|
|
338085
338090
|
jwt
|
|
338086
338091
|
});
|
|
338087
|
-
|
|
338088
|
-
} catch {
|
|
338089
|
-
console.info("Unauthorized");
|
|
338092
|
+
localTokenPromise.resolve();
|
|
338093
|
+
} catch (error3) {
|
|
338094
|
+
console.info("Unauthorized", error3);
|
|
338095
|
+
localTokenPromise?.resolve();
|
|
338090
338096
|
} finally {
|
|
338091
|
-
|
|
338092
|
-
|
|
338097
|
+
if (needsCleanup) {
|
|
338098
|
+
isAuthPublishing.flag = false;
|
|
338099
|
+
tokenPromise = null;
|
|
338100
|
+
}
|
|
338093
338101
|
}
|
|
338094
338102
|
}
|
|
338095
338103
|
function publishLogout() {
|