@udixio/tailwind 2.3.5 → 2.3.6

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## 2.3.6 (2025-10-17)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **theme, plugins-tailwind:** enhance instance management and fix subThemes processing ([0a1b42e](https://github.com/Udixio/UI/commit/0a1b42e))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated @udixio/theme to 2.1.1
10
+
11
+ ### ❤️ Thank You
12
+
13
+ - Joël VIGREUX
14
+
1
15
  ## 2.3.5 (2025-10-17)
2
16
 
3
17
  ### 🩹 Fixes
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind.plugin.d.ts","sourceRoot":"","sources":["../../src/browser/tailwind.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAO/E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAgFD,qBAAa,cAAe,SAAQ,cAAc,CAChD,yBAAyB,EACzB,qBAAqB,CACtB;IACQ,YAAY,wBAAgB;IAC5B,IAAI,SAAc;IACzB,WAAW,mCAA6B;CACzC;AAED,qBAAa,yBAA0B,SAAQ,kBAAkB,CAAC,qBAAqB,CAAC;IAC/E,SAAS,SAAM;IAEtB,MAAM;IAeN,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE;IA0E/C,SAAS;eAC+B,MAAM;cAAQ,MAAM;;IAetD,MAAM;CAWb"}
1
+ {"version":3,"file":"tailwind.plugin.d.ts","sourceRoot":"","sources":["../../src/browser/tailwind.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAO/E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAgFD,qBAAa,cAAe,SAAQ,cAAc,CAChD,yBAAyB,EACzB,qBAAqB,CACtB;IACQ,YAAY,wBAAgB;IAC5B,IAAI,SAAc;IACzB,WAAW,mCAA6B;CACzC;AAED,qBAAa,yBAA0B,SAAQ,kBAAkB,CAAC,qBAAqB,CAAC;IAC/E,SAAS,SAAM;IAEtB,MAAM;IAeN,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE;IA+E/C,SAAS;eAC+B,MAAM;cAAQ,MAAM;;IAetD,MAAM;CAYb"}
package/dist/browser.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const tailwind_plugin = require("./tailwind.plugin-Dvf5FtVR.cjs");
3
+ const tailwind_plugin = require("./tailwind.plugin-CEGlpiFj.cjs");
4
4
  exports.TailwindImplPluginBrowser = tailwind_plugin.TailwindImplPluginBrowser;
5
5
  exports.TailwindPlugin = tailwind_plugin.TailwindPlugin;
6
6
  exports.animation = tailwind_plugin.animation;
package/dist/browser.js CHANGED
@@ -1,5 +1,5 @@
1
- import { m as main } from "./tailwind.plugin-kD1ORWiZ.js";
2
- import { T, b, a, f, s } from "./tailwind.plugin-kD1ORWiZ.js";
1
+ import { m as main } from "./tailwind.plugin-Bvh5RFHQ.js";
2
+ import { T, b, a, f, s } from "./tailwind.plugin-Bvh5RFHQ.js";
3
3
  export {
4
4
  T as TailwindImplPluginBrowser,
5
5
  b as TailwindPlugin,
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind.plugin.d.ts","sourceRoot":"","sources":["../../src/node/tailwind.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,EACL,yBAAyB,EACzB,qBAAqB,IAAI,4BAA4B,EACtD,MAAM,4BAA4B,CAAC;AAIpC,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAEjE,qBAAa,cAAe,SAAQ,cAAc,CAChD,kBAAkB,EAClB,qBAAqB,CACtB;IACQ,YAAY,wBAAgB;IAC5B,IAAI,SAAc;IACzB,WAAW,4BAAsB;CAClC;AAED,cAAM,kBAAmB,SAAQ,yBAAyB;IACxD,OAAO,CAAC,QAAQ;IAQD,MAAM;CAkFtB"}
1
+ {"version":3,"file":"tailwind.plugin.d.ts","sourceRoot":"","sources":["../../src/node/tailwind.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,EACL,yBAAyB,EACzB,qBAAqB,IAAI,4BAA4B,EACtD,MAAM,4BAA4B,CAAC;AAIpC,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAEjE,qBAAa,cAAe,SAAQ,cAAc,CAChD,kBAAkB,EAClB,qBAAqB,CACtB;IACQ,YAAY,wBAAgB;IAC5B,IAAI,SAAc;IACzB,WAAW,4BAAsB;CAClC;AAED,cAAM,kBAAmB,SAAQ,yBAAyB;IACxD,OAAO,CAAC,QAAQ;IAQD,MAAM;CAmFtB"}
package/dist/node.cjs CHANGED
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  ));
25
25
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
26
26
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
27
- const tailwind_plugin = require("./tailwind.plugin-Dvf5FtVR.cjs");
27
+ const tailwind_plugin = require("./tailwind.plugin-CEGlpiFj.cjs");
28
28
  const theme = require("@udixio/theme");
29
29
  const fs = require("fs");
30
30
  const console = require("node:console");
@@ -61,6 +61,7 @@ class TailwindImplPlugin extends tailwind_plugin.TailwindImplPluginBrowser {
61
61
  return typeof process !== "undefined" && process.versions != null && process.versions.node != null;
62
62
  }
63
63
  async onLoad() {
64
+ this.outputCss = "";
64
65
  if (!this.isNodeJs()) {
65
66
  await super.onLoad();
66
67
  return;
package/dist/node.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { T as TailwindImplPluginBrowser, m as main } from "./tailwind.plugin-kD1ORWiZ.js";
5
- import { a, f, s } from "./tailwind.plugin-kD1ORWiZ.js";
4
+ import { T as TailwindImplPluginBrowser, m as main } from "./tailwind.plugin-Bvh5RFHQ.js";
5
+ import { a, f, s } from "./tailwind.plugin-Bvh5RFHQ.js";
6
6
  import { PluginAbstract, FontPlugin } from "@udixio/theme";
7
7
  import * as fs from "fs";
8
8
  import * as console from "node:console";
@@ -21,6 +21,7 @@ class TailwindImplPlugin extends TailwindImplPluginBrowser {
21
21
  return typeof process !== "undefined" && process.versions != null && process.versions.node != null;
22
22
  }
23
23
  async onLoad() {
24
+ this.outputCss = "";
24
25
  if (!this.isNodeJs()) {
25
26
  await super.onLoad();
26
27
  return;
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  import plugin from "tailwindcss/plugin";
5
5
  import { kebabCase } from "text-case";
6
6
  import { PluginAbstract, FontPlugin, PluginImplAbstract } from "@udixio/theme";
7
- import { Hct, argbFromHex, hexFromArgb } from "@material/material-color-utilities";
7
+ import { hexFromArgb, Hct, argbFromHex } from "@material/material-color-utilities";
8
8
  const createAnimationFunc = ({
9
9
  addBase,
10
10
  prefix,
@@ -726,6 +726,7 @@ class TailwindImplPluginBrowser extends PluginImplAbstract {
726
726
  })}
727
727
  }`;
728
728
  const sourceColor = this.api.context.sourceColor;
729
+ const originalSourceColorHex = hexFromArgb(sourceColor.toInt());
729
730
  for (const [key, value] of Object.entries(this.options.subThemes ?? {})) {
730
731
  const newHue = Hct.fromInt(argbFromHex(value)).hue;
731
732
  const newColor = Hct.from(newHue, sourceColor.chroma, sourceColor.tone);
@@ -745,9 +746,10 @@ class TailwindImplPluginBrowser extends PluginImplAbstract {
745
746
  mode: darkMode,
746
747
  darkSelector: darkSelector ?? "",
747
748
  styles: Object.entries(colors2).map(([key2, value2]) => `--color-${key2}: ${value2.dark};`).join("\n ")
748
- })}
749
+ })}
749
750
  }`;
750
751
  }
752
+ this.api.context.sourceColor = originalSourceColorHex;
751
753
  }
752
754
  getColors() {
753
755
  const colors = {};
@@ -765,7 +767,7 @@ class TailwindImplPluginBrowser extends PluginImplAbstract {
765
767
  return colors;
766
768
  }
767
769
  async onLoad() {
768
- this.getColors();
770
+ this.outputCss = "";
769
771
  this.loadColor({ isDynamic: true });
770
772
  }
771
773
  }
@@ -727,6 +727,7 @@ class TailwindImplPluginBrowser extends theme.PluginImplAbstract {
727
727
  })}
728
728
  }`;
729
729
  const sourceColor = this.api.context.sourceColor;
730
+ const originalSourceColorHex = materialColorUtilities.hexFromArgb(sourceColor.toInt());
730
731
  for (const [key, value] of Object.entries(this.options.subThemes ?? {})) {
731
732
  const newHue = materialColorUtilities.Hct.fromInt(materialColorUtilities.argbFromHex(value)).hue;
732
733
  const newColor = materialColorUtilities.Hct.from(newHue, sourceColor.chroma, sourceColor.tone);
@@ -746,9 +747,10 @@ class TailwindImplPluginBrowser extends theme.PluginImplAbstract {
746
747
  mode: darkMode,
747
748
  darkSelector: darkSelector ?? "",
748
749
  styles: Object.entries(colors2).map(([key2, value2]) => `--color-${key2}: ${value2.dark};`).join("\n ")
749
- })}
750
+ })}
750
751
  }`;
751
752
  }
753
+ this.api.context.sourceColor = originalSourceColorHex;
752
754
  }
753
755
  getColors() {
754
756
  const colors = {};
@@ -766,7 +768,7 @@ class TailwindImplPluginBrowser extends theme.PluginImplAbstract {
766
768
  return colors;
767
769
  }
768
770
  async onLoad() {
769
- this.getColors();
771
+ this.outputCss = "";
770
772
  this.loadColor({ isDynamic: true });
771
773
  }
772
774
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udixio/tailwind",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "type": "module",
5
5
  "main": "./dist/node.js",
6
6
  "module": "./dist/node.js",
@@ -31,7 +31,7 @@
31
31
  "chalk": "^5.6.0",
32
32
  "pathe": "^2.0.3",
33
33
  "tslib": "^2.3.0",
34
- "@udixio/theme": "2.1.0"
34
+ "@udixio/theme": "2.1.1"
35
35
  },
36
36
  "repository": {
37
37
  "type": "git",
@@ -163,6 +163,8 @@ export class TailwindImplPluginBrowser extends PluginImplAbstract<TailwindPlugin
163
163
  }`;
164
164
 
165
165
  const sourceColor = this.api.context.sourceColor;
166
+ const originalSourceColorHex = hexFromArgb(sourceColor.toInt());
167
+
166
168
  for (const [key, value] of Object.entries(this.options.subThemes ?? {})) {
167
169
  const newHue = Hct.fromInt(argbFromHex(value)).hue;
168
170
  const newColor = Hct.from(newHue, sourceColor.chroma, sourceColor.tone);
@@ -188,9 +190,12 @@ export class TailwindImplPluginBrowser extends PluginImplAbstract<TailwindPlugin
188
190
  styles: Object.entries(colors)
189
191
  .map(([key, value]) => `--color-${key}: ${value.dark};`)
190
192
  .join('\n '),
191
- })}
193
+ })}
192
194
  }`;
193
195
  }
196
+
197
+ // Restore original sourceColor after processing subThemes
198
+ this.api.context.sourceColor = originalSourceColorHex;
194
199
  }
195
200
 
196
201
  getColors() {
@@ -210,7 +215,8 @@ export class TailwindImplPluginBrowser extends PluginImplAbstract<TailwindPlugin
210
215
  }
211
216
 
212
217
  async onLoad() {
213
- this.getColors();
218
+ this.outputCss = '';
219
+ // this.getColors();
214
220
 
215
221
  // if (typeof window !== 'undefined') {
216
222
  // const { tailwindBrowserInit } = await import('./tailwind-browser');
@@ -28,6 +28,7 @@ class TailwindImplPlugin extends TailwindImplPluginBrowser {
28
28
  }
29
29
 
30
30
  override async onLoad() {
31
+ this.outputCss = '';
31
32
  if (!this.isNodeJs()) {
32
33
  await super.onLoad();
33
34
  return;