@arbocollab/arbo-web-scene 0.26.6-alpha.1 → 0.26.6-alpha.5

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/es/index.es.js CHANGED
@@ -11928,7 +11928,7 @@ const rlr = (e, t) => {
11928
11928
  (s = (i = e == null ? void 0 : e.config) == null ? void 0 : i.globalProperties) == null || s.setStoreValue("scene", "setCurrentSceneTabId", a);
11929
11929
  }
11930
11930
  return e.config.globalProperties.setStoreValue = r, e.config.globalProperties.handleSetTab = o, { handleSetTab: o };
11931
- }, olr = "0.26.6-alpha.1", alr = {
11931
+ }, olr = "0.26.6-alpha.5", alr = {
11932
11932
  "@arbocollab/arbo-chart-component": "1.0.1",
11933
11933
  "@arbocollab/arbo-comment-utils": "1.0.1",
11934
11934
  "@arbocollab/arbo-common-utils": "npm:@arbocollab/arbo-common-utils@0.0.12-alpha.0",
@@ -30685,10 +30685,10 @@ const KA = () => {
30685
30685
  is_primary_eq: 1,
30686
30686
  is_point_metric_eq: 1,
30687
30687
  condition_combine_type: "or"
30688
- }, k = Ba.get(`/workspace/${e}/items/${y}/metrics`, { params: D });
30689
- return console.log("metricPointApi", k), k;
30688
+ };
30689
+ return Ba.get(`/workspace/${e}/items/${y}/metrics`, { params: D });
30690
30690
  } catch (y) {
30691
- console.log("metricPointApi", y);
30691
+ console.error("metricPointApi", y);
30692
30692
  }
30693
30693
  },
