microboard-ui-temp 0.0.37 → 0.0.39

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 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.37/dist/board.css"
14
+ href="https://unpkg.com/microboard-ui-temp@0.0.39/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.37/dist/customWebComponents.js"
87
+ src="https://unpkg.com/microboard-ui-temp@0.0.39/dist/customWebComponents.js"
88
88
  ></script>
89
89
  <script
90
90
  defer
91
- src="https://unpkg.com/microboard-ui-temp@0.0.37/dist/loadLinksImages.js"
91
+ src="https://unpkg.com/microboard-ui-temp@0.0.39/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.37/dist/index.js");
278
+ const { initInter } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.39/dist/index.js");
279
279
  initInter();
280
- const { createApp } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.37/dist/index.js");
280
+ const { createApp } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.39/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.37/dist/index.css");
289
+ const response = await fetch("https://www.unpkg.com/microboard-ui-temp@0.0.39/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.37/dist/sprite.svg");
294
+ const responseSvg = await fetch("https://www.unpkg.com/microboard-ui-temp@0.0.39/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, conf } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.37/dist/index.js");
312
- conf.apiURL = "https://dev-app.microboard.io/api/v1/";
311
+ const { boardsApi, createApp, frontConf } = await import("https://www.unpkg.com/microboard-ui-temp@0.0.39/dist/index.js");
312
+ frontConf.apiURL = "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
@@ -215912,9 +215912,7 @@ var conf = {
215912
215912
  FORCE_HOTKEYS: "auto",
215913
215913
  debug: false,
215914
215914
  FALLBACK_LNG: "en",
215915
- cursorsMap,
215916
- apiURL: undefined,
215917
- wsURL: undefined
215915
+ cursorsMap
215918
215916
  };
215919
215917
  initDefaultI18N();
215920
215918
 
@@ -255870,7 +255868,7 @@ class Card extends BaseItem {
255870
255868
  this.board.bringToFront(this);
255871
255869
  }, 1000);
255872
255870
  this.transformation.subject.subscribe((_, op) => {
255873
- if (this.parent === "Board" && op.method === "translateBy" || op.method === "transformMany" && !Object.keys(op.items).length) {
255871
+ if (this.parent === "Board" && op.method === "translateBy") {
255874
255872
  this.throttledBringToFront();
255875
255873
  }
255876
255874
  this.updateMbr();
@@ -255897,14 +255895,14 @@ class Card extends BaseItem {
255897
255895
  this.imageToRender = this.face;
255898
255896
  }
255899
255897
  }
255900
- render(context) {
255898
+ render(context, left) {
255901
255899
  if (this.transformationRenderBlock) {
255902
255900
  return;
255903
255901
  }
255904
255902
  const ctx = context.ctx;
255905
255903
  if (this.imageToRender && this.imageToRender.complete) {
255906
255904
  ctx.save();
255907
- ctx.drawImage(this.imageToRender, this.left, this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
255905
+ ctx.drawImage(this.imageToRender, left ? left : this.left, this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
255908
255906
  ctx.restore();
255909
255907
  }
255910
255908
  }
@@ -256100,14 +256098,16 @@ class Deck extends BaseItem {
256100
256098
  if (!width2 || !height3) {
256101
256099
  return;
256102
256100
  }
256103
- const tempCanvas = document.createElement("canvas");
256101
+ const tempCanvas = conf.documentFactory.createElement("canvas");
256104
256102
  tempCanvas.width = width2;
256105
256103
  tempCanvas.height = height3;
256106
256104
  const tempCtx = tempCanvas.getContext("2d");
256107
256105
  if (!tempCtx)
256108
256106
  return;
256109
256107
  const tempContext = { ...context, ctx: tempCtx };
256110
- this.index?.render(tempContext);
256108
+ this.index?.list().forEach((item, index2) => {
256109
+ item.render(tempContext, index2 * 2);
256110
+ });
256111
256111
  this.cachedCanvas = tempCanvas;
256112
256112
  }
256113
256113
  }
@@ -283988,6 +283988,10 @@ __export(exports_auth, {
283988
283988
  });
283989
283989
 
283990
283990
  // src/Config.ts
283991
+ var frontConf = {
283992
+ apiURL: undefined,
283993
+ wsURL: undefined
283994
+ };
283991
283995
  var isSnapshotInIframe = typeof window !== "undefined" && window.parent && window.parent !== window && window.parent.location.href.includes("/snapshots/");
283992
283996
  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}`;
283993
283997
  var parsedUrl = new URL(baseUrl);
@@ -283997,15 +284001,14 @@ function getApiUrl(path4) {
283997
284001
  if (!path4) {
283998
284002
  path4 = "";
283999
284003
  }
284000
- console.log("GETapi url", conf.apiURL);
284001
- if (conf.apiURL) {
284002
- return `${conf.apiURL}${path4}`;
284004
+ if (frontConf.apiURL) {
284005
+ return `${frontConf.apiURL}${path4}`;
284003
284006
  }
284004
284007
  return `${PROTOCOL}//${HOST}/api/v1${path4}`;
284005
284008
  }
284006
284009
  function getWebsocketUrl() {
284007
- if (conf.wsURL) {
284008
- return conf.wsURL;
284010
+ if (frontConf.wsURL) {
284011
+ return frontConf.wsURL;
284009
284012
  }
284010
284013
  return `${PROTOCOL === "https:" ? "wss" : "ws"}://${HOST}/ws`;
284011
284014
  }
@@ -447148,9 +447151,9 @@ export {
447148
447151
  sprite_default as sprite,
447149
447152
  exports_media as mediaApi,
447150
447153
  initInter,
447154
+ frontConf,
447151
447155
  customCursors_default as customCursors,
447152
447156
  createApp,
447153
- conf,
447154
447157
  exports_boards as boardsApi,
447155
447158
  exports_billing as billingApi,
447156
447159
  exports_auth as authApi,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
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.92",
53
+ "microboard-temp": "^0.4.94",
54
54
  "nanoid": "^5.1.5",
55
55
  "prop-types": "^15.8.1",
56
56
  "react-hot-toast": "2.4.1",