@albi_scando/as-design-system-threejs-lib 1.1.5 → 1.1.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,22 +1,33 @@
1
1
  import { Locales } from '@albi_scando/as-const-languages-lib';
2
- export declare const OBSERVED_ATTRIBUTES: {
3
- LANGUAGES: string;
4
- SELECTED: string;
5
- };
6
2
  export declare class LanguagePickerComponent extends HTMLElement {
3
+ /**
4
+ * @see TextureLoader
5
+ */
7
6
  private static readonly textureLoader;
7
+ /**
8
+ * @see ShadowRoot
9
+ */
8
10
  readonly shadowRoot: ShadowRoot;
11
+ /**
12
+ * Observed attributes for the component.
13
+ */
9
14
  static get observedAttributes(): string[];
15
+ private options;
16
+ private flags;
17
+ /**
18
+ * Single source of truth for which language is currently selected.
19
+ * Everything else (rotation, BarMenu) is derived from this.
20
+ */
21
+ private selected;
22
+ private selectedTmp;
10
23
  private _renderer;
11
24
  private _scene;
12
25
  private _camera;
13
26
  private _root;
14
27
  private _canvas;
15
- private _controls;
16
28
  private _resizeObserver;
17
29
  private _clock;
18
30
  private _lastTime;
19
- private _lights;
20
31
  private _spotlight;
21
32
  private _flagsGroup;
22
33
  private _wind;
@@ -33,32 +44,41 @@ export declare class LanguagePickerComponent extends HTMLElement {
33
44
  private _introCameraHoldDuration;
34
45
  private _isIntroCameraAnimating;
35
46
  private _isIntroCameraHolding;
36
- private options;
37
- private flags;
38
- /**
39
- * Single source of truth for which language is currently selected.
40
- * Everything else (rotation, BarMenu) is derived from this.
41
- */
42
- private selected;
43
- private selectedTmp;
44
47
  private _menuContainer;
45
48
  private _menuIntroStartScale;
46
49
  private _barMenu;
47
- private _languageButtons;
48
50
  private _confirmationDialog;
49
51
  private _isInitialized;
50
52
  private _isInitializing;
51
53
  private _barMenuVisibleIndex;
54
+ private _floorGeometry;
55
+ private _floorMaterial;
52
56
  private _programmaticScrollTimer;
57
+ /**
58
+ * @constructor
59
+ */
53
60
  constructor();
61
+ /**
62
+ * Called when observed attributes change.
63
+ * @param name Name of the changed attribute.
64
+ * @param oldValue Previous value of the attribute, or null if it was not set.
65
+ * @param newValue New value of the attribute, or null if it was removed.
66
+ * @returns {void}
67
+ */
54
68
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
69
+ /**
70
+ * Called when the component is added to the DOM.
71
+ */
55
72
  connectedCallback(): void;
73
+ /**
74
+ * Called when the component is removed from the DOM.
75
+ */
56
76
  disconnectedCallback(): void;
57
77
  /**
58
- * Initialize the component with a set of languages.
59
- * @param languages Set of locale keys representing the languages to display.
78
+ * Initialize the component with a set of options.
79
+ * @param options Set of keys representing the options to display.
60
80
  */
61
- private _initializeComponent;
81
+ private init;
62
82
  /**
63
83
  * Cache references to important HTML elements.
64
84
  */
@@ -86,11 +106,7 @@ export declare class LanguagePickerComponent extends HTMLElement {
86
106
  * Rotates the flags ring and syncs the BarMenu to show the correct autonym.
87
107
  * Safe to call before init — queued and applied once the component is ready.
88
108
  */
89
- selectLanguage(language: Locales): void;
90
- addLanguage(_language: string): void;
91
- addLocales(_languages: string[]): void;
92
- removeLanguage(_language: string): void;
93
- removeLocales(_languages: string[]): void;
109
+ select(language: Locales): void;
94
110
  /**
95
111
  * Rotate the flags group so that the flag at `index` faces the camera.
96
112
  * @param id Locale key of the language to rotate to.
@@ -109,4 +125,8 @@ export declare class LanguagePickerComponent extends HTMLElement {
109
125
  private _updateGroupRotation;
110
126
  private _updateIntroCamera;
111
127
  private _setMenuIntroScale;
128
+ addLanguage(_language: string): void;
129
+ addLocales(_languages: string[]): void;
130
+ removeLanguage(_language: string): void;
131
+ removeLocales(_languages: string[]): void;
112
132
  }
@@ -1,4 +1,4 @@
1
1
  export { LanguagePickerComponent } from './component';
2
- export { OBSERVED_ATTRIBUTES } from './component';
3
2
  export { selector } from './selector';
4
3
  export { COMPONENT_CUSTOM_MESSAGES } from './custom-messages.const';
4
+ export { OBSERVED_ATTRIBUTES } from './observed-attributes.const';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * observed attributes for the language picker web component
3
+ */
4
+ export declare const OBSERVED_ATTRIBUTES: {
5
+ OPTIONS: string;
6
+ SELECTED: string;
7
+ };
@@ -1,34 +1,35 @@
1
- export interface ThemeCubeComponentOptions {
2
- options: Set<string>;
3
- selected?: string | undefined;
4
- }
1
+ import { Themes } from '@albi_scando/as-const-lib';
5
2
  export declare class ThemeCubeComponent extends HTMLElement {
6
- private static readonly FACE_VISUALS;
7
- private static readonly CUBE_SIDE_LENGTH;
8
3
  private static readonly textureLoader;
9
4
  readonly shadowRoot: ShadowRoot;
10
- private static readonly themesAttribute;
11
- private static readonly selectedAttribute;
5
+ static get observedAttributes(): string[];
6
+ private static readonly FACE_VISUALS;
7
+ private static readonly CUBE_SIDE_LENGTH;
8
+ private options;
9
+ /**
10
+ * Single source of truth for the selected theme.
11
+ * UI preview and confirmation derive from this value.
12
+ */
13
+ private selected;
14
+ private _renderer;
15
+ private _scene;
16
+ private _camera;
12
17
  private _root;
13
18
  private _canvas;
19
+ private _cube;
20
+ private _cubeGeometry;
21
+ private _cubeMaterials;
22
+ private _resizeObserver;
23
+ private _clock;
24
+ private _lastTime;
25
+ private _animationFrameId;
14
26
  private _hintTop;
15
27
  private _previewTitle;
16
28
  private _previewSub;
17
29
  private _applyBtn;
18
30
  private _confirmationDialog;
19
31
  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
32
  private _themeTextures;
31
- private _selected;
32
33
  private _currentFaceThemeId;
33
34
  private _isDragging;
34
35
  private _lastPointerX;
@@ -44,18 +45,20 @@ export declare class ThemeCubeComponent extends HTMLElement {
44
45
  private _isInitializing;
45
46
  private readonly _tmpCamDir;
46
47
  private readonly _tmpWorldNormal;
47
- static get observedAttributes(): string[];
48
- constructor(input?: ThemeCubeComponentOptions);
48
+ constructor();
49
49
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
50
50
  connectedCallback(): void;
51
51
  disconnectedCallback(): void;
52
- private initializeComponent;
52
+ private init;
53
53
  private setupHtmlElements;
54
- private _sanitizeThemes;
55
- private _setupDOM;
56
- private _setupScene;
57
- private _setupCube;
58
- private _setupApplyButton;
54
+ private setupScene;
55
+ private setupUI;
56
+ private setupCube;
57
+ private resizeHandler;
58
+ private setupApplyButton;
59
+ private setupConfirmationDialog;
60
+ select(theme: Themes): void;
61
+ private _syncRotationToSelected;
59
62
  private _handleApplyClick;
60
63
  private _applyTheme;
61
64
  private _updatePreviewDialog;
@@ -76,7 +79,8 @@ export declare class ThemeCubeComponent extends HTMLElement {
76
79
  private _bindEvents;
77
80
  private _unbindEvents;
78
81
  private _parseThemesAttribute;
79
- private _setupConfirmationDialog;
82
+ private _sanitizeThemes;
83
+ private _normalizeOptions;
80
84
  private _handleConfirmation;
81
85
  private _handleConfirmationCancel;
82
86
  private _resolveThemeFaceVisual;
@@ -0,0 +1,5 @@
1
+ import { Themes } from '@albi_scando/as-const-lib';
2
+ export declare const DEFAULT_VALUES: {
3
+ readonly selected: "dark-purple";
4
+ readonly options: Set<Themes>;
5
+ };
@@ -1,4 +1,4 @@
1
1
  export { ThemeCubeComponent } from './component';
2
- export type { ThemeCubeComponentOptions } from './component';
3
2
  export { selector } from './selector';
4
3
  export { COMPONENT_CUSTOM_MESSAGES } from './custom-messages.const';
4
+ export { OBSERVED_ATTRIBUTES } from './observed-attributes.const';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * observed attributes for the language picker web component
3
+ */
4
+ export declare const OBSERVED_ATTRIBUTES: {
5
+ OPTIONS: string;
6
+ SELECTED: string;
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@albi_scando/as-design-system-threejs-lib",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
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": [