effcss 1.3.6 → 2.0.1
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/README.md +44 -23
- package/dist/build/define-provider.min.js +2 -2
- package/dist/constants.js +1 -0
- package/dist/index.js +1 -1
- package/dist/types/src/_provider/manage.d.ts +1 -1
- package/dist/types/src/_provider/process.d.ts +4 -8
- package/dist/types/src/constants.d.ts +85 -0
- package/dist/types/src/index.d.ts +10 -20
- package/dist/types/src/types.d.ts +172 -168
- package/dist/types/src/utils/browser.d.ts +123 -0
- package/dist/types/src/utils/common.d.ts +74 -0
- package/dist/utils/browser.js +1 -0
- package/dist/utils/common.js +1 -0
- package/logo.svg +305 -0
- package/package.json +13 -18
- package/dist/build/define-provider-with-configs.min.js +0 -7
- package/dist/configs/basic.js +0 -1
- package/dist/configs/ext.js +0 -1
- package/dist/css/dict.js +0 -1
- package/dist/css/functions.js +0 -1
- package/dist/types/build/defineProviderWithConfigs.d.ts +0 -1
- package/dist/types/src/_provider/constants.d.ts +0 -19
- package/dist/types/src/configs/basic/Agent.d.ts +0 -3
- package/dist/types/src/configs/basic/AgentColor.d.ts +0 -3
- package/dist/types/src/configs/basic/Animation.d.ts +0 -3
- package/dist/types/src/configs/basic/Background.d.ts +0 -3
- package/dist/types/src/configs/basic/Border.d.ts +0 -3
- package/dist/types/src/configs/basic/BorderExt.d.ts +0 -3
- package/dist/types/src/configs/basic/Box.d.ts +0 -3
- package/dist/types/src/configs/basic/Color.d.ts +0 -3
- package/dist/types/src/configs/basic/Column.d.ts +0 -3
- package/dist/types/src/configs/basic/FlexContainer.d.ts +0 -3
- package/dist/types/src/configs/basic/FlexItem.d.ts +0 -3
- package/dist/types/src/configs/basic/Font.d.ts +0 -3
- package/dist/types/src/configs/basic/GridContainer.d.ts +0 -3
- package/dist/types/src/configs/basic/GridItem.d.ts +0 -3
- package/dist/types/src/configs/basic/Indent.d.ts +0 -3
- package/dist/types/src/configs/basic/Inset.d.ts +0 -3
- package/dist/types/src/configs/basic/Mask.d.ts +0 -3
- package/dist/types/src/configs/basic/Object.d.ts +0 -3
- package/dist/types/src/configs/basic/Outline.d.ts +0 -3
- package/dist/types/src/configs/basic/Scroll.d.ts +0 -3
- package/dist/types/src/configs/basic/ScrollExt.d.ts +0 -3
- package/dist/types/src/configs/basic/Size.d.ts +0 -3
- package/dist/types/src/configs/basic/SizeExt.d.ts +0 -3
- package/dist/types/src/configs/basic/Text.d.ts +0 -3
- package/dist/types/src/configs/basic/Transform.d.ts +0 -3
- package/dist/types/src/configs/basic/Transition.d.ts +0 -3
- package/dist/types/src/configs/basic/User.d.ts +0 -3
- package/dist/types/src/configs/basic/View.d.ts +0 -3
- package/dist/types/src/configs/basic.d.ts +0 -112
- package/dist/types/src/configs/ext/Keyframes.d.ts +0 -6
- package/dist/types/src/configs/ext/Reset.d.ts +0 -3
- package/dist/types/src/configs/ext.d.ts +0 -8
- package/dist/types/src/css/dict.d.ts +0 -4
- package/dist/types/src/css/functions.d.ts +0 -443
- package/dist/types/src/utils.d.ts +0 -197
- package/dist/utils.js +0 -1
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Join args with dash
|
|
3
|
-
* @param args
|
|
4
|
-
*/
|
|
5
|
-
export declare const dash: (...args: (string | number)[]) => string;
|
|
6
|
-
/**
|
|
7
|
-
* Join args with space
|
|
8
|
-
* @param args
|
|
9
|
-
*/
|
|
10
|
-
export declare const space: (...args: (string | number)[]) => string;
|
|
11
|
-
/**
|
|
12
|
-
* Join args with comma
|
|
13
|
-
* @param args
|
|
14
|
-
*/
|
|
15
|
-
export declare const comma: (...args: (string | number)[]) => string;
|
|
16
|
-
/**
|
|
17
|
-
* Put value in parentheses
|
|
18
|
-
* @param val
|
|
19
|
-
*/
|
|
20
|
-
export declare const parentheses: (val: string | number) => string;
|
|
21
|
-
/**
|
|
22
|
-
* Transformer
|
|
23
|
-
* @param target
|
|
24
|
-
* @param transform
|
|
25
|
-
*/
|
|
26
|
-
export declare const transformer: <K extends string, T extends (string | number), V extends (string | number)>(target: Record<K, T>, transform: (val: [string | number, T]) => [string | number, V]) => Record<K, V>;
|
|
27
|
-
/**
|
|
28
|
-
* Value transformer
|
|
29
|
-
* @param target
|
|
30
|
-
* @param transformVal
|
|
31
|
-
*/
|
|
32
|
-
export declare const valTransformer: <K extends string, T extends (string | number), V extends (string | number)>(target: Record<K, T>, handler: (val: T) => V) => Record<K, V>;
|
|
33
|
-
/**
|
|
34
|
-
* Constructs `attr(val)` expression
|
|
35
|
-
* @param val
|
|
36
|
-
*/
|
|
37
|
-
export declare const attr: (val: string | number) => string;
|
|
38
|
-
/**
|
|
39
|
-
* Constructs `url(val)` expression
|
|
40
|
-
* @param val
|
|
41
|
-
*/
|
|
42
|
-
export declare const url: (val: string | number) => string;
|
|
43
|
-
/**
|
|
44
|
-
* Add a string inside `calc(val)` expression
|
|
45
|
-
* @param val
|
|
46
|
-
*/
|
|
47
|
-
export declare const calcExp: (val: string) => string;
|
|
48
|
-
/**
|
|
49
|
-
* Constructs `@keyframes key` expression
|
|
50
|
-
* @param val
|
|
51
|
-
*/
|
|
52
|
-
export declare const atKeyframes: (val: string) => string;
|
|
53
|
-
/**
|
|
54
|
-
* Constructs `fitContent(val)` expression
|
|
55
|
-
* @param val
|
|
56
|
-
*/
|
|
57
|
-
export declare const fitContent: (val: string | number) => string;
|
|
58
|
-
/**
|
|
59
|
-
* Constructs `minmax(min, max)` expression
|
|
60
|
-
* @param val
|
|
61
|
-
*/
|
|
62
|
-
export declare const minmax: (min: string | number, max: string | number) => string;
|
|
63
|
-
/**
|
|
64
|
-
* Constructs `repeat(count, tracks)` expression
|
|
65
|
-
* @param val
|
|
66
|
-
*/
|
|
67
|
-
export declare const repeat: (count: string | number, tracks: string | number) => string;
|
|
68
|
-
/**
|
|
69
|
-
* Constructs `scale3d(val)` expression
|
|
70
|
-
* @param val
|
|
71
|
-
*/
|
|
72
|
-
export declare const scale3d: (val: string | number) => string;
|
|
73
|
-
/**
|
|
74
|
-
* Constructs `scaleX(val)` expression
|
|
75
|
-
* @param val
|
|
76
|
-
*/
|
|
77
|
-
export declare const scaleX: (val: string | number) => string;
|
|
78
|
-
/**
|
|
79
|
-
* Constructs `scaleY(val)` expression
|
|
80
|
-
* @param val
|
|
81
|
-
*/
|
|
82
|
-
export declare const scaleY: (val: string | number) => string;
|
|
83
|
-
/**
|
|
84
|
-
* Constructs `scaleZ(val)` expression
|
|
85
|
-
* @param val
|
|
86
|
-
*/
|
|
87
|
-
export declare const scaleZ: (val: string | number) => string;
|
|
88
|
-
/**
|
|
89
|
-
* Constructs `scale(val)` expression
|
|
90
|
-
* @param val
|
|
91
|
-
*/
|
|
92
|
-
export declare const scale: (val: string | number) => string;
|
|
93
|
-
/**
|
|
94
|
-
* Constructs `translate3d(x, y, z)` expression
|
|
95
|
-
* @param x
|
|
96
|
-
* @param y
|
|
97
|
-
* @param z
|
|
98
|
-
*/
|
|
99
|
-
export declare const translate3d: (x: string | number, y: string | number, z: string | number) => string;
|
|
100
|
-
/**
|
|
101
|
-
* Constructs `translateX(val)` expression
|
|
102
|
-
* @param val
|
|
103
|
-
*/
|
|
104
|
-
export declare const translateX: (val: string | number) => string;
|
|
105
|
-
/**
|
|
106
|
-
* Constructs `translateY(val)` expression
|
|
107
|
-
* @param val
|
|
108
|
-
*/
|
|
109
|
-
export declare const translateY: (val: string | number) => string;
|
|
110
|
-
/**
|
|
111
|
-
* Constructs `translateZ(val)` expression
|
|
112
|
-
* @param val
|
|
113
|
-
*/
|
|
114
|
-
export declare const translateZ: (val: string | number) => string;
|
|
115
|
-
/**
|
|
116
|
-
* Constructs `translate(x, y)` expression
|
|
117
|
-
* @param x
|
|
118
|
-
* @param y
|
|
119
|
-
*/
|
|
120
|
-
export declare const translate: (x: string | number, y: string | number) => string;
|
|
121
|
-
/**
|
|
122
|
-
* Constructs `rotate(val)` expression
|
|
123
|
-
* @param val
|
|
124
|
-
*/
|
|
125
|
-
export declare const rotate: (val: string | number) => string;
|
|
126
|
-
/**
|
|
127
|
-
* Constructs `rotateX(val)` expression
|
|
128
|
-
* @param val
|
|
129
|
-
*/
|
|
130
|
-
export declare const rotateX: (val: string | number) => string;
|
|
131
|
-
/**
|
|
132
|
-
* Constructs `rotateX(val)` expression
|
|
133
|
-
* @param val
|
|
134
|
-
*/
|
|
135
|
-
export declare const rotateY: (val: string | number) => string;
|
|
136
|
-
/**
|
|
137
|
-
* Constructs `rotateX(val)` expression
|
|
138
|
-
* @param val
|
|
139
|
-
*/
|
|
140
|
-
export declare const rotateZ: (val: string | number) => string;
|
|
141
|
-
/**
|
|
142
|
-
* Constructs `rotate3d(x, y, z)` expression
|
|
143
|
-
* @param x
|
|
144
|
-
* @param y
|
|
145
|
-
* @param z
|
|
146
|
-
* @param a
|
|
147
|
-
*/
|
|
148
|
-
export declare const rotate3d: (x: string | number, y: string | number, z: string | number, a: string | number) => string;
|
|
149
|
-
/**
|
|
150
|
-
* Constructs `skew(x, y)` expression
|
|
151
|
-
* @param x
|
|
152
|
-
* @param y
|
|
153
|
-
*/
|
|
154
|
-
export declare const skew: (x: string | number, y: string | number) => string;
|
|
155
|
-
/**
|
|
156
|
-
* Constructs `skewX(val)` expression
|
|
157
|
-
* @param val
|
|
158
|
-
*/
|
|
159
|
-
export declare const skewX: (val: string | number) => string;
|
|
160
|
-
/**
|
|
161
|
-
* Constructs `skewY(val)` expression
|
|
162
|
-
* @param val
|
|
163
|
-
*/
|
|
164
|
-
export declare const skewY: (val: string | number) => string;
|
|
165
|
-
/**
|
|
166
|
-
* Constructs `perspective(val)` expression
|
|
167
|
-
* @param val
|
|
168
|
-
*/
|
|
169
|
-
export declare const perspective: (val: string | number) => string;
|
|
170
|
-
/**
|
|
171
|
-
* Constructs `opacity(val)` expression
|
|
172
|
-
* @param val
|
|
173
|
-
*/
|
|
174
|
-
export declare const opacity: (val: string | number) => string;
|
|
175
|
-
/**
|
|
176
|
-
* Constructs `blur(val)` expression
|
|
177
|
-
* @param val
|
|
178
|
-
*/
|
|
179
|
-
export declare const blur: (val: string | number) => string;
|
|
180
|
-
/**
|
|
181
|
-
* Constructs `contrast(val)` expression
|
|
182
|
-
* @param val
|
|
183
|
-
*/
|
|
184
|
-
export declare const contrast: (val: string | number) => string;
|
|
185
|
-
/**
|
|
186
|
-
* Constructs `drop-shadow(val)` expression
|
|
187
|
-
* @param val
|
|
188
|
-
*/
|
|
189
|
-
export declare const dropShadow: (val: string | number) => string;
|
|
190
|
-
/**
|
|
191
|
-
* Constructs `saturate(val)` expression
|
|
192
|
-
* @param val
|
|
193
|
-
*/
|
|
194
|
-
export declare const saturate: (val: string | number) => string;
|
|
195
|
-
/**
|
|
196
|
-
* Constructs `invert(val)` expression
|
|
197
|
-
* @param val
|
|
198
|
-
*/
|
|
199
|
-
export declare const invert: (val: string | number) => string;
|
|
200
|
-
/**
|
|
201
|
-
* Constructs `sepia(val)` expression
|
|
202
|
-
* @param val
|
|
203
|
-
*/
|
|
204
|
-
export declare const sepia: (val: string | number) => string;
|
|
205
|
-
/**
|
|
206
|
-
* Constructs `hue-rotate(val)` expression
|
|
207
|
-
* @param val
|
|
208
|
-
*/
|
|
209
|
-
export declare const hueRotate: (val: string | number) => string;
|
|
210
|
-
/**
|
|
211
|
-
* Constructs `grayscale(val)` expression
|
|
212
|
-
* @param val
|
|
213
|
-
*/
|
|
214
|
-
export declare const grayscale: (val: string | number) => string;
|
|
215
|
-
/**
|
|
216
|
-
* Constructs `blur(val)` expression
|
|
217
|
-
* @param val
|
|
218
|
-
*/
|
|
219
|
-
export declare const brightness: (val: string | number) => string;
|
|
220
|
-
/**
|
|
221
|
-
* Constructs `oklch(from f l c h / alpha)` expression
|
|
222
|
-
* @param params
|
|
223
|
-
*/
|
|
224
|
-
export declare const oklchFrom: ({ f, l, c, h, a }: {
|
|
225
|
-
f: string;
|
|
226
|
-
l?: string | number;
|
|
227
|
-
c?: string | number;
|
|
228
|
-
h?: string | number;
|
|
229
|
-
a?: string | number;
|
|
230
|
-
}) => string;
|
|
231
|
-
/**
|
|
232
|
-
* Constructs `light-dark(val)` expression
|
|
233
|
-
* @param val
|
|
234
|
-
*/
|
|
235
|
-
export declare const lightDark: (l: string, d: string) => string;
|
|
236
|
-
/**
|
|
237
|
-
* Constructs `color-mix(m, c1 p1, c2, p2)` expression
|
|
238
|
-
* @param val
|
|
239
|
-
*/
|
|
240
|
-
export declare const colorMix: ({ m, c1, c2, p1, p2 }: {
|
|
241
|
-
m: string;
|
|
242
|
-
c1: string;
|
|
243
|
-
c2: string;
|
|
244
|
-
p1?: number;
|
|
245
|
-
p2?: number;
|
|
246
|
-
}) => string;
|
|
247
|
-
/**
|
|
248
|
-
* Constructs `prefers-color-scheme: key` expression
|
|
249
|
-
* @param params
|
|
250
|
-
*/
|
|
251
|
-
export declare const preferColorScheme: (val: string) => string;
|
|
252
|
-
/**
|
|
253
|
-
* Constructs `linear-gradient(val)` expression
|
|
254
|
-
* @param val
|
|
255
|
-
*/
|
|
256
|
-
export declare const linearGradient: (val: string | number) => string;
|
|
257
|
-
/**
|
|
258
|
-
* Constructs `radial-gradient(val)` expression
|
|
259
|
-
* @param val
|
|
260
|
-
*/
|
|
261
|
-
export declare const radialGradient: (val: string | number) => string;
|
|
262
|
-
/**
|
|
263
|
-
* Constructs `conic-gradient(val)` expression
|
|
264
|
-
* @param val
|
|
265
|
-
*/
|
|
266
|
-
export declare const conicGradient: (val: string | number) => string;
|
|
267
|
-
/**
|
|
268
|
-
* Constructs `val:active` expression
|
|
269
|
-
* @param val
|
|
270
|
-
*/
|
|
271
|
-
export declare const pseudoActive: (val: string) => string;
|
|
272
|
-
/**
|
|
273
|
-
* Constructs `val:focus` expression
|
|
274
|
-
* @param val
|
|
275
|
-
*/
|
|
276
|
-
export declare const pseudoFocus: (val: string) => string;
|
|
277
|
-
/**
|
|
278
|
-
* Constructs `val:hover` expression
|
|
279
|
-
* @param val
|
|
280
|
-
*/
|
|
281
|
-
export declare const pseudoHover: (val: string) => string;
|
|
282
|
-
/**
|
|
283
|
-
* Constructs `val:visited` expression
|
|
284
|
-
* @param val
|
|
285
|
-
*/
|
|
286
|
-
export declare const pseudoVisited: (val: string) => string;
|
|
287
|
-
/**
|
|
288
|
-
* Constructs `val:link` expression
|
|
289
|
-
* @param val
|
|
290
|
-
*/
|
|
291
|
-
export declare const pseudoLink: (val: string) => string;
|
|
292
|
-
/**
|
|
293
|
-
* Constructs `val::before` expression
|
|
294
|
-
* @param val
|
|
295
|
-
*/
|
|
296
|
-
export declare const pseudoBefore: (val?: string) => string;
|
|
297
|
-
/**
|
|
298
|
-
* Constructs `val::after` expression
|
|
299
|
-
* @param val
|
|
300
|
-
*/
|
|
301
|
-
export declare const pseudoAfter: (val?: string) => string;
|
|
302
|
-
/**
|
|
303
|
-
* Constructs `::part(val)` expression
|
|
304
|
-
* @param val
|
|
305
|
-
*/
|
|
306
|
-
export declare const pseudoPart: (val: string) => string;
|
|
307
|
-
/**
|
|
308
|
-
* Constructs `::slotted(val)` expression
|
|
309
|
-
* @param val
|
|
310
|
-
*/
|
|
311
|
-
export declare const pseudoSlotted: (val: string) => string;
|
|
312
|
-
/**
|
|
313
|
-
* Constructs `:has(val)` expression
|
|
314
|
-
* @param val
|
|
315
|
-
*/
|
|
316
|
-
export declare const pseudoHas: (val: string) => string;
|
|
317
|
-
/**
|
|
318
|
-
* Constructs `:is(val)` expression
|
|
319
|
-
* @param val
|
|
320
|
-
*/
|
|
321
|
-
export declare const pseudoIs: (val: string) => string;
|
|
322
|
-
/**
|
|
323
|
-
* Constructs `:not(val)` expression
|
|
324
|
-
* @param val
|
|
325
|
-
*/
|
|
326
|
-
export declare const pseudoNot: (val: string) => string;
|
|
327
|
-
/**
|
|
328
|
-
* Constructs `:nth-child(val)` expression
|
|
329
|
-
* @param val
|
|
330
|
-
*/
|
|
331
|
-
export declare const pseudoNthChild: (val: string) => string;
|
|
332
|
-
/**
|
|
333
|
-
* Constructs `:nth-of-type(val)` expression
|
|
334
|
-
* @param val
|
|
335
|
-
*/
|
|
336
|
-
export declare const pseudoNthOfType: (val: string) => string;
|
|
337
|
-
/**
|
|
338
|
-
* Constructs `:host(val)` expression
|
|
339
|
-
* @param val
|
|
340
|
-
*/
|
|
341
|
-
export declare const pseudoHost: (val: string) => string;
|
|
342
|
-
/**
|
|
343
|
-
* Constructs `:state(val)` expression
|
|
344
|
-
* @param val
|
|
345
|
-
*/
|
|
346
|
-
export declare const pseudoState: (val: string) => string;
|
|
347
|
-
/**
|
|
348
|
-
* Constructs `:where(val)` expression
|
|
349
|
-
* @param val
|
|
350
|
-
*/
|
|
351
|
-
export declare const pseudoWhere: (val: string) => string;
|
|
352
|
-
export declare const pseudoOddChild: () => string;
|
|
353
|
-
export declare const pseudoEvenChild: () => string;
|
|
354
|
-
/**
|
|
355
|
-
* Transform object values to `percents`
|
|
356
|
-
* @param params
|
|
357
|
-
*/
|
|
358
|
-
export declare const toPercent: <T extends string>(params?: Record<string | number, string | number>) => Record<T, string> | undefined;
|
|
359
|
-
/**
|
|
360
|
-
* Transform args to `percent` object
|
|
361
|
-
* @param params
|
|
362
|
-
*/
|
|
363
|
-
export declare const argsToPercent: <T extends number>(...args: T[]) => Record<T, string>;
|
|
364
|
-
/**
|
|
365
|
-
* Transform object values to `rem`s
|
|
366
|
-
* @param params
|
|
367
|
-
*/
|
|
368
|
-
export declare const toRem: <T extends string>(params?: Record<string | number, string | number>) => Record<T, string> | undefined;
|
|
369
|
-
/**
|
|
370
|
-
* Transform object values to `ms`s
|
|
371
|
-
* @param params
|
|
372
|
-
*/
|
|
373
|
-
export declare const toMs: <T extends string>(params?: Record<string | number, string | number>) => Record<T, string> | undefined;
|
|
374
|
-
/**
|
|
375
|
-
* Transform object values to `px`s
|
|
376
|
-
* @param params
|
|
377
|
-
*/
|
|
378
|
-
export declare const toPx: <T extends string>(params?: Record<string | number, string | number>) => Record<T, string> | undefined;
|
|
379
|
-
/**
|
|
380
|
-
* Transform object values to `deg`s
|
|
381
|
-
* @param params
|
|
382
|
-
*/
|
|
383
|
-
export declare const toDeg: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
384
|
-
/**
|
|
385
|
-
* Transform object values to `vw`s
|
|
386
|
-
* @param params
|
|
387
|
-
*/
|
|
388
|
-
export declare const toVw: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
389
|
-
/**
|
|
390
|
-
* Transform object values to `vh`s
|
|
391
|
-
* @param params
|
|
392
|
-
*/
|
|
393
|
-
export declare const toVh: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
394
|
-
/**
|
|
395
|
-
* Transform object values to `vmin`s
|
|
396
|
-
* @param params
|
|
397
|
-
*/
|
|
398
|
-
export declare const toVmin: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
399
|
-
/**
|
|
400
|
-
* Transform object values to `vmax`s
|
|
401
|
-
* @param params
|
|
402
|
-
*/
|
|
403
|
-
export declare const toVmax: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
404
|
-
/**
|
|
405
|
-
* Transform object values to `cqb`s
|
|
406
|
-
* @param params
|
|
407
|
-
*/
|
|
408
|
-
export declare const toCqb: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
409
|
-
/**
|
|
410
|
-
* Transform object values to `cqi`s
|
|
411
|
-
* @param params
|
|
412
|
-
*/
|
|
413
|
-
export declare const toCqi: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
414
|
-
/**
|
|
415
|
-
* Transform object values to `cqw`s
|
|
416
|
-
* @param params
|
|
417
|
-
*/
|
|
418
|
-
export declare const toCqw: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
419
|
-
/**
|
|
420
|
-
* Transform object values to `cqh`s
|
|
421
|
-
* @param params
|
|
422
|
-
*/
|
|
423
|
-
export declare const toCqh: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
424
|
-
/**
|
|
425
|
-
* Transform object values to `cqmin`s
|
|
426
|
-
* @param params
|
|
427
|
-
*/
|
|
428
|
-
export declare const toCqmin: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
429
|
-
/**
|
|
430
|
-
* Transform object values to `cqmax`s
|
|
431
|
-
* @param params
|
|
432
|
-
*/
|
|
433
|
-
export declare const toCqmax: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
434
|
-
/**
|
|
435
|
-
* Transform object values to `span`s
|
|
436
|
-
* @param params
|
|
437
|
-
*/
|
|
438
|
-
export declare const toSpan: <T extends string | number>(params?: Record<T, string | number>) => Record<T, string> | undefined;
|
|
439
|
-
/**
|
|
440
|
-
* Transform args to `deg` object
|
|
441
|
-
* @param params
|
|
442
|
-
*/
|
|
443
|
-
export declare const argsToDeg: <T extends number>(...args: T[]) => Record<T, string>;
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { IStyleConfig, IStyleDispatcher, IStyleProvider, TGetBEMResolver, TKeyGenerator, TStyleSheetConfig } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Prefix which will be used for autogenerated
|
|
4
|
-
* - variable names;
|
|
5
|
-
* - keyframes names;
|
|
6
|
-
* - stylesheet keys.
|
|
7
|
-
*/
|
|
8
|
-
export declare const PREFIX = "eff";
|
|
9
|
-
/**
|
|
10
|
-
* Id for special script element,
|
|
11
|
-
* which contains initial style config
|
|
12
|
-
*/
|
|
13
|
-
export declare const SETTINGS_ID = "effcss";
|
|
14
|
-
/**
|
|
15
|
-
* Name of the custom style provider element
|
|
16
|
-
*/
|
|
17
|
-
export declare const COMPONENT_NAME = "style-provider";
|
|
18
|
-
/**
|
|
19
|
-
* Create settings script element
|
|
20
|
-
* @param settings - settings object
|
|
21
|
-
* @param params - params for settings element
|
|
22
|
-
* @see {@link IStyleConfig}
|
|
23
|
-
*/
|
|
24
|
-
export declare const createSettingsElement: (settings: IStyleConfig, params?: {
|
|
25
|
-
/**
|
|
26
|
-
* Settings element id
|
|
27
|
-
* @defaultValue
|
|
28
|
-
* @see {@link SETTINGS_ID}
|
|
29
|
-
*/
|
|
30
|
-
id: string;
|
|
31
|
-
}) => Node;
|
|
32
|
-
/**
|
|
33
|
-
* Create settings HTML string
|
|
34
|
-
* @param settings - settings object
|
|
35
|
-
* @param params - params for settings element
|
|
36
|
-
* @see {@link IStyleConfig}
|
|
37
|
-
*/
|
|
38
|
-
export declare const createSettingsHTML: (settings: IStyleConfig, params?: {
|
|
39
|
-
/**
|
|
40
|
-
* Settings element id
|
|
41
|
-
* @defaultValue
|
|
42
|
-
* @see {@link SETTINGS_ID}
|
|
43
|
-
*/
|
|
44
|
-
id: string;
|
|
45
|
-
}) => string;
|
|
46
|
-
/**
|
|
47
|
-
* Get style provider component
|
|
48
|
-
* @param root - style provider scope
|
|
49
|
-
* @description
|
|
50
|
-
* Use this function to get the first provider element found in the document
|
|
51
|
-
* @see {@link IStyleProvider}
|
|
52
|
-
*/
|
|
53
|
-
export declare const getProvider: (root?: Document, name?: string) => IStyleProvider;
|
|
54
|
-
/**
|
|
55
|
-
* Compile stylesheet
|
|
56
|
-
* @param key - stylesheet key
|
|
57
|
-
* @param config - stylesheet config
|
|
58
|
-
* @param provider - style provider
|
|
59
|
-
* @see {@link IStyleProvider}
|
|
60
|
-
*/
|
|
61
|
-
export declare const compileStyleSheet: (key: string, config: TStyleSheetConfig, provider?: IStyleProvider) => boolean | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Use stylesheet
|
|
64
|
-
* @param config - stylesheet config
|
|
65
|
-
* @param provider - style provider
|
|
66
|
-
* @see {@link IStyleProvider}
|
|
67
|
-
*/
|
|
68
|
-
export declare const useStyleSheet: (config: TStyleSheetConfig, provider?: IStyleProvider) => (e?: string) => (m?: string | object) => Record<string, string>;
|
|
69
|
-
/**
|
|
70
|
-
* Expand stylesheet
|
|
71
|
-
* @param key - stylesheet key
|
|
72
|
-
* @param config - stylesheet config
|
|
73
|
-
* @param provider - style provider
|
|
74
|
-
* @see {@link IStyleProvider}
|
|
75
|
-
*/
|
|
76
|
-
export declare const expandStyleSheet: (key: string, config: string[], provider?: IStyleProvider) => number | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Process styles
|
|
79
|
-
* @param styles - stylesheet dictionary
|
|
80
|
-
* @param ext - extra rules config
|
|
81
|
-
* @param provider - style provider
|
|
82
|
-
* @see {@link IStyleProvider}
|
|
83
|
-
*/
|
|
84
|
-
export declare const processStyles: (styles?: Record<string, TStyleSheetConfig>, ext?: Record<string, string[]>, provider?: IStyleProvider) => void;
|
|
85
|
-
/**
|
|
86
|
-
* Resolve stylesheet
|
|
87
|
-
* @param key stylesheet key
|
|
88
|
-
* @param provider - style provider
|
|
89
|
-
* @see {@link IStyleProvider}
|
|
90
|
-
*/
|
|
91
|
-
export declare const resolveStyleSheet: (key: string, provider?: IStyleProvider) => (e?: string) => (m?: string | object) => Record<string, string>;
|
|
92
|
-
/**
|
|
93
|
-
* Get stylesheet from provider
|
|
94
|
-
* @param key - stylesheet key
|
|
95
|
-
* @param provider - style provider
|
|
96
|
-
* @see {@link IStyleProvider}
|
|
97
|
-
*/
|
|
98
|
-
export declare const getStyleSheet: (key: string, provider?: IStyleProvider) => CSSStyleSheet | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* Add stylesheet to provider
|
|
101
|
-
* @param key - stylesheet key
|
|
102
|
-
* @param provider - style provider
|
|
103
|
-
* @see {@link IStyleProvider}
|
|
104
|
-
*/
|
|
105
|
-
export declare const addStyleSheet: (key: string, stylesheet: CSSStyleSheet, provider?: IStyleProvider) => true | void;
|
|
106
|
-
/**
|
|
107
|
-
* Remove stylesheet from provider
|
|
108
|
-
* @param key - stylesheet key
|
|
109
|
-
* @param provider - style provider
|
|
110
|
-
* @see {@link IStyleProvider}
|
|
111
|
-
*/
|
|
112
|
-
export declare const removeStyleSheet: (key: string, provider?: IStyleProvider) => true | void;
|
|
113
|
-
/**
|
|
114
|
-
* Stringify stylesheet
|
|
115
|
-
* @param key - stylesheet key
|
|
116
|
-
* @param provider - style provider
|
|
117
|
-
* @see {@link IStyleProvider}
|
|
118
|
-
*/
|
|
119
|
-
export declare const stringifyStyleSheet: (key: string, provider?: IStyleProvider) => string;
|
|
120
|
-
/**
|
|
121
|
-
* Get all stylesheets
|
|
122
|
-
* @param provider - style provider
|
|
123
|
-
* @see {@link IStyleProvider}
|
|
124
|
-
*/
|
|
125
|
-
export declare const stringifyAllStyles: (provider?: IStyleProvider) => string;
|
|
126
|
-
/**
|
|
127
|
-
* Get rules count for stylesheet
|
|
128
|
-
* @param key - stylesheet key
|
|
129
|
-
* @param provider - style provider
|
|
130
|
-
* @see {@link IStyleProvider}
|
|
131
|
-
*/
|
|
132
|
-
export declare const getRulesCount: (key: string, provider?: IStyleProvider) => number;
|
|
133
|
-
/**
|
|
134
|
-
* Get total rules count
|
|
135
|
-
* @param provider - style provider
|
|
136
|
-
* @see {@link IStyleProvider}
|
|
137
|
-
*/
|
|
138
|
-
export declare const getTotalRulesCount: (provider?: IStyleProvider) => number;
|
|
139
|
-
/**
|
|
140
|
-
* Generate stylesheet key
|
|
141
|
-
* @param configs - current stylesheet configs
|
|
142
|
-
*/
|
|
143
|
-
export declare const generateStyleSheetKey: TKeyGenerator;
|
|
144
|
-
/**
|
|
145
|
-
* BEM resolver
|
|
146
|
-
* @param params - BEM resolver params
|
|
147
|
-
*/
|
|
148
|
-
export declare const getBEMResolver: TGetBEMResolver;
|
|
149
|
-
/**
|
|
150
|
-
* Basic class for manipulating stylesheets
|
|
151
|
-
*/
|
|
152
|
-
export declare class StyleDispatcher implements IStyleDispatcher {
|
|
153
|
-
/**
|
|
154
|
-
* Dispatcher root element
|
|
155
|
-
* @description
|
|
156
|
-
* Scope where style provider will be searched for
|
|
157
|
-
*/
|
|
158
|
-
root: Document;
|
|
159
|
-
/**
|
|
160
|
-
* Style provider
|
|
161
|
-
*/
|
|
162
|
-
provider: IStyleProvider;
|
|
163
|
-
construstor(root?: Document): void;
|
|
164
|
-
/**
|
|
165
|
-
* Use stylesheet
|
|
166
|
-
* @param config - stylesheet config
|
|
167
|
-
* @see {@link useStyleSheet}
|
|
168
|
-
*/
|
|
169
|
-
use: (config: TStyleSheetConfig) => (e?: string) => (m?: string | object) => Record<string, string>;
|
|
170
|
-
/**
|
|
171
|
-
* Compile stylesheet
|
|
172
|
-
* @param key - stylesheet key
|
|
173
|
-
* @param config - stylesheet config
|
|
174
|
-
* @see {@link compileStyleSheet}
|
|
175
|
-
*/
|
|
176
|
-
compile: (key: string, config: TStyleSheetConfig) => boolean | undefined;
|
|
177
|
-
/**
|
|
178
|
-
* Expand stylesheet
|
|
179
|
-
* @param key - stylesheet key
|
|
180
|
-
* @param config - stylesheet config
|
|
181
|
-
* @see {@link expandStyleSheet}
|
|
182
|
-
*/
|
|
183
|
-
expand: (key: string, config: string[]) => number | undefined;
|
|
184
|
-
/**
|
|
185
|
-
* Process styles
|
|
186
|
-
* @param styles - stylesheet dictionary
|
|
187
|
-
* @param ext - stylesheet extra rules
|
|
188
|
-
* @see {@link processStyles}
|
|
189
|
-
*/
|
|
190
|
-
process: (styles?: Record<string, TStyleSheetConfig>, ext?: Record<string, string[]>) => void;
|
|
191
|
-
/**
|
|
192
|
-
* Resolve stylesheet
|
|
193
|
-
* @param key - stylesheet key
|
|
194
|
-
* @see {@link resolveStyleSheet}
|
|
195
|
-
*/
|
|
196
|
-
resolve: (key: string) => (e?: string) => (m?: string | object) => Record<string, string>;
|
|
197
|
-
}
|
package/dist/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=e=>"object"==typeof e,t="eff",r="effcss",i="style-provider",o=(e,t)=>{const i=JSON.stringify(e),o=(null==t?void 0:t.id)||r,n=document.createElement("script");return n.id=o,n.type="application/json",n.innerHTML=i,n},n=(e,t)=>{const i=JSON.stringify(e);return`<script id="${(null==t?void 0:t.id)||r}" type="application/json">${i}<\/script>`},s=(e=document,t=i)=>{var r;return null===(r=e.getElementsByTagName(t))||void 0===r?void 0:r[0]},l=(e,t,r=s())=>r.compileStyleSheet(e,t),d=(e,t=s())=>t.useStyleSheet(e),v=(e,t,r=s())=>r.expandStyleSheet(e,t),u=(e,t,r=s())=>r.processStyles(e,t),a=(e,t=s())=>t.resolveStyleSheet(e),c=(e,t=s())=>{var r;return null===(r=null==t?void 0:t.manager)||void 0===r?void 0:r.get(e)},p=(e,t,r=s())=>{var i;return null===(i=null==r?void 0:r.manager)||void 0===i?void 0:i.add(e,t)},m=(e,t=s())=>{var r;return null===(r=null==t?void 0:t.manager)||void 0===r?void 0:r.remove(e)},h=(e,t=s())=>{var r;return[...(null===(r=c(e,t))||void 0===r?void 0:r.cssRules)||[]].map((e=>e.cssText)).join("")},g=(e=s())=>{var t;return Object.keys((null===(t=null==e?void 0:e.manager)||void 0===t?void 0:t.getAll())||{}).map((t=>h(t,e))).join("")},y=(e,t=s())=>{var r;return function e(t){return t?t.length+[...t].reduce(((t,r)=>t+e(null==r?void 0:r.cssRules)),0):0}(null===(r=c(e,t))||void 0===r?void 0:r.cssRules)},j=(e=s())=>{var t;return Object.keys((null===(t=null==e?void 0:e.manager)||void 0===t?void 0:t.getAll())||{}).reduce(((t,r)=>t+y(r,e)),0)},S=e=>e.size.toString(36),f=t=>{const r=e=>Object.entries(e).reduce(((e,[t,r])=>(void 0!==r&&e.push(t+(r?"-"+r:"")),e)),[]).join(" "),i=(e,t)=>Object.defineProperties({[e]:t},{k:{value:e},v:{value:t}});return"c"===t.mode?{selector:({b:e,e:t,m:r,mv:i,s:o})=>`.${e}${(t?"__"+t:"")+(r?"_"+r:"")+(r&&i?"_"+i:"")+(o?":"+o:"")}`,attr:t=>o=>n=>{let s=n||"";e(s)&&(s=r(s));const l=t+(o?"__"+o:"");return s=l+(s?" "+(null==s?void 0:s.split(" ").map((e=>l+"_"+e.split("-").join("_"))).join(" ")):""),i("class",s)}}:{selector:({b:e,e:t,m:r,mv:i,s:o})=>`[data-${e}${t?"-"+t:""}${r||o?'~="'+(r||"")+(i?"-"+i:"")+(o?":"+o:"")+'"':""}]`,attr:t=>o=>n=>{const s=`data-${t}${o?"-"+o:""}`;let l=n||"";return e(l)&&(l=r(l)),i(s,l)}}};class ${constructor(){this.root=document,this.use=e=>d(e,this.provider),this.compile=(e,t)=>l(e,t,this.provider),this.expand=(e,t)=>v(e,t,this.provider),this.process=(e,t)=>u(e,t,this.provider),this.resolve=e=>a(e,this.provider)}construstor(e){e&&(this.root=e),this.provider=s(this.root)}}export{i as COMPONENT_NAME,t as PREFIX,r as SETTINGS_ID,$ as StyleDispatcher,p as addStyleSheet,l as compileStyleSheet,o as createSettingsElement,n as createSettingsHTML,v as expandStyleSheet,S as generateStyleSheetKey,f as getBEMResolver,s as getProvider,y as getRulesCount,c as getStyleSheet,j as getTotalRulesCount,u as processStyles,m as removeStyleSheet,a as resolveStyleSheet,g as stringifyAllStyles,h as stringifyStyleSheet,d as useStyleSheet};
|