uniwind-plugin-next 1.2.0 → 1.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.
Files changed (74) hide show
  1. package/README.md +22 -14
  2. package/dist/_virtual/rolldown_runtime.mjs +7 -0
  3. package/dist/{webpack → common}/types.d.cts +1 -1
  4. package/dist/common/types.d.cts.map +1 -0
  5. package/dist/{webpack → common}/types.d.mts +1 -1
  6. package/dist/common/types.d.mts.map +1 -0
  7. package/dist/common/util.cjs +6 -0
  8. package/dist/common/util.mjs +6 -0
  9. package/dist/common/util.mjs.map +1 -0
  10. package/dist/index.cjs +12 -2
  11. package/dist/index.d.cts +8 -2
  12. package/dist/index.d.cts.map +1 -0
  13. package/dist/index.d.mts +8 -2
  14. package/dist/index.d.mts.map +1 -0
  15. package/dist/index.mjs +12 -2
  16. package/dist/index.mjs.map +1 -0
  17. package/dist/postcss/index.cjs +0 -3
  18. package/dist/postcss/index.mjs +0 -3
  19. package/dist/postcss/index.mjs.map +1 -1
  20. package/dist/{webpack/uniwind → uniwind}/package.cjs +1 -1
  21. package/dist/uniwind/package.mjs +6 -0
  22. package/dist/uniwind/package.mjs.map +1 -0
  23. package/dist/{webpack/uniwind → uniwind}/src/css/index.cjs +8 -6
  24. package/dist/{webpack/uniwind → uniwind}/src/css/index.mjs +7 -5
  25. package/dist/uniwind/src/css/index.mjs.map +1 -0
  26. package/dist/uniwind/src/css/insets.cjs +87 -0
  27. package/dist/uniwind/src/css/insets.mjs +87 -0
  28. package/dist/uniwind/src/css/insets.mjs.map +1 -0
  29. package/dist/{webpack/uniwind → uniwind}/src/css/themes.cjs +2 -2
  30. package/dist/{webpack/uniwind → uniwind}/src/css/themes.mjs +1 -1
  31. package/dist/uniwind/src/css/themes.mjs.map +1 -0
  32. package/dist/{webpack/uniwind → uniwind}/src/css/variants.cjs +1 -1
  33. package/dist/{webpack/uniwind → uniwind}/src/css/variants.mjs +1 -1
  34. package/dist/uniwind/src/css/variants.mjs.map +1 -0
  35. package/dist/{webpack/uniwind → uniwind}/src/metro/logger.cjs +1 -1
  36. package/dist/{webpack/uniwind → uniwind}/src/metro/logger.mjs +1 -1
  37. package/dist/uniwind/src/metro/logger.mjs.map +1 -0
  38. package/dist/{webpack/uniwind → uniwind}/src/utils/buildDtsFile.cjs +2 -2
  39. package/dist/{webpack/uniwind → uniwind}/src/utils/buildDtsFile.mjs +1 -1
  40. package/dist/uniwind/src/utils/buildDtsFile.mjs.map +1 -0
  41. package/dist/{webpack/uniwind → uniwind}/src/utils/stringifyThemes.cjs +1 -1
  42. package/dist/{webpack/uniwind → uniwind}/src/utils/stringifyThemes.mjs +1 -1
  43. package/dist/uniwind/src/utils/stringifyThemes.mjs.map +1 -0
  44. package/dist/webpack/UniwindWebpackPlugin.cjs +11 -8
  45. package/dist/webpack/UniwindWebpackPlugin.mjs +11 -7
  46. package/dist/webpack/UniwindWebpackPlugin.mjs.map +1 -1
  47. package/dist/webpack/withUniwindBase.cjs +39 -0
  48. package/dist/webpack/withUniwindBase.mjs +37 -0
  49. package/dist/webpack/withUniwindBase.mjs.map +1 -0
  50. package/package.json +11 -14
  51. package/LICENSE +0 -21
  52. package/dist/webpack/types.d.cts.map +0 -1
  53. package/dist/webpack/types.d.mts.map +0 -1
  54. package/dist/webpack/uniwind/package.mjs +0 -6
  55. package/dist/webpack/uniwind/package.mjs.map +0 -1
  56. package/dist/webpack/uniwind/src/css/index.mjs.map +0 -1
  57. package/dist/webpack/uniwind/src/css/insets.cjs +0 -66
  58. package/dist/webpack/uniwind/src/css/insets.mjs +0 -66
  59. package/dist/webpack/uniwind/src/css/insets.mjs.map +0 -1
  60. package/dist/webpack/uniwind/src/css/themes.mjs.map +0 -1
  61. package/dist/webpack/uniwind/src/css/variants.mjs.map +0 -1
  62. package/dist/webpack/uniwind/src/metro/logger.mjs.map +0 -1
  63. package/dist/webpack/uniwind/src/utils/buildDtsFile.mjs.map +0 -1
  64. package/dist/webpack/uniwind/src/utils/common.cjs +0 -6
  65. package/dist/webpack/uniwind/src/utils/common.mjs +0 -6
  66. package/dist/webpack/uniwind/src/utils/common.mjs.map +0 -1
  67. package/dist/webpack/uniwind/src/utils/stringifyThemes.mjs.map +0 -1
  68. package/dist/webpack/withUniwind.cjs +0 -34
  69. package/dist/webpack/withUniwind.d.cts +0 -7
  70. package/dist/webpack/withUniwind.d.cts.map +0 -1
  71. package/dist/webpack/withUniwind.d.mts +0 -7
  72. package/dist/webpack/withUniwind.d.mts.map +0 -1
  73. package/dist/webpack/withUniwind.mjs +0 -32
  74. package/dist/webpack/withUniwind.mjs.map +0 -1
package/README.md CHANGED
@@ -1,22 +1,20 @@
1
1
  # uniwind-plugin-next
2
2
 
