@react-email/tailwind 2.0.0-canary.1 → 2.0.0-canary.2
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.d.mts +6 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -25
- package/dist/index.mjs +31 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,12 @@ import * as React$1 from "react";
|
|
|
2
2
|
import { Config } from "tailwindcss";
|
|
3
3
|
import { StyleSheet } from "css-tree";
|
|
4
4
|
|
|
5
|
+
//#region src/inline-styles.d.ts
|
|
6
|
+
declare function inlineStyles(styleSheet: StyleSheet, classes: string[]): Record<string, string>;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/sanitize-stylesheet.d.ts
|
|
9
|
+
declare function sanitizeStyleSheet(styleSheet: StyleSheet): void;
|
|
10
|
+
//#endregion
|
|
5
11
|
//#region src/tailwind.d.ts
|
|
6
12
|
type TailwindConfig = Omit<Config, 'content'>;
|
|
7
13
|
interface TailwindProps {
|
|
@@ -14,8 +20,6 @@ interface EmailElementProps {
|
|
|
14
20
|
style?: React$1.CSSProperties;
|
|
15
21
|
}
|
|
16
22
|
declare const pixelBasedPreset: TailwindConfig;
|
|
17
|
-
declare function sanitizeStyleSheet(styleSheet: StyleSheet): void;
|
|
18
|
-
declare function inlineStyles(styleSheet: StyleSheet, classes: string[]): Record<string, string>;
|
|
19
23
|
declare function Tailwind({
|
|
20
24
|
children,
|
|
21
25
|
config
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tailwind.tsx","../src/utils/tailwindcss/setup-tailwind.ts"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/inline-styles.ts","../src/sanitize-stylesheet.ts","../src/tailwind.tsx","../src/utils/tailwindcss/setup-tailwind.ts"],"sourcesContent":[],"mappings":";;;;;iBAKgB,YAAA,aACF,gCAEX;;;iBCHa,kBAAA,aAA+B;;;KCOnC,cAAA,GAAiB,KAAK;UAEjB,aAAA;YACL,OAAA,CAAM;EFVF,MAAA,CAAA,EEWL,cFXiB;;AACd,UEaG,iBAAA,CFbH;UAEX,CAAA,EEYU,OAAA,CAAM,SFZhB;EAAM,SAAA,CAAA,EAAA,MAAA;UEcC,OAAA,CAAM;;cAGH,kBAAkB;ADpBf,iBC+EA,QAAA,CD/EkB;EAAa,QAAA;EAAA;AAAU,CAAA,EC+EV,aD/EU,CAAA,EC+EG,OAAA,CAAA,SD/EH;;;KEG7C,aAAA,GAAgB,QAAQ,kBAAkB;iBAEhC,aAAA,SAAsB,iBAAc;;EHL1C,aAAA,EAAY,GAAA,GGyED,UHzEC;CAAA,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ import { StyleSheet } from "css-tree";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Config } from "tailwindcss";
|
|
4
4
|
|
|
5
|
+
//#region src/inline-styles.d.ts
|
|
6
|
+
declare function inlineStyles(styleSheet: StyleSheet, classes: string[]): Record<string, string>;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/sanitize-stylesheet.d.ts
|
|
9
|
+
declare function sanitizeStyleSheet(styleSheet: StyleSheet): void;
|
|
10
|
+
//#endregion
|
|
5
11
|
//#region src/tailwind.d.ts
|
|
6
12
|
type TailwindConfig = Omit<Config, 'content'>;
|
|
7
13
|
interface TailwindProps {
|
|
@@ -14,8 +20,6 @@ interface EmailElementProps {
|
|
|
14
20
|
style?: React.CSSProperties;
|
|
15
21
|
}
|
|
16
22
|
declare const pixelBasedPreset: TailwindConfig;
|
|
17
|
-
declare function sanitizeStyleSheet(styleSheet: StyleSheet): void;
|
|
18
|
-
declare function inlineStyles(styleSheet: StyleSheet, classes: string[]): Record<string, string>;
|
|
19
23
|
declare function Tailwind({
|
|
20
24
|
children,
|
|
21
25
|
config
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/tailwind.tsx","../src/utils/tailwindcss/setup-tailwind.ts"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/inline-styles.ts","../src/sanitize-stylesheet.ts","../src/tailwind.tsx","../src/utils/tailwindcss/setup-tailwind.ts"],"sourcesContent":[],"mappings":";;;;;iBAKgB,YAAA,aACF,gCAEX;;;iBCHa,kBAAA,aAA+B;;;KCOnC,cAAA,GAAiB,KAAK;UAEjB,aAAA;YACL,KAAA,CAAM;EFVF,MAAA,CAAA,EEWL,cFXiB;;AACd,UEaG,iBAAA,CFbH;UAEX,CAAA,EEYU,KAAA,CAAM,SFZhB;EAAM,SAAA,CAAA,EAAA,MAAA;UEcC,KAAA,CAAM;;cAGH,kBAAkB;ADpBf,iBC+EA,QAAA,CD/EkB;EAAa,QAAA;EAAA;AAAU,CAAA,EC+EV,aD/EU,CAAA,EC+EG,KAAA,CAAA,SD/EH;;;KEG7C,aAAA,GAAgB,QAAQ,kBAAkB;iBAEhC,aAAA,SAAsB,iBAAc;;EHL1C,aAAA,EAAY,GAAA,GGyED,UHzEC;CAAA,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19038,21 +19038,6 @@ const { version } = {
|
|
|
19038
19038
|
//#region ../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/index.js
|
|
19039
19039
|
const { tokenize, parse, generate, lexer, createLexer, walk, find, findLast, findAll, toPlainObject, fromPlainObject, fork } = syntax_default;
|
|
19040
19040
|
|
|
19041
|
-
//#endregion
|
|
19042
|
-
//#region src/hooks/use-suspended-promise.ts
|
|
19043
|
-
const promiseStates = /* @__PURE__ */ new Map();
|
|
19044
|
-
function useSuspensedPromise(promiseFn, key) {
|
|
19045
|
-
const previousState = promiseStates.get(key);
|
|
19046
|
-
if (previousState) {
|
|
19047
|
-
if ("error" in previousState) throw previousState.error;
|
|
19048
|
-
if ("result" in previousState) return previousState.result;
|
|
19049
|
-
throw previousState.promise;
|
|
19050
|
-
}
|
|
19051
|
-
const state = { promise: promiseFn().then((result) => state.result = result).catch((error) => state.error = error) };
|
|
19052
|
-
promiseStates.set(key, state);
|
|
19053
|
-
throw state.promise;
|
|
19054
|
-
}
|
|
19055
|
-
|
|
19056
19041
|
//#endregion
|
|
19057
19042
|
//#region src/utils/css/is-rule-inlinable.ts
|
|
19058
19043
|
function isRuleInlinable(rule) {
|
|
@@ -19189,6 +19174,14 @@ function makeInlineStylesFor(inlinableRules, customProperties) {
|
|
|
19189
19174
|
return styles;
|
|
19190
19175
|
}
|
|
19191
19176
|
|
|
19177
|
+
//#endregion
|
|
19178
|
+
//#region src/inline-styles.ts
|
|
19179
|
+
function inlineStyles(styleSheet, classes) {
|
|
19180
|
+
const { inlinable: inlinableRules } = extractRulesPerClass(styleSheet, classes);
|
|
19181
|
+
const customProperties = getCustomProperties(styleSheet);
|
|
19182
|
+
return makeInlineStylesFor(Array.from(inlinableRules.values()), customProperties);
|
|
19183
|
+
}
|
|
19184
|
+
|
|
19192
19185
|
//#endregion
|
|
19193
19186
|
//#region src/utils/css/resolve-all-css-variables.ts
|
|
19194
19187
|
function doSelectorsIntersect(first, second) {
|
|
@@ -19655,6 +19648,29 @@ function sanitizeDeclarations(nodeContainingDeclarations) {
|
|
|
19655
19648
|
});
|
|
19656
19649
|
}
|
|
19657
19650
|
|
|
19651
|
+
//#endregion
|
|
19652
|
+
//#region src/sanitize-stylesheet.ts
|
|
19653
|
+
function sanitizeStyleSheet(styleSheet) {
|
|
19654
|
+
resolveAllCssVariables(styleSheet);
|
|
19655
|
+
resolveCalcExpressions(styleSheet);
|
|
19656
|
+
sanitizeDeclarations(styleSheet);
|
|
19657
|
+
}
|
|
19658
|
+
|
|
19659
|
+
//#endregion
|
|
19660
|
+
//#region src/hooks/use-suspended-promise.ts
|
|
19661
|
+
const promiseStates = /* @__PURE__ */ new Map();
|
|
19662
|
+
function useSuspensedPromise(promiseFn, key) {
|
|
19663
|
+
const previousState = promiseStates.get(key);
|
|
19664
|
+
if (previousState) {
|
|
19665
|
+
if ("error" in previousState) throw previousState.error;
|
|
19666
|
+
if ("result" in previousState) return previousState.result;
|
|
19667
|
+
throw previousState.promise;
|
|
19668
|
+
}
|
|
19669
|
+
const state = { promise: promiseFn().then((result) => state.result = result).catch((error) => state.error = error) };
|
|
19670
|
+
promiseStates.set(key, state);
|
|
19671
|
+
throw state.promise;
|
|
19672
|
+
}
|
|
19673
|
+
|
|
19658
19674
|
//#endregion
|
|
19659
19675
|
//#region src/utils/compatibility/sanitize-class-name.ts
|
|
19660
19676
|
const digitToNameMap = {
|
|
@@ -21674,16 +21690,6 @@ const pixelBasedPreset = { theme: { extend: {
|
|
|
21674
21690
|
96: "384px"
|
|
21675
21691
|
}
|
|
21676
21692
|
} } };
|
|
21677
|
-
function sanitizeStyleSheet(styleSheet) {
|
|
21678
|
-
resolveAllCssVariables(styleSheet);
|
|
21679
|
-
resolveCalcExpressions(styleSheet);
|
|
21680
|
-
sanitizeDeclarations(styleSheet);
|
|
21681
|
-
}
|
|
21682
|
-
function inlineStyles(styleSheet, classes) {
|
|
21683
|
-
const { inlinable: inlinableRules } = extractRulesPerClass(styleSheet, classes);
|
|
21684
|
-
const customProperties = getCustomProperties(styleSheet);
|
|
21685
|
-
return makeInlineStylesFor(Array.from(inlinableRules.values()), customProperties);
|
|
21686
|
-
}
|
|
21687
21693
|
function Tailwind({ children, config }) {
|
|
21688
21694
|
const tailwindSetup = useSuspensedPromise(() => setupTailwind(config ?? {}), JSON.stringify(config, (_key, value) => typeof value === "function" ? value.toString() : value));
|
|
21689
21695
|
let classesUsed = [];
|
package/dist/index.mjs
CHANGED
|
@@ -19025,21 +19025,6 @@ const { version } = {
|
|
|
19025
19025
|
//#region ../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/index.js
|
|
19026
19026
|
const { tokenize, parse, generate, lexer, createLexer, walk, find, findLast, findAll, toPlainObject, fromPlainObject, fork } = syntax_default;
|
|
19027
19027
|
|
|
19028
|
-
//#endregion
|
|
19029
|
-
//#region src/hooks/use-suspended-promise.ts
|
|
19030
|
-
const promiseStates = /* @__PURE__ */ new Map();
|
|
19031
|
-
function useSuspensedPromise(promiseFn, key) {
|
|
19032
|
-
const previousState = promiseStates.get(key);
|
|
19033
|
-
if (previousState) {
|
|
19034
|
-
if ("error" in previousState) throw previousState.error;
|
|
19035
|
-
if ("result" in previousState) return previousState.result;
|
|
19036
|
-
throw previousState.promise;
|
|
19037
|
-
}
|
|
19038
|
-
const state = { promise: promiseFn().then((result) => state.result = result).catch((error) => state.error = error) };
|
|
19039
|
-
promiseStates.set(key, state);
|
|
19040
|
-
throw state.promise;
|
|
19041
|
-
}
|
|
19042
|
-
|
|
19043
19028
|
//#endregion
|
|
19044
19029
|
//#region src/utils/css/is-rule-inlinable.ts
|
|
19045
19030
|
function isRuleInlinable(rule) {
|
|
@@ -19176,6 +19161,14 @@ function makeInlineStylesFor(inlinableRules, customProperties) {
|
|
|
19176
19161
|
return styles;
|
|
19177
19162
|
}
|
|
19178
19163
|
|
|
19164
|
+
//#endregion
|
|
19165
|
+
//#region src/inline-styles.ts
|
|
19166
|
+
function inlineStyles(styleSheet, classes) {
|
|
19167
|
+
const { inlinable: inlinableRules } = extractRulesPerClass(styleSheet, classes);
|
|
19168
|
+
const customProperties = getCustomProperties(styleSheet);
|
|
19169
|
+
return makeInlineStylesFor(Array.from(inlinableRules.values()), customProperties);
|
|
19170
|
+
}
|
|
19171
|
+
|
|
19179
19172
|
//#endregion
|
|
19180
19173
|
//#region src/utils/css/resolve-all-css-variables.ts
|
|
19181
19174
|
function doSelectorsIntersect(first, second) {
|
|
@@ -19642,6 +19635,29 @@ function sanitizeDeclarations(nodeContainingDeclarations) {
|
|
|
19642
19635
|
});
|
|
19643
19636
|
}
|
|
19644
19637
|
|
|
19638
|
+
//#endregion
|
|
19639
|
+
//#region src/sanitize-stylesheet.ts
|
|
19640
|
+
function sanitizeStyleSheet(styleSheet) {
|
|
19641
|
+
resolveAllCssVariables(styleSheet);
|
|
19642
|
+
resolveCalcExpressions(styleSheet);
|
|
19643
|
+
sanitizeDeclarations(styleSheet);
|
|
19644
|
+
}
|
|
19645
|
+
|
|
19646
|
+
//#endregion
|
|
19647
|
+
//#region src/hooks/use-suspended-promise.ts
|
|
19648
|
+
const promiseStates = /* @__PURE__ */ new Map();
|
|
19649
|
+
function useSuspensedPromise(promiseFn, key) {
|
|
19650
|
+
const previousState = promiseStates.get(key);
|
|
19651
|
+
if (previousState) {
|
|
19652
|
+
if ("error" in previousState) throw previousState.error;
|
|
19653
|
+
if ("result" in previousState) return previousState.result;
|
|
19654
|
+
throw previousState.promise;
|
|
19655
|
+
}
|
|
19656
|
+
const state = { promise: promiseFn().then((result) => state.result = result).catch((error) => state.error = error) };
|
|
19657
|
+
promiseStates.set(key, state);
|
|
19658
|
+
throw state.promise;
|
|
19659
|
+
}
|
|
19660
|
+
|
|
19645
19661
|
//#endregion
|
|
19646
19662
|
//#region src/utils/compatibility/sanitize-class-name.ts
|
|
19647
19663
|
const digitToNameMap = {
|
|
@@ -21661,16 +21677,6 @@ const pixelBasedPreset = { theme: { extend: {
|
|
|
21661
21677
|
96: "384px"
|
|
21662
21678
|
}
|
|
21663
21679
|
} } };
|
|
21664
|
-
function sanitizeStyleSheet(styleSheet) {
|
|
21665
|
-
resolveAllCssVariables(styleSheet);
|
|
21666
|
-
resolveCalcExpressions(styleSheet);
|
|
21667
|
-
sanitizeDeclarations(styleSheet);
|
|
21668
|
-
}
|
|
21669
|
-
function inlineStyles(styleSheet, classes) {
|
|
21670
|
-
const { inlinable: inlinableRules } = extractRulesPerClass(styleSheet, classes);
|
|
21671
|
-
const customProperties = getCustomProperties(styleSheet);
|
|
21672
|
-
return makeInlineStylesFor(Array.from(inlinableRules.values()), customProperties);
|
|
21673
|
-
}
|
|
21674
21680
|
function Tailwind({ children, config }) {
|
|
21675
21681
|
const tailwindSetup = useSuspensedPromise(() => setupTailwind(config ?? {}), JSON.stringify(config, (_key, value) => typeof value === "function" ? value.toString() : value));
|
|
21676
21682
|
let classesUsed = [];
|