@ama-styling/devkit 14.1.0-prerelease.2 → 14.1.0-prerelease.4
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/index.d.ts
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { ItemIdentifier, DevtoolsCommonOptions, OtterMessageContent, MessageDataTypes, ConnectContentMessage, RequestMessagesContentMessage } from '@o3r/core';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { ModuleWithProviders, InjectionToken } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
/** Style Metadata map */
|
|
6
|
+
interface CssMetadata {
|
|
7
|
+
/** Variables' dictionary */
|
|
8
|
+
variables: {
|
|
9
|
+
[name: string]: CssVariable;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** Metadata information added in the design token extension for Metadata extraction */
|
|
13
|
+
interface DesignTokenMetadata {
|
|
14
|
+
/** List of tags */
|
|
15
|
+
tags?: string[];
|
|
16
|
+
/** Description of the variable */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Name of a group of variables */
|
|
19
|
+
category?: string;
|
|
20
|
+
/** Component reference if the variable is linked to one */
|
|
21
|
+
component?: ItemIdentifier;
|
|
22
|
+
}
|
|
23
|
+
/** CSS Variable possible types */
|
|
24
|
+
type CssVariableType = 'string' | 'color';
|
|
25
|
+
/** Metadata for a CSS Variable */
|
|
26
|
+
interface CssVariable {
|
|
27
|
+
/** Name of the variable */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Default value of the variable */
|
|
30
|
+
defaultValue: string;
|
|
31
|
+
/** References of the variable */
|
|
32
|
+
references?: CssVariable[];
|
|
33
|
+
/** Tags of the variable */
|
|
34
|
+
tags?: string[];
|
|
35
|
+
/** Description of the variable */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Description of the variable */
|
|
38
|
+
label?: string;
|
|
39
|
+
/** Type of the variable */
|
|
40
|
+
type?: CssVariableType;
|
|
41
|
+
/** Name of a group of variables */
|
|
42
|
+
category?: string;
|
|
43
|
+
/** component reference if the variable is linked to one */
|
|
44
|
+
component?: ItemIdentifier;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Styling devtools service options
|
|
48
|
+
*/
|
|
49
|
+
interface StylingDevtoolsServiceOptions extends DevtoolsCommonOptions {
|
|
50
|
+
/**
|
|
51
|
+
* Path to retrieve the styling metadata file
|
|
52
|
+
*/
|
|
53
|
+
stylingMetadataPath: string;
|
|
54
|
+
}
|
|
55
|
+
/** Update styling variables */
|
|
56
|
+
interface UpdateStylingVariablesContentMessage extends OtterMessageContent<'updateStylingVariables'> {
|
|
57
|
+
/**
|
|
58
|
+
* Dictionary of variable value to update
|
|
59
|
+
* indexed by the variable name
|
|
60
|
+
*/
|
|
61
|
+
variables: Record<string, string>;
|
|
62
|
+
}
|
|
63
|
+
/** Reset styling variables override */
|
|
64
|
+
interface ResetStylingVariablesContentMessage extends OtterMessageContent<'resetStylingVariables'> {
|
|
65
|
+
}
|
|
66
|
+
/** Styling variable */
|
|
67
|
+
type StylingVariable = CssVariable & {
|
|
68
|
+
runtimeValue?: string;
|
|
69
|
+
};
|
|
70
|
+
/** Get styling variables */
|
|
71
|
+
interface GetStylingVariableContentMessage extends OtterMessageContent<'getStylingVariable'> {
|
|
72
|
+
/** List of styling variables */
|
|
73
|
+
variables: StylingVariable[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* List of styling message contents
|
|
77
|
+
*/
|
|
78
|
+
type StylingMessageContents = UpdateStylingVariablesContentMessage | ResetStylingVariablesContentMessage | GetStylingVariableContentMessage;
|
|
79
|
+
/** List of possible DataTypes for Styling messages */
|
|
80
|
+
type StylingMessageDataTypes = MessageDataTypes<StylingMessageContents>;
|
|
81
|
+
/** List of all messages for Styling purposes */
|
|
82
|
+
type AvailableStylingMessageContents = StylingMessageContents | ConnectContentMessage | RequestMessagesContentMessage<StylingMessageDataTypes>;
|
|
83
|
+
/** Tag to identify theme variable */
|
|
84
|
+
declare const THEME_TAG_NAME = "theme";
|
|
85
|
+
/** Tag to identify palette variable */
|
|
86
|
+
declare const PALETTE_TAG_NAME = "palette";
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Styling devtools service
|
|
90
|
+
*/
|
|
91
|
+
declare class OtterStylingDevtools {
|
|
92
|
+
private readonly document;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieve styling metadata
|
|
95
|
+
* @param stylingMetadataPath
|
|
96
|
+
*/
|
|
97
|
+
getStylingMetadata(stylingMetadataPath: string): Promise<CssMetadata>;
|
|
98
|
+
/**
|
|
99
|
+
* Update styling variables
|
|
100
|
+
* @param variables
|
|
101
|
+
*/
|
|
102
|
+
updateVariables(variables: Record<string, string>): void;
|
|
103
|
+
/**
|
|
104
|
+
* Reset styling variables override
|
|
105
|
+
*/
|
|
106
|
+
resetStylingVariables(): void;
|
|
107
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OtterStylingDevtools, never>;
|
|
108
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<OtterStylingDevtools>;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Service to handle communication between application and chrome extension for styling
|
|
113
|
+
*/
|
|
114
|
+
declare class StylingDevtoolsMessageService {
|
|
115
|
+
private readonly logger;
|
|
116
|
+
private readonly stylingDevTools;
|
|
117
|
+
private readonly options;
|
|
118
|
+
private readonly sendMessage;
|
|
119
|
+
private readonly destroyRef;
|
|
120
|
+
constructor();
|
|
121
|
+
private sendMetadata;
|
|
122
|
+
/**
|
|
123
|
+
* Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
|
|
124
|
+
* @param only restricted list of messages to re-send
|
|
125
|
+
*/
|
|
126
|
+
private handleReEmitRequest;
|
|
127
|
+
/**
|
|
128
|
+
* Function to handle the incoming messages from Otter Chrome DevTools extension
|
|
129
|
+
* @param message Message coming from the Otter Chrome DevTools extension
|
|
130
|
+
*/
|
|
131
|
+
private handleEvents;
|
|
132
|
+
/**
|
|
133
|
+
* Function to connect the plugin to the Otter Chrome DevTools extension
|
|
134
|
+
*/
|
|
135
|
+
private connectPlugin;
|
|
136
|
+
/** @inheritDoc */
|
|
137
|
+
activate(): void;
|
|
138
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StylingDevtoolsMessageService, never>;
|
|
139
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StylingDevtoolsMessageService>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
declare class StylingDevtoolsModule {
|
|
143
|
+
/**
|
|
144
|
+
* Initialize Otter Devtools
|
|
145
|
+
* @param options
|
|
146
|
+
*/
|
|
147
|
+
static instrument(options: Partial<StylingDevtoolsServiceOptions>): ModuleWithProviders<StylingDevtoolsModule>;
|
|
148
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StylingDevtoolsModule, never>;
|
|
149
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<StylingDevtoolsModule, never, never, never>;
|
|
150
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<StylingDevtoolsModule>;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Default value for styling devtools
|
|
155
|
+
*/
|
|
156
|
+
declare const OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS: Readonly<StylingDevtoolsServiceOptions>;
|
|
157
|
+
/**
|
|
158
|
+
* Token for styling devtools
|
|
159
|
+
*/
|
|
160
|
+
declare const OTTER_STYLING_DEVTOOLS_OPTIONS: InjectionToken<StylingDevtoolsServiceOptions>;
|
|
161
|
+
|
|
162
|
+
export { OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS, OTTER_STYLING_DEVTOOLS_OPTIONS, OtterStylingDevtools, PALETTE_TAG_NAME, StylingDevtoolsMessageService, StylingDevtoolsModule, THEME_TAG_NAME };
|
|
163
|
+
export type { AvailableStylingMessageContents, CssMetadata, CssVariable, CssVariableType, DesignTokenMetadata, GetStylingVariableContentMessage, ResetStylingVariablesContentMessage, StylingDevtoolsServiceOptions, StylingMessageDataTypes, StylingVariable, UpdateStylingVariablesContentMessage };
|
|
164
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-styling/devkit",
|
|
3
|
-
"version": "14.1.0-prerelease.
|
|
3
|
+
"version": "14.1.0-prerelease.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"@angular-devkit/schematics": "~21.0.2",
|
|
19
19
|
"@angular/common": "~21.0.3",
|
|
20
20
|
"@angular/core": "~21.0.3",
|
|
21
|
-
"@o3r/core": "~14.1.0-prerelease.
|
|
22
|
-
"@o3r/logger": "~14.1.0-prerelease.
|
|
23
|
-
"@o3r/schematics": "~14.1.0-prerelease.
|
|
24
|
-
"@o3r/testing": "~14.1.0-prerelease.
|
|
21
|
+
"@o3r/core": "~14.1.0-prerelease.4",
|
|
22
|
+
"@o3r/logger": "~14.1.0-prerelease.4",
|
|
23
|
+
"@o3r/schematics": "~14.1.0-prerelease.4",
|
|
24
|
+
"@o3r/testing": "~14.1.0-prerelease.4",
|
|
25
25
|
"@schematics/angular": "~21.0.2",
|
|
26
26
|
"rxjs": "^7.8.1",
|
|
27
27
|
"type-fest": "^5.3.1",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@o3r/schematics": "~14.1.0-prerelease.
|
|
51
|
+
"@o3r/schematics": "~14.1.0-prerelease.4",
|
|
52
52
|
"tslib": "^2.6.2"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools-registration.js","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/devtools-registration.ts"],"names":[],"mappings":";;;AAAA,qCAEiB;AACjB,kCAAkC;AAClC,gDAEyB;AAKzB,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AACpD,MAAM,oBAAoB,GAAG,+BAA+B,CAAC;AAC7D,MAAM,YAAY,GAAW,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAE5I;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,OAA8B,EAAE,EAAE;IACjE,OAAO,IAAA,0CAA6B,EAAC;QACnC,UAAU,EAAE,mBAAmB;QAC/B,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,oBAAoB;QACjC,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,CAAC,CAAC;AACL,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,yCAEmB;AACnB,2DAGoC;AACpC,gDAGyB;AACzB,2EAEyC;AAKzC,MAAM,eAAe,GAAG,IAAA,mBAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAEvE;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,kBAAkB;IAClB,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,kCAAqB,EAAC,OAAO,EAAE,eAAe,EAAE,EAAE,CAAC;QACnD,IAAA,wCAAgB,EAAC,OAAO,CAAC;KAC1B,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACI,MAAM,KAAK,GAAG,CAAC,OAA8B,EAAE,EAAE,CAAC,IAAA,iCAAoB,EAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;AAAnF,QAAA,KAAK,SAA8E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|