@maizzle/framework 6.0.0-rc.17 → 6.0.0-rc.18
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/bin/maizzle.mjs +1 -1
- package/dist/build.d.ts +6 -5
- package/dist/build.d.ts.map +1 -1
- package/dist/{build.mjs → build.js} +13 -9
- package/dist/build.js.map +1 -0
- package/dist/components/Body.vue +10 -0
- package/dist/components/Button.vue +70 -11
- package/dist/components/Column.vue +10 -0
- package/dist/components/Container.vue +29 -1
- package/dist/components/Html.vue +10 -0
- package/dist/components/Layout.vue +27 -12
- package/dist/components/MarkdownLayout.vue +39 -0
- package/dist/components/Overlap.vue +10 -0
- package/dist/components/Preheader.vue +3 -8
- package/dist/components/Row.vue +10 -0
- package/dist/components/Section.vue +10 -0
- package/dist/components/{utils.mjs → utils.js} +1 -1
- package/dist/components/utils.js.map +1 -0
- package/dist/composables/{defineConfig.mjs → defineConfig.js} +3 -3
- package/dist/composables/defineConfig.js.map +1 -0
- package/dist/composables/{renderContext.mjs → renderContext.js} +1 -1
- package/dist/composables/renderContext.js.map +1 -0
- package/dist/composables/useBaseUrl.d.ts +19 -0
- package/dist/composables/useBaseUrl.d.ts.map +1 -0
- package/dist/composables/useBaseUrl.js +27 -0
- package/dist/composables/useBaseUrl.js.map +1 -0
- package/dist/composables/{useConfig.mjs → useConfig.js} +1 -1
- package/dist/composables/useConfig.js.map +1 -0
- package/dist/composables/{useDoctype.mjs → useDoctype.js} +2 -2
- package/dist/composables/useDoctype.js.map +1 -0
- package/dist/composables/{useEvent.mjs → useEvent.js} +2 -2
- package/dist/composables/useEvent.js.map +1 -0
- package/dist/composables/{useFont.mjs → useFont.js} +2 -2
- package/dist/composables/useFont.js.map +1 -0
- package/dist/composables/{useOutlookFallback.mjs → useOutlookFallback.js} +1 -1
- package/dist/composables/useOutlookFallback.js.map +1 -0
- package/dist/composables/{usePlaintext.mjs → usePlaintext.js} +2 -2
- package/dist/composables/usePlaintext.js.map +1 -0
- package/dist/composables/{usePreheader.mjs → usePreheader.js} +2 -2
- package/dist/composables/usePreheader.js.map +1 -0
- package/dist/composables/useTransformers.d.ts +34 -0
- package/dist/composables/useTransformers.d.ts.map +1 -0
- package/dist/composables/useTransformers.js +49 -0
- package/dist/composables/useTransformers.js.map +1 -0
- package/dist/composables/useUrlQuery.d.ts +19 -0
- package/dist/composables/useUrlQuery.d.ts.map +1 -0
- package/dist/composables/useUrlQuery.js +27 -0
- package/dist/composables/useUrlQuery.js.map +1 -0
- package/dist/config/{defaults.mjs → defaults.js} +8 -2
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/{index.mjs → index.js} +3 -3
- package/dist/config/index.js.map +1 -0
- package/dist/events/index.d.ts +8 -2
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/{index.mjs → index.js} +20 -4
- package/dist/events/index.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +37 -0
- package/dist/{plaintext.mjs → plaintext.js} +1 -1
- package/dist/plaintext.js.map +1 -0
- package/dist/{plugin.mjs → plugin.js} +5 -5
- package/dist/plugin.js.map +1 -0
- package/dist/plugins/postcss/{mergeMediaQueries.mjs → mergeMediaQueries.js} +1 -1
- package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -0
- package/dist/plugins/postcss/{pruneVars.mjs → pruneVars.js} +1 -1
- package/dist/plugins/postcss/pruneVars.js.map +1 -0
- package/dist/plugins/postcss/{quoteFontFamilies.mjs → quoteFontFamilies.js} +1 -1
- package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -0
- package/dist/plugins/postcss/{removeDeclarations.mjs → removeDeclarations.js} +1 -1
- package/dist/plugins/postcss/removeDeclarations.js.map +1 -0
- package/dist/plugins/postcss/{resolveMaizzleImports.mjs → resolveMaizzleImports.js} +1 -1
- package/dist/plugins/postcss/resolveMaizzleImports.js.map +1 -0
- package/dist/plugins/postcss/{resolveProps.mjs → resolveProps.js} +1 -1
- package/dist/plugins/postcss/resolveProps.js.map +1 -0
- package/dist/plugins/postcss/{tailwindCleanup.mjs → tailwindCleanup.js} +1 -1
- package/dist/plugins/postcss/tailwindCleanup.js.map +1 -0
- package/dist/{prepare.mjs → prepare.js} +4 -4
- package/dist/prepare.js.map +1 -0
- package/dist/render/{createRenderer.mjs → createRenderer.js} +19 -11
- package/dist/render/createRenderer.js.map +1 -0
- package/dist/render/{index.mjs → index.js} +5 -5
- package/dist/render/index.js.map +1 -0
- package/dist/render/{injectFonts.mjs → injectFonts.js} +2 -2
- package/dist/render/injectFonts.js.map +1 -0
- package/dist/render/plugins/{codeBlockExtract.mjs → codeBlockExtract.js} +1 -1
- package/dist/render/plugins/codeBlockExtract.js.map +1 -0
- package/dist/render/plugins/{markdownExtract.mjs → markdownExtract.js} +1 -1
- package/dist/render/plugins/markdownExtract.js.map +1 -0
- package/dist/render/plugins/{rawExtract.mjs → rawExtract.js} +1 -1
- package/dist/render/plugins/rawExtract.js.map +1 -0
- package/dist/render/plugins/{rowSourceLocation.mjs → rowSourceLocation.js} +1 -1
- package/dist/render/plugins/rowSourceLocation.js.map +1 -0
- package/dist/{serve.mjs → serve.js} +8 -8
- package/dist/serve.js.map +1 -0
- package/dist/server/{compatibility.mjs → compatibility.js} +4 -4
- package/dist/server/compatibility.js.map +1 -0
- package/dist/server/{email.mjs → email.js} +1 -1
- package/dist/server/email.js.map +1 -0
- package/dist/server/{linter.mjs → linter.js} +2 -2
- package/dist/server/linter.js.map +1 -0
- package/dist/server/{sfc-utils.mjs → sfc-utils.js} +1 -1
- package/dist/server/sfc-utils.js.map +1 -0
- package/dist/server/ui/App.vue +18 -0
- package/dist/server/ui/components/ui/command/Command.vue +4 -1
- package/dist/transformers/{addAttributes.mjs → addAttributes.js} +3 -3
- package/dist/transformers/addAttributes.js.map +1 -0
- package/dist/transformers/{attributeToStyle.mjs → attributeToStyle.js} +3 -3
- package/dist/transformers/attributeToStyle.js.map +1 -0
- package/dist/transformers/{base.mjs → base.js} +6 -6
- package/dist/transformers/base.js.map +1 -0
- package/dist/transformers/{columnWidth.mjs → columnWidth.js} +3 -3
- package/dist/transformers/columnWidth.js.map +1 -0
- package/dist/transformers/{entities.mjs → entities.js} +3 -3
- package/dist/transformers/entities.js.map +1 -0
- package/dist/transformers/filters/{defaults.mjs → defaults.js} +1 -1
- package/dist/transformers/filters/defaults.js.map +1 -0
- package/dist/transformers/filters/{index.mjs → index.js} +5 -5
- package/dist/transformers/filters/index.js.map +1 -0
- package/dist/transformers/{format.mjs → format.js} +1 -1
- package/dist/transformers/format.js.map +1 -0
- package/dist/transformers/index.js +113 -0
- package/dist/transformers/index.js.map +1 -0
- package/dist/transformers/{inlineCSS.mjs → inlineCSS.js} +5 -5
- package/dist/transformers/inlineCSS.js.map +1 -0
- package/dist/transformers/{inlineLink.mjs → inlineLink.js} +3 -3
- package/dist/transformers/inlineLink.js.map +1 -0
- package/dist/transformers/{minify.mjs → minify.js} +1 -1
- package/dist/transformers/minify.js.map +1 -0
- package/dist/transformers/msoPlaceholders.d.ts +28 -0
- package/dist/transformers/msoPlaceholders.d.ts.map +1 -0
- package/dist/transformers/msoPlaceholders.js +89 -0
- package/dist/transformers/msoPlaceholders.js.map +1 -0
- package/dist/transformers/{purgeCSS.mjs → purgeCSS.js} +5 -5
- package/dist/transformers/purgeCSS.js.map +1 -0
- package/dist/transformers/{removeAttributes.mjs → removeAttributes.js} +3 -3
- package/dist/transformers/removeAttributes.js.map +1 -0
- package/dist/transformers/{replaceStrings.mjs → replaceStrings.js} +1 -1
- package/dist/transformers/replaceStrings.js.map +1 -0
- package/dist/transformers/{safeClassNames.mjs → safeClassNames.js} +3 -3
- package/dist/transformers/safeClassNames.js.map +1 -0
- package/dist/transformers/{shorthandCSS.mjs → shorthandCSS.js} +3 -3
- package/dist/transformers/shorthandCSS.js.map +1 -0
- package/dist/transformers/{sixHex.mjs → sixHex.js} +3 -3
- package/dist/transformers/sixHex.js.map +1 -0
- package/dist/transformers/{tailwindComponent.mjs → tailwindComponent.js} +4 -4
- package/dist/transformers/tailwindComponent.js.map +1 -0
- package/dist/transformers/{tailwindcss.mjs → tailwindcss.js} +5 -5
- package/dist/transformers/tailwindcss.js.map +1 -0
- package/dist/transformers/{urlQuery.mjs → urlQuery.js} +2 -2
- package/dist/transformers/urlQuery.js.map +1 -0
- package/dist/types/config.d.ts +43 -2
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/ast/index.js +5 -0
- package/dist/utils/ast/{parser.mjs → parser.js} +1 -1
- package/dist/utils/ast/parser.js.map +1 -0
- package/dist/utils/ast/{serializer.mjs → serializer.js} +2 -2
- package/dist/utils/ast/serializer.js.map +1 -0
- package/dist/utils/ast/{walker.mjs → walker.js} +1 -1
- package/dist/utils/ast/walker.js.map +1 -0
- package/dist/utils/{compileTailwindCss.mjs → compileTailwindCss.js} +7 -7
- package/dist/utils/compileTailwindCss.js.map +1 -0
- package/dist/utils/{decodeStyleEntities.mjs → decodeStyleEntities.js} +1 -1
- package/dist/utils/decodeStyleEntities.js.map +1 -0
- package/dist/utils/{detect.mjs → detect.js} +1 -1
- package/dist/utils/detect.js.map +1 -0
- package/dist/utils/{url.mjs → url.js} +1 -1
- package/dist/utils/url.js.map +1 -0
- package/node_modules/@clack/core/CHANGELOG.md +8 -0
- package/node_modules/@clack/core/dist/index.d.mts +18 -4
- package/node_modules/@clack/core/dist/index.mjs +16 -10
- package/node_modules/@clack/core/dist/index.mjs.map +1 -1
- package/node_modules/@clack/core/package.json +5 -2
- package/node_modules/@clack/prompts/CHANGELOG.md +15 -0
- package/node_modules/@clack/prompts/README.md +107 -2
- package/node_modules/@clack/prompts/dist/index.d.mts +16 -11
- package/node_modules/@clack/prompts/dist/index.mjs +114 -107
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
- package/node_modules/@clack/prompts/package.json +7 -4
- package/node_modules/fast-string-truncated-width/dist/index.js +36 -96
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +0 -3
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +3 -3
- package/node_modules/fast-string-truncated-width/dist/utils.js +14 -9
- package/node_modules/fast-string-truncated-width/package.json +1 -1
- package/node_modules/fast-string-truncated-width/readme.md +2 -3
- package/node_modules/fast-string-width/package.json +2 -2
- package/node_modules/fast-string-width/readme.md +0 -3
- package/node_modules/fast-wrap-ansi/lib/main.js +4 -1
- package/node_modules/fast-wrap-ansi/lib/main.js.map +1 -1
- package/node_modules/fast-wrap-ansi/package.json +2 -2
- package/node_modules/tinyexec/README.md +1 -1
- package/node_modules/tinyexec/dist/main.d.mts +6 -6
- package/node_modules/tinyexec/dist/main.mjs +126 -134
- package/node_modules/tinyexec/package.json +9 -9
- package/package.json +3 -3
- package/dist/build.mjs.map +0 -1
- package/dist/components/utils.mjs.map +0 -1
- package/dist/composables/defineConfig.mjs.map +0 -1
- package/dist/composables/renderContext.mjs.map +0 -1
- package/dist/composables/useConfig.mjs.map +0 -1
- package/dist/composables/useDoctype.mjs.map +0 -1
- package/dist/composables/useEvent.mjs.map +0 -1
- package/dist/composables/useFont.mjs.map +0 -1
- package/dist/composables/useOutlookFallback.mjs.map +0 -1
- package/dist/composables/usePlaintext.mjs.map +0 -1
- package/dist/composables/usePreheader.mjs.map +0 -1
- package/dist/config/defaults.mjs.map +0 -1
- package/dist/config/index.mjs.map +0 -1
- package/dist/events/index.mjs.map +0 -1
- package/dist/index.mjs +0 -34
- package/dist/plaintext.mjs.map +0 -1
- package/dist/plugin.mjs.map +0 -1
- package/dist/plugins/postcss/mergeMediaQueries.mjs.map +0 -1
- package/dist/plugins/postcss/pruneVars.mjs.map +0 -1
- package/dist/plugins/postcss/quoteFontFamilies.mjs.map +0 -1
- package/dist/plugins/postcss/removeDeclarations.mjs.map +0 -1
- package/dist/plugins/postcss/resolveMaizzleImports.mjs.map +0 -1
- package/dist/plugins/postcss/resolveProps.mjs.map +0 -1
- package/dist/plugins/postcss/tailwindCleanup.mjs.map +0 -1
- package/dist/prepare.mjs.map +0 -1
- package/dist/render/createRenderer.mjs.map +0 -1
- package/dist/render/index.mjs.map +0 -1
- package/dist/render/injectFonts.mjs.map +0 -1
- package/dist/render/plugins/codeBlockExtract.mjs.map +0 -1
- package/dist/render/plugins/markdownExtract.mjs.map +0 -1
- package/dist/render/plugins/rawExtract.mjs.map +0 -1
- package/dist/render/plugins/rowSourceLocation.mjs.map +0 -1
- package/dist/serve.mjs.map +0 -1
- package/dist/server/compatibility.mjs.map +0 -1
- package/dist/server/email.mjs.map +0 -1
- package/dist/server/linter.mjs.map +0 -1
- package/dist/server/sfc-utils.mjs.map +0 -1
- package/dist/transformers/addAttributes.mjs.map +0 -1
- package/dist/transformers/attributeToStyle.mjs.map +0 -1
- package/dist/transformers/base.mjs.map +0 -1
- package/dist/transformers/columnWidth.mjs.map +0 -1
- package/dist/transformers/entities.mjs.map +0 -1
- package/dist/transformers/filters/defaults.mjs.map +0 -1
- package/dist/transformers/filters/index.mjs.map +0 -1
- package/dist/transformers/format.mjs.map +0 -1
- package/dist/transformers/index.mjs +0 -87
- package/dist/transformers/index.mjs.map +0 -1
- package/dist/transformers/inlineCSS.mjs.map +0 -1
- package/dist/transformers/inlineLink.mjs.map +0 -1
- package/dist/transformers/minify.mjs.map +0 -1
- package/dist/transformers/msoWidthFromClass.d.ts +0 -19
- package/dist/transformers/msoWidthFromClass.d.ts.map +0 -1
- package/dist/transformers/msoWidthFromClass.mjs +0 -61
- package/dist/transformers/msoWidthFromClass.mjs.map +0 -1
- package/dist/transformers/purgeCSS.mjs.map +0 -1
- package/dist/transformers/removeAttributes.mjs.map +0 -1
- package/dist/transformers/replaceStrings.mjs.map +0 -1
- package/dist/transformers/safeClassNames.mjs.map +0 -1
- package/dist/transformers/shorthandCSS.mjs.map +0 -1
- package/dist/transformers/sixHex.mjs.map +0 -1
- package/dist/transformers/tailwindComponent.mjs.map +0 -1
- package/dist/transformers/tailwindcss.mjs.map +0 -1
- package/dist/transformers/urlQuery.mjs.map +0 -1
- package/dist/utils/ast/index.mjs +0 -5
- package/dist/utils/ast/parser.mjs.map +0 -1
- package/dist/utils/ast/serializer.mjs.map +0 -1
- package/dist/utils/ast/walker.mjs.map +0 -1
- package/dist/utils/compileTailwindCss.mjs.map +0 -1
- package/dist/utils/decodeStyleEntities.mjs.map +0 -1
- package/dist/utils/detect.mjs.map +0 -1
- package/dist/utils/url.mjs.map +0 -1
- /package/dist/components/{Divider.vue → Hr.vue} +0 -0
- /package/dist/types/{config.mjs → config.js} +0 -0
- /package/dist/types/{index.mjs → index.js} +0 -0
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { createRequire as e } from "node:module";
|
|
2
2
|
import { spawn as t, spawnSync as n } from "node:child_process";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { pipeline as
|
|
6
|
-
import { PassThrough as
|
|
7
|
-
import
|
|
3
|
+
import { cwd as r } from "node:process";
|
|
4
|
+
import { delimiter as i, dirname as a, resolve as o } from "node:path";
|
|
5
|
+
import { pipeline as s } from "node:stream/promises";
|
|
6
|
+
import { PassThrough as c } from "node:stream";
|
|
7
|
+
import l from "node:readline";
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var u = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
|
|
10
|
+
var d = /* @__PURE__ */ e(import.meta.url);
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/env.ts
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const f = /^path$/i;
|
|
14
|
+
const p = {
|
|
15
15
|
key: "PATH",
|
|
16
16
|
value: ""
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function m(e) {
|
|
19
19
|
for (const t in e) {
|
|
20
|
-
if (!Object.prototype.hasOwnProperty.call(e, t) || !
|
|
20
|
+
if (!Object.prototype.hasOwnProperty.call(e, t) || !f.test(t)) continue;
|
|
21
21
|
const n = e[t];
|
|
22
|
-
if (!n) return
|
|
22
|
+
if (!n) return p;
|
|
23
23
|
return {
|
|
24
24
|
key: t,
|
|
25
25
|
value: n
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return p;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
const n = t.value.split(
|
|
32
|
-
const
|
|
30
|
+
function h(e, t) {
|
|
31
|
+
const n = t.value.split(i);
|
|
32
|
+
const r = [];
|
|
33
33
|
let s = e;
|
|
34
34
|
let c;
|
|
35
35
|
do {
|
|
36
|
-
|
|
36
|
+
r.push(o(s, "node_modules", ".bin"));
|
|
37
37
|
c = s;
|
|
38
|
-
s =
|
|
38
|
+
s = a(s);
|
|
39
39
|
} while (s !== c);
|
|
40
|
-
|
|
41
|
-
const l =
|
|
40
|
+
r.push(a(process.execPath));
|
|
41
|
+
const l = r.concat(n).join(i);
|
|
42
42
|
return {
|
|
43
43
|
key: t.key,
|
|
44
44
|
value: l
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function g(e, t) {
|
|
48
48
|
const n = {
|
|
49
49
|
...process.env,
|
|
50
50
|
...t
|
|
51
51
|
};
|
|
52
|
-
const r =
|
|
52
|
+
const r = h(e, m(n));
|
|
53
53
|
n[r.key] = r.value;
|
|
54
54
|
return n;
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/stream.ts
|
|
58
|
-
const
|
|
58
|
+
const _ = (e) => {
|
|
59
59
|
let t = e.length;
|
|
60
|
-
const n = new
|
|
60
|
+
const n = new c();
|
|
61
61
|
const r = () => {
|
|
62
62
|
if (--t === 0) n.end();
|
|
63
63
|
};
|
|
64
|
-
for (const t of e)
|
|
64
|
+
for (const t of e) s(t, n, { end: false }).then(r).catch(r);
|
|
65
65
|
return n;
|
|
66
66
|
};
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region node_modules/isexe/windows.js
|
|
69
|
-
var
|
|
69
|
+
var v = /* @__PURE__ */ u(((e, t) => {
|
|
70
70
|
t.exports = a;
|
|
71
71
|
a.sync = o;
|
|
72
|
-
var n =
|
|
72
|
+
var n = d("fs");
|
|
73
73
|
function r(e, t) {
|
|
74
74
|
var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
|
|
75
75
|
if (!n) return true;
|
|
@@ -96,10 +96,10 @@ var y = /* @__PURE__ */ d(((e, t) => {
|
|
|
96
96
|
}));
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region node_modules/isexe/mode.js
|
|
99
|
-
var
|
|
99
|
+
var y = /* @__PURE__ */ u(((e, t) => {
|
|
100
100
|
t.exports = r;
|
|
101
101
|
r.sync = i;
|
|
102
|
-
var n =
|
|
102
|
+
var n = d("fs");
|
|
103
103
|
function r(e, t, r) {
|
|
104
104
|
n.stat(e, function(e, n) {
|
|
105
105
|
r(e, e ? false : a(n, t));
|
|
@@ -126,11 +126,11 @@ var b = /* @__PURE__ */ d(((e, t) => {
|
|
|
126
126
|
}));
|
|
127
127
|
//#endregion
|
|
128
128
|
//#region node_modules/isexe/index.js
|
|
129
|
-
var
|
|
130
|
-
|
|
129
|
+
var b = /* @__PURE__ */ u(((e, t) => {
|
|
130
|
+
d("fs");
|
|
131
131
|
var n;
|
|
132
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) n =
|
|
133
|
-
else n =
|
|
132
|
+
if (process.platform === "win32" || global.TESTING_WINDOWS) n = v();
|
|
133
|
+
else n = y();
|
|
134
134
|
t.exports = r;
|
|
135
135
|
r.sync = i;
|
|
136
136
|
function r(e, t, i) {
|
|
@@ -168,11 +168,11 @@ var x = /* @__PURE__ */ d(((e, t) => {
|
|
|
168
168
|
}));
|
|
169
169
|
//#endregion
|
|
170
170
|
//#region node_modules/which/which.js
|
|
171
|
-
var
|
|
171
|
+
var x = /* @__PURE__ */ u(((e, t) => {
|
|
172
172
|
const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
173
|
-
const r =
|
|
173
|
+
const r = d("path");
|
|
174
174
|
const i = n ? ";" : ":";
|
|
175
|
-
const a =
|
|
175
|
+
const a = b();
|
|
176
176
|
const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
|
|
177
177
|
const s = (e, t) => {
|
|
178
178
|
const r = t.colon || i;
|
|
@@ -240,7 +240,7 @@ var S = /* @__PURE__ */ d(((e, t) => {
|
|
|
240
240
|
}));
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region node_modules/path-key/index.js
|
|
243
|
-
var
|
|
243
|
+
var S = /* @__PURE__ */ u(((e, t) => {
|
|
244
244
|
const n = (e = {}) => {
|
|
245
245
|
const t = e.env || process.env;
|
|
246
246
|
if ((e.platform || process.platform) !== "win32") return "PATH";
|
|
@@ -251,10 +251,10 @@ var C = /* @__PURE__ */ d(((e, t) => {
|
|
|
251
251
|
}));
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
254
|
-
var
|
|
255
|
-
const n =
|
|
256
|
-
const r =
|
|
257
|
-
const i =
|
|
254
|
+
var C = /* @__PURE__ */ u(((e, t) => {
|
|
255
|
+
const n = d("path");
|
|
256
|
+
const r = x();
|
|
257
|
+
const i = S();
|
|
258
258
|
function a(e, t) {
|
|
259
259
|
const a = e.options.env || process.env;
|
|
260
260
|
const o = process.cwd();
|
|
@@ -282,7 +282,7 @@ var w = /* @__PURE__ */ d(((e, t) => {
|
|
|
282
282
|
}));
|
|
283
283
|
//#endregion
|
|
284
284
|
//#region node_modules/cross-spawn/lib/util/escape.js
|
|
285
|
-
var
|
|
285
|
+
var w = /* @__PURE__ */ u(((e, t) => {
|
|
286
286
|
const n = /([()\][%!^"`<>&|;, *?])/g;
|
|
287
287
|
function r(e) {
|
|
288
288
|
e = e.replace(n, "^$1");
|
|
@@ -302,13 +302,13 @@ var T = /* @__PURE__ */ d(((e, t) => {
|
|
|
302
302
|
}));
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region node_modules/shebang-regex/index.js
|
|
305
|
-
var
|
|
305
|
+
var T = /* @__PURE__ */ u(((e, t) => {
|
|
306
306
|
t.exports = /^#!(.*)/;
|
|
307
307
|
}));
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region node_modules/shebang-command/index.js
|
|
310
|
-
var
|
|
311
|
-
const n =
|
|
310
|
+
var E = /* @__PURE__ */ u(((e, t) => {
|
|
311
|
+
const n = T();
|
|
312
312
|
t.exports = (e = "") => {
|
|
313
313
|
const t = e.match(n);
|
|
314
314
|
if (!t) return null;
|
|
@@ -320,9 +320,9 @@ var D = /* @__PURE__ */ d(((e, t) => {
|
|
|
320
320
|
}));
|
|
321
321
|
//#endregion
|
|
322
322
|
//#region node_modules/cross-spawn/lib/util/readShebang.js
|
|
323
|
-
var
|
|
324
|
-
const n =
|
|
325
|
-
const r =
|
|
323
|
+
var D = /* @__PURE__ */ u(((e, t) => {
|
|
324
|
+
const n = d("fs");
|
|
325
|
+
const r = E();
|
|
326
326
|
function i(e) {
|
|
327
327
|
const t = 150;
|
|
328
328
|
const i = Buffer.alloc(t);
|
|
@@ -338,11 +338,11 @@ var O = /* @__PURE__ */ d(((e, t) => {
|
|
|
338
338
|
}));
|
|
339
339
|
//#endregion
|
|
340
340
|
//#region node_modules/cross-spawn/lib/parse.js
|
|
341
|
-
var
|
|
342
|
-
const n =
|
|
343
|
-
const r =
|
|
344
|
-
const i =
|
|
345
|
-
const a =
|
|
341
|
+
var O = /* @__PURE__ */ u(((e, t) => {
|
|
342
|
+
const n = d("path");
|
|
343
|
+
const r = C();
|
|
344
|
+
const i = w();
|
|
345
|
+
const a = D();
|
|
346
346
|
const o = process.platform === "win32";
|
|
347
347
|
const s = /\.(?:com|exe)$/i;
|
|
348
348
|
const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
@@ -376,7 +376,7 @@ var k = /* @__PURE__ */ d(((e, t) => {
|
|
|
376
376
|
}
|
|
377
377
|
return e;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function f(e, t, n) {
|
|
380
380
|
if (t && !Array.isArray(t)) {
|
|
381
381
|
n = t;
|
|
382
382
|
t = null;
|
|
@@ -395,11 +395,11 @@ var k = /* @__PURE__ */ d(((e, t) => {
|
|
|
395
395
|
};
|
|
396
396
|
return n.shell ? r : u(r);
|
|
397
397
|
}
|
|
398
|
-
t.exports =
|
|
398
|
+
t.exports = f;
|
|
399
399
|
}));
|
|
400
400
|
//#endregion
|
|
401
401
|
//#region node_modules/cross-spawn/lib/enoent.js
|
|
402
|
-
var
|
|
402
|
+
var k = /* @__PURE__ */ u(((e, t) => {
|
|
403
403
|
const n = process.platform === "win32";
|
|
404
404
|
function r(e, t) {
|
|
405
405
|
return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
|
|
@@ -438,10 +438,10 @@ var A = /* @__PURE__ */ d(((e, t) => {
|
|
|
438
438
|
}));
|
|
439
439
|
//#endregion
|
|
440
440
|
//#region node_modules/cross-spawn/index.js
|
|
441
|
-
var
|
|
442
|
-
const n =
|
|
443
|
-
const r =
|
|
444
|
-
const i =
|
|
441
|
+
var A = /* @__PURE__ */ u(((e, t) => {
|
|
442
|
+
const n = d("child_process");
|
|
443
|
+
const r = O();
|
|
444
|
+
const i = k();
|
|
445
445
|
function a(e, t, a) {
|
|
446
446
|
const o = r(e, t, a);
|
|
447
447
|
const s = n.spawn(o.command, o.args, o.options);
|
|
@@ -462,8 +462,8 @@ var j = /* @__PURE__ */ d(((e, t) => {
|
|
|
462
462
|
}));
|
|
463
463
|
//#endregion
|
|
464
464
|
//#region src/non-zero-exit-error.ts
|
|
465
|
-
var
|
|
466
|
-
var
|
|
465
|
+
var j = A();
|
|
466
|
+
var M = class extends Error {
|
|
467
467
|
get exitCode() {
|
|
468
468
|
if (this.result.exitCode !== null) return this.result.exitCode;
|
|
469
469
|
}
|
|
@@ -475,20 +475,14 @@ var N = class extends Error {
|
|
|
475
475
|
};
|
|
476
476
|
//#endregion
|
|
477
477
|
//#region src/main.ts
|
|
478
|
-
const
|
|
479
|
-
const
|
|
478
|
+
const N = /\r?\n/;
|
|
479
|
+
const P = {
|
|
480
480
|
timeout: void 0,
|
|
481
481
|
persist: false
|
|
482
482
|
};
|
|
483
|
-
const
|
|
484
|
-
const
|
|
485
|
-
function
|
|
486
|
-
return {
|
|
487
|
-
command: a(e),
|
|
488
|
-
args: t ?? []
|
|
489
|
-
};
|
|
490
|
-
}
|
|
491
|
-
function z(e) {
|
|
483
|
+
const F = { timeout: void 0 };
|
|
484
|
+
const I = { windowsHide: true };
|
|
485
|
+
function L(e) {
|
|
492
486
|
const t = new AbortController();
|
|
493
487
|
for (const n of e) {
|
|
494
488
|
if (n.aborted) {
|
|
@@ -502,14 +496,14 @@ function z(e) {
|
|
|
502
496
|
}
|
|
503
497
|
return t.signal;
|
|
504
498
|
}
|
|
505
|
-
async function
|
|
499
|
+
async function R(e) {
|
|
506
500
|
let t = "";
|
|
507
501
|
try {
|
|
508
502
|
for await (const n of e) t += n.toString();
|
|
509
503
|
} catch {}
|
|
510
504
|
return t;
|
|
511
505
|
}
|
|
512
|
-
var
|
|
506
|
+
var z = class {
|
|
513
507
|
_process;
|
|
514
508
|
_aborted = false;
|
|
515
509
|
_options;
|
|
@@ -529,7 +523,7 @@ var V = class {
|
|
|
529
523
|
}
|
|
530
524
|
constructor(e, t, n) {
|
|
531
525
|
this._options = {
|
|
532
|
-
...
|
|
526
|
+
...P,
|
|
533
527
|
...n
|
|
534
528
|
};
|
|
535
529
|
this._command = e;
|
|
@@ -548,7 +542,7 @@ var V = class {
|
|
|
548
542
|
return this._process?.killed === true;
|
|
549
543
|
}
|
|
550
544
|
pipe(e, t, n) {
|
|
551
|
-
return
|
|
545
|
+
return H(e, t, {
|
|
552
546
|
...n,
|
|
553
547
|
stdin: this
|
|
554
548
|
});
|
|
@@ -559,18 +553,18 @@ var V = class {
|
|
|
559
553
|
const t = [];
|
|
560
554
|
if (this._streamErr) t.push(this._streamErr);
|
|
561
555
|
if (this._streamOut) t.push(this._streamOut);
|
|
562
|
-
const n =
|
|
563
|
-
const r =
|
|
556
|
+
const n = _(t);
|
|
557
|
+
const r = l.createInterface({ input: n });
|
|
564
558
|
for await (const e of r) yield e.toString();
|
|
565
559
|
await this._processClosed;
|
|
566
560
|
e.removeAllListeners();
|
|
567
561
|
if (this._thrownError) throw this._thrownError;
|
|
568
|
-
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
562
|
+
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this);
|
|
569
563
|
}
|
|
570
564
|
async _waitForOutput() {
|
|
571
565
|
const e = this._process;
|
|
572
566
|
if (!e) throw new Error("No process was started");
|
|
573
|
-
const [t, n] = await Promise.all([this._streamOut ?
|
|
567
|
+
const [t, n] = await Promise.all([this._streamOut ? R(this._streamOut) : "", this._streamErr ? R(this._streamErr) : ""]);
|
|
574
568
|
await this._processClosed;
|
|
575
569
|
const { stdin: r } = this._options;
|
|
576
570
|
if (r && typeof r !== "string") await r;
|
|
@@ -581,7 +575,7 @@ var V = class {
|
|
|
581
575
|
stdout: t,
|
|
582
576
|
exitCode: this.exitCode
|
|
583
577
|
};
|
|
584
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
578
|
+
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this, i);
|
|
585
579
|
return i;
|
|
586
580
|
}
|
|
587
581
|
then(e, t) {
|
|
@@ -590,31 +584,30 @@ var V = class {
|
|
|
590
584
|
_streamOut;
|
|
591
585
|
_streamErr;
|
|
592
586
|
spawn() {
|
|
593
|
-
const e =
|
|
587
|
+
const e = r();
|
|
594
588
|
const n = this._options;
|
|
595
|
-
const
|
|
596
|
-
...
|
|
589
|
+
const i = {
|
|
590
|
+
...I,
|
|
597
591
|
...n.nodeOptions
|
|
598
592
|
};
|
|
599
|
-
const
|
|
593
|
+
const a = [];
|
|
600
594
|
this._resetState();
|
|
601
|
-
if (n.timeout !== void 0)
|
|
602
|
-
if (n.signal !== void 0)
|
|
603
|
-
if (n.persist === true)
|
|
604
|
-
if (
|
|
605
|
-
|
|
606
|
-
const
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
if (
|
|
610
|
-
|
|
611
|
-
this.
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
if (l.stdin) {
|
|
595
|
+
if (n.timeout !== void 0) a.push(AbortSignal.timeout(n.timeout));
|
|
596
|
+
if (n.signal !== void 0) a.push(n.signal);
|
|
597
|
+
if (n.persist === true) i.detached = true;
|
|
598
|
+
if (a.length > 0) i.signal = L(a);
|
|
599
|
+
i.env = g(e, i.env);
|
|
600
|
+
const o = (0, j._parse)(this._command, this._args, i);
|
|
601
|
+
const s = t(o.command, o.args, o.options);
|
|
602
|
+
if (s.stderr) this._streamErr = s.stderr;
|
|
603
|
+
if (s.stdout) this._streamOut = s.stdout;
|
|
604
|
+
this._process = s;
|
|
605
|
+
s.once("error", this._onError);
|
|
606
|
+
s.once("close", this._onClose);
|
|
607
|
+
if (s.stdin) {
|
|
615
608
|
const { stdin: e } = n;
|
|
616
|
-
if (typeof e === "string")
|
|
617
|
-
else e?.process?.stdout?.pipe(
|
|
609
|
+
if (typeof e === "string") s.stdin.end(e);
|
|
610
|
+
else e?.process?.stdout?.pipe(s.stdin);
|
|
618
611
|
}
|
|
619
612
|
}
|
|
620
613
|
_resetState() {
|
|
@@ -635,56 +628,55 @@ var V = class {
|
|
|
635
628
|
if (this._resolveClose) this._resolveClose();
|
|
636
629
|
};
|
|
637
630
|
};
|
|
638
|
-
function
|
|
639
|
-
const
|
|
640
|
-
...
|
|
641
|
-
...
|
|
631
|
+
function B(e, t, i) {
|
|
632
|
+
const a = {
|
|
633
|
+
...F,
|
|
634
|
+
...i
|
|
642
635
|
};
|
|
643
|
-
const
|
|
644
|
-
const
|
|
636
|
+
const o = r();
|
|
637
|
+
const s = {
|
|
645
638
|
windowsHide: true,
|
|
646
|
-
...
|
|
639
|
+
...a.nodeOptions
|
|
647
640
|
};
|
|
648
|
-
if (
|
|
649
|
-
|
|
650
|
-
const
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
const
|
|
656
|
-
const
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
stderr: p,
|
|
641
|
+
if (a.timeout !== void 0) s.timeout = a.timeout;
|
|
642
|
+
s.env = g(o, s.env);
|
|
643
|
+
const c = (0, j._parse)(e, t ?? [], s);
|
|
644
|
+
const l = n(c.command, c.args, c.options);
|
|
645
|
+
if (l.error) throw l.error;
|
|
646
|
+
const u = l.stdout?.toString() ?? "";
|
|
647
|
+
const d = l.stderr?.toString() ?? "";
|
|
648
|
+
const f = l.status ?? void 0;
|
|
649
|
+
const p = l.signal != null;
|
|
650
|
+
const m = {
|
|
651
|
+
stdout: u,
|
|
652
|
+
stderr: d,
|
|
661
653
|
get exitCode() {
|
|
662
|
-
return
|
|
654
|
+
return f;
|
|
663
655
|
},
|
|
664
656
|
get pid() {
|
|
665
|
-
return
|
|
657
|
+
return l.pid;
|
|
666
658
|
},
|
|
667
659
|
get killed() {
|
|
668
|
-
return
|
|
660
|
+
return p;
|
|
669
661
|
},
|
|
670
662
|
*[Symbol.iterator]() {
|
|
671
|
-
for (const e of [
|
|
663
|
+
for (const e of [u, d]) {
|
|
672
664
|
if (!e) continue;
|
|
673
|
-
const t = e.split(
|
|
665
|
+
const t = e.split(N);
|
|
674
666
|
if (t[t.length - 1] === "") t.pop();
|
|
675
667
|
yield* t;
|
|
676
668
|
}
|
|
677
669
|
}
|
|
678
670
|
};
|
|
679
|
-
if (
|
|
680
|
-
return
|
|
671
|
+
if (a.throwOnError && f !== 0 && f !== void 0) throw new M(m, m);
|
|
672
|
+
return m;
|
|
681
673
|
}
|
|
682
|
-
const
|
|
683
|
-
const r = new
|
|
674
|
+
const V = (e, t, n) => {
|
|
675
|
+
const r = new z(e, t, n);
|
|
684
676
|
r.spawn();
|
|
685
677
|
return r;
|
|
686
678
|
};
|
|
687
|
-
const
|
|
688
|
-
const
|
|
679
|
+
const H = V;
|
|
680
|
+
const U = B;
|
|
689
681
|
//#endregion
|
|
690
|
-
export {
|
|
682
|
+
export { z as ExecProcess, M as NonZeroExitError, H as exec, U as execSync, V as x, B as xSync };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinyexec",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A minimal library for executing processes in Node",
|
|
6
6
|
"main": "./dist/main.mjs",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@eslint/js": "^10.0.1",
|
|
42
42
|
"@types/cross-spawn": "^6.0.6",
|
|
43
|
-
"@types/node": "^25.
|
|
44
|
-
"@vitest/coverage-v8": "^4.1.
|
|
43
|
+
"@types/node": "^25.6.0",
|
|
44
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
45
45
|
"cross-spawn": "^7.0.6",
|
|
46
|
-
"eslint": "^10.2.
|
|
47
|
-
"prettier": "^3.8.
|
|
46
|
+
"eslint": "^10.2.1",
|
|
47
|
+
"prettier": "^3.8.3",
|
|
48
48
|
"publint": "^0.3.18",
|
|
49
|
-
"rollup-plugin-license": "^3.7.
|
|
50
|
-
"tsdown": "^0.21.
|
|
51
|
-
"typescript": "^6.0.
|
|
52
|
-
"typescript-eslint": "^8.
|
|
49
|
+
"rollup-plugin-license": "^3.7.1",
|
|
50
|
+
"tsdown": "^0.21.10",
|
|
51
|
+
"typescript": "^6.0.3",
|
|
52
|
+
"typescript-eslint": "^8.59.1",
|
|
53
53
|
"vitest": "^4.0.7"
|
|
54
54
|
},
|
|
55
55
|
"exports": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maizzle/framework",
|
|
3
|
-
"version": "6.0.0-rc.
|
|
3
|
+
"version": "6.0.0-rc.18",
|
|
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",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"import": "./dist/index.
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
13
|
"types": "./dist/index.d.ts"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"@tailwindcss/vite": "^4.2.2",
|
|
39
39
|
"@unhead/vue": "^3.0.4",
|
|
40
40
|
"@vitejs/plugin-vue": "^6.0.4",
|
|
41
|
-
"@vitest/coverage-v8": "^4.0.18",
|
|
42
41
|
"@vueuse/core": "^14.2.1",
|
|
43
42
|
"class-variance-authority": "^0.7.1",
|
|
44
43
|
"clsx": "^2.1.1",
|
|
@@ -89,6 +88,7 @@
|
|
|
89
88
|
"@types/node": "^25.2.3",
|
|
90
89
|
"@types/nodemailer": "^8.0.0",
|
|
91
90
|
"@types/postcss-safe-parser": "^5.0.4",
|
|
91
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
92
92
|
"@vue/test-utils": "^2.4.6",
|
|
93
93
|
"happy-dom": "^20.6.3",
|
|
94
94
|
"oxlint": "^1.50.0",
|
package/dist/build.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.mjs","names":[],"sources":["../src/build.ts"],"sourcesContent":["import { readFileSync, writeFileSync, mkdirSync, cpSync, existsSync, rmSync } from 'node:fs'\nimport { resolve, dirname, basename, relative, join } from 'node:path'\nimport { glob } from 'tinyglobby'\nimport ora from 'ora'\nimport { resolveConfig } from './config/index.ts'\nimport { EventManager } from './events/index.ts'\nimport { runTransformers } from './transformers/index.ts'\nimport { createRenderer } from './render/createRenderer.ts'\nimport { createPlaintext } from './plaintext.ts'\nimport type { MaizzleConfig } from './types/index.ts'\n\nexport interface BuildOptions {\n config?: Partial<MaizzleConfig> | string\n}\n\nexport interface BuildResult {\n files: string[]\n config: MaizzleConfig\n}\n\n/**\n * Build all SFC email templates to HTML files.\n *\n * Creates a single Renderer instance, then loops through each template\n * calling render → transformers → write to disk.\n */\nexport async function build(options: BuildOptions = {}): Promise<BuildResult> {\n const start = Date.now()\n const spinner = ora({ text: 'Building templates...', spinner: 'circleHalves' }).start()\n\n const config = await resolveConfig(options.config)\n\n const events = new EventManager()\n events.registerConfig(config)\n await events.fireBeforeCreate({ config })\n\n const outputPath = resolve(config.output?.path ?? 'dist')\n const outputExtension = config.output?.extension ?? 'html'\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const contentBase = computeContentBase(contentPatterns)\n const templateFiles = await glob(contentPatterns)\n\n if (templateFiles.length === 0) {\n spinner.succeed('No templates found')\n return { files: [], config }\n }\n\n // Clear the output directory before writing fresh output\n if (existsSync(outputPath)) {\n rmSync(outputPath, { recursive: true, force: true })\n }\n\n const renderer = await createRenderer({ markdown: config.markdown, root: config.root, componentDirs: [config.components?.source ?? []].flat(), vite: config.vite })\n const outputFiles: string[] = []\n\n try {\n for (const templatePath of templateFiles) {\n const absolutePath = resolve(templatePath)\n let template = readFileSync(absolutePath, 'utf-8')\n\n template = await events.fireBeforeRender({ config, template })\n\n const rendered = await renderer.render(absolutePath, config)\n\n let html = await events.fireAfterRender({ config, template, html: rendered.html })\n\n // Use the per-template merged config (from defineConfig() in the SFC) so that\n // template-level overrides like css.safe: false are respected by transformers.\n const templateConfig = rendered.templateConfig\n\n const doctype = rendered.doctype ?? templateConfig.doctype ?? '<!DOCTYPE html>'\n\n if (templateConfig.useTransformers !== false) {\n html = await runTransformers(html, templateConfig, absolutePath, doctype, rendered.tailwindBlocks)\n }\n\n html = await events.fireAfterTransform({ config, template, html })\n html = `${doctype}\\n${html}`\n\n const outputFilePath = resolveOutputPath(templatePath, outputPath, outputExtension, contentBase)\n mkdirSync(dirname(outputFilePath), { recursive: true })\n writeFileSync(outputFilePath, html)\n outputFiles.push(outputFilePath)\n\n // Generate plaintext version if configured\n const globalPlaintext = templateConfig.plaintext\n const sfcPlaintext = rendered.plaintext\n\n if (globalPlaintext || sfcPlaintext) {\n const stripOptions = typeof globalPlaintext === 'object' ? globalPlaintext : {}\n const plaintext = createPlaintext(html, stripOptions)\n const ptExtension = sfcPlaintext?.extension ?? 'txt'\n\n let ptOutputPath: string\n\n if (sfcPlaintext?.destination) {\n const name = basename(templatePath).replace(/\\.(vue|md)$/, '')\n ptOutputPath = join(resolve(sfcPlaintext.destination), `${name}.${ptExtension}`)\n } else if (typeof globalPlaintext === 'string') {\n ptOutputPath = resolveOutputPath(templatePath, resolve(globalPlaintext), ptExtension, contentBase)\n } else {\n ptOutputPath = resolveOutputPath(templatePath, outputPath, ptExtension, contentBase)\n }\n\n mkdirSync(dirname(ptOutputPath), { recursive: true })\n writeFileSync(ptOutputPath, plaintext)\n }\n\n // Register SFC event handlers that were collected during render\n for (const { name, handler } of rendered.sfcEventHandlers) {\n events.on(name, handler)\n }\n\n events.clearSfcHandlers()\n }\n\n await copyStatic(config, outputPath)\n await events.fireAfterBuild({ files: outputFiles, config })\n } finally {\n await renderer.close()\n }\n\n const duration = ((Date.now() - start) / 1000).toFixed(2)\n const count = outputFiles.length\n spinner.stopAndPersist({\n symbol: '✅',\n text: `Built ${count} template${count !== 1 ? 's' : ''} in ${duration}s`,\n })\n\n return { files: outputFiles, config }\n}\n\n/**\n * Extract the static (non-glob) prefix from content patterns.\n *\n * For example, `['/abs/path/emails/**\\/*.vue']` → `'/abs/path/emails'`\n *\n * This is used to strip the content base from template paths\n * so the output preserves only the subdirectory structure.\n */\nfunction computeContentBase(patterns: string[]): string {\n // Use the first non-negated pattern\n const pattern = patterns.find(p => !p.startsWith('!')) ?? patterns[0]\n\n // Split on first glob character (* { ? [) and take the directory part\n const staticPart = pattern.split(/[*{?[]/)[0]\n\n // Ensure we have a clean directory path (not a partial segment)\n return resolve(staticPart.endsWith('/') ? staticPart : dirname(staticPart))\n}\n\nfunction resolveOutputPath(templatePath: string, outputDir: string, extension: string, contentBase: string): string {\n const name = basename(templatePath).replace(/\\.(vue|md)$/, '')\n const absTemplate = resolve(templatePath)\n const rel = relative(contentBase, dirname(absTemplate))\n\n return join(outputDir, rel, `${name}.${extension}`)\n}\n\nasync function copyStatic(config: MaizzleConfig, outputPath: string): Promise<void> {\n const sources = config.static?.source ?? ['public/**/*.*']\n const destination = config.static?.destination ?? 'public'\n\n const files = await glob(sources)\n\n for (const file of files) {\n const destPath = join(outputPath, destination, relative(dirname(sources[0]).replace(/\\*.*$/, ''), file))\n const destDir = dirname(destPath)\n\n if (!existsSync(destDir)) {\n mkdirSync(destDir, { recursive: true })\n }\n\n cpSync(file, destPath)\n }\n}\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/components/utils.ts"],"sourcesContent":["export function normalizeToPixels(value: string | number): string {\n if (typeof value === 'number' || Number.isFinite(Number(value))) {\n return `${value}px`\n }\n return value\n}\n\nconst counters: Record<string, number> = {}\n\n/**\n * Module-scoped sequential ID generator. Used by components to mint\n * unique marker ids (e.g. `c1`, `c2`) for the post-render transformer.\n *\n * Must live here (not inside `<script setup>`) because Vue compiles\n * `<script setup>` into the component's `setup()` function — any\n * `let counter = 0` there resets per instance, causing id collisions.\n */\nexport function nextId(prefix: string): string {\n counters[prefix] = (counters[prefix] ?? 0) + 1\n return `${prefix}${counters[prefix]}`\n}\n\nexport function hasWidthUtility(classStr: string): boolean {\n return classStr.split(/\\s+/).some((c) => {\n const utility = c.split(':').pop() ?? ''\n const clean = utility.replace(/^!/, '')\n return /^(w-|max-w-|min-w-)/.test(clean)\n })\n}\n\nexport function hasWidthInStyle(styleStr: string): boolean {\n return /(?:^|;\\s*)(?:max-width|width)\\s*:/i.test(styleStr)\n}\n\nexport function hasHeightUtility(classStr: string): boolean {\n return classStr.split(/\\s+/).some((c) => {\n const utility = c.split(':').pop() ?? ''\n const clean = utility.replace(/^!/, '')\n return /^(h-|max-h-|min-h-)/.test(clean)\n })\n}\n\nexport function hasHeightInStyle(styleStr: string): boolean {\n return /(?:^|;\\s*)(?:max-height|height)\\s*:/i.test(styleStr)\n}\n\n/**\n * Shared prop for components that emit MSO/VML fallback markup. The\n * `null` default acts as the \"unset\" sentinel — `useOutlookFallback`\n * treats `null` as inherit-from-ancestor (root default `true`),\n * letting users override per-component without losing inheritance.\n */\nexport const outlookFallbackProp = {\n type: Boolean,\n default: null,\n} as const\n\n"],"mappings":";AAAA,SAAgB,kBAAkB,OAAgC;AAChE,KAAI,OAAO,UAAU,YAAY,OAAO,SAAS,OAAO,MAAM,CAAC,CAC7D,QAAO,GAAG,MAAM;AAElB,QAAO;;AAGT,MAAM,WAAmC,EAAE;;;;;;;;;AAU3C,SAAgB,OAAO,QAAwB;AAC7C,UAAS,WAAW,SAAS,WAAW,KAAK;AAC7C,QAAO,GAAG,SAAS,SAAS;;AAG9B,SAAgB,gBAAgB,UAA2B;AACzD,QAAO,SAAS,MAAM,MAAM,CAAC,MAAM,MAAM;EAEvC,MAAM,SADU,EAAE,MAAM,IAAI,CAAC,KAAK,IAAI,IAChB,QAAQ,MAAM,GAAG;AACvC,SAAO,sBAAsB,KAAK,MAAM;GACxC;;AAGJ,SAAgB,gBAAgB,UAA2B;AACzD,QAAO,qCAAqC,KAAK,SAAS;;AAG5D,SAAgB,iBAAiB,UAA2B;AAC1D,QAAO,SAAS,MAAM,MAAM,CAAC,MAAM,MAAM;EAEvC,MAAM,SADU,EAAE,MAAM,IAAI,CAAC,KAAK,IAAI,IAChB,QAAQ,MAAM,GAAG;AACvC,SAAO,sBAAsB,KAAK,MAAM;GACxC;;AAGJ,SAAgB,iBAAiB,UAA2B;AAC1D,QAAO,uCAAuC,KAAK,SAAS;;;;;;;;AAS9D,MAAa,sBAAsB;CACjC,MAAM;CACN,SAAS;CACV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defineConfig.mjs","names":[],"sources":["../../src/composables/defineConfig.ts"],"sourcesContent":["import { getCurrentInstance, inject, provide } from 'vue'\nimport { createDefu } from 'defu'\nimport { MaizzleConfigKey } from './useConfig.ts'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nconst merge = createDefu((obj, key, value) => {\n if (Array.isArray(obj[key])) {\n obj[key] = value\n return true\n }\n})\n\n/**\n * Define Maizzle config.\n *\n * Works in both contexts:\n * - In maizzle.config.ts: typed identity function, returns the config as-is\n * - In Vue SFC <script setup>: merges with the global config and provides\n * the result to child components via useConfig()\n */\nexport function defineConfig(data: Partial<MaizzleConfig> = {}): MaizzleConfig {\n // Inside a Vue SFC — merge with global config and provide to children\n if (getCurrentInstance()) {\n const globalConfig = inject(MaizzleConfigKey, {} as MaizzleConfig)\n const merged = merge(data, globalConfig) as MaizzleConfig\n\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.sfcConfig = merged\n\n provide(MaizzleConfigKey, merged)\n\n return merged\n }\n\n // Outside Vue (maizzle.config.ts) — just return the config\n return data as MaizzleConfig\n}\n"],"mappings":";;;;;;AAMA,MAAM,QAAQ,YAAY,KAAK,KAAK,UAAU;AAC5C,KAAI,MAAM,QAAQ,IAAI,KAAK,EAAE;AAC3B,MAAI,OAAO;AACX,SAAO;;EAET;;;;;;;;;AAUF,SAAgB,aAAa,OAA+B,EAAE,EAAiB;AAE7E,KAAI,oBAAoB,EAAE;EAExB,MAAM,SAAS,MAAM,MADA,OAAO,kBAAkB,EAAE,CAAkB,CAC1B;EAExC,MAAM,MAAM,OAAO,iBAAiB;AACpC,MAAI,IAAK,KAAI,YAAY;AAEzB,UAAQ,kBAAkB,OAAO;AAEjC,SAAO;;AAIT,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderContext.mjs","names":[],"sources":["../../src/composables/renderContext.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { MaizzleConfig } from '../types/index.ts'\nimport type { EventName, EventMap } from '../events/index.ts'\nimport type { UsePlaintextOptions } from './usePlaintext.ts'\n\nexport interface FontRegistration {\n family: string\n slug: string\n declaration: string\n url: string\n}\n\nexport interface TailwindBlock {\n id: string\n /** Optional raw CSS from the component's `#config` slot. */\n css?: string\n}\n\nexport interface RenderContext {\n doctype?: string\n preheader?: { text: string; fillerCount: number; shyCount: number }\n sfcConfig?: MaizzleConfig\n sfcEventHandlers: Array<{ name: EventName; handler: EventMap[EventName] }>\n plaintext?: UsePlaintextOptions\n fonts?: FontRegistration[]\n tailwindBlocks?: TailwindBlock[]\n}\n\nexport const RenderContextKey: InjectionKey<RenderContext> = Symbol('RenderContext')\n"],"mappings":";AA4BA,MAAa,mBAAgD,OAAO,gBAAgB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useConfig.mjs","names":[],"sources":["../../src/composables/useConfig.ts"],"sourcesContent":["import { inject } from 'vue'\nimport type { InjectionKey } from 'vue'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport const MaizzleConfigKey: InjectionKey<MaizzleConfig> = Symbol('MaizzleConfig')\n\nexport function useConfig(): MaizzleConfig {\n const config = inject(MaizzleConfigKey)\n\n if (!config) {\n throw new Error('useConfig() requires the Maizzle plugin to provide config. Make sure you are using it inside a Maizzle template.')\n }\n\n return config\n}\n"],"mappings":";;;AAIA,MAAa,mBAAgD,OAAO,gBAAgB;AAEpF,SAAgB,YAA2B;CACzC,MAAM,SAAS,OAAO,iBAAiB;AAEvC,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,mHAAmH;AAGrI,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDoctype.mjs","names":[],"sources":["../../src/composables/useDoctype.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\n/**\n * Set the doctype for the current email template.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useDoctype('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">')\n * ```\n */\nexport function useDoctype(doctype: string): void {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.doctype = doctype\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,WAAW,SAAuB;CAChD,MAAM,MAAM,OAAO,iBAAiB;AACpC,KAAI,IAAK,KAAI,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEvent.mjs","names":[],"sources":["../../src/composables/useEvent.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\nimport type { EventName, EventMap } from '../events/index.ts'\n\n/**\n * Register an event handler from within an SFC's <script setup>.\n *\n * Usage:\n * ```ts\n * useEvent('beforeRender', ({ config, template }) => {\n * return template.replace('foo', 'bar')\n * })\n * ```\n */\nexport function useEvent<K extends EventName>(name: K, handler: EventMap[K]) {\n const ctx = inject(RenderContextKey)\n if (ctx) ctx.sfcEventHandlers.push({ name, handler })\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,SAAgB,SAA8B,MAAS,SAAsB;CAC3E,MAAM,MAAM,OAAO,iBAAiB;AACpC,KAAI,IAAK,KAAI,iBAAiB,KAAK;EAAE;EAAM;EAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFont.mjs","names":[],"sources":["../../src/composables/useFont.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { RenderContextKey } from './renderContext.ts'\n\ntype FontCategory = 'sans' | 'serif' | 'mono' | 'display' | 'handwriting'\n\nconst FAMILY_CATEGORIES: Record<string, FontCategory> = {\n // Sans-serif\n 'Roboto': 'sans',\n 'Open Sans': 'sans',\n 'Inter': 'sans',\n 'Lato': 'sans',\n 'Montserrat': 'sans',\n // Serif\n 'Merriweather': 'serif',\n 'Playfair Display': 'serif',\n 'Lora': 'serif',\n 'PT Serif': 'serif',\n 'Noto Serif': 'serif',\n // Display\n 'Oswald': 'display',\n 'Bebas Neue': 'display',\n 'Anton': 'display',\n 'Lobster': 'display',\n 'Pacifico': 'display',\n // Handwriting\n 'Dancing Script': 'handwriting',\n 'Caveat': 'handwriting',\n 'Shadows Into Light': 'handwriting',\n 'Satisfy': 'handwriting',\n 'Great Vibes': 'handwriting',\n // Monospace\n 'Roboto Mono': 'mono',\n 'Source Code Pro': 'mono',\n 'JetBrains Mono': 'mono',\n 'Fira Code': 'mono',\n 'Inconsolata': 'mono',\n}\n\nconst DEFAULT_FALLBACKS: Record<FontCategory, string> = {\n sans: 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif',\n serif: 'ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif',\n mono: 'ui-monospace, Menlo, Consolas, monospace',\n display: 'Impact, \"Arial Black\", system-ui, sans-serif',\n handwriting: '\"Segoe Script\", \"Brush Script MT\", cursive',\n}\n\nexport type FontProvider = 'google' | 'bunny'\n\nexport interface UseFontOptions {\n /**\n * A single font family name, e.g. `\"Roboto\"` or `\"Open Sans\"`.\n *\n * For fallback fonts, use the `fallback` option instead of a\n * comma-separated list here.\n */\n family: string\n /** CSS fallback list appended to the `font-family` declaration. */\n fallback?: string\n /**\n * Font provider used to build the stylesheet URL when `url` is omitted.\n * Bunny Fonts is a drop-in, privacy-friendly Google Fonts mirror.\n * @default 'google'\n */\n provider?: FontProvider\n /**\n * Stylesheet URL. When provided, used as-is for the `<link href>`.\n * When omitted, a URL is built from `provider`, `family`, `weights`,\n * `display` and `styles`.\n */\n url?: string\n /** Font weights to load. Ignored when `url` is provided. */\n weights?: number[]\n /** `font-display` value. Ignored when `url` is provided. */\n display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional'\n /** Font styles to load. Ignored when `url` is provided. */\n styles?: Array<'normal' | 'italic'>\n}\n\nconst PROVIDER_BASE_URL: Record<FontProvider, string> = {\n google: 'https://fonts.googleapis.com/css2',\n bunny: 'https://fonts.bunny.net/css2',\n}\n\nfunction slugify(family: string): string {\n return family\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9-]/g, '')\n}\n\nfunction buildProviderUrl(opts: Required<Omit<UseFontOptions, 'url' | 'fallback'>>): string {\n const familyParam = opts.family.trim().replace(/\\s+/g, '+')\n const weights = [...opts.weights].sort((a, b) => a - b)\n const hasItalic = opts.styles.includes('italic')\n const hasNormal = opts.styles.includes('normal')\n\n const axis = hasItalic\n ? `:ital,wght@${weights.flatMap(w => [\n ...(hasNormal ? [`0,${w}`] : []),\n `1,${w}`,\n ]).join(';')}`\n : `:wght@${weights.join(';')}`\n\n return `${PROVIDER_BASE_URL[opts.provider]}?family=${familyParam}${axis}&display=${opts.display}`\n}\n\n/**\n * Register a font for the current email template.\n *\n * Builds a Google Fonts stylesheet URL from `family`/`weights`/`display`/`styles`\n * (or uses `url` as-is). The renderer injects a `<link>` tag into `<head>`\n * and merges `--font-{slug}` declarations into the template's existing\n * `@import \"tailwindcss\"` style block so a `font-{slug}` utility class\n * is generated. If no Tailwind import is found, falls back to a `:root`\n * declaration so the CSS variable is still available.\n *\n * Usage in SFC <script setup>:\n * ```ts\n * useFont({ family: 'Roboto', fallback: 'Verdana, sans-serif', weights: [400, 600] })\n * ```\n */\nexport function useFont(options: UseFontOptions): void {\n const ctx = inject(RenderContextKey)\n if (!ctx) return\n\n ctx.fonts = ctx.fonts ?? []\n if (ctx.fonts.some(f => f.family === options.family)) return\n\n const url = options.url ?? buildProviderUrl({\n family: options.family,\n provider: options.provider ?? 'google',\n weights: options.weights ?? [400],\n display: options.display ?? 'swap',\n styles: options.styles ?? ['normal'],\n })\n\n const fallback = options.fallback\n ?? DEFAULT_FALLBACKS[FAMILY_CATEGORIES[options.family] ?? 'sans']\n const quoted = /\\s/.test(options.family) ? `\"${options.family}\"` : options.family\n const declaration = `${quoted}, ${fallback}`\n\n ctx.fonts.push({\n family: options.family,\n slug: slugify(options.family),\n declaration,\n url,\n })\n}\n"],"mappings":";;;;AAKA,MAAM,oBAAkD;CAEtD,UAAU;CACV,aAAa;CACb,SAAS;CACT,QAAQ;CACR,cAAc;CAEd,gBAAgB;CAChB,oBAAoB;CACpB,QAAQ;CACR,YAAY;CACZ,cAAc;CAEd,UAAU;CACV,cAAc;CACd,SAAS;CACT,WAAW;CACX,YAAY;CAEZ,kBAAkB;CAClB,UAAU;CACV,sBAAsB;CACtB,WAAW;CACX,eAAe;CAEf,eAAe;CACf,mBAAmB;CACnB,kBAAkB;CAClB,aAAa;CACb,eAAe;CAChB;AAED,MAAM,oBAAkD;CACtD,MAAM;CACN,OAAO;CACP,MAAM;CACN,SAAS;CACT,aAAa;CACd;AAkCD,MAAM,oBAAkD;CACtD,QAAQ;CACR,OAAO;CACR;AAED,SAAS,QAAQ,QAAwB;AACvC,QAAO,OACJ,MAAM,CACN,aAAa,CACb,QAAQ,QAAQ,IAAI,CACpB,QAAQ,eAAe,GAAG;;AAG/B,SAAS,iBAAiB,MAAkE;CAC1F,MAAM,cAAc,KAAK,OAAO,MAAM,CAAC,QAAQ,QAAQ,IAAI;CAC3D,MAAM,UAAU,CAAC,GAAG,KAAK,QAAQ,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE;CACvD,MAAM,YAAY,KAAK,OAAO,SAAS,SAAS;CAChD,MAAM,YAAY,KAAK,OAAO,SAAS,SAAS;CAEhD,MAAM,OAAO,YACT,cAAc,QAAQ,SAAQ,MAAK,CACjC,GAAI,YAAY,CAAC,KAAK,IAAI,GAAG,EAAE,EAC/B,KAAK,IACN,CAAC,CAAC,KAAK,IAAI,KACZ,SAAS,QAAQ,KAAK,IAAI;AAE9B,QAAO,GAAG,kBAAkB,KAAK,UAAU,UAAU,cAAc,KAAK,WAAW,KAAK;;;;;;;;;;;;;;;;;AAkB1F,SAAgB,QAAQ,SAA+B;CACrD,MAAM,MAAM,OAAO,iBAAiB;AACpC,KAAI,CAAC,IAAK;AAEV,KAAI,QAAQ,IAAI,SAAS,EAAE;AAC3B,KAAI,IAAI,MAAM,MAAK,MAAK,EAAE,WAAW,QAAQ,OAAO,CAAE;CAEtD,MAAM,MAAM,QAAQ,OAAO,iBAAiB;EAC1C,QAAQ,QAAQ;EAChB,UAAU,QAAQ,YAAY;EAC9B,SAAS,QAAQ,WAAW,CAAC,IAAI;EACjC,SAAS,QAAQ,WAAW;EAC5B,QAAQ,QAAQ,UAAU,CAAC,SAAS;EACrC,CAAC;CAEF,MAAM,WAAW,QAAQ,YACpB,kBAAkB,kBAAkB,QAAQ,WAAW;CAE5D,MAAM,cAAc,GADL,KAAK,KAAK,QAAQ,OAAO,GAAG,IAAI,QAAQ,OAAO,KAAK,QAAQ,OAC7C,IAAI;AAElC,KAAI,MAAM,KAAK;EACb,QAAQ,QAAQ;EAChB,MAAM,QAAQ,QAAQ,OAAO;EAC7B;EACA;EACD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOutlookFallback.mjs","names":[],"sources":["../../src/composables/useOutlookFallback.ts"],"sourcesContent":["import { inject, provide, type InjectionKey } from 'vue'\n\nconst OutlookFallbackKey: InjectionKey<boolean> = Symbol('OutlookFallback')\n\n/**\n * Toggle whether descendants emit Outlook (MSO) and VML fallback markup.\n *\n * Call once in a Layout/template's `<script setup>` to disable for the\n * whole tree:\n * `useOutlookFallback(false)`\n *\n * Components inheriting `false` skip MSO ghost tables, VML rectangles,\n * `xmlns:v`/`xmlns:o`, mso-specific CSS, and Button's `<Outlook>`\n * spacers. Each MSO-aware component still accepts an `outlook-fallback`\n * prop that overrides inheritance for its subtree.\n *\n * @param value Pass `true`/`false` to set; omit to just read the\n * inherited value (defaults to `true` at the root).\n * @returns The resolved boolean for the current component.\n */\nexport function useOutlookFallback(value?: boolean | null): boolean {\n const inherited = inject(OutlookFallbackKey, true)\n const enabled = value == null ? inherited : value\n provide(OutlookFallbackKey, enabled)\n return enabled\n}\n"],"mappings":";;;AAEA,MAAM,qBAA4C,OAAO,kBAAkB;;;;;;;;;;;;;;;;;AAkB3E,SAAgB,mBAAmB,OAAiC;CAClE,MAAM,YAAY,OAAO,oBAAoB,KAAK;CAClD,MAAM,UAAU,SAAS,OAAO,YAAY;AAC5C,SAAQ,oBAAoB,QAAQ;AACpC,QAAO"}
|