@albi_scando/as-design-system-threejs-lib 1.0.9 → 1.1.0
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/dist/as-design-system-threejs-lib.es.js +4471 -3938
- package/dist/as-design-system-threejs-lib.umd.js +172 -149
- package/dist/types/constants/box-face-normals.constant.d.ts +12 -0
- package/dist/types/constants/custom-messages.const.d.ts +1 -0
- package/dist/types/main.d.ts +3 -0
- package/dist/types/mappers/themes.mapper.d.ts +1 -0
- package/dist/types/utils/switch-theme.utils.d.ts +4 -0
- package/dist/types/web-components/language-picker/component.d.ts +7 -6
- package/dist/types/web-components/theme-picker/component.d.ts +82 -0
- package/dist/types/web-components/theme-picker/custom-messages.const.d.ts +3 -0
- package/dist/types/web-components/theme-picker/main.d.ts +4 -0
- package/dist/types/web-components/theme-picker/selector.d.ts +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Predefined normals for each face of a cube, used for raycasting and determining which face is being interacted with.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BOX_FACE_NORMALS: {
|
|
6
|
+
readonly RIGHT: Vector3;
|
|
7
|
+
readonly LEFT: Vector3;
|
|
8
|
+
readonly TOP: Vector3;
|
|
9
|
+
readonly BOTTOM: Vector3;
|
|
10
|
+
readonly FRONT: Vector3;
|
|
11
|
+
readonly BACK: Vector3;
|
|
12
|
+
};
|
package/dist/types/main.d.ts
CHANGED
|
@@ -2,4 +2,7 @@ import { APPLICATION_NAME } from './constants/application.constant.ts';
|
|
|
2
2
|
export { APPLICATION_NAME };
|
|
3
3
|
export { WebComponentsRegistry } from './web-components/registry.ts';
|
|
4
4
|
export { CUSTOM_MESSAGES } from './constants/custom-messages.const.ts';
|
|
5
|
+
export { switchTheme, clearThemes } from './utils/switch-theme.utils.ts';
|
|
6
|
+
export { THEME_TEXTURES_MAPPER } from './mappers/themes.mapper.ts';
|
|
5
7
|
export * as LanguagePicker from './web-components/language-picker/main.ts';
|
|
8
|
+
export * as ThemePicker from './web-components/theme-picker/main.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const THEME_TEXTURES_MAPPER: Readonly<Record<string, string>>;
|
|
@@ -4,14 +4,15 @@ export interface LanguagePickerComponentOptions {
|
|
|
4
4
|
selected?: Locales | undefined;
|
|
5
5
|
}
|
|
6
6
|
export declare class LanguagePickerComponent extends HTMLElement {
|
|
7
|
-
private static readonly
|
|
8
|
-
private static readonly
|
|
7
|
+
private static readonly textureLoader;
|
|
8
|
+
private static readonly languagesAttribute;
|
|
9
|
+
private static readonly selectedAttribute;
|
|
9
10
|
private readonly _shadowRoot;
|
|
10
|
-
private _container;
|
|
11
|
-
private _canvas;
|
|
12
|
-
private _camera;
|
|
13
11
|
private _renderer;
|
|
14
12
|
private _scene;
|
|
13
|
+
private _camera;
|
|
14
|
+
private _container;
|
|
15
|
+
private _canvas;
|
|
15
16
|
private _controls;
|
|
16
17
|
private _resizeObserver;
|
|
17
18
|
private _clock;
|
|
@@ -51,7 +52,7 @@ export declare class LanguagePickerComponent extends HTMLElement {
|
|
|
51
52
|
private _setupUI;
|
|
52
53
|
private _setupFlags;
|
|
53
54
|
private _computeIntroCameraEndPosition;
|
|
54
|
-
private
|
|
55
|
+
private _setupConfirmationDialog;
|
|
55
56
|
/**
|
|
56
57
|
* Handles the confirmation of a language change.
|
|
57
58
|
*
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export interface ThemeCubeComponentOptions {
|
|
2
|
+
options: Set<string>;
|
|
3
|
+
selected?: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare class ThemeCubeComponent extends HTMLElement {
|
|
6
|
+
private static readonly FACE_VISUALS;
|
|
7
|
+
private static readonly CUBE_SIDE_LENGTH;
|
|
8
|
+
private static readonly textureLoader;
|
|
9
|
+
private static readonly themesAttribute;
|
|
10
|
+
private static readonly selectedAttribute;
|
|
11
|
+
readonly shadowRoot: ShadowRoot;
|
|
12
|
+
private _root;
|
|
13
|
+
private _canvas;
|
|
14
|
+
private _hintTop;
|
|
15
|
+
private _previewTitle;
|
|
16
|
+
private _previewSub;
|
|
17
|
+
private _applyBtn;
|
|
18
|
+
private _confirmationDialog;
|
|
19
|
+
private _isConfirmationDialogOpen;
|
|
20
|
+
private _renderer;
|
|
21
|
+
private _scene;
|
|
22
|
+
private _camera;
|
|
23
|
+
private _cube;
|
|
24
|
+
private _cubeGeometry;
|
|
25
|
+
private _cubeMaterials;
|
|
26
|
+
private readonly _clock;
|
|
27
|
+
private _animFrameId;
|
|
28
|
+
private _resizeObserver;
|
|
29
|
+
private _themes;
|
|
30
|
+
private _themeTextures;
|
|
31
|
+
private _selected;
|
|
32
|
+
private _currentFaceThemeId;
|
|
33
|
+
private _isDragging;
|
|
34
|
+
private _lastPointerX;
|
|
35
|
+
private _lastPointerY;
|
|
36
|
+
private _dragPointerId;
|
|
37
|
+
private _rotX;
|
|
38
|
+
private _rotY;
|
|
39
|
+
private _idleSeconds;
|
|
40
|
+
private _autoSpinEnabled;
|
|
41
|
+
private _autoVelX;
|
|
42
|
+
private _autoVelY;
|
|
43
|
+
private _isInitialized;
|
|
44
|
+
private _isInitializing;
|
|
45
|
+
private readonly _tmpCamDir;
|
|
46
|
+
private readonly _tmpWorldNormal;
|
|
47
|
+
static get observedAttributes(): string[];
|
|
48
|
+
constructor(input?: ThemeCubeComponentOptions);
|
|
49
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
50
|
+
connectedCallback(): void;
|
|
51
|
+
disconnectedCallback(): void;
|
|
52
|
+
private initializeComponent;
|
|
53
|
+
private _sanitizeThemes;
|
|
54
|
+
private _setupDOM;
|
|
55
|
+
private _setupScene;
|
|
56
|
+
private _setupCube;
|
|
57
|
+
private _setupApplyButton;
|
|
58
|
+
private _handleApplyClick;
|
|
59
|
+
private _applyTheme;
|
|
60
|
+
private _updatePreviewDialog;
|
|
61
|
+
private _animate;
|
|
62
|
+
private _updateIdleAutoSpin;
|
|
63
|
+
private _getFrontFaceIndex;
|
|
64
|
+
private _updateCameraForLayout;
|
|
65
|
+
private _updatePanelPosition;
|
|
66
|
+
private _setMaterialTexture;
|
|
67
|
+
private _createFallbackFaceTexture;
|
|
68
|
+
private _getThemeIdForFace;
|
|
69
|
+
private _formatThemeName;
|
|
70
|
+
private _restoreThemePreview;
|
|
71
|
+
private _stopAutoSpinFromInteraction;
|
|
72
|
+
private _onPointerDown;
|
|
73
|
+
private _onPointerMove;
|
|
74
|
+
private _onPointerUp;
|
|
75
|
+
private _bindEvents;
|
|
76
|
+
private _unbindEvents;
|
|
77
|
+
private _parseThemesAttribute;
|
|
78
|
+
private _setupConfirmationDialog;
|
|
79
|
+
private _handleConfirmation;
|
|
80
|
+
private _handleConfirmationCancel;
|
|
81
|
+
private _resolveThemeFaceVisual;
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const selector = "theme-picker";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@albi_scando/as-design-system-threejs-lib",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A library of reusable, strongly typed threejs Web Components built with TypeScript, designed for creating consistent and maintainable user interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@albi_scando/as-const-languages-lib": "^1.1.1",
|
|
50
|
-
"@albi_scando/as-const-lib": "^1.
|
|
51
|
-
"@albi_scando/as-design-system-lib": "^1.
|
|
50
|
+
"@albi_scando/as-const-lib": "^1.11.0",
|
|
51
|
+
"@albi_scando/as-design-system-lib": "^1.7.0",
|
|
52
52
|
"@albi_scando/as-threejs-flags-lib": "^2.3.2",
|
|
53
53
|
"@commitlint/cli": "^20.4.1",
|
|
54
54
|
"@commitlint/config-conventional": "^20.4.1",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@semantic-release/git": "^10.0.1",
|
|
59
59
|
"@semantic-release/github": "^12.0.3",
|
|
60
60
|
"@semantic-release/npm": "^13.1.3",
|
|
61
|
-
"@storybook/addon-docs": "10.
|
|
62
|
-
"@storybook/html-vite": "10.
|
|
61
|
+
"@storybook/addon-docs": "10.3.0",
|
|
62
|
+
"@storybook/html-vite": "10.3.0",
|
|
63
63
|
"@types/node": "^25.2.1",
|
|
64
64
|
"@types/numeric": "^1.2.6",
|
|
65
65
|
"@vitest/coverage-v8": "^4.0.18",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"eslint-plugin-prettier": "^5.5.5",
|
|
73
73
|
"eslint-plugin-regexp": "^3.0.0",
|
|
74
74
|
"eslint-plugin-security": "^3.0.1",
|
|
75
|
-
"eslint-plugin-storybook": "10.
|
|
75
|
+
"eslint-plugin-storybook": "10.3.0",
|
|
76
76
|
"globals": "^17.3.0",
|
|
77
77
|
"http-server": "^14.1.1",
|
|
78
78
|
"husky": "^9.1.7",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"prettier": "3.8.1",
|
|
81
81
|
"sass": "^1.97.3",
|
|
82
82
|
"semantic-release": "^25.0.3",
|
|
83
|
-
"storybook": "10.
|
|
83
|
+
"storybook": "10.3.0",
|
|
84
84
|
"typedoc": "^0.28.16",
|
|
85
85
|
"typescript": "^5.9.3",
|
|
86
86
|
"typescript-eslint": "^8.54.0",
|