rainbowindex 0.2.2 → 0.4.0
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/CHANGELOG.md +70 -14
- package/LICENSE +1 -1
- package/README.md +23 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.mjs +1 -1
- package/dist/chunk-3HRMFZGE.mjs +19 -0
- package/dist/{chunk-FHATRQMN.mjs → chunk-4SVFFDS2.mjs} +495 -461
- package/dist/{chunk-SOMDX7V6.mjs → chunk-5Y7EXXLS.mjs} +320 -417
- package/dist/{chunk-W6XIBM4M.mjs → chunk-6DAHUFNU.mjs} +5278 -4928
- package/dist/{chunk-CUUW2K35.mjs → chunk-TLR6RP5L.mjs} +41 -120
- package/dist/chunk-YLB6FGIG.mjs +244 -0
- package/dist/cli.mjs +280 -277
- package/dist/{index-CfDtWufj.d.ts → context-ruu2x_jR.d.ts} +15 -70
- package/dist/editor.d.ts +106 -28
- package/dist/editor.mjs +44 -12
- package/dist/{index-DK6APAGD.d.ts → index-BB2HoeMj.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +4 -4
- package/dist/safelist-D9-Plqta.d.ts +109 -0
- package/dist/vite.mjs +48 -27
- package/package.json +1 -1
- package/dist/chunk-KYDEHYIE.mjs +0 -691
- package/dist/safelist-CH3_PywB.d.ts +0 -43
package/dist/vite.mjs
CHANGED
|
@@ -1,42 +1,59 @@
|
|
|
1
1
|
import {
|
|
2
2
|
postcss_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-TLR6RP5L.mjs";
|
|
4
|
+
import "./chunk-4SVFFDS2.mjs";
|
|
5
5
|
import {
|
|
6
|
+
isSourceFile
|
|
7
|
+
} from "./chunk-3HRMFZGE.mjs";
|
|
8
|
+
import {
|
|
9
|
+
DIRECTIVE_TYPE_NAMES,
|
|
6
10
|
expandApplyGroups,
|
|
7
11
|
findClosingBrace,
|
|
8
12
|
hasRIActivation,
|
|
9
13
|
isAtRuleBoundary,
|
|
10
|
-
isAtRuleNameChar
|
|
11
|
-
|
|
12
|
-
} from "./chunk-W6XIBM4M.mjs";
|
|
14
|
+
isAtRuleNameChar
|
|
15
|
+
} from "./chunk-6DAHUFNU.mjs";
|
|
13
16
|
import {
|
|
14
17
|
devWarn
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5Y7EXXLS.mjs";
|
|
16
19
|
|
|
17
20
|
// src/integrations/vite.ts
|
|
18
21
|
import { existsSync } from "fs";
|
|
19
|
-
import { access,
|
|
22
|
+
import { access, readdir, readFile } from "fs/promises";
|
|
20
23
|
import { join, relative, resolve } from "path";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
|
|
25
|
+
// src/directives/postcss-safe.ts
|
|
26
|
+
var BODY_GRAMMAR = {
|
|
27
|
+
color: "removal",
|
|
28
|
+
text: "removal",
|
|
29
|
+
spacing: "removal",
|
|
30
|
+
breakpoint: "removal",
|
|
31
|
+
rounded: "removal",
|
|
32
|
+
shadow: "removal",
|
|
33
|
+
weight: "removal",
|
|
34
|
+
ease: "removal",
|
|
35
|
+
blur: "removal",
|
|
36
|
+
z: "removal",
|
|
37
|
+
animate: "removal",
|
|
38
|
+
leading: "removal",
|
|
39
|
+
tracking: "removal",
|
|
40
|
+
opacity: "removal",
|
|
41
|
+
duration: "removal",
|
|
42
|
+
fluid: "keyword",
|
|
43
|
+
font: "raw",
|
|
44
|
+
preflight: "raw",
|
|
45
|
+
utility: "raw",
|
|
46
|
+
custom: "raw",
|
|
47
|
+
source: "raw",
|
|
48
|
+
layer: "raw",
|
|
49
|
+
register: "raw"
|
|
50
|
+
};
|
|
51
|
+
var REMOVAL_BODY_DIRECTIVES = new Set(
|
|
52
|
+
DIRECTIVE_TYPE_NAMES.filter((n) => BODY_GRAMMAR[n] === "removal")
|
|
53
|
+
);
|
|
54
|
+
var KEYWORD_BODY_DIRECTIVES = new Set(
|
|
55
|
+
DIRECTIVE_TYPE_NAMES.filter((n) => BODY_GRAMMAR[n] === "keyword")
|
|
56
|
+
);
|
|
40
57
|
var REMOVAL_RE = /!([\w][\w-]*)\s*;/g;
|
|
41
58
|
var FLUID_KEYWORD_RE = /\b(no-parabolic|parabolic|no-shift|shift)\s*;?/g;
|
|
42
59
|
var COLOR_FLAG_RE = /(?<=[{;\s]|^)(inline|no-parabolic|parabolic)\s*(?:;|(?=}))/g;
|
|
@@ -148,6 +165,9 @@ function rewriteDirectiveBodies(code) {
|
|
|
148
165
|
if (last === 0) return code;
|
|
149
166
|
return out + code.slice(last);
|
|
150
167
|
}
|
|
168
|
+
|
|
169
|
+
// src/integrations/vite.ts
|
|
170
|
+
var CSS_FILE_RE = /\.(?:module\.)?css$/;
|
|
151
171
|
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist"]);
|
|
152
172
|
var POSTCSS_CONFIG_FILES = [
|
|
153
173
|
"postcss.config.js",
|
|
@@ -248,11 +268,12 @@ function rainbowindexVite() {
|
|
|
248
268
|
}
|
|
249
269
|
if (!isSourceFile(file)) return;
|
|
250
270
|
const extraModules = [];
|
|
271
|
+
const hmrModules = new Set(modules);
|
|
251
272
|
for (const cssFile of riCSSFiles) {
|
|
252
273
|
const mods = server.moduleGraph.getModulesByFile(cssFile);
|
|
253
274
|
if (mods) {
|
|
254
275
|
for (const mod of mods) {
|
|
255
|
-
if (!
|
|
276
|
+
if (!hmrModules.has(mod)) {
|
|
256
277
|
extraModules.push(mod);
|
|
257
278
|
}
|
|
258
279
|
}
|