@maizzle/framework 6.1.3 → 6.1.5
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/build.d.ts +3 -4
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +1 -5
- package/dist/build.js.map +1 -1
- package/dist/components/Outlook.vue +8 -2
- package/dist/components/utils.d.ts +10 -11
- package/dist/components/utils.d.ts.map +1 -1
- package/dist/composables/defineConfig.d.ts +1 -2
- package/dist/composables/defineConfig.d.ts.map +1 -1
- package/dist/composables/renderContext.d.ts +4 -5
- package/dist/composables/renderContext.d.ts.map +1 -1
- package/dist/composables/useBaseUrl.d.ts +1 -2
- package/dist/composables/useBaseUrl.d.ts.map +1 -1
- package/dist/composables/useConfig.d.ts +2 -3
- package/dist/composables/useConfig.d.ts.map +1 -1
- package/dist/composables/useCurrentTemplate.d.ts +2 -3
- package/dist/composables/useCurrentTemplate.d.ts.map +1 -1
- package/dist/composables/useDoctype.d.ts +1 -2
- package/dist/composables/useDoctype.d.ts.map +1 -1
- package/dist/composables/useEvent.d.ts +1 -2
- package/dist/composables/useEvent.d.ts.map +1 -1
- package/dist/composables/useFont.d.ts +3 -4
- package/dist/composables/useFont.d.ts.map +1 -1
- package/dist/composables/useOutlookFallback.d.ts +1 -2
- package/dist/composables/useOutlookFallback.d.ts.map +1 -1
- package/dist/composables/useOutputPath.d.ts +1 -2
- package/dist/composables/useOutputPath.d.ts.map +1 -1
- package/dist/composables/usePlaintext.d.ts +2 -3
- package/dist/composables/usePlaintext.d.ts.map +1 -1
- package/dist/composables/usePreheader.d.ts +2 -3
- package/dist/composables/usePreheader.d.ts.map +1 -1
- package/dist/composables/useTransformers.d.ts +1 -2
- package/dist/composables/useTransformers.d.ts.map +1 -1
- package/dist/composables/useUrlQuery.d.ts +1 -2
- package/dist/composables/useUrlQuery.d.ts.map +1 -1
- package/dist/config/defaults.d.ts +1 -2
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.d.ts.map +1 -1
- package/dist/events/index.d.ts +4 -5
- package/dist/events/index.d.ts.map +1 -1
- package/dist/plaintext.d.ts +1 -2
- package/dist/plaintext.d.ts.map +1 -1
- package/dist/plugin.d.ts +1 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugins/postcss/flattenGradients.d.ts +3 -3
- package/dist/plugins/postcss/flattenGradients.d.ts.map +1 -1
- package/dist/plugins/postcss/mergeMediaQueries.d.ts +1 -2
- package/dist/plugins/postcss/mergeMediaQueries.d.ts.map +1 -1
- package/dist/plugins/postcss/pruneVars.d.ts +2 -2
- package/dist/plugins/postcss/pruneVars.d.ts.map +1 -1
- package/dist/plugins/postcss/quoteFontFamilies.d.ts +2 -3
- package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -1
- package/dist/plugins/postcss/removeDeclarations.d.ts +4 -4
- package/dist/plugins/postcss/removeDeclarations.d.ts.map +1 -1
- package/dist/plugins/postcss/resolveMaizzleImports.d.ts +1 -2
- package/dist/plugins/postcss/resolveMaizzleImports.d.ts.map +1 -1
- package/dist/plugins/postcss/resolveProps.d.ts +2 -2
- package/dist/plugins/postcss/resolveProps.d.ts.map +1 -1
- package/dist/plugins/postcss/tailwindCleanup.d.ts +1 -2
- package/dist/plugins/postcss/tailwindCleanup.d.ts.map +1 -1
- package/dist/prepare.d.ts +2 -3
- package/dist/prepare.d.ts.map +1 -1
- package/dist/render/active.d.ts +2 -3
- package/dist/render/active.d.ts.map +1 -1
- package/dist/render/buildTemplate.d.ts +5 -6
- package/dist/render/buildTemplate.d.ts.map +1 -1
- package/dist/render/buildTemplate.js +1 -1
- package/dist/render/buildTemplate.js.map +1 -1
- package/dist/render/createRenderer.d.ts +4 -5
- package/dist/render/createRenderer.d.ts.map +1 -1
- package/dist/render/index.d.ts +3 -3
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/render/injectFonts.d.ts +1 -2
- package/dist/render/injectFonts.d.ts.map +1 -1
- package/dist/render/parallel/buildWorker.d.ts +3 -4
- package/dist/render/parallel/buildWorker.d.ts.map +1 -1
- package/dist/render/plugins/codeBlockExtract.d.ts +1 -2
- package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -1
- package/dist/render/plugins/markdownExtract.d.ts +1 -2
- package/dist/render/plugins/markdownExtract.d.ts.map +1 -1
- package/dist/render/plugins/rawExtract.d.ts +1 -2
- package/dist/render/plugins/rawExtract.d.ts.map +1 -1
- package/dist/render/plugins/rowSourceLocation.d.ts +1 -2
- package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -1
- package/dist/serve.d.ts +3 -4
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +47 -4
- package/dist/serve.js.map +1 -1
- package/dist/server/compatibility.d.ts +2 -3
- package/dist/server/compatibility.d.ts.map +1 -1
- package/dist/server/email.d.ts +2 -3
- package/dist/server/email.d.ts.map +1 -1
- package/dist/server/linter.d.ts +3 -4
- package/dist/server/linter.d.ts.map +1 -1
- package/dist/server/sfc-utils.d.ts +6 -7
- package/dist/server/sfc-utils.d.ts.map +1 -1
- package/dist/server/static.d.ts +10 -0
- package/dist/server/static.d.ts.map +1 -0
- package/dist/server/static.js +71 -0
- package/dist/server/static.js.map +1 -0
- package/dist/server/ui/.vite/deps/@lucide_vue.js +1 -1
- package/dist/server/ui/.vite/deps/@vueuse_core.js +1 -1
- package/dist/server/ui/.vite/deps/@vueuse_shared.js +1 -1
- package/dist/server/ui/.vite/deps/_metadata.json +15 -15
- package/dist/server/ui/.vite/deps/reka-ui.js +1 -2
- package/dist/server/ui/.vite/deps/reka-ui.js.map +1 -1
- package/dist/server/ui/.vite/deps/vue-router.js +1 -1
- package/dist/server/ui/.vite/deps/vue.js +1 -1
- package/dist/server/ui/.vite/deps/{vue.runtime.esm-bundler-S54atuNJ.js → vue.runtime.esm-bundler-Dq07uCLt.js} +174 -53
- package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-Dq07uCLt.js.map +1 -0
- package/dist/tests/render/_helpers.d.ts +2 -3
- package/dist/tests/render/_helpers.d.ts.map +1 -1
- package/dist/transformers/addAttributes.d.ts +2 -3
- package/dist/transformers/addAttributes.d.ts.map +1 -1
- package/dist/transformers/attributeToStyle.d.ts +2 -3
- package/dist/transformers/attributeToStyle.d.ts.map +1 -1
- package/dist/transformers/base.d.ts +3 -4
- package/dist/transformers/base.d.ts.map +1 -1
- package/dist/transformers/columnWidth.d.ts +1 -2
- package/dist/transformers/columnWidth.d.ts.map +1 -1
- package/dist/transformers/entities.d.ts +3 -4
- package/dist/transformers/entities.d.ts.map +1 -1
- package/dist/transformers/filters/defaults.d.ts +2 -3
- package/dist/transformers/filters/defaults.d.ts.map +1 -1
- package/dist/transformers/filters/index.d.ts +4 -4
- package/dist/transformers/filters/index.d.ts.map +1 -1
- package/dist/transformers/format.d.ts +2 -2
- package/dist/transformers/format.d.ts.map +1 -1
- package/dist/transformers/imgWidth.d.ts +1 -2
- package/dist/transformers/imgWidth.d.ts.map +1 -1
- package/dist/transformers/index.d.ts +2 -2
- package/dist/transformers/index.d.ts.map +1 -1
- package/dist/transformers/index.js +8 -2
- package/dist/transformers/index.js.map +1 -1
- package/dist/transformers/inlineCss.d.ts +3 -4
- package/dist/transformers/inlineCss.d.ts.map +1 -1
- package/dist/transformers/inlineLink.d.ts +2 -3
- package/dist/transformers/inlineLink.d.ts.map +1 -1
- package/dist/transformers/minify.d.ts +2 -2
- package/dist/transformers/minify.d.ts.map +1 -1
- package/dist/transformers/minifyCodeInline.d.ts +1 -2
- package/dist/transformers/minifyCodeInline.d.ts.map +1 -1
- package/dist/transformers/msoConditionals.d.ts +4 -0
- package/dist/transformers/msoConditionals.d.ts.map +1 -0
- package/dist/transformers/msoConditionals.js +25 -0
- package/dist/transformers/msoConditionals.js.map +1 -0
- package/dist/transformers/msoPlaceholders.d.ts +1 -2
- package/dist/transformers/msoPlaceholders.d.ts.map +1 -1
- package/dist/transformers/purgeCss.d.ts +3 -4
- package/dist/transformers/purgeCss.d.ts.map +1 -1
- package/dist/transformers/removeAttributes.d.ts +4 -5
- package/dist/transformers/removeAttributes.d.ts.map +1 -1
- package/dist/transformers/replaceStrings.d.ts +1 -2
- package/dist/transformers/replaceStrings.d.ts.map +1 -1
- package/dist/transformers/safeSelectors.d.ts +2 -3
- package/dist/transformers/safeSelectors.d.ts.map +1 -1
- package/dist/transformers/shorthandCss.d.ts +3 -4
- package/dist/transformers/shorthandCss.d.ts.map +1 -1
- package/dist/transformers/sixHex.d.ts +2 -3
- package/dist/transformers/sixHex.d.ts.map +1 -1
- package/dist/transformers/tailwindComponent.d.ts +1 -2
- package/dist/transformers/tailwindComponent.d.ts.map +1 -1
- package/dist/transformers/tailwindcss.d.ts +2 -3
- package/dist/transformers/tailwindcss.d.ts.map +1 -1
- package/dist/transformers/urlQuery.d.ts +2 -3
- package/dist/transformers/urlQuery.d.ts.map +1 -1
- package/dist/types/config.d.ts +18 -19
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/ast/parser.d.ts +1 -2
- package/dist/utils/ast/parser.d.ts.map +1 -1
- package/dist/utils/ast/serializer.d.ts +1 -2
- package/dist/utils/ast/serializer.d.ts.map +1 -1
- package/dist/utils/ast/walker.d.ts +1 -2
- package/dist/utils/ast/walker.d.ts.map +1 -1
- package/dist/utils/cloneConfig.d.ts +1 -2
- package/dist/utils/cloneConfig.d.ts.map +1 -1
- package/dist/utils/compileTailwindCss.d.ts +4 -5
- package/dist/utils/compileTailwindCss.d.ts.map +1 -1
- package/dist/utils/componentSources.d.ts +4 -5
- package/dist/utils/componentSources.d.ts.map +1 -1
- package/dist/utils/cssBox.d.ts +6 -7
- package/dist/utils/cssBox.d.ts.map +1 -1
- package/dist/utils/decodeStyleEntities.d.ts +1 -2
- package/dist/utils/decodeStyleEntities.d.ts.map +1 -1
- package/dist/utils/detect.d.ts +1 -2
- package/dist/utils/detect.d.ts.map +1 -1
- package/dist/utils/output-markers.d.ts +4 -5
- package/dist/utils/output-markers.d.ts.map +1 -1
- package/dist/utils/staticPaths.d.ts +5 -0
- package/dist/utils/staticPaths.d.ts.map +1 -0
- package/dist/utils/staticPaths.js +11 -0
- package/dist/utils/staticPaths.js.map +1 -0
- package/dist/utils/url.d.ts +4 -5
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/watchPaths.d.ts +2 -3
- package/dist/utils/watchPaths.d.ts.map +1 -1
- package/node_modules/tinyexec/dist/main.d.mts +5 -3
- package/node_modules/tinyexec/dist/main.mjs +256 -232
- package/node_modules/tinyexec/package.json +9 -9
- package/package.json +5 -5
- package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-S54atuNJ.js.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/tests/render/_helpers.d.ts
|
|
2
|
-
declare function createTempProject(): string;
|
|
3
|
-
declare function writeSfc(dir: string, path: string, content: string): void;
|
|
2
|
+
export declare function createTempProject(): string;
|
|
3
|
+
export declare function writeSfc(dir: string, path: string, content: string): void;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { createTempProject, writeSfc };
|
|
6
5
|
//# sourceMappingURL=_helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_helpers.d.ts","names":[],"sources":["../../../src/tests/render/_helpers.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"_helpers.d.ts","names":[],"sources":["../../../src/tests/render/_helpers.ts"],"mappings":";wBAIgB;wBAKA,SAAS,aAAa,cAAc"}
|
|
@@ -29,13 +29,12 @@ import { ChildNode } from "domhandler";
|
|
|
29
29
|
* },
|
|
30
30
|
* })
|
|
31
31
|
*/
|
|
32
|
-
declare function addAttributes(html: string, config?: AttributesConfig): string;
|
|
32
|
+
export declare function addAttributes(html: string, config?: AttributesConfig): string;
|
|
33
33
|
/**
|
|
34
34
|
* DOM-form of {@link addAttributes} used by the internal transformer pipeline.
|
|
35
35
|
* Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
36
36
|
* serialize/parse round-trips when chained with other transformers.
|
|
37
37
|
*/
|
|
38
|
-
declare function addAttributesDom(dom: ChildNode[], config?: AttributesConfig): ChildNode[];
|
|
38
|
+
export declare function addAttributesDom(dom: ChildNode[], config?: AttributesConfig): ChildNode[];
|
|
39
39
|
//#endregion
|
|
40
|
-
export { addAttributes, addAttributesDom };
|
|
41
40
|
//# sourceMappingURL=addAttributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAttributes.d.ts","names":[],"sources":["../../src/transformers/addAttributes.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"addAttributes.d.ts","names":[],"sources":["../../src/transformers/addAttributes.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+CgB,cAAc,cAAc,SAAQ;;;;;;wBASpC,iBAAiB,KAAK,aAAa,SAAQ,mBAAwB"}
|
|
@@ -25,13 +25,12 @@ import { ChildNode } from "domhandler";
|
|
|
25
25
|
* // Restrict to specific attributes:
|
|
26
26
|
* const limited = attributeToStyle(html, ['width', 'height'])
|
|
27
27
|
*/
|
|
28
|
-
declare function attributeToStyle(html: string, attributes?: boolean | string[]): string;
|
|
28
|
+
export declare function attributeToStyle(html: string, attributes?: boolean | string[]): string;
|
|
29
29
|
/**
|
|
30
30
|
* DOM-form of {@link attributeToStyle} used by the internal transformer
|
|
31
31
|
* pipeline. Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
32
32
|
* serialize/parse round-trips when chained with other transformers.
|
|
33
33
|
*/
|
|
34
|
-
declare function attributeToStyleDom(dom: ChildNode[], attributes?: boolean | string[]): ChildNode[];
|
|
34
|
+
export declare function attributeToStyleDom(dom: ChildNode[], attributes?: boolean | string[]): ChildNode[];
|
|
35
35
|
//#endregion
|
|
36
|
-
export { attributeToStyle, attributeToStyleDom };
|
|
37
36
|
//# sourceMappingURL=attributeToStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributeToStyle.d.ts","names":[],"sources":["../../src/transformers/attributeToStyle.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"attributeToStyle.d.ts","names":[],"sources":["../../src/transformers/attributeToStyle.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiCgB,iBAAiB,cAAc;;;;;;wBAS/B,oBAAoB,KAAK,aAAa,kCAAwC"}
|
|
@@ -3,7 +3,7 @@ import { ChildNode } from "domhandler";
|
|
|
3
3
|
/**
|
|
4
4
|
* Options for the `base` transformer.
|
|
5
5
|
*/
|
|
6
|
-
interface BaseUrlOptions {
|
|
6
|
+
export interface BaseUrlOptions {
|
|
7
7
|
/** Base URL to prepend to relative links. */
|
|
8
8
|
url?: string;
|
|
9
9
|
/**
|
|
@@ -58,13 +58,12 @@ interface BaseUrlOptions {
|
|
|
58
58
|
* inlineCss: false,
|
|
59
59
|
* })
|
|
60
60
|
*/
|
|
61
|
-
declare function base(html: string, options: string | BaseUrlOptions): string;
|
|
61
|
+
export declare function base(html: string, options: string | BaseUrlOptions): string;
|
|
62
62
|
/**
|
|
63
63
|
* DOM-form of {@link base} used by the internal transformer pipeline.
|
|
64
64
|
* Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
65
65
|
* serialize/parse round-trips when chained with other transformers.
|
|
66
66
|
*/
|
|
67
|
-
declare function baseDom(dom: ChildNode[], options: string | BaseUrlOptions | undefined | null | false): ChildNode[];
|
|
67
|
+
export declare function baseDom(dom: ChildNode[], options: string | BaseUrlOptions | undefined | null | false): ChildNode[];
|
|
68
68
|
//#endregion
|
|
69
|
-
export { BaseUrlOptions, base, baseDom };
|
|
70
69
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":[],"sources":["../../src/transformers/base.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"base.d.ts","names":[],"sources":["../../src/transformers/base.ts"],"mappings":";;;;;iBAUiB;;EAEf;;;;;;;;;;EAUA,kBAAkB,eAAe;;;;;EAKjC,aAAa;;;;;;EAMb;;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkIc,KAAK,cAAc,kBAAkB;;;;;;wBASrC,QAAQ,KAAK,aAAa,kBAAkB,4CAA4C"}
|
|
@@ -24,7 +24,6 @@ import { ChildNode } from "domhandler";
|
|
|
24
24
|
* rows cascade. All `data-maizzle-cw*` and `data-maizzle-oh-*` are
|
|
25
25
|
* stripped at the end of the second walk pass.
|
|
26
26
|
*/
|
|
27
|
-
declare function columnWidth(dom: ChildNode[]): ChildNode[];
|
|
27
|
+
export declare function columnWidth(dom: ChildNode[]): ChildNode[];
|
|
28
28
|
//#endregion
|
|
29
|
-
export { columnWidth };
|
|
30
29
|
//# sourceMappingURL=columnWidth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnWidth.d.ts","names":[],"sources":["../../src/transformers/columnWidth.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"columnWidth.d.ts","names":[],"sources":["../../src/transformers/columnWidth.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;wBAqKgB,YAAY,KAAK,cAAc"}
|
|
@@ -5,7 +5,7 @@ import { ChildNode } from "domhandler";
|
|
|
5
5
|
/**
|
|
6
6
|
* Node types {@link entitiesDom} encodes. Both default to `true`.
|
|
7
7
|
*/
|
|
8
|
-
interface EntitiesScope {
|
|
8
|
+
export interface EntitiesScope {
|
|
9
9
|
/** Encode entities in text nodes */
|
|
10
10
|
text?: boolean;
|
|
11
11
|
/**
|
|
@@ -40,13 +40,12 @@ interface EntitiesScope {
|
|
|
40
40
|
* // Disable the transform
|
|
41
41
|
* entities('hello world', false)
|
|
42
42
|
*/
|
|
43
|
-
declare function entities(html: string, custom?: EntitiesConfig, scope?: EntitiesScope): string;
|
|
43
|
+
export declare function entities(html: string, custom?: EntitiesConfig, scope?: EntitiesScope): string;
|
|
44
44
|
/**
|
|
45
45
|
* DOM-form of {@link entities} used by the internal transformer pipeline.
|
|
46
46
|
* Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
47
47
|
* serialize/parse round-trips when chained with other transformers.
|
|
48
48
|
*/
|
|
49
|
-
declare function entitiesDom(dom: ChildNode[], custom?: EntitiesConfig, scope?: EntitiesScope): ChildNode[];
|
|
49
|
+
export declare function entitiesDom(dom: ChildNode[], custom?: EntitiesConfig, scope?: EntitiesScope): ChildNode[];
|
|
50
50
|
//#endregion
|
|
51
|
-
export { EntitiesScope, entities, entitiesDom };
|
|
52
51
|
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","names":[],"sources":["../../src/transformers/entities.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","names":[],"sources":["../../src/transformers/entities.ts"],"mappings":";;;;;;;iBAkCiB;;EAEf;;;;;;;;EAQA;;;;;;;;;;;;;;;;;;;;;;;;;wBA0Bc,SAAS,cAAc,SAAQ,gBAAuB,QAAO;;;;;;wBAS7D,YAAY,KAAK,aAAa,SAAQ,gBAAuB,QAAO,gBAAqB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/transformers/filters/defaults.d.ts
|
|
2
|
-
type FilterFunction = (str: string, value: string) => string;
|
|
3
|
-
declare const defaults: Record<string, FilterFunction>;
|
|
2
|
+
export type FilterFunction = (str: string, value: string) => string;
|
|
3
|
+
export declare const defaults: Record<string, FilterFunction>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { FilterFunction, defaults };
|
|
6
5
|
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","names":[],"sources":["../../../src/transformers/filters/defaults.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","names":[],"sources":["../../../src/transformers/filters/defaults.ts"],"mappings":";YAAY,kBAAkB,aAAa;qBAgB9B,UAAU,eAAe"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FilterFunction } from "./defaults.js";
|
|
2
2
|
import { ChildNode } from "domhandler";
|
|
3
3
|
//#region src/transformers/filters/index.d.ts
|
|
4
|
-
type FiltersConfig = false | Record<string, (str: string, value: string) => string>;
|
|
4
|
+
export type FiltersConfig = false | Record<string, (str: string, value: string) => string>;
|
|
5
5
|
/**
|
|
6
6
|
* Apply transformation functions to the content of elements that have
|
|
7
7
|
* matching filter attributes. Multiple filters on the same element are
|
|
@@ -30,13 +30,13 @@ type FiltersConfig = false | Record<string, (str: string, value: string) => stri
|
|
|
30
30
|
* // Disable all filters
|
|
31
31
|
* filters('<p uppercase>foo</p>', false)
|
|
32
32
|
*/
|
|
33
|
-
declare function filters(html: string, custom?: FiltersConfig): string;
|
|
33
|
+
export declare function filters(html: string, custom?: FiltersConfig): string;
|
|
34
34
|
/**
|
|
35
35
|
* DOM-form of {@link filters} used by the internal transformer pipeline.
|
|
36
36
|
* Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
37
37
|
* serialize/parse round-trips when chained with other transformers.
|
|
38
38
|
*/
|
|
39
|
-
declare function filtersDom(dom: ChildNode[], custom?: FiltersConfig): ChildNode[];
|
|
39
|
+
export declare function filtersDom(dom: ChildNode[], custom?: FiltersConfig): ChildNode[];
|
|
40
40
|
//#endregion
|
|
41
|
-
export {
|
|
41
|
+
export type { FilterFunction };
|
|
42
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/transformers/filters/index.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/transformers/filters/index.ts"],"mappings":";;;YAMY,wBAAwB,gBAAgB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2CjD,QAAQ,cAAc,SAAQ;;;;;;wBAS9B,WAAW,KAAK,aAAa,SAAQ,gBAAqB"}
|
|
@@ -15,7 +15,7 @@ import { FormatConfig, FormatConfig as FormatConfig$1 } from "oxfmt";
|
|
|
15
15
|
*
|
|
16
16
|
* const pretty = await format(html, { useTabs: true, tabWidth: 4 })
|
|
17
17
|
*/
|
|
18
|
-
declare function format(html: string, options?: FormatConfig$1): Promise<string>;
|
|
18
|
+
export declare function format(html: string, options?: FormatConfig$1): Promise<string>;
|
|
19
19
|
//#endregion
|
|
20
|
-
export {
|
|
20
|
+
export type { FormatConfig };
|
|
21
21
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","names":[],"sources":["../../src/transformers/format.ts"],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"format.d.ts","names":[],"sources":["../../src/transformers/format.ts"],"mappings":";;;;;;;;;;;;;;;;;wBA2BsB,OAAO,cAAc,UAAS,iBAAoB"}
|
|
@@ -13,7 +13,6 @@ import { ChildNode } from "domhandler";
|
|
|
13
13
|
* content box). When no pixel width is found anywhere, the marker is
|
|
14
14
|
* dropped and the image stays fluid.
|
|
15
15
|
*/
|
|
16
|
-
declare function imgWidthDom(dom: ChildNode[]): ChildNode[];
|
|
16
|
+
export declare function imgWidthDom(dom: ChildNode[]): ChildNode[];
|
|
17
17
|
//#endregion
|
|
18
|
-
export { imgWidthDom };
|
|
19
18
|
//# sourceMappingURL=imgWidth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imgWidth.d.ts","names":[],"sources":["../../src/transformers/imgWidth.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"imgWidth.d.ts","names":[],"sources":["../../src/transformers/imgWidth.ts"],"mappings":";;;;;;;;;;;;;;;wBAgDgB,YAAY,KAAK,cAAc"}
|
|
@@ -28,11 +28,11 @@ import { TailwindBlock } from "../composables/renderContext.js";
|
|
|
28
28
|
* 12. Purge CSS (serializes/parses internally around email-comb)
|
|
29
29
|
* 13. Entities
|
|
30
30
|
* + Vue-generated comments stripped here (on serialized string)
|
|
31
|
+
* 13.5 Outlook placeholders → MSO conditional comments
|
|
31
32
|
* 14. Replace strings
|
|
32
33
|
* 15. Prettify
|
|
33
34
|
* 16. Minify
|
|
34
35
|
*/
|
|
35
|
-
declare function runTransformers(html: string, config: MaizzleConfig, filePath?: string, doctype?: string, tailwindBlocks?: TailwindBlock[], sourceFiles?: string[]): Promise<string>;
|
|
36
|
+
export declare function runTransformers(html: string, config: MaizzleConfig, filePath?: string, doctype?: string, tailwindBlocks?: TailwindBlock[], sourceFiles?: string[]): Promise<string>;
|
|
36
37
|
//#endregion
|
|
37
|
-
export { runTransformers };
|
|
38
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/transformers/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/transformers/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2DsB,gBACpB,cACA,QAAQ,eACR,mBACA,kBACA,iBAAiB,iBACjB,yBACC"}
|
|
@@ -19,6 +19,7 @@ import { baseDom } from "./base.js";
|
|
|
19
19
|
import { entitiesDom } from "./entities.js";
|
|
20
20
|
import { urlQueryDom } from "./urlQuery.js";
|
|
21
21
|
import { purgeCssDom } from "./purgeCss.js";
|
|
22
|
+
import { msoConditionals } from "./msoConditionals.js";
|
|
22
23
|
import { replaceStrings } from "./replaceStrings.js";
|
|
23
24
|
import { format } from "./format.js";
|
|
24
25
|
import { minifyCodeInline } from "./minifyCodeInline.js";
|
|
@@ -51,15 +52,19 @@ import { minify } from "./minify.js";
|
|
|
51
52
|
* 12. Purge CSS (serializes/parses internally around email-comb)
|
|
52
53
|
* 13. Entities
|
|
53
54
|
* + Vue-generated comments stripped here (on serialized string)
|
|
55
|
+
* 13.5 Outlook placeholders → MSO conditional comments
|
|
54
56
|
* 14. Replace strings
|
|
55
57
|
* 15. Prettify
|
|
56
58
|
* 16. Minify
|
|
57
59
|
*/
|
|
58
60
|
async function runTransformers(html, config, filePath, doctype, tailwindBlocks, sourceFiles) {
|
|
61
|
+
/**
|
|
62
|
+
* Whole-pipeline opt-out. `<Outlook>` placeholders still have to
|
|
63
|
+
* become real conditional comments, so that one step always runs.
|
|
64
|
+
*/
|
|
65
|
+
if (config.useTransformers === false) return msoConditionals(html);
|
|
59
66
|
/**
|
|
60
67
|
* Per-transformer skip map — only honored when useTransformers is an object.
|
|
61
|
-
* Whole-pipeline opt-out (`useTransformers === false`) is handled upstream
|
|
62
|
-
* in build.ts / render so we never reach this function in that case.
|
|
63
68
|
*
|
|
64
69
|
* A toggle set to `true` *force-enables* its transformer for this run
|
|
65
70
|
* by layering on the matching config slice (e.g. `prettify: true`
|
|
@@ -139,6 +144,7 @@ async function runTransformers(html, config, filePath, doctype, tailwindBlocks,
|
|
|
139
144
|
if (enabled("entities")) dom = entitiesDom(dom, effective.html?.decodeEntities);
|
|
140
145
|
const isXhtml = doctype ? /xhtml/i.test(doctype) : false;
|
|
141
146
|
let result = serialize(dom, { selfClosingTags: isXhtml });
|
|
147
|
+
result = msoConditionals(result);
|
|
142
148
|
if (enabled("replaceStrings")) result = replaceStrings(result, effective);
|
|
143
149
|
const minifyWillRun = enabled("minify") && !!effective.html?.minify;
|
|
144
150
|
if (enabled("prettify") && !minifyWillRun && effective.html?.format) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/transformers/index.ts"],"sourcesContent":["import { parse, serialize } from '../utils/ast/index.ts'\nimport { inlineLinkDom } from './inlineLink.ts'\nimport { tailwindComponent } from './tailwindComponent.ts'\nimport { tailwindcss } from './tailwindcss.ts'\nimport { safeSelectorsDom } from './safeSelectors.ts'\nimport { attributeToStyleDom } from './attributeToStyle.ts'\nimport { inlineCssDom } from './inlineCss.ts'\nimport { msoPlaceholders } from './msoPlaceholders.ts'\nimport { columnWidth } from './columnWidth.ts'\nimport { imgWidthDom } from './imgWidth.ts'\nimport { removeAttributesDom } from './removeAttributes.ts'\nimport { shorthandCssDom } from './shorthandCss.ts'\nimport { sixHexDom } from './sixHex.ts'\nimport { addAttributesDom } from './addAttributes.ts'\nimport { filtersDom } from './filters/index.ts'\nimport { baseDom } from './base.ts'\nimport { entitiesDom } from './entities.ts'\nimport { urlQueryDom } from './urlQuery.ts'\nimport { purgeCssDom } from './purgeCss.ts'\nimport { replaceStrings } from './replaceStrings.ts'\nimport { format } from './format.ts'\nimport { minifyCodeInline } from './minifyCodeInline.ts'\nimport { minify } from './minify.ts'\nimport type { MaizzleConfig } from '../types/config.ts'\nimport type { TailwindBlock } from '../composables/renderContext.ts'\n\n/**\n * Run all Maizzle transformers on the rendered HTML.\n *\n * The HTML is parsed into a DOM once at the start and passed through all\n * DOM-based transformers as a shared `ChildNode[]`. After all DOM transformers\n * complete, the DOM is serialized back to a string exactly once.\n *\n * String-only transformers (those that rely on external tools that require a\n * raw HTML string) then run on the serialized output.\n *\n * Transformers run in a specific order:\n * 0. Inline link stylesheets — replace `<link rel=\"stylesheet\">` with `<style>` tags\n * 1. Tailwind CSS — compile CSS, lower syntax, optimize (cleanup + merge media queries)\n * 2. Safe class names\n * 3. Attribute to style\n * 4. CSS inliner\n * 5. Remove attributes\n * 6. Shorthand CSS\n * 7. Six-digit HEX\n * 8. Add attributes\n * 9. Filters\n * 10. Base URL\n * 11. URL query\n * 11.5 Entities in comment nodes (before purge — protects MSO conditionals)\n * 12. Purge CSS (serializes/parses internally around email-comb)\n * 13. Entities\n * + Vue-generated comments stripped here (on serialized string)\n * 14. Replace strings\n * 15. Prettify\n * 16. Minify\n */\nexport async function runTransformers(\n html: string,\n config: MaizzleConfig,\n filePath?: string,\n doctype?: string,\n tailwindBlocks?: TailwindBlock[],\n sourceFiles?: string[],\n): Promise<string> {\n /**\n * Per-transformer skip map — only honored when useTransformers is an object.\n * Whole-pipeline opt-out (`useTransformers === false`) is handled upstream\n * in build.ts / render so we never reach this function in that case.\n *\n * A toggle set to `true` *force-enables* its transformer for this run\n * by layering on the matching config slice (e.g. `prettify: true`\n * sets `html.format = true`). This only applies to transformers\n * whose enable flag is a plain boolean — data-driven ones\n * (filters, baseURL, urlQuery, etc.) need actual config\n * values, so a bare `true` for those is a no-op.\n */\n const toggles = typeof config.useTransformers === 'object' ? config.useTransformers : null\n const enabled = (key: keyof NonNullable<typeof toggles>) => toggles?.[key] !== false\n\n let effective = config\n if (toggles) {\n const cssOver: Record<string, unknown> = {}\n const htmlOver: Record<string, unknown> = {}\n if (toggles.inlineCss === true) cssOver.inline = true\n if (toggles.purgeCss === true) cssOver.purge = true\n if (toggles.safeSelectors === true) cssOver.safe = true\n if (toggles.shorthandCss === true) cssOver.shorthand = true\n if (toggles.sixHex === true) cssOver.sixHex = true\n if (toggles.prettify === true) htmlOver.format = true\n if (toggles.minify === true) htmlOver.minify = true\n if (toggles.entities === true) htmlOver.decodeEntities = true\n\n if (Object.keys(cssOver).length || Object.keys(htmlOver).length) {\n effective = {\n ...config,\n css: { ...config.css, ...cssOver },\n html: { ...config.html, ...htmlOver },\n }\n }\n }\n\n // Parse once — all DOM transformers share this array\n let dom = parse(html)\n\n // 0. Inline <link> stylesheets\n dom = await inlineLinkDom(dom, filePath)\n\n // 0.5. <Tailwind> component — compile per-block scoped CSS, inject into <head>\n if (tailwindBlocks?.length) {\n dom = await tailwindComponent(dom, tailwindBlocks, effective, filePath, sourceFiles)\n }\n\n // 1. Tailwind CSS — always runs first\n dom = await tailwindcss(dom, effective, filePath, sourceFiles)\n\n // 2. Safe class names\n if (enabled('safeSelectors')) dom = safeSelectorsDom(dom, effective.css)\n\n // 3. Attribute to style\n if (enabled('attributeToStyle') && typeof effective.css?.inline === 'object' && effective.css.inline.attributeToStyle) {\n dom = attributeToStyleDom(dom, effective.css.inline.attributeToStyle)\n }\n\n // 4. CSS inliner (serializes/parses internally around juice)\n if (enabled('inlineCss') && effective.css?.inline) {\n const inlineOptions = typeof effective.css.inline === 'object' ? effective.css.inline : {}\n dom = inlineCssDom(dom, inlineOptions)\n }\n\n // 4.5. Resolve MSO placeholders (table width + td style) from inlined CSS\n dom = msoPlaceholders(dom)\n\n // 4.6. Resolve Column min-width placeholders from nearest sized ancestor\n dom = columnWidth(dom)\n\n // 4.7. Backfill width on <Img> images that inherit their parent's width\n dom = imgWidthDom(dom)\n\n // 5. Remove attributes\n if (enabled('removeAttributes')) {\n const removeRules = effective.html?.attributes?.remove\n dom = removeAttributesDom(dom, Array.isArray(removeRules) ? removeRules : [])\n }\n\n // 6. Shorthand CSS\n if (enabled('shorthandCss') && effective.css?.shorthand) {\n const shorthandOptions = typeof effective.css.shorthand === 'object' ? effective.css.shorthand : {}\n dom = shorthandCssDom(dom, shorthandOptions)\n }\n\n // 7. Six-digit HEX\n if (enabled('sixHex') && effective.css?.sixHex !== false) dom = sixHexDom(dom)\n\n // 8. Add attributes\n if (enabled('addAttributes')) dom = addAttributesDom(dom, effective.html?.attributes)\n\n // 9. Filters\n if (enabled('filters')) dom = filtersDom(dom, effective.filters)\n\n // 10. Base URL (serializes/parses internally for VML/MSO regex passes)\n if (enabled('baseURL') && effective.url?.base) dom = baseDom(dom, effective.url.base)\n\n // 11. URL query\n if (enabled('urlQuery') && effective.url?.query && Object.keys(effective.url.query).length > 0) {\n const { _options: queryOptions, ...queryParams } = effective.url.query as Record<string, unknown>\n dom = urlQueryDom(dom, queryParams, (queryOptions ?? {}) as import('../types/config.ts').UrlQueryOptions)\n }\n\n /**\n * 11.5. Encode entities in comment nodes before purge/minify. Raw\n * invisible chars (e.g. U+00A0 from Vue decoding at compile\n * time) inside MSO conditionals make email-comb remove the whole\n * \"whitespace-only\" conditional and html-crush collapse the chars.\n * Text nodes are skipped here — purge's internal parse round-trip\n * would decode them again — comment data survives un-decoded.\n */\n if (enabled('entities')) dom = entitiesDom(dom, effective.html?.decodeEntities, { text: false })\n\n // 12. Remove unused CSS (serializes/parses internally around email-comb)\n if (enabled('purgeCss') && effective.css?.purge) {\n const purgeOptions = typeof effective.css.purge === 'object' ? effective.css.purge : {}\n dom = purgeCssDom(dom, purgeOptions)\n }\n\n // 13. Entities\n if (enabled('entities')) dom = entitiesDom(dom, effective.html?.decodeEntities)\n\n // Serialize once — remaining transformers operate on the HTML string\n const isXhtml = doctype ? /xhtml/i.test(doctype) : false\n let result = serialize(dom, { selfClosingTags: isXhtml })\n\n // 14. Replace strings\n if (enabled('replaceStrings')) result = replaceStrings(result, effective)\n\n // 15. Format — skipped when `minify` is enabled\n const minifyWillRun = enabled('minify') && !!effective.html?.minify\n if (enabled('prettify') && !minifyWillRun && effective.html?.format) {\n const formatOptions = typeof effective.html.format === 'object' ? effective.html.format : {}\n result = await format(result, formatOptions)\n }\n\n // 16. Minify\n if (enabled('minify') && effective.html?.minify) {\n const minifyOptions = typeof effective.html.minify === 'object' ? effective.html.minify : {}\n result = minify(result, minifyOptions)\n }\n\n /**\n * Strip self-closing slashes for HTML5 doctypes, but preserve content\n * inside MSO conditional comments (XML-ish, case/syntax sensitive).\n * MUST run BEFORE minifyCodeInline: at this point, CodeInline's\n * shiki output is still marker-encoded (§MZLT§/§MZGT§), so any\n * ` />` in the highlighted source code (e.g. a Vue self-close\n * tag) hasn't materialized yet and can't be mistakenly\n * stripped from inside a `<code>` element.\n */\n if (!isXhtml) {\n result = result.replace(\n /<!--\\[if [^\\]]*\\]>[\\s\\S]*?<!\\[endif\\]-->|( \\/>)/g,\n (match, selfClose) => selfClose ? '>' : match,\n )\n }\n\n /**\n * 16.5. Strip whitespace inside `data-minify-inline` markers (CodeInline's\n * Shiki output, etc.). Runs after format/minify so it cleans up the\n * pretty-printer's indentation between sibling tags.\n */\n result = minifyCodeInline(result)\n\n return result\n}\n"],"mappings":";;;;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AAC;CAG/F,IAAI,QAAQ,UAAU,KAAK,UAAU,KAAK,OAAO;EAC/C,MAAM,eAAe,OAAO,UAAU,IAAI,UAAU,WAAW,UAAU,IAAI,QAAQ,CAAC;EACtF,MAAM,YAAY,KAAK,YAAY;CACrC;CAGA,IAAI,QAAQ,UAAU,GAAG,MAAM,YAAY,KAAK,UAAU,MAAM,cAAc;CAG9E,MAAM,UAAU,UAAU,SAAS,KAAK,OAAO,IAAI;CACnD,IAAI,SAAS,UAAU,KAAK,EAAE,iBAAiB,QAAQ,CAAC;CAGxD,IAAI,QAAQ,gBAAgB,GAAG,SAAS,eAAe,QAAQ,SAAS;CAGxE,MAAM,gBAAgB,QAAQ,QAAQ,KAAK,CAAC,CAAC,UAAU,MAAM;CAC7D,IAAI,QAAQ,UAAU,KAAK,CAAC,iBAAiB,UAAU,MAAM,QAAQ;EACnE,MAAM,gBAAgB,OAAO,UAAU,KAAK,WAAW,WAAW,UAAU,KAAK,SAAS,CAAC;EAC3F,SAAS,MAAM,OAAO,QAAQ,aAAa;CAC7C;CAGA,IAAI,QAAQ,QAAQ,KAAK,UAAU,MAAM,QAAQ;EAC/C,MAAM,gBAAgB,OAAO,UAAU,KAAK,WAAW,WAAW,UAAU,KAAK,SAAS,CAAC;EAC3F,SAAS,OAAO,QAAQ,aAAa;CACvC;;;;;;;;;;CAWA,IAAI,CAAC,SACH,SAAS,OAAO,QACd,qDACC,OAAO,cAAc,YAAY,MAAM,KAC1C;;;;;;CAQF,SAAS,iBAAiB,MAAM;CAEhC,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/transformers/index.ts"],"sourcesContent":["import { parse, serialize } from '../utils/ast/index.ts'\nimport { inlineLinkDom } from './inlineLink.ts'\nimport { tailwindComponent } from './tailwindComponent.ts'\nimport { tailwindcss } from './tailwindcss.ts'\nimport { safeSelectorsDom } from './safeSelectors.ts'\nimport { attributeToStyleDom } from './attributeToStyle.ts'\nimport { inlineCssDom } from './inlineCss.ts'\nimport { msoPlaceholders } from './msoPlaceholders.ts'\nimport { columnWidth } from './columnWidth.ts'\nimport { imgWidthDom } from './imgWidth.ts'\nimport { removeAttributesDom } from './removeAttributes.ts'\nimport { shorthandCssDom } from './shorthandCss.ts'\nimport { sixHexDom } from './sixHex.ts'\nimport { addAttributesDom } from './addAttributes.ts'\nimport { filtersDom } from './filters/index.ts'\nimport { baseDom } from './base.ts'\nimport { entitiesDom } from './entities.ts'\nimport { urlQueryDom } from './urlQuery.ts'\nimport { purgeCssDom } from './purgeCss.ts'\nimport { msoConditionals } from './msoConditionals.ts'\nimport { replaceStrings } from './replaceStrings.ts'\nimport { format } from './format.ts'\nimport { minifyCodeInline } from './minifyCodeInline.ts'\nimport { minify } from './minify.ts'\nimport type { MaizzleConfig } from '../types/config.ts'\nimport type { TailwindBlock } from '../composables/renderContext.ts'\n\n/**\n * Run all Maizzle transformers on the rendered HTML.\n *\n * The HTML is parsed into a DOM once at the start and passed through all\n * DOM-based transformers as a shared `ChildNode[]`. After all DOM transformers\n * complete, the DOM is serialized back to a string exactly once.\n *\n * String-only transformers (those that rely on external tools that require a\n * raw HTML string) then run on the serialized output.\n *\n * Transformers run in a specific order:\n * 0. Inline link stylesheets — replace `<link rel=\"stylesheet\">` with `<style>` tags\n * 1. Tailwind CSS — compile CSS, lower syntax, optimize (cleanup + merge media queries)\n * 2. Safe class names\n * 3. Attribute to style\n * 4. CSS inliner\n * 5. Remove attributes\n * 6. Shorthand CSS\n * 7. Six-digit HEX\n * 8. Add attributes\n * 9. Filters\n * 10. Base URL\n * 11. URL query\n * 11.5 Entities in comment nodes (before purge — protects MSO conditionals)\n * 12. Purge CSS (serializes/parses internally around email-comb)\n * 13. Entities\n * + Vue-generated comments stripped here (on serialized string)\n * 13.5 Outlook placeholders → MSO conditional comments\n * 14. Replace strings\n * 15. Prettify\n * 16. Minify\n */\nexport async function runTransformers(\n html: string,\n config: MaizzleConfig,\n filePath?: string,\n doctype?: string,\n tailwindBlocks?: TailwindBlock[],\n sourceFiles?: string[],\n): Promise<string> {\n /**\n * Whole-pipeline opt-out. `<Outlook>` placeholders still have to\n * become real conditional comments, so that one step always runs.\n */\n if (config.useTransformers === false) return msoConditionals(html)\n\n /**\n * Per-transformer skip map — only honored when useTransformers is an object.\n *\n * A toggle set to `true` *force-enables* its transformer for this run\n * by layering on the matching config slice (e.g. `prettify: true`\n * sets `html.format = true`). This only applies to transformers\n * whose enable flag is a plain boolean — data-driven ones\n * (filters, baseURL, urlQuery, etc.) need actual config\n * values, so a bare `true` for those is a no-op.\n */\n const toggles = typeof config.useTransformers === 'object' ? config.useTransformers : null\n const enabled = (key: keyof NonNullable<typeof toggles>) => toggles?.[key] !== false\n\n let effective = config\n if (toggles) {\n const cssOver: Record<string, unknown> = {}\n const htmlOver: Record<string, unknown> = {}\n if (toggles.inlineCss === true) cssOver.inline = true\n if (toggles.purgeCss === true) cssOver.purge = true\n if (toggles.safeSelectors === true) cssOver.safe = true\n if (toggles.shorthandCss === true) cssOver.shorthand = true\n if (toggles.sixHex === true) cssOver.sixHex = true\n if (toggles.prettify === true) htmlOver.format = true\n if (toggles.minify === true) htmlOver.minify = true\n if (toggles.entities === true) htmlOver.decodeEntities = true\n\n if (Object.keys(cssOver).length || Object.keys(htmlOver).length) {\n effective = {\n ...config,\n css: { ...config.css, ...cssOver },\n html: { ...config.html, ...htmlOver },\n }\n }\n }\n\n // Parse once — all DOM transformers share this array\n let dom = parse(html)\n\n // 0. Inline <link> stylesheets\n dom = await inlineLinkDom(dom, filePath)\n\n // 0.5. <Tailwind> component — compile per-block scoped CSS, inject into <head>\n if (tailwindBlocks?.length) {\n dom = await tailwindComponent(dom, tailwindBlocks, effective, filePath, sourceFiles)\n }\n\n // 1. Tailwind CSS — always runs first\n dom = await tailwindcss(dom, effective, filePath, sourceFiles)\n\n // 2. Safe class names\n if (enabled('safeSelectors')) dom = safeSelectorsDom(dom, effective.css)\n\n // 3. Attribute to style\n if (enabled('attributeToStyle') && typeof effective.css?.inline === 'object' && effective.css.inline.attributeToStyle) {\n dom = attributeToStyleDom(dom, effective.css.inline.attributeToStyle)\n }\n\n // 4. CSS inliner (serializes/parses internally around juice)\n if (enabled('inlineCss') && effective.css?.inline) {\n const inlineOptions = typeof effective.css.inline === 'object' ? effective.css.inline : {}\n dom = inlineCssDom(dom, inlineOptions)\n }\n\n // 4.5. Resolve MSO placeholders (table width + td style) from inlined CSS\n dom = msoPlaceholders(dom)\n\n // 4.6. Resolve Column min-width placeholders from nearest sized ancestor\n dom = columnWidth(dom)\n\n // 4.7. Backfill width on <Img> images that inherit their parent's width\n dom = imgWidthDom(dom)\n\n // 5. Remove attributes\n if (enabled('removeAttributes')) {\n const removeRules = effective.html?.attributes?.remove\n dom = removeAttributesDom(dom, Array.isArray(removeRules) ? removeRules : [])\n }\n\n // 6. Shorthand CSS\n if (enabled('shorthandCss') && effective.css?.shorthand) {\n const shorthandOptions = typeof effective.css.shorthand === 'object' ? effective.css.shorthand : {}\n dom = shorthandCssDom(dom, shorthandOptions)\n }\n\n // 7. Six-digit HEX\n if (enabled('sixHex') && effective.css?.sixHex !== false) dom = sixHexDom(dom)\n\n // 8. Add attributes\n if (enabled('addAttributes')) dom = addAttributesDom(dom, effective.html?.attributes)\n\n // 9. Filters\n if (enabled('filters')) dom = filtersDom(dom, effective.filters)\n\n // 10. Base URL (serializes/parses internally for VML/MSO regex passes)\n if (enabled('baseURL') && effective.url?.base) dom = baseDom(dom, effective.url.base)\n\n // 11. URL query\n if (enabled('urlQuery') && effective.url?.query && Object.keys(effective.url.query).length > 0) {\n const { _options: queryOptions, ...queryParams } = effective.url.query as Record<string, unknown>\n dom = urlQueryDom(dom, queryParams, (queryOptions ?? {}) as import('../types/config.ts').UrlQueryOptions)\n }\n\n /**\n * 11.5. Encode entities in comment nodes before purge/minify. Raw\n * invisible chars (e.g. U+00A0 from Vue decoding at compile\n * time) inside MSO conditionals make email-comb remove the whole\n * \"whitespace-only\" conditional and html-crush collapse the chars.\n * Text nodes are skipped here — purge's internal parse round-trip\n * would decode them again — comment data survives un-decoded.\n */\n if (enabled('entities')) dom = entitiesDom(dom, effective.html?.decodeEntities, { text: false })\n\n // 12. Remove unused CSS (serializes/parses internally around email-comb)\n if (enabled('purgeCss') && effective.css?.purge) {\n const purgeOptions = typeof effective.css.purge === 'object' ? effective.css.purge : {}\n dom = purgeCssDom(dom, purgeOptions)\n }\n\n // 13. Entities\n if (enabled('entities')) dom = entitiesDom(dom, effective.html?.decodeEntities)\n\n // Serialize once — remaining transformers operate on the HTML string\n const isXhtml = doctype ? /xhtml/i.test(doctype) : false\n let result = serialize(dom, { selfClosingTags: isXhtml })\n\n // 13.5. Collapse <Outlook> placeholders into MSO conditional comments\n result = msoConditionals(result)\n\n // 14. Replace strings\n if (enabled('replaceStrings')) result = replaceStrings(result, effective)\n\n // 15. Format — skipped when `minify` is enabled\n const minifyWillRun = enabled('minify') && !!effective.html?.minify\n if (enabled('prettify') && !minifyWillRun && effective.html?.format) {\n const formatOptions = typeof effective.html.format === 'object' ? effective.html.format : {}\n result = await format(result, formatOptions)\n }\n\n // 16. Minify\n if (enabled('minify') && effective.html?.minify) {\n const minifyOptions = typeof effective.html.minify === 'object' ? effective.html.minify : {}\n result = minify(result, minifyOptions)\n }\n\n /**\n * Strip self-closing slashes for HTML5 doctypes, but preserve content\n * inside MSO conditional comments (XML-ish, case/syntax sensitive).\n * MUST run BEFORE minifyCodeInline: at this point, CodeInline's\n * shiki output is still marker-encoded (§MZLT§/§MZGT§), so any\n * ` />` in the highlighted source code (e.g. a Vue self-close\n * tag) hasn't materialized yet and can't be mistakenly\n * stripped from inside a `<code>` element.\n */\n if (!isXhtml) {\n result = result.replace(\n /<!--\\[if [^\\]]*\\]>[\\s\\S]*?<!\\[endif\\]-->|( \\/>)/g,\n (match, selfClose) => selfClose ? '>' : match,\n )\n }\n\n /**\n * 16.5. Strip whitespace inside `data-minify-inline` markers (CodeInline's\n * Shiki output, etc.). Runs after format/minify so it cleans up the\n * p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7
7
|
* handful of Maizzle-specific extras.
|
|
8
8
|
*/
|
|
9
|
-
interface InlineCssOptions extends JuiceOptions {
|
|
9
|
+
export interface InlineCssOptions extends JuiceOptions {
|
|
10
10
|
/**
|
|
11
11
|
* Convert `0px`, `0em` etc. to `0` in inline styles.
|
|
12
12
|
*
|
|
@@ -72,13 +72,12 @@ interface InlineCssOptions extends JuiceOptions {
|
|
|
72
72
|
* removeStyleTags: true,
|
|
73
73
|
* })
|
|
74
74
|
*/
|
|
75
|
-
declare function inlineCss(html: string, options?: InlineCssOptions): string;
|
|
75
|
+
export declare function inlineCss(html: string, options?: InlineCssOptions): string;
|
|
76
76
|
/**
|
|
77
77
|
* DOM-form of {@link inlineCss} used by the internal transformer pipeline.
|
|
78
78
|
* Takes a parsed DOM, returns a parsed DOM — avoids the redundant
|
|
79
79
|
* serialize/parse round-trips when chained with other transformers.
|
|
80
80
|
*/
|
|
81
|
-
declare function inlineCssDom(dom: ChildNode[], options?: InlineCssOptions): ChildNode[];
|
|
81
|
+
export declare function inlineCssDom(dom: ChildNode[], options?: InlineCssOptions): ChildNode[];
|
|
82
82
|
//#endregion
|
|
83
|
-
export { InlineCssOptions, inlineCss, inlineCssDom };
|
|
84
83
|
//# sourceMappingURL=inlineCss.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inlineCss.d.ts","names":[],"sources":["../../src/transformers/inlineCss.ts"],"mappings":";;;KAMK,eAAe,YAAY,kBAAkB;;;;;
|
|
1
|
+
{"version":3,"file":"inlineCss.d.ts","names":[],"sources":["../../src/transformers/inlineCss.ts"],"mappings":";;;KAMK,eAAe,YAAY,kBAAkB;;;;;iBAMjC,yBAAyB;;;;;;EAMxC;;;;;;;EAOA;;;;;EAKA;;;;;EAKA,mBAAmB;;;;;EAKnB;;;;;;;EAOA;;;;;;;EAOA;;;;;EAKA,aAAa;IAAiB;IAAe;;;;;;;;;;;;;;;;;wBAiB/B,UAAU,cAAc,UAAS;;;;;;wBASjC,aAAa,KAAK,aAAa,UAAS,mBAAwB"}
|
|
@@ -22,13 +22,12 @@ import { ChildNode } from "domhandler";
|
|
|
22
22
|
* '/path/to/template.html',
|
|
23
23
|
* )
|
|
24
24
|
*/
|
|
25
|
-
declare function inlineLink(html: string, filePath?: string): Promise<string>;
|
|
25
|
+
export declare function inlineLink(html: string, filePath?: string): Promise<string>;
|
|
26
26
|
/**
|
|
27
27
|
* DOM-form of {@link inlineLink} used by the internal transformer pipeline.
|
|
28
28
|
* Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
29
29
|
* serialize/parse round-trips when chained with other transformers.
|
|
30
30
|
*/
|
|
31
|
-
declare function inlineLinkDom(dom: ChildNode[], filePath?: string): Promise<ChildNode[]>;
|
|
31
|
+
export declare function inlineLinkDom(dom: ChildNode[], filePath?: string): Promise<ChildNode[]>;
|
|
32
32
|
//#endregion
|
|
33
|
-
export { inlineLink, inlineLinkDom };
|
|
34
33
|
//# sourceMappingURL=inlineLink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inlineLink.d.ts","names":[],"sources":["../../src/transformers/inlineLink.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"inlineLink.d.ts","names":[],"sources":["../../src/transformers/inlineLink.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;wBA2BsB,WAAW,cAAc,oBAAoB;;;;;;wBAS7C,cAAc,KAAK,aAAa,oBAAoB,QAAQ"}
|
|
@@ -14,7 +14,7 @@ import { Opts, Opts as MinifyOptions } from "html-crush";
|
|
|
14
14
|
*
|
|
15
15
|
* const tight = minify('<p> hello </p>', { removeIndentations: true })
|
|
16
16
|
*/
|
|
17
|
-
declare function minify(html: string, options?: Partial<Opts>): string;
|
|
17
|
+
export declare function minify(html: string, options?: Partial<Opts>): string;
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
19
|
+
export type { MinifyOptions };
|
|
20
20
|
//# sourceMappingURL=minify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minify.d.ts","names":[],"sources":["../../src/transformers/minify.ts"],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"minify.d.ts","names":[],"sources":["../../src/transformers/minify.ts"],"mappings":";;;;;;;;;;;;;;;;wBAwBgB,OAAO,cAAc,UAAS,QAAQ"}
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
* The marker attribute is intentionally generic so any component facing
|
|
24
24
|
* the same formatter-vs-inline-structure problem can opt in.
|
|
25
25
|
*/
|
|
26
|
-
declare function minifyCodeInline(html: string): string;
|
|
26
|
+
export declare function minifyCodeInline(html: string): string;
|
|
27
27
|
//#endregion
|
|
28
|
-
export { minifyCodeInline };
|
|
29
28
|
//# sourceMappingURL=minifyCodeInline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minifyCodeInline.d.ts","names":[],"sources":["../../src/transformers/minifyCodeInline.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"minifyCodeInline.d.ts","names":[],"sources":["../../src/transformers/minifyCodeInline.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;wBAwBgB,iBAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"msoConditionals.d.ts","names":[],"sources":["../../src/transformers/msoConditionals.ts"],"mappings":";wBAkBgB,gBAAgB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/transformers/msoConditionals.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the placeholder comments emitted by `<Outlook>` into real MSO
|
|
4
|
+
* conditional comments.
|
|
5
|
+
*
|
|
6
|
+
* `<Outlook>` can't render `<!--[if mso]>…<![endif]-->` directly: the
|
|
7
|
+
* whole block would parse as a single comment node and every DOM
|
|
8
|
+
* transformer (inliner, safe selectors, purge, attributes…) would
|
|
9
|
+
* be blind to the markup inside it. Instead it wraps its slot in
|
|
10
|
+
* two self-contained conditional comments carrying a marker, so
|
|
11
|
+
* the content stays real DOM through the pipeline. Shaping the
|
|
12
|
+
* markers as conditionals means juice and email-comb leave
|
|
13
|
+
* them alone. This runs on the serialized string, after
|
|
14
|
+
* every DOM transformer, and turns the pair back into a
|
|
15
|
+
* single hidden conditional block.
|
|
16
|
+
*/
|
|
17
|
+
const RE_OPEN = /<!--\[if ([^\]]+)\]>__MAIZZLE_MSO_OPEN__<!\[endif\]-->/g;
|
|
18
|
+
const RE_CLOSE = /<!--\[if mso\]>__MAIZZLE_MSO_CLOSE__<!\[endif\]-->/g;
|
|
19
|
+
function msoConditionals(html) {
|
|
20
|
+
return html.replace(RE_OPEN, "<!--[if $1]>").replace(RE_CLOSE, "<![endif]-->");
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { msoConditionals };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=msoConditionals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"msoConditionals.js","names":[],"sources":["../../src/transformers/msoConditionals.ts"],"sourcesContent":["/**\n * Resolve the placeholder comments emitted by `<Outlook>` into real MSO\n * conditional comments.\n *\n * `<Outlook>` can't render `<!--[if mso]>…<![endif]-->` directly: the\n * whole block would parse as a single comment node and every DOM\n * transformer (inliner, safe selectors, purge, attributes…) would\n * be blind to the markup inside it. Instead it wraps its slot in\n * two self-contained conditional comments carrying a marker, so\n * the content stays real DOM through the pipeline. Shaping the\n * markers as conditionals means juice and email-comb leave\n * them alone. This runs on the serialized string, after\n * every DOM transformer, and turns the pair back into a\n * single hidden conditional block.\n */\nconst RE_OPEN = /<!--\\[if ([^\\]]+)\\]>__MAIZZLE_MSO_OPEN__<!\\[endif\\]-->/g\nconst RE_CLOSE = /<!--\\[if mso\\]>__MAIZZLE_MSO_CLOSE__<!\\[endif\\]-->/g\n\nexport function msoConditionals(html: string): string {\n return html\n .replace(RE_OPEN, '<!--[if $1]>')\n .replace(RE_CLOSE, '<![endif]-->')\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAM,UAAU;AAChB,MAAM,WAAW;AAEjB,SAAgB,gBAAgB,MAAsB;CACpD,OAAO,KACJ,QAAQ,SAAS,cAAc,CAAC,CAChC,QAAQ,UAAU,cAAc;AACrC"}
|
|
@@ -26,7 +26,6 @@ import { ChildNode } from "domhandler";
|
|
|
26
26
|
* Single collect-walk + single substitute-walk: the same Container div
|
|
27
27
|
* carries both marker kinds, so one element visit fills both maps.
|
|
28
28
|
*/
|
|
29
|
-
declare function msoPlaceholders(dom: ChildNode[]): ChildNode[];
|
|
29
|
+
export declare function msoPlaceholders(dom: ChildNode[]): ChildNode[];
|
|
30
30
|
//#endregion
|
|
31
|
-
export { msoPlaceholders };
|
|
32
31
|
//# sourceMappingURL=msoPlaceholders.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"msoPlaceholders.d.ts","names":[],"sources":["../../src/transformers/msoPlaceholders.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"msoPlaceholders.d.ts","names":[],"sources":["../../src/transformers/msoPlaceholders.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8CgB,gBAAgB,KAAK,cAAc"}
|
|
@@ -4,7 +4,7 @@ import { Opts } from "email-comb";
|
|
|
4
4
|
/**
|
|
5
5
|
* Options for the `purgeCss` transformer.
|
|
6
6
|
*/
|
|
7
|
-
interface PurgeCssOptions extends Partial<Omit<Opts, 'whitelist'>> {
|
|
7
|
+
export interface PurgeCssOptions extends Partial<Omit<Opts, 'whitelist'>> {
|
|
8
8
|
/**
|
|
9
9
|
* Selectors to preserve regardless of whether they're matched in the
|
|
10
10
|
* markup. Appended to Maizzle's built-in safelist (Gmail, Apple Mail,
|
|
@@ -30,13 +30,12 @@ interface PurgeCssOptions extends Partial<Omit<Opts, 'whitelist'>> {
|
|
|
30
30
|
* safelist: ['.keep'],
|
|
31
31
|
* })
|
|
32
32
|
*/
|
|
33
|
-
declare function purgeCss(html: string, options?: PurgeCssOptions): string;
|
|
33
|
+
export declare function purgeCss(html: string, options?: PurgeCssOptions): string;
|
|
34
34
|
/**
|
|
35
35
|
* DOM-form of {@link purgeCss} used by the internal transformer
|
|
36
36
|
* pipeline. Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
37
37
|
* serialize/parse round-trips when chained with other transformers.
|
|
38
38
|
*/
|
|
39
|
-
declare function purgeCssDom(dom: ChildNode[], options?: PurgeCssOptions): ChildNode[];
|
|
39
|
+
export declare function purgeCssDom(dom: ChildNode[], options?: PurgeCssOptions): ChildNode[];
|
|
40
40
|
//#endregion
|
|
41
|
-
export { PurgeCssOptions, purgeCss, purgeCssDom };
|
|
42
41
|
//# sourceMappingURL=purgeCss.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purgeCss.d.ts","names":[],"sources":["../../src/transformers/purgeCss.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"purgeCss.d.ts","names":[],"sources":["../../src/transformers/purgeCss.ts"],"mappings":";;;;;;iBAsCiB,wBAAwB,QAAQ,KAAK;;;;;;EAMpD;;;;;;;;;;;;;;;;;;;;wBAqBc,SAAS,cAAc,UAAS;;;;;;wBAShC,YAAY,KAAK,aAAa,UAAS,kBAAuB"}
|
|
@@ -3,7 +3,7 @@ import { ChildNode } from "domhandler";
|
|
|
3
3
|
/**
|
|
4
4
|
* Single attribute-removal rule.
|
|
5
5
|
*/
|
|
6
|
-
interface RemoveAttributeRule {
|
|
6
|
+
export interface RemoveAttributeRule {
|
|
7
7
|
/** Attribute name to match. */
|
|
8
8
|
name: string;
|
|
9
9
|
/**
|
|
@@ -18,7 +18,7 @@ interface RemoveAttributeRule {
|
|
|
18
18
|
* Entry passed to {@link removeAttributes}. A bare string targets the named
|
|
19
19
|
* attribute and removes it when its value is empty.
|
|
20
20
|
*/
|
|
21
|
-
type RemoveAttributeOption = string | RemoveAttributeRule;
|
|
21
|
+
export type RemoveAttributeOption = string | RemoveAttributeRule;
|
|
22
22
|
/**
|
|
23
23
|
* Remove HTML attributes from elements.
|
|
24
24
|
*
|
|
@@ -41,13 +41,12 @@ type RemoveAttributeOption = string | RemoveAttributeRule;
|
|
|
41
41
|
* { name: 'role', value: 'none' },
|
|
42
42
|
* ])
|
|
43
43
|
*/
|
|
44
|
-
declare function removeAttributes(html: string, attributes?: RemoveAttributeOption[]): string;
|
|
44
|
+
export declare function removeAttributes(html: string, attributes?: RemoveAttributeOption[]): string;
|
|
45
45
|
/**
|
|
46
46
|
* DOM-form of {@link removeAttributes} used by the internal transformer
|
|
47
47
|
* pipeline. Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
48
48
|
* serialize/parse round-trips when chained with other transformers.
|
|
49
49
|
*/
|
|
50
|
-
declare function removeAttributesDom(dom: ChildNode[], attributes?: RemoveAttributeOption[]): ChildNode[];
|
|
50
|
+
export declare function removeAttributesDom(dom: ChildNode[], attributes?: RemoveAttributeOption[]): ChildNode[];
|
|
51
51
|
//#endregion
|
|
52
|
-
export { RemoveAttributeOption, RemoveAttributeRule, removeAttributes, removeAttributesDom };
|
|
53
52
|
//# sourceMappingURL=removeAttributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeAttributes.d.ts","names":[],"sources":["../../src/transformers/removeAttributes.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"removeAttributes.d.ts","names":[],"sources":["../../src/transformers/removeAttributes.ts"],"mappings":";;;;;iBAMiB;;EAEf;;;;;;;EAOA,iBAAiB;;;;;;YAOP,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;wBAwB7B,iBAAiB,cAAc,aAAY;;;;;;wBAS3C,oBAAoB,KAAK,aAAa,aAAY,0BAA+B"}
|
|
@@ -9,7 +9,6 @@ import { MaizzleConfig } from "../types/config.js";
|
|
|
9
9
|
*
|
|
10
10
|
* Character classes must be escaped in keys, e.g. `\\s` for `\s`.
|
|
11
11
|
*/
|
|
12
|
-
declare function replaceStrings(html: string, config?: MaizzleConfig): string;
|
|
12
|
+
export declare function replaceStrings(html: string, config?: MaizzleConfig): string;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { replaceStrings };
|
|
15
14
|
//# sourceMappingURL=replaceStrings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceStrings.d.ts","names":[],"sources":["../../src/transformers/replaceStrings.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"replaceStrings.d.ts","names":[],"sources":["../../src/transformers/replaceStrings.ts"],"mappings":";;;;;;;;;;;wBAWgB,eAAe,cAAc,SAAQ"}
|
|
@@ -24,13 +24,12 @@ import { ChildNode } from "domhandler";
|
|
|
24
24
|
*
|
|
25
25
|
* const out = safeSelectors('<div class="sm:text-base"></div>')
|
|
26
26
|
*/
|
|
27
|
-
declare function safeSelectors(html: string, config?: CssConfig): string;
|
|
27
|
+
export declare function safeSelectors(html: string, config?: CssConfig): string;
|
|
28
28
|
/**
|
|
29
29
|
* DOM-form of {@link safeSelectors} used by the internal transformer pipeline.
|
|
30
30
|
* Takes a parsed DOM, returns a parsed DOM — avoids redundant
|
|
31
31
|
* serialize/parse round-trips when chained with other transformers.
|
|
32
32
|
*/
|
|
33
|
-
declare function safeSelectorsDom(dom: ChildNode[], config?: CssConfig): ChildNode[];
|
|
33
|
+
export declare function safeSelectorsDom(dom: ChildNode[], config?: CssConfig): ChildNode[];
|
|
34
34
|
//#endregion
|
|
35
|
-
export { safeSelectors, safeSelectorsDom };
|
|
36
35
|
//# sourceMappingURL=safeSelectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeSelectors.d.ts","names":[],"sources":["../../src/transformers/safeSelectors.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"safeSelectors.d.ts","names":[],"sources":["../../src/transformers/safeSelectors.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;wBA2HgB,cAAc,cAAc,SAAQ;;;;;;wBASpC,iBAAiB,KAAK,aAAa,SAAQ,YAAiB"}
|