@shjjs/visual-ui 3.0.7 → 3.0.8

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.
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-79619911"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dde8cdcf"]]);
5
5
  export {
6
- _ as default
6
+ r as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as d, onMounted as J, computed as a, shallowRef as b, ref as u, watch as j, createElementBlock as E, openBlock as c, createElementVNode as H, createBlock as V, createCommentVNode as O, unref as P } from "vue";
2
- import { useVueImportMap as x, Sandbox as N, useStore as k } from "@vue/repl";
1
+ import { defineComponent as d, onMounted as J, computed as a, shallowRef as b, ref as u, watch as j, createElementBlock as E, openBlock as c, createElementVNode as H, createBlock as V, createCommentVNode as k, unref as O } from "vue";
2
+ import { useVueImportMap as P, Sandbox as x, useStore as N } from "@vue/repl";
3
3
  import { useWatch as D } from "./hooks/useWatch.mjs";
4
4
  /* empty css */
5
5
  /* empty css */
@@ -171,7 +171,7 @@ const B = { class: "custom-component-render" }, R = { class: "preview-content" }
171
171
  J(() => {
172
172
  window.SHJDatasourceV2 = M, window.SHJParseEvent = T;
173
173
  });
174
- const e = a(() => _(i.option)), { productionMode: p, vueVersion: v, importMap: h } = x(), w = a(() => ({
174
+ const e = a(() => _(i.option)), { productionMode: p, vueVersion: v, importMap: h } = P(), w = a(() => ({
175
175
  script: {
176
176
  inlineTemplate: p.value,
177
177
  isProd: p.value,
@@ -188,7 +188,7 @@ const B = { class: "custom-component-render" }, R = { class: "preview-content" }
188
188
  if (!(l.value === s && o.value)) {
189
189
  l.value = s, t.value = !0;
190
190
  try {
191
- const r = k(
191
+ const r = N(
192
192
  { builtinImportMap: h, vueVersion: v, sfcOptions: w },
193
193
  s
194
194
  );
@@ -265,6 +265,7 @@ const B = { class: "custom-component-render" }, R = { class: "preview-content" }
265
265
  #app {
266
266
  height: 100%;
267
267
  overflow: hidden;
268
+ background-color: transparent !important;
268
269
  }
269
270
  </style>
270
271
  ${g}
@@ -273,12 +274,13 @@ const B = { class: "custom-component-render" }, R = { class: "preview-content" }
273
274
  }));
274
275
  return (s, r) => (c(), E("div", B, [
275
276
  H("div", R, [
276
- !t.value && o.value ? (c(), V(P(N), {
277
+ !t.value && o.value ? (c(), V(O(x), {
277
278
  key: 0,
278
279
  store: o.value,
280
+ theme: "dark",
279
281
  "clear-console": !1,
280
282
  "preview-options": C.value
281
- }, null, 8, ["store", "preview-options"])) : O("", !0)
283
+ }, null, 8, ["store", "preview-options"])) : k("", !0)
282
284
  ])
283
285
  ]));
284
286
  }
@@ -1,7 +1,7 @@
1
- import { defineComponent as z, computed as q, ref as K, onMounted as N, onBeforeUnmount as W, watch as d, createElementBlock as Y, openBlock as _ } from "vue";
1
+ import { defineComponent as P, computed as K, ref as N, onMounted as W, onBeforeUnmount as Y, watch as c, createElementBlock as _, openBlock as j } from "vue";
2
2
  import "@babylonjs/loaders/glTF";
3
3
  import * as t from "@babylonjs/core";
4
- import { cloneDeep as h, isEqual as f } from "lodash";
4
+ import { cloneDeep as d, isEqual as h } from "lodash";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  import "../../../Interaction/components/Tabs/index.mjs";
@@ -157,13 +157,13 @@ import "../../../Scene/components/UnityIframe/index.mjs";
157
157
  import "../../../Scene/components/UnityWebgl/index.mjs";
158
158
  import "../../../Scene/components/Vr/index.mjs";
159
159
  import "../../../Scene/components/Earth/index.mjs";
160
- import { SHJParseEvent as k } from "../../../../commons/plugins/event/index.mjs";
160
+ import { SHJParseEvent as z } from "../../../../commons/plugins/event/index.mjs";
161
161
  import "../../../../commons/plugins/datasource/utils/request.mjs";
162
162
  import "mqtt";
163
163
  import "nanoid";
164
- import { upgradeModelViewer as j } from "./version.mjs";
165
- const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
166
- ...J,
164
+ import { upgradeModelViewer as J } from "./version.mjs";
165
+ const U = P({ name: "ShjModelViewer" }), Qt = /* @__PURE__ */ P({
166
+ ...U,
167
167
  props: {
168
168
  option: {},
169
169
  sources: {},
@@ -171,10 +171,10 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
171
171
  basicEvents: {}
172
172
  },
173
173
  emits: ["on-load-success", "on-play-animation"],
174
- setup(y, { expose: P, emit: H }) {
175
- const e = q(() => j(y.option)), E = H;
176
- let T, o, n, p, v, s, w, g, u, b, l, a;
177
- const B = () => {
174
+ setup(y, { expose: H, emit: I }) {
175
+ const e = K(() => J(y.option)), E = I;
176
+ let A, o, n, p, v, s, w, g, u, b, l, a;
177
+ const C = N(), B = () => {
178
178
  n || (n = new t.ArcRotateCamera(
179
179
  "Camera",
180
180
  e.value.camera.alpha,
@@ -194,9 +194,9 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
194
194
  e.value.camera.lowerBetaLimit
195
195
  ), n.upperBetaLimit = t.Tools.ToRadians(
196
196
  e.value.camera.upperBetaLimit
197
- ), n.useBouncingBehavior = e.value.camera.useBouncingBehavior, n.wheelDeltaPercentage = e.value.camera.wheelDeltaPercentage || 0.01, n.useAutoRotationBehavior = e.value.camera.autoRotation, n.panningSensibility = 1 / (e.value.camera.panningSensibility || 0.01), n.attachControl(A.value, !0);
197
+ ), n.useBouncingBehavior = e.value.camera.useBouncingBehavior, n.wheelDeltaPercentage = e.value.camera.wheelDeltaPercentage || 0.01, n.useAutoRotationBehavior = e.value.camera.autoRotation, n.panningSensibility = 1 / (e.value.camera.panningSensibility || 0.01), n.attachControl(C.value, !0);
198
198
  }, F = () => {
199
- o || (o = new t.Scene(T)), o.environmentTexture = t.CubeTexture.CreateFromPrefilteredData(
199
+ o || (o = new t.Scene(A)), o.environmentTexture = t.CubeTexture.CreateFromPrefilteredData(
200
200
  e.value.scene.environmentTexture,
201
201
  o
202
202
  ), o.environmentIntensity = e.value.scene.environmentIntensity, e.value.scene.colorShow ? o.clearColor = t.Color4.FromHexString(
@@ -224,11 +224,11 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
224
224
  ), p.diffuse = t.Color3.FromHexString(
225
225
  e.value.directionalLight.diffuse || "#ffffff"
226
226
  ), p.intensity = e.value.directionalLight.intensity, p.shadowMinZ = e.value.directionalLight.shadowMinZ, p.shadowMaxZ = e.value.directionalLight.shadowMaxZ, p.autoCalcShadowZBounds = e.value.directionalLight.autoCalcShadowZBounds, e.value.directionalLight.shadowGenerator.enable) {
227
- const { mapSize: i, transparencyShadow: r, usePercentageCloserFiltering: m, bias: c } = e.value.directionalLight.shadowGenerator;
227
+ const { mapSize: i, transparencyShadow: r, usePercentageCloserFiltering: m, bias: f } = e.value.directionalLight.shadowGenerator;
228
228
  if (!s && (s = new t.ShadowGenerator(i, p), l))
229
229
  for (let L = 0; L < l.length; L++)
230
230
  e.value.meshes.isCasterShadow && s && s.addShadowCaster(l[L], !0);
231
- s.mapSize = i, s.transparencyShadow = r, s.usePercentageCloserFiltering = m, s.bias = c;
231
+ s.mapSize = i, s.transparencyShadow = r, s.usePercentageCloserFiltering = m, s.bias = f;
232
232
  } else
233
233
  s && (s.dispose(), s = null);
234
234
  e.value.directionalLight.lightGizmo && e.value.directionalLight.lightGizmo.enable ? (v || (v = new t.LightGizmo(), v.light = p), v.scaleRatio = e.value.directionalLight.lightGizmo.scaleRatio) : v && (v.dispose(), v = null);
@@ -254,10 +254,10 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
254
254
  width: i,
255
255
  height: r,
256
256
  position: m,
257
- rotation: c,
257
+ rotation: f,
258
258
  scaling: L,
259
- material: C,
260
- receiveShadows: Z
259
+ material: T,
260
+ receiveShadows: q
261
261
  } = e.value.ground;
262
262
  u || (u = t.MeshBuilder.CreateGround(
263
263
  "ground",
@@ -268,24 +268,24 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
268
268
  m[1],
269
269
  m[2]
270
270
  ), u.rotation = new t.Vector3(
271
- t.Tools.ToRadians(c[0]),
272
- t.Tools.ToRadians(c[1]),
273
- t.Tools.ToRadians(c[2])
271
+ t.Tools.ToRadians(f[0]),
272
+ t.Tools.ToRadians(f[1]),
273
+ t.Tools.ToRadians(f[2])
274
274
  ), u.scaling = new t.Vector3(L[0], L[1], L[2]);
275
275
  const x = new t.StandardMaterial("", o);
276
276
  x.emissiveTexture = new t.Texture(
277
- C.emissiveTexture,
277
+ T.emissiveTexture,
278
278
  o
279
279
  ), x.diffuseTexture = new t.Texture(
280
- C.emissiveTexture,
280
+ T.emissiveTexture,
281
281
  o
282
282
  ), x.ambientTexture = new t.Texture(
283
- C.emissiveTexture,
283
+ T.emissiveTexture,
284
284
  o
285
285
  ), x.diffuseColor = new t.Color3(1, 1, 1), x.opacityTexture = new t.Texture(
286
- C.opacityTexture,
286
+ T.opacityTexture,
287
287
  o
288
- ), u.material = x, u.receiveShadows = Z;
288
+ ), u.material = x, u.receiveShadows = q;
289
289
  } else
290
290
  u && (u.dispose(), u = null);
291
291
  }, M = () => {
@@ -306,7 +306,7 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
306
306
  if (o) {
307
307
  o.stopAllAnimations();
308
308
  const m = o.getAnimationGroupByName(i);
309
- m && (E("on-play-animation"), k.parseEvents(y.useEvents, "on-play-animation"), m.start(
309
+ m && (E("on-play-animation"), z.parseEvents(y.useEvents, "on-play-animation"), m.start(
310
310
  r.loop,
311
311
  r.speedRatio,
312
312
  m.from,
@@ -335,10 +335,7 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
335
335
  l[i].isPickable = !1, l[i].receiveShadows = e.value.meshes.isCasterShadow, e.value.meshes.isCasterShadow && s && s.addShadowCaster(l[i], !0);
336
336
  e.value.animation.animationGroups = o.animationGroups.map((i) => ({ uniqueId: i.uniqueId, name: i.name })), y.basicEvents && (y.basicEvents.function[0].args[0].select = o.animationGroups.map(
337
337
  (i) => ({ name: i.name, value: i.name })
338
- )), e.value.animation.defaultAnimation && e.value.animation.defaultAnimation.name ? D(e.value.animation.defaultAnimation.name, {
339
- loop: e.value.animation.defaultAnimation.loop,
340
- speedRatio: e.value.animation.defaultAnimation.speedRatio
341
- }) : o.animationGroups && o.animationGroups[0] && o.animationGroups[0].stop();
338
+ )), k();
342
339
  }, V = () => {
343
340
  const i = e.value.pipelineOption;
344
341
  i && i.enabled ? (a || (a = new t.DefaultRenderingPipeline(
@@ -351,104 +348,117 @@ const J = z({ name: "ShjModelViewer" }), Xt = /* @__PURE__ */ z({
351
348
  ), a.chromaticAberration.direction.y = Math.cos(
352
349
  i.chromaticAberrationDirection
353
350
  )), a.sharpenEnabled = i.sharpenEnabled, a.sharpen.edgeAmount = i.sharpenEdgeAmount, a.sharpen.colorAmount = i.sharpenColorAmount) : a && (a.dispose(), a = null);
354
- }, I = function() {
355
- F(), B(), G(), R(), O(), M(), S(), V(), E("on-load-success"), k.parseEvents(y.useEvents, "on-load-success");
356
- }, A = K();
357
- return N(() => {
358
- T = new t.Engine(A.value, !0), T && e.value.meshes.url && (I(), T.runRenderLoop(function() {
351
+ }, k = () => {
352
+ o.stopAllAnimations(), e.value.animation.defaultAnimation && e.value.animation.defaultAnimation.name ? D(e.value.animation.defaultAnimation.name, {
353
+ loop: e.value.animation.defaultAnimation.loop,
354
+ speedRatio: e.value.animation.defaultAnimation.speedRatio
355
+ }) : o.animationGroups && o.animationGroups[0] && o.animationGroups[0].stop();
356
+ }, Z = function() {
357
+ F(), B(), G(), R(), O(), M(), S(), V(), E("on-load-success"), z.parseEvents(y.useEvents, "on-load-success");
358
+ };
359
+ return W(() => {
360
+ A = new t.Engine(C.value, !0), A && e.value.meshes.url && (Z(), A.runRenderLoop(function() {
359
361
  o && o.render();
360
362
  }));
361
- }), W(() => {
362
- o.dispose(), T.dispose();
363
- }), P({
363
+ }), Y(() => {
364
+ o.dispose(), A.dispose();
365
+ }), H({
364
366
  playAnimation: (i, r) => {
365
- const m = r[0].value, c = {
367
+ const m = r[0].value, f = {
366
368
  loop: r[1].keys[0].defaultValue,
367
369
  speedRatio: r[1].keys[1].defaultValue
368
370
  };
369
- D(m, c);
371
+ D(m, f);
370
372
  }
371
- }), d(
372
- () => h(e.value.camera),
373
+ }), c(
374
+ () => d(e.value.camera),
373
375
  (i, r) => {
374
- !f(i, r) && n && B();
376
+ !h(i, r) && n && B();
375
377
  },
376
378
  {
377
379
  deep: !0
378
380
  }
379
- ), d(
380
- () => h(e.value.scene),
381
+ ), c(
382
+ () => d(e.value.scene),
381
383
  (i, r) => {
382
- !f(i, r) && o && F();
384
+ !h(i, r) && o && F();
383
385
  },
384
386
  {
385
387
  deep: !0
386
388
  }
387
- ), d(
388
- () => h(e.value.directionalLight),
389
+ ), c(
390
+ () => d(e.value.directionalLight),
389
391
  (i, r) => {
390
- f(i, r) || R();
392
+ h(i, r) || R();
391
393
  },
392
394
  {
393
395
  deep: !0
394
396
  }
395
- ), d(
396
- () => h(e.value.hemisphericLight),
397
+ ), c(
398
+ () => d(e.value.hemisphericLight),
397
399
  (i, r) => {
398
- f(i, r) || G();
400
+ h(i, r) || G();
399
401
  },
400
402
  {
401
403
  deep: !0
402
404
  }
403
- ), d(
404
- () => h(e.value.ground),
405
+ ), c(
406
+ () => d(e.value.ground),
405
407
  (i, r) => {
406
- f(i, r) || O();
408
+ h(i, r) || O();
407
409
  },
408
410
  {
409
411
  deep: !0
410
412
  }
411
- ), d(
412
- () => h(e.value.skybox),
413
+ ), c(
414
+ () => d(e.value.skybox),
413
415
  (i, r) => {
414
- f(i, r) || M();
416
+ h(i, r) || M();
415
417
  },
416
418
  {
417
419
  deep: !0
418
420
  }
419
- ), d(
420
- () => h(e.value.meshes),
421
+ ), c(
422
+ () => d(e.value.meshes),
421
423
  (i, r) => {
422
- !f(i, r) && l && i.url === r.url && S();
424
+ !h(i, r) && l && i.url === r.url && S();
423
425
  },
424
426
  {
425
427
  deep: !0
426
428
  }
427
- ), d(
428
- () => h(e.value.meshes.url),
429
+ ), c(
430
+ () => d(e.value.meshes.url),
429
431
  (i, r) => {
430
- f(i, r) || (o.meshes.forEach((m, c) => {
431
- c > 1 && m.dispose();
432
+ h(i, r) || (o.meshes.forEach((m, f) => {
433
+ f > 1 && m.dispose();
432
434
  }), l = null, S());
433
435
  },
434
436
  {
435
437
  deep: !0
436
438
  }
437
- ), d(
438
- () => h(e.value.pipelineOption),
439
+ ), c(
440
+ () => d(e.value.pipelineOption),
441
+ (i, r) => {
442
+ h(i, r) || V();
443
+ },
444
+ {
445
+ deep: !0
446
+ }
447
+ ), c(
448
+ () => d(e.value.animation),
439
449
  (i, r) => {
440
- f(i, r) || V();
450
+ h(i, r) || k();
441
451
  },
442
452
  {
443
453
  deep: !0
444
454
  }
445
- ), (i, r) => (_(), Y("canvas", {
455
+ ), (i, r) => (j(), _("canvas", {
446
456
  ref_key: "canvasRef",
447
- ref: A,
457
+ ref: C,
448
458
  class: "babylon-canvas"
449
459
  }, null, 512));
450
460
  }
451
461
  });
452
462
  export {
453
- Xt as default
463
+ Qt as default
454
464
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-56e45189"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fc5fed6a"]]);
5
5
  export {
6
- p as default
6
+ c as default
7
7
  };