@salty-css/core 0.0.1-alpha.3 → 0.0.1-alpha.300
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/.saltyrc.schema.json +48 -0
- package/README.md +490 -43
- package/bin/bin-util.d.ts +2 -0
- package/bin/index.cjs +2 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +3 -0
- package/bin/logger.d.ts +2 -0
- package/bin/main.cjs +11 -0
- package/bin/main.d.ts +1 -0
- package/bin/main.js +263 -0
- package/bin/prettier.d.ts +1 -0
- package/cache/resolve-dynamic-config-cache.cjs +1 -0
- package/cache/resolve-dynamic-config-cache.d.ts +1 -0
- package/cache/resolve-dynamic-config-cache.js +11 -0
- package/compiler/get-files.d.ts +3 -0
- package/compiler/get-function-range.d.ts +1 -0
- package/compiler/helpers.d.ts +2 -0
- package/compiler/index.cjs +1 -0
- package/compiler/index.d.ts +24 -0
- package/compiler/index.js +22 -0
- package/{dist/config → config}/define-config.d.ts +1 -1
- package/config/index.cjs +1 -0
- package/config/index.d.ts +3 -0
- package/config/index.js +14 -0
- package/css/index.cjs +1 -0
- package/css/index.d.ts +4 -0
- package/css/index.js +12 -0
- package/css/keyframes.cjs +1 -0
- package/css/keyframes.d.ts +22 -0
- package/css/keyframes.js +39 -0
- package/css/media.cjs +1 -0
- package/css/media.d.ts +87 -0
- package/css/media.js +88 -0
- package/css/merge.cjs +1 -0
- package/css/merge.d.ts +7 -0
- package/css/merge.js +5 -0
- package/dash-case-BJEkFEGQ.cjs +1 -0
- package/{dist/util/index.js → dash-case-DBThphLm.js} +5 -5
- package/define-templates-4A2yHcMF.js +52 -0
- package/define-templates-Cunsb_Tr.cjs +1 -0
- package/factories/define-global-styles.d.ts +7 -0
- package/factories/define-media-query.d.ts +8 -0
- package/factories/define-templates.d.ts +27 -0
- package/factories/define-variables.d.ts +12 -0
- package/factories/index.cjs +1 -0
- package/factories/index.d.ts +4 -0
- package/factories/index.js +30 -0
- package/generators/class-name-generator.d.ts +6 -0
- package/generators/index.cjs +1 -0
- package/generators/index.d.ts +2 -0
- package/generators/index.js +88 -0
- package/generators/styled-generator.d.ts +20 -0
- package/generators/styles-generator.d.ts +22 -0
- package/helpers/color.d.ts +18 -0
- package/helpers/index.cjs +1 -0
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +1183 -0
- package/helpers/viewport-clamp.d.ts +9 -0
- package/helpers-CC5pFyba.cjs +1 -0
- package/helpers-nHqH4L9L.js +11 -0
- package/{dist/config/index.cjs → index-84Wroia-.cjs} +1 -1
- package/index-CituHO0U.js +524 -0
- package/index-D_732b92.js +4 -0
- package/index-ol1Q_xul.cjs +41 -0
- package/package.json +88 -21
- package/parse-styles-B1E0JeC7.cjs +5 -0
- package/parse-styles-y_-drahL.js +161 -0
- package/parsers/index.cjs +2 -0
- package/parsers/index.d.ts +5 -0
- package/parsers/index.js +33 -0
- package/parsers/parse-modifiers.d.ts +3 -0
- package/parsers/parse-styles.d.ts +13 -0
- package/parsers/parse-templates.d.ts +4 -0
- package/parsers/parse-tokens.d.ts +3 -0
- package/parsers/parser-types.d.ts +8 -0
- package/parsers/property-name-check.d.ts +1 -0
- package/parsers/unit-check.d.ts +7 -0
- package/pascal-case-BQpR5PdN.js +6 -0
- package/pascal-case-iWoaJWwT.cjs +1 -0
- package/react-styled-file-CGVf5n1B.js +11 -0
- package/react-styled-file-Dkubsz-U.cjs +8 -0
- package/react-vanilla-file-CCXbsjIb.js +18 -0
- package/react-vanilla-file-CG_WJLam.cjs +15 -0
- package/salty.config-BhBY_oOk.js +10 -0
- package/salty.config-Dk6ZcCxI.cjs +7 -0
- package/server/index.cjs +1 -0
- package/server/index.d.ts +1 -0
- package/server/index.js +4 -0
- package/server/should-restart.d.ts +1 -0
- package/should-restart-C6VJ-qaY.js +12 -0
- package/should-restart-DAhvRrtu.cjs +1 -0
- package/templates/salty-reset.d.ts +2 -0
- package/types/cli-types.d.ts +10 -0
- package/types/config-types.d.ts +85 -0
- package/types/index.d.ts +97 -0
- package/util/camel-case.d.ts +1 -0
- package/util/dot-case.d.ts +1 -0
- package/util/index.cjs +1 -0
- package/util/index.d.ts +4 -0
- package/util/index.js +11 -0
- package/util/module-type.d.ts +1 -0
- package/util/pascal-case.d.ts +1 -0
- package/viewport-clamp-CaYwREKc.js +7 -0
- package/viewport-clamp-mq_DFtRR.cjs +1 -0
- package/dist/README.md +0 -107
- package/dist/compiler/index.cjs +0 -11
- package/dist/compiler/index.d.ts +0 -16
- package/dist/compiler/index.js +0 -180
- package/dist/config/config-types.d.ts +0 -59
- package/dist/config/index.d.ts +0 -2
- package/dist/config/index.js +0 -4
- package/dist/generator/index.cjs +0 -1
- package/dist/generator/index.d.ts +0 -1
- package/dist/generator/index.js +0 -51
- package/dist/generator/parse-modifiers.d.ts +0 -3
- package/dist/generator/parse-styles.d.ts +0 -2
- package/dist/generator/parse-templates.d.ts +0 -2
- package/dist/generator/parse-tokens.d.ts +0 -2
- package/dist/generator/parser-types.d.ts +0 -4
- package/dist/generator/style-generator.d.ts +0 -27
- package/dist/package.json +0 -50
- package/dist/parse-templates-BOSK0Tb6.js +0 -90
- package/dist/parse-templates-BY1Xai-_.cjs +0 -8
- package/dist/types/index.d.ts +0 -58
- package/dist/util/index.cjs +0 -1
- package/dist/util/index.d.ts +0 -2
- /package/{dist/css/index.cjs → css/token.cjs} +0 -0
- /package/{dist/css/index.d.ts → css/token.d.ts} +0 -0
- /package/{dist/css/index.js → css/token.js} +0 -0
- /package/{dist/types → types}/index.cjs +0 -0
- /package/{dist/types → types}/index.js +0 -0
- /package/{dist/types → types}/util-types.d.ts +0 -0
- /package/{dist/util → util}/dash-case.d.ts +0 -0
- /package/{dist/util → util}/to-hash.d.ts +0 -0
package/bin/main.js
ADDED
@@ -0,0 +1,263 @@
|
|
1
|
+
import { Command as ot } from "commander";
|
2
|
+
import { existsSync as Q, watch as rt } from "fs";
|
3
|
+
import { mkdir as q, readFile as S, writeFile as C } from "fs/promises";
|
4
|
+
import { join as a, relative as z, parse as ct, format as et } from "path";
|
5
|
+
import { render as lt } from "ejs";
|
6
|
+
import { l as e, a as h, g as K, i as dt, b as ft } from "../index-CituHO0U.js";
|
7
|
+
import { p as pt } from "../pascal-case-BQpR5PdN.js";
|
8
|
+
import { exec as gt } from "child_process";
|
9
|
+
import ut from "ora";
|
10
|
+
import { c as yt } from "../should-restart-C6VJ-qaY.js";
|
11
|
+
const st = (u) => new Promise((v, k) => {
|
12
|
+
gt(u, ($) => {
|
13
|
+
if ($) return k($);
|
14
|
+
v();
|
15
|
+
});
|
16
|
+
}), E = async (...u) => {
|
17
|
+
const v = u.map((J) => J.replace("-D", "").split("@").slice(0, -1).join("@").trim()).join(", "), k = ut(`Installing packages: ${v}`).start(), $ = u.join(" ");
|
18
|
+
await st(`npm install ${$}`), k.succeed(`Installed packages: ${v}`);
|
19
|
+
}, mt = () => Q(a(process.cwd(), "node_modules", ".bin", "prettier"));
|
20
|
+
async function j(u) {
|
21
|
+
try {
|
22
|
+
if (!mt()) return;
|
23
|
+
await st(`./node_modules/.bin/prettier --write "${u}"`), e.info(`Formatted ${u} with Prettier`);
|
24
|
+
} catch (v) {
|
25
|
+
e.error(`Error formatting ${u} with Prettier:`, v);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
async function Jt() {
|
29
|
+
const u = new ot();
|
30
|
+
u.name("salty-css").description("Salty-CSS CLI tool to help with annoying configuration tasks.");
|
31
|
+
const v = {
|
32
|
+
// Core files
|
33
|
+
"salty.config.ts": import("../salty.config-BhBY_oOk.js"),
|
34
|
+
"saltygen/index.css": import("../index-D_732b92.js"),
|
35
|
+
// React
|
36
|
+
"react/react-styled-file.ts": import("../react-styled-file-CGVf5n1B.js"),
|
37
|
+
"react/react-vanilla-file.ts": import("../react-vanilla-file-CCXbsjIb.js")
|
38
|
+
}, k = async (s, i) => {
|
39
|
+
const { default: d } = await v[s], l = lt(d, i);
|
40
|
+
return { fileName: s, content: l };
|
41
|
+
}, $ = async () => {
|
42
|
+
const s = a(process.cwd(), ".saltyrc.json");
|
43
|
+
return await S(s, "utf-8").then(JSON.parse).catch(() => ({}));
|
44
|
+
}, J = a(process.cwd(), "package.json"), O = async (s = J) => {
|
45
|
+
const i = await S(s, "utf-8").then(JSON.parse).catch(() => {
|
46
|
+
});
|
47
|
+
if (!i) throw "Could not read package.json file!";
|
48
|
+
return i;
|
49
|
+
}, nt = async (s, i = J) => {
|
50
|
+
typeof s == "object" && (s = JSON.stringify(s, null, 2)), await C(i, s);
|
51
|
+
}, X = async () => {
|
52
|
+
const s = new URL("../package.json", import.meta.url);
|
53
|
+
return O(s);
|
54
|
+
}, Y = await (async () => (await $()).defaultProject)(), N = await X(), A = {
|
55
|
+
core: `@salty-css/core@${N.version}`,
|
56
|
+
react: `@salty-css/react@${N.version}`,
|
57
|
+
eslintConfigCore: `@salty-css/eslint-config-core@${N.version}`,
|
58
|
+
vite: `@salty-css/vite@${N.version}`,
|
59
|
+
next: `@salty-css/next@${N.version}`
|
60
|
+
}, G = (s) => {
|
61
|
+
const i = s === "." ? "" : s, d = process.cwd();
|
62
|
+
return a(d, i);
|
63
|
+
};
|
64
|
+
u.command("init [directory]").description("Initialize a new Salty-CSS project.").option("-d, --dir <dir>", "Project directory to initialize the project in.").option("--css-file <css-file>", "Existing CSS file where to import the generated CSS. Path must be relative to the given project directory.").option("--skip-install", "Skip installing dependencies.").action(async function(s = ".") {
|
65
|
+
if (!await O().catch(() => {
|
66
|
+
})) return h("Salty CSS project must be initialized in a directory with a package.json file.");
|
67
|
+
e.info("Initializing a new Salty-CSS project!");
|
68
|
+
const { dir: d = s, cssFile: l, skipInstall: p } = this.opts();
|
69
|
+
if (!d) return h("Project directory must be provided. Add it as the first argument after init command or use the --dir option.");
|
70
|
+
p || await E(A.core, A.react);
|
71
|
+
const r = process.cwd(), o = G(d), T = await Promise.all([k("salty.config.ts"), k("saltygen/index.css")]);
|
72
|
+
await q(o, { recursive: !0 });
|
73
|
+
const y = T.map(async ({ fileName: t, content: g }) => {
|
74
|
+
const c = a(o, t);
|
75
|
+
if (await S(c, "utf-8").catch(() => {
|
76
|
+
}) !== void 0) {
|
77
|
+
e.debug("File already exists: " + c);
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
const b = t.split("/").slice(0, -1).join("/");
|
81
|
+
b && await q(a(o, b), { recursive: !0 }), e.info("Creating file: " + c), await C(c, g), await j(c);
|
82
|
+
});
|
83
|
+
await Promise.all(y);
|
84
|
+
const w = z(r, o) || ".", m = a(r, ".saltyrc.json"), f = await S(m, "utf-8").catch(() => {
|
85
|
+
});
|
86
|
+
if (f === void 0) {
|
87
|
+
e.info("Creating file: " + m);
|
88
|
+
const g = JSON.stringify({
|
89
|
+
$schema: "./node_modules/@salty-css/core/.saltyrc.schema.json",
|
90
|
+
info: "This file is used to define projects and their configurations for Salty CSS cli. Do not delete, modify or add this file to .gitignore.",
|
91
|
+
defaultProject: w,
|
92
|
+
projects: [
|
93
|
+
{
|
94
|
+
dir: w,
|
95
|
+
framework: "react"
|
96
|
+
}
|
97
|
+
]
|
98
|
+
}, null, 2);
|
99
|
+
await C(m, g), await j(m);
|
100
|
+
} else {
|
101
|
+
const t = JSON.parse(f), g = (t == null ? void 0 : t.projects) || [];
|
102
|
+
if (g.findIndex((n) => n.dir === w) === -1) {
|
103
|
+
g.push({ dir: w, framework: "react" }), t.projects = [...g];
|
104
|
+
const n = JSON.stringify(t, null, 2);
|
105
|
+
n !== f && (e.info("Edit file: " + m), await C(m, n), await j(m));
|
106
|
+
}
|
107
|
+
}
|
108
|
+
const P = a(r, ".gitignore"), H = await S(P, "utf-8").catch(() => {
|
109
|
+
});
|
110
|
+
H !== void 0 && (H.includes("saltygen") || (e.info("Edit file: " + P), await C(P, H + `
|
111
|
+
|
112
|
+
# Salty-CSS
|
113
|
+
saltygen
|
114
|
+
`)));
|
115
|
+
const F = ["src", "public", "assets", "styles", "css", "app"], M = ["styles", "css", "app", "pages"], B = ["index", "styles", "main", "app", "global", "globals"], U = [".css", ".scss", ".sass"], D = await (async () => {
|
116
|
+
if (l) return l;
|
117
|
+
for (const t of F)
|
118
|
+
for (const g of B)
|
119
|
+
for (const c of U) {
|
120
|
+
const n = a(o, t, g + c);
|
121
|
+
if (await S(n, "utf-8").catch(() => {
|
122
|
+
}) !== void 0) return z(o, n);
|
123
|
+
for (const L of M) {
|
124
|
+
const R = a(o, t, L, g + c);
|
125
|
+
if (await S(R, "utf-8").catch(() => {
|
126
|
+
}) !== void 0) return z(o, R);
|
127
|
+
}
|
128
|
+
}
|
129
|
+
})();
|
130
|
+
if (D) {
|
131
|
+
const t = a(o, D), g = await S(t, "utf-8").catch(() => {
|
132
|
+
});
|
133
|
+
if (g !== void 0 && !g.includes("saltygen")) {
|
134
|
+
const n = a(t, ".."), L = `@import '${z(n, a(o, "saltygen/index.css"))}';`;
|
135
|
+
e.info("Adding global import statement to CSS file: " + t), await C(t, L + `
|
136
|
+
` + g), await j(t);
|
137
|
+
}
|
138
|
+
} else
|
139
|
+
e.warn("Could not find a CSS file to import the generated CSS. Please add it manually.");
|
140
|
+
const at = {
|
141
|
+
projectJs: a(o, "eslint.config.js"),
|
142
|
+
rootJs: a(r, "eslint.config.js"),
|
143
|
+
projectMjs: a(o, "eslint.config.mjs"),
|
144
|
+
rootMjs: a(r, "eslint.config.mjs"),
|
145
|
+
projectJson: a(o, ".eslintrc.json"),
|
146
|
+
rootJson: a(r, ".eslintrc.json")
|
147
|
+
}, x = Object.values(at).find((t) => Q(t));
|
148
|
+
if (x) {
|
149
|
+
p || await E(A.eslintConfigCore);
|
150
|
+
const t = await S(x, "utf-8").catch(() => {
|
151
|
+
});
|
152
|
+
if (!t) return h("Could not read ESLint config file.");
|
153
|
+
if (!t.includes("salty-css"))
|
154
|
+
if (e.info("Edit file: " + x), x.endsWith("js")) {
|
155
|
+
let n = `import saltyCss from "@salty-css/eslint-config-core/flat";
|
156
|
+
${t}`;
|
157
|
+
t.includes("typescript-eslint") ? n.includes(".config(") ? n = n.replace(".config(", ".config(saltyCss,") : e.warn("Could not find the correct place to add the Salty-CSS config for ESLint. Please add it manually.") : n.includes("export default [") ? n = n.replace("export default [", "export default [ saltyCss,") : n.includes("eslintConfig = [") ? n = n.replace("eslintConfig = [", "eslintConfig = [ saltyCss,") : e.warn("Could not find the correct place to add the Salty-CSS config for ESLint. Please add it manually."), await C(x, n), await j(x);
|
158
|
+
} else {
|
159
|
+
const c = JSON.parse(t);
|
160
|
+
c.extends || (c.extends = []), c.extends.push("@salty-css/core");
|
161
|
+
const n = JSON.stringify(c, null, 2);
|
162
|
+
await C(x, n), await j(x);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
const W = a(o, "vite.config.ts"), V = await S(W, "utf-8").catch(() => {
|
166
|
+
});
|
167
|
+
if (V !== void 0 && !V.includes("saltyPlugin")) {
|
168
|
+
e.info("Edit file: " + W);
|
169
|
+
const g = `import { saltyPlugin } from '@salty-css/vite';
|
170
|
+
`, n = V.replace(/(plugins: \[)/, `$1
|
171
|
+
saltyPlugin(__dirname),`);
|
172
|
+
p || await E(`-D ${A.vite}`), e.info("Adding Salty-CSS plugin to Vite config..."), await C(W, g + n), await j(W);
|
173
|
+
}
|
174
|
+
const _ = ["next.config.js", "next.config.cjs", "next.config.ts", "next.config.mjs"].map((t) => a(o, t)).find((t) => Q(t));
|
175
|
+
if (_) {
|
176
|
+
let t = await S(_, "utf-8").catch(() => {
|
177
|
+
});
|
178
|
+
if (t !== void 0 && !t.includes("withSaltyCss")) {
|
179
|
+
let c = !1;
|
180
|
+
/\splugins([^=]*)=[^[]\[/.test(t) && !c && (t = t.replace(/\splugins([^=]*)=[^[]\[/, (R, I) => ` plugins${I}= [withSaltyCss,`), c = !0);
|
181
|
+
const b = t.includes("module.exports"), L = b ? `const { withSaltyCss } = require('@salty-css/next');
|
182
|
+
` : `import { withSaltyCss } from '@salty-css/next';
|
183
|
+
`;
|
184
|
+
b && !c ? (t = t.replace(/module.exports = ([^;]+)/, (R, I) => `module.exports = withSaltyCss(${I})`), c = !0) : c || (t = t.replace(/export default ([^;]+)/, (R, I) => `export default withSaltyCss(${I})`)), p || await E(`-D ${A.next}`), e.info("Adding Salty-CSS plugin to Next.js config..."), await C(_, L + t), await j(_);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
const it = await O().catch(() => h("Could not read package.json file.")).then((t) => (t.scripts || (t.scripts = {}), t.scripts.prepare ? t.scripts.prepare.includes("salty-css") || (e.info("Edit file: " + J), t.scripts.prepare = t.scripts.prepare + " && npx salty-css build") : (e.info("Edit file: " + J), t.scripts.prepare = "npx salty-css build"), t));
|
188
|
+
await nt(it), e.info("Running the build to generate initial CSS..."), await K(o), e.info("🎉 Salty CSS project initialized successfully!"), e.info("Next steps:"), e.info("1. Configure variables and templates in `salty.config.ts`"), e.info("2. Create a new component with `npx salty-css generate [component-name]`"), e.info("3. Run `npx salty-css build` to generate the CSS"), e.info("4. Read about the features in the documentation: https://salty-css.dev"), e.info("5. Star the project on GitHub: https://github.com/margarita-form/salty-css ⭐");
|
189
|
+
}), u.command("build [directory]").alias("b").description("Build the Salty-CSS project.").option("-d, --dir <dir>", "Project directory to build the project in.").option("--watch", "Watch for changes and rebuild the project.").action(async function(s = Y) {
|
190
|
+
e.info("Building the Salty-CSS project...");
|
191
|
+
const { dir: i = s, watch: d } = this.opts();
|
192
|
+
if (!i) return h("Project directory must be provided. Add it as the first argument after build command or use the --dir option.");
|
193
|
+
const l = G(i);
|
194
|
+
await K(l), d && (e.info("Watching for changes in the project directory..."), rt(l, { recursive: !0 }, async (p, r) => {
|
195
|
+
await yt(r) ? await K(l, !1, !1) : dt(r) && await ft(l, r);
|
196
|
+
}));
|
197
|
+
}), u.command("generate [file] [directory]").alias("g").description("Generate a new component file.").option("-f, --file <file>", "File to generate.").option("-d, --dir <dir>", "Project directory to generate the file in.").option("-t, --tag <tag>", "HTML tag of the component.", "div").option("-n, --name <name>", "Name of the component.").option("-c, --className <className>", "CSS class of the component.").option("-r, --reactComponent", "Generate a React component as well.").action(async function(s, i = Y) {
|
198
|
+
const { file: d = s, dir: l = i, tag: p, name: r, className: o, reactComponent: T = !1 } = this.opts();
|
199
|
+
if (!d) return h("File to generate must be provided. Add it as the first argument after generate command or use the --file option.");
|
200
|
+
if (!l) return h("Project directory must be provided. Add it as the second argument after generate command or use the --dir option.");
|
201
|
+
const y = G(l), w = d.split("/").slice(0, -1).join("/");
|
202
|
+
w && await q(a(y, w), { recursive: !0 });
|
203
|
+
const m = a(y, d), f = ct(m);
|
204
|
+
f.ext || (f.ext = ".ts"), f.name.endsWith(".css") || (f.name = f.name + ".css"), f.base = f.name + f.ext;
|
205
|
+
const P = et(f);
|
206
|
+
if (await S(P, "utf-8").catch(() => {
|
207
|
+
}) !== void 0) {
|
208
|
+
e.error("File already exists:", P);
|
209
|
+
return;
|
210
|
+
}
|
211
|
+
let F = pt(r || f.base.replace(/\.css\.\w+$/, ""));
|
212
|
+
if (T) {
|
213
|
+
const B = F + "Component";
|
214
|
+
F = F + "Wrapper";
|
215
|
+
const U = f.base.replace(/\.css\.\w+$/, ""), { content: tt } = await k("react/react-vanilla-file.ts", { tag: p, componentName: B, styledComponentName: F, className: o, fileName: U });
|
216
|
+
f.name = U.replace(/\.css$/, ""), f.ext = ".tsx", f.base = f.name + f.ext;
|
217
|
+
const D = et(f);
|
218
|
+
e.info("Generating a new file: " + D), await C(D, tt), await j(D);
|
219
|
+
}
|
220
|
+
const { content: M } = await k("react/react-styled-file.ts", { tag: p, name: F, className: o });
|
221
|
+
e.info("Generating a new file: " + P), await C(P, M), await j(P);
|
222
|
+
});
|
223
|
+
const Z = async () => {
|
224
|
+
const s = a(process.cwd(), "package.json"), i = await O(s).catch((p) => h(p));
|
225
|
+
if (!i) return h("Could not read package.json file.");
|
226
|
+
const d = { ...i.dependencies, ...i.devDependencies }, l = Object.entries(d).filter(([p]) => p === "salty-css" || p.startsWith("@salty-css/"));
|
227
|
+
return l.length ? l : h(
|
228
|
+
"No Salty-CSS packages found in package.json. Make sure you are running update command in the same directory! Used package.json path: " + s
|
229
|
+
);
|
230
|
+
};
|
231
|
+
u.command("update [version]").alias("up").description("Update Salty-CSS packages to the latest or specified version.").option("-v, --version <version>", "Version to update to.").option("--legacy-peer-deps <legacyPeerDeps>", "Use legacy peer dependencies (not recommended).", !1).action(async function(s = "latest") {
|
232
|
+
const { legacyPeerDeps: i, version: d = s } = this.opts(), l = await Z();
|
233
|
+
if (!l) return h("Could not update Salty-CSS packages as any were found in package.json.");
|
234
|
+
const p = l.map(([y]) => d === "@" ? `${y}@${N.version}` : `${y}@${d.replace(/^@/, "")}`);
|
235
|
+
i ? (e.warn("Using legacy peer dependencies to update packages."), await E(...p, "--legacy-peer-deps")) : await E(...p);
|
236
|
+
const r = await Z();
|
237
|
+
if (!r) return h("Something went wrong while reading the updated packages.");
|
238
|
+
const o = r.reduce((y, [w, m]) => (y[m] || (y[m] = []), y[m].push(w), y), {});
|
239
|
+
if (Object.keys(o).length === 1) {
|
240
|
+
const w = Object.keys(o)[0].replace(/^\^/, "");
|
241
|
+
e.info(`Updated to all Salty CSS packages successfully to ${w}`);
|
242
|
+
} else
|
243
|
+
for (const [y, w] of Object.entries(o)) {
|
244
|
+
const m = y.replace(/^\^/, "");
|
245
|
+
e.info(`Updated to ${m}: ${w.join(", ")}`);
|
246
|
+
}
|
247
|
+
}), u.option("-v, --version", "Show the current version of Salty-CSS.").action(async function() {
|
248
|
+
const s = await X();
|
249
|
+
e.info("CLI is running: " + s.version);
|
250
|
+
const i = a(process.cwd(), "package.json"), d = await O(i).catch((r) => h(r));
|
251
|
+
if (!d) return;
|
252
|
+
const l = { ...d.dependencies, ...d.devDependencies }, p = Object.keys(l).filter((r) => r === "salty-css" || r.startsWith("@salty-css/"));
|
253
|
+
if (!p.length)
|
254
|
+
return h(
|
255
|
+
"No Salty-CSS packages found in package.json. Make sure you are running update command in the same directory! Used package.json path: " + i
|
256
|
+
);
|
257
|
+
for (const r of p)
|
258
|
+
e.info(`${r}: ${l[r]}`);
|
259
|
+
}), u.parseAsync(process.argv);
|
260
|
+
}
|
261
|
+
export {
|
262
|
+
Jt as main
|
263
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function formatWithPrettier(filePath: string): Promise<void>;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("fs/promises"),r=require("path"),t=require("../helpers-CC5pFyba.cjs"),i=async()=>{const o=t.getCorePackageRoot(),c=r.join(o,"cache/config-cache.json"),e=await n.readFile(c,"utf8");if(!e)throw new Error("Could not find config cache file");return JSON.parse(e)};exports.resolveDynamicConfigCache=i;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const resolveDynamicConfigCache: () => Promise<any>;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { readFile as r } from "fs/promises";
|
2
|
+
import { join as t } from "path";
|
3
|
+
import { g as n } from "../helpers-nHqH4L9L.js";
|
4
|
+
const s = async () => {
|
5
|
+
const e = n(), c = t(e, "cache/config-cache.json"), o = await r(c, "utf8");
|
6
|
+
if (!o) throw new Error("Could not find config cache file");
|
7
|
+
return JSON.parse(o);
|
8
|
+
};
|
9
|
+
export {
|
10
|
+
s as resolveDynamicConfigCache
|
11
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const getFunctionRange: (contents: string, name: string) => Promise<[number, number]>;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("esbuild");require("child_process");require("../dash-case-BJEkFEGQ.cjs");require("path");require("fs");require("fs/promises");require("../parse-styles-B1E0JeC7.cjs");require("../parsers/index.cjs");const e=require("../index-ol1Q_xul.cjs");require("../css/merge.cjs");require("../define-templates-Cunsb_Tr.cjs");require("../helpers-CC5pFyba.cjs");exports.compileSaltyFile=e.compileSaltyFile;exports.generateConfigStyles=e.generateConfigStyles;exports.generateCss=e.generateCss;exports.generateFile=e.generateFile;exports.isSaltyFile=e.isSaltyFile;exports.minimizeFile=e.minimizeFile;exports.saltyFileExtensions=e.saltyFileExtensions;exports.saltyFileRegExp=e.saltyFileRegExp;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
export declare const saltyFileExtensions: string[];
|
2
|
+
export declare const saltyFileRegExp: (additional?: string[]) => RegExp;
|
3
|
+
export declare const isSaltyFile: (file: string, additional?: string[]) => boolean;
|
4
|
+
export declare const generateConfigStyles: (dirname: string, configFiles: Set<string>) => Promise<void>;
|
5
|
+
export declare const compileSaltyFile: (dirname: string, sourceFilePath: string, outputDirectory: string) => Promise<{
|
6
|
+
contents: {
|
7
|
+
[key: string]: {
|
8
|
+
generator: any;
|
9
|
+
isClassName?: boolean;
|
10
|
+
isMedia?: boolean;
|
11
|
+
isGlobalDefine?: boolean;
|
12
|
+
isDefineVariables?: boolean;
|
13
|
+
isDefineTemplates?: boolean;
|
14
|
+
isKeyframes?: boolean;
|
15
|
+
animationName?: string;
|
16
|
+
css?: Promise<string>;
|
17
|
+
styles?: any;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
outputFilePath: string;
|
21
|
+
}>;
|
22
|
+
export declare const generateCss: (dirname: string, prod?: boolean, clean?: boolean) => Promise<void>;
|
23
|
+
export declare const generateFile: (dirname: string, file: string, prod?: boolean) => Promise<void>;
|
24
|
+
export declare const minimizeFile: (dirname: string, file: string, prod?: boolean) => Promise<string | undefined>;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import "esbuild";
|
2
|
+
import "child_process";
|
3
|
+
import "../dash-case-DBThphLm.js";
|
4
|
+
import "path";
|
5
|
+
import "fs";
|
6
|
+
import "fs/promises";
|
7
|
+
import "../parse-styles-y_-drahL.js";
|
8
|
+
import "../parsers/index.js";
|
9
|
+
import { e as y, d as x, g as S, b as c, i as f, m as C, s as E, c as b } from "../index-CituHO0U.js";
|
10
|
+
import "../css/merge.js";
|
11
|
+
import "../define-templates-4A2yHcMF.js";
|
12
|
+
import "../helpers-nHqH4L9L.js";
|
13
|
+
export {
|
14
|
+
y as compileSaltyFile,
|
15
|
+
x as generateConfigStyles,
|
16
|
+
S as generateCss,
|
17
|
+
c as generateFile,
|
18
|
+
f as isSaltyFile,
|
19
|
+
C as minimizeFile,
|
20
|
+
E as saltyFileExtensions,
|
21
|
+
b as saltyFileRegExp
|
22
|
+
};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { SaltyConfig } from '
|
1
|
+
import { SaltyConfig } from '../types/config-types';
|
2
2
|
export declare const defineConfig: <T extends SaltyConfig>(config: T) => T;
|
package/config/index.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../factories/index.cjs"),a=require("../define-templates-Cunsb_Tr.cjs"),i=t=>t;exports.GlobalStylesFactory=e.GlobalStylesFactory;exports.VariablesFactory=e.VariablesFactory;exports.defineGlobalStyles=e.defineGlobalStyles;exports.defineMediaQuery=e.defineMediaQuery;exports.defineVariables=e.defineVariables;exports.TemplateFactory=a.TemplateFactory;exports.TemplatesFactory=a.TemplatesFactory;exports.defineTemplates=a.defineTemplates;exports.defineConfig=i;
|
package/config/index.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
import { GlobalStylesFactory as o, VariablesFactory as l, defineGlobalStyles as s, defineMediaQuery as i, defineVariables as f } from "../factories/index.js";
|
2
|
+
import { T as d, a as y, d as p } from "../define-templates-4A2yHcMF.js";
|
3
|
+
const a = (e) => e;
|
4
|
+
export {
|
5
|
+
o as GlobalStylesFactory,
|
6
|
+
d as TemplateFactory,
|
7
|
+
y as TemplatesFactory,
|
8
|
+
l as VariablesFactory,
|
9
|
+
a as defineConfig,
|
10
|
+
s as defineGlobalStyles,
|
11
|
+
i as defineMediaQuery,
|
12
|
+
p as defineTemplates,
|
13
|
+
f as defineVariables
|
14
|
+
};
|
package/css/index.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./keyframes.cjs"),e=require("./media.cjs"),t=require("./token.cjs"),r=require("./merge.cjs");exports.keyframes=s.keyframes;exports.MediaQueryFactory=e.MediaQueryFactory;exports.media=e.media;exports.token=t.token;exports.mergeFactories=r.mergeFactories;exports.mergeObjects=r.mergeObjects;
|
package/css/index.d.ts
ADDED
package/css/index.js
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
import { keyframes as o } from "./keyframes.js";
|
2
|
+
import { MediaQueryFactory as t, media as a } from "./media.js";
|
3
|
+
import { token as p } from "./token.js";
|
4
|
+
import { mergeFactories as c, mergeObjects as i } from "./merge.js";
|
5
|
+
export {
|
6
|
+
t as MediaQueryFactory,
|
7
|
+
o as keyframes,
|
8
|
+
a as media,
|
9
|
+
c as mergeFactories,
|
10
|
+
i as mergeObjects,
|
11
|
+
p as token
|
12
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../parse-styles-B1E0JeC7.cjs"),O=require("../dash-case-BJEkFEGQ.cjs"),h=({animationName:l,params:y,appendInitialStyles:$,...t})=>{const i=async(d={})=>{const n=l||O.toHash(t),r=async()=>{const{duration:s="500ms",easing:e="ease-in-out",delay:o="0s",iterationCount:c="1",direction:g="normal",fillMode:b="forwards",playState:j="running"}={...y,...d},a=`${n} ${s} ${e} ${o} ${c} ${g} ${b} ${j}`;if(!$)return a;const m=t.from||t["0%"];if(!m)return a;const w=await u.parseAndJoinStyles(m,"");return`${a};${w}`},f=Object.entries(t).map(async([s,e])=>{if(!e)return"";const o=await u.parseAndJoinStyles(e,"");return`${typeof s=="number"?`${s}%`:s}{${o}}`}),S=(await Promise.all(f)).join(""),p=`@keyframes ${n} {${S}}`;return Object.assign(r,{toString:r,isKeyframes:!0,animationName:n,css:p,keyframes:t}),r};return Object.assign(i,{_shouldResolve:!0}),i};exports.keyframes=h;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { CssStyles, StyleValue } from '../types';
|
2
|
+
type KeyframeKeys = number | 'from' | 'to' | `${number}%`;
|
3
|
+
type Keyframes = {
|
4
|
+
[key in KeyframeKeys]?: CssStyles;
|
5
|
+
};
|
6
|
+
interface KeyframesConfig {
|
7
|
+
animationName?: string;
|
8
|
+
appendInitialStyles?: boolean;
|
9
|
+
params?: KeyframesParams;
|
10
|
+
}
|
11
|
+
interface KeyframesParams {
|
12
|
+
duration?: string;
|
13
|
+
delay?: string;
|
14
|
+
iterationCount?: string | number;
|
15
|
+
easing?: StyleValue<'animationTimingFunction'>;
|
16
|
+
direction?: StyleValue<'animationDirection'>;
|
17
|
+
fillMode?: StyleValue<'animationFillMode'>;
|
18
|
+
playState?: StyleValue<'animationPlayState'>;
|
19
|
+
}
|
20
|
+
type KeyframesProps = Keyframes & KeyframesConfig;
|
21
|
+
export declare const keyframes: ({ animationName: _name, params: _params, appendInitialStyles, ...keyframes }: KeyframesProps) => (params?: KeyframesParams) => Promise<() => Promise<string>>;
|
22
|
+
export {};
|
package/css/keyframes.js
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
import { p as $ } from "../parse-styles-y_-drahL.js";
|
2
|
+
import { t as O } from "../dash-case-DBThphLm.js";
|
3
|
+
const N = ({ animationName: u, params: f, appendInitialStyles: l, ...t }) => {
|
4
|
+
const i = async (y = {}) => {
|
5
|
+
const r = u || O(t), e = async () => {
|
6
|
+
const {
|
7
|
+
duration: s = "500ms",
|
8
|
+
easing: n = "ease-in-out",
|
9
|
+
delay: o = "0s",
|
10
|
+
iterationCount: c = "1",
|
11
|
+
direction: S = "normal",
|
12
|
+
fillMode: b = "forwards",
|
13
|
+
playState: j = "running"
|
14
|
+
} = { ...f, ...y }, a = `${r} ${s} ${n} ${o} ${c} ${S} ${b} ${j}`;
|
15
|
+
if (!l) return a;
|
16
|
+
const m = t.from || t["0%"];
|
17
|
+
if (!m) return a;
|
18
|
+
const w = await $(m, "");
|
19
|
+
return `${a};${w}`;
|
20
|
+
}, d = Object.entries(t).map(async ([s, n]) => {
|
21
|
+
if (!n) return "";
|
22
|
+
const o = await $(n, "");
|
23
|
+
return `${typeof s == "number" ? `${s}%` : s}{${o}}`;
|
24
|
+
}), p = (await Promise.all(d)).join(""), g = `@keyframes ${r} {${p}}`;
|
25
|
+
return Object.assign(e, {
|
26
|
+
toString: e,
|
27
|
+
isKeyframes: !0,
|
28
|
+
animationName: r,
|
29
|
+
css: g,
|
30
|
+
keyframes: t
|
31
|
+
}), e;
|
32
|
+
};
|
33
|
+
return Object.assign(i, {
|
34
|
+
_shouldResolve: !0
|
35
|
+
}), i;
|
36
|
+
};
|
37
|
+
export {
|
38
|
+
N as keyframes
|
39
|
+
};
|
package/css/media.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var a=Object.defineProperty;var o=(s,e,t)=>e in s?a(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var i=(s,e,t)=>o(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r{constructor(e="@media"){i(this,"next",e=>{const t=new String(e);return Object.assign(t,{get isMedia(){return!0},get and(){return new r(`${e} and`)},get or(){return new r(`${e},`)}}),t});this.base=e}custom(e){return this.next(`${this.base} ${e}`)}minWidth(e){const t=typeof e=="number"?`${e}px`:e,n=`${this.base} (min-width: ${t})`;return this.next(n)}maxWidth(e){const t=typeof e=="number"?`${e}px`:e,n=`${this.base} (max-width: ${t})`;return this.next(n)}minHeight(e){const t=typeof e=="number"?`${e}px`:e,n=`${this.base} (min-height: ${t})`;return this.next(n)}maxHeight(e){const t=typeof e=="number"?`${e}px`:e,n=`${this.base} (max-height: ${t})`;return this.next(n)}get portrait(){const e=`${this.base} (orientation: portrait)`;return this.next(e)}get landscape(){const e=`${this.base} (orientation: landscape)`;return this.next(e)}prefersColorScheme(e){const t=`${this.base} (prefers-color-scheme: ${e})`;return this.next(t)}get dark(){return this.prefersColorScheme("dark")}get light(){return this.prefersColorScheme("light")}get print(){const e=`${this.base} print`;return this.next(e)}get screen(){const e=`${this.base} screen`;return this.next(e)}get speech(){const e=`${this.base} speech`;return this.next(e)}get all(){const e=`${this.base} all`;return this.next(e)}get not(){const e=`${this.base} not`;return this.next(e)}get reducedMotion(){const e=`${this.base} (prefers-reduced-motion: reduce)`;return this.next(e)}}const u=new r;exports.MediaQueryFactory=r;exports.media=u;
|
package/css/media.d.ts
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
import { OrString, OrNumber } from '../types/util-types';
|
2
|
+
export declare class MediaQueryFactory {
|
3
|
+
private base;
|
4
|
+
constructor(base?: string);
|
5
|
+
private next;
|
6
|
+
custom(value: string): string & {
|
7
|
+
isMedia: boolean;
|
8
|
+
and: MediaQueryFactory;
|
9
|
+
or: MediaQueryFactory;
|
10
|
+
};
|
11
|
+
minWidth(width: OrString | OrNumber): string & {
|
12
|
+
isMedia: boolean;
|
13
|
+
and: MediaQueryFactory;
|
14
|
+
or: MediaQueryFactory;
|
15
|
+
};
|
16
|
+
maxWidth(width: OrString | OrNumber): string & {
|
17
|
+
isMedia: boolean;
|
18
|
+
and: MediaQueryFactory;
|
19
|
+
or: MediaQueryFactory;
|
20
|
+
};
|
21
|
+
minHeight(height: OrString | OrNumber): string & {
|
22
|
+
isMedia: boolean;
|
23
|
+
and: MediaQueryFactory;
|
24
|
+
or: MediaQueryFactory;
|
25
|
+
};
|
26
|
+
maxHeight(height: OrString | OrNumber): string & {
|
27
|
+
isMedia: boolean;
|
28
|
+
and: MediaQueryFactory;
|
29
|
+
or: MediaQueryFactory;
|
30
|
+
};
|
31
|
+
get portrait(): string & {
|
32
|
+
isMedia: boolean;
|
33
|
+
and: MediaQueryFactory;
|
34
|
+
or: MediaQueryFactory;
|
35
|
+
};
|
36
|
+
get landscape(): string & {
|
37
|
+
isMedia: boolean;
|
38
|
+
and: MediaQueryFactory;
|
39
|
+
or: MediaQueryFactory;
|
40
|
+
};
|
41
|
+
prefersColorScheme(scheme: 'dark' | 'light' | OrString): string & {
|
42
|
+
isMedia: boolean;
|
43
|
+
and: MediaQueryFactory;
|
44
|
+
or: MediaQueryFactory;
|
45
|
+
};
|
46
|
+
get dark(): string & {
|
47
|
+
isMedia: boolean;
|
48
|
+
and: MediaQueryFactory;
|
49
|
+
or: MediaQueryFactory;
|
50
|
+
};
|
51
|
+
get light(): string & {
|
52
|
+
isMedia: boolean;
|
53
|
+
and: MediaQueryFactory;
|
54
|
+
or: MediaQueryFactory;
|
55
|
+
};
|
56
|
+
get print(): string & {
|
57
|
+
isMedia: boolean;
|
58
|
+
and: MediaQueryFactory;
|
59
|
+
or: MediaQueryFactory;
|
60
|
+
};
|
61
|
+
get screen(): string & {
|
62
|
+
isMedia: boolean;
|
63
|
+
and: MediaQueryFactory;
|
64
|
+
or: MediaQueryFactory;
|
65
|
+
};
|
66
|
+
get speech(): string & {
|
67
|
+
isMedia: boolean;
|
68
|
+
and: MediaQueryFactory;
|
69
|
+
or: MediaQueryFactory;
|
70
|
+
};
|
71
|
+
get all(): string & {
|
72
|
+
isMedia: boolean;
|
73
|
+
and: MediaQueryFactory;
|
74
|
+
or: MediaQueryFactory;
|
75
|
+
};
|
76
|
+
get not(): string & {
|
77
|
+
isMedia: boolean;
|
78
|
+
and: MediaQueryFactory;
|
79
|
+
or: MediaQueryFactory;
|
80
|
+
};
|
81
|
+
get reducedMotion(): string & {
|
82
|
+
isMedia: boolean;
|
83
|
+
and: MediaQueryFactory;
|
84
|
+
or: MediaQueryFactory;
|
85
|
+
};
|
86
|
+
}
|
87
|
+
export declare const media: MediaQueryFactory;
|
package/css/media.js
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
var a = Object.defineProperty;
|
2
|
+
var o = (s, t, e) => t in s ? a(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
3
|
+
var i = (s, t, e) => o(s, typeof t != "symbol" ? t + "" : t, e);
|
4
|
+
class r {
|
5
|
+
constructor(t = "@media") {
|
6
|
+
i(this, "next", (t) => {
|
7
|
+
const e = new String(t);
|
8
|
+
return Object.assign(e, {
|
9
|
+
get isMedia() {
|
10
|
+
return !0;
|
11
|
+
},
|
12
|
+
get and() {
|
13
|
+
return new r(`${t} and`);
|
14
|
+
},
|
15
|
+
get or() {
|
16
|
+
return new r(`${t},`);
|
17
|
+
}
|
18
|
+
}), e;
|
19
|
+
});
|
20
|
+
this.base = t;
|
21
|
+
}
|
22
|
+
custom(t) {
|
23
|
+
return this.next(`${this.base} ${t}`);
|
24
|
+
}
|
25
|
+
minWidth(t) {
|
26
|
+
const e = typeof t == "number" ? `${t}px` : t, n = `${this.base} (min-width: ${e})`;
|
27
|
+
return this.next(n);
|
28
|
+
}
|
29
|
+
maxWidth(t) {
|
30
|
+
const e = typeof t == "number" ? `${t}px` : t, n = `${this.base} (max-width: ${e})`;
|
31
|
+
return this.next(n);
|
32
|
+
}
|
33
|
+
minHeight(t) {
|
34
|
+
const e = typeof t == "number" ? `${t}px` : t, n = `${this.base} (min-height: ${e})`;
|
35
|
+
return this.next(n);
|
36
|
+
}
|
37
|
+
maxHeight(t) {
|
38
|
+
const e = typeof t == "number" ? `${t}px` : t, n = `${this.base} (max-height: ${e})`;
|
39
|
+
return this.next(n);
|
40
|
+
}
|
41
|
+
get portrait() {
|
42
|
+
const t = `${this.base} (orientation: portrait)`;
|
43
|
+
return this.next(t);
|
44
|
+
}
|
45
|
+
get landscape() {
|
46
|
+
const t = `${this.base} (orientation: landscape)`;
|
47
|
+
return this.next(t);
|
48
|
+
}
|
49
|
+
prefersColorScheme(t) {
|
50
|
+
const e = `${this.base} (prefers-color-scheme: ${t})`;
|
51
|
+
return this.next(e);
|
52
|
+
}
|
53
|
+
get dark() {
|
54
|
+
return this.prefersColorScheme("dark");
|
55
|
+
}
|
56
|
+
get light() {
|
57
|
+
return this.prefersColorScheme("light");
|
58
|
+
}
|
59
|
+
get print() {
|
60
|
+
const t = `${this.base} print`;
|
61
|
+
return this.next(t);
|
62
|
+
}
|
63
|
+
get screen() {
|
64
|
+
const t = `${this.base} screen`;
|
65
|
+
return this.next(t);
|
66
|
+
}
|
67
|
+
get speech() {
|
68
|
+
const t = `${this.base} speech`;
|
69
|
+
return this.next(t);
|
70
|
+
}
|
71
|
+
get all() {
|
72
|
+
const t = `${this.base} all`;
|
73
|
+
return this.next(t);
|
74
|
+
}
|
75
|
+
get not() {
|
76
|
+
const t = `${this.base} not`;
|
77
|
+
return this.next(t);
|
78
|
+
}
|
79
|
+
get reducedMotion() {
|
80
|
+
const t = `${this.base} (prefers-reduced-motion: reduce)`;
|
81
|
+
return this.next(t);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
const u = new r();
|
85
|
+
export {
|
86
|
+
r as MediaQueryFactory,
|
87
|
+
u as media
|
88
|
+
};
|