tailwindcss 0.0.0-insiders.ca1dfd6 → 0.0.0-insiders.ca7b10e

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.
Files changed (179) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +18 -11
  3. package/dist/chunk-7MHEDNEU.mjs +1 -0
  4. package/dist/chunk-AZANAYY2.mjs +1 -0
  5. package/dist/chunk-YTVGJJD3.mjs +12 -0
  6. package/dist/colors-b_6i0Oi7.d.ts +295 -0
  7. package/dist/colors.d.mts +295 -0
  8. package/dist/colors.d.ts +5 -0
  9. package/dist/colors.js +1 -0
  10. package/dist/colors.mjs +1 -0
  11. package/dist/default-theme.d.mts +1147 -0
  12. package/dist/default-theme.d.ts +1147 -0
  13. package/dist/default-theme.js +1 -0
  14. package/dist/default-theme.mjs +1 -0
  15. package/dist/flatten-color-palette.d.mts +6 -0
  16. package/dist/flatten-color-palette.d.ts +6 -0
  17. package/dist/flatten-color-palette.js +1 -0
  18. package/dist/flatten-color-palette.mjs +1 -0
  19. package/dist/lib.d.mts +264 -0
  20. package/dist/lib.d.ts +3 -0
  21. package/dist/lib.js +33 -0
  22. package/dist/lib.mjs +22 -0
  23. package/dist/plugin.d.mts +11 -0
  24. package/dist/plugin.d.ts +104 -0
  25. package/dist/plugin.js +1 -0
  26. package/dist/plugin.mjs +1 -0
  27. package/dist/resolve-config-BIFUA2FY.d.ts +29 -0
  28. package/dist/resolve-config-QUZ9b-Gn.d.mts +190 -0
  29. package/dist/types-B254mqw1.d.mts +98 -0
  30. package/index.css +866 -0
  31. package/package.json +73 -100
  32. package/preflight.css +375 -0
  33. package/theme.css +453 -0
  34. package/CHANGELOG.md +0 -1758
  35. package/base.css +0 -1
  36. package/colors.js +0 -1
  37. package/components.css +0 -1
  38. package/defaultConfig.js +0 -1
  39. package/defaultTheme.js +0 -1
  40. package/lib/cli-peer-dependencies.js +0 -15
  41. package/lib/cli.js +0 -707
  42. package/lib/constants.js +0 -37
  43. package/lib/corePluginList.js +0 -169
  44. package/lib/corePlugins.js +0 -3525
  45. package/lib/css/LICENSE +0 -25
  46. package/lib/css/preflight.css +0 -354
  47. package/lib/featureFlags.js +0 -57
  48. package/lib/index.js +0 -32
  49. package/lib/lib/collapseAdjacentRules.js +0 -41
  50. package/lib/lib/detectNesting.js +0 -19
  51. package/lib/lib/evaluateTailwindFunctions.js +0 -167
  52. package/lib/lib/expandApplyAtRules.js +0 -228
  53. package/lib/lib/expandTailwindAtRules.js +0 -257
  54. package/lib/lib/generateRules.js +0 -350
  55. package/lib/lib/getModuleDependencies.js +0 -48
  56. package/lib/lib/normalizeTailwindDirectives.js +0 -75
  57. package/lib/lib/resolveDefaultsAtRules.js +0 -128
  58. package/lib/lib/setupContextUtils.js +0 -791
  59. package/lib/lib/setupTrackingContext.js +0 -170
  60. package/lib/lib/setupWatchingContext.js +0 -284
  61. package/lib/lib/sharedState.js +0 -29
  62. package/lib/lib/substituteScreenAtRules.js +0 -24
  63. package/lib/processTailwindFeatures.js +0 -47
  64. package/lib/public/colors.js +0 -333
  65. package/lib/public/create-plugin.js +0 -13
  66. package/lib/public/default-config.js +0 -14
  67. package/lib/public/default-theme.js +0 -14
  68. package/lib/public/resolve-config.js +0 -19
  69. package/lib/util/bigSign.js +0 -8
  70. package/lib/util/buildMediaQuery.js +0 -31
  71. package/lib/util/cloneDeep.js +0 -19
  72. package/lib/util/cloneNodes.js +0 -14
  73. package/lib/util/color.js +0 -84
  74. package/lib/util/configurePlugins.js +0 -18
  75. package/lib/util/createPlugin.js +0 -30
  76. package/lib/util/createUtilityPlugin.js +0 -53
  77. package/lib/util/dataTypes.js +0 -202
  78. package/lib/util/defaults.js +0 -16
  79. package/lib/util/escapeClassName.js +0 -19
  80. package/lib/util/escapeCommas.js +0 -8
  81. package/lib/util/flattenColorPalette.js +0 -19
  82. package/lib/util/getAllConfigs.js +0 -29
  83. package/lib/util/hashConfig.js +0 -16
  84. package/lib/util/isKeyframeRule.js +0 -8
  85. package/lib/util/isPlainObject.js +0 -12
  86. package/lib/util/log.js +0 -35
  87. package/lib/util/nameClass.js +0 -31
  88. package/lib/util/negateValue.js +0 -17
  89. package/lib/util/parseAnimationValue.js +0 -89
  90. package/lib/util/parseDependency.js +0 -63
  91. package/lib/util/parseObjectStyles.js +0 -31
  92. package/lib/util/pluginUtils.js +0 -282
  93. package/lib/util/prefixSelector.js +0 -23
  94. package/lib/util/resolveConfig.js +0 -293
  95. package/lib/util/resolveConfigPath.js +0 -52
  96. package/lib/util/responsive.js +0 -19
  97. package/lib/util/tap.js +0 -9
  98. package/lib/util/toColorValue.js +0 -9
  99. package/lib/util/toPath.js +0 -9
  100. package/lib/util/transformThemeValue.js +0 -53
  101. package/lib/util/withAlphaVariable.js +0 -67
  102. package/nesting/README.md +0 -42
  103. package/nesting/index.js +0 -12
  104. package/nesting/plugin.js +0 -41
  105. package/peers/index.js +0 -77111
  106. package/plugin.js +0 -1
  107. package/prettier.config.js +0 -19
  108. package/resolveConfig.js +0 -1
  109. package/screens.css +0 -1
  110. package/scripts/create-plugin-list.js +0 -10
  111. package/scripts/install-integrations.js +0 -27
  112. package/scripts/rebuildFixtures.js +0 -68
  113. package/src/cli-peer-dependencies.js +0 -9
  114. package/src/cli.js +0 -762
  115. package/src/constants.js +0 -17
  116. package/src/corePluginList.js +0 -1
  117. package/src/corePlugins.js +0 -2382
  118. package/src/css/LICENSE +0 -25
  119. package/src/css/preflight.css +0 -354
  120. package/src/featureFlags.js +0 -48
  121. package/src/index.js +0 -34
  122. package/src/lib/collapseAdjacentRules.js +0 -39
  123. package/src/lib/detectNesting.js +0 -20
  124. package/src/lib/evaluateTailwindFunctions.js +0 -195
  125. package/src/lib/expandApplyAtRules.js +0 -251
  126. package/src/lib/expandTailwindAtRules.js +0 -266
  127. package/src/lib/generateRules.js +0 -320
  128. package/src/lib/getModuleDependencies.js +0 -39
  129. package/src/lib/normalizeTailwindDirectives.js +0 -77
  130. package/src/lib/resolveDefaultsAtRules.js +0 -125
  131. package/src/lib/setupContextUtils.js +0 -775
  132. package/src/lib/setupTrackingContext.js +0 -184
  133. package/src/lib/setupWatchingContext.js +0 -306
  134. package/src/lib/sharedState.js +0 -13
  135. package/src/lib/substituteScreenAtRules.js +0 -16
  136. package/src/processTailwindFeatures.js +0 -43
  137. package/src/public/colors.js +0 -305
  138. package/src/public/create-plugin.js +0 -2
  139. package/src/public/default-config.js +0 -4
  140. package/src/public/default-theme.js +0 -4
  141. package/src/public/resolve-config.js +0 -7
  142. package/src/util/bigSign.js +0 -3
  143. package/src/util/buildMediaQuery.js +0 -24
  144. package/src/util/cloneDeep.js +0 -11
  145. package/src/util/cloneNodes.js +0 -11
  146. package/src/util/color.js +0 -56
  147. package/src/util/configurePlugins.js +0 -23
  148. package/src/util/createPlugin.js +0 -27
  149. package/src/util/createUtilityPlugin.js +0 -37
  150. package/src/util/dataTypes.js +0 -216
  151. package/src/util/defaults.js +0 -11
  152. package/src/util/escapeClassName.js +0 -8
  153. package/src/util/escapeCommas.js +0 -3
  154. package/src/util/flattenColorPalette.js +0 -13
  155. package/src/util/getAllConfigs.js +0 -19
  156. package/src/util/hashConfig.js +0 -5
  157. package/src/util/isKeyframeRule.js +0 -3
  158. package/src/util/isPlainObject.js +0 -8
  159. package/src/util/log.js +0 -28
  160. package/src/util/nameClass.js +0 -26
  161. package/src/util/negateValue.js +0 -14
  162. package/src/util/parseAnimationValue.js +0 -68
  163. package/src/util/parseDependency.js +0 -49
  164. package/src/util/parseObjectStyles.js +0 -19
  165. package/src/util/pluginUtils.js +0 -288
  166. package/src/util/prefixSelector.js +0 -15
  167. package/src/util/resolveConfig.js +0 -282
  168. package/src/util/resolveConfigPath.js +0 -55
  169. package/src/util/responsive.js +0 -10
  170. package/src/util/tap.js +0 -4
  171. package/src/util/toColorValue.js +0 -3
  172. package/src/util/toPath.js +0 -4
  173. package/src/util/transformThemeValue.js +0 -37
  174. package/src/util/withAlphaVariable.js +0 -49
  175. package/stubs/defaultConfig.stub.js +0 -890
  176. package/stubs/defaultPostCssConfig.stub.js +0 -6
  177. package/stubs/simpleConfig.stub.js +0 -8
  178. package/tailwind.css +0 -5
  179. package/variants.css +0 -1
