vis-core 0.25.5 → 0.25.6

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,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document!="undefined"){var t=document.createElement("style");t.appendChild(document.createTextNode(".-translate-x-1\\/2,.-translate-y-1\\/2{--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1 }.shadow{--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000 }.ring{--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000 }.invert,.filter{--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: }.visible{visibility:visible}.static{position:static}.absolute{position:absolute}.left-1\\/2{left:50%}.top-1\\/2{top:50%}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.whitespace-nowrap{white-space:nowrap}.text-center{text-align:center}.text-sm{font-size:14px;line-height:20px}.text-xs{font-size:12px;line-height:16px}.leading-\\[1\\]{line-height:1}.text-\\[\\#809083\\]{--tw-text-opacity: 1;color:rgb(128 144 131 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-opacity-80{--tw-text-opacity: .8 }.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
1
+ (function(){"use strict";try{if(typeof document!="undefined"){var t=document.createElement("style");t.appendChild(document.createTextNode(".-translate-x-1\\/2,.-translate-y-1\\/2,.transform{--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1 }.shadow{--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000 }.ring{--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000 }.invert,.filter{--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: }.visible{visibility:visible}.static{position:static}.absolute{position:absolute}.left-1\\/2{left:50%}.top-1\\/2{top:50%}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.whitespace-nowrap{white-space:nowrap}.text-center{text-align:center}.text-sm{font-size:14px;line-height:20px}.text-xs{font-size:12px;line-height:16px}.leading-\\[1\\]{line-height:1}.text-\\[\\#809083\\]{--tw-text-opacity: 1;color:rgb(128 144 131 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-opacity-80{--tw-text-opacity: .8 }.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
2
  var H1 = Object.defineProperty, J1 = Object.defineProperties;
3
3
  var k1 = Object.getOwnPropertyDescriptors;
4
4
  var v1 = Object.getOwnPropertySymbols, K1 = Object.getPrototypeOf, w1 = Object.prototype.hasOwnProperty, z1 = Object.prototype.propertyIsEnumerable, U1 = Reflect.get;
@@ -90,7 +90,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
90
90
  ).toString(CryptoJS.enc.Utf8), De = JSON.parse(Je), bt = Date.now();
91
91
  return !De.s || De.s > bt ? (this.token = void 0, "") : De.e && De.e < bt ? (this.token = void 0, "") : (De.isValid = ye, De);
92
92
  }
93
- }, version = "0.25.5";
93
+ }, version = "0.25.6";
94
94
  /**
95
95
  * @license
96
96
  * Copyright 2010-2025 Three.js Authors
@@ -56159,7 +56159,54 @@ const detect = () => {
56159
56159
  tier: 0
56160
56160
  };
56161
56161
  }
56162
- }, IS_DEV = !1;
56162
+ };
56163
+ function observeTransformScale(d, t) {
56164
+ let o = d, r = 1;
56165
+ for (; o; ) {
56166
+ const ne = window.getComputedStyle(o).transform;
56167
+ if (ne && ne !== "none") {
56168
+ const ye = new DOMMatrix(ne);
56169
+ if (ye.a !== 1 || ye.d !== 1) {
56170
+ r = Math.max(ye.a, ye.d);
56171
+ break;
56172
+ }
56173
+ }
56174
+ if (o === document.body) {
56175
+ o = null;
56176
+ break;
56177
+ }
56178
+ o = o.parentElement;
56179
+ }
56180
+ if (!o)
56181
+ return () => {
56182
+ };
56183
+ const g = () => {
56184
+ const ne = window.getComputedStyle(o).transform;
56185
+ let ye = 1;
56186
+ if (ne && ne !== "none") {
56187
+ const fe = new DOMMatrix(ne);
56188
+ ye = Math.max(fe.a, fe.d);
56189
+ }
56190
+ r !== ye && (r = ye, t(ye));
56191
+ }, v = new MutationObserver((O) => {
56192
+ for (const ne of O)
56193
+ if (ne.type === "attributes" && (ne.attributeName === "style" || ne.attributeName === "class")) {
56194
+ g();
56195
+ return;
56196
+ }
56197
+ });
56198
+ v.observe(o, {
56199
+ attributes: !0,
56200
+ attributeFilter: ["style", "class"]
56201
+ });
56202
+ const w = new ResizeObserver(() => {
56203
+ g();
56204
+ });
56205
+ return w.observe(o), t(r), () => {
56206
+ v.disconnect(), w == null || w.disconnect();
56207
+ };
56208
+ }
56209
+ const IS_DEV = !1;
56163
56210
  class Base extends Camera {
56164
56211
  constructor(o) {
56165
56212
  var r;
@@ -56185,13 +56232,15 @@ class Base extends Camera {
56185
56232
  T0(this, "publicDir", {});
56186
56233
  T0(this, "_baseObjectByUuid");
56187
56234
  T0(this, "_objectByUuid");
56235
+ T0(this, "stopObserveTransformScale", null);
56188
56236
  T0(this, "sceneActive", -1);
56189
56237
  T0(this, "initSettingsObj");
56190
56238
  T0(this, "mouseButtonsActiveStore", null);
56191
56239
  if (this.container = o.container, this.options = ii({
56192
56240
  assetsPrefix: "",
56193
56241
  editor: !0,
56194
- logarithmicDepthBuffer: !0
56242
+ logarithmicDepthBuffer: !0,
56243
+ observeParentScale: !0
56195
56244
  }, o), !this.options.assetsPrefix) {
56196
56245
  let g = "/";
56197
56246
  g === "/" && (g = ""), this.options.assetsPrefix = g;
@@ -56330,7 +56379,12 @@ class Base extends Camera {
56330
56379
  anisotropy: 1
56331
56380
  } : {})
56332
56381
  }), this.pencilConfig), this.options.pencilConfig));
56333
- this.pencil = bt, this.sceneActive = 1;
56382
+ this.options.observeParentScale && (this.stopObserveTransformScale = observeTransformScale(
56383
+ this.container,
56384
+ (Yt) => {
56385
+ bt.setDevicePixelRatio(window.devicePixelRatio * Yt);
56386
+ }
56387
+ )), this.pencil = bt, this.sceneActive = 1;
56334
56388
  const Ct = bt.composerController.ssaoPass;
56335
56389
  Ct && (Ct.enabled = !1);
56336
56390
  const Lt = new T({
@@ -56500,8 +56554,8 @@ class Base extends Camera {
56500
56554
  return { x: ne, y: ye };
56501
56555
  }
56502
56556
  dispose() {
56503
- var o, r, g, v;
56504
- super.dispose(), this.editor && (this.editor.viewport.vis = void 0, this.editor.dispose()), this.publicDir = {}, this.options.pencil ? ((o = this.mList) == null || o.dispose(), this.pencil.removePage(this.sceneActive)) : this.options.pencil2 || (r = this.pencil) == null || r.dispose(), (g = this.pmremGenerator) == null || g.dispose(), (v = this.re) == null || v.dispose();
56557
+ var o, r, g, v, w;
56558
+ super.dispose(), this.editor && (this.editor.viewport.vis = void 0, this.editor.dispose()), this.publicDir = {}, this.options.pencil ? ((o = this.mList) == null || o.dispose(), this.pencil.removePage(this.sceneActive)) : this.options.pencil2 || (r = this.pencil) == null || r.dispose(), (g = this.pmremGenerator) == null || g.dispose(), (v = this.re) == null || v.dispose(), (w = this.stopObserveTransformScale) == null || w.call(this);
56505
56559
  }
56506
56560
  }
56507
56561
  T0(Base, "VisName", "base");
@@ -0,0 +1 @@
1
+ export declare function observeTransformScale(element: HTMLElement, callback: (scale: number) => void): () => void;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.25.5";
1
+ declare const _default: "0.25.6";
2
2
  export default _default;
@@ -21,6 +21,7 @@ export interface BaseOptions {
21
21
  logarithmicDepthBuffer?: boolean;
22
22
  workerOnce?: boolean;
23
23
  tier?: number;
24
+ observeParentScale?: boolean;
24
25
  [key: string]: any;
25
26
  }
26
27
  export default class Base extends Camera {
@@ -91,6 +92,7 @@ export default class Base extends Camera {
91
92
  initMaterial(...args: any): Promise<void>;
92
93
  initVis(...args: any): Promise<void>;
93
94
  init(...args: any[]): Promise<void>;
95
+ private stopObserveTransformScale;
94
96
  initPencil(): Promise<void>;
95
97
  private sceneActive;
96
98
  setSceneActive(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.25.5",
3
+ "version": "0.25.6",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && bundler",