microboard-ui-temp 0.0.50 → 0.1.0
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/README.md +1 -13
- package/dist/board.html +2 -0
- package/dist/customWebComponents.js +4 -18
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/board.html
CHANGED
|
@@ -22,17 +22,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
22
22
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
// src/Config.ts
|
|
26
|
-
var frontConf = {
|
|
27
|
-
apiURL: undefined,
|
|
28
|
-
wsURL: undefined
|
|
29
|
-
};
|
|
30
|
-
var isSnapshotInIframe = typeof window !== "undefined" && window.parent && window.parent !== window && window.parent.location.href.includes("/snapshots/");
|
|
31
|
-
var baseUrl = typeof process !== "undefined" && process.env.BASE_URL ? process.env.BASE_URL : isSnapshotInIframe ? `${window.parent.location.protocol}//${window.parent.location.host}` : `${location.protocol}//${location.host}`;
|
|
32
|
-
var parsedUrl = new URL(baseUrl);
|
|
33
|
-
var PROTOCOL = parsedUrl.protocol;
|
|
34
|
-
var HOST = parsedUrl.host;
|
|
35
|
-
|
|
36
25
|
// src/public/customWebComponents.ts
|
|
37
26
|
class RichTextElement extends HTMLElement {
|
|
38
27
|
constructor() {
|
|
@@ -201,8 +190,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
201
190
|
editIcon.appendChild(editIconPath);
|
|
202
191
|
editButton.appendChild(editIcon);
|
|
203
192
|
const editFileText = document.createElement("p");
|
|
204
|
-
const
|
|
205
|
-
editFileText.textContent =
|
|
193
|
+
const isSnapshotInIframe = window.parent && window.parent !== window && window.parent.location.href.includes("/snapshots/");
|
|
194
|
+
editFileText.textContent = isSnapshotInIframe ? "Edit copy" : "Edit file";
|
|
206
195
|
editButton.appendChild(editFileText);
|
|
207
196
|
editButton.style.backgroundColor = "rgba(20, 21, 26, 1)";
|
|
208
197
|
editButton.style.cursor = "pointer";
|
|
@@ -319,13 +308,10 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
319
308
|
ev.stopPropagation();
|
|
320
309
|
const htmlContent = document.documentElement.innerHTML;
|
|
321
310
|
const boardName2 = document.title?.trim() || "shared-board";
|
|
322
|
-
const { boardsApi,
|
|
311
|
+
const { boardsApi, api } = await import("https://www.unpkg.com/microboard-ui-temp/dist/index.js");
|
|
323
312
|
api.updateURL("https://dev-app.microboard.io/api/v1");
|
|
324
|
-
frontConf.wsURL = "wss://dev-app.microboard.io/ws";
|
|
325
313
|
const boardRes = await boardsApi.createBoard(boardName2, true);
|
|
326
|
-
|
|
327
|
-
console.log("boardid", boardRes);
|
|
328
|
-
console.log("snapshot pub", publishedSnapshot);
|
|
314
|
+
await boardsApi.publishSnapshot(htmlContent, boardRes.data.id, boardRes.data.id);
|
|
329
315
|
window.location.href = `https://dev-app.microboard.io/boards/${boardRes.data.id}`;
|
|
330
316
|
};
|
|
331
317
|
shareButton.onclick = handleShareBoard;
|