@variantic/player 0.0.24 → 0.0.25

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 (36) hide show
  1. package/README.md +35 -3
  2. package/assembly.d.ts +4762 -0
  3. package/index.d.ts +2198 -0
  4. package/package.json +17 -10
  5. package/libs/packages/player/src/index.d.ts +0 -8
  6. package/libs/schemas/engine/src/index.d.ts +0 -4
  7. package/libs/schemas/engine/src/lib/documentation.d.ts +0 -9
  8. package/libs/schemas/engine/src/lib/engine.d.ts +0 -215
  9. package/libs/schemas/engine/src/lib/publication.d.ts +0 -82
  10. package/libs/schemas/engine/src/lib/studio.d.ts +0 -81
  11. package/libs/schemas/file-types/export-configuration/src/index.d.ts +0 -1
  12. package/libs/schemas/file-types/export-configuration/src/lib/export-configuration.d.ts +0 -10
  13. package/libs/schemas/file-types/vas/src/index.d.ts +0 -3
  14. package/libs/schemas/file-types/vas/src/lib/interaction.d.ts +0 -3
  15. package/libs/schemas/file-types/vas/src/lib/object-configuration.d.ts +0 -25
  16. package/libs/schemas/file-types/vas/src/lib/vas.d.ts +0 -612
  17. package/libs/schemas/library-api/src/index.d.ts +0 -1
  18. package/libs/schemas/library-api/src/lib/library-api.d.ts +0 -27
  19. package/libs/schemas/web-component/api/player/ar/src/index.d.ts +0 -1
  20. package/libs/schemas/web-component/api/player/ar/src/lib/ar.d.ts +0 -22
  21. package/libs/schemas/web-component/api/player/configuration/src/index.d.ts +0 -1
  22. package/libs/schemas/web-component/api/player/configuration/src/lib/configuration.d.ts +0 -27
  23. package/libs/schemas/web-component/api/player/documentation/src/index.d.ts +0 -1
  24. package/libs/schemas/web-component/api/player/documentation/src/lib/documentation.d.ts +0 -26
  25. package/libs/schemas/web-component/api/player/events/src/index.d.ts +0 -1
  26. package/libs/schemas/web-component/api/player/events/src/lib/events.d.ts +0 -19
  27. package/libs/schemas/web-component/api/player/integration-connector/src/index.d.ts +0 -1
  28. package/libs/schemas/web-component/api/player/integration-connector/src/lib/integration-connector.d.ts +0 -30
  29. package/libs/schemas/web-component/api/player/layout/src/index.d.ts +0 -1
  30. package/libs/schemas/web-component/api/player/layout/src/lib/layout.d.ts +0 -18
  31. package/libs/schemas/web-component/api/player/player/src/index.d.ts +0 -1
  32. package/libs/schemas/web-component/api/player/player/src/lib/player.d.ts +0 -46
  33. package/libs/schemas/web-component/api/player/snapshot/src/index.d.ts +0 -1
  34. package/libs/schemas/web-component/api/player/snapshot/src/lib/snapshot.d.ts +0 -29
  35. package/libs/schemas/web-component/api/player/viewer/src/index.d.ts +0 -1
  36. package/libs/schemas/web-component/api/player/viewer/src/lib/viewer.d.ts +0 -471
package/package.json CHANGED
@@ -1,18 +1,25 @@
1
1
  {
2
2
  "name": "@variantic/player",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
- "devDependencies": {
12
- "emittery": "^1.0.2"
13
- },
14
8
  "type": "commonjs",
15
- "typings": "./libs/packages/player/src/index.d.ts",
16
- "types": "./libs/packages/player/src/index.d.ts",
17
- "main": "./libs/packages/player/src/index.js"
9
+ "typings": "./index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./index.d.ts"
13
+ },
14
+ "./assembly": {
15
+ "types": "./assembly.d.ts"
16
+ }
17
+ },
18
+ "typesVersions": {
19
+ "*": {
20
+ "assembly": [
21
+ "assembly.d.ts"
22
+ ]
23
+ }
24
+ }
18
25
  }