3
- > This is an unofficial plugin, and is not affiliated with Uniwind or Next.js.
4
-
5
- [Uniwind](https://uniwind.dev/) config plugin for Next.js. Note that only Webpack-based projects are supported, there are no plans to support Turbopack-based projects.
3
+ [Uniwind](https://uniwind.dev/) config plugin for Next.js projects using Webpack. Turbopack-based projects are not supported at this stage.
6
4
 
7
5
  ## Example
8
6
  See a fully working example project here: [Demo](http://uniwind-next.a16n.dev/) ([Source](https://github.com/a16n-dev/uniwind-plugin-next/tree/main/examples/next-16))
9
7
 
10
-
11
8
  ## Compatibility
12
9
  See the table below for tested versions of `uniwind-plugin-next` and corresponding versions of `uniwind`. Other versions of `uniwind` may work, but are not guaranteed to.
13
10
 
14
11
  Tested on Next `16.1`, but other versions will likely work fine.
15
12
 
16
- | uniwind-plugin-next | Uniwind |
17
- |---------------------|---------|
18
- | `1.1.x` | `1.2.2` |
19
- | `1.2.x` | `1.2.2` |
13
+ | Uniwind | uniwind-plugin-next |
14
+ |-------------------|---------------------|
15
+ | `1.2.7` | `1.4.0` |
16
+ | `1.2.4` - `1.2.6` | `1.3.0` |
17
+ | `1.2.2`-`1.2.3` | `1.2.0` |
20
18
 
21
19
  ## Installation & setup
22
20
  This setup guide assumes you already have a next.js project setup with Tailwind v4
@@ -70,17 +68,27 @@ const config = {
70
68
  ...
71
69
 
72
70
  return (
73
- <html lang="en" suppressHydrationWarning>
74
- ...
75
- </html>
71
+ <html lang="en" suppressHydrationWarning>
72
+ ...
73
+ </html>
76
74
  );
77
75
  ```
78
76
 
79
77
  6. Start the dev server to generate `uniwind-types.d.ts`. Make sure that it's included in your `tsconfig.json`'s `include` array.
80
78
 
79
+ ## Uniwind Pro
80
+
81
+ If you're using the pro version of Uniwind, use `withUniwindPro()` instead of `withUniwind()`.
82
+
83
+ ```ts
84
+ // next.config.ts
85
+ import { withUniwindPro } from 'uniwind-plugin-next'
86
+
87
+ export default withUniwindPro(withExpo(nextConfig), { ... });
88
+ ```
89
+
90
+
81
91
  ## SSR Considerations
82
92
  - This plugin marks all Uniwind web components with `'use client'` automatically, so you do not need to do this manually.
83
93
 
84
- - Be aware that some Uniwind features, such as `withUniwind` and `useResolveClassNames` will not work in a server environment, as they rely on accessing `window` or `document`.
85
-
86
- - Additional code is required to avoid a flash of unstyled content (FOUC). See the example project for reference.
94
+ - Be aware that some Uniwind features, such as `withUniwind` and `useResolveClassNames` will not work in a server environment, as they rely on accessing `window` or `document`.
@@ -0,0 +1,7 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region rolldown:runtime
4
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
+
6
+ //#endregion
7
+ export { __require };
@@ -1,4 +1,4 @@
1
- //#region src/webpack/types.d.ts
1
+ //#region src/common/types.d.ts
2
2
  type UniwindConfig = {
3
3
  cssEntryFile: string;
4
4
  extraThemes?: Array<string>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/common/types.ts"],"sourcesContent":[],"mappings":";KAAY,aAAA;EAAA,YAAA,EAAA,MAAa;gBAET"}
@@ -1,4 +1,4 @@
1
- //#region src/webpack/types.d.ts
1
+ //#region src/common/types.d.ts
2
2
  type UniwindConfig = {
3
3
  cssEntryFile: string;
4
4
  extraThemes?: Array<string>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/common/types.ts"],"sourcesContent":[],"mappings":";KAAY,aAAA;EAAA,YAAA,EAAA,MAAa;gBAET"}
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/common/util.ts
3
+ const uniq = (arr) => Array.from(new Set(arr));
4
+
5
+ //#endregion
6
+ exports.uniq = uniq;
@@ -0,0 +1,6 @@
1
+ //#region src/common/util.ts
2
+ const uniq = (arr) => Array.from(new Set(arr));
3
+
4
+ //#endregion
5
+ export { uniq };
6
+ //# sourceMappingURL=util.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.mjs","names":[],"sources":["../../src/common/util.ts"],"sourcesContent":["export const uniq = <T>(arr: Array<T>) => Array.from(new Set(arr));\n"],"mappings":";AAAA,MAAa,QAAW,QAAkB,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,3 +1,13 @@
1
- const require_withUniwind = require('./webpack/withUniwind.cjs');
1
+ const require_withUniwindBase = require('./webpack/withUniwindBase.cjs');
2
2
 
3
- exports.withUniwind = require_withUniwind.withUniwind;
3
+ //#region src/index.ts
4
+ function withUniwind(nextConfig = {}, uniwindConfig) {
5
+ return require_withUniwindBase.withUniwindBase("uniwind", nextConfig, uniwindConfig);
6
+ }
7
+ function withUniwindPro(nextConfig = {}, uniwindConfig) {
8
+ return require_withUniwindBase.withUniwindBase("uniwind-pro", nextConfig, uniwindConfig);
9
+ }
10
+
11
+ //#endregion
12
+ exports.withUniwind = withUniwind;
13
+ exports.withUniwindPro = withUniwindPro;
package/dist/index.d.cts CHANGED
@@ -1,2 +1,8 @@
1
- import { withUniwind } from "./webpack/withUniwind.cjs";
2
- export { withUniwind };
1
+ import { UniwindConfig } from "./common/types.cjs";
2
+
3
+ //#region src/index.d.ts
4
+ declare function withUniwind(nextConfig: any | undefined, uniwindConfig: UniwindConfig): any;
5
+ declare function withUniwindPro(nextConfig: any | undefined, uniwindConfig: UniwindConfig): any;
6
+ //#endregion
7
+ export { withUniwind, withUniwindPro };
8
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;iBAGgB,WAAA,6CAEC;iBAKD,cAAA,6CAEC"}
package/dist/index.d.mts CHANGED
@@ -1,2 +1,8 @@
1
- import { withUniwind } from "./webpack/withUniwind.mjs";
2
- export { withUniwind };
1
+ import { UniwindConfig } from "./common/types.mjs";
2
+
3
+ //#region src/index.d.ts
4
+ declare function withUniwind(nextConfig: any | undefined, uniwindConfig: UniwindConfig): any;
5
+ declare function withUniwindPro(nextConfig: any | undefined, uniwindConfig: UniwindConfig): any;
6
+ //#endregion
7
+ export { withUniwind, withUniwindPro };
8
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;iBAGgB,WAAA,6CAEC;iBAKD,cAAA,6CAEC"}
package/dist/index.mjs CHANGED
@@ -1,3 +1,13 @@
1
- import { withUniwind } from "./webpack/withUniwind.mjs";
1
+ import { withUniwindBase } from "./webpack/withUniwindBase.mjs";
2
2
 
3
- export { withUniwind };
3
+ //#region src/index.ts
4
+ function withUniwind(nextConfig = {}, uniwindConfig) {
5
+ return withUniwindBase("uniwind", nextConfig, uniwindConfig);
6
+ }
7
+ function withUniwindPro(nextConfig = {}, uniwindConfig) {
8
+ return withUniwindBase("uniwind-pro", nextConfig, uniwindConfig);
9
+ }
10
+
11
+ //#endregion
12
+ export { withUniwind, withUniwindPro };
13
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { UniwindConfig } from \"./common/types\";\nimport { withUniwindBase } from \"./webpack/withUniwindBase\";\n\nexport function withUniwind(\n nextConfig: any = {},\n uniwindConfig: UniwindConfig,\n): any {\n return withUniwindBase(\"uniwind\", nextConfig, uniwindConfig);\n}\n\nexport function withUniwindPro(\n nextConfig: any = {},\n uniwindConfig: UniwindConfig,\n): any {\n return withUniwindBase(\"uniwind-pro\", nextConfig, uniwindConfig);\n}\n"],"mappings":";;;AAGA,SAAgB,YACd,aAAkB,EAAE,EACpB,eACK;AACL,QAAO,gBAAgB,WAAW,YAAY,cAAc;;AAG9D,SAAgB,eACd,aAAkB,EAAE,EACpB,eACK;AACL,QAAO,gBAAgB,eAAe,YAAY,cAAc"}
@@ -9,9 +9,6 @@ function UniwindPluginNext() {
9
9
  decl.value = decl.value.replace(/fontScale\(([^)]+)\)/g, "calc($1 * 1rem)");
10
10
  decl.value = decl.value.replace(/hairlineWidth\(\)/g, "1px");
11
11
  });
12
- root.walkAtRules("import", (rule) => {
13
- if (rule.params.replace(/['"]/g, "") === "uniwind") rule.params = "\"uniwind-plugin-next/css\"";
14
- });
15
12
  }
16
13
  };
17
14
  }
@@ -8,9 +8,6 @@ function UniwindPluginNext() {
8
8
  decl.value = decl.value.replace(/fontScale\(([^)]+)\)/g, "calc($1 * 1rem)");
9
9
  decl.value = decl.value.replace(/hairlineWidth\(\)/g, "1px");
10
10
  });
11
- root.walkAtRules("import", (rule) => {
12
- if (rule.params.replace(/['"]/g, "") === "uniwind") rule.params = "\"uniwind-plugin-next/css\"";
13
- });
14
11
  }
15
12
  };
16
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/postcss/index.ts"],"sourcesContent":["export default function UniwindPluginNext() {\n return {\n postcssPlugin: \"uniwind-plugin-next\",\n Once(root: any) {\n root.walkDecls((decl: any) => {\n // Transform pixelRatio(X) → calc(X * 1px)\n decl.value = decl.value.replace(\n /pixelRatio\\(([^)]+)\\)/g,\n \"calc($1 * 1px)\",\n );\n // Transform fontScale(X) → calc(X * 1rem)\n decl.value = decl.value.replace(\n /fontScale\\(([^)]+)\\)/g,\n \"calc($1 * 1rem)\",\n );\n // Transform hairlineWidth() → 1px\n decl.value = decl.value.replace(/hairlineWidth\\(\\)/g, \"1px\");\n });\n // Replace `@import 'uniwind'` with `@import 'uniwind-plugin-next'`\n root.walkAtRules(\"import\", (rule: any) => {\n const importPath = rule.params.replace(/['\"]/g, \"\");\n\n if (importPath === \"uniwind\") {\n rule.params = '\"uniwind-plugin-next/css\"';\n }\n });\n },\n };\n}\n\nUniwindPluginNext.postcss = true;\n"],"mappings":";AAAA,SAAwB,oBAAoB;AAC1C,QAAO;EACL,eAAe;EACf,KAAK,MAAW;AACd,QAAK,WAAW,SAAc;AAE5B,SAAK,QAAQ,KAAK,MAAM,QACtB,0BACA,iBACD;AAED,SAAK,QAAQ,KAAK,MAAM,QACtB,yBACA,kBACD;AAED,SAAK,QAAQ,KAAK,MAAM,QAAQ,sBAAsB,MAAM;KAC5D;AAEF,QAAK,YAAY,WAAW,SAAc;AAGxC,QAFmB,KAAK,OAAO,QAAQ,SAAS,GAAG,KAEhC,UACjB,MAAK,SAAS;KAEhB;;EAEL;;AAGH,kBAAkB,UAAU"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/postcss/index.ts"],"sourcesContent":["export default function UniwindPluginNext() {\n return {\n postcssPlugin: \"uniwind-plugin-next\",\n Once(root: any) {\n root.walkDecls((decl: any) => {\n // Transform pixelRatio(X) → calc(X * 1px)\n decl.value = decl.value.replace(\n /pixelRatio\\(([^)]+)\\)/g,\n \"calc($1 * 1px)\",\n );\n // Transform fontScale(X) → calc(X * 1rem)\n decl.value = decl.value.replace(\n /fontScale\\(([^)]+)\\)/g,\n \"calc($1 * 1rem)\",\n );\n // Transform hairlineWidth() → 1px\n decl.value = decl.value.replace(/hairlineWidth\\(\\)/g, \"1px\");\n });\n },\n };\n}\n\nUniwindPluginNext.postcss = true;\n"],"mappings":";AAAA,SAAwB,oBAAoB;AAC1C,QAAO;EACL,eAAe;EACf,KAAK,MAAW;AACd,QAAK,WAAW,SAAc;AAE5B,SAAK,QAAQ,KAAK,MAAM,QACtB,0BACA,iBACD;AAED,SAAK,QAAQ,KAAK,MAAM,QACtB,yBACA,kBACD;AAED,SAAK,QAAQ,KAAK,MAAM,QAAQ,sBAAsB,MAAM;KAC5D;;EAEL;;AAGH,kBAAkB,UAAU"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/webpack/uniwind/package.json
2
+ //#region src/uniwind/package.json
3
3
  var name = "uniwind";
4
4
 
5
5
  //#endregion
@@ -0,0 +1,6 @@
1
+ //#region src/uniwind/package.json
2
+ var name = "uniwind";
3
+
4
+ //#endregion
5
+ export { name };
6
+ //# sourceMappingURL=package.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.mjs","names":[],"sources":["../../src/uniwind/package.json"],"sourcesContent":[""],"mappings":""}
@@ -1,4 +1,4 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
2
  const require_insets = require('./insets.cjs');
3
3
  const require_themes = require('./themes.cjs');
4
4
  const require_variants = require('./variants.cjs');
@@ -7,19 +7,21 @@ path = require_rolldown_runtime.__toESM(path);
7
7
  let fs = require("fs");
8
8
  fs = require_rolldown_runtime.__toESM(fs);
9
9
 
10
- //#region src/webpack/uniwind/src/css/index.ts
10
+ //#region src/uniwind/src/css/index.ts
11
11
  const dirname = typeof __dirname !== "undefined" ? __dirname : __dirname;
12
12
  const buildCSS = async (themes, input) => {
13
13
  const variants = require_variants.generateCSSForVariants();
14
14
  const insets = require_insets.generateCSSForInsets();
15
15
  const themesCSS = await require_themes.generateCSSForThemes(themes, input);
16
- const cssFile = path.default.join(dirname, "../../uniwind.css");
17
- if ((fs.default.existsSync(cssFile) ? fs.default.readFileSync(cssFile, "utf-8") : "") === cssFile) return;
18
- fs.default.writeFileSync(cssFile, [
16
+ const cssFilePath = path.default.join(dirname, "../../uniwind.css");
17
+ const oldCSSFile = fs.default.existsSync(cssFilePath) ? fs.default.readFileSync(cssFilePath, "utf-8") : "";
18
+ const newCssFile = [
19
19
  variants,
20
20
  insets,
21
21
  themesCSS
22
- ].join("\n"));
22
+ ].join("\n");
23
+ if (oldCSSFile === newCssFile) return;
24
+ fs.default.writeFileSync(cssFilePath, newCssFile);
23
25
  };
24
26
 
25
27
  //#endregion
@@ -4,19 +4,21 @@ import { generateCSSForVariants } from "./variants.mjs";
4
4
  import path from "path";
5
5
  import fs from "fs";
6
6
 
7
- //#region src/webpack/uniwind/src/css/index.ts
7
+ //#region src/uniwind/src/css/index.ts
8
8
  const dirname = typeof __dirname !== "undefined" ? __dirname : import.meta.dirname;
9
9
  const buildCSS = async (themes, input) => {
10
10
  const variants = generateCSSForVariants();
11
11
  const insets = generateCSSForInsets();
12
12
  const themesCSS = await generateCSSForThemes(themes, input);
13
- const cssFile = path.join(dirname, "../../uniwind.css");
14
- if ((fs.existsSync(cssFile) ? fs.readFileSync(cssFile, "utf-8") : "") === cssFile) return;
15
- fs.writeFileSync(cssFile, [
13
+ const cssFilePath = path.join(dirname, "../../uniwind.css");
14
+ const oldCSSFile = fs.existsSync(cssFilePath) ? fs.readFileSync(cssFilePath, "utf-8") : "";
15
+ const newCssFile = [
16
16
  variants,
17
17
  insets,
18
18
  themesCSS
19
- ].join("\n"));
19
+ ].join("\n");
20
+ if (oldCSSFile === newCssFile) return;
21
+ fs.writeFileSync(cssFilePath, newCssFile);
20
22
  };
21
23
 
22
24
  //#endregion
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/uniwind/src/css/index.ts"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport { generateCSSForInsets } from \"./insets\";\nimport { generateCSSForThemes } from \"./themes\";\nimport { generateCSSForVariants } from \"./variants\";\n\nconst dirname =\n typeof __dirname !== \"undefined\" ? __dirname : import.meta.dirname;\n\nexport const buildCSS = async (themes: Array<string>, input: string) => {\n const variants = generateCSSForVariants();\n const insets = generateCSSForInsets();\n const themesCSS = await generateCSSForThemes(themes, input);\n const cssFilePath = path.join(dirname, \"../../uniwind.css\");\n const oldCSSFile = fs.existsSync(cssFilePath)\n ? fs.readFileSync(cssFilePath, \"utf-8\")\n : \"\";\n\n const newCssFile = [variants, insets, themesCSS].join(\"\\n\");\n\n if (oldCSSFile === newCssFile) {\n return;\n }\n\n fs.writeFileSync(cssFilePath, newCssFile);\n};\n"],"mappings":";;;;;;;AAMA,MAAM,UACJ,OAAO,cAAc,cAAc,YAAY,OAAO,KAAK;AAE7D,MAAa,WAAW,OAAO,QAAuB,UAAkB;CACtE,MAAM,WAAW,wBAAwB;CACzC,MAAM,SAAS,sBAAsB;CACrC,MAAM,YAAY,MAAM,qBAAqB,QAAQ,MAAM;CAC3D,MAAM,cAAc,KAAK,KAAK,SAAS,oBAAoB;CAC3D,MAAM,aAAa,GAAG,WAAW,YAAY,GACzC,GAAG,aAAa,aAAa,QAAQ,GACrC;CAEJ,MAAM,aAAa;EAAC;EAAU;EAAQ;EAAU,CAAC,KAAK,KAAK;AAE3D,KAAI,eAAe,WACjB;AAGF,IAAG,cAAc,aAAa,WAAW"}
@@ -0,0 +1,87 @@
1
+
2
+ //#region src/uniwind/src/css/insets.ts
3
+ const types = [
4
+ "margin",
5
+ "padding",
6
+ "inset"
7
+ ];
8
+ const sides = [
9
+ "inset",
10
+ "x",
11
+ "y",
12
+ "top",
13
+ "bottom",
14
+ "left",
15
+ "right"
16
+ ];
17
+ const safeAreaTypes = [
18
+ "safe",
19
+ "safe-or-*",
20
+ "safe-offset-*"
21
+ ];
22
+ const spacing = "--spacing(--value(integer))";
23
+ const length = "--value([length])";
24
+ const generateCSSForInsets = () => {
25
+ let css = `@utility h-screen-safe {
26
+ height: calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)));
27
+ }\n\n`;
28
+ const getInsetsForSide = (side) => {
29
+ switch (side) {
30
+ case "top": return ["top"];
31
+ case "bottom": return ["bottom"];
32
+ case "left": return ["left"];
33
+ case "right": return ["right"];
34
+ case "x": return ["left", "right"];
35
+ case "y": return ["top", "bottom"];
36
+ case "inset": return [
37
+ "top",
38
+ "bottom",
39
+ "left",
40
+ "right"
41
+ ];
42
+ default: return [];
43
+ }
44
+ };
45
+ const getUtilityName = (typeName, side, safeAreaType) => {
46
+ if (typeName === "inset") return `${side}-${safeAreaType}`;
47
+ const sideSuffix = side === "inset" ? "" : side.at(0);
48
+ return `${typeName.at(0)}${sideSuffix}-${safeAreaType}`;
49
+ };
50
+ const getStyleProperty = (typeName, inset) => {
51
+ if (typeName === "inset") return inset;
52
+ return `${typeName}-${inset}`;
53
+ };
54
+ const getStylesForSafeAreaType = (safeAreaType, styles) => {
55
+ switch (safeAreaType) {
56
+ case "safe": return styles;
57
+ case "safe-or-*": return styles.flatMap((style) => {
58
+ const styleWithoutSemicolon = style.replace(";", "");
59
+ return [styleWithoutSemicolon.replace(/: (env.*)/, (_, env) => `: max(${env}, ${spacing});`), styleWithoutSemicolon.replace(/: (env.*)/, (_, env) => `: max(${env}, ${length});`)];
60
+ });
61
+ case "safe-offset-*": return styles.flatMap((style) => {
62
+ const styleWithoutSemicolon = style.replace(";", "");
63
+ return [styleWithoutSemicolon.replace(/: (env.*)/, (_, env) => `: calc(${env} + ${spacing});`), styleWithoutSemicolon.replace(/: (env.*)/, (_, env) => `: calc(${env} + ${length});`)];
64
+ });
65
+ default: return [];
66
+ }
67
+ };
68
+ types.forEach((type) => {
69
+ sides.forEach((side) => {
70
+ const styles = getInsetsForSide(side).map((inset) => `${getStyleProperty(type, inset)}: env(safe-area-inset-${inset});`);
71
+ safeAreaTypes.forEach((safeAreaType) => {
72
+ const utilityName = getUtilityName(type, side, safeAreaType);
73
+ css += [
74
+ `@utility ${utilityName} {`,
75
+ ...getStylesForSafeAreaType(safeAreaType, styles).map((style) => ` ${style}`),
76
+ "}",
77
+ "",
78
+ ""
79
+ ].join("\n");
80
+ });
81
+ });
82
+ });
83
+ return css.slice(0, -1);
84
+ };
85
+
86
+ //#endregion
87
+ exports.generateCSSForInsets = generateCSSForInsets;
@@ -0,0 +1,87 @@
1
+ //#region src/uniwind/src/css/insets.ts
2
+ const types = [
3
+ "margin",
4
+ "padding",
5
+ "inset"
6
+ ];
7
+ const sides = [
8
+ "inset",
9
+ "x",
10
+ "y",
11
+ "top",
12
+ "bottom",
13
+ "left",
14
+ "right"
15
+ ];
16
+ const safeAreaTypes = [
17
+ "safe",
18
+ "safe-or-*",
19
+ "safe-offset-*"
20
+ ];
21
+ const spacing = "--spacing(--value(integer))";
22
+ const length = "--value([length])";
23
+ const generateCSSForInsets = () => {
24
+ let css = `@utility h-screen-safe {
25
+ height: calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)));
26
+ }\n\n`;
27
+ const getInsetsForSide = (side) => {
28
+ switch (side) {
29
+ case "top": return ["top"];
30
+ case "bottom": return ["bottom"];
31
+ case "left": return ["left"];
32
+ case "right": return ["right"];
33
+ case "x": return ["left", "right"];
34
+ case "y": return ["top", "bottom"];
35
+ case "inset": return [
36
+ "top",
37
+ "bottom",
38
+ "left",
39
+ "right"
40
+ ];
41
+ default: return [];
42
+ }
43
+ };
44
+ const getUtilityName = (typeName, side, safeAreaType) => {
45
+ if (typeName === "inset") return `${side}-${safeAreaType}`;
46
+ const sideSuffix = side === "inset" ? "" : side.at(0);
47
+ return `${typeName.at(0)}${sideSuffix}-${safeAreaType}`;
48
+ };
49
+ const getStyleProperty = (typeName, inset) => {
50
+ if (typeName === "inset") return inset;
51
+ return `${typeName}-${inset}`;
52
+ };
53
+ const getStylesForSafeAreaType = (safeAreaType, styles) => {
54
+ switch (safeAreaType) {
55
+ case "safe": return styles;
56
+ case "safe-or-*": return styles.flatMap((style) => {
57
+ const styleWithoutSemicolon = style.replace(";", "");
58
+ return [styleWithoutSemicolon.replace(/: (env.*)/, (_, env) => `: max(${env}, ${spacing});`), styleWithoutSemicolon.replace(/: (env.*)/, (_, env) => `: max(${env}, ${length});`)];
59
+ });
60
+ case "safe-offset-*": return styles.flatMap((style) => {
61
+ const styleWithoutSemicolon = style.replace(";", "");
62
+ return [styleWithoutSemicolon.replace(/: (env.*)/, (_, env) => `: calc(${env} + ${spacing});`), styleWithoutSemicolon.replace(/: (env.*)/, (_, env) => `: calc(${env} + ${length});`)];
63
+ });
64
+ default: return [];
65
+ }
66
+ };
67
+ types.forEach((type) => {
68
+ sides.forEach((side) => {
69
+ const styles = getInsetsForSide(side).map((inset) => `${getStyleProperty(type, inset)}: env(safe-area-inset-${inset});`);
70
+ safeAreaTypes.forEach((safeAreaType) => {
71
+ const utilityName = getUtilityName(type, side, safeAreaType);
72
+ css += [
73
+ `@utility ${utilityName} {`,
74
+ ...getStylesForSafeAreaType(safeAreaType, styles).map((style) => ` ${style}`),
75
+ "}",
76
+ "",
77
+ ""
78
+ ].join("\n");
79
+ });
80
+ });
81
+ });
82
+ return css.slice(0, -1);
83
+ };
84
+
85
+ //#endregion
86
+ export { generateCSSForInsets };
87
+ //# sourceMappingURL=insets.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insets.mjs","names":[],"sources":["../../../../src/uniwind/src/css/insets.ts"],"sourcesContent":["const types = [\"margin\", \"padding\", \"inset\"] as const;\nconst sides = [\"inset\", \"x\", \"y\", \"top\", \"bottom\", \"left\", \"right\"] as const;\nconst safeAreaTypes = [\"safe\", \"safe-or-*\", \"safe-offset-*\"] as const;\nconst spacing = \"--spacing(--value(integer))\";\nconst length = \"--value([length])\";\n\ntype Side = (typeof sides)[number];\ntype TypeName = (typeof types)[number];\ntype SafeAreaType = (typeof safeAreaTypes)[number];\ntype Inset = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport const generateCSSForInsets = () => {\n let css = `@utility h-screen-safe {\n height: calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)));\n}\\n\\n`;\n\n const getInsetsForSide = (side: Side): Array<Inset> => {\n switch (side) {\n case \"top\":\n return [\"top\"];\n case \"bottom\":\n return [\"bottom\"];\n case \"left\":\n return [\"left\"];\n case \"right\":\n return [\"right\"];\n case \"x\":\n return [\"left\", \"right\"];\n case \"y\":\n return [\"top\", \"bottom\"];\n case \"inset\":\n return [\"top\", \"bottom\", \"left\", \"right\"];\n default:\n side satisfies never;\n return [];\n }\n };\n\n const getUtilityName = (\n typeName: TypeName,\n side: Side,\n safeAreaType: SafeAreaType,\n ) => {\n if (typeName === \"inset\") {\n return `${side}-${safeAreaType}`;\n }\n\n const sideSuffix = side === \"inset\" ? \"\" : side.at(0);\n\n return `${typeName.at(0)}${sideSuffix}-${safeAreaType}`;\n };\n\n const getStyleProperty = (typeName: TypeName, inset: Inset) => {\n if (typeName === \"inset\") {\n return inset;\n }\n\n return `${typeName}-${inset}`;\n };\n\n const getStylesForSafeAreaType = (\n safeAreaType: SafeAreaType,\n styles: Array<string>,\n ) => {\n switch (safeAreaType) {\n case \"safe\":\n return styles;\n case \"safe-or-*\":\n return styles.flatMap((style) => {\n const styleWithoutSemicolon = style.replace(\";\", \"\");\n\n return [\n styleWithoutSemicolon.replace(\n /: (env.*)/,\n (_, env) => `: max(${env}, ${spacing});`,\n ),\n styleWithoutSemicolon.replace(\n /: (env.*)/,\n (_, env) => `: max(${env}, ${length});`,\n ),\n ];\n });\n case \"safe-offset-*\":\n return styles.flatMap((style) => {\n const styleWithoutSemicolon = style.replace(\";\", \"\");\n\n return [\n styleWithoutSemicolon.replace(\n /: (env.*)/,\n (_, env) => `: calc(${env} + ${spacing});`,\n ),\n styleWithoutSemicolon.replace(\n /: (env.*)/,\n (_, env) => `: calc(${env} + ${length});`,\n ),\n ];\n });\n default:\n safeAreaType satisfies never;\n return [];\n }\n };\n\n types.forEach((type) => {\n sides.forEach((side) => {\n const insets = getInsetsForSide(side);\n const styles = insets.map(\n (inset) =>\n `${getStyleProperty(type, inset)}: env(safe-area-inset-${inset});`,\n );\n\n safeAreaTypes.forEach((safeAreaType) => {\n const utilityName = getUtilityName(type, side, safeAreaType);\n\n css += [\n `@utility ${utilityName} {`,\n ...getStylesForSafeAreaType(safeAreaType, styles).map(\n (style) => ` ${style}`,\n ),\n \"}\",\n \"\",\n \"\",\n ].join(\"\\n\");\n });\n });\n });\n\n // Remove the last newline character\n return css.slice(0, -1);\n};\n"],"mappings":";AAAA,MAAM,QAAQ;CAAC;CAAU;CAAW;CAAQ;AAC5C,MAAM,QAAQ;CAAC;CAAS;CAAK;CAAK;CAAO;CAAU;CAAQ;CAAQ;AACnE,MAAM,gBAAgB;CAAC;CAAQ;CAAa;CAAgB;AAC5D,MAAM,UAAU;AAChB,MAAM,SAAS;AAOf,MAAa,6BAA6B;CACxC,IAAI,MAAM;;;CAIV,MAAM,oBAAoB,SAA6B;AACrD,UAAQ,MAAR;GACE,KAAK,MACH,QAAO,CAAC,MAAM;GAChB,KAAK,SACH,QAAO,CAAC,SAAS;GACnB,KAAK,OACH,QAAO,CAAC,OAAO;GACjB,KAAK,QACH,QAAO,CAAC,QAAQ;GAClB,KAAK,IACH,QAAO,CAAC,QAAQ,QAAQ;GAC1B,KAAK,IACH,QAAO,CAAC,OAAO,SAAS;GAC1B,KAAK,QACH,QAAO;IAAC;IAAO;IAAU;IAAQ;IAAQ;GAC3C,QAEE,QAAO,EAAE;;;CAIf,MAAM,kBACJ,UACA,MACA,iBACG;AACH,MAAI,aAAa,QACf,QAAO,GAAG,KAAK,GAAG;EAGpB,MAAM,aAAa,SAAS,UAAU,KAAK,KAAK,GAAG,EAAE;AAErD,SAAO,GAAG,SAAS,GAAG,EAAE,GAAG,WAAW,GAAG;;CAG3C,MAAM,oBAAoB,UAAoB,UAAiB;AAC7D,MAAI,aAAa,QACf,QAAO;AAGT,SAAO,GAAG,SAAS,GAAG;;CAGxB,MAAM,4BACJ,cACA,WACG;AACH,UAAQ,cAAR;GACE,KAAK,OACH,QAAO;GACT,KAAK,YACH,QAAO,OAAO,SAAS,UAAU;IAC/B,MAAM,wBAAwB,MAAM,QAAQ,KAAK,GAAG;AAEpD,WAAO,CACL,sBAAsB,QACpB,cACC,GAAG,QAAQ,SAAS,IAAI,IAAI,QAAQ,IACtC,EACD,sBAAsB,QACpB,cACC,GAAG,QAAQ,SAAS,IAAI,IAAI,OAAO,IACrC,CACF;KACD;GACJ,KAAK,gBACH,QAAO,OAAO,SAAS,UAAU;IAC/B,MAAM,wBAAwB,MAAM,QAAQ,KAAK,GAAG;AAEpD,WAAO,CACL,sBAAsB,QACpB,cACC,GAAG,QAAQ,UAAU,IAAI,KAAK,QAAQ,IACxC,EACD,sBAAsB,QACpB,cACC,GAAG,QAAQ,UAAU,IAAI,KAAK,OAAO,IACvC,CACF;KACD;GACJ,QAEE,QAAO,EAAE;;;AAIf,OAAM,SAAS,SAAS;AACtB,QAAM,SAAS,SAAS;GAEtB,MAAM,SADS,iBAAiB,KAAK,CACf,KACnB,UACC,GAAG,iBAAiB,MAAM,MAAM,CAAC,wBAAwB,MAAM,IAClE;AAED,iBAAc,SAAS,iBAAiB;IACtC,MAAM,cAAc,eAAe,MAAM,MAAM,aAAa;AAE5D,WAAO;KACL,YAAY,YAAY;KACxB,GAAG,yBAAyB,cAAc,OAAO,CAAC,KAC/C,UAAU,OAAO,QACnB;KACD;KACA;KACA;KACD,CAAC,KAAK,KAAK;KACZ;IACF;GACF;AAGF,QAAO,IAAI,MAAM,GAAG,GAAG"}
@@ -1,4 +1,4 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
2
  const require_logger = require('../metro/logger.cjs');
3
3
  let path = require("path");
4
4
  path = require_rolldown_runtime.__toESM(path);
@@ -7,7 +7,7 @@ fs = require_rolldown_runtime.__toESM(fs);
7
7
  let _tailwindcss_node = require("@tailwindcss/node");
8
8
  let lightningcss = require("lightningcss");
9
9
 
10
- //#region src/webpack/uniwind/src/css/themes.ts
10
+ //#region src/uniwind/src/css/themes.ts
11
11
  const readFileSafe = (filePath) => {
12
12
  try {
13
13
  return fs.default.readFileSync(filePath, "utf-8");
@@ -4,7 +4,7 @@ import fs from "fs";
4
4
  import { compile } from "@tailwindcss/node";
5
5
  import { transform } from "lightningcss";
6
6
 
7
- //#region src/webpack/uniwind/src/css/themes.ts
7
+ //#region src/uniwind/src/css/themes.ts
8
8
  const readFileSafe = (filePath) => {
9
9
  try {
10
10
  return fs.readFileSync(filePath, "utf-8");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.mjs","names":[],"sources":["../../../../src/uniwind/src/css/themes.ts"],"sourcesContent":["import { compile } from \"@tailwindcss/node\";\nimport fs from \"fs\";\nimport { transform } from \"lightningcss\";\nimport path from \"path\";\nimport { Logger } from \"../metro/logger\";\n\nconst readFileSafe = (filePath: string) => {\n try {\n return fs.readFileSync(filePath, \"utf-8\");\n } catch {\n return null;\n }\n};\n\nconst isExcludedDependency = (url: string) =>\n [\n url.includes(\"node_modules/tailwindcss\"),\n url.includes(\"node_modules/@tailwindcss\"),\n url.includes(\"node_modules/uniwind\"),\n ].some(Boolean);\n\nexport const generateCSSForThemes = async (\n themes: Array<string>,\n input: string,\n) => {\n // css generation\n const themesVariables = Object.fromEntries(\n themes.map((theme) => [theme, new Set<string>()]),\n );\n\n const findVariantsRec = async (cssPath: string) => {\n const css = readFileSafe(cssPath);\n\n if (css === null) {\n return;\n }\n\n const { dependencies } = transform({\n code: Buffer.from(css),\n filename: \"uniwind.css\",\n analyzeDependencies: true,\n visitor: {\n Rule: (rule) => {\n if (rule.type === \"unknown\" && rule.value.name === \"variant\") {\n const [firstPrelude] = rule.value.prelude;\n\n if (\n firstPrelude?.type !== \"token\" ||\n firstPrelude.value.type !== \"ident\" ||\n !themes.includes(firstPrelude.value.value)\n ) {\n return;\n }\n\n const theme = firstPrelude.value.value;\n\n rule.value.block?.forEach((block) => {\n if (block.type === \"dashed-ident\") {\n themesVariables[theme]?.add(block.value);\n }\n });\n }\n },\n },\n });\n\n if (!Array.isArray(dependencies)) {\n return;\n }\n\n const importUrls = new Set<string>();\n const importsCSS = dependencies\n .filter((dependency) => {\n if (dependency.url.startsWith(\".\")) {\n importUrls.add(path.resolve(path.dirname(cssPath), dependency.url));\n\n return false;\n }\n\n return !isExcludedDependency(dependency.url);\n })\n .map((dependency) => `@import \"${dependency.url}\";`)\n .join(\"\\n\");\n\n await compile(importsCSS, {\n base: path.resolve(path.dirname(cssPath)),\n onDependency: (dependency) => {\n if (isExcludedDependency(dependency)) {\n return;\n }\n\n importUrls.add(dependency);\n },\n });\n\n for (const filePath of importUrls) {\n await findVariantsRec(filePath);\n }\n };\n\n await findVariantsRec(input);\n\n // Check if all themes have the same variables\n let hasErrors = false as boolean;\n const hasVariables = Object.values(themesVariables).some(\n (variables) => variables.size > 0,\n );\n\n Object.values(themesVariables).forEach((variables) => {\n Object.entries(themesVariables).forEach(\n ([checkedTheme, checkedVariables]) => {\n variables.forEach((variable) => {\n if (!checkedVariables.has(variable)) {\n Logger.error(\n `Theme ${checkedTheme} is missing variable ${variable}`,\n );\n hasErrors = true;\n }\n });\n },\n );\n });\n\n if (hasErrors) {\n Logger.error(\"All themes must have the same variables\");\n }\n\n const variablesCSS = hasVariables\n ? [\n \"\",\n \"@theme {\",\n ...Array.from(Object.values(themesVariables).at(0) ?? []).map(\n (variable) => ` ${variable}: unset;`,\n ),\n \"}\",\n ]\n : [];\n const uniwindCSS = [\n ...themes.map(\n (theme) => `@custom-variant ${theme} (&:where(.${theme}, .${theme} *));`,\n ),\n ...variablesCSS,\n ].join(\"\\n\");\n\n return uniwindCSS;\n};\n"],"mappings":";;;;;;;AAMA,MAAM,gBAAgB,aAAqB;AACzC,KAAI;AACF,SAAO,GAAG,aAAa,UAAU,QAAQ;SACnC;AACN,SAAO;;;AAIX,MAAM,wBAAwB,QAC5B;CACE,IAAI,SAAS,2BAA2B;CACxC,IAAI,SAAS,4BAA4B;CACzC,IAAI,SAAS,uBAAuB;CACrC,CAAC,KAAK,QAAQ;AAEjB,MAAa,uBAAuB,OAClC,QACA,UACG;CAEH,MAAM,kBAAkB,OAAO,YAC7B,OAAO,KAAK,UAAU,CAAC,uBAAO,IAAI,KAAa,CAAC,CAAC,CAClD;CAED,MAAM,kBAAkB,OAAO,YAAoB;EACjD,MAAM,MAAM,aAAa,QAAQ;AAEjC,MAAI,QAAQ,KACV;EAGF,MAAM,EAAE,iBAAiB,UAAU;GACjC,MAAM,OAAO,KAAK,IAAI;GACtB,UAAU;GACV,qBAAqB;GACrB,SAAS,EACP,OAAO,SAAS;AACd,QAAI,KAAK,SAAS,aAAa,KAAK,MAAM,SAAS,WAAW;KAC5D,MAAM,CAAC,gBAAgB,KAAK,MAAM;AAElC,SACE,cAAc,SAAS,WACvB,aAAa,MAAM,SAAS,WAC5B,CAAC,OAAO,SAAS,aAAa,MAAM,MAAM,CAE1C;KAGF,MAAM,QAAQ,aAAa,MAAM;AAEjC,UAAK,MAAM,OAAO,SAAS,UAAU;AACnC,UAAI,MAAM,SAAS,eACjB,iBAAgB,QAAQ,IAAI,MAAM,MAAM;OAE1C;;MAGP;GACF,CAAC;AAEF,MAAI,CAAC,MAAM,QAAQ,aAAa,CAC9B;EAGF,MAAM,6BAAa,IAAI,KAAa;AAcpC,QAAM,QAba,aAChB,QAAQ,eAAe;AACtB,OAAI,WAAW,IAAI,WAAW,IAAI,EAAE;AAClC,eAAW,IAAI,KAAK,QAAQ,KAAK,QAAQ,QAAQ,EAAE,WAAW,IAAI,CAAC;AAEnE,WAAO;;AAGT,UAAO,CAAC,qBAAqB,WAAW,IAAI;IAC5C,CACD,KAAK,eAAe,YAAY,WAAW,IAAI,IAAI,CACnD,KAAK,KAAK,EAEa;GACxB,MAAM,KAAK,QAAQ,KAAK,QAAQ,QAAQ,CAAC;GACzC,eAAe,eAAe;AAC5B,QAAI,qBAAqB,WAAW,CAClC;AAGF,eAAW,IAAI,WAAW;;GAE7B,CAAC;AAEF,OAAK,MAAM,YAAY,WACrB,OAAM,gBAAgB,SAAS;;AAInC,OAAM,gBAAgB,MAAM;CAG5B,IAAI,YAAY;CAChB,MAAM,eAAe,OAAO,OAAO,gBAAgB,CAAC,MACjD,cAAc,UAAU,OAAO,EACjC;AAED,QAAO,OAAO,gBAAgB,CAAC,SAAS,cAAc;AACpD,SAAO,QAAQ,gBAAgB,CAAC,SAC7B,CAAC,cAAc,sBAAsB;AACpC,aAAU,SAAS,aAAa;AAC9B,QAAI,CAAC,iBAAiB,IAAI,SAAS,EAAE;AACnC,YAAO,MACL,SAAS,aAAa,uBAAuB,WAC9C;AACD,iBAAY;;KAEd;IAEL;GACD;AAEF,KAAI,UACF,QAAO,MAAM,0CAA0C;CAGzD,MAAM,eAAe,eACjB;EACE;EACA;EACA,GAAG,MAAM,KAAK,OAAO,OAAO,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,KACvD,aAAa,OAAO,SAAS,UAC/B;EACD;EACD,GACD,EAAE;AAQN,QAPmB,CACjB,GAAG,OAAO,KACP,UAAU,mBAAmB,MAAM,aAAa,MAAM,KAAK,MAAM,OACnE,EACD,GAAG,aACJ,CAAC,KAAK,KAAK"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/webpack/uniwind/src/css/variants.ts