30694
30694
  getUserBasicInforAPI: async (y) => {
@@ -30696,7 +30696,7 @@ const KA = () => {
30696
30696
  const D = await Ba.get(
30697
30697
  `/workspace/${e}/tile/people/ws-user-roles/${y}/basic-info`
30698
30698
  );
30699
- return console.log("get user's basic info", D), D || null;
30699
+ return D || null;
30700
30700
  } catch (D) {
30701
30701
  return ro(D, "getUserBasicInforAPI"), null;
30702
30702
  }
@@ -218815,7 +218815,8 @@ const Up = /* @__PURE__ */ V$("scene", () => {
218815
218815
  var Xe;
218816
218816
  const Oe = (Xe = s.value) == null ? void 0 : Xe.entity_path;
218817
218817
  if (!Oe) return [];
218818
- const Be = w("BASE_URL"), ke = Tp(), rt = Oe.map((Ke, Qe) => ({
218818
+ const Be = w("BASE_URL"), ke = Tp();
218819
+ return Oe.map((Ke, Qe) => ({
218819
218820
  label: Ke.name,
218820
218821
  href: sh({
218821
218822
  type: "project",
@@ -218828,7 +218829,6 @@ const Up = /* @__PURE__ */ V$("scene", () => {
218828
218829
  disabled: !1,
218829
218830
  isCurrent: !1
218830
218831
  }));
218831
- return console.log("Generated breadcrumb:", rt), rt;
218832
218832
  }), D = te(() => {
218833
218833
  if (!s.value)
218834
218834
  return [];
@@ -219254,26 +219254,28 @@ const cde = () => {
219254
219254
  const f = d.data;
219255
219255
  if (!f)
219256
219256
  return console.error("Failed to get presigned URL"), null;
219257
- if (console.log(f.data), f.data.length > 0) {
219257
+ if (f.data.length > 0) {
219258
219258
  const m = new FormData();
219259
- Object.entries(f.form_inputs).forEach(([v, g]) => {
219260
- m.append(v, g);
219261
- }), m.set("key", f.data[0].key), m.append("Content-Type", u.type), m.append("file", u);
219262
- const p = await r({
219259
+ Object.entries(f.form_inputs).forEach(([g, w]) => {
219260
+ m.append(g, w);
219261
+ });
219262
+ const p = u.type === "video/mp4" && u.name.endsWith(".m4v");
219263
+ m.set("key", f.data[0].key), m.append("Content-Type", p ? "video/x-m4v" : u.type), m.append("file", u);
219264
+ const v = await r({
219263
219265
  url: f.form_attributes.action,
219264
219266
  data: m,
219265
219267
  method: f.form_attributes.method,
219266
219268
  enctype: f.form_attributes.enctype
219267
219269
  });
219268
- if (p != null && p.success) {
219269
- const v = f.data[0];
219270
+ if (v != null && v.success) {
219271
+ const g = f.data[0];
219270
219272
  return sM.files.add({
219271
- id: n + "_" + v.path,
219272
- path: v.key,
219273
+ id: n + "_" + g.path,
219274
+ path: g.key,
219273
219275
  name: u.name,
219274
219276
  thumbnail: "",
219275
219277
  type: u.type,
219276
- key: v.path,
219278
+ key: g.path,
219277
219279
  mimetype: u.type,
219278
219280
  fileId: "",
219279
219281
  mimeType: "",
@@ -219304,16 +219306,13 @@ const cde = () => {
219304
219306
  return Ls().showMessage("File exceeds 5MB.", "error"), null;
219305
219307
  if (!p)
219306
219308
  return Ls().showMessage("File format not supported.", "error"), null;
219307
- const g = (await o(
219308
- {
219309
- name: u.name,
219310
- type: u.type,
219311
- extra1: u.type,
219312
- extra2: u.type
219313
- },
219314
- d
219315
- )).data;
219316
- return g || (console.error("Failed to get presigned URL"), null);
219309
+ const v = u.type === "video/mp4" && u.name.endsWith(".m4v"), g = {
219310
+ name: u.name,
219311
+ type: u.type,
219312
+ extra1: v ? "video/x-m4v" : u.type,
219313
+ extra2: v ? "video/x-m4v" : u.type
219314
+ }, S = (await o(g, d)).data;
219315
+ return S || (console.error("Failed to get presigned URL"), null);
219317
219316
  }
219318
219317
  };
219319
219318
  }, Yla = /* @__PURE__ */ yt({
@@ -219603,8 +219602,8 @@ const oua = /* @__PURE__ */ qa(nua, [["render", rua], ["__scopeId", "data-v-4a44
219603
219602
  return fdn(x, "white") ? "#f3f5f8" : "white";
219604
219603
  }), S = async (x) => {
219605
219604
  var D, k, O;
219606
- if (console.log("nextStatus", x), x.id == i.value || x == null || !v.value) {
219607
- d.value = (D = a.value) == null ? void 0 : D.find((R) => R.id === i.value), console.log("status not changed or no permission,", x, i.value, v.value);
219605
+ if (x.id == i.value || x == null || !v.value) {
219606
+ d.value = (D = a.value) == null ? void 0 : D.find((R) => R.id === i.value);
219608
219607
  return;
219609
219608
  }
219610
219609
  const y = (k = a == null ? void 0 : a.value) == null ? void 0 : k.find((R) => R.id === x.id);
@@ -219792,7 +219791,7 @@ const sua = /* @__PURE__ */ qa(aua, [["render", iua], ["__scopeId", "data-v-c28b
219792
219791
  const O = await s();
219793
219792
  return e.setMetricPoint(O), O;
219794
219793
  } catch (O) {
219795
- console.log("getMetricPoint", O);
219794
+ console.error("getMetricPoint", O);
219796
219795
  }
219797
219796
  }
219798
219797
  };
@@ -220563,11 +220562,7 @@ const $ua = /* @__PURE__ */ qa(wua, [["render", Aua], ["__scopeId", "data-v-b99b
220563
220562
  }, i = te(() => r.canDrop ? r.fileType : []), s = oe(), { isOverDropZone: l } = ymr(s, {
220564
220563
  onDrop: a,
220565
220564
  dataTypes: i.value
220566
- }), u = te(() => l.value == !0 || r.showDropZone == !0);
220567
- mn(() => {
220568
- console.log("DropArea props", { props: r, computedDataTypes: i });
220569
- });
220570
- const d = { props: r, emits: o, onDropFile: a, computedDataTypes: i, dropZoneRef: s, isOverDropZoneComment: l, isShowDropZone: u };
220565
+ }), u = te(() => l.value == !0 || r.showDropZone == !0), d = { props: r, emits: o, onDropFile: a, computedDataTypes: i, dropZoneRef: s, isOverDropZoneComment: l, isShowDropZone: u };
220571
220566
  return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
220572
220567
  }
220573
220568
  }), Rua = { class: "icon" }, Pua = { class: "text" };
@@ -236262,13 +236257,7 @@ const aya = 2, kS = /* @__PURE__ */ V$("comment", () => {
236262
236257
  };
236263
236258
  }), UF = /* @__PURE__ */ V$("rendition", () => {
236264
236259
  const e = oe({}), t = oe([]), n = oe([]), r = oe([]), o = oe(), a = oe({}), i = oe(0);
236265
- return vt(
236266
- n,
236267
- (f) => {
236268
- console.log("fileReference changed:", f);
236269
- },
236270
- { deep: !0, immediate: !0 }
236271
- ), {
236260
+ return {
236272
236261
  renditionList: e,
236273
236262
  numberOfRendition: i,
236274
236263
  fileReference: n,
@@ -238923,14 +238912,14 @@ const tba = /* @__PURE__ */ qa(Jya, [["render", eba], ["__scopeId", "data-v-9559
238923
238912
  try {
238924
238913
  const Be = await R(Oe, kNe.TEMPORARY, 5e7);
238925
238914
  $.value = Be ?? void 0;
238926
- const ke = Be == null ? void 0 : Be.data.data[0];
238915
+ const ke = Be == null ? void 0 : Be.data.data[0], rt = Oe.type === "video/mp4" && Oe.name.endsWith(".m4v");
238927
238916
  if (Be != null && Be.data && ke)
238928
238917
  return {
238929
238918
  fileId: ke.name,
238930
238919
  path: ke.path,
238931
238920
  name: ke.name,
238932
238921
  thumbnail: ke.thumbnail ?? "",
238933
- mimeType: Oe.type,
238922
+ mimeType: rt ? "video/x-m4v" : Oe.type,
238934
238923
  key: ke.key
238935
238924
  };
238936
238925
  Ls().showMessage("Upload failed.", "error");
@@ -239254,7 +239243,7 @@ const oba = /* @__PURE__ */ qa(nba, [["render", rba], ["__scopeId", "data-v-a9fc
239254
239243
  video: ["video/mp4", "video/quicktime"],
239255
239244
  image: ["image/jpeg", "image/png", "image/jpg"]
239256
239245
  }, Y = [], de = [];
239257
- if (console.log("config.renditionType", se, ve, fe, K), ve && ve.length > 0) {
239246
+ if (ve && ve.length > 0) {
239258
239247
  const Ce = L(se, fe), { currentLength: we } = Ce;
239259
239248
  let ee = Ce.selectedType;
239260
239249
  Array.from(ve).reverse().forEach((Ae) => {
@@ -421991,7 +421980,7 @@ const t3i = /* @__PURE__ */ qa(KFi, [["render", e3i], ["__scopeId", "data-v-e253
421991
421980
  a("deleteRendition", k);
421992
421981
  }, m = (k) => {
421993
421982
  var O;
421994
- l != null && l.value && ((O = l.value) == null || O.clearFile()), console.log("files", k), a("handleCreateNewRendition", k);
421983
+ l != null && l.value && ((O = l.value) == null || O.clearFile()), a("handleCreateNewRendition", k);
421995
421984
  }, p = (k) => {
421996
421985
  a("selectRendition", k);
421997
421986
  }, v = te(() => {
@@ -423260,27 +423249,33 @@ const Ytn = 3, i4i = /* @__PURE__ */ yt({
423260
423249
  return (($ = a.value) == null ? void 0 : $.name) ?? "";
423261
423250
  }), m = te(
423262
423251
  () => {
423263
- var $, P, U, F;
423252
+ var $, P, U, F, L;
423264
423253
  return {
423265
423254
  type: w(($ = a.value) == null ? void 0 : $.type),
423266
423255
  src: ((P = a.value) == null ? void 0 : P.url) ?? "",
423267
423256
  poster: ((U = a.value) == null ? void 0 : U.thumbnail) ?? "",
423268
423257
  framePerSecond: 24,
423269
- fileType: ((F = a.value) == null ? void 0 : F.fileType) || ""
423258
+ fileType: ((F = a.value) == null ? void 0 : F.fileType) || "",
423259
+ name: ((L = a.value) == null ? void 0 : L.name) ?? ""
423270
423260
  };
423271
423261
  }
423272
423262
  ), p = () => {
423273
423263
  a.value = null, i.value = "LOADING", s.value = null, u.value = 0, o("close");
423274
423264
  }, v = async ($, P) => {
423275
- if (!$ || !P) {
423265
+ if (console.log("downloadFile", { name: $, url: P }), !$ || !P) {
423276
423266
  Ls().showMessage("Invalid file information for download", "error");
423277
423267
  return;
423278
423268
  }
423279
423269
  try {
423280
- const U = document.createElement("a");
423281
- U.href = P, U.setAttribute("target", "_blank"), U.setAttribute("download", $ || "download"), U.setAttribute("rel", "noopener noreferrer"), document.body.appendChild(U), U.click(), document.body.removeChild(U), Ls().showMessage("Download started", "success");
423270
+ const U = await fetch(P);
423271
+ if (!U.ok)
423272
+ throw new Error(`Network response was not ok: ${U.status} ${U.statusText}`);
423273
+ const F = await U.blob(), L = URL.createObjectURL(F), j = document.createElement("a");
423274
+ j.href = L, j.setAttribute("download", $), document.body.appendChild(j), j.click(), document.body.removeChild(j), URL.revokeObjectURL(L), Ls().showMessage("Download started", "success");
423282
423275
  } catch (U) {
423283
- ro(U, "downloadFile"), Ls().showMessage("Failed to download file", "error");
423276
+ ro(U, "downloadFile");
423277
+ const F = U instanceof TypeError ? "Failed to download file (possible CORS restriction)" : "Failed to download file";
423278
+ Ls().showMessage(F, "error");
423284
423279
  }
423285
423280
  }, g = ($) => {
423286
423281
  if (!$ || typeof $ != "string") return !1;
@@ -423319,7 +423314,7 @@ const Ytn = 3, i4i = /* @__PURE__ */ yt({
423319
423314
  var P, U, F, L, j;
423320
423315
  try {
423321
423316
  if (!g($.mimeType)) {
423322
- v($.name, ((P = $.data) == null ? void 0 : P.url) || $.url);
423317
+ console.log("File type not previewable, triggering download", $), v($.name, ((P = $.data) == null ? void 0 : P.url) || $.url);
423323
423318
  return;
423324
423319
  }
423325
423320
  if (i.value = "LOADING", s.value = null, $.commenttype === "temporary") {
@@ -423471,7 +423466,7 @@ function h4i(e, t, n, r, o, a) {
423471
423466
  Oi(Gs({
423472
423467
  listItems: [r.resourceURL],
423473
423468
  isReviewFile: !1,
423474
- name: "",
423469
+ name: r.fileName,
423475
423470
  type: r.resourceURL.type
423476
423471
  })),
423477
423472
  null,
@@ -423645,10 +423640,7 @@ const C4i = /* @__PURE__ */ qa(w4i, [["render", E4i], ["__scopeId", "data-v-2268
423645
423640
  return console.error("Error fetching user basic info:", F), null;
423646
423641
  }
423647
423642
  };
423648
- $.appContext.config.globalProperties.$getUserBasicInfo = P, console.log(
423649
- "getUserBasicInfo function provided to global properties",
423650
- $.appContext.config.globalProperties.$getUserBasicInfo
423651
- );
423643
+ $.appContext.config.globalProperties.$getUserBasicInfo = P;
423652
423644
  }
423653
423645
  });
423654
423646
  const O = te(() => sessionStorage.getItem("user.ws_user_role_id") || "");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arbocollab/arbo-web-scene",
3
3
  "description": "Arbo Web Scene",
4
- "version": "0.26.6-alpha.1",
4
+ "version": "0.26.6-alpha.5",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "analyze": "npx vite-bundle-visualizer",
13
13
  "fetch:config": "node scripts/fetch-build-config.mjs ${MODE:-development}",
14
14
  "build": " node scripts/fetch-build-config.mjs ${MODE:-development} && vite build",
15
- "publish:lib": "cd lib && npm publish --userconfig=npmjs.npmrc --access public --tag ${TAG:-beta}",
15
+ "publish:npmjs": "cd lib && npm publish --userconfig=npmjs.npmrc --access public --tag ${TAG:-beta}",
16
16
  "publish:app": "firebase deploy --only hosting"
17
17
  },
18
18
  "peerDependencies": {