@ama-styling/devkit 0.0.0-placeholder → 14.0.0-prerelease.12
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/LICENSE +26 -0
- package/README.md +15 -31
- package/fesm2022/ama-styling-devkit.mjs +14 -14
- package/fesm2022/ama-styling-devkit.mjs.map +1 -1
- package/package.json +85 -13
- package/schematics/ng-add/helpers/devtools-registration.d.ts +7 -0
- package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -0
- package/schematics/ng-add/helpers/devtools-registration.js +23 -0
- package/schematics/ng-add/index.d.ts +5 -3
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +18 -4
- package/schematics/ng-add/schema.d.ts +2 -3
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/package.json +3 -0
- package/{index.d.ts → types/ama-styling-devkit.d.ts} +1 -1
- package/types/ama-styling-devkit.d.ts.map +1 -0
- package/index.d.ts.map +0 -1
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/schema.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright Amadeus SAS
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
4
|
+
are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
this list of conditions and the following disclaimer in the documentation and/or
|
|
11
|
+
other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
+
may be used to endorse or promote products derived from this software without
|
|
15
|
+
specific prior written permission.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
21
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
22
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
23
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
24
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
25
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,40 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Otter styling</h1>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
|
|
4
|
+
</p>
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/otter/tree/main/docs/core/MODULE.md).
|
|
7
|
+
<br />
|
|
8
|
+
<br />
|
|
4
9
|
|
|
5
10
|
## Description
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @ama-styling/devkit
|
|
13
|
-
```
|
|
12
|
+
[](https://www.npmjs.com/package/@ama-styling/devkit)
|
|
13
|
+
[](https://www.npmjs.com/package/@ama-styling/devkit)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
This package provides development utilities and tools for styling workflows, including helpers for design tokens, CSS processing, and other styling-related development tasks.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
import { VERSION } from '@ama-styling/devkit';
|
|
17
|
+
## How to install
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
```shell
|
|
20
|
+
ng add @ama-styling/devkit
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- Development utilities for styling workflows
|
|
26
|
-
- Design token processing helpers
|
|
27
|
-
- CSS development tools
|
|
28
|
-
- Build and development helpers
|
|
29
|
-
|
|
30
|
-
## API Documentation
|
|
31
|
-
|
|
32
|
-
The API documentation is available [here](./docs/README.md).
|
|
33
|
-
|
|
34
|
-
## Contributing
|
|
35
|
-
|
|
36
|
-
Please refer to the [contributing guidelines](../../../CONTRIBUTING.md) for information on how to contribute to this package.
|
|
37
|
-
|
|
38
|
-
## License
|
|
39
|
-
|
|
40
|
-
This project is licensed under the MIT License - see the [LICENSE](../../../LICENSE) file for details.
|
|
23
|
+
> [!WARNING]
|
|
24
|
+
> This module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
|
|
@@ -44,10 +44,10 @@ class OtterStylingDevtools {
|
|
|
44
44
|
}, [])
|
|
45
45
|
.forEach((varName) => style.removeProperty(varName));
|
|
46
46
|
}
|
|
47
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
48
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
47
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: OtterStylingDevtools, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
48
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: OtterStylingDevtools }); }
|
|
49
49
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: OtterStylingDevtools, decorators: [{
|
|
51
51
|
type: Injectable
|
|
52
52
|
}] });
|
|
53
53
|
|
|
@@ -106,7 +106,7 @@ const getCSSVariableValue = (variableName, cssRules) => {
|
|
|
106
106
|
*/
|
|
107
107
|
class StylingDevtoolsMessageService {
|
|
108
108
|
constructor() {
|
|
109
|
-
this.logger = inject(LoggerService);
|
|
109
|
+
this.logger = inject(LoggerService, { optional: true });
|
|
110
110
|
this.stylingDevTools = inject(OtterStylingDevtools);
|
|
111
111
|
this.options = inject(OTTER_STYLING_DEVTOOLS_OPTIONS, { optional: true }) ?? OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS;
|
|
112
112
|
this.sendMessage = (sendOtterMessage);
|
|
@@ -142,7 +142,7 @@ class StylingDevtoolsMessageService {
|
|
|
142
142
|
* @param message Message coming from the Otter Chrome DevTools extension
|
|
143
143
|
*/
|
|
144
144
|
handleEvents(message) {
|
|
145
|
-
this.logger
|
|
145
|
+
this.logger?.debug('Message handling by the styling service', message);
|
|
146
146
|
switch (message.dataType) {
|
|
147
147
|
case 'connect': {
|
|
148
148
|
this.connectPlugin();
|
|
@@ -161,7 +161,7 @@ class StylingDevtoolsMessageService {
|
|
|
161
161
|
break;
|
|
162
162
|
}
|
|
163
163
|
default: {
|
|
164
|
-
this.logger
|
|
164
|
+
this.logger?.warn('Message ignored by the styling service', message);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
@@ -169,16 +169,16 @@ class StylingDevtoolsMessageService {
|
|
|
169
169
|
* Function to connect the plugin to the Otter Chrome DevTools extension
|
|
170
170
|
*/
|
|
171
171
|
connectPlugin() {
|
|
172
|
-
this.logger
|
|
172
|
+
this.logger?.debug('Otter DevTools is plugged to styling service of the application');
|
|
173
173
|
}
|
|
174
174
|
/** @inheritDoc */
|
|
175
175
|
activate() {
|
|
176
176
|
fromEvent(window, 'message').pipe(takeUntilDestroyed(this.destroyRef), filterMessageContent(isStylingMessage)).subscribe((e) => this.handleEvents(e));
|
|
177
177
|
}
|
|
178
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
179
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
178
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: StylingDevtoolsMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
179
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: StylingDevtoolsMessageService }); }
|
|
180
180
|
}
|
|
181
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: StylingDevtoolsMessageService, decorators: [{
|
|
182
182
|
type: Injectable
|
|
183
183
|
}], ctorParameters: () => [] });
|
|
184
184
|
|
|
@@ -197,15 +197,15 @@ class StylingDevtoolsModule {
|
|
|
197
197
|
]
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
201
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
202
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
200
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: StylingDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
201
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: StylingDevtoolsModule }); }
|
|
202
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: StylingDevtoolsModule, providers: [
|
|
203
203
|
{ provide: OTTER_STYLING_DEVTOOLS_OPTIONS, useValue: OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS },
|
|
204
204
|
StylingDevtoolsMessageService,
|
|
205
205
|
OtterStylingDevtools
|
|
206
206
|
] }); }
|
|
207
207
|
}
|
|
208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: StylingDevtoolsModule, decorators: [{
|
|
209
209
|
type: NgModule,
|
|
210
210
|
args: [{
|
|
211
211
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ama-styling-devkit.mjs","sources":["../../src/core/styling-devkit-interface.ts","../../src/core/styling-devtools.ts","../../src/core/styling-devtools-token.ts","../../src/core/styling-devtools-message-service.ts","../../src/core/styling-devtools-module.ts","../../src/ama-styling-devkit.ts"],"sourcesContent":["import type {\n ConnectContentMessage,\n DevtoolsCommonOptions,\n ItemIdentifier,\n MessageDataTypes,\n OtterMessageContent,\n RequestMessagesContentMessage,\n} from '@o3r/core';\n\n/** Style Metadata map */\nexport interface CssMetadata {\n /** Variables' dictionary */\n variables: {\n [name: string]: CssVariable;\n };\n}\n\n/** Metadata information added in the design token extension for Metadata extraction */\nexport interface DesignTokenMetadata {\n /** List of tags */\n tags?: string[];\n /** Description of the variable */\n label?: string;\n /** Name of a group of variables */\n category?: string;\n /** Component reference if the variable is linked to one */\n component?: ItemIdentifier;\n}\n\n/** CSS Variable possible types */\nexport type CssVariableType = 'string' | 'color';\n\n/** Metadata for a CSS Variable */\nexport interface CssVariable {\n /** Name of the variable */\n name: string;\n /** Default value of the variable */\n defaultValue: string;\n /** References of the variable */\n references?: CssVariable[];\n /** Tags of the variable */\n tags?: string[];\n /** Description of the variable */\n description?: string;\n /** Description of the variable */\n label?: string;\n /** Type of the variable */\n type?: CssVariableType;\n /** Name of a group of variables */\n category?: string;\n /** component reference if the variable is linked to one */\n component?: ItemIdentifier;\n}\n\n/**\n * Styling devtools service options\n */\nexport interface StylingDevtoolsServiceOptions extends DevtoolsCommonOptions {\n /**\n * Path to retrieve the styling metadata file\n */\n stylingMetadataPath: string;\n}\n\n/** Update styling variables */\nexport interface UpdateStylingVariablesContentMessage extends OtterMessageContent<'updateStylingVariables'> {\n /**\n * Dictionary of variable value to update\n * indexed by the variable name\n */\n variables: Record<string, string>;\n}\n\n/** Reset styling variables override */\nexport interface ResetStylingVariablesContentMessage extends OtterMessageContent<'resetStylingVariables'> {}\n\n/** Styling variable */\nexport type StylingVariable = CssVariable & { runtimeValue?: string };\n\n/** Get styling variables */\nexport interface GetStylingVariableContentMessage extends OtterMessageContent<'getStylingVariable'> {\n /** List of styling variables */\n variables: StylingVariable[];\n}\n\n/**\n * List of styling message contents\n */\ntype StylingMessageContents = UpdateStylingVariablesContentMessage\n | ResetStylingVariablesContentMessage\n | GetStylingVariableContentMessage;\n\n/** List of possible DataTypes for Styling messages */\nexport type StylingMessageDataTypes = MessageDataTypes<StylingMessageContents>;\n\n/** List of all messages for Styling purposes */\nexport type AvailableStylingMessageContents = StylingMessageContents\n | ConnectContentMessage\n | RequestMessagesContentMessage<StylingMessageDataTypes>;\n\n/** Tag to identify theme variable */\nexport const THEME_TAG_NAME = 'theme';\n\n/** Tag to identify palette variable */\nexport const PALETTE_TAG_NAME = 'palette';\n","import {\n DOCUMENT,\n inject,\n Injectable,\n} from '@angular/core';\nimport type {\n CssMetadata,\n} from './index';\n\n/**\n * Styling devtools service\n */\n@Injectable()\nexport class OtterStylingDevtools {\n private readonly document = inject(DOCUMENT);\n\n /**\n * Retrieve styling metadata\n * @param stylingMetadataPath\n */\n public async getStylingMetadata(stylingMetadataPath: string): Promise<CssMetadata> {\n return (await fetch(stylingMetadataPath)).json();\n }\n\n /**\n * Update styling variables\n * @param variables\n */\n public updateVariables(variables: Record<string, string>) {\n Object.entries(variables).forEach(([varName, value]) => this.document.querySelector('html')!.style.setProperty(`--${varName}`, value));\n }\n\n /**\n * Reset styling variables override\n */\n public resetStylingVariables() {\n const style = this.document.querySelector('html')!.style;\n style.cssText\n .split(/;(\\s+)?/)\n .reduce((acc: string[], str) => {\n const match = str?.match(/^(--.*):/);\n return match ? acc.concat(match[1]) : acc;\n }, [])\n .forEach((varName) => style.removeProperty(varName));\n }\n}\n","import {\n InjectionToken,\n} from '@angular/core';\nimport type {\n StylingDevtoolsServiceOptions,\n} from './styling-devkit-interface';\n\n/**\n * Default value for styling devtools\n */\nexport const OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS: Readonly<StylingDevtoolsServiceOptions> = {\n isActivatedOnBootstrap: false,\n stylingMetadataPath: './metadata/styling.metadata.json'\n} as const;\n\n/**\n * Token for styling devtools\n */\nexport const OTTER_STYLING_DEVTOOLS_OPTIONS = new InjectionToken<StylingDevtoolsServiceOptions>('Otter Styling Devtools options');\n","/* eslint-disable no-console -- this is the purpose of this service */\nimport {\n DestroyRef,\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n takeUntilDestroyed,\n} from '@angular/core/rxjs-interop';\nimport {\n filterMessageContent,\n sendOtterMessage,\n} from '@o3r/core';\nimport {\n LoggerService,\n} from '@o3r/logger';\nimport {\n fromEvent,\n} from 'rxjs';\nimport {\n AvailableStylingMessageContents,\n StylingDevtoolsServiceOptions,\n StylingMessageDataTypes,\n} from './styling-devkit-interface';\nimport {\n OtterStylingDevtools,\n} from './styling-devtools';\nimport {\n OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_STYLING_DEVTOOLS_OPTIONS,\n} from './styling-devtools-token';\n\nconst isStylingMessage = (message: any): message is AvailableStylingMessageContents => {\n return message && (\n message.dataType === 'updateStylingVariables'\n || message.dataType === 'resetStylingVariables'\n || message.dataType === 'getStylingVariable'\n || message.dataType === 'requestMessages'\n || message.dataType === 'connect'\n );\n};\n\nconst getCSSRulesAppliedOnRoot = () => Array.from(document.styleSheets)\n .reverse()\n .reduce((acc: CSSStyleRule[], styleSheet) => {\n let rules;\n try {\n rules = styleSheet.cssRules || styleSheet.rules;\n } catch (err) {\n console.debug(`Could not access to stylesheet ${styleSheet.href}. This might be due to network issues, please check:\n- network connectivity\n- CORS setup\n- granted access to the stylesheet`, err);\n }\n\n return acc.concat(\n Array.from(rules || [])\n .reverse()\n .filter((rule): rule is CSSStyleRule => rule instanceof CSSStyleRule && /\\b:root\\b/.test(rule.selectorText))\n );\n }, []);\n\nconst getCSSVariableValueInCSSStyleDeclaration = (variableName: string, style: CSSStyleDeclaration) =>\n style.getPropertyValue(variableName).trim();\n\nconst getCSSVariableValue = (variableName: string, cssRules: CSSStyleRule[]) => {\n const inlineValue = getCSSVariableValueInCSSStyleDeclaration(variableName, document.querySelector('html')!.style);\n if (inlineValue) {\n return inlineValue;\n }\n\n for (const rule of cssRules) {\n const ruleValue = getCSSVariableValueInCSSStyleDeclaration(variableName, rule.style);\n if (ruleValue) {\n return ruleValue;\n }\n }\n};\n\n/**\n * Service to handle communication between application and chrome extension for styling\n */\n@Injectable()\nexport class StylingDevtoolsMessageService {\n private readonly logger = inject(LoggerService);\n private readonly stylingDevTools = inject(OtterStylingDevtools);\n private readonly options = inject<StylingDevtoolsServiceOptions>(OTTER_STYLING_DEVTOOLS_OPTIONS, { optional: true }) ?? OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS;\n\n private readonly sendMessage = sendOtterMessage<AvailableStylingMessageContents>;\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.options = {\n ...OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS,\n ...this.options\n };\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n private async sendMetadata() {\n const metadata = await this.stylingDevTools.getStylingMetadata(this.options.stylingMetadataPath);\n const cssRules = getCSSRulesAppliedOnRoot();\n const variables = Object.values(metadata.variables).map((variable) => ({\n ...variable,\n runtimeValue: getCSSVariableValue(`--${variable.name}`, cssRules)\n }));\n this.sendMessage('getStylingVariable', { variables });\n }\n\n /**\n * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension\n * @param only restricted list of messages to re-send\n */\n private handleReEmitRequest(only?: StylingMessageDataTypes[]) {\n if (!only || only.includes('getStylingVariable')) {\n return this.sendMetadata();\n }\n }\n\n /**\n * Function to handle the incoming messages from Otter Chrome DevTools extension\n * @param message Message coming from the Otter Chrome DevTools extension\n */\n private handleEvents(message: AvailableStylingMessageContents) {\n this.logger.debug('Message handling by the styling service', message);\n\n switch (message.dataType) {\n case 'connect': {\n this.connectPlugin();\n break;\n }\n case 'requestMessages': {\n void this.handleReEmitRequest(message.only);\n break;\n }\n case 'updateStylingVariables': {\n this.stylingDevTools.updateVariables(message.variables);\n break;\n }\n case 'resetStylingVariables': {\n this.stylingDevTools.resetStylingVariables();\n break;\n }\n default: {\n this.logger.warn('Message ignored by the styling service', message);\n }\n }\n }\n\n /**\n * Function to connect the plugin to the Otter Chrome DevTools extension\n */\n private connectPlugin() {\n this.logger.debug('Otter DevTools is plugged to styling service of the application');\n }\n\n /** @inheritDoc */\n public activate() {\n fromEvent(window, 'message').pipe(\n takeUntilDestroyed(this.destroyRef),\n filterMessageContent(isStylingMessage)\n ).subscribe((e) => this.handleEvents(e));\n }\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport type {\n StylingDevtoolsServiceOptions,\n} from './styling-devkit-interface';\nimport {\n OtterStylingDevtools,\n} from './styling-devtools';\nimport {\n StylingDevtoolsMessageService,\n} from './styling-devtools-message-service';\nimport {\n OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_STYLING_DEVTOOLS_OPTIONS,\n} from './styling-devtools-token';\n\n@NgModule({\n providers: [\n { provide: OTTER_STYLING_DEVTOOLS_OPTIONS, useValue: OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS },\n StylingDevtoolsMessageService,\n OtterStylingDevtools\n ]\n})\nexport class StylingDevtoolsModule {\n /**\n * Initialize Otter Devtools\n * @param options\n */\n public static instrument(options: Partial<StylingDevtoolsServiceOptions>): ModuleWithProviders<StylingDevtoolsModule> {\n return {\n ngModule: StylingDevtoolsModule,\n providers: [\n { provide: OTTER_STYLING_DEVTOOLS_OPTIONS, useValue: { ...OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },\n StylingDevtoolsMessageService,\n OtterStylingDevtools\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAoGA;AACO,MAAM,cAAc,GAAG;AAE9B;AACO,MAAM,gBAAgB,GAAG;;AC/FhC;;AAEG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AA+B7C,IAAA;AA7BC;;;AAGG;IACI,MAAM,kBAAkB,CAAC,mBAA2B,EAAA;QACzD,OAAO,CAAC,MAAM,KAAK,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE;IAClD;AAEA;;;AAGG;AACI,IAAA,eAAe,CAAC,SAAiC,EAAA;AACtD,QAAA,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAE,C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ACL,YAAA,QAAQ,EAAE,qBAAqB;AAC/B,YAAA,SAAS,EAAE;AACT,gBAAA,EAAE,OAAO,EAAE,8BAA8B,EAAE,QAAQ,EAAE,EAAE,GAAG,sCAAsC,EAAE,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;gBAC9H,6BAA6B;gBAC7B;AACD;SACF;IACH;kIAdW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mIAArB,qBAAqB,EAAA,CAAA,CAAA;AAArB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,EAAA,SAAA,EANrB;AACT,YAAA,EAAE,OAAO,EAAE,8BAA8B,EAAE,QAAQ,EAAE,sCAAsC,EAAE;YAC7F,6BAA6B;YAC7B;AACD,SAAA,EAAA,CAAA,CAAA;;4FAEU,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,8BAA8B,EAAE,QAAQ,EAAE,sCAAsC,EAAE;wBAC7F,6BAA6B;wBAC7B;AACD;AACF,iBAAA;;;ACxBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ama-styling-devkit.mjs","sources":["../../src/core/styling-devkit-interface.ts","../../src/core/styling-devtools.ts","../../src/core/styling-devtools-token.ts","../../src/core/styling-devtools-message-service.ts","../../src/core/styling-devtools-module.ts","../../src/ama-styling-devkit.ts"],"sourcesContent":["import type {\n ConnectContentMessage,\n DevtoolsCommonOptions,\n ItemIdentifier,\n MessageDataTypes,\n OtterMessageContent,\n RequestMessagesContentMessage,\n} from '@o3r/core';\n\n/** Style Metadata map */\nexport interface CssMetadata {\n /** Variables' dictionary */\n variables: {\n [name: string]: CssVariable;\n };\n}\n\n/** Metadata information added in the design token extension for Metadata extraction */\nexport interface DesignTokenMetadata {\n /** List of tags */\n tags?: string[];\n /** Description of the variable */\n label?: string;\n /** Name of a group of variables */\n category?: string;\n /** Component reference if the variable is linked to one */\n component?: ItemIdentifier;\n}\n\n/** CSS Variable possible types */\nexport type CssVariableType = 'string' | 'color';\n\n/** Metadata for a CSS Variable */\nexport interface CssVariable {\n /** Name of the variable */\n name: string;\n /** Default value of the variable */\n defaultValue: string;\n /** References of the variable */\n references?: CssVariable[];\n /** Tags of the variable */\n tags?: string[];\n /** Description of the variable */\n description?: string;\n /** Description of the variable */\n label?: string;\n /** Type of the variable */\n type?: CssVariableType;\n /** Name of a group of variables */\n category?: string;\n /** component reference if the variable is linked to one */\n component?: ItemIdentifier;\n}\n\n/**\n * Styling devtools service options\n */\nexport interface StylingDevtoolsServiceOptions extends DevtoolsCommonOptions {\n /**\n * Path to retrieve the styling metadata file\n */\n stylingMetadataPath: string;\n}\n\n/** Update styling variables */\nexport interface UpdateStylingVariablesContentMessage extends OtterMessageContent<'updateStylingVariables'> {\n /**\n * Dictionary of variable value to update\n * indexed by the variable name\n */\n variables: Record<string, string>;\n}\n\n/** Reset styling variables override */\nexport interface ResetStylingVariablesContentMessage extends OtterMessageContent<'resetStylingVariables'> {}\n\n/** Styling variable */\nexport type StylingVariable = CssVariable & { runtimeValue?: string };\n\n/** Get styling variables */\nexport interface GetStylingVariableContentMessage extends OtterMessageContent<'getStylingVariable'> {\n /** List of styling variables */\n variables: StylingVariable[];\n}\n\n/**\n * List of styling message contents\n */\ntype StylingMessageContents = UpdateStylingVariablesContentMessage\n | ResetStylingVariablesContentMessage\n | GetStylingVariableContentMessage;\n\n/** List of possible DataTypes for Styling messages */\nexport type StylingMessageDataTypes = MessageDataTypes<StylingMessageContents>;\n\n/** List of all messages for Styling purposes */\nexport type AvailableStylingMessageContents = StylingMessageContents\n | ConnectContentMessage\n | RequestMessagesContentMessage<StylingMessageDataTypes>;\n\n/** Tag to identify theme variable */\nexport const THEME_TAG_NAME = 'theme';\n\n/** Tag to identify palette variable */\nexport const PALETTE_TAG_NAME = 'palette';\n","import {\n DOCUMENT,\n inject,\n Injectable,\n} from '@angular/core';\nimport type {\n CssMetadata,\n} from './index';\n\n/**\n * Styling devtools service\n */\n@Injectable()\nexport class OtterStylingDevtools {\n private readonly document = inject(DOCUMENT);\n\n /**\n * Retrieve styling metadata\n * @param stylingMetadataPath\n */\n public async getStylingMetadata(stylingMetadataPath: string): Promise<CssMetadata> {\n return (await fetch(stylingMetadataPath)).json();\n }\n\n /**\n * Update styling variables\n * @param variables\n */\n public updateVariables(variables: Record<string, string>) {\n Object.entries(variables).forEach(([varName, value]) => this.document.querySelector('html')!.style.setProperty(`--${varName}`, value));\n }\n\n /**\n * Reset styling variables override\n */\n public resetStylingVariables() {\n const style = this.document.querySelector('html')!.style;\n style.cssText\n .split(/;(\\s+)?/)\n .reduce((acc: string[], str) => {\n const match = str?.match(/^(--.*):/);\n return match ? acc.concat(match[1]) : acc;\n }, [])\n .forEach((varName) => style.removeProperty(varName));\n }\n}\n","import {\n InjectionToken,\n} from '@angular/core';\nimport type {\n StylingDevtoolsServiceOptions,\n} from './styling-devkit-interface';\n\n/**\n * Default value for styling devtools\n */\nexport const OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS: Readonly<StylingDevtoolsServiceOptions> = {\n isActivatedOnBootstrap: false,\n stylingMetadataPath: './metadata/styling.metadata.json'\n} as const;\n\n/**\n * Token for styling devtools\n */\nexport const OTTER_STYLING_DEVTOOLS_OPTIONS = new InjectionToken<StylingDevtoolsServiceOptions>('Otter Styling Devtools options');\n","/* eslint-disable no-console -- this is the purpose of this service */\nimport {\n DestroyRef,\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n takeUntilDestroyed,\n} from '@angular/core/rxjs-interop';\nimport {\n filterMessageContent,\n sendOtterMessage,\n} from '@o3r/core';\nimport {\n LoggerService,\n} from '@o3r/logger';\nimport {\n fromEvent,\n} from 'rxjs';\nimport {\n AvailableStylingMessageContents,\n StylingDevtoolsServiceOptions,\n StylingMessageDataTypes,\n} from './styling-devkit-interface';\nimport {\n OtterStylingDevtools,\n} from './styling-devtools';\nimport {\n OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_STYLING_DEVTOOLS_OPTIONS,\n} from './styling-devtools-token';\n\nconst isStylingMessage = (message: any): message is AvailableStylingMessageContents => {\n return message && (\n message.dataType === 'updateStylingVariables'\n || message.dataType === 'resetStylingVariables'\n || message.dataType === 'getStylingVariable'\n || message.dataType === 'requestMessages'\n || message.dataType === 'connect'\n );\n};\n\nconst getCSSRulesAppliedOnRoot = () => Array.from(document.styleSheets)\n .reverse()\n .reduce((acc: CSSStyleRule[], styleSheet) => {\n let rules;\n try {\n rules = styleSheet.cssRules || styleSheet.rules;\n } catch (err) {\n console.debug(`Could not access to stylesheet ${styleSheet.href}. This might be due to network issues, please check:\n- network connectivity\n- CORS setup\n- granted access to the stylesheet`, err);\n }\n\n return acc.concat(\n Array.from(rules || [])\n .reverse()\n .filter((rule): rule is CSSStyleRule => rule instanceof CSSStyleRule && /\\b:root\\b/.test(rule.selectorText))\n );\n }, []);\n\nconst getCSSVariableValueInCSSStyleDeclaration = (variableName: string, style: CSSStyleDeclaration) =>\n style.getPropertyValue(variableName).trim();\n\nconst getCSSVariableValue = (variableName: string, cssRules: CSSStyleRule[]) => {\n const inlineValue = getCSSVariableValueInCSSStyleDeclaration(variableName, document.querySelector('html')!.style);\n if (inlineValue) {\n return inlineValue;\n }\n\n for (const rule of cssRules) {\n const ruleValue = getCSSVariableValueInCSSStyleDeclaration(variableName, rule.style);\n if (ruleValue) {\n return ruleValue;\n }\n }\n};\n\n/**\n * Service to handle communication between application and chrome extension for styling\n */\n@Injectable()\nexport class StylingDevtoolsMessageService {\n private readonly logger = inject(LoggerService, { optional: true });\n private readonly stylingDevTools = inject(OtterStylingDevtools);\n private readonly options = inject<StylingDevtoolsServiceOptions>(OTTER_STYLING_DEVTOOLS_OPTIONS, { optional: true }) ?? OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS;\n\n private readonly sendMessage = sendOtterMessage<AvailableStylingMessageContents>;\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.options = {\n ...OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS,\n ...this.options\n };\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n private async sendMetadata() {\n const metadata = await this.stylingDevTools.getStylingMetadata(this.options.stylingMetadataPath);\n const cssRules = getCSSRulesAppliedOnRoot();\n const variables = Object.values(metadata.variables).map((variable) => ({\n ...variable,\n runtimeValue: getCSSVariableValue(`--${variable.name}`, cssRules)\n }));\n this.sendMessage('getStylingVariable', { variables });\n }\n\n /**\n * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension\n * @param only restricted list of messages to re-send\n */\n private handleReEmitRequest(only?: StylingMessageDataTypes[]) {\n if (!only || only.includes('getStylingVariable')) {\n return this.sendMetadata();\n }\n }\n\n /**\n * Function to handle the incoming messages from Otter Chrome DevTools extension\n * @param message Message coming from the Otter Chrome DevTools extension\n */\n private handleEvents(message: AvailableStylingMessageContents) {\n this.logger?.debug('Message handling by the styling service', message);\n\n switch (message.dataType) {\n case 'connect': {\n this.connectPlugin();\n break;\n }\n case 'requestMessages': {\n void this.handleReEmitRequest(message.only);\n break;\n }\n case 'updateStylingVariables': {\n this.stylingDevTools.updateVariables(message.variables);\n break;\n }\n case 'resetStylingVariables': {\n this.stylingDevTools.resetStylingVariables();\n break;\n }\n default: {\n this.logger?.warn('Message ignored by the styling service', message);\n }\n }\n }\n\n /**\n * Function to connect the plugin to the Otter Chrome DevTools extension\n */\n private connectPlugin() {\n this.logger?.debug('Otter DevTools is plugged to styling service of the application');\n }\n\n /** @inheritDoc */\n public activate() {\n fromEvent(window, 'message').pipe(\n takeUntilDestroyed(this.destroyRef),\n filterMessageContent(isStylingMessage)\n ).subscribe((e) => this.handleEvents(e));\n }\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport type {\n StylingDevtoolsServiceOptions,\n} from './styling-devkit-interface';\nimport {\n OtterStylingDevtools,\n} from './styling-devtools';\nimport {\n StylingDevtoolsMessageService,\n} from './styling-devtools-message-service';\nimport {\n OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_STYLING_DEVTOOLS_OPTIONS,\n} from './styling-devtools-token';\n\n@NgModule({\n providers: [\n { provide: OTTER_STYLING_DEVTOOLS_OPTIONS, useValue: OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS },\n StylingDevtoolsMessageService,\n OtterStylingDevtools\n ]\n})\nexport class StylingDevtoolsModule {\n /**\n * Initialize Otter Devtools\n * @param options\n */\n public static instrument(options: Partial<StylingDevtoolsServiceOptions>): ModuleWithProviders<StylingDevtoolsModule> {\n return {\n ngModule: StylingDevtoolsModule,\n providers: [\n { provide: OTTER_STYLING_DEVTOOLS_OPTIONS, useValue: { ...OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },\n StylingDevtoolsMessageService,\n OtterStylingDevtools\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAoGA;AACO,MAAM,cAAc,GAAG;AAE9B;AACO,MAAM,gBAAgB,GAAG;;AC/FhC;;AAEG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AA+B7C,IAAA;AA7BC;;;AAGG;IACI,MAAM,kBAAkB,CAAC,mBAA2B,EAAA;QACzD,OAAO,CAAC,MAAM,KAAK,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE;IAClD;AAEA;;;AAGG;AACI,IAAA,eAAe,CAAC,SAAiC,EAAA;A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version": "14.0.0-prerelease.12",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"otter-module"
|
|
16
16
|
],
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@angular-devkit/schematics": "
|
|
19
|
-
"@angular/common": "
|
|
20
|
-
"@angular/core": "
|
|
21
|
-
"@o3r/core": "
|
|
22
|
-
"@o3r/logger": "
|
|
23
|
-
"@o3r/schematics": "
|
|
24
|
-
"@o3r/testing": "
|
|
25
|
-
"@schematics/angular": "
|
|
18
|
+
"@angular-devkit/schematics": "~21.0.2",
|
|
19
|
+
"@angular/common": "~21.0.3",
|
|
20
|
+
"@angular/core": "~21.0.3",
|
|
21
|
+
"@o3r/core": "~14.0.0-prerelease.12",
|
|
22
|
+
"@o3r/logger": "~14.0.0-prerelease.12",
|
|
23
|
+
"@o3r/schematics": "~14.0.0-prerelease.12",
|
|
24
|
+
"@o3r/testing": "~14.0.0-prerelease.12",
|
|
25
|
+
"@schematics/angular": "~21.0.2",
|
|
26
26
|
"rxjs": "^7.8.1",
|
|
27
27
|
"type-fest": "^5.3.1",
|
|
28
28
|
"typescript": "^5.9.0"
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
"@angular-devkit/schematics": {
|
|
32
32
|
"optional": true
|
|
33
33
|
},
|
|
34
|
+
"@o3r/logger": {
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
34
37
|
"@o3r/schematics": {
|
|
35
38
|
"optional": true
|
|
36
39
|
},
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
}
|
|
46
49
|
},
|
|
47
50
|
"dependencies": {
|
|
48
|
-
"@o3r/schematics": "
|
|
51
|
+
"@o3r/schematics": "~14.0.0-prerelease.12",
|
|
49
52
|
"tslib": "^2.6.2"
|
|
50
53
|
},
|
|
51
54
|
"engines": {
|
|
@@ -53,15 +56,84 @@
|
|
|
53
56
|
},
|
|
54
57
|
"schematics": "./collection.json",
|
|
55
58
|
"module": "fesm2022/ama-styling-devkit.mjs",
|
|
56
|
-
"typings": "
|
|
59
|
+
"typings": "types/ama-styling-devkit.d.ts",
|
|
57
60
|
"exports": {
|
|
58
61
|
"./package.json": {
|
|
59
62
|
"default": "./package.json"
|
|
60
63
|
},
|
|
61
64
|
".": {
|
|
62
|
-
"types": "./
|
|
65
|
+
"types": "./types/ama-styling-devkit.d.ts",
|
|
63
66
|
"default": "./fesm2022/ama-styling-devkit.mjs"
|
|
64
67
|
}
|
|
65
68
|
},
|
|
66
|
-
"sideEffects": false
|
|
69
|
+
"sideEffects": false,
|
|
70
|
+
"contributors": [
|
|
71
|
+
{
|
|
72
|
+
"name": "Yannick Adam",
|
|
73
|
+
"url": "https://github.com/yannickadam",
|
|
74
|
+
"email": "yannickadam@users.noreply.github.com"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "Kilian Panot",
|
|
78
|
+
"url": "https://github.com/kpanot",
|
|
79
|
+
"email": "kpanot@users.noreply.github.com"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "Jeremy Bourgeois",
|
|
83
|
+
"url": "https://github.com/jbourgeois-1A",
|
|
84
|
+
"email": "jbourgeois-1A@users.noreply.github.com"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "Pierre Henri Ginoux",
|
|
88
|
+
"url": "https://github.com/pginoux-1A",
|
|
89
|
+
"email": "pginoux-1A@users.noreply.github.com"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "Mircea Vasile Rednic",
|
|
93
|
+
"url": "https://github.com/mrednic-1A",
|
|
94
|
+
"email": "mrednic-1A@users.noreply.github.com"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "Stephane Dalle",
|
|
98
|
+
"url": "https://github.com/sdalle-1A",
|
|
99
|
+
"email": "sdalle-1A@users.noreply.github.com"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "Nicolas Hoffmann",
|
|
103
|
+
"url": "https://github.com/nhoffmann-1A",
|
|
104
|
+
"email": "nhoffmann-1A@users.noreply.github.com"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "Victor Scaiceanu",
|
|
108
|
+
"url": "https://github.com/vscaiceanu-1a",
|
|
109
|
+
"email": "vscaiceanu-1A@users.noreply.github.com"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "Florian Paul",
|
|
113
|
+
"url": "https://github.com/fpaul-1A",
|
|
114
|
+
"email": "fpaul-1A@users.noreply.github.com"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "Corinne Paulve",
|
|
118
|
+
"url": "https://github.com/cpaulve-1A",
|
|
119
|
+
"email": "cpaulve-1A@users.noreply.github.com"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "Matthieu Crouzet",
|
|
123
|
+
"url": "https://github.com/matthieu-crouzet",
|
|
124
|
+
"email": "matthieu-crouzet@users.noreply.github.com"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "Salome Do",
|
|
128
|
+
"url": "https://github.com/sdo-1A",
|
|
129
|
+
"email": "sdo-1A@users.noreply.github.com"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"bugs": "https://github.com/AmadeusITGroup/otter/issues",
|
|
133
|
+
"repository": {
|
|
134
|
+
"type": "git",
|
|
135
|
+
"url": "git+https://github.com/AmadeusITGroup/otter.git"
|
|
136
|
+
},
|
|
137
|
+
"license": "BSD-3-Clause",
|
|
138
|
+
"homepage": "https://amadeusitgroup.github.io/otter/"
|
|
67
139
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NgAddSchematicsSchema } from '../schema';
|
|
2
|
+
/**
|
|
3
|
+
* Register Devtools to the application
|
|
4
|
+
* @param options
|
|
5
|
+
*/
|
|
6
|
+
export declare const registerDevtools: (options: NgAddSchematicsSchema) => import("@angular-devkit/schematics").Rule;
|
|
7
|
+
//# sourceMappingURL=devtools-registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools-registration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/devtools-registration.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,WAAW,CAAC;AAMnB;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,qBAAqB,8CAO9D,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDevtools = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const schematics_1 = require("@o3r/schematics");
|
|
7
|
+
const DEVTOOL_MODULE_NAME = 'StylingDevtoolsModule';
|
|
8
|
+
const DEVTOOL_SERVICE_NAME = 'StylingDevtoolsMessageService';
|
|
9
|
+
const PACKAGE_NAME = JSON.parse((0, node_fs_1.readFileSync)(path.resolve(__dirname, '..', '..', '..', 'package.json'), { encoding: 'utf8' })).name;
|
|
10
|
+
/**
|
|
11
|
+
* Register Devtools to the application
|
|
12
|
+
* @param options
|
|
13
|
+
*/
|
|
14
|
+
const registerDevtools = (options) => {
|
|
15
|
+
return (0, schematics_1.registerDevtoolsToApplication)({
|
|
16
|
+
moduleName: DEVTOOL_MODULE_NAME,
|
|
17
|
+
packageName: PACKAGE_NAME,
|
|
18
|
+
serviceName: DEVTOOL_SERVICE_NAME,
|
|
19
|
+
projectName: options.projectName
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.registerDevtools = registerDevtools;
|
|
23
|
+
//# sourceMappingURL=devtools-registration.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Rule } from '@angular-devkit/schematics';
|
|
2
|
+
import type { NgAddSchematicsSchema } from './schema';
|
|
2
3
|
/**
|
|
3
|
-
* Add Otter
|
|
4
|
+
* Add Otter Ama styling devkit to an Angular Project
|
|
5
|
+
* @param options
|
|
4
6
|
*/
|
|
5
|
-
export declare
|
|
7
|
+
export declare const ngAdd: (options: NgAddSchematicsSchema) => Rule;
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AAQpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAgBlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ngAdd =
|
|
3
|
+
exports.ngAdd = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
const schematics_2 = require("@o3r/schematics");
|
|
7
|
+
const devtools_registration_1 = require("./helpers/devtools-registration");
|
|
8
|
+
const packageJsonPath = (0, node_path_1.resolve)(__dirname, '..', '..', 'package.json');
|
|
5
9
|
/**
|
|
6
|
-
* Add Otter
|
|
10
|
+
* Add Otter Ama styling devkit to an Angular Project
|
|
11
|
+
* @param options
|
|
7
12
|
*/
|
|
8
|
-
function
|
|
13
|
+
function ngAddFn(options) {
|
|
9
14
|
/* ng add rules */
|
|
10
|
-
return (0, schematics_1.
|
|
15
|
+
return (0, schematics_1.chain)([
|
|
16
|
+
(0, schematics_2.ngAddDependenciesRule)(options, packageJsonPath, {}),
|
|
17
|
+
(0, devtools_registration_1.registerDevtools)(options)
|
|
18
|
+
]);
|
|
11
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Add Otter Ama styling devkit to an Angular Project
|
|
22
|
+
* @param options
|
|
23
|
+
*/
|
|
24
|
+
const ngAdd = (options) => (0, schematics_2.createOtterSchematic)(ngAddFn)(options);
|
|
25
|
+
exports.ngAdd = ngAdd;
|
|
12
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
projectName?: string | undefined;
|
|
1
|
+
import type { NgAddOptions, SchematicOptionObject } from '@o3r/schematics';
|
|
2
|
+
export interface NgAddSchematicsSchema extends NgAddOptions, SchematicOptionObject {
|
|
4
3
|
}
|
|
5
4
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qBAAsB,SAAQ,YAAY,EAAE,qBAAqB;CACjF"}
|
|
@@ -161,4 +161,4 @@ declare const OTTER_STYLING_DEVTOOLS_OPTIONS: InjectionToken<StylingDevtoolsServ
|
|
|
161
161
|
|
|
162
162
|
export { OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS, OTTER_STYLING_DEVTOOLS_OPTIONS, OtterStylingDevtools, PALETTE_TAG_NAME, StylingDevtoolsMessageService, StylingDevtoolsModule, THEME_TAG_NAME };
|
|
163
163
|
export type { AvailableStylingMessageContents, CssMetadata, CssVariable, CssVariableType, DesignTokenMetadata, GetStylingVariableContentMessage, ResetStylingVariablesContentMessage, StylingDevtoolsServiceOptions, StylingMessageDataTypes, StylingVariable, UpdateStylingVariablesContentMessage };
|
|
164
|
-
//# sourceMappingURL=
|
|
164
|
+
//# sourceMappingURL=ama-styling-devkit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ama-styling-devkit.d.ts","sources":["../../src/core/styling-devkit-interface.ts","../../src/core/styling-devtools.ts","../../src/core/styling-devtools-message-service.ts","../../src/core/styling-devtools-module.ts","../../src/core/styling-devtools-token.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":";;;;AASA;;;AAGE;AACE,wBAAA,WAAA;;AAEH;AAED;;;AAGE;;;;;;;AAOD;AAED;;AAGA;;;;;;;AAOE,iBAAA,WAAA;;AAEA;;;;;;;;;;;AAWD;AAED;;AAEG;AACG,UAAA,6BAAA,SAAA,qBAAA;AACJ;;AAEG;;AAEJ;AAED;;AAEE;;;AAGG;AACH,eAAA,MAAA;AACD;AAED;;AAC4G;AAE5G;AACM,KAAA,eAAA,GAAA,WAAA;;;AAEN;;;;AAIC;AAED;;AAEG;AACH,KAAA,sBAAA,GAAA,oCAAA,GAAA,mCAAA,GAAA,gCAAA;AAIA;;AAGA;AACM,KAAA,+BAAA,GAAA,sBAAA,GAAA,qBAAA,GAAA,6BAAA,CAAA,uBAAA;AAIN;AACA,cAAA,cAAA;AAEA;AACA,cAAA,gBAAA;;AC/FA;;AAEG;AACH,cAAA,oBAAA;AAEE;AAEA;;;AAGG;;AAKH;;;AAGG;;AAKH;;AAEG;;;;AAWJ;;ACkCD;;AAEG;AACH,cAAA,6BAAA;AAEE;AACA;AACA;AAEA;AACA;;;AAsBA;;;AAGG;AACH;AAMA;;;AAGG;AACH;AA0BA;;AAEG;AACH;;;;;AAWD;;ACnJD,cAAA,qBAAA;AAQE;;;AAGG;;;;;AAWJ;;ACjCD;;AAEG;AACH,cAAA,sCAAA,EAAA,QAAA,CAAA,6BAAA;AAKA;;AAEG;AACH,cAAA,8BAAA,EAAA,cAAA,CAAA,6BAAA;;;;"}
|
package/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../src/core/styling-devkit-interface.ts","../src/core/styling-devtools.ts","../src/core/styling-devtools-message-service.ts","../src/core/styling-devtools-module.ts","../src/core/styling-devtools-token.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":";;;;AASA;;;AAGE;AACE,wBAAA,WAAA;;AAEH;AAED;;;AAGE;;;;;;;AAOD;AAED;;AAGA;;;;;;;AAOE,iBAAA,WAAA;;AAEA;;;;;;;;;;;AAWD;AAED;;AAEG;AACG,UAAA,6BAAA,SAAA,qBAAA;AACJ;;AAEG;;AAEJ;AAED;;AAEE;;;AAGG;AACH,eAAA,MAAA;AACD;AAED;;AAC4G;AAE5G;AACM,KAAA,eAAA,GAAA,WAAA;;;AAEN;;;;AAIC;AAED;;AAEG;AACH,KAAA,sBAAA,GAAA,oCAAA,GAAA,mCAAA,GAAA,gCAAA;AAIA;;AAGA;AACM,KAAA,+BAAA,GAAA,sBAAA,GAAA,qBAAA,GAAA,6BAAA,CAAA,uBAAA;AAIN;AACA,cAAA,cAAA;AAEA;AACA,cAAA,gBAAA;;AC/FA;;AAEG;AACH,cAAA,oBAAA;AAEE;AAEA;;;AAGG;;AAKH;;;AAGG;;AAKH;;AAEG;;;;AAWJ;;ACkCD;;AAEG;AACH,cAAA,6BAAA;AAEE;AACA;AACA;AAEA;AACA;;;AAsBA;;;AAGG;AACH;AAMA;;;AAGG;AACH;AA0BA;;AAEG;AACH;;;;;AAWD;;ACnJD,cAAA,qBAAA;AAQE;;;AAGG;;;;;AAWJ;;ACjCD;;AAEG;AACH,cAAA,sCAAA,EAAA,QAAA,CAAA,6BAAA;AAKA;;AAEG;AACH,cAAA,8BAAA,EAAA,cAAA,CAAA,6BAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;AAUA,sBAGC;AAbD,2DAEoC;AAKpC;;GAEG;AACH,SAAgB,KAAK;IACnB,kBAAkB;IAClB,OAAO,IAAA,iBAAI,GAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|