@abcagency/hc-ui-components 1.8.3 → 1.8.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/dist/components/HireControlMap.js +5 -16
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/containers/maps/map-container.js +12 -8
- package/dist/components/containers/maps/map-container.js.map +1 -1
- package/dist/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +52 -0
- package/dist/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js.map +1 -0
- package/dist/node_modules/react-loader-spinner/dist/index.js +90 -0
- package/dist/node_modules/react-loader-spinner/dist/index.js.map +1 -0
- package/dist/node_modules/styled-components/dist/styled-components.browser.esm.js +13 -0
- package/dist/node_modules/styled-components/dist/styled-components.browser.esm.js.map +1 -0
- package/dist/node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js +16 -0
- package/dist/node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js.map +1 -0
- package/dist/node_modules/styled-components/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +10 -0
- package/dist/node_modules/styled-components/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js.map +1 -0
- package/dist/node_modules/stylis/src/Enum.js +13 -0
- package/dist/node_modules/stylis/src/Enum.js.map +1 -0
- package/dist/node_modules/stylis/src/Middleware.js +76 -0
- package/dist/node_modules/stylis/src/Middleware.js.map +1 -0
- package/dist/node_modules/stylis/src/Parser.js +197 -0
- package/dist/node_modules/stylis/src/Parser.js.map +1 -0
- package/dist/node_modules/stylis/src/Prefixer.js +148 -0
- package/dist/node_modules/stylis/src/Prefixer.js.map +1 -0
- package/dist/node_modules/stylis/src/Serializer.js +38 -0
- package/dist/node_modules/stylis/src/Serializer.js.map +1 -0
- package/dist/node_modules/stylis/src/Tokenizer.js +235 -0
- package/dist/node_modules/stylis/src/Tokenizer.js.map +1 -0
- package/dist/node_modules/stylis/src/Utility.js +128 -0
- package/dist/node_modules/stylis/src/Utility.js.map +1 -0
- package/dist/node_modules/tinycolor2/esm/tinycolor.js +174 -0
- package/dist/node_modules/tinycolor2/esm/tinycolor.js.map +1 -0
- package/dist/node_modules/tslib/tslib.es6.js +45 -0
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/styles/index.css +1 -1
- package/package.json +2 -1
- package/src/components/HireControlMap.js +2 -10
- package/src/components/containers/maps/map-container.js +12 -5
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { RULESET, KEYFRAMES, DECLARATION, WEBKIT, MOZ, MS } from './Enum.js';
|
|
2
|
+
import { combine, replace, sizeof, match, assign, filter } from './Utility.js';
|
|
3
|
+
import { copy, lift } from './Tokenizer.js';
|
|
4
|
+
import { serialize } from './Serializer.js';
|
|
5
|
+
import { prefix } from './Prefixer.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {function[]} collection
|
|
9
|
+
* @return {function}
|
|
10
|
+
*/
|
|
11
|
+
function middleware (collection) {
|
|
12
|
+
var length = sizeof(collection);
|
|
13
|
+
|
|
14
|
+
return function (element, index, children, callback) {
|
|
15
|
+
var output = '';
|
|
16
|
+
|
|
17
|
+
for (var i = 0; i < length; i++)
|
|
18
|
+
output += collection[i](element, index, children, callback) || '';
|
|
19
|
+
|
|
20
|
+
return output
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {function} callback
|
|
26
|
+
* @return {function}
|
|
27
|
+
*/
|
|
28
|
+
function rulesheet (callback) {
|
|
29
|
+
return function (element) {
|
|
30
|
+
if (!element.root)
|
|
31
|
+
if (element = element.return)
|
|
32
|
+
callback(element);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {object} element
|
|
38
|
+
* @param {number} index
|
|
39
|
+
* @param {object[]} children
|
|
40
|
+
* @param {function} callback
|
|
41
|
+
*/
|
|
42
|
+
function prefixer (element, index, children, callback) {
|
|
43
|
+
if (element.length > -1)
|
|
44
|
+
if (!element.return)
|
|
45
|
+
switch (element.type) {
|
|
46
|
+
case DECLARATION: element.return = prefix(element.value, element.length, children);
|
|
47
|
+
return
|
|
48
|
+
case KEYFRAMES:
|
|
49
|
+
return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
|
|
50
|
+
case RULESET:
|
|
51
|
+
if (element.length)
|
|
52
|
+
return combine(children = element.props, function (value) {
|
|
53
|
+
switch (match(value, callback = /(::plac\w+|:read-\w+)/)) {
|
|
54
|
+
// :read-(only|write)
|
|
55
|
+
case ':read-only': case ':read-write':
|
|
56
|
+
lift(copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]}));
|
|
57
|
+
lift(copy(element, {props: [value]}));
|
|
58
|
+
assign(element, {props: filter(children, callback)});
|
|
59
|
+
break
|
|
60
|
+
// :placeholder
|
|
61
|
+
case '::placeholder':
|
|
62
|
+
lift(copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}));
|
|
63
|
+
lift(copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}));
|
|
64
|
+
lift(copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]}));
|
|
65
|
+
lift(copy(element, {props: [value]}));
|
|
66
|
+
assign(element, {props: filter(children, callback)});
|
|
67
|
+
break
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return ''
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { middleware, prefixer, rulesheet };
|
|
76
|
+
//# sourceMappingURL=Middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Middleware.js","sources":["../../../../node_modules/stylis/src/Middleware.js"],"sourcesContent":["import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine, filter, assign} from './Utility.js'\nimport {copy, lift, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(children = element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, callback = /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]}))\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [value]}))\n\t\t\t\t\t\t\t\t\tassign(element, {props: filter(children, callback)})\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}))\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}))\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]}))\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [value]}))\n\t\t\t\t\t\t\t\t\tassign(element, {props: filter(children, callback)})\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t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;AACvF,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,EAAC;AACtF,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAC;AAC9C,SAAS,MAAM,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAC;AAC7D,SAAS,KAAK;AACd,QAAQ;AACR;AACA,OAAO,OAAO,EAAE;AAChB,OAAO,CAAC;AACR,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { COMMENT, DECLARATION, RULESET } from './Enum.js';
|
|
2
|
+
import { strlen, append, charat, replace, indexof, abs, sizeof, substr, trim, from } from './Utility.js';
|
|
3
|
+
import { dealloc, alloc, next, peek, delimit, identifier, commenter, escaping, whitespace, node, char, prev, caret } from './Tokenizer.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {string} value
|
|
7
|
+
* @return {object[]}
|
|
8
|
+
*/
|
|
9
|
+
function compile (value) {
|
|
10
|
+
return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} value
|
|
15
|
+
* @param {object} root
|
|
16
|
+
* @param {object?} parent
|
|
17
|
+
* @param {string[]} rule
|
|
18
|
+
* @param {string[]} rules
|
|
19
|
+
* @param {string[]} rulesets
|
|
20
|
+
* @param {number[]} pseudo
|
|
21
|
+
* @param {number[]} points
|
|
22
|
+
* @param {string[]} declarations
|
|
23
|
+
* @return {object}
|
|
24
|
+
*/
|
|
25
|
+
function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
26
|
+
var index = 0;
|
|
27
|
+
var offset = 0;
|
|
28
|
+
var length = pseudo;
|
|
29
|
+
var atrule = 0;
|
|
30
|
+
var property = 0;
|
|
31
|
+
var previous = 0;
|
|
32
|
+
var variable = 1;
|
|
33
|
+
var scanning = 1;
|
|
34
|
+
var ampersand = 1;
|
|
35
|
+
var character = 0;
|
|
36
|
+
var type = '';
|
|
37
|
+
var props = rules;
|
|
38
|
+
var children = rulesets;
|
|
39
|
+
var reference = rule;
|
|
40
|
+
var characters = type;
|
|
41
|
+
|
|
42
|
+
while (scanning)
|
|
43
|
+
switch (previous = character, character = next()) {
|
|
44
|
+
// (
|
|
45
|
+
case 40:
|
|
46
|
+
if (previous != 108 && charat(characters, length - 1) == 58) {
|
|
47
|
+
if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f', abs(index ? points[index - 1] : 0)) != -1)
|
|
48
|
+
ampersand = -1;
|
|
49
|
+
break
|
|
50
|
+
}
|
|
51
|
+
// " ' [
|
|
52
|
+
case 34: case 39: case 91:
|
|
53
|
+
characters += delimit(character);
|
|
54
|
+
break
|
|
55
|
+
// \t \n \r \s
|
|
56
|
+
case 9: case 10: case 13: case 32:
|
|
57
|
+
characters += whitespace(previous);
|
|
58
|
+
break
|
|
59
|
+
// \
|
|
60
|
+
case 92:
|
|
61
|
+
characters += escaping(caret() - 1, 7);
|
|
62
|
+
continue
|
|
63
|
+
// /
|
|
64
|
+
case 47:
|
|
65
|
+
switch (peek()) {
|
|
66
|
+
case 42: case 47:
|
|
67
|
+
append(comment(commenter(next(), caret()), root, parent, declarations), declarations);
|
|
68
|
+
break
|
|
69
|
+
default:
|
|
70
|
+
characters += '/';
|
|
71
|
+
}
|
|
72
|
+
break
|
|
73
|
+
// {
|
|
74
|
+
case 123 * variable:
|
|
75
|
+
points[index++] = strlen(characters) * ampersand;
|
|
76
|
+
// } ; \0
|
|
77
|
+
case 125 * variable: case 59: case 0:
|
|
78
|
+
switch (character) {
|
|
79
|
+
// \0 }
|
|
80
|
+
case 0: case 125: scanning = 0;
|
|
81
|
+
// ;
|
|
82
|
+
case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '');
|
|
83
|
+
if (property > 0 && (strlen(characters) - length))
|
|
84
|
+
append(property > 32 ? declaration(characters + ';', rule, parent, length - 1, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), declarations);
|
|
85
|
+
break
|
|
86
|
+
// @ ;
|
|
87
|
+
case 59: characters += ';';
|
|
88
|
+
// { rule/at-rule
|
|
89
|
+
default:
|
|
90
|
+
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets);
|
|
91
|
+
|
|
92
|
+
if (character === 123)
|
|
93
|
+
if (offset === 0)
|
|
94
|
+
parse(characters, root, reference, reference, props, rulesets, length, points, children);
|
|
95
|
+
else
|
|
96
|
+
switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
|
|
97
|
+
// d l m s
|
|
98
|
+
case 100: case 108: case 109: case 115:
|
|
99
|
+
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children);
|
|
100
|
+
break
|
|
101
|
+
default:
|
|
102
|
+
parse(characters, reference, reference, reference, [''], children, 0, points, children);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
|
|
107
|
+
break
|
|
108
|
+
// :
|
|
109
|
+
case 58:
|
|
110
|
+
length = 1 + strlen(characters), property = previous;
|
|
111
|
+
default:
|
|
112
|
+
if (variable < 1)
|
|
113
|
+
if (character == 123)
|
|
114
|
+
--variable;
|
|
115
|
+
else if (character == 125 && variable++ == 0 && prev() == 125)
|
|
116
|
+
continue
|
|
117
|
+
|
|
118
|
+
switch (characters += from(character), character * variable) {
|
|
119
|
+
// &
|
|
120
|
+
case 38:
|
|
121
|
+
ampersand = offset > 0 ? 1 : (characters += '\f', -1);
|
|
122
|
+
break
|
|
123
|
+
// ,
|
|
124
|
+
case 44:
|
|
125
|
+
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
|
|
126
|
+
break
|
|
127
|
+
// @
|
|
128
|
+
case 64:
|
|
129
|
+
// -
|
|
130
|
+
if (peek() === 45)
|
|
131
|
+
characters += delimit(next());
|
|
132
|
+
|
|
133
|
+
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
|
|
134
|
+
break
|
|
135
|
+
// -
|
|
136
|
+
case 45:
|
|
137
|
+
if (previous === 45 && strlen(characters) == 2)
|
|
138
|
+
variable = 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return rulesets
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @param {string} value
|
|
147
|
+
* @param {object} root
|
|
148
|
+
* @param {object?} parent
|
|
149
|
+
* @param {number} index
|
|
150
|
+
* @param {number} offset
|
|
151
|
+
* @param {string[]} rules
|
|
152
|
+
* @param {number[]} points
|
|
153
|
+
* @param {string} type
|
|
154
|
+
* @param {string[]} props
|
|
155
|
+
* @param {string[]} children
|
|
156
|
+
* @param {number} length
|
|
157
|
+
* @param {object[]} siblings
|
|
158
|
+
* @return {object}
|
|
159
|
+
*/
|
|
160
|
+
function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {
|
|
161
|
+
var post = offset - 1;
|
|
162
|
+
var rule = offset === 0 ? rules : [''];
|
|
163
|
+
var size = sizeof(rule);
|
|
164
|
+
|
|
165
|
+
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
166
|
+
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
167
|
+
if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
|
|
168
|
+
props[k++] = z;
|
|
169
|
+
|
|
170
|
+
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @param {number} value
|
|
175
|
+
* @param {object} root
|
|
176
|
+
* @param {object?} parent
|
|
177
|
+
* @param {object[]} siblings
|
|
178
|
+
* @return {object}
|
|
179
|
+
*/
|
|
180
|
+
function comment (value, root, parent, siblings) {
|
|
181
|
+
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @param {string} value
|
|
186
|
+
* @param {object} root
|
|
187
|
+
* @param {object?} parent
|
|
188
|
+
* @param {number} length
|
|
189
|
+
* @param {object[]} siblings
|
|
190
|
+
* @return {object}
|
|
191
|
+
*/
|
|
192
|
+
function declaration (value, root, parent, length, siblings) {
|
|
193
|
+
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export { comment, compile, declaration, parse, ruleset };
|
|
197
|
+
//# sourceMappingURL=Parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Parser.js","sources":["../../../../node_modules/stylis/src/Parser.js"],"sourcesContent":["import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f', abs(index ? points[index - 1] : 0)) != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent, declarations), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @param {object[]} siblings\n * @return {object}\n */\nexport function comment (value, root, parent, siblings) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function declaration (value, root, parent, length, siblings) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings)\n}\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACO,SAAS,OAAO,EAAE,KAAK,EAAE;AAChC,CAAC,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACvF,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE;AACjG,CAAC,IAAI,KAAK,GAAG,EAAC;AACd,CAAC,IAAI,MAAM,GAAG,EAAC;AACf,CAAC,IAAI,MAAM,GAAG,OAAM;AACpB,CAAC,IAAI,MAAM,GAAG,EAAC;AACf,CAAC,IAAI,QAAQ,GAAG,EAAC;AACjB,CAAC,IAAI,QAAQ,GAAG,EAAC;AACjB,CAAC,IAAI,QAAQ,GAAG,EAAC;AACjB,CAAC,IAAI,QAAQ,GAAG,EAAC;AACjB,CAAC,IAAI,SAAS,GAAG,EAAC;AAClB,CAAC,IAAI,SAAS,GAAG,EAAC;AAClB,CAAC,IAAI,IAAI,GAAG,GAAE;AACd,CAAC,IAAI,KAAK,GAAG,MAAK;AAClB,CAAC,IAAI,QAAQ,GAAG,SAAQ;AACxB,CAAC,IAAI,SAAS,GAAG,KAAI;AACrB,CAAC,IAAI,UAAU,GAAG,KAAI;AACtB;AACA,CAAC,OAAO,QAAQ;AAChB,EAAE,QAAQ,QAAQ,GAAG,SAAS,EAAE,SAAS,GAAG,IAAI,EAAE;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M,EAAE,QAAQ,EAAE;AACxD,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;AAC3F,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE;AACpE,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC;AACzH;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { MS, WEBKIT, MOZ } from './Enum.js';
|
|
2
|
+
import { hash, replace, charat, strlen, indexof, match, substr } from './Utility.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @param {string} value
|
|
6
|
+
* @param {number} length
|
|
7
|
+
* @param {object[]} children
|
|
8
|
+
* @return {string}
|
|
9
|
+
*/
|
|
10
|
+
function prefix (value, length, children) {
|
|
11
|
+
switch (hash(value, length)) {
|
|
12
|
+
// color-adjust
|
|
13
|
+
case 5103:
|
|
14
|
+
return WEBKIT + 'print-' + value + value
|
|
15
|
+
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
16
|
+
case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:
|
|
17
|
+
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
18
|
+
case 5572: case 6356: case 5844: case 3191: case 6645: case 3005:
|
|
19
|
+
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
20
|
+
case 6391: case 5879: case 5623: case 6135: case 4599: case 4855:
|
|
21
|
+
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
22
|
+
case 4215: case 6389: case 5109: case 5365: case 5621: case 3829:
|
|
23
|
+
return WEBKIT + value + value
|
|
24
|
+
// tab-size
|
|
25
|
+
case 4789:
|
|
26
|
+
return MOZ + value + value
|
|
27
|
+
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
28
|
+
case 5349: case 4246: case 4810: case 6968: case 2756:
|
|
29
|
+
return WEBKIT + value + MOZ + value + MS + value + value
|
|
30
|
+
// writing-mode
|
|
31
|
+
case 5936:
|
|
32
|
+
switch (charat(value, length + 11)) {
|
|
33
|
+
// vertical-l(r)
|
|
34
|
+
case 114:
|
|
35
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value
|
|
36
|
+
// vertical-r(l)
|
|
37
|
+
case 108:
|
|
38
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value
|
|
39
|
+
// horizontal(-)tb
|
|
40
|
+
case 45:
|
|
41
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value
|
|
42
|
+
// default: fallthrough to below
|
|
43
|
+
}
|
|
44
|
+
// flex, flex-direction, scroll-snap-type, writing-mode
|
|
45
|
+
case 6828: case 4268: case 2903:
|
|
46
|
+
return WEBKIT + value + MS + value + value
|
|
47
|
+
// order
|
|
48
|
+
case 6165:
|
|
49
|
+
return WEBKIT + value + MS + 'flex-' + value + value
|
|
50
|
+
// align-items
|
|
51
|
+
case 5187:
|
|
52
|
+
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value
|
|
53
|
+
// align-self
|
|
54
|
+
case 5443:
|
|
55
|
+
return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/g, '') + (!match(value, /flex-|baseline/) ? MS + 'grid-row-' + replace(value, /flex-|-self/g, '') : '') + value
|
|
56
|
+
// align-content
|
|
57
|
+
case 4675:
|
|
58
|
+
return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/g, '') + value
|
|
59
|
+
// flex-shrink
|
|
60
|
+
case 5548:
|
|
61
|
+
return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value
|
|
62
|
+
// flex-basis
|
|
63
|
+
case 5292:
|
|
64
|
+
return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value
|
|
65
|
+
// flex-grow
|
|
66
|
+
case 6060:
|
|
67
|
+
return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value
|
|
68
|
+
// transition
|
|
69
|
+
case 4554:
|
|
70
|
+
return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value
|
|
71
|
+
// cursor
|
|
72
|
+
case 6187:
|
|
73
|
+
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value
|
|
74
|
+
// background, background-image
|
|
75
|
+
case 5495: case 3959:
|
|
76
|
+
return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1')
|
|
77
|
+
// justify-content
|
|
78
|
+
case 4968:
|
|
79
|
+
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value
|
|
80
|
+
// justify-self
|
|
81
|
+
case 4200:
|
|
82
|
+
if (!match(value, /flex-|baseline/)) return MS + 'grid-column-align' + substr(value, length) + value
|
|
83
|
+
break
|
|
84
|
+
// grid-template-(columns|rows)
|
|
85
|
+
case 2592: case 3360:
|
|
86
|
+
return MS + replace(value, 'template-', '') + value
|
|
87
|
+
// grid-(row|column)-start
|
|
88
|
+
case 4384: case 3616:
|
|
89
|
+
if (children && children.some(function (element, index) { return length = index, match(element.props, /grid-\w+-end/) })) {
|
|
90
|
+
return ~indexof(value + (children = children[length].value), 'span', 0) ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span', 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ';')
|
|
91
|
+
}
|
|
92
|
+
return MS + replace(value, '-start', '') + value
|
|
93
|
+
// grid-(row|column)-end
|
|
94
|
+
case 4896: case 4128:
|
|
95
|
+
return (children && children.some(function (element) { return match(element.props, /grid-\w+-start/) })) ? value : MS + replace(replace(value, '-end', '-span'), 'span ', '') + value
|
|
96
|
+
// (margin|padding)-inline-(start|end)
|
|
97
|
+
case 4095: case 3583: case 4068: case 2532:
|
|
98
|
+
return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value
|
|
99
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
100
|
+
case 8116: case 7059: case 5753: case 5535:
|
|
101
|
+
case 5445: case 5701: case 4933: case 4677:
|
|
102
|
+
case 5533: case 5789: case 5021: case 4765:
|
|
103
|
+
// stretch, max-content, min-content, fill-available
|
|
104
|
+
if (strlen(value) - 1 - length > 6)
|
|
105
|
+
switch (charat(value, length + 1)) {
|
|
106
|
+
// (m)ax-content, (m)in-content
|
|
107
|
+
case 109:
|
|
108
|
+
// -
|
|
109
|
+
if (charat(value, length + 4) !== 45)
|
|
110
|
+
break
|
|
111
|
+
// (f)ill-available, (f)it-content
|
|
112
|
+
case 102:
|
|
113
|
+
return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value
|
|
114
|
+
// (s)tretch
|
|
115
|
+
case 115:
|
|
116
|
+
return ~indexof(value, 'stretch', 0) ? prefix(replace(value, 'stretch', 'fill-available'), length, children) + value : value
|
|
117
|
+
}
|
|
118
|
+
break
|
|
119
|
+
// grid-(column|row)
|
|
120
|
+
case 5152: case 5920:
|
|
121
|
+
return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function (_, a, b, c, d, e, f) { return (MS + a + ':' + b + f) + (c ? (MS + a + '-span:' + (d ? e : +e - +b)) + f : '') + value })
|
|
122
|
+
// position: sticky
|
|
123
|
+
case 4949:
|
|
124
|
+
// stick(y)?
|
|
125
|
+
if (charat(value, length + 6) === 121)
|
|
126
|
+
return replace(value, ':', ':' + WEBKIT) + value
|
|
127
|
+
break
|
|
128
|
+
// display: (flex|inline-flex|grid|inline-grid)
|
|
129
|
+
case 6444:
|
|
130
|
+
switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {
|
|
131
|
+
// (inline-)?fle(x)
|
|
132
|
+
case 120:
|
|
133
|
+
return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value
|
|
134
|
+
// (inline-)?gri(d)
|
|
135
|
+
case 100:
|
|
136
|
+
return replace(value, ':', ':' + MS) + value
|
|
137
|
+
}
|
|
138
|
+
break
|
|
139
|
+
// scroll-margin, scroll-margin-(top|right|bottom|left)
|
|
140
|
+
case 5719: case 2647: case 2135: case 3927: case 2391:
|
|
141
|
+
return replace(value, 'scroll-', 'scroll-snap-') + value
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return value
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { prefix };
|
|
148
|
+
//# sourceMappingURL=Prefixer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prefixer.js","sources":["../../../../node_modules/stylis/src/Prefixer.js"],"sourcesContent":["import {MS, MOZ, WEBKIT} from './Enum.js'\nimport {hash, charat, strlen, indexof, replace, substr, match} from './Utility.js'\n\n/**\n * @param {string} value\n * @param {number} length\n * @param {object[]} children\n * @return {string}\n */\nexport function prefix (value, length, children) {\n\tswitch (hash(value, length)) {\n\t\t// color-adjust\n\t\tcase 5103:\n\t\t\treturn WEBKIT + 'print-' + value + value\n\t\t// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\t\tcase 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:\n\t\t// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\t\tcase 5572: case 6356: case 5844: case 3191: case 6645: case 3005:\n\t\t// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\t\tcase 6391: case 5879: case 5623: case 6135: case 4599: case 4855:\n\t\t// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\t\tcase 4215: case 6389: case 5109: case 5365: case 5621: case 3829:\n\t\t\treturn WEBKIT + value + value\n\t\t// tab-size\n\t\tcase 4789:\n\t\t\treturn MOZ + value + value\n\t\t// appearance, user-select, transform, hyphens, text-size-adjust\n\t\tcase 5349: case 4246: case 4810: case 6968: case 2756:\n\t\t\treturn WEBKIT + value + MOZ + value + MS + value + value\n\t\t// writing-mode\n\t\tcase 5936:\n\t\t\tswitch (charat(value, length + 11)) {\n\t\t\t\t// vertical-l(r)\n\t\t\t\tcase 114:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value\n\t\t\t\t// vertical-r(l)\n\t\t\t\tcase 108:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value\n\t\t\t\t// horizontal(-)tb\n\t\t\t\tcase 45:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value\n\t\t\t\t// default: fallthrough to below\n\t\t\t}\n\t\t// flex, flex-direction, scroll-snap-type, writing-mode\n\t\tcase 6828: case 4268: case 2903:\n\t\t\treturn WEBKIT + value + MS + value + value\n\t\t// order\n\t\tcase 6165:\n\t\t\treturn WEBKIT + value + MS + 'flex-' + value + value\n\t\t// align-items\n\t\tcase 5187:\n\t\t\treturn WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value\n\t\t// align-self\n\t\tcase 5443:\n\t\t\treturn WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/g, '') + (!match(value, /flex-|baseline/) ? MS + 'grid-row-' + replace(value, /flex-|-self/g, '') : '') + value\n\t\t// align-content\n\t\tcase 4675:\n\t\t\treturn WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/g, '') + value\n\t\t// flex-shrink\n\t\tcase 5548:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value\n\t\t// flex-basis\n\t\tcase 5292:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value\n\t\t// flex-grow\n\t\tcase 6060:\n\t\t\treturn WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value\n\t\t// transition\n\t\tcase 4554:\n\t\t\treturn WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value\n\t\t// cursor\n\t\tcase 6187:\n\t\t\treturn replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value\n\t\t// background, background-image\n\t\tcase 5495: case 3959:\n\t\t\treturn replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1')\n\t\t// justify-content\n\t\tcase 4968:\n\t\t\treturn replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value\n\t\t// justify-self\n\t\tcase 4200:\n\t\t\tif (!match(value, /flex-|baseline/)) return MS + 'grid-column-align' + substr(value, length) + value\n\t\t\tbreak\n\t\t// grid-template-(columns|rows)\n\t\tcase 2592: case 3360:\n\t\t\treturn MS + replace(value, 'template-', '') + value\n\t\t// grid-(row|column)-start\n\t\tcase 4384: case 3616:\n\t\t\tif (children && children.some(function (element, index) { return length = index, match(element.props, /grid-\\w+-end/) })) {\n\t\t\t\treturn ~indexof(value + (children = children[length].value), 'span', 0) ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span', 0) ? match(children, /\\d+/) : +match(children, /\\d+/) - +match(value, /\\d+/)) + ';')\n\t\t\t}\n\t\t\treturn MS + replace(value, '-start', '') + value\n\t\t// grid-(row|column)-end\n\t\tcase 4896: case 4128:\n\t\t\treturn (children && children.some(function (element) { return match(element.props, /grid-\\w+-start/) })) ? value : MS + replace(replace(value, '-end', '-span'), 'span ', '') + value\n\t\t// (margin|padding)-inline-(start|end)\n\t\tcase 4095: case 3583: case 4068: case 2532:\n\t\t\treturn replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value\n\t\t// (min|max)?(width|height|inline-size|block-size)\n\t\tcase 8116: case 7059: case 5753: case 5535:\n\t\tcase 5445: case 5701: case 4933: case 4677:\n\t\tcase 5533: case 5789: case 5021: case 4765:\n\t\t\t// stretch, max-content, min-content, fill-available\n\t\t\tif (strlen(value) - 1 - length > 6)\n\t\t\t\tswitch (charat(value, length + 1)) {\n\t\t\t\t\t// (m)ax-content, (m)in-content\n\t\t\t\t\tcase 109:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (charat(value, length + 4) !== 45)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t// (f)ill-available, (f)it-content\n\t\t\t\t\tcase 102:\n\t\t\t\t\t\treturn replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value\n\t\t\t\t\t// (s)tretch\n\t\t\t\t\tcase 115:\n\t\t\t\t\t\treturn ~indexof(value, 'stretch', 0) ? prefix(replace(value, 'stretch', 'fill-available'), length, children) + value : value\n\t\t\t\t}\n\t\t\tbreak\n\t\t// grid-(column|row)\n\t\tcase 5152: case 5920:\n\t\t\treturn replace(value, /(.+?):(\\d+)(\\s*\\/\\s*(span)?\\s*(\\d+))?(.*)/, function (_, a, b, c, d, e, f) { return (MS + a + ':' + b + f) + (c ? (MS + a + '-span:' + (d ? e : +e - +b)) + f : '') + value })\n\t\t// position: sticky\n\t\tcase 4949:\n\t\t\t// stick(y)?\n\t\t\tif (charat(value, length + 6) === 121)\n\t\t\t\treturn replace(value, ':', ':' + WEBKIT) + value\n\t\t\tbreak\n\t\t// display: (flex|inline-flex|grid|inline-grid)\n\t\tcase 6444:\n\t\t\tswitch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {\n\t\t\t\t// (inline-)?fle(x)\n\t\t\t\tcase 120:\n\t\t\t\t\treturn replace(value, /(.+:)([^;\\s!]+)(;|(\\s+)?!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value\n\t\t\t\t// (inline-)?gri(d)\n\t\t\t\tcase 100:\n\t\t\t\t\treturn replace(value, ':', ':' + MS) + value\n\t\t\t}\n\t\t\tbreak\n\t\t// scroll-margin, scroll-margin-(top|right|bottom|left)\n\t\tcase 5719: case 2647: case 2135: case 3927: case 2391:\n\t\t\treturn replace(value, 'scroll-', 'scroll-snap-') + value\n\t}\n\n\treturn value\n}\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE;AACjD,CAAC,QAAQ,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC;AAC5B;AACA,EAAE,KAAK,IAAI;AACX,GAAG,OAAO,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK;AAC3C;AACA,EAAE,KAAK,IAAI,CAAC,CAAC,KAAK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AAG,EAAE,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,KAAK;AAC3L;AACA,IAAI,KAAK,GAAG;AACZ,KAAK,OAAO,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,KAAK;AACjD,IAAI;AACJ,GAAG,KAAK;AACR;AACA,EAAE,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI;AACvD,GAAG,OAAO,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,GAAG,KAAK;AAC3D,EAAE;AACF;AACA,CAAC,OAAO,KAAK;AACb;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RULESET, KEYFRAMES, COMMENT, DECLARATION, IMPORT, LAYER } from './Enum.js';
|
|
2
|
+
import { strlen } from './Utility.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @param {object[]} children
|
|
6
|
+
* @param {function} callback
|
|
7
|
+
* @return {string}
|
|
8
|
+
*/
|
|
9
|
+
function serialize (children, callback) {
|
|
10
|
+
var output = '';
|
|
11
|
+
|
|
12
|
+
for (var i = 0; i < children.length; i++)
|
|
13
|
+
output += callback(children[i], i, children, callback) || '';
|
|
14
|
+
|
|
15
|
+
return output
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param {object} element
|
|
20
|
+
* @param {number} index
|
|
21
|
+
* @param {object[]} children
|
|
22
|
+
* @param {function} callback
|
|
23
|
+
* @return {string}
|
|
24
|
+
*/
|
|
25
|
+
function stringify (element, index, children, callback) {
|
|
26
|
+
switch (element.type) {
|
|
27
|
+
case LAYER: if (element.children.length) break
|
|
28
|
+
case IMPORT: case DECLARATION: return element.return = element.return || element.value
|
|
29
|
+
case COMMENT: return ''
|
|
30
|
+
case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
|
|
31
|
+
case RULESET: if (!strlen(element.value = element.props.join(','))) return ''
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { serialize, stringify };
|
|
38
|
+
//# sourceMappingURL=Serializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Serializer.js","sources":["../../../../node_modules/stylis/src/Serializer.js"],"sourcesContent":["import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\n\tfor (var i = 0; i < children.length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: if (!strlen(element.value = element.props.join(','))) return ''\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE;AAC/C,CAAC,IAAI,MAAM,GAAG,GAAE;AAChB;AACA,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;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