dymo-api 1.0.79 → 1.0.80

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.
@@ -48,8 +48,9 @@ const customError = (code, message) => {
48
48
  return Object.assign(new Error(), { code, message: `[${config_1.default.lib.name}] ${message}` });
49
49
  };
50
50
  const convertTailwindToInlineCss = (htmlContent) => {
51
- return htmlContent.replace(/class="([^"]+)"/g, (match, classList) => {
52
- return match.replace("class", "style").replace(classList, (0, tw_to_css_1.twi)(classList, { minify: true, merge: true }));
51
+ return htmlContent.replace(/class="([^"]+)"( style="([^"]+)")?/g, (match, classList, _, existingStyle) => {
52
+ const compiledStyles = (0, tw_to_css_1.twi)(classList, { minify: true, merge: true });
53
+ return match.replace(/class="[^"]+"/, "").replace(/ style="[^"]+"/, "").concat(` style="${existingStyle ? `${existingStyle.trim().slice(0, -1)}; ${compiledStyles}` : compiledStyles}"`);
53
54
  });
54
55
  };
55
56
  /**
@@ -9,8 +9,9 @@ const customError = (code, message) => {
9
9
  return Object.assign(new Error(), { code, message: `[${config.lib.name}] ${message}` });
10
10
  };
11
11
  const convertTailwindToInlineCss = (htmlContent) => {
12
- return htmlContent.replace(/class="([^"]+)"/g, (match, classList) => {
13
- return match.replace("class", "style").replace(classList, twi(classList, { minify: true, merge: true }));
12
+ return htmlContent.replace(/class="([^"]+)"( style="([^"]+)")?/g, (match, classList, _, existingStyle) => {
13
+ const compiledStyles = twi(classList, { minify: true, merge: true });
14
+ return match.replace(/class="[^"]+"/, "").replace(/ style="[^"]+"/, "").concat(` style="${existingStyle ? `${existingStyle.trim().slice(0, -1)}; ${compiledStyles}` : compiledStyles}"`);
14
15
  });
15
16
  };
16
17
  /**
@@ -36,6 +36,7 @@ export interface SendEmail {
36
36
  options?: {
37
37
  priority?: "high" | "normal" | "low" | undefined;
38
38
  composeTailwindClasses?: boolean;
39
+ compileToCssSafe?: boolean;
39
40
  };
40
41
  attachments?: Attachment[];
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dymo-api",
3
- "version": "1.0.79",
3
+ "version": "1.0.80",
4
4
  "description": "Flow system for Dymo API.",
5
5
  "main": "dist/cjs/dymo-api.js",
6
6
  "module": "dist/esm/dymo-api.js",