2
+ //#region src/uniwind/src/css/variants.ts
3
3
  const variants = [
4
4
  "ios",
5
5
  "android",
@@ -1,4 +1,4 @@
1
- //#region src/webpack/uniwind/src/css/variants.ts
1
+ //#region src/uniwind/src/css/variants.ts
2
2
  const variants = [
3
3
  "ios",
4
4
  "android",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.mjs","names":[],"sources":["../../../../src/uniwind/src/css/variants.ts"],"sourcesContent":["const variants = [\"ios\", \"android\", \"web\", \"native\"];\n\nexport const generateCSSForVariants = () => {\n let css = \"\";\n\n variants.forEach((variant) => {\n css += `@custom-variant ${variant} (${variant === \"web\" ? \"html &\" : `@media ${variant}`});\\n`;\n });\n\n return css;\n};\n"],"mappings":";AAAA,MAAM,WAAW;CAAC;CAAO;CAAW;CAAO;CAAS;AAEpD,MAAa,+BAA+B;CAC1C,IAAI,MAAM;AAEV,UAAS,SAAS,YAAY;AAC5B,SAAO,mBAAmB,QAAQ,IAAI,YAAY,QAAQ,WAAW,UAAU,UAAU;GACzF;AAEF,QAAO"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/webpack/uniwind/src/metro/logger.ts
2
+ //#region src/uniwind/src/metro/logger.ts
3
3
  const red = "\x1B[91m";
4
4
  const yellow = "\x1B[33m";
5
5
  const blue = "\x1B[36m";
@@ -1,4 +1,4 @@
1
- //#region src/webpack/uniwind/src/metro/logger.ts
1
+ //#region src/uniwind/src/metro/logger.ts
2
2
  const red = "\x1B[91m";
3
3
  const yellow = "\x1B[33m";
4
4
  const blue = "\x1B[36m";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.mjs","names":["name: string"],"sources":["../../../../src/uniwind/src/metro/logger.ts"],"sourcesContent":["/* eslint-disable no-console */\n\nconst red = \"\\x1b[91m\";\nconst yellow = \"\\x1b[33m\";\nconst blue = \"\\x1b[36m\";\nconst reset = \"\\x1b[0m\";\n\nexport class Logger {\n static debug = false;\n\n constructor(private readonly name: string) {}\n\n static log(message: string, meta = \"\") {\n if (!Logger.debug) {\n return;\n }\n\n console.log(`${blue}Uniwind ${meta}- ${message}${reset}`);\n }\n\n static error(message: string, meta = \"\") {\n console.log(`${red}Uniwind Error ${meta}- ${message}${reset}`);\n }\n\n static warn(message: string, meta = \"\") {\n if (!Logger.debug) {\n return;\n }\n\n console.log(`${yellow}Uniwind Warning ${meta}- ${message}${reset}`);\n }\n\n log(message: string) {\n Logger.log(message, `[${this.name} Processor] `);\n }\n\n error(message: string) {\n Logger.error(message, `[${this.name} Processor] `);\n }\n\n warn(message: string) {\n Logger.warn(message, `[${this.name} Processor] `);\n }\n}\n"],"mappings":";AAEA,MAAM,MAAM;AACZ,MAAM,SAAS;AACf,MAAM,OAAO;AACb,MAAM,QAAQ;AAEd,IAAa,SAAb,MAAa,OAAO;;eACH;;CAEf,YAAY,AAAiBA,MAAc;EAAd;;CAE7B,OAAO,IAAI,SAAiB,OAAO,IAAI;AACrC,MAAI,CAAC,OAAO,MACV;AAGF,UAAQ,IAAI,GAAG,KAAK,UAAU,KAAK,IAAI,UAAU,QAAQ;;CAG3D,OAAO,MAAM,SAAiB,OAAO,IAAI;AACvC,UAAQ,IAAI,GAAG,IAAI,gBAAgB,KAAK,IAAI,UAAU,QAAQ;;CAGhE,OAAO,KAAK,SAAiB,OAAO,IAAI;AACtC,MAAI,CAAC,OAAO,MACV;AAGF,UAAQ,IAAI,GAAG,OAAO,kBAAkB,KAAK,IAAI,UAAU,QAAQ;;CAGrE,IAAI,SAAiB;AACnB,SAAO,IAAI,SAAS,IAAI,KAAK,KAAK,cAAc;;CAGlD,MAAM,SAAiB;AACrB,SAAO,MAAM,SAAS,IAAI,KAAK,KAAK,cAAc;;CAGpD,KAAK,SAAiB;AACpB,SAAO,KAAK,SAAS,IAAI,KAAK,KAAK,cAAc"}
@@ -1,9 +1,9 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
2
  const require_package = require('../../package.cjs');
3
3
  let fs = require("fs");
4
4
  fs = require_rolldown_runtime.__toESM(fs);
5
5
 
6
- //#region src/webpack/uniwind/src/utils/buildDtsFile.ts
6
+ //#region src/uniwind/src/utils/buildDtsFile.ts
7
7
  const buildDtsFile = (dtsPath, stringifiedThemes) => {
8
8
  const oldDtsContent = fs.default.existsSync(dtsPath) ? fs.default.readFileSync(dtsPath, "utf-8") : "";
9
9
  const dtsContent = [
@@ -1,7 +1,7 @@
1
1
  import { name } from "../../package.mjs";
2
2
  import fs from "fs";
3
3
 
4
- //#region src/webpack/uniwind/src/utils/buildDtsFile.ts
4
+ //#region src/uniwind/src/utils/buildDtsFile.ts
5
5
  const buildDtsFile = (dtsPath, stringifiedThemes) => {
6
6
  const oldDtsContent = fs.existsSync(dtsPath) ? fs.readFileSync(dtsPath, "utf-8") : "";
7
7
  const dtsContent = [
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildDtsFile.mjs","names":[],"sources":["../../../../src/uniwind/src/utils/buildDtsFile.ts"],"sourcesContent":["import fs from \"fs\";\nimport { name } from \"../../package.json\";\n\nexport const buildDtsFile = (dtsPath: string, stringifiedThemes: string) => {\n const oldDtsContent = fs.existsSync(dtsPath)\n ? fs.readFileSync(dtsPath, \"utf-8\")\n : \"\";\n const dtsContent = [\n `// NOTE: This file is generated by ${name} and it should not be edited manually.`,\n `/// <reference types=\"${name}/types\" />`,\n \"\",\n `declare module '${name}' {`,\n ` export interface UniwindConfig {`,\n ` themes: readonly ${stringifiedThemes}`,\n ` }`,\n `}`,\n \"\",\n `export {}`,\n \"\",\n ].join(\"\\n\");\n\n if (oldDtsContent === dtsContent) {\n return;\n }\n\n fs.writeFileSync(dtsPath, dtsContent);\n};\n"],"mappings":";;;;AAGA,MAAa,gBAAgB,SAAiB,sBAA8B;CAC1E,MAAM,gBAAgB,GAAG,WAAW,QAAQ,GACxC,GAAG,aAAa,SAAS,QAAQ,GACjC;CACJ,MAAM,aAAa;EACjB,sCAAsC,KAAK;EAC3C,yBAAyB,KAAK;EAC9B;EACA,mBAAmB,KAAK;EACxB;EACA,4BAA4B;EAC5B;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;AAEZ,KAAI,kBAAkB,WACpB;AAGF,IAAG,cAAc,SAAS,WAAW"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region src/webpack/uniwind/src/utils/stringifyThemes.ts
2
+ //#region src/uniwind/src/utils/stringifyThemes.ts
3
3
  const stringifyThemes = (themes = []) => `[${themes.map((theme) => `'${theme}'`).join(", ")}]`;
4
4
 
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- //#region src/webpack/uniwind/src/utils/stringifyThemes.ts
1
+ //#region src/uniwind/src/utils/stringifyThemes.ts
2
2
  const stringifyThemes = (themes = []) => `[${themes.map((theme) => `'${theme}'`).join(", ")}]`;
3
3
 
4
4
  //#endregion
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringifyThemes.mjs","names":[],"sources":["../../../../src/uniwind/src/utils/stringifyThemes.ts"],"sourcesContent":["export const stringifyThemes = (themes: Array<string> = []) =>\n `[${themes.map((theme) => `'${theme}'`).join(\", \")}]`;\n"],"mappings":";AAAA,MAAa,mBAAmB,SAAwB,EAAE,KACxD,IAAI,OAAO,KAAK,UAAU,IAAI,MAAM,GAAG,CAAC,KAAK,KAAK,CAAC"}