@@ -1,202 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.normalize = normalize;
6
- exports.url = url;
7
- exports.number = number;
8
- exports.percentage = percentage;
9
- exports.length = length;
10
- exports.lineWidth = lineWidth;
11
- exports.color = color;
12
- exports.image = image;
13
- exports.gradient = gradient;
14
- exports.position = position;
15
- exports.familyName = familyName;
16
- exports.genericName = genericName;
17
- exports.absoluteSize = absoluteSize;
18
- exports.relativeSize = relativeSize;
19
- var _color = require("./color");
20
- // Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types
21
- let COMMA = /,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
22
- ;
23
- let UNDERSCORE = /_(?![^(]*\))/g // Underscore separator that is not located between brackets. E.g.: `rgba(255,_255,_255)_black` these don't count.
24
- ;
25
- function normalize(value) {
26
- // Convert `_` to ` `, except for escaped underscores `\_`
27
- value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + ' '.repeat(fullMatch.length - 1)
28
- ).replace(/^_/g, ' ').replace(/\\_/g, '_');
29
- // Remove leftover whitespace
30
- value = value.trim();
31
- // Keep raw strings if it starts with `url(`
32
- if (value.startsWith('url(')) return value;
33
- // Add spaces around operators inside calc() that do not follow an operator
34
- // or '('.
35
- return value.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, '$1 $2 ');
36
- }
37
- function url(value) {
38
- return value.startsWith('url(');
39
- }
40
- function number(value) {
41
- return !isNaN(Number(value));
42
- }
43
- function percentage(value) {
44
- return /%$/g.test(value) || /^calc\(.+?%\)/g.test(value);
45
- }
46
- let lengthUnits = [
47
- 'cm',
48
- 'mm',
49
- 'Q',
50
- 'in',
51
- 'pc',
52
- 'pt',
53
- 'px',
54
- 'em',
55
- 'ex',
56
- 'ch',
57
- 'rem',
58
- 'lh',
59
- 'vw',
60
- 'vh',
61
- 'vmin',
62
- 'vmax',
63
- ];
64
- let lengthUnitsPattern = `(?:${lengthUnits.join('|')})`;
65
- function length(value) {
66
- return new RegExp(`${lengthUnitsPattern}$`).test(value) || new RegExp(`^calc\\(.+?${lengthUnitsPattern}`).test(value);
67
- }
68
- let lineWidths = new Set([
69
- 'thin',
70
- 'medium',
71
- 'thick'
72
- ]);
73
- function lineWidth(value) {
74
- return lineWidths.has(value);
75
- }
76
- function color(value) {
77
- let colors = 0;
78
- let result = value.split(UNDERSCORE).every((part)=>{
79
- part = normalize(part);
80
- if (part.startsWith('var(')) return true;
81
- if ((0, _color).parseColor(part) !== null) return colors++, true;
82
- return false;
83
- });
84
- if (!result) return false;
85
- return colors > 0;
86
- }
87
- function image(value) {
88
- let images = 0;
89
- let result = value.split(COMMA).every((part)=>{
90
- part = normalize(part);
91
- if (part.startsWith('var(')) return true;
92
- if (url(part) || gradient(part) || [
93
- 'element(',
94
- 'image(',
95
- 'cross-fade(',
96
- 'image-set('
97
- ].some((fn)=>part.startsWith(fn)
98
- )) {
99
- images++;
100
- return true;
101
- }
102
- return false;
103
- });
104
- if (!result) return false;
105
- return images > 0;
106
- }
107
- let gradientTypes = new Set([
108
- 'linear-gradient',
109
- 'radial-gradient',
110
- 'repeating-linear-gradient',
111
- 'repeating-radial-gradient',
112
- 'conic-gradient',
113
- ]);
114
- function gradient(value) {
115
- value = normalize(value);
116
- for (let type of gradientTypes){
117
- if (value.startsWith(`${type}(`)) {
118
- return true;
119
- }
120
- }
121
- return false;
122
- }
123
- let validPositions = new Set([
124
- 'center',
125
- 'top',
126
- 'right',
127
- 'bottom',
128
- 'left'
129
- ]);
130
- function position(value) {
131
- let positions = 0;
132
- let result = value.split(UNDERSCORE).every((part)=>{
133
- part = normalize(part);
134
- if (part.startsWith('var(')) return true;
135
- if (validPositions.has(part) || length(part) || percentage(part)) {
136
- positions++;
137
- return true;
138
- }
139
- return false;
140
- });
141
- if (!result) return false;
142
- return positions > 0;
143
- }
144
- function familyName(value) {
145
- let fonts = 0;
146
- let result = value.split(COMMA).every((part)=>{
147
- part = normalize(part);
148
- if (part.startsWith('var(')) return true;
149
- // If it contains spaces, then it should be quoted
150
- if (part.includes(' ')) {
151
- if (!/(['"])([^"']+)\1/g.test(part)) {
152
- return false;
153
- }
154
- }
155
- // If it starts with a number, it's invalid
156
- if (/^\d/g.test(part)) {
157
- return false;
158
- }
159
- fonts++;
160
- return true;
161
- });
162
- if (!result) return false;
163
- return fonts > 0;
164
- }
165
- let genericNames = new Set([
166
- 'serif',
167
- 'sans-serif',
168
- 'monospace',
169
- 'cursive',
170
- 'fantasy',
171
- 'system-ui',
172
- 'ui-serif',
173
- 'ui-sans-serif',
174
- 'ui-monospace',
175
- 'ui-rounded',
176
- 'math',
177
- 'emoji',
178
- 'fangsong',
179
- ]);
180
- function genericName(value) {
181
- return genericNames.has(value);
182
- }
183
- let absoluteSizes = new Set([
184
- 'xx-small',
185
- 'x-small',
186
- 'small',
187
- 'medium',
188
- 'large',
189
- 'x-large',
190
- 'x-large',
191
- 'xxx-large',
192
- ]);
193
- function absoluteSize(value) {
194
- return absoluteSizes.has(value);
195
- }
196
- let relativeSizes = new Set([
197
- 'larger',
198
- 'smaller'
199
- ]);
200
- function relativeSize(value) {
201
- return relativeSizes.has(value);
202
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.defaults = defaults;
6
- function defaults(target, ...sources) {
7
- for (let source of sources){
8
- for(let k in source){
9
- var ref;
10
- if (!(target === null || target === void 0 ? void 0 : (ref = target.hasOwnProperty) === null || ref === void 0 ? void 0 : ref.call(target, k))) {
11
- target[k] = source[k];
12
- }
13
- }
14
- }
15
- return target;
16
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = escapeClassName;
6
- var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
7
- var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
8
- function _interopRequireDefault(obj) {
9
- return obj && obj.__esModule ? obj : {
10
- default: obj
11
- };
12
- }
13
- function escapeClassName(className) {
14
- var ref;
15
- let node = _postcssSelectorParser.default.className();
16
- node.value = className;
17
- var ref1;
18
- return (0, _escapeCommas).default((ref1 = node === null || node === void 0 ? void 0 : (ref = node.raws) === null || ref === void 0 ? void 0 : ref.value) !== null && ref1 !== void 0 ? ref1 : node.value);
19
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = escapeCommas;
6
- function escapeCommas(className) {
7
- return className.replace(/\\,/g, '\\2c ');
8
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = void 0;
6
- const flattenColorPalette = (colors)=>Object.assign({
7
- }, ...Object.entries(colors !== null && colors !== void 0 ? colors : {
8
- }).flatMap(([color, values])=>typeof values == 'object' ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({
9
- [color + (number === 'DEFAULT' ? '' : `-${number}`)]: hex
10
- })
11
- ) : [
12
- {
13
- [`${color}`]: values
14
- }
15
- ]
16
- ))
17
- ;
18
- var _default = flattenColorPalette;
19
- exports.default = _default;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = getAllConfigs;
6
- var _defaultConfigStubJs = _interopRequireDefault(require("../../stubs/defaultConfig.stub.js"));
7
- var _featureFlags = require("../featureFlags");
8
- function _interopRequireDefault(obj) {
9
- return obj && obj.__esModule ? obj : {
10
- default: obj
11
- };
12
- }
13
- function getAllConfigs(config) {
14
- var ref;
15
- const configs = ((ref = config === null || config === void 0 ? void 0 : config.presets) !== null && ref !== void 0 ? ref : [
16
- _defaultConfigStubJs.default
17
- ]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset)
18
- );
19
- const features = {
20
- };
21
- const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags).flagEnabled(config, feature)
22
- ).map((feature)=>features[feature]
23
- );
24
- return [
25
- config,
26
- ...experimentals,
27
- ...configs
28
- ];
29
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = hashConfig;
6
- var _objectHash = _interopRequireDefault(require("object-hash"));
7
- function _interopRequireDefault(obj) {
8
- return obj && obj.__esModule ? obj : {
9
- default: obj
10
- };
11
- }
12
- function hashConfig(config) {
13
- return (0, _objectHash).default(config, {
14
- ignoreUnknown: true
15
- });
16
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = isKeyframeRule;
6
- function isKeyframeRule(rule) {
7
- return rule.parent && rule.parent.type === 'atrule' && /keyframes$/.test(rule.parent.name);
8
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = isPlainObject;
6
- function isPlainObject(value) {
7
- if (Object.prototype.toString.call(value) !== '[object Object]') {
8
- return false;
9
- }
10
- const prototype = Object.getPrototypeOf(value);
11
- return prototype === null || prototype === Object.prototype;
12
- }
package/lib/util/log.js DELETED
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = void 0;
6
- var _chalk = _interopRequireDefault(require("chalk"));
7
- function _interopRequireDefault(obj) {
8
- return obj && obj.__esModule ? obj : {
9
- default: obj
10
- };
11
- }
12
- var _default = {
13
- info (messages) {
14
- if (process.env.JEST_WORKER_ID !== undefined) return;
15
- console.warn('');
16
- messages.forEach((message)=>{
17
- console.warn(_chalk.default.bold.cyan('info'), '-', message);
18
- });
19
- },
20
- warn (messages) {
21
- if (process.env.JEST_WORKER_ID !== undefined) return;
22
- console.warn('');
23
- messages.forEach((message)=>{
24
- console.warn(_chalk.default.bold.yellow('warn'), '-', message);
25
- });
26
- },
27
- risk (messages) {
28
- if (process.env.JEST_WORKER_ID !== undefined) return;
29
- console.warn('');
30
- messages.forEach((message)=>{
31
- console.warn(_chalk.default.bold.magenta('risk'), '-', message);
32
- });
33
- }
34
- };
35
- exports.default = _default;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = nameClass;
6
- exports.formatClass = formatClass;
7
- var _escapeClassName = _interopRequireDefault(require("./escapeClassName"));
8
- var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
9
- function _interopRequireDefault(obj) {
10
- return obj && obj.__esModule ? obj : {
11
- default: obj
12
- };
13
- }
14
- function asClass(name) {
15
- return (0, _escapeCommas).default(`.${(0, _escapeClassName).default(name)}`);
16
- }
17
- function nameClass(classPrefix, key) {
18
- return asClass(formatClass(classPrefix, key));
19
- }
20
- function formatClass(classPrefix, key) {
21
- if (key === 'DEFAULT') {
22
- return classPrefix;
23
- }
24
- if (key === '-') {
25
- return `-${classPrefix}`;
26
- }
27
- if (key.startsWith('-')) {
28
- return `-${classPrefix}${key}`;
29
- }
30
- return `${classPrefix}-${key}`;
31
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = _default;
6
- function _default(value) {
7
- value = `${value}`;
8
- // Flip sign of numbers
9
- if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value)) {
10
- return value.replace(/^[+-]?/, (sign)=>sign === '-' ? '' : '-'
11
- );
12
- }
13
- if (value.includes('var(') || value.includes('calc(')) {
14
- return `calc(${value} * -1)`;
15
- }
16
- return value;
17
- }
@@ -1,89 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = parseAnimationValue;
6
- const DIRECTIONS = new Set([
7
- 'normal',
8
- 'reverse',
9
- 'alternate',
10
- 'alternate-reverse'
11
- ]);
12
- const PLAY_STATES = new Set([
13
- 'running',
14
- 'paused'
15
- ]);
16
- const FILL_MODES = new Set([
17
- 'none',
18
- 'forwards',
19
- 'backwards',
20
- 'both'
21
- ]);
22
- const ITERATION_COUNTS = new Set([
23
- 'infinite'
24
- ]);
25
- const TIMINGS = new Set([
26
- 'linear',
27
- 'ease',
28
- 'ease-in',
29
- 'ease-out',
30
- 'ease-in-out',
31
- 'step-start',
32
- 'step-end',
33
- ]);
34
- const TIMING_FNS = [
35
- 'cubic-bezier',
36
- 'steps'
37
- ];
38
- const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
39
- ;
40
- const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
41
- ;
42
- const TIME = /^(-?[\d.]+m?s)$/;
43
- const DIGIT = /^(\d+)$/;
44
- function parseAnimationValue(input) {
45
- let animations = input.split(COMMA);
46
- return animations.map((animation)=>{
47
- let value = animation.trim();
48
- let result = {
49
- value
50
- };
51
- let parts = value.split(SPACE);
52
- let seen = new Set();
53
- for (let part of parts){
54
- if (!seen.has('DIRECTIONS') && DIRECTIONS.has(part)) {
55
- result.direction = part;
56
- seen.add('DIRECTIONS');
57
- } else if (!seen.has('PLAY_STATES') && PLAY_STATES.has(part)) {
58
- result.playState = part;
59
- seen.add('PLAY_STATES');
60
- } else if (!seen.has('FILL_MODES') && FILL_MODES.has(part)) {
61
- result.fillMode = part;
62
- seen.add('FILL_MODES');
63
- } else if (!seen.has('ITERATION_COUNTS') && (ITERATION_COUNTS.has(part) || DIGIT.test(part))) {
64
- result.iterationCount = part;
65
- seen.add('ITERATION_COUNTS');
66
- } else if (!seen.has('TIMING_FUNCTION') && TIMINGS.has(part)) {
67
- result.timingFunction = part;
68
- seen.add('TIMING_FUNCTION');
69
- } else if (!seen.has('TIMING_FUNCTION') && TIMING_FNS.some((f)=>part.startsWith(`${f}(`)
70
- )) {
71
- result.timingFunction = part;
72
- seen.add('TIMING_FUNCTION');
73
- } else if (!seen.has('DURATION') && TIME.test(part)) {
74
- result.duration = part;
75
- seen.add('DURATION');
76
- } else if (!seen.has('DELAY') && TIME.test(part)) {
77
- result.delay = part;
78
- seen.add('DELAY');
79
- } else if (!seen.has('NAME')) {
80
- result.name = part;
81
- seen.add('NAME');
82
- } else {
83
- if (!result.unknown) result.unknown = [];
84
- result.unknown.push(part);
85
- }
86
- }
87
- return result;
88
- });
89
- }
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = parseDependency;
6
- var _isGlob = _interopRequireDefault(require("is-glob"));
7
- var _globParent = _interopRequireDefault(require("glob-parent"));
8
- var _path = _interopRequireDefault(require("path"));
9
- function _interopRequireDefault(obj) {
10
- return obj && obj.__esModule ? obj : {
11
- default: obj
12
- };
13
- }
14
- // Based on `glob-base`
15
- // https://github.com/micromatch/glob-base/blob/master/index.js
16
- function parseGlob(pattern) {
17
- let glob = pattern;
18
- let base = (0, _globParent).default(pattern);
19
- if (base !== '.') {
20
- glob = pattern.substr(base.length);
21
- if (glob.charAt(0) === '/') {
22
- glob = glob.substr(1);
23
- }
24
- }
25
- if (glob.substr(0, 2) === './') {
26
- glob = glob.substr(2);
27
- }
28
- if (glob.charAt(0) === '/') {
29
- glob = glob.substr(1);
30
- }
31
- return {
32
- base,
33
- glob
34
- };
35
- }
36
- function parseDependency(normalizedFileOrGlob) {
37
- if (normalizedFileOrGlob.startsWith('!')) {
38
- return null;
39
- }
40
- let message;
41
- if ((0, _isGlob).default(normalizedFileOrGlob)) {
42
- let { base , glob } = parseGlob(normalizedFileOrGlob);
43
- message = {
44
- type: 'dir-dependency',
45
- dir: _path.default.resolve(base),
46
- glob
47
- };
48
- } else {
49
- message = {
50
- type: 'dependency',
51
- file: _path.default.resolve(normalizedFileOrGlob)
52
- };
53
- }
54
- // rollup-plugin-postcss does not support dir-dependency messages
55
- // but directories can be watched in the same way as files
56
- if (message.type === 'dir-dependency' && process.env.ROLLUP_WATCH === 'true') {
57
- message = {
58
- type: 'dependency',
59
- file: message.dir
60
- };
61
- }
62
- return message;
63
- }
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = parseObjectStyles;
6
- var _postcss = _interopRequireDefault(require("postcss"));
7
- var _postcssNested = _interopRequireDefault(require("postcss-nested"));
8
- var _postcssJs = _interopRequireDefault(require("postcss-js"));
9
- function _interopRequireDefault(obj) {
10
- return obj && obj.__esModule ? obj : {
11
- default: obj
12
- };
13
- }
14
- function parseObjectStyles(styles) {
15
- if (!Array.isArray(styles)) {
16
- return parseObjectStyles([
17
- styles
18
- ]);
19
- }
20
- return styles.flatMap((style)=>{
21
- return (0, _postcss).default([
22
- (0, _postcssNested).default({
23
- bubble: [
24
- 'screen'
25
- ]
26
- }),
27
- ]).process(style, {
28
- parser: _postcssJs.default
29
- }).root.nodes;
30
- });
31
- }