flinker-dom 1.1.10 → 1.1.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/dist/esm/core.js +1 -0
- package/dist/esm/processor.js +9 -9
- package/dist/types/core.d.ts +1 -0
- package/dist/types/processor.d.ts +4 -3
- package/package.json +1 -1
package/dist/esm/core.js
CHANGED
|
@@ -115,6 +115,7 @@ const RuleBuilder = () => {
|
|
|
115
115
|
operator.borderRight = (value) => { setValue('border-right', Array.isArray(value) ? value.join(' ') : value); };
|
|
116
116
|
operator.borderTop = (value) => { setValue('border-top', Array.isArray(value) ? value.join(' ') : value); };
|
|
117
117
|
operator.borderBottom = (value) => { setValue('border-bottom', Array.isArray(value) ? value.join(' ') : value); };
|
|
118
|
+
operator.content = (value) => { setValue('content', value); };
|
|
118
119
|
operator.cornerRadius = (value) => { setValue('border-radius', value); };
|
|
119
120
|
operator.opacity = (value) => { setValue('opacity', value); };
|
|
120
121
|
operator.shadow = (value) => { setValue('box-shadow', value); };
|
package/dist/esm/processor.js
CHANGED
|
@@ -17,6 +17,7 @@ const abbreviations = {
|
|
|
17
17
|
'box-shadow': 'BS',
|
|
18
18
|
'caret-color': 'CC',
|
|
19
19
|
'color': 'C',
|
|
20
|
+
'content': 'CO',
|
|
20
21
|
'cursor': 'CU',
|
|
21
22
|
'display': 'D',
|
|
22
23
|
'flex-direction': 'F',
|
|
@@ -70,19 +71,19 @@ const abbreviations = {
|
|
|
70
71
|
'user-select': 'U',
|
|
71
72
|
'z-index': 'Z'
|
|
72
73
|
};
|
|
74
|
+
const pseudoClasses = ['none', ':hover', ':focus', ':link', ':visited', ':active', '::placeholder', '::before'];
|
|
73
75
|
export class StyleSheetProcessor {
|
|
74
76
|
constructor(styleSheet) {
|
|
75
77
|
this.hash = new Map();
|
|
76
78
|
this.list = Array.of();
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (t === 'hover') {
|
|
79
|
+
pseudoClasses.forEach(t => {
|
|
80
|
+
if (t === ':hover') {
|
|
80
81
|
const pc = new HoverPseudoClass(styleSheet);
|
|
81
|
-
this.hash.set('hover', pc);
|
|
82
|
+
this.hash.set(':hover', pc);
|
|
82
83
|
this.list.push(pc);
|
|
83
84
|
}
|
|
84
85
|
else {
|
|
85
|
-
const pc = new PseudoClass(t, styleSheet
|
|
86
|
+
const pc = new PseudoClass(t, styleSheet);
|
|
86
87
|
this.hash.set(t, pc);
|
|
87
88
|
this.list.push(pc);
|
|
88
89
|
}
|
|
@@ -108,16 +109,15 @@ export class StyleSheetProcessor {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
export class PseudoClass {
|
|
111
|
-
constructor(type, styleSheet
|
|
112
|
+
constructor(type, styleSheet) {
|
|
112
113
|
this.type = type;
|
|
113
114
|
this.styleSheet = styleSheet;
|
|
114
115
|
this.style = '';
|
|
115
116
|
this.hashSum = '';
|
|
116
|
-
this.divider = divider;
|
|
117
117
|
}
|
|
118
118
|
insertRule(className, tag) {
|
|
119
119
|
if (this.style) {
|
|
120
|
-
const rule = tag + '.' + className + (this.type === 'none' ? '' : this.
|
|
120
|
+
const rule = tag + '.' + className + (this.type === 'none' ? '' : this.type) + '{' + this.style + '}';
|
|
121
121
|
this.styleSheet.insertRule(rule);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -142,7 +142,7 @@ export class PseudoClass {
|
|
|
142
142
|
}
|
|
143
143
|
class HoverPseudoClass extends PseudoClass {
|
|
144
144
|
constructor(styleSheet) {
|
|
145
|
-
super('hover', styleSheet);
|
|
145
|
+
super(':hover', styleSheet);
|
|
146
146
|
this.isMobileDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0);
|
|
147
147
|
}
|
|
148
148
|
insertRule(className, tag) {
|
package/dist/types/core.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export interface UIComponentProps {
|
|
|
28
28
|
children?: any;
|
|
29
29
|
className?: string;
|
|
30
30
|
cornerRadius?: string;
|
|
31
|
+
content?: string;
|
|
31
32
|
cursor?: 'auto' | 'pointer' | 'wait' | 'crosshair' | 'not-allowed' | 'zoom-in' | 'grab' | 'inherit';
|
|
32
33
|
disableHorizontalScroll?: boolean;
|
|
33
34
|
disableScroll?: boolean;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type RulePriority } from './core';
|
|
2
|
+
declare const pseudoClasses: readonly ["none", ":hover", ":focus", ":link", ":visited", ":active", "::placeholder", "::before"];
|
|
3
|
+
export type PseudoClassType = typeof pseudoClasses[number];
|
|
2
4
|
export declare class StyleSheetProcessor {
|
|
3
5
|
private readonly hash;
|
|
4
6
|
private readonly list;
|
|
@@ -8,16 +10,15 @@ export declare class StyleSheetProcessor {
|
|
|
8
10
|
insertRule(className: string, tag: string): void;
|
|
9
11
|
clearValues(): void;
|
|
10
12
|
}
|
|
11
|
-
export type PseudoClassType = 'none' | 'hover' | 'focus' | 'placeholder';
|
|
12
13
|
export declare class PseudoClass {
|
|
13
14
|
readonly type: PseudoClassType;
|
|
14
15
|
readonly styleSheet: CSSStyleSheet;
|
|
15
16
|
style: string;
|
|
16
17
|
hashSum: string;
|
|
17
|
-
|
|
18
|
-
constructor(type: PseudoClassType, styleSheet: CSSStyleSheet, divider?: string);
|
|
18
|
+
constructor(type: PseudoClassType, styleSheet: CSSStyleSheet);
|
|
19
19
|
insertRule(className: string, tag: string): void;
|
|
20
20
|
setValue(key: string, value: string, priority: RulePriority, appendToClassName?: boolean): void;
|
|
21
21
|
isEmpty(): boolean;
|
|
22
22
|
clear(): void;
|
|
23
23
|
}
|
|
24
|
+
export {};
|