@@ -1,8 +0,0 @@
1
- export * from '@variantic/schemas/web-component-apis/player/viewer';
2
- export * from '@variantic/schemas/web-component-apis/player/ar';
3
- export * from '@variantic/schemas/web-component-apis/player/configuration';
4
- export * from '@variantic/schemas/web-component-apis/player/documentation';
5
- export * from '@variantic/schemas/web-component-apis/player/integrationConnector';
6
- export * from '@variantic/schemas/web-component-apis/player/layout';
7
- export * from '@variantic/schemas/web-component-apis/player/snapshot';
8
- export * from '@variantic/schemas/web-component-apis/player';
@@ -1,4 +0,0 @@
1
- export * from './lib/engine';
2
- export * from './lib/publication';
3
- export * from './lib/documentation';
4
- export * from './lib/studio';
@@ -1,9 +0,0 @@
1
- export type TDocumentation = {
2
- id: string;
3
- parameters: {
4
- name: string;
5
- type: 'TEXT' | 'PROJECTION' | 'BOOL' | 'SOURCE_DATA';
6
- uuid: string;
7
- value: string;
8
- }[];
9
- };
@@ -1,215 +0,0 @@
1
- import type { TObjectConfiguration, TInteractionMode, TVasFile } from '@variantic/schemas/file-types/vas';
2
- import type { TPublication } from './publication';
3
- import type { TDocumentation } from './documentation';
4
- import type { TStudioShadowMapType, TVsmShadowQuality } from './studio';
5
- export type TValue = string | number | boolean;
6
- export { TInteractionMode };
7
- export type TSettings = TVasFile['set']['configuration']['settings'] & {
8
- sceneSettings?: TVasFile['set']['configuration']['sceneSettings'] & {
9
- backgroundColor?: string | null;
10
- studioId?: number | null;
11
- envMap?: string | null;
12
- toneMapping?: {
13
- mode?: 'None' | 'Linear' | 'Reinhard' | 'Cineon' | 'ACESFilmic' | 'AgX' | 'Neutral';
14
- exposure?: number;
15
- };
16
- shadowMap?: {
17
- type?: TStudioShadowMapType;
18
- vsmQuality?: TVsmShadowQuality;
19
- };
20
- };
21
- cameraSettings?: TVasFile['set']['configuration']['cameraSettings'];
22
- flowsSettings?: TVasFile['set']['configuration']['flowsSettings'];
23
- };
24
- export type TRootObjectData = {
25
- id: string;
26
- fileId: string;
27
- transform: number[];
28
- showInProductsList?: boolean;
29
- singleObjectSelected?: boolean;
30
- };
31
- export type TRootObjectConfiguration = {
32
- id: string;
33
- fileId: string;
34
- name?: string;
35
- transform: number[];
36
- interaction?: TInteractionMode;
37
- configuration?: Record<string, TObjectConfiguration>;
38
- };
39
- export type TRootData = Partial<{
40
- publication: TPublication;
41
- documentation: TDocumentation;
42
- }>;
43
- export type TRenderDataObjectTag = `subcomponent:${string}`;
44
- export type TAnimationRenderData = {
45
- key: string;
46
- clips: {
47
- name: string;
48
- duration: number;
49
- channels: {
50
- target: {
51
- path: 'translation' | 'rotation';
52
- };
53
- sampler: {
54
- start: 'current';
55
- times: number[];
56
- easings: string[];
57
- values: TValue[][];
58
- };
59
- }[];
60
- }[];
61
- };
62
- export type TRenderDataObject = Partial<{
63
- controlledVisibility: boolean;
64
- inAvailableSpace: boolean;
65
- count: number;
66
- positioning: number[];
67
- transform: number[];
68
- propagation: number[];
69
- geometry: [string, Record<string, TValue>];
70
- dimensionGeometry: [string, Record<string, TValue>];
71
- importedGeometry: [string, Record<string, TValue>];
72
- isGroup: boolean;
73
- isImport: boolean;
74
- interaction: TInteractionMode;
75
- movementPlane: number[];
76
- keyPoint: {
77
- tags: string[];
78
- snappedGridPlaneId?: string;
79
- };
80
- gridPlane: {
81
- mode: 'static' | 'sticky';
82
- priority: TValue;
83
- tags: string[];
84
- snaps: TSnap[];
85
- };
86
- boxCollider: {
87
- tags: string[];
88
- collision: boolean;
89
- interact: boolean;
90
- occluder: boolean;
91
- rangefinder: boolean;
92
- };
93
- rangefinder: {
94
- tags: string[];
95
- axis: Array<'x' | 'y' | 'z'>;
96
- near: number;
97
- far: number;
98
- };
99
- dynamicConfiguration: Record<string, number>;
100
- layers: number[];
101
- dimensioning: Record<string, never>;
102
- material: Record<string, {
103
- blobUrl: string;
104
- overrides?: Record<string, unknown>;
105
- }>;
106
- modifier: 'subtract' | 'intersect';
107
- textureFit: {
108
- offset: {
109
- x: number | 'random';
110
- y: number | 'random';
111
- };
112
- rotation: number | 'random';
113
- scale: number;
114
- flip: {
115
- x: boolean;
116
- y: boolean;
117
- };
118
- };
119
- rendering: {
120
- shadow: [boolean, boolean];
121
- order: number;
122
- };
123
- animation: TAnimationRenderData;
124
- tags: TRenderDataObjectTag[];
125
- }>;
126
- export type TUniqueRenderDataObject = {
127
- id: string;
128
- ref: string;
129
- } & TRenderDataObject;
130
- export type TRenderData = {
131
- entryObjects: number[];
132
- tree: Record<string, number[]>;
133
- objects: TUniqueRenderDataObject[];
134
- activeDrag?: number;
135
- };
136
- export type TPricingSection = {
137
- name: string;
138
- table: string[][];
139
- price: number;
140
- priceColumnIndex: number;
141
- };
142
- export type TPricingData = {
143
- sections: TPricingSection[];
144
- finalPrice: number;
145
- };
146
- export type TTreeObjectOverrides = Partial<{
147
- transform: number[];
148
- movementPlane: number[];
149
- interaction: TInteractionMode;
150
- }>;
151
- export type TSnapType = 'point' | 'grid';
152
- export type TSnapTypeMaker<T extends TSnapType, U extends Record<string, unknown>> = {
153
- id: string;
154
- type: T;
155
- data: U;
156
- snappedKeyPointIds: string[];
157
- };
158
- export type TSnapPoint = TSnapTypeMaker<'point', {
159
- x: TValue;
160
- y: TValue;
161
- }>;
162
- export type TSnapGrid = TSnapTypeMaker<'grid', {
163
- cols: TValue;
164
- rows: TValue;
165
- }>;
166
- export type TSnap = TSnapPoint | TSnapGrid;
167
- /**
168
- * Snaps because of different types
169
- * have to be identified in different ways based
170
- * on the type which snap point belongs to
171
- *
172
- * Example
173
- * { type: 'grid', snapId: 0, data: { row: 0, col: 1 } } }
174
- *
175
- * Which means that we are referring to the grid (snaps array index 0) snap point
176
- * on row 0 and column 1
177
- */
178
- export type TSnapIdentifierMaker<T extends TSnapType, U extends Record<string, unknown>> = {
179
- id: string;
180
- type: T;
181
- data: U;
182
- };
183
- export type TSnapPointIdentifier = TSnapIdentifierMaker<'point', {
184
- x: number;
185
- y: number;
186
- }>;
187
- export type TSnapGridIdentifier = TSnapIdentifierMaker<'grid', {
188
- col: number;
189
- row: number;
190
- }>;
191
- export type TSnapIdentifier = TSnapPointIdentifier | TSnapGridIdentifier;
192
- export type TCommonMaterialGroupProperties = {
193
- hash: string;
194
- selected: string;
195
- alias: string;
196
- };
197
- export type TMaterialGroup = ({
198
- type: 'list';
199
- materials: string[];
200
- } | {
201
- type: 'query';
202
- query: Record<string, any>;
203
- }) & TCommonMaterialGroupProperties;
204
- export type TCommonSubcomponentGroupProperties = {
205
- hash: string;
206
- selected: string;
207
- alias: string;
208
- };
209
- export type TSubcomponentGroup = ({
210
- type: 'list';
211
- assets: string[];
212
- } | {
213
- type: 'query';
214
- query: Record<string, any>;
215
- }) & TCommonSubcomponentGroupProperties;
@@ -1,82 +0,0 @@
1
- export type TPublication = {
2
- containers: TPublicationContainer[];
3
- };
4
- export type TPublicationContainer = {
5
- id: string;
6
- panels: TPublicationPanel[];
7
- };
8
- export type TPublicationPanel = {
9
- id: string;
10
- label: string;
11
- events: TEvents;
12
- blocks: TPublicationBlock[];
13
- };
14
- export type TPublicationBlock = {
15
- id: string;
16
- label: string;
17
- events: TEvents;
18
- kind: TBlockNumberRange | TBlockNumberPredefined | TBlockText | TBlockTextInput | TBlockBoolean | TBlockList;
19
- };
20
- export type TBlockNumberRange = {
21
- type: 'number-range';
22
- value: number;
23
- range: {
24
- min: number;
25
- max: number;
26
- };
27
- preferred: number[];
28
- };
29
- export type TBlockNumberPredefined = {
30
- type: 'number-predefined';
31
- value: number;
32
- options: number[];
33
- };
34
- export type TBlockText = {
35
- type: 'text';
36
- value: string;
37
- };
38
- export type TBlockTextInput = {
39
- type: 'text-input';
40
- value: string;
41
- maxLength: number;
42
- placeholder: string;
43
- };
44
- export type TBlockBoolean = {
45
- type: 'boolean';
46
- value: boolean;
47
- };
48
- export type TBlockList = {
49
- type: 'list';
50
- style: TBlockListDropdownStyle | TBlockListButtonsStyle | TBlockListDropdownImageStyle | TBlockListButtonsImageStyle;
51
- selected: string;
52
- options: Array<{
53
- value: string;
54
- label: string;
55
- imageId?: string;
56
- }>;
57
- };
58
- export type TBlockListDropdownStyle = {
59
- type: 'dropdown';
60
- };
61
- export type TBlockListButtonsStyle = {
62
- type: 'buttons';
63
- align: 'content' | 'responsive';
64
- };
65
- export type TBlockListDropdownImageStyle = {
66
- type: 'dropdownImage';
67
- size: 'sm' | 'md' | 'lg';
68
- };
69
- export type TBlockListButtonsImageStyle = {
70
- type: 'buttonsImage';
71
- size: 'sm' | 'md' | 'lg';
72
- shape: 'square' | 'portrait' | 'landscape';
73
- };
74
- export type TEvents = {
75
- hover?: Array<{
76
- type: 'layer';
77
- layers: number[];
78
- } | {
79
- type: 'dimension';
80
- ids: string[];
81
- }>;
82
- } | undefined;
@@ -1,81 +0,0 @@
1
- export type TStudioId = 0 | 1 | 2;
2
- export type TStudioToneMappingMode = 'None' | 'Linear' | 'Reinhard' | 'Cineon' | 'ACESFilmic' | 'AgX' | 'Neutral';
3
- export type TStudioShadowMapType = 'Basic' | 'PCF' | 'VSM';
4
- export type TVsmShadowQuality = 'Performance' | 'Balanced' | 'Quality';
5
- export type TStudioShadowMapConfig = {
6
- type: TStudioShadowMapType;
7
- vsmQuality: TVsmShadowQuality;
8
- };
9
- export type TStudioSceneConfig = {
10
- backgroundColor: string | null;
11
- envMap: string | null;
12
- backgroundMode: 'color' | 'environment';
13
- backgroundBlurriness: number;
14
- backgroundIntensity: number;
15
- environmentIntensity: number;
16
- environmentRotationY: number;
17
- shadowMap: TStudioShadowMapConfig;
18
- toneMapping: {
19
- mode: TStudioToneMappingMode;
20
- exposure: number;
21
- };
22
- };
23
- export type TStudioFloorConfig = {
24
- activeFloor: boolean;
25
- activeFloorShadow: boolean;
26
- useFloorInAR: boolean;
27
- reflection: {
28
- enabled: boolean;
29
- opacity: number;
30
- fadeDistance: number;
31
- };
32
- floorSize: {
33
- x: number;
34
- y: number;
35
- };
36
- floorSizeType: 'infinity' | 'likeObject' | 'custom';
37
- selectedMaterialGroup: number | null;
38
- selectedDefaultMaterial: number | null;
39
- };
40
- /**
41
- * Settings a studio explicitly owns. Definitions only declare editable
42
- * paths; the runtime fills in the remaining paths from compatibility defaults.
43
- */
44
- export type TStudioSceneSettings = Partial<Omit<TStudioSceneConfig, 'toneMapping' | 'shadowMap'>> & {
45
- toneMapping?: Partial<TStudioSceneConfig['toneMapping']>;
46
- shadowMap?: Partial<TStudioSceneConfig['shadowMap']>;
47
- };
48
- export type TStudioFloorSettings = Partial<Omit<TStudioFloorConfig, 'reflection' | 'floorSize'>> & {
49
- reflection?: Partial<TStudioFloorConfig['reflection']>;
50
- floorSize?: Partial<TStudioFloorConfig['floorSize']>;
51
- };
52
- export type TStudioSettings = {
53
- scene?: TStudioSceneSettings;
54
- floor?: TStudioFloorSettings;
55
- };
56
- /** Complete scene/floor settings after defaults and persisted overrides. */
57
- export type TStudioResolvedSettings = {
58
- scene: TStudioSceneConfig;
59
- floor: TStudioFloorConfig;
60
- };
61
- /**
62
- * Generic definition type keeps the schema package independent of Three.js.
63
- * Viewer code supplies its builder context and light-group result types.
64
- */
65
- export type TStudioDefinition<TBuilderContext = unknown, TLightGroup = unknown> = {
66
- id: TStudioId;
67
- name: string;
68
- settings: TStudioSettings;
69
- configuration: {
70
- createLights: (context: TBuilderContext) => TLightGroup;
71
- };
72
- };
73
- /** Legacy persisted light override data is retained but never edited. */
74
- export type TStudioLightsSettings = {
75
- preset: 'directional' | 'area' | 'environment';
76
- };
77
- export type TStudioOverrides = {
78
- scene?: TStudioSceneSettings;
79
- lights?: Partial<TStudioLightsSettings>;
80
- floor?: TStudioFloorSettings;
81
- };
@@ -1 +0,0 @@
1
- export * from './lib/export-configuration';
@@ -1,10 +0,0 @@
1
- import { type Static } from '@sinclair/typebox';
2
- export declare const exportConfigurationSchema: import("@sinclair/typebox").TObject<{
3
- exports: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
4
- name: import("@sinclair/typebox").TString;
5
- bomTemplateId: import("@sinclair/typebox").TNumber;
6
- bomFilterId: import("@sinclair/typebox").TNumber;
7
- }>>;
8
- v: import("@sinclair/typebox").TLiteral<1>;
9
- }>;
10
- export type TExportConfigurationFile = Static<typeof exportConfigurationSchema>;
@@ -1,3 +0,0 @@
1
- export * from './lib/vas';
2
- export * from './lib/object-configuration';
3
- export * from './lib/interaction';
@@ -1,3 +0,0 @@
1
- import { type Static } from '@sinclair/typebox';
2
- export declare const interactionModeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"select-only">, import("@sinclair/typebox").TLiteral<"select-and-drag">]>;
3
- export type TInteractionMode = Static<typeof interactionModeSchema>;
@@ -1,25 +0,0 @@
1
- import { type Static } from '@sinclair/typebox';
2
- export declare const objectConfigurationSchema: import("@sinclair/typebox").TObject<{
3
- transform: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
4
- publication: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
5
- blocks: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
6
- }>>;
7
- materials: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
8
- selected: import("@sinclair/typebox").TString;
9
- }>>>;
10
- subcomponent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
11
- selected: import("@sinclair/typebox").TString;
12
- }>>>;
13
- interaction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"select-only">, import("@sinclair/typebox").TLiteral<"select-and-drag">]>>;
14
- draggable: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
15
- movementPlane: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
16
- gridPlane: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
17
- snaps: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
18
- snappedObjects: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
19
- }>>;
20
- }>>;
21
- keyPoint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
22
- snappedObject: import("@sinclair/typebox").TString;
23
- }>>;
24
- }>;
25
- export type TObjectConfiguration = Static<typeof objectConfigurationSchema>;