microboard-ui-temp 0.0.49 → 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 CHANGED
@@ -7,17 +7,5 @@ bun install
7
7
  To build:
8
8
 
9
9
  ```bash
10
- bun run build:app
11
- ```
12
-
13
- To run:
14
-
15
- ```bash
16
- bun run start
17
- ```
18
-
19
- or:
20
-
21
- ```bash
22
- docker compose up --build
10
+ bun run build
23
11
  ```
package/dist/board.html CHANGED
@@ -90,5 +90,7 @@
90
90
  defer
91
91
  src="https://unpkg.com/microboard-ui-temp/dist/loadLinksImages.js"
92
92
  ></script>
93
+ <!-- <script type="module" src="public/customWebComponents.ts"></script>
94
+ <script defer src="public/loadLinksImages.js"></script> -->
93
95
  </body>
94
96
  </head>
@@ -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 isSnapshotInIframe2 = window.parent && window.parent !== window && window.parent.location.href.includes("/snapshots/");
205
- editFileText.textContent = isSnapshotInIframe2 ? "Edit copy" : "Edit file";
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, createApp, api } = await import("https://www.unpkg.com/microboard-ui-temp/dist/index.js");
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
- const publishedSnapshot = await boardsApi.publishSnapshot(htmlContent, boardName2, boardRes.data.id);
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;
package/dist/index.js CHANGED
@@ -256014,13 +256014,6 @@ class Deck extends BaseItem {
256014
256014
  const foundItem = this.index?.getById(childId);
256015
256015
  if (this.parent !== childId && this.getId() !== childId) {
256016
256016
  if (foundItem) {
256017
- foundItem.transformation.apply({
256018
- class: "Transformation",
256019
- method: "translateTo",
256020
- item: [this.id],
256021
- x: this.left,
256022
- y: this.top - this.getHeight() / 2
256023
- });
256024
256017
  this.index?.remove(foundItem);
256025
256018
  foundItem.parent = "Board";
256026
256019
  foundItem.shouldUseRelativeAlignment = true;
@@ -262128,7 +262121,7 @@ class Board {
262128
262121
  itemData.transformation.translateX = translateX - minX + x;
262129
262122
  itemData.transformation.translateY = translateY - minY + y;
262130
262123
  }
262131
- if (itemData.itemType === "Frame") {
262124
+ if ("children" in itemData && itemData.children) {
262132
262125
  itemData.children = itemData.children.map((childId) => newItemIdMap[childId]);
262133
262126
  }
262134
262127
  newMap[newItemId] = itemData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.0.49",
3
+ "version": "0.1.0",
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.98",
53
+ "microboard-temp": "^0.4.99",
54
54
  "nanoid": "^5.1.5",
55
55
  "prop-types": "^15.8.1",
56
56
  "react-hot-toast": "2.4.1",