shop-components 0.1.68 → 0.2.2

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.
Files changed (61) hide show
  1. package/dist/__VLS_types.d.ts +124 -0
  2. package/dist/assets/loader.worker-fysOIq2s.js +7 -0
  3. package/dist/shop-components.cjs +5077 -0
  4. package/dist/shop-components.mjs +34644 -63718
  5. package/dist/{device-viewer → stories/device-viewer}/amr.d.ts +23 -5
  6. package/dist/{device-viewer → stories/device-viewer}/dimension/size-box.d.ts +2 -3
  7. package/dist/stories/device-viewer/dimension/size-line.d.ts +24 -0
  8. package/dist/{device-viewer → stories/device-viewer}/goods-box.d.ts +1 -0
  9. package/dist/{device-viewer → stories/device-viewer}/index.d.ts +15 -2
  10. package/dist/stories/device-viewer/libs/BVH/index.d.ts +342 -0
  11. package/dist/{device-viewer → stories/device-viewer}/libs/gizmo/gizmo.d.ts +2 -0
  12. package/dist/stories/device-viewer/libs/progress-shadow/ProgressiveShadows.d.ts +91 -0
  13. package/dist/{device-viewer → stories/device-viewer}/logo.d.ts +1 -1
  14. package/dist/{device-viewer → stories/device-viewer}/outerline.d.ts +12 -0
  15. package/dist/{device-viewer → stories/device-viewer}/scene.d.ts +98 -4
  16. package/dist/{device-viewer → stories/device-viewer}/slot/slot-item.d.ts +6 -0
  17. package/dist/{device-viewer → stories/device-viewer}/slot.d.ts +11 -0
  18. package/dist/stories/device-viewer/ui/camera-position.d.ts +6 -0
  19. package/dist/stories/device-viewer/utils/geometory.d.ts +3 -0
  20. package/dist/{device-viewer → stories/device-viewer}/utils/index.d.ts +2 -0
  21. package/dist/{devices → stories/devices}/index.stories.d.ts +1 -1
  22. package/dist/{devices → stories/devices}/src/connector.d.ts +1 -1
  23. package/dist/{devices → stories/devices}/src/constraints/same-device-constraint.d.ts +2 -2
  24. package/dist/{devices → stories/devices}/src/constraints/single-connection-constraint.d.ts +2 -2
  25. package/dist/{devices → stories/devices}/src/device.d.ts +1 -1
  26. package/dist/{main.d.ts → stories/main.d.ts} +0 -1
  27. package/dist/vite-env.d.ts +11 -0
  28. package/package.json +10 -8
  29. package/dist/device-viewer/dimension/size-line.d.ts +0 -15
  30. package/dist/shop-components.umd.js +0 -9981
  31. /package/dist/{cropper → stories/cropper}/index.d.ts +0 -0
  32. /package/dist/{cropper → stories/cropper}/index.stories.d.ts +0 -0
  33. /package/dist/{device-viewer → stories/device-viewer}/assembly.d.ts +0 -0
  34. /package/dist/{device-viewer → stories/device-viewer}/belt.d.ts +0 -0
  35. /package/dist/{device-viewer → stories/device-viewer}/dimension/index.d.ts +0 -0
  36. /package/dist/{device-viewer → stories/device-viewer}/dimension/line3.d.ts +0 -0
  37. /package/dist/{device-viewer → stories/device-viewer}/group-roller.d.ts +0 -0
  38. /package/dist/{device-viewer → stories/device-viewer}/index.stories.d.ts +0 -0
  39. /package/dist/{device-viewer → stories/device-viewer}/lines.d.ts +0 -0
  40. /package/dist/{device-viewer → stories/device-viewer}/main.d.ts +0 -0
  41. /package/dist/{device-viewer → stories/device-viewer}/mechanism/mechanism.d.ts +0 -0
  42. /package/dist/{device-viewer → stories/device-viewer}/pin/pin.d.ts +0 -0
  43. /package/dist/{device-viewer → stories/device-viewer}/roller.d.ts +0 -0
  44. /package/dist/{device-viewer → stories/device-viewer}/row.d.ts +0 -0
  45. /package/dist/{device-viewer → stories/device-viewer}/sound.d.ts +0 -0
  46. /package/dist/{device-viewer → stories/device-viewer}/text2.d.ts +0 -0
  47. /package/dist/{device-viewer → stories/device-viewer}/text3.d.ts +0 -0
  48. /package/dist/{device-viewer → stories/device-viewer}/ui/right-menu.d.ts +0 -0
  49. /package/dist/{device-viewer → stories/device-viewer}/worker/generate-mesh-bvh-worker.d.ts +0 -0
  50. /package/dist/{device-viewer → stories/device-viewer}/worker/generateAsync.worker.d.ts +0 -0
  51. /package/dist/{device-viewer → stories/device-viewer}/worker/path-tracing-scene-worker.d.ts +0 -0
  52. /package/dist/{devices → stories/devices}/index.d.ts +0 -0
  53. /package/dist/{devices → stories/devices}/src/constraints/constraint.d.ts +0 -0
  54. /package/dist/{devices → stories/devices}/src/pin.d.ts +0 -0
  55. /package/dist/{main → stories/main}/index.d.ts +0 -0
  56. /package/dist/{plugin.d.ts → stories/plugin.d.ts} +0 -0
  57. /package/dist/{plugins → stories/plugins}/change-slot/index.d.ts +0 -0
  58. /package/dist/{sglb → stories/sglb}/index.d.ts +0 -0
  59. /package/dist/{step-viewer → stories/step-viewer}/index.d.ts +0 -0
  60. /package/dist/{step-viewer → stories/step-viewer}/index.stories.d.ts +0 -0
  61. /package/dist/{utils → stories/utils}/index.d.ts +0 -0
@@ -1,6 +1,7 @@
1
- import { Mesh, MeshStandardMaterial, Object3D, OrthographicCamera, PerspectiveCamera, Scene, Vector2, WebGLRenderer } from 'three';
1
+ import { Color, Mesh, MeshStandardMaterial, Object3D, OrthographicCamera, PerspectiveCamera, Scene, Vector2, Vector3, WebGLRenderer } from 'three';
2
2
  import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass';
3
3
  import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass';
4
+ import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass';
4
5
  import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
5
6
  import { WebGLPathTracer } from 'three-gpu-pathtracer';
6
7
  import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer';
@@ -52,6 +53,7 @@ export interface SceneProps {
52
53
  useAxisBall?: boolean;
53
54
  axisBallOffset?: Vector2;
54
55
  workerUrl?: string;
56
+ isMobile?: boolean;
55
57
  }
56
58
  export declare class Scene3D {
57
59
  props: SceneProps;
@@ -71,11 +73,17 @@ export declare class Scene3D {
71
73
  _outlinePass: OutlinePass;
72
74
  _outlinePassError: OutlinePass;
73
75
  _fxaaPass: ShaderPass;
76
+ _bloomPass: UnrealBloomPass;
77
+ private _progressShadow;
78
+ test: Mesh;
79
+ private _clock;
80
+ private _uiHiddenTime;
74
81
  camera: PerspectiveCamera;
75
82
  private _mainCamera;
76
83
  d: number;
77
84
  orthographicCamera: OrthographicCamera;
78
85
  controls: OrbitControls;
86
+ private _cameraPositionUI;
79
87
  private _controlsGizmo;
80
88
  private _axisMoving;
81
89
  private _resizeObserver;
@@ -85,7 +93,6 @@ export declare class Scene3D {
85
93
  private _selected;
86
94
  private _pointerDownTimeout;
87
95
  pane: Pane | undefined;
88
- lines: DeviceLines;
89
96
  private _dragging;
90
97
  readonly maxSample: number;
91
98
  sampleCount: number;
@@ -94,8 +101,19 @@ export declare class Scene3D {
94
101
  private _fpsCacheMax;
95
102
  private _emitter;
96
103
  sound: Sound;
104
+ private _rafId;
105
+ private _destroyed;
97
106
  private _ground;
107
+ private light;
108
+ private _amrRender;
109
+ private _pointCloudMode;
110
+ get pointCloudMode(): boolean;
111
+ set pointCloudMode(enabled: boolean);
98
112
  get usePathTracing(): boolean;
113
+ private _clearAmrContent;
114
+ private _shadowMode;
115
+ get shadowMode(): boolean;
116
+ set shadowMode(use: boolean);
99
117
  set usePathTracing(use: boolean);
100
118
  get fpsAverage(): number;
101
119
  constructor(props: SceneProps);
@@ -105,6 +123,17 @@ export declare class Scene3D {
105
123
  removeEventListener: <T extends string | symbol>(event: T, fn: (...args: any[]) => void, context?: any) => EventEmitter<string | symbol, any>;
106
124
  showState(): void;
107
125
  hideState(): void;
126
+ hideAmrUI(all?: boolean, hideGoods?: boolean): void;
127
+ showAmrUI(all?: boolean): void;
128
+ private _showSlots;
129
+ get showSlots(): boolean;
130
+ set showSlots(value: boolean);
131
+ private _showSize;
132
+ get showSize(): boolean;
133
+ set showSize(value: boolean);
134
+ private _showControls;
135
+ get showControls(): boolean;
136
+ set showControls(value: boolean);
108
137
  private _updateCamera;
109
138
  private _loadEnv;
110
139
  private _drag;
@@ -118,12 +147,15 @@ export declare class Scene3D {
118
147
  toCameraRight(): void;
119
148
  toCameraFace(): void;
120
149
  generateBVH(): Promise<void>;
121
- download(): Promise<string>;
150
+ download(useRenderTarget?: boolean): Promise<string>;
151
+ captureTriViews(options?: TriViewCaptureOptions): Promise<TriViewCaptureResult>;
122
152
  clearAMR(): void;
123
153
  exportAMR(): Promise<ArrayBuffer | {
124
- [key: string]: any;
154
+ [key: string]: unknown;
125
155
  }>;
156
+ debounceForkHeightChange: () => void;
126
157
  addAMR(url: string, type?: string): Promise<void>;
158
+ focusSlots: (slots: Slot[]) => void;
127
159
  fit: () => void;
128
160
  select(obj: string | Object3D | Object3D[]): void;
129
161
  appendTo(parent: HTMLElement): void;
@@ -135,3 +167,65 @@ export declare class Scene3D {
135
167
  clean(): void;
136
168
  destroy(): void;
137
169
  }
170
+ export type TriViewKey = 'top' | 'front' | 'side' | 'perspective';
171
+ export interface TriViewCaptureSize {
172
+ width: number;
173
+ height: number;
174
+ }
175
+ export interface TriViewCaptureView {
176
+ key: string;
177
+ direction: Vector3;
178
+ up: Vector3;
179
+ plane: TriViewCapturePlane;
180
+ mode?: 'orthographic' | 'perspective';
181
+ fov?: number;
182
+ }
183
+ export interface TriViewCaptureOptions {
184
+ size?: TriViewCaptureSize;
185
+ margin?: number;
186
+ includeOverlay?: boolean;
187
+ backgroundColor?: Color | string | number | null;
188
+ views?: TriViewCaptureView[];
189
+ subject?: Object3D;
190
+ trimTransparent?: boolean;
191
+ enforceAspect?: boolean;
192
+ alphaThreshold?: number;
193
+ trimPadding?: number;
194
+ }
195
+ export interface TriViewCaptureResult {
196
+ top?: string;
197
+ front?: string;
198
+ side?: string;
199
+ [key: string]: string | undefined;
200
+ }
201
+ interface TriViewCapturePlane {
202
+ width: 'x' | 'y' | 'z';
203
+ height: 'x' | 'y' | 'z';
204
+ depth: 'x' | 'y' | 'z';
205
+ }
206
+ interface TriViewCaptureDeps {
207
+ renderer: WebGLRenderer;
208
+ scene: Scene;
209
+ overlayScene?: Scene;
210
+ subject: Object3D;
211
+ onBeforeCapture?: () => void;
212
+ onAfterCapture?: () => void;
213
+ }
214
+ export declare class TriViewCapture {
215
+ private deps;
216
+ private orthoCamera;
217
+ private perspectiveCamera;
218
+ private canvas;
219
+ private pixelBuffer;
220
+ constructor(deps: TriViewCaptureDeps);
221
+ capture(options?: TriViewCaptureOptions): Promise<TriViewCaptureResult>;
222
+ private resolveViews;
223
+ private computeBounds;
224
+ private configureCamera;
225
+ private getPerspectiveDirection;
226
+ private storeRendererState;
227
+ private applyRendererState;
228
+ private restoreRendererState;
229
+ private readPixels;
230
+ private ensureCanvas;
231
+ }
@@ -1,6 +1,8 @@
1
1
  import { LitElement } from 'lit';
2
2
  export interface SlotItemProps {
3
3
  name: string;
4
+ isMobile?: boolean;
5
+ logo?: string;
4
6
  onRemove?: () => void;
5
7
  }
6
8
  export declare class SlotItem extends LitElement {
@@ -10,6 +12,9 @@ export declare class SlotItem extends LitElement {
10
12
  static styles: import("lit").CSSResult;
11
13
  constructor(props: SlotItemProps);
12
14
  selected: boolean;
15
+ focused: boolean;
16
+ toBeInstalled: boolean;
17
+ toBeReplaced: boolean;
13
18
  hasError: boolean;
14
19
  canInstall: boolean;
15
20
  hide: boolean;
@@ -18,6 +23,7 @@ export declare class SlotItem extends LitElement {
18
23
  allFunctions: string[];
19
24
  functions: string[];
20
25
  deviceName: string;
26
+ deviceLogo: string;
21
27
  slot: any;
22
28
  get hasMoreFunctions(): boolean;
23
29
  removeDevice: () => void;
@@ -12,6 +12,7 @@ export interface SlotProps {
12
12
  show: boolean;
13
13
  isMirror: boolean;
14
14
  mirrorTarget?: string;
15
+ isMobile?: boolean;
15
16
  }
16
17
  export interface DeviceInfo {
17
18
  name: string;
@@ -26,6 +27,7 @@ export declare const SLOT_EVENTS: {
26
27
  ON_DEVICE_REPLACED: string;
27
28
  ON_BEFORE_SELECTED: string;
28
29
  ON_SELECTED: string;
30
+ ON_ADD_BUTTON_CLICKED: string;
29
31
  ON_DEVICE_SELECTED: string;
30
32
  ON_DROP_ERROR: string;
31
33
  ON_ERROR_STATE_CHANGE: string;
@@ -46,6 +48,9 @@ export declare class Slot extends CSS2DObject {
46
48
  private _loading;
47
49
  private _selected;
48
50
  private _deviceSelected;
51
+ private _focused;
52
+ private _toBeInstalled;
53
+ private _toBeReplaced;
49
54
  private _allFunctions;
50
55
  private _functions;
51
56
  private _timer;
@@ -80,6 +85,12 @@ export declare class Slot extends CSS2DObject {
80
85
  hide(): void;
81
86
  show(): void;
82
87
  get selected(): boolean;
88
+ get focused(): boolean;
89
+ set focused(f: boolean);
90
+ get toBeInstalled(): boolean;
91
+ set toBeInstalled(f: boolean);
92
+ get toBeReplaced(): boolean;
93
+ set toBeReplaced(f: boolean);
83
94
  set selected(s: boolean);
84
95
  get deviceSelected(): boolean;
85
96
  set deviceSelected(s: boolean);
@@ -0,0 +1,6 @@
1
+ import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
2
+ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
3
+ export declare class CameraPosition extends CSS2DObject {
4
+ private _controls;
5
+ constructor(_controls: OrbitControls);
6
+ }
@@ -0,0 +1,3 @@
1
+ import { BufferGeometry, Object3D, Scene } from 'three';
2
+ export declare function isMesh(m: Object3D): any;
3
+ export declare const mergeObject: (model: Object3D | Scene) => BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
@@ -38,3 +38,5 @@ export declare const generateLogoSize: (m: Mesh) => {
38
38
  width: number;
39
39
  height: number;
40
40
  };
41
+ export declare function isMobileWeb(): boolean;
42
+ export declare function isMiniProgram(): boolean;
@@ -1,4 +1,4 @@
1
- import ShopDevices from '../../../../../../../stories/devices/index';
1
+ import ShopDevices from './index';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  render: (args: any) => ShopDevices;
@@ -1,4 +1,4 @@
1
- import Pin from '../../../../../../../../stories/devices/src/pin';
1
+ import Pin from './pin';
2
2
  export default class Connector {
3
3
  readonly uuid: string;
4
4
  connections: Pin[];
@@ -1,5 +1,5 @@
1
- import { ConstraintExecResult, Constraintable } from '../../../../../../../../../stories/devices/src/constraints/constraint';
2
- import Pin from '../../../../../../../../../stories/devices/src/pin';
1
+ import { ConstraintExecResult, Constraintable } from './constraint';
2
+ import Pin from '../pin';
3
3
  export default class SameDeviceConstraint extends Constraintable {
4
4
  source: Pin;
5
5
  target: Pin;
@@ -1,5 +1,5 @@
1
- import { Constraintable, ConstraintExecResult } from '../../../../../../../../../stories/devices/src/constraints/constraint';
2
- import Pin from '../../../../../../../../../stories/devices/src/pin';
1
+ import { Constraintable, ConstraintExecResult } from './constraint';
2
+ import Pin from '../pin';
3
3
  export default class SingleConnectionConstraint extends Constraintable {
4
4
  source: Pin;
5
5
  target: Pin;
@@ -1,4 +1,4 @@
1
- import Pin from '../../../../../../../../stories/devices/src/pin';
1
+ import Pin from './pin';
2
2
  export default class Device {
3
3
  private _deviceId;
4
4
  private _name;
@@ -1,4 +1,3 @@
1
1
  export * from './device-viewer/main';
2
2
  export * from './sglb/index';
3
- export * from './cropper/index';
4
3
  export * from './utils/index';
@@ -0,0 +1,11 @@
1
+ /// <reference types="vite/client" />
2
+ import '@types/three'
3
+
4
+ declare module '*.vue';
5
+
6
+ declare module "*.glb" {
7
+ const value: string;
8
+ export default value;
9
+ }
10
+
11
+ declare module 'three-gpu-pathtracer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shop-components",
3
- "version": "0.1.68",
3
+ "version": "0.2.2",
4
4
  "description": "Shop components",
5
5
  "main": "dist/shop-components.umd.js",
6
6
  "module": "dist/shop-components.mjs",
@@ -22,42 +22,44 @@
22
22
  "author": "machengda<machengda@seer-group.com>",
23
23
  "license": "ISC",
24
24
  "devDependencies": {
25
+ "@needle-tools/gltf-progressive": "^3.3.5",
25
26
  "@storybook/addon-essentials": "^8.0.6",
26
27
  "@storybook/addon-links": "^8.0.6",
27
28
  "@storybook/addon-mdx-gfm": "^8.0.6",
29
+ "@storybook/addon-themes": "^8.0.6",
28
30
  "@storybook/blocks": "^8.0.6",
29
31
  "@storybook/web-components": "^8.0.6",
30
32
  "@storybook/web-components-vite": "^8.0.6",
31
33
  "auto-changelog": "^2.4.0",
32
- "lit": "^3.1.0",
33
34
  "react": "^18.2.0",
34
35
  "react-dom": "^18.2.0",
35
36
  "storybook": "^8.0.6",
36
- "three": "^0.164.0"
37
+ "vite": "^5.1.6",
38
+ "vite-plugin-dts": "^3.7.3"
37
39
  },
38
40
  "resolutions": {
39
41
  "string-width": "4.2.3"
40
42
  },
41
43
  "dependencies": {
42
44
  "@nodetoy/three-nodetoy": "^0.1.36",
43
- "@storybook/addon-themes": "^8.0.6",
44
45
  "@tweakpane/core": "^2.0.3",
45
46
  "@tweenjs/tween.js": "^23.1.2",
46
47
  "@types/bezier-js": "^4.1.1",
47
48
  "@types/howler": "^2.2.11",
48
- "@types/three": "^0.164.0",
49
+ "@types/three": "0.180.0",
49
50
  "bezier-js": "^6.1.4",
50
51
  "eventemitter3": "^5.0.1",
51
52
  "howler": "^2.2.4",
53
+ "lit": "^3.1.0",
52
54
  "pixi-viewport": "^5.0.2",
53
55
  "pixi.js": "7.4.0",
54
56
  "stats-fps.js": "0.0.6",
55
57
  "stylus": "^0.63.0",
58
+ "terser": "^5.44.0",
59
+ "three": "0.180.0",
56
60
  "three-gpu-pathtracer": "0.0.23",
57
61
  "three-mesh-bvh": "^0.7.5",
58
62
  "troika-three-text": "^0.49.1",
59
- "tweakpane": "^4.0.3",
60
- "vite": "^5.1.6",
61
- "vite-plugin-dts": "^3.7.3"
63
+ "tweakpane": "^4.0.3"
62
64
  }
63
65
  }
@@ -1,15 +0,0 @@
1
- import { Object3D, Vector3 } from 'three';
2
- export declare class SizeLine extends Object3D {
3
- private _startWith?;
4
- private _showText;
5
- private _line;
6
- private _text;
7
- private _textWrapper;
8
- private _tw;
9
- constructor(_startWith?: string | undefined, _showText?: boolean);
10
- reset(): void;
11
- update(start: Vector3, end: Vector3): void;
12
- updateDirection(pos: Vector3): void;
13
- updateSize(pos: Vector3): void;
14
- destroy(): void;
15
- }