microboard-ui-temp 0.0.27 → 0.0.28
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 +4 -4
- package/dist/customWebComponents.js +46 -13
- package/dist/index.js +11 -3
- package/package.json +1 -1
- package/dist/chunk-vz1894k0.js +0 -0
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.28/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.28/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.28/dist/loadLinksImages.js"
|
|
92
92
|
></script>
|
|
93
|
-
|
|
93
|
+
</body>
|
|
94
94
|
</head>
|
|
@@ -22,7 +22,7 @@ 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/public/customWebComponents.
|
|
25
|
+
// src/public/customWebComponents.ts
|
|
26
26
|
class RichTextElement extends HTMLElement {
|
|
27
27
|
constructor() {
|
|
28
28
|
super();
|
|
@@ -120,16 +120,22 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
120
120
|
itemsDiv.style.transformOrigin = "0 0";
|
|
121
121
|
document.body.style.cursor = "grab";
|
|
122
122
|
function updateTransform() {
|
|
123
|
+
if (!itemsDiv) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
123
126
|
itemsDiv.style.transform = "translate(" + translateX + "px, " + translateY + "px) scale(" + scale + ")";
|
|
124
127
|
}
|
|
125
128
|
function handleMouseDown(ev) {
|
|
129
|
+
if (!itemsDiv) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
126
132
|
isDragging = true;
|
|
127
133
|
startX = ev.clientX;
|
|
128
134
|
startY = ev.clientY;
|
|
129
135
|
itemsDiv.style.cursor = "grabbing";
|
|
130
136
|
}
|
|
131
137
|
function handleMouseMove(ev) {
|
|
132
|
-
if (!isDragging) {
|
|
138
|
+
if (!isDragging || !itemsDiv) {
|
|
133
139
|
return;
|
|
134
140
|
}
|
|
135
141
|
const dx = ev.clientX - startX;
|
|
@@ -141,7 +147,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
141
147
|
updateTransform();
|
|
142
148
|
}
|
|
143
149
|
function handleMouseUp(ev) {
|
|
144
|
-
if (!isDragging) {
|
|
150
|
+
if (!isDragging || !itemsDiv) {
|
|
145
151
|
return;
|
|
146
152
|
}
|
|
147
153
|
isDragging = false;
|
|
@@ -158,7 +164,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
158
164
|
document.addEventListener("mousedown", handleMouseDown);
|
|
159
165
|
document.addEventListener("mousemove", handleMouseMove);
|
|
160
166
|
document.addEventListener("mouseup", handleMouseUp);
|
|
161
|
-
document.addEventListener("wheel", handleWheel
|
|
167
|
+
document.addEventListener("wheel", handleWheel);
|
|
162
168
|
const titlePanel = document.createElement("div");
|
|
163
169
|
titlePanel.style.boxShadow = "0px 10px 16px -3px rgba(20, 21, 26, 0.08)";
|
|
164
170
|
titlePanel.style.position = "fixed";
|
|
@@ -198,6 +204,21 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
198
204
|
editButton.style.gap = "8px";
|
|
199
205
|
editButton.style.padding = "8px";
|
|
200
206
|
editButton.style.borderRadius = "10px";
|
|
207
|
+
const shareButton = document.createElement("button");
|
|
208
|
+
const shareButtonText = document.createElement("p");
|
|
209
|
+
shareButtonText.textContent = "Share with friends";
|
|
210
|
+
shareButton.appendChild(shareButtonText);
|
|
211
|
+
shareButton.style.backgroundColor = "rgba(20, 21, 26, 1)";
|
|
212
|
+
shareButton.style.cursor = "pointer";
|
|
213
|
+
shareButton.style.boxShadow = "0px 1px 2px 0px rgba(20, 21, 26, 0.05)";
|
|
214
|
+
shareButton.style.color = "#ffff";
|
|
215
|
+
shareButton.style.fontSize = "14px";
|
|
216
|
+
shareButton.style.lineHeight = "20px";
|
|
217
|
+
shareButton.style.display = "flex";
|
|
218
|
+
shareButton.style.alignItems = "center";
|
|
219
|
+
shareButton.style.gap = "8px";
|
|
220
|
+
shareButton.style.padding = "8px";
|
|
221
|
+
shareButton.style.borderRadius = "10px";
|
|
201
222
|
const separator = document.createElement("div");
|
|
202
223
|
separator.style.borderRight = "1px solid rgba(222, 224, 227, 1)";
|
|
203
224
|
separator.style.height = "100%";
|
|
@@ -216,7 +237,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
216
237
|
const boardNameTag = document.querySelector('meta[name="board-name"]');
|
|
217
238
|
let boardNameStr = "Untitled";
|
|
218
239
|
if (boardNameTag) {
|
|
219
|
-
boardNameStr = boardNameTag.getAttribute("content");
|
|
240
|
+
boardNameStr = boardNameTag.getAttribute("content") || "";
|
|
220
241
|
}
|
|
221
242
|
const p = document.createElement("p");
|
|
222
243
|
p.textContent = boardNameStr;
|
|
@@ -240,6 +261,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
240
261
|
titlePanel.appendChild(boardName);
|
|
241
262
|
titlePanel.appendChild(separator);
|
|
242
263
|
titlePanel.appendChild(editButton);
|
|
264
|
+
titlePanel.appendChild(shareButton);
|
|
243
265
|
document.body.appendChild(titlePanel);
|
|
244
266
|
editButton.onclick = async () => {
|
|
245
267
|
editButton.disabled = true;
|
|
@@ -248,17 +270,14 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
248
270
|
document.removeEventListener("mousedown", handleMouseDown);
|
|
249
271
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
250
272
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
251
|
-
document.removeEventListener("wheel", handleWheel
|
|
252
|
-
passive: false
|
|
253
|
-
});
|
|
273
|
+
document.removeEventListener("wheel", handleWheel);
|
|
254
274
|
translateX = 0;
|
|
255
275
|
translateY = 0;
|
|
256
276
|
scale = 1;
|
|
257
277
|
updateTransform();
|
|
258
|
-
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.28/dist/index.js");
|
|
259
279
|
initInter();
|
|
260
|
-
const { createApp } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.
|
|
261
|
-
console.log("createapp", createApp);
|
|
280
|
+
const { createApp } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.28/dist/index.js");
|
|
262
281
|
const app = createApp();
|
|
263
282
|
window.app = app;
|
|
264
283
|
const stringed = await app.openAndEditFile();
|
|
@@ -267,12 +286,12 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
267
286
|
app.getBoard().deserializeHTML(stringed);
|
|
268
287
|
app.localRender("items");
|
|
269
288
|
}
|
|
270
|
-
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.28/dist/index.css");
|
|
271
290
|
const cssText = await response.text();
|
|
272
291
|
const styleEl = document.createElement("style");
|
|
273
292
|
styleEl.textContent = cssText;
|
|
274
293
|
document.body.appendChild(styleEl);
|
|
275
|
-
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.28/dist/sprite.svg");
|
|
276
295
|
const svgText = await responseSvg.text();
|
|
277
296
|
const div = document.createElement("div");
|
|
278
297
|
div.style.display = "none";
|
|
@@ -284,4 +303,18 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
284
303
|
editButton.textContent = "Edit board";
|
|
285
304
|
}
|
|
286
305
|
};
|
|
306
|
+
const handleShareBoard = async (ev) => {
|
|
307
|
+
ev.preventDefault();
|
|
308
|
+
ev.stopPropagation();
|
|
309
|
+
const htmlContent = document.documentElement.innerHTML;
|
|
310
|
+
const boardName2 = document.title?.trim() || "shared-board";
|
|
311
|
+
const { boardsApi, createApp } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.28/dist/index.js");
|
|
312
|
+
const boardId = await boardsApi.createBoardUnAuthed(boardName2);
|
|
313
|
+
const app = createApp();
|
|
314
|
+
window.app = app;
|
|
315
|
+
await app.openBoard(boardId);
|
|
316
|
+
await app.getBoard().deserializeHTMLAndEmit(htmlContent);
|
|
317
|
+
window.location.href = `https://dev-app.microboard.io/boards/${boardId}`;
|
|
318
|
+
};
|
|
319
|
+
shareButton.onclick = handleShareBoard;
|
|
287
320
|
});
|
package/dist/index.js
CHANGED
|
@@ -352244,7 +352244,7 @@ var Folder = ({
|
|
|
352244
352244
|
const boardsList = useBoardsList();
|
|
352245
352245
|
const boardId = board.getBoardId();
|
|
352246
352246
|
const accordionRef = import_react212.useRef(null);
|
|
352247
|
-
const currentBoardRef = import_react212.useRef();
|
|
352247
|
+
const currentBoardRef = import_react212.useRef(null);
|
|
352248
352248
|
const currentFolderRef = import_react212.useRef(null);
|
|
352249
352249
|
const { id: id3, foldersRefState } = useOpenedFoldersContext();
|
|
352250
352250
|
const [openedByDragging, setOpenedByDragging] = import_react212.useState(false);
|
|
@@ -352265,7 +352265,7 @@ var Folder = ({
|
|
|
352265
352265
|
data: { ...folder, parentFolderId },
|
|
352266
352266
|
disabled: folder?.type !== exports_folders.FolderType.ROOT && folder?.type !== exports_folders.FolderType.NESTED
|
|
352267
352267
|
});
|
|
352268
|
-
const isOverTimerRef = import_react212.useRef();
|
|
352268
|
+
const isOverTimerRef = import_react212.useRef(setTimeout(() => {}));
|
|
352269
352269
|
const itemRef = import_react212.useRef(null);
|
|
352270
352270
|
const style2 = transform ? {
|
|
352271
352271
|
transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,
|
|
@@ -446612,8 +446612,16 @@ cursorsMap2["sticker-light-gray"] = `url(${sticker_light_gray_default}) 12 12, a
|
|
|
446612
446612
|
cursorsMap2["sticker-gray"] = `url(${sticker_gray_default}) 12 12, auto`;
|
|
446613
446613
|
var customCursors_default = {};
|
|
446614
446614
|
export {
|
|
446615
|
+
exports_users as usersApi,
|
|
446615
446616
|
sprite_default as sprite,
|
|
446617
|
+
exports_media as mediaApi,
|
|
446616
446618
|
initInter,
|
|
446617
446619
|
customCursors_default as customCursors,
|
|
446618
|
-
createApp
|
|
446620
|
+
createApp,
|
|
446621
|
+
exports_boards as boardsApi,
|
|
446622
|
+
exports_billing as billingApi,
|
|
446623
|
+
exports_auth as authApi,
|
|
446624
|
+
api,
|
|
446625
|
+
HTTPResponse,
|
|
446626
|
+
HTTPError
|
|
446619
446627
|
};
|
package/package.json
CHANGED
package/dist/chunk-vz1894k0.js
DELETED
|
File without changes
|