@breadstone/mosaik-elements-foundation 0.0.221 → 0.0.222
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/Controls/Behaviors/Themeable.js +2 -2
- package/Controls/Behaviors/Themeable.js.map +1 -1
- package/Controls/Components/Buttons/Button/Themes/ButtonElement.Cosmopolitan.js +26 -26
- package/Controls/Components/Buttons/Button/Themes/ButtonElement.Joy.js +27 -27
- package/Controls/Components/Buttons/Button/Themes/ButtonElement.Memphis.js +26 -26
- package/Controls/Components/Buttons/CompoundButton/Themes/CompoundButtonElement.Cosmopolitan.js +8 -8
- package/Controls/Components/Buttons/CompoundButton/Themes/CompoundButtonElement.Joy.js +10 -10
- package/Controls/Components/Buttons/CompoundButton/Themes/CompoundButtonElement.Memphis.js +9 -9
- package/Controls/Components/Buttons/DropDownButton/Themes/DropDownButtonElement.Cosmopolitan.js +9 -9
- package/Controls/Components/Buttons/DropDownButton/Themes/DropDownButtonElement.Joy.js +10 -10
- package/Controls/Components/Buttons/DropDownButton/Themes/DropDownButtonElement.Memphis.js +8 -8
- package/Controls/Components/Buttons/FloatingActionButton/Themes/FloatingActionButtonElement.Cosmopolitan.js +8 -8
- package/Controls/Components/Buttons/FloatingActionButton/Themes/FloatingActionButtonElement.Joy.js +9 -9
- package/Controls/Components/Buttons/FloatingActionButton/Themes/FloatingActionButtonElement.Memphis.js +32 -32
- package/Controls/Components/Buttons/RepeatButton/Themes/RepeatButtonElement.Cosmopolitan.js +8 -8
- package/Controls/Components/Buttons/RepeatButton/Themes/RepeatButtonElement.Joy.js +10 -10
- package/Controls/Components/Buttons/RepeatButton/Themes/RepeatButtonElement.Memphis.js +9 -9
- package/Controls/Components/Buttons/SplitButton/Themes/SplitButtonElement.Cosmopolitan.js +8 -8
- package/Controls/Components/Buttons/SplitButton/Themes/SplitButtonElement.Joy.js +12 -12
- package/Controls/Components/Buttons/SplitButton/Themes/SplitButtonElement.Memphis.js +9 -9
- package/Controls/Components/Buttons/ToggleButton/Themes/ToggleButtonElement.Cosmopolitan.js +9 -9
- package/Controls/Components/Buttons/ToggleButton/Themes/ToggleButtonElement.Joy.js +10 -10
- package/Controls/Components/Buttons/ToggleButton/Themes/ToggleButtonElement.Memphis.js +9 -9
- package/Controls/Components/Grouping/BannerGroup/Themes/BannerGroupElement.Cosmopolitan.js +1 -1
- package/Controls/Components/Grouping/BannerGroup/Themes/BannerGroupElement.Joy.js +1 -1
- package/Controls/Components/Grouping/BannerGroup/Themes/BannerGroupElement.Memphis.js +1 -1
- package/Controls/Components/Grouping/Expander/ExpanderGroupElement.d.ts +0 -3
- package/Controls/Components/Grouping/Expander/ExpanderGroupElement.d.ts.map +1 -1
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Cosmopolitan.d.ts.map +1 -1
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Cosmopolitan.js +0 -4
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Cosmopolitan.js.map +1 -1
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Joy.d.ts.map +1 -1
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Joy.js +0 -4
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Joy.js.map +1 -1
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Memphis.d.ts.map +1 -1
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Memphis.js +0 -4
- package/Controls/Components/Grouping/Expander/Themes/ExpanderElement.Memphis.js.map +1 -1
- package/Controls/Components/Inputs/Calendar/Themes/CalendarSubHeaderElement.Cosmopolitan.js +1 -1
- package/Controls/Components/Inputs/Calendar/Themes/CalendarSubHeaderElement.Joy.js +1 -1
- package/Controls/Components/Inputs/Calendar/Themes/CalendarSubHeaderElement.Memphis.js +1 -1
- package/Controls/Components/Inputs/CheckBox/Themes/CheckBoxElement.Joy.js +1 -1
- package/Controls/Components/Inputs/Choice/Themes/ChoiceElement.Joy.js +1 -1
- package/Controls/Components/Inputs/Radio/Themes/RadioElement.Joy.js +1 -1
- package/Controls/Components/Inputs/Radio/Themes/RadioElement.Memphis.js +1 -1
- package/Controls/Components/Inputs/ToggleSwitch/Themes/ToggleSwitchElement.Joy.js +1 -1
- package/Controls/Components/Layouts/TileManager/Themes/TileManagerTileElement.Cosmopolitan.js +2 -2
- package/Controls/Components/Layouts/TileManager/Themes/TileManagerTileElement.Joy.js +2 -2
- package/Controls/Components/Layouts/TileManager/Themes/TileManagerTileElement.Memphis.js +2 -2
- package/Controls/Components/Media/Avatar/Themes/AvatarElement.Joy.js +3 -3
- package/Controls/Components/Media/Avatar/Themes/AvatarElement.Memphis.js +1 -1
- package/Controls/Components/Media/Badge/Themes/BadgeElement.Joy.js +4 -4
- package/Controls/Components/Media/Chat/Themes/ChatMessageAvatarElement.Joy.js +1 -1
- package/Controls/Components/Media/Chat/Themes/ChatMessageAvatarElement.Memphis.js +1 -1
- package/Controls/Components/Media/Chip/Themes/ChipElement.Joy.js +4 -4
- package/Controls/Components/Media/ColorSwatch/Themes/ColorSwatchElement.Cosmopolitan.js +4 -4
- package/Controls/Components/Media/ColorSwatch/Themes/ColorSwatchElement.Joy.js +4 -4
- package/Controls/Components/Media/ColorSwatch/Themes/ColorSwatchElement.Memphis.js +4 -4
- package/Controls/Components/Media/Persona/Themes/PersonaElement.Joy.js +1 -1
- package/Controls/Components/Overlays/Toast/Themes/ToastElement.Memphis.js +1 -1
- package/Controls/Components/Primitives/Floating/Themes/FloatingElement.Joy.js +1 -1
- package/Controls/Components/Primitives/Floating/Themes/FloatingElement.Memphis.js +1 -1
- package/Controls/Components/Primitives/Popup/Themes/PopupElement.Memphis.js +1 -1
- package/Controls/Components/Primitives/TickBar/Themes/TickBarElement.Cosmopolitan.js +5 -5
- package/Controls/Components/Primitives/TickBar/Themes/TickBarElement.Joy.js +5 -5
- package/Controls/Components/Primitives/TickBar/Themes/TickBarElement.Memphis.js +5 -5
- package/Controls/Components/Ranges/MeterRing/Themes/MeterRingElement.Cosmopolitan.js +2 -2
- package/Controls/Components/Ranges/MeterRing/Themes/MeterRingElement.Joy.js +2 -2
- package/Controls/Components/Ranges/MeterRing/Themes/MeterRingElement.Memphis.js +2 -2
- package/Controls/Components/Ranges/ProgressBar/Themes/ProgressBarElement.Joy.d.ts.map +1 -1
- package/Controls/Components/Ranges/ProgressBar/Themes/ProgressBarElement.Joy.js +7 -4
- package/Controls/Components/Ranges/ProgressBar/Themes/ProgressBarElement.Joy.js.map +1 -1
- package/Controls/Components/Ranges/ProgressRing/Themes/ProgressRingElement.Cosmopolitan.js +3 -3
- package/Controls/Components/Ranges/ProgressRing/Themes/ProgressRingElement.Joy.js +3 -3
- package/Controls/Components/Ranges/ProgressRing/Themes/ProgressRingElement.Memphis.js +3 -3
- package/Controls/Components/Ranges/ScrubSlider/Themes/ScrubSliderElement.Cosmopolitan.js +2 -2
- package/Controls/Components/Ranges/ScrubSlider/Themes/ScrubSliderElement.Joy.js +2 -2
- package/Controls/Components/Ranges/ScrubSlider/Themes/ScrubSliderElement.Memphis.js +2 -2
- package/Controls/Components/Selectors/ElectronicProgramGuide/Themes/EpgProgramElement.Joy.js +1 -1
- package/Controls/Components/Selectors/ElectronicProgramGuide/Themes/EpgProgramElement.Memphis.js +1 -1
- package/Controls/Components/Selectors/Menu/Themes/MenuItemElement.Cosmopolitan.js +1 -1
- package/Controls/Components/Selectors/Menu/Themes/MenuItemElement.Joy.js +1 -1
- package/Controls/Components/Selectors/Menu/Themes/MenuItemElement.Memphis.js +1 -1
- package/Controls/Components/Selectors/Segment/Themes/SegmentElement.Joy.js +1 -1
- package/Controls/Components/Selectors/Segment/Themes/SegmentElement.Memphis.js +1 -1
- package/Controls/Components/Selectors/Tab/Themes/TabElement.Cosmopolitan.js +1 -1
- package/Controls/Components/Selectors/Tab/Themes/TabElement.Joy.js +1 -1
- package/Controls/Components/Selectors/Tab/Themes/TabElement.Memphis.js +1 -1
- package/Controls/Components/Selectors/TabStrip/Themes/TabStripItemElement.Joy.js +1 -1
- package/Index.d.ts +1 -1
- package/Index.d.ts.map +1 -1
- package/Reactivity/Rx/Directives/AsyncDirective.d.ts +1 -1
- package/Routing/PathToRegexp.d.ts +1 -1
- package/Theming/IThemeElementProps.d.ts +16 -1
- package/Theming/IThemeElementProps.d.ts.map +1 -1
- package/Theming/IThemeService.d.ts +57 -154
- package/Theming/IThemeService.d.ts.map +1 -1
- package/Theming/IThemeService.js +3 -1
- package/Theming/IThemeService.js.map +1 -1
- package/Theming/Theme2Element.d.ts +76 -9
- package/Theming/Theme2Element.d.ts.map +1 -1
- package/Theming/Theme2Element.js +105 -54
- package/Theming/Theme2Element.js.map +1 -1
- package/Theming/Theme2ElementTemplate.d.ts +1 -1
- package/Theming/Theme2ElementTemplate.d.ts.map +1 -1
- package/Theming/Theme2ElementTemplate.js +1 -1
- package/Theming/Theme2ElementTemplate.js.map +1 -1
- package/Theming/ThemeService.d.ts +118 -67
- package/Theming/ThemeService.d.ts.map +1 -1
- package/Theming/ThemeService.js +453 -195
- package/Theming/ThemeService.js.map +1 -1
- package/package.json +3 -3
package/Theming/Theme2Element.js
CHANGED
|
@@ -27,8 +27,9 @@ import { ThemeService } from './ThemeService';
|
|
|
27
27
|
*/
|
|
28
28
|
let Theme2Element = class Theme2Element extends CustomElement {
|
|
29
29
|
// #region Fields
|
|
30
|
+
_name;
|
|
30
31
|
_theme;
|
|
31
|
-
|
|
32
|
+
_global;
|
|
32
33
|
// #endregion
|
|
33
34
|
// #region Ctor
|
|
34
35
|
/**
|
|
@@ -36,10 +37,10 @@ let Theme2Element = class Theme2Element extends CustomElement {
|
|
|
36
37
|
*/
|
|
37
38
|
constructor() {
|
|
38
39
|
super();
|
|
39
|
-
|
|
40
|
-
ThemeService.instance.registerProvider(this);
|
|
40
|
+
this._name = null;
|
|
41
41
|
this._theme = null;
|
|
42
|
-
this.
|
|
42
|
+
this._global = false;
|
|
43
|
+
ThemeService.instance.registerProvider(this);
|
|
43
44
|
}
|
|
44
45
|
// #endregion
|
|
45
46
|
// #region Properties
|
|
@@ -54,13 +55,43 @@ let Theme2Element = class Theme2Element extends CustomElement {
|
|
|
54
55
|
static get is() {
|
|
55
56
|
return 'mosaik-theme2';
|
|
56
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Gets or sets the `name` property.
|
|
60
|
+
* When set, this element will only respond to theme changes for this specific name.
|
|
61
|
+
* When null (default), responds to global/default theme changes.
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
get name() {
|
|
66
|
+
return this._name;
|
|
67
|
+
}
|
|
68
|
+
set name(value) {
|
|
69
|
+
if (this._name !== value) {
|
|
70
|
+
// Unregister with old ID
|
|
71
|
+
ThemeService.instance.unregisterProvider(this);
|
|
72
|
+
this._name = value;
|
|
73
|
+
this.requestUpdate('name');
|
|
74
|
+
// Re-register with new ID
|
|
75
|
+
ThemeService.instance.registerProvider(this);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
57
78
|
/**
|
|
58
79
|
* Gets or sets the `theme` property.
|
|
80
|
+
* If no local theme is set, returns the theme from ThemeService for this element's name.
|
|
59
81
|
*
|
|
60
82
|
* @public
|
|
61
83
|
*/
|
|
62
84
|
get theme() {
|
|
63
|
-
|
|
85
|
+
if (this._theme) {
|
|
86
|
+
return this._theme;
|
|
87
|
+
}
|
|
88
|
+
// Try to get theme from ThemeService
|
|
89
|
+
try {
|
|
90
|
+
return ThemeService.instance.getTheme(this._name);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
64
95
|
}
|
|
65
96
|
set theme(value) {
|
|
66
97
|
if (!Equals.areObjectsEqual(this._theme, value)) {
|
|
@@ -69,17 +100,19 @@ let Theme2Element = class Theme2Element extends CustomElement {
|
|
|
69
100
|
}
|
|
70
101
|
}
|
|
71
102
|
/**
|
|
72
|
-
* Gets or sets the `
|
|
103
|
+
* Gets or sets the `global` property.
|
|
104
|
+
* When true, CSS variables are applied both locally and globally.
|
|
105
|
+
* When false (default), CSS variables are only applied locally to this element.
|
|
73
106
|
*
|
|
74
107
|
* @public
|
|
75
108
|
*/
|
|
76
|
-
get
|
|
77
|
-
return this.
|
|
109
|
+
get global() {
|
|
110
|
+
return this._global;
|
|
78
111
|
}
|
|
79
|
-
set
|
|
80
|
-
if (this.
|
|
81
|
-
this.
|
|
82
|
-
this.requestUpdate('
|
|
112
|
+
set global(value) {
|
|
113
|
+
if (this._global !== value) {
|
|
114
|
+
this._global = value;
|
|
115
|
+
this.requestUpdate('global');
|
|
83
116
|
}
|
|
84
117
|
}
|
|
85
118
|
// #endregion
|
|
@@ -91,108 +124,126 @@ let Theme2Element = class Theme2Element extends CustomElement {
|
|
|
91
124
|
connectedCallback() {
|
|
92
125
|
super.connectedCallback();
|
|
93
126
|
ThemeService.instance.initialize();
|
|
94
|
-
|
|
127
|
+
// If we have a theme, apply it through the service
|
|
128
|
+
if (this._theme) {
|
|
129
|
+
ThemeService.instance.applyTheme(this._theme, this._name, { notifyProviders: false });
|
|
130
|
+
}
|
|
95
131
|
}
|
|
96
132
|
/**
|
|
97
133
|
* @public
|
|
98
134
|
* @override
|
|
99
135
|
*/
|
|
100
136
|
disconnectedCallback() {
|
|
101
|
-
// Unregister from ThemeService
|
|
102
137
|
ThemeService.instance.unregisterProvider(this);
|
|
103
|
-
// Note: We do NOT call ThemeService.reset() here since other elements may still use it
|
|
104
138
|
}
|
|
105
139
|
/**
|
|
106
140
|
* Applies the complete theme.
|
|
141
|
+
* Called by ThemeService to update this provider's internal state.
|
|
142
|
+
* CSS variables are handled by ThemeService directly.
|
|
107
143
|
*
|
|
108
|
-
* @
|
|
109
|
-
* @param theme
|
|
144
|
+
* @public
|
|
145
|
+
* @param theme The theme to apply.
|
|
110
146
|
*/
|
|
111
147
|
applyTheme(theme) {
|
|
112
148
|
if (!theme) {
|
|
113
149
|
return;
|
|
114
150
|
}
|
|
115
|
-
|
|
151
|
+
this._theme = theme;
|
|
116
152
|
}
|
|
117
153
|
/**
|
|
118
154
|
* Applies the scheme (light/dark mode color roles) from the theme.
|
|
155
|
+
* Called by ThemeService to update this provider's internal state.
|
|
119
156
|
*
|
|
120
|
-
* @
|
|
121
|
-
* @param scheme
|
|
157
|
+
* @public
|
|
158
|
+
* @param scheme The scheme to apply.
|
|
122
159
|
*/
|
|
123
160
|
applyScheme(scheme) {
|
|
124
|
-
|
|
125
|
-
|
|
161
|
+
if (this._theme) {
|
|
162
|
+
this._theme.scheme = scheme;
|
|
163
|
+
}
|
|
126
164
|
}
|
|
127
165
|
/**
|
|
128
166
|
* Applies the color palette from the theme.
|
|
167
|
+
* Called by ThemeService to update this provider's internal state.
|
|
129
168
|
*
|
|
130
|
-
* @
|
|
131
|
-
* @param palette
|
|
169
|
+
* @public
|
|
170
|
+
* @param palette The palette to apply.
|
|
132
171
|
*/
|
|
133
172
|
applyPalette(palette) {
|
|
134
|
-
|
|
135
|
-
|
|
173
|
+
if (this._theme) {
|
|
174
|
+
this._theme.palette = palette;
|
|
175
|
+
}
|
|
136
176
|
}
|
|
137
177
|
/**
|
|
138
178
|
* Applies the font family from the theme.
|
|
179
|
+
* Called by ThemeService to update this provider's internal state.
|
|
139
180
|
*
|
|
140
|
-
* @
|
|
141
|
-
* @param fontFamily
|
|
181
|
+
* @public
|
|
182
|
+
* @param fontFamily The font family to apply.
|
|
142
183
|
*/
|
|
143
184
|
applyFontFamily(fontFamily) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
185
|
+
if (this._theme) {
|
|
186
|
+
this._theme.fontFamily = fontFamily;
|
|
187
|
+
}
|
|
147
188
|
}
|
|
148
189
|
/**
|
|
149
190
|
* Applies the typography settings from the theme.
|
|
191
|
+
* Called by ThemeService to update this provider's internal state.
|
|
150
192
|
*
|
|
151
|
-
* @
|
|
152
|
-
* @param typography
|
|
193
|
+
* @public
|
|
194
|
+
* @param typography The typography settings to apply.
|
|
153
195
|
*/
|
|
154
196
|
applyTypography(typography) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
197
|
+
if (this._theme) {
|
|
198
|
+
this._theme.typography = typography;
|
|
199
|
+
}
|
|
158
200
|
}
|
|
159
201
|
/**
|
|
160
202
|
* Applies the layout settings from the theme.
|
|
203
|
+
* Called by ThemeService to update this provider's internal state.
|
|
161
204
|
*
|
|
162
|
-
* @
|
|
163
|
-
* @param layout
|
|
205
|
+
* @public
|
|
206
|
+
* @param layout The layout settings to apply.
|
|
164
207
|
*/
|
|
165
208
|
applyLayout(layout) {
|
|
166
|
-
|
|
167
|
-
|
|
209
|
+
if (this._theme) {
|
|
210
|
+
this._theme.layout = layout;
|
|
211
|
+
}
|
|
168
212
|
}
|
|
169
213
|
/**
|
|
170
214
|
* Applies the elevation (shadow) settings from the theme.
|
|
215
|
+
* Called by ThemeService to update this provider's internal state.
|
|
171
216
|
*
|
|
172
|
-
* @
|
|
173
|
-
* @param elevation
|
|
217
|
+
* @public
|
|
218
|
+
* @param elevation The elevation settings to apply.
|
|
174
219
|
*/
|
|
175
220
|
applyElevation(elevation) {
|
|
176
|
-
|
|
177
|
-
|
|
221
|
+
if (this._theme) {
|
|
222
|
+
this._theme.elevation = elevation;
|
|
223
|
+
}
|
|
178
224
|
}
|
|
179
225
|
/**
|
|
226
|
+
* Called when the theme property changes.
|
|
227
|
+
* Delegates to ThemeService for CSS variable management.
|
|
228
|
+
*
|
|
180
229
|
* @protected
|
|
181
230
|
*/
|
|
182
231
|
onThemePropertyChanged(prev, next) {
|
|
183
232
|
if (prev !== next && next) {
|
|
184
|
-
|
|
233
|
+
// Delegate to ThemeService - it handles CSS variables for both global and local
|
|
234
|
+
// Use notifyProviders: false to prevent infinite loop (we are the provider)
|
|
235
|
+
ThemeService.instance.applyTheme(next, this._name, { notifyProviders: false });
|
|
185
236
|
}
|
|
186
237
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Gets the current theme name or empty string.
|
|
189
|
-
*
|
|
190
|
-
* @private
|
|
191
|
-
*/
|
|
192
|
-
getThemeName() {
|
|
193
|
-
return this._theme?.name ?? '';
|
|
194
|
-
}
|
|
195
238
|
};
|
|
239
|
+
__decorate([
|
|
240
|
+
Property({
|
|
241
|
+
type: String,
|
|
242
|
+
attribute: 'name'
|
|
243
|
+
}),
|
|
244
|
+
__metadata("design:type", Object),
|
|
245
|
+
__metadata("design:paramtypes", [Object])
|
|
246
|
+
], Theme2Element.prototype, "name", null);
|
|
196
247
|
__decorate([
|
|
197
248
|
Property({ type: Object }),
|
|
198
249
|
__metadata("design:type", Object),
|
|
@@ -202,7 +253,7 @@ __decorate([
|
|
|
202
253
|
Property({ type: Boolean }),
|
|
203
254
|
__metadata("design:type", Boolean),
|
|
204
255
|
__metadata("design:paramtypes", [Boolean])
|
|
205
|
-
], Theme2Element.prototype, "
|
|
256
|
+
], Theme2Element.prototype, "global", null);
|
|
206
257
|
__decorate([
|
|
207
258
|
Watch('theme'),
|
|
208
259
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme2Element.js","sourceRoot":"","sources":["../../src/Theming/Theme2Element.ts"],"names":[],"mappings":"AAAA,kBAAkB;;;;;;;;;;AAGlB,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,aAAa;AAEb;;;;;;;GAOG;AAOI,IAAM,aAAa,GAAnB,MAAM,aACT,SAAQ,aAAa;IAGrB,iBAAi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C,MAAM,GAAG,MAAM,CAAC;QAChC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,cAAc,CAAC,SAA8B;QAChD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QACtC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IAEO,sBAAsB,CAAC,IAAa,EAAE,IAAa;QACzD,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,EAAE,CAAC;YACxB,gFAAgF;YAChF,4EAA4E;YAC5E,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,CAAC;QACnF,CAAC;IACL,CAAC;CAIJ,CAAA;AA1MG;IAAC,QAAQ,CAAC;QACN,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;KACpB,CAAC;;;yCAGD;AAoBD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;;0CAY1B;AAeD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;;2CAG3B;AAwIS;IADT,KAAK,CAAC,OAAO,CAAC;;;;2DAOd;AAxPQ,aAAa;IANzB,SAAS,CAAC;QACP,QAAQ,EAAE,eAAe;QACzB,QAAQ,EAAE,qBAAqB;QAC/B,MAAM,EAAE,kBAAkB;QAC1B,OAAO,EAAE,EAAE;KACd,CAAC;;GACW,aAAa,CA4PzB"}
|
|
@@ -5,5 +5,5 @@ import type { Theme2Element } from './Theme2Element';
|
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export declare function theme2ElementTemplate<T extends Theme2Element>(
|
|
8
|
+
export declare function theme2ElementTemplate<T extends Theme2Element>(_e: T): TemplateResult;
|
|
9
9
|
//# sourceMappingURL=Theme2ElementTemplate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme2ElementTemplate.d.ts","sourceRoot":"","sources":["../../src/Theming/Theme2ElementTemplate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"Theme2ElementTemplate.d.ts","sourceRoot":"","sources":["../../src/Theming/Theme2ElementTemplate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,aAAa,EAAE,EAAE,EAAE,CAAC,GAAG,cAAc,CAIpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme2ElementTemplate.js","sourceRoot":"","sources":["../../src/Theming/Theme2ElementTemplate.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,EAAE,IAAI,EAAuB,MAAM,aAAa,CAAC;AAGxD,aAAa;AAEb;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAA0B,
|
|
1
|
+
{"version":3,"file":"Theme2ElementTemplate.js","sourceRoot":"","sources":["../../src/Theming/Theme2ElementTemplate.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,EAAE,IAAI,EAAuB,MAAM,aAAa,CAAC;AAGxD,aAAa;AAEb;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAA0B,EAAK;IAChE,OAAO,IAAI,CAAA;;KAEV,CAAC;AACN,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ITheme, type ThemeMode, type ThemeScheme, type ThemeSemantic } from '@breadstone/mosaik-themes';
|
|
2
2
|
import { type IEventEmitter } from '@breadstone/mosaik-elements';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IThemeApplyOptions, IThemeEventDetail, IThemeProvider, IThemeServiceConfig } from './IThemeService';
|
|
4
4
|
/**
|
|
5
5
|
* Service for managing theme CSS variables throughout the application.
|
|
6
6
|
* Provides methods to apply theme properties globally to the document.
|
|
@@ -18,9 +18,11 @@ import type { ISetCssVariableOptions, IThemeEventDetail, IThemeProvider, IThemeS
|
|
|
18
18
|
* // Use the singleton instance
|
|
19
19
|
* ThemeService.instance.applyTheme(myTheme);
|
|
20
20
|
*
|
|
21
|
-
* // Or apply individual parts
|
|
22
|
-
* ThemeService.instance.applyScheme(theme.scheme
|
|
23
|
-
* ThemeService.instance.applyPalette(theme.palette
|
|
21
|
+
* // Or apply individual parts (theme name is derived from stored state)
|
|
22
|
+
* ThemeService.instance.applyScheme(theme.scheme); // global scope
|
|
23
|
+
* ThemeService.instance.applyPalette(theme.palette); // global scope
|
|
24
|
+
* ThemeService.instance.applyLayout(theme.layout); // global scope
|
|
25
|
+
* ThemeService.instance.applyFontFamily('Arial'); // global scope
|
|
24
26
|
*
|
|
25
27
|
* // Subscribe to theme changes
|
|
26
28
|
* ThemeService.instance.themeChanged.subscribe((detail) => {
|
|
@@ -30,16 +32,16 @@ import type { ISetCssVariableOptions, IThemeEventDetail, IThemeProvider, IThemeS
|
|
|
30
32
|
*
|
|
31
33
|
* @public
|
|
32
34
|
*/
|
|
33
|
-
export declare class ThemeService
|
|
35
|
+
export declare class ThemeService {
|
|
34
36
|
private static _instance;
|
|
35
37
|
private static _config;
|
|
36
38
|
private readonly _globalStyleSheet;
|
|
37
39
|
private readonly _providers;
|
|
40
|
+
private readonly _themeStates;
|
|
38
41
|
private readonly _themeChanged;
|
|
39
42
|
private readonly _schemeChanged;
|
|
40
43
|
private readonly _paletteChanged;
|
|
41
44
|
private _initialized;
|
|
42
|
-
private _currentTheme;
|
|
43
45
|
/**
|
|
44
46
|
* Constructs a new instance of the `ThemeService` class.
|
|
45
47
|
* Use {@link ThemeService.instance} to access the singleton instance.
|
|
@@ -63,13 +65,6 @@ export declare class ThemeService implements IThemeService {
|
|
|
63
65
|
* @readonly
|
|
64
66
|
*/
|
|
65
67
|
get isInitialized(): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Gets the currently applied theme, if any.
|
|
68
|
-
*
|
|
69
|
-
* @public
|
|
70
|
-
* @readonly
|
|
71
|
-
*/
|
|
72
|
-
get currentTheme(): ITheme | null;
|
|
73
68
|
/**
|
|
74
69
|
* Event emitter that fires when the theme changes.
|
|
75
70
|
*
|
|
@@ -97,7 +92,7 @@ export declare class ThemeService implements IThemeService {
|
|
|
97
92
|
*
|
|
98
93
|
* @public
|
|
99
94
|
* @static
|
|
100
|
-
* @param config
|
|
95
|
+
* @param config Configuration options for the theme service.
|
|
101
96
|
* @returns The ThemeService class for chaining.
|
|
102
97
|
* @throws Error if called after the instance has already been created.
|
|
103
98
|
*
|
|
@@ -133,26 +128,45 @@ export declare class ThemeService implements IThemeService {
|
|
|
133
128
|
dispose(): void;
|
|
134
129
|
/**
|
|
135
130
|
* Registers a theme provider with the service.
|
|
131
|
+
* If a theme state already exists for the provider's name, the provider
|
|
132
|
+
* will be synchronized with that state. Otherwise, if the provider has a theme,
|
|
133
|
+
* it will be used to initialize the state for that name.
|
|
136
134
|
*
|
|
137
135
|
* @public
|
|
138
|
-
* @param provider
|
|
136
|
+
* @param provider The theme provider to register.
|
|
139
137
|
*/
|
|
140
138
|
registerProvider(provider: IThemeProvider): void;
|
|
141
139
|
/**
|
|
142
140
|
* Unregisters a theme provider from the service.
|
|
143
141
|
*
|
|
144
142
|
* @public
|
|
145
|
-
* @param provider
|
|
143
|
+
* @param provider The theme provider to unregister.
|
|
146
144
|
*/
|
|
147
145
|
unregisterProvider(provider: IThemeProvider): void;
|
|
148
146
|
/**
|
|
149
|
-
*
|
|
147
|
+
* Checks whether a theme exists for the specified name.
|
|
148
|
+
* For the global scope (no name), this also returns true if a default theme is configured.
|
|
149
|
+
*
|
|
150
|
+
* @public
|
|
151
|
+
* @param name Optional name for scoped themes. Use `null` or omit for global scope.
|
|
152
|
+
* @returns `true` if a theme is set for the specified scope, `false` otherwise.
|
|
153
|
+
*/
|
|
154
|
+
hasTheme(name?: string | null): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Gets the current theme for the specified name.
|
|
157
|
+
* If no name is provided (undefined), returns the theme for the global/default scope (null key).
|
|
158
|
+
*
|
|
159
|
+
* The method uses the following fallback chain:
|
|
160
|
+
* 1. Theme state from `_themeStates` map
|
|
161
|
+
* 2. Theme from the first matching provider
|
|
162
|
+
* 3. Default theme from configuration (global scope only)
|
|
150
163
|
*
|
|
151
164
|
* @public
|
|
165
|
+
* @param name Optional name for scoped themes. Use `null` or omit for global scope.
|
|
152
166
|
* @returns The current theme.
|
|
153
|
-
* @throws Error if no theme is set.
|
|
167
|
+
* @throws Error if no theme is set for the specified scope and no default theme is configured.
|
|
154
168
|
*/
|
|
155
|
-
getTheme(): ITheme;
|
|
169
|
+
getTheme(name?: string | null): ITheme;
|
|
156
170
|
/**
|
|
157
171
|
* Gets the current theme name from the document element.
|
|
158
172
|
*
|
|
@@ -169,116 +183,127 @@ export declare class ThemeService implements IThemeService {
|
|
|
169
183
|
getDocumentThemeMode(): ThemeMode | null;
|
|
170
184
|
/**
|
|
171
185
|
* Applies the complete theme.
|
|
186
|
+
* If name is provided, only providers with that name are notified.
|
|
187
|
+
* If name is not provided (undefined), only providers without a name (null) are notified.
|
|
172
188
|
*
|
|
173
189
|
* @public
|
|
174
|
-
* @param theme
|
|
190
|
+
* @param theme The theme to apply.
|
|
191
|
+
* @param name Optional name for scoped application.
|
|
192
|
+
* @param options Optional settings to control notification behavior.
|
|
175
193
|
*/
|
|
176
|
-
applyTheme(theme: ITheme): void;
|
|
194
|
+
applyTheme(theme: ITheme, name?: string | null, options?: IThemeApplyOptions): void;
|
|
177
195
|
/**
|
|
178
196
|
* Applies the scheme (light/dark mode color roles) from the theme.
|
|
197
|
+
* Uses the theme name from the stored state for the specified scope.
|
|
179
198
|
*
|
|
180
199
|
* @public
|
|
181
|
-
* @param scheme
|
|
182
|
-
* @param
|
|
200
|
+
* @param scheme The scheme to apply.
|
|
201
|
+
* @param name Optional name for scoped application.
|
|
183
202
|
*/
|
|
184
|
-
applyScheme(scheme: ITheme['scheme'],
|
|
203
|
+
applyScheme(scheme: ITheme['scheme'], name?: string | null): void;
|
|
185
204
|
/**
|
|
186
205
|
* Applies the color palette from the theme.
|
|
206
|
+
* Uses the theme name from the stored state for the specified scope.
|
|
187
207
|
*
|
|
188
208
|
* @public
|
|
189
|
-
* @param palette
|
|
190
|
-
* @param
|
|
209
|
+
* @param palette The palette to apply.
|
|
210
|
+
* @param name Optional name for scoped application.
|
|
191
211
|
*/
|
|
192
|
-
applyPalette(palette: ITheme['palette'],
|
|
212
|
+
applyPalette(palette: ITheme['palette'], name?: string | null): void;
|
|
193
213
|
/**
|
|
194
214
|
* Applies the font family from the theme.
|
|
215
|
+
* Uses the theme name and typography keys from the stored state for the specified scope.
|
|
195
216
|
*
|
|
196
217
|
* @public
|
|
197
|
-
* @param fontFamily
|
|
198
|
-
* @param
|
|
199
|
-
* @param typographyKeys - The typography keys to apply the font family to. If not provided, uses the current theme typography keys.
|
|
218
|
+
* @param fontFamily The font family to apply.
|
|
219
|
+
* @param name Optional name for scoped application.
|
|
200
220
|
*/
|
|
201
|
-
applyFontFamily(fontFamily: ITheme['fontFamily'],
|
|
221
|
+
applyFontFamily(fontFamily: ITheme['fontFamily'], name?: string | null): void;
|
|
202
222
|
/**
|
|
203
223
|
* Applies the typography settings from the theme.
|
|
224
|
+
* Uses the theme name and font family from the stored state for the specified scope.
|
|
204
225
|
*
|
|
205
226
|
* @public
|
|
206
|
-
* @param typography
|
|
207
|
-
* @param
|
|
208
|
-
* @param fontFamily - The font family to use in shorthand typography values. If not provided, uses the current theme font family.
|
|
227
|
+
* @param typography The typography settings to apply.
|
|
228
|
+
* @param name Optional name for scoped application.
|
|
209
229
|
*/
|
|
210
|
-
applyTypography(typography: ITheme['typography'],
|
|
230
|
+
applyTypography(typography: ITheme['typography'], name?: string | null): void;
|
|
211
231
|
/**
|
|
212
232
|
* Applies the layout settings from the theme.
|
|
233
|
+
* Uses the theme name from the stored state for the specified scope.
|
|
213
234
|
*
|
|
214
235
|
* @public
|
|
215
|
-
* @param layout
|
|
216
|
-
* @param
|
|
236
|
+
* @param layout The layout settings to apply.
|
|
237
|
+
* @param name Optional name for scoped application.
|
|
217
238
|
*/
|
|
218
|
-
applyLayout(layout: ITheme['layout'],
|
|
239
|
+
applyLayout(layout: ITheme['layout'], name?: string | null): void;
|
|
219
240
|
/**
|
|
220
241
|
* Applies the elevation (shadow) settings from the theme.
|
|
242
|
+
* Uses the theme name from the stored state for the specified scope.
|
|
221
243
|
*
|
|
222
244
|
* @public
|
|
223
|
-
* @param elevation
|
|
224
|
-
* @param
|
|
225
|
-
*/
|
|
226
|
-
applyElevation(elevation: ITheme['elevation'], themeName: string): void;
|
|
227
|
-
/**
|
|
228
|
-
* Sets a CSS variable.
|
|
229
|
-
*
|
|
230
|
-
* @public
|
|
231
|
-
* @param property - The CSS variable name (e.g., `--my-var`).
|
|
232
|
-
* @param value - The value to set.
|
|
233
|
-
* @param options - Optional settings for where to apply the variable.
|
|
245
|
+
* @param elevation The elevation settings to apply.
|
|
246
|
+
* @param name Optional name for scoped application.
|
|
234
247
|
*/
|
|
235
|
-
|
|
248
|
+
applyElevation(elevation: ITheme['elevation'], name?: string | null): void;
|
|
236
249
|
/**
|
|
237
250
|
* Gets the current theme mode from the document.
|
|
238
251
|
*
|
|
239
252
|
* @public
|
|
240
253
|
* @returns The current theme mode ('light' or 'dark').
|
|
241
254
|
*/
|
|
242
|
-
getCurrentThemeMode():
|
|
255
|
+
getCurrentThemeMode(): ThemeMode;
|
|
243
256
|
/**
|
|
244
257
|
* Replaces the scheme with the specified key.
|
|
245
258
|
* This is useful when you want to replace a specific scheme in the theme.
|
|
259
|
+
* If the name is provided, only providers with that name are notified.
|
|
260
|
+
* If name is not provided (undefined), only providers without a name (null) are notified.
|
|
246
261
|
*
|
|
247
262
|
* @public
|
|
248
|
-
* @param mode
|
|
249
|
-
* @param scheme
|
|
263
|
+
* @param mode The theme mode to replace.
|
|
264
|
+
* @param scheme The scheme color roles to replace.
|
|
265
|
+
* @param name Optional name for scoped replacement.
|
|
266
|
+
* @param options Optional settings to control notification behavior.
|
|
250
267
|
*/
|
|
251
|
-
replaceScheme(mode: ThemeMode, scheme: Partial<ThemeScheme
|
|
268
|
+
replaceScheme(mode: ThemeMode, scheme: Partial<ThemeScheme>, name?: string | null, options?: IThemeApplyOptions): void;
|
|
252
269
|
/**
|
|
253
270
|
* Replaces the palette with the specified key.
|
|
254
271
|
* This is useful when you want to replace a specific palette in the theme.
|
|
272
|
+
* If themeId is provided, only providers with that ID are notified.
|
|
273
|
+
* If themeId is not provided (undefined), only providers without an ID (null) are notified.
|
|
255
274
|
*
|
|
256
275
|
* @public
|
|
257
|
-
* @param mode
|
|
258
|
-
* @param semantic
|
|
276
|
+
* @param mode The theme mode to replace.
|
|
277
|
+
* @param semantic The semantic color roles to replace.
|
|
278
|
+
* @param name Optional name for scoped replacement.
|
|
279
|
+
* @param options Optional settings to control notification behavior.
|
|
259
280
|
*/
|
|
260
|
-
replacePalette(mode: ThemeMode, semantic: Partial<ThemeSemantic
|
|
281
|
+
replacePalette(mode: ThemeMode, semantic: Partial<ThemeSemantic>, name?: string | null, options?: IThemeApplyOptions): void;
|
|
261
282
|
/**
|
|
262
|
-
*
|
|
283
|
+
* Sets a CSS variable.
|
|
263
284
|
*
|
|
264
285
|
* @private
|
|
265
|
-
* @param
|
|
266
|
-
* @param
|
|
286
|
+
* @param property The CSS variable name (e.g., `--my-var`).
|
|
287
|
+
* @param value The value to set.
|
|
288
|
+
* @param options Optional settings for where to apply the variable.
|
|
267
289
|
*/
|
|
268
|
-
private
|
|
290
|
+
private setCssVariable;
|
|
269
291
|
/**
|
|
270
|
-
*
|
|
292
|
+
* Sets a CSS variable globally and on all provider elements.
|
|
293
|
+
* For providers with global=false, only sets locally on the element.
|
|
271
294
|
*
|
|
272
295
|
* @private
|
|
273
|
-
* @param
|
|
274
|
-
* @param
|
|
296
|
+
* @param property The CSS variable name.
|
|
297
|
+
* @param value The value to set.
|
|
298
|
+
* @param providers The providers to set the variable on.
|
|
299
|
+
* @param applyGlobally Whether to apply the variable globally.
|
|
275
300
|
*/
|
|
276
|
-
private
|
|
301
|
+
private setCssVariableWithProviders;
|
|
277
302
|
/**
|
|
278
303
|
* Converts a camelCase string to kebab-case.
|
|
279
304
|
*
|
|
280
305
|
* @private
|
|
281
|
-
* @param value
|
|
306
|
+
* @param value The value to convert.
|
|
282
307
|
* @returns The kebab-case string.
|
|
283
308
|
*/
|
|
284
309
|
private toKebabCase;
|
|
@@ -286,7 +311,7 @@ export declare class ThemeService implements IThemeService {
|
|
|
286
311
|
* Normalizes a CssLength value to a px string.
|
|
287
312
|
*
|
|
288
313
|
* @private
|
|
289
|
-
* @param value
|
|
314
|
+
* @param value The value to normalize.
|
|
290
315
|
* @returns The normalized px string.
|
|
291
316
|
*/
|
|
292
317
|
private normalizeCssLength;
|
|
@@ -296,5 +321,31 @@ export declare class ThemeService implements IThemeService {
|
|
|
296
321
|
* @private
|
|
297
322
|
*/
|
|
298
323
|
private ensureInitialized;
|
|
324
|
+
/**
|
|
325
|
+
* Gets all providers that match the specified theme ID.
|
|
326
|
+
* If themeId is null, returns providers without an ID.
|
|
327
|
+
*
|
|
328
|
+
* @private
|
|
329
|
+
* @param themeId The theme ID to filter by.
|
|
330
|
+
* @returns Array of matching providers.
|
|
331
|
+
*/
|
|
332
|
+
private getProvidersForName;
|
|
333
|
+
/**
|
|
334
|
+
* Gets the theme name for CSS variable prefixing from the stored state.
|
|
335
|
+
* Falls back to the default theme name from configuration if no state exists for the given scope.
|
|
336
|
+
*
|
|
337
|
+
* @private
|
|
338
|
+
* @param name The scope name (null for global scope).
|
|
339
|
+
* @returns The theme name for CSS variable prefixing.
|
|
340
|
+
*/
|
|
341
|
+
private getThemeNameForScope;
|
|
342
|
+
/**
|
|
343
|
+
* Creates a deep clone of a theme object.
|
|
344
|
+
*
|
|
345
|
+
* @private
|
|
346
|
+
* @param theme The theme to clone.
|
|
347
|
+
* @returns A deep clone of the theme.
|
|
348
|
+
*/
|
|
349
|
+
private cloneTheme;
|
|
299
350
|
}
|
|
300
351
|
//# sourceMappingURL=ThemeService.d.ts.map
|