@react-email/tailwind 0.0.15-canary.1 → 0.0.15

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/dist/index.js CHANGED
@@ -2431,7 +2431,7 @@ ${n.map(({variableName:a,uniqueLocalName:c})=>` reactHotLoader.register(${a}, "
2431
2431
  @tailwind base;
2432
2432
  @tailwind components;
2433
2433
  @tailwind utilities;
2434
- `,{from:void 0}).css},UX=t=>{const e=/rgb\(\s*(\d+)\s*(\d+)\s*(\d+)(?:\s*\/\s*([\d%.]+))?\s*\)/gm;return t.replaceAll(e,(n,a,c,u,r)=>{const l=r==="1"||typeof r>"u"?"":`,${r}`;return`rgb(${a},${c},${u}${l})`})},VX=t=>t.replace(/-(\w|$)/g,(e,n)=>n.toUpperCase()),WX=t=>{let e=t;return e=e.toLowerCase(),e==="float"?"cssFloat":e.startsWith("--")?e:(e.startsWith("-ms-")&&(e=e.slice(1)),VX(e))},HX=t=>Array.from(t.matchAll(/([a-zA-Z0-9\-_]+)\s*:\s*('[^']*'[^;]*|"[^"]*"[^;]*|[^;]*?\([^)]*\)[^;]*|[^;(]*);?/gm)).map(([e,n,a])=>({property:n,value:a.replaceAll(/[\r\n|\r|\n]+/g,"").replaceAll(/\s+/g," ")})),qX=t=>{const e={},n=HX(t);for(const{property:a,value:c}of n)a.length>0&&c.trim().length>0&&(e[WX(a)]=c.trim());return e};function C0(t){return t.replaceAll(/\\[0-9]|\\/g,"")}const LI=t=>t.replaceAll("+","plus").replaceAll("[","").replaceAll("%","pc").replaceAll("]","").replaceAll("(","").replaceAll(")","").replaceAll("!","imprtnt").replaceAll(">","gt").replaceAll("<","lt").replaceAll("=","eq").replace(/[^a-zA-Z0-9\-_]/g,"_");function GX(t){const e=C0(t);return LI(e)}function zX(t){return t.split(";").map(e=>e.endsWith("!important")?e.trim():`${e.trim()}!important`).join(";")}function KX(t,e){const n=Jc(Gl.jsx(Gl.Fragment,{children:t})),a=UX($X(n,e)),[c,u]=CO(a),r={};for(const f of Lg(c)){const d=C0(f.selector);r[d]=qX(f.content)}const l=[],i=u.map(f=>{let d=f;for(const s of Lg(f))l.push(C0(s.selector)),d=d.replace(s.value,s.value.replace(s.selector,GX(s.selector)).replace(s.content,zX(s.content)).trim());return d.replace(/(\r\n|\r|\n)+/gm,"").replace(/\s+/gm," ")});return{stylePerClassMap:r,sanitizedMediaQueries:i,nonInlinableClasses:l}}function YX(t){return e=>{const n=e.split(" "),a=[];let c={};for(const u of n)u in t?c={...c,...t[u]}:a.push(u);return{styles:c,residualClassName:a.join(" ")}}}const XX=t=>t.replace(/\/\*[\s\S]*?\*\//gm,"").replace(/;\s+/gm,";").replace(/:\s+/gm,":").replace(/\)\s*{/gm,"){").replace(/\s+\(/gm,"(").replace(/{\s+/gm,"{").replace(/}\s+/gm,"}").replace(/\s*{/gm,"{").replace(/;?\s*}/gm,"}"),JX=({children:t,config:e})=>{const{stylePerClassMap:n,nonInlinableClasses:a,sanitizedMediaQueries:c}=KX(t,e??{}),u=YX(n),r=c.filter(s=>s.trim().length>0),l=r.length>0;let i=!1;function f(s){const o={};if(!i&&l&&s.type==="head"){i=!0;const y=Gl.jsx("style",{children:XX(r.join(""))});return Ys.cloneElement(s,s.props,s.props.children,y)}if(s.props.children&&(o.children=Ys.Children.map(s.props.children,y=>Ys.isValidElement(y)?f(y):y)),s.props.className){const{styles:y,residualClassName:b}=u(s.props.className);if(o.style={...s.props.style,...y},b.trim().length>0){o.className=b;for(const E of a)o.className=o.className.replace(E,LI(E))}else o.className=void 0}const m={...s.props,...o},h=o.children?o.children:s.props.children;if(typeof s.type=="function"){const y=s.type,b=y({...s.props,...o});if(Ys.isValidElement(b))return f(b)}return Ys.cloneElement(s,m,h)}const d=Ys.Children.map(t,s=>{if(Ys.isValidElement(s))return f(s)})??[];if(l&&!i)throw new Error(`You are trying to use the following Tailwind classes that have media queries: ${a.join(" ")}.
2434
+ `,{from:void 0}).css},UX=t=>{const e=/rgb\(\s*(\d+)\s*(\d+)\s*(\d+)(?:\s*\/\s*([\d%.]+))?\s*\)/gm;return t.replaceAll(e,(n,a,c,u,r)=>{const l=r==="1"||typeof r>"u"?"":`,${r}`;return`rgb(${a},${c},${u}${l})`})},VX=t=>t.replace(/-(\w|$)/g,(e,n)=>n.toUpperCase()),WX=t=>{let e=t;return e=e.toLowerCase(),e==="float"?"cssFloat":e.startsWith("--")?e:(e.startsWith("-ms-")&&(e=e.slice(1)),VX(e))},HX=t=>Array.from(t.matchAll(/([a-zA-Z0-9\-_]+)\s*:\s*('[^']*'[^;]*|"[^"]*"[^;]*|[^;]*?\([^)]*\)[^;]*|[^;(]*);?/gm)).map(([e,n,a])=>({property:n,value:a.replaceAll(/[\r\n|\r|\n]+/g,"").replaceAll(/\s+/g," ")})),qX=t=>{const e={},n=HX(t);for(const{property:a,value:c}of n)a.length>0&&c.trim().length>0&&(e[WX(a)]=c.trim());return e};function C0(t){return t.replaceAll(/\\[0-9]|\\/g,"")}const LI=t=>t.replaceAll("+","plus").replaceAll("[","").replaceAll("%","pc").replaceAll("]","").replaceAll("(","").replaceAll(")","").replaceAll("!","imprtnt").replaceAll(">","gt").replaceAll("<","lt").replaceAll("=","eq").replace(/[^a-zA-Z0-9\-_]/g,"_");function GX(t){const e=C0(t);return LI(e)}function zX(t){return t.split(";").map(e=>e.endsWith("!important")?e.trim():`${e.trim()}!important`).join(";")}function KX(t,e){const n=Jc(Gl.jsx(Gl.Fragment,{children:t})),a=UX($X(n,e)),[c,u]=CO(a),r={};for(const f of Lg(c)){const d=C0(f.selector);r[d]=qX(f.content)}const l=[],i=u.map(f=>{let d=f;for(const s of Lg(f))l.push(C0(s.selector)),d=d.replace(s.value,s.value.replace(s.selector,GX(s.selector)).replace(s.content,zX(s.content)).trim());return d.replace(/(\r\n|\r|\n)+/gm,"").replace(/\s+/gm," ")});return{stylePerClassMap:r,sanitizedMediaQueries:i,nonInlinableClasses:l}}function YX(t){return e=>{const n=e.split(" "),a=[];let c={};for(const u of n)u in t?c={...c,...t[u]}:a.push(u);return{styles:c,residualClassName:a.join(" ")}}}const XX=t=>t.replace(/\/\*[\s\S]*?\*\//gm,"").replace(/;\s+/gm,";").replace(/:\s+/gm,":").replace(/\)\s*{/gm,"){").replace(/\s+\(/gm,"(").replace(/{\s+/gm,"{").replace(/}\s+/gm,"}").replace(/\s*{/gm,"{").replace(/;?\s*}/gm,"}"),JX=({children:t,config:e})=>{const{stylePerClassMap:n,nonInlinableClasses:a,sanitizedMediaQueries:c}=KX(t,e??{}),u=YX(n),r=c.filter(s=>s.trim().length>0),l=r.length>0;let i=!1;function f(s){const o={};if(!i&&l&&s.type==="head"){i=!0;const y=Gl.jsx("style",{children:XX(r.join(""))});return Ys.cloneElement(s,s.props,s.props.children,y)}if(s.props.children&&(o.children=Ys.Children.map(s.props.children,y=>Ys.isValidElement(y)?f(y):y)),s.props.className){const{styles:y,residualClassName:b}=u(s.props.className);if(o.style={...s.props.style,...y},b.trim().length>0){o.className=b;for(const E of a)o.className=o.className.replace(E,LI(E))}else o.className=void 0}const m={...s.props,...o},h=o.children?o.children:s.props.children;if(typeof s.type=="function"){const y=s.type,b=y({...s.props,...o});if(Ys.isValidElement(b))return f(b)}return Ys.cloneElement(s,m,h)}const d=Ys.Children.map(t,s=>Ys.isValidElement(s)?f(s):s)??[];if(l&&!i)throw new Error(`You are trying to use the following Tailwind classes that have media queries: ${a.join(" ")}.
2435
2435
  For the media queries to work properly on rendering, they need to be added into a <style> tag inside of a <head> tag,
2436
2436
  the Tailwind component tried finding a <head> element but just wasn't able to find it.
2437
2437
 
package/dist/index.mjs CHANGED
@@ -93083,10 +93083,7 @@ const YX = (t) => t.replace(/\/\*[\s\S]*?\*\//gm, "").replace(/;\s+/gm, ";").rep
93083
93083
  }
93084
93084
  return Ys.cloneElement(s, m, h);
93085
93085
  }
93086
- const d = Ys.Children.map(t, (s) => {
93087
- if (Ys.isValidElement(s))
93088
- return f(s);
93089
- }) ?? [];
93086
+ const d = Ys.Children.map(t, (s) => Ys.isValidElement(s) ? f(s) : s) ?? [];
93090
93087
  if (l && !i)
93091
93088
  throw new Error(
93092
93089
  `You are trying to use the following Tailwind classes that have media queries: ${a.join(
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../src/tailwind.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAMpE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAQD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAyH5C,CAAC"}
1
+ {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../src/tailwind.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAMpE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAQD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA2H5C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-email/tailwind",
3
- "version": "0.0.15-canary.1",
3
+ "version": "0.0.15",
4
4
  "description": "A React component to wrap emails with Tailwind CSS",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -60,10 +60,10 @@
60
60
  "vite-plugin-node-polyfills": "0.17.0",
61
61
  "@react-email/button": "^0.0.14",
62
62
  "@react-email/head": "0.0.7",
63
- "@react-email/html": "0.0.7",
64
63
  "eslint-config-custom": "0.0.0",
65
- "@react-email/hr": "0.0.7",
66
- "tsconfig": "0.0.0"
64
+ "@react-email/html": "0.0.7",
65
+ "tsconfig": "0.0.0",
66
+ "@react-email/hr": "0.0.7"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public"