@maizzle/framework 6.0.0-4 → 6.0.0-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
@@ -4,7 +4,19 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [6.0.0-3] - 2025-07-14
7
+ ## [6.0.0-6] - 2025-07-14
8
+
9
+ ### Fixed
10
+
11
+ - use extension when importing file 99835d3
12
+
13
+ ## [6.0.0-5] - 2025-07-14
14
+
15
+ ### Changed
16
+
17
+ - run css compilation before components too 272bbdb
18
+
19
+ ## [6.0.0-4] - 2025-07-14
8
20
 
9
21
  ### Added
10
22
 
@@ -18,6 +30,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
18
30
 
19
31
  - removed `posthtml-postcss` dependency
20
32
 
33
+ ## [6.0.0-3] - 2025-07-14
34
+
35
+ ### Added
36
+
37
+ - safelist spark targeting selectors f29efb8
38
+ - safelist targeting for superhuman beb6b41
39
+ - safelist notion mail targeting 5cfd68f
40
+
41
+ ### Changed
42
+
43
+ - safelisting outlook targeting b8b21f3
44
+ - safelisting selectors acb7b80
45
+
46
+ ### Fixed
47
+
48
+ - safelist class names for container queries b828c44
49
+ - purge safelisting patterns d6b9c48
50
+ - safelisting comcast targeting selector 9677421
51
+ - preserve yahoo mail targeting selectors 2f3429f
52
+
21
53
  ## [6.0.0-2] - 2025-07-11
22
54
 
23
55
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maizzle/framework",
3
- "version": "6.0.0-4",
3
+ "version": "6.0.0-6",
4
4
  "description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -11,9 +11,10 @@ import envAttributes from './plugins/envAttributes.js'
11
11
  import { getPosthtmlOptions } from './defaultConfig.js'
12
12
  import combineMediaQueries from './plugins/combineMediaQueries.js'
13
13
  import defaultComponentsConfig from './defaultComponentsConfig.js'
14
+ import removeRawStyleAttributes from './plugins/removeRawStyleAttributes.js'
14
15
 
15
16
  // PostCSS
16
- import compileCss from './plugins/postcss/compileCss.js'
17
+ import { compileCss } from './plugins/postcss/compileCss.js'
17
18
 
18
19
  export async function process(html = '', config = {}) {
19
20
  /**
@@ -71,6 +72,7 @@ export async function process(html = '', config = {}) {
71
72
 
72
73
  return posthtml([
73
74
  ...beforePlugins,
75
+ compileCss(config),
74
76
  fetchPlugin,
75
77
  components(componentsConfig),
76
78
  fetchPlugin,
@@ -80,6 +82,7 @@ export async function process(html = '', config = {}) {
80
82
  compileCss(config),
81
83
  get(config, 'css.combineMediaQueries') !== false
82
84
  && combineMediaQueries(get(config, 'css.combineMediaQueries', { sort: 'mobile-first' })),
85
+ removeRawStyleAttributes(),
83
86
  ...get(
84
87
  config,
85
88
  'posthtml.plugins.after',
@@ -9,7 +9,7 @@ import postcssSafeParser from 'postcss-safe-parser'
9
9
  import removeDuplicateSelectors from './removeDuplicateSelectors.js'
10
10
  import cleanupTailwindArtifacts from './cleanupTailwindArtifacts.js'
11
11
 
12
- const validAttributeNames = new Set([
12
+ const attributes = new Set([
13
13
  'raw',
14
14
  'plain',
15
15
  'as-is',
@@ -17,6 +17,9 @@ const validAttributeNames = new Set([
17
17
  'unprocessed',
18
18
  ])
19
19
 
20
+ // export attributes
21
+ export const validAttributeNames = attributes
22
+
20
23
  /**
21
24
  * PostHTML plugin to process Tailwind CSS within style tags.
22
25
  *
@@ -24,21 +27,14 @@ const validAttributeNames = new Set([
24
27
  * compiles it with PostCSS. `<style>` tags marked as
25
28
  * `no-process` will be skipped.
26
29
  */
27
- export default function compile(config = {}) {
30
+ export function compileCss(config = {}) {
28
31
  return tree => {
29
32
  return new Promise((resolve, reject) => {
30
33
  const stylePromises = []
31
34
 
32
35
  tree.walk(node => {
33
36
  if (node.tag === 'style' && node.content) {
34
- if (node.attrs && Object.keys(node.attrs).some(attr => validAttributeNames.has(attr))) {
35
- // Remove the attribute
36
- for (const attr of Object.keys(node.attrs)) {
37
- if (validAttributeNames.has(attr)) {
38
- delete node.attrs[attr]
39
- }
40
- }
41
-
37
+ if (node.attrs && Object.keys(node.attrs).some(attr => attributes.has(attr))) {
42
38
  return node
43
39
  }
44
40
 
@@ -0,0 +1,22 @@
1
+ import { validAttributeNames } from './postcss/compileCss.js'
2
+
3
+ const plugin = () => tree => {
4
+ const process = node => {
5
+ if (node.tag === 'style') {
6
+ if (node.attrs && Object.keys(node.attrs).some(attr => validAttributeNames.has(attr))) {
7
+ // Remove the attribute
8
+ for (const attr of Object.keys(node.attrs)) {
9
+ if (validAttributeNames.has(attr)) {
10
+ delete node.attrs[attr]
11
+ }
12
+ }
13
+ }
14
+ }
15
+
16
+ return node
17
+ }
18
+
19
+ return tree.walk(process)
20
+ }
21
+
22
+ export default plugin