nuxt-email-renderer 0.0.1
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/README.md +84 -0
- package/dist/chunks/build.mjs +705 -0
- package/dist/client/200.html +1 -0
- package/dist/client/404.html +1 -0
- package/dist/client/_nuxt/3R9sgenR.js +1 -0
- package/dist/client/_nuxt/5UMTGv3q.js +1 -0
- package/dist/client/_nuxt/BJ_ZNVwW.js +57 -0
- package/dist/client/_nuxt/BQq6TDT9.js +1 -0
- package/dist/client/_nuxt/BaEALuhw.js +1 -0
- package/dist/client/_nuxt/BpPBU6U6.js +1 -0
- package/dist/client/_nuxt/C-EM3RPC.js +1 -0
- package/dist/client/_nuxt/CAkrHwjs.js +1 -0
- package/dist/client/_nuxt/CLam8HLD.js +13 -0
- package/dist/client/_nuxt/CWC_D6I8.js +1 -0
- package/dist/client/_nuxt/CWrUPQXK.js +1 -0
- package/dist/client/_nuxt/ChBHSR31.js +1 -0
- package/dist/client/_nuxt/CjpBjtYD.js +1 -0
- package/dist/client/_nuxt/ClYUVDjM.js +1 -0
- package/dist/client/_nuxt/Coq9dpCu.js +1 -0
- package/dist/client/_nuxt/Ct-qVDJL.js +1 -0
- package/dist/client/_nuxt/DGBet86w.js +1 -0
- package/dist/client/_nuxt/D_dyXden.js +1 -0
- package/dist/client/_nuxt/DfWNeV2h.js +1 -0
- package/dist/client/_nuxt/GBsDgIkm.js +1 -0
- package/dist/client/_nuxt/ImWtXt63.js +10 -0
- package/dist/client/_nuxt/YAsWV_SB.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -0
- package/dist/client/_nuxt/builds/meta/b874db0a-5b15-4361-9e12-b85e9c2f73e6.json +1 -0
- package/dist/client/_nuxt/entry.uVMzXFrc.css +1 -0
- package/dist/client/_nuxt/error-404.BzYUYoct.css +1 -0
- package/dist/client/_nuxt/error-500.CZg0BYA4.css +1 -0
- package/dist/client/_nuxt/fDag-OJT.js +51 -0
- package/dist/client/index.html +1 -0
- package/dist/module.d.mts +15 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +192 -0
- package/dist/runtime/components/body/EBody.vue +43 -0
- package/dist/runtime/components/body/EBody.vue.d.ts +21 -0
- package/dist/runtime/components/body/__snapshots__/Ebody.test.ts.snap +3 -0
- package/dist/runtime/components/button/EButton.vue +75 -0
- package/dist/runtime/components/button/EButton.vue.d.ts +3 -0
- package/dist/runtime/components/button/__snapshots__/EButton.test.ts.snap +9 -0
- package/dist/runtime/components/button/utils/parse-padding.d.ts +24 -0
- package/dist/runtime/components/button/utils/parse-padding.js +83 -0
- package/dist/runtime/components/button/utils/px-to-pt.d.ts +1 -0
- package/dist/runtime/components/button/utils/px-to-pt.js +1 -0
- package/dist/runtime/components/code-block/ECodeBlock.vue +99 -0
- package/dist/runtime/components/code-block/ECodeBlock.vue.d.ts +78 -0
- package/dist/runtime/components/code-inline/ECodeInline.vue +42 -0
- package/dist/runtime/components/code-inline/ECodeInline.vue.d.ts +23 -0
- package/dist/runtime/components/column/EColumn.vue +18 -0
- package/dist/runtime/components/column/EColumn.vue.d.ts +4 -0
- package/dist/runtime/components/column/__snapshots__/EColumn.test.ts.snap +3 -0
- package/dist/runtime/components/container/EContainer.vue +25 -0
- package/dist/runtime/components/container/EContainer.vue.d.ts +3 -0
- package/dist/runtime/components/container/__snapshots__/EContainer.test.ts.snap +3 -0
- package/dist/runtime/components/font/EFont.vue +50 -0
- package/dist/runtime/components/font/EFont.vue.d.ts +65 -0
- package/dist/runtime/components/font/__snapshots__/EFont.test.ts.snap +33 -0
- package/dist/runtime/components/head/EHead.vue +16 -0
- package/dist/runtime/components/head/EHead.vue.d.ts +4 -0
- package/dist/runtime/components/head/__snapshots__/EHead.test.ts.snap +8 -0
- package/dist/runtime/components/heading/EHeading.utils.d.ts +14 -0
- package/dist/runtime/components/heading/EHeading.utils.js +23 -0
- package/dist/runtime/components/heading/EHeading.vue +74 -0
- package/dist/runtime/components/heading/EHeading.vue.d.ts +89 -0
- package/dist/runtime/components/heading/__snapshots__/EHeading.test.ts.snap +3 -0
- package/dist/runtime/components/hr/EHr.vue +14 -0
- package/dist/runtime/components/hr/EHr.vue.d.ts +4 -0
- package/dist/runtime/components/hr/__snapshots__/EHr.test.ts.snap +3 -0
- package/dist/runtime/components/html/EHtml.vue +29 -0
- package/dist/runtime/components/html/EHtml.vue.d.ts +26 -0
- package/dist/runtime/components/html/__snapshots__/EHtml.test.ts.snap +3 -0
- package/dist/runtime/components/img/EImg.vue +37 -0
- package/dist/runtime/components/img/EImg.vue.d.ts +39 -0
- package/dist/runtime/components/index.d.ts +38 -0
- package/dist/runtime/components/index.js +38 -0
- package/dist/runtime/components/link/ELink.vue +30 -0
- package/dist/runtime/components/link/ELink.vue.d.ts +24 -0
- package/dist/runtime/components/link/__snapshots__/ELink.test.ts.snap +3 -0
- package/dist/runtime/components/preview/EPreview.vue +41 -0
- package/dist/runtime/components/preview/EPreview.vue.d.ts +7 -0
- package/dist/runtime/components/preview/__snapshots__/EPreview.test.ts.snap +5 -0
- package/dist/runtime/components/row/ERow.vue +31 -0
- package/dist/runtime/components/row/ERow.vue.d.ts +4 -0
- package/dist/runtime/components/section/ESection.vue +23 -0
- package/dist/runtime/components/section/ESection.vue.d.ts +4 -0
- package/dist/runtime/components/style/EStyle.vue +18 -0
- package/dist/runtime/components/style/EStyle.vue.d.ts +4 -0
- package/dist/runtime/components/text/EText.vue +22 -0
- package/dist/runtime/components/text/EText.vue.d.ts +4 -0
- package/dist/runtime/server/api/emails/list.get.d.ts +2 -0
- package/dist/runtime/server/api/emails/list.get.js +19 -0
- package/dist/runtime/server/api/emails/render.get.d.ts +2 -0
- package/dist/runtime/server/api/emails/render.get.js +47 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/cleanup.d.ts +1 -0
- package/dist/runtime/server/utils/cleanup.js +5 -0
- package/dist/runtime/server/utils/options.d.ts +15 -0
- package/dist/runtime/server/utils/options.js +0 -0
- package/dist/runtime/server/utils/plainTextSelectors.d.ts +2 -0
- package/dist/runtime/server/utils/plainTextSelectors.js +8 -0
- package/dist/runtime/server/utils/pretty.d.ts +1 -0
- package/dist/runtime/server/utils/pretty.js +11 -0
- package/dist/runtime/server/utils/render.d.ts +14 -0
- package/dist/runtime/server/utils/render.js +30 -0
- package/dist/types.d.mts +3 -0
- package/package.json +70 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export const ECodeInline = defineComponent({
|
|
4
|
+
name: "ECodeInline",
|
|
5
|
+
props: {
|
|
6
|
+
class: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
style: {
|
|
11
|
+
type: Object
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(props, { slots }) {
|
|
15
|
+
return () => [h("style", null, `
|
|
16
|
+
meta ~ .cino {
|
|
17
|
+
display: none !important;
|
|
18
|
+
opacity: 0 !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
meta ~ .cio {
|
|
22
|
+
display: block !important;
|
|
23
|
+
}
|
|
24
|
+
`), h("code", {
|
|
25
|
+
...props,
|
|
26
|
+
class: [
|
|
27
|
+
props.class,
|
|
28
|
+
"cino"
|
|
29
|
+
],
|
|
30
|
+
style: props.style
|
|
31
|
+
}, slots.default?.()), h("span", {
|
|
32
|
+
...props,
|
|
33
|
+
class: [
|
|
34
|
+
props.class,
|
|
35
|
+
"cio"
|
|
36
|
+
],
|
|
37
|
+
style: { ...props.style, display: "none" }
|
|
38
|
+
}, slots.default?.())];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export default ECodeInline;
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue';
|
|
2
|
+
export declare const ECodeInline: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
3
|
+
class: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
style: {
|
|
8
|
+
type: PropType<CSSProperties>;
|
|
9
|
+
};
|
|
10
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>[], {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
13
|
+
class: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
style: {
|
|
18
|
+
type: PropType<CSSProperties>;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{}>, {
|
|
21
|
+
class: string;
|
|
22
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
export default ECodeInline;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export const EColumn = defineComponent({
|
|
4
|
+
name: "EColumn",
|
|
5
|
+
setup(_, { slots }) {
|
|
6
|
+
return () => {
|
|
7
|
+
return h(
|
|
8
|
+
"td",
|
|
9
|
+
{
|
|
10
|
+
role: "presentation"
|
|
11
|
+
},
|
|
12
|
+
slots.default?.()
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export default EColumn;
|
|
18
|
+
</script>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const EColumn: import("@vue/runtime-core").DefineComponent<{}, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export default EColumn;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`<EColumn> component > renders correctly 1`] = `"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><td role="presentation">Lorem ipsum</td>"`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export const EContainer = defineComponent({
|
|
4
|
+
name: "EContainer",
|
|
5
|
+
setup(props, { slots }) {
|
|
6
|
+
return () => h(
|
|
7
|
+
"table",
|
|
8
|
+
{
|
|
9
|
+
align: "center",
|
|
10
|
+
width: "100%",
|
|
11
|
+
role: "presentation",
|
|
12
|
+
cellspacing: "0",
|
|
13
|
+
cellpadding: "0",
|
|
14
|
+
border: "0",
|
|
15
|
+
style: {
|
|
16
|
+
"max-width": "37.5em",
|
|
17
|
+
...props.style
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
[h("tbody", [h("tr", { style: "width: 100%" }, [h("td", {}, slots.default?.())])])]
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export default EContainer;
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TableHTMLAttributes } from 'vue';
|
|
2
|
+
export declare const EContainer: import("@vue/runtime-core").DefineComponent<TableHTMLAttributes, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<TableHTMLAttributes> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
export default EContainer;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`<EContainer> component > renders correctly 1`] = `"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><table align="center" width="100%" role="presentation" cellspacing="0" cellpadding="0" border="0" style="max-width:37.5em;"><tbody><tr style="width: 100%"><td>Lorem ipsum</td></tr></tbody></table>"`;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export const EFont = defineComponent({
|
|
4
|
+
name: "EFont",
|
|
5
|
+
props: {
|
|
6
|
+
fontFamily: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
fallbackFontFamily: {
|
|
11
|
+
type: [String, Array],
|
|
12
|
+
default: "Arial"
|
|
13
|
+
},
|
|
14
|
+
webFont: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
fontStyle: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "normal"
|
|
21
|
+
},
|
|
22
|
+
fontWeight: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
default: 400
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup({ fontFamily, fallbackFontFamily, webFont, fontStyle, fontWeight }) {
|
|
28
|
+
const src = webFont ? `src: url(${webFont.url}) format('${webFont.format}');` : "";
|
|
29
|
+
const style = `
|
|
30
|
+
@font-face {
|
|
31
|
+
font-family: '${fontFamily}';
|
|
32
|
+
font-style: ${fontStyle};
|
|
33
|
+
font-weight: ${fontWeight};
|
|
34
|
+
mso-font-alt: '${Array.isArray(fallbackFontFamily) ? fallbackFontFamily[0] : fallbackFontFamily}';
|
|
35
|
+
${src}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
* {
|
|
39
|
+
font-family: '${fontFamily}', ${Array.isArray(fallbackFontFamily) ? fallbackFontFamily.join(", ") : fallbackFontFamily};
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
return () => {
|
|
43
|
+
return h("style", {
|
|
44
|
+
innerHTML: style
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export default EFont;
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
type FallbackFont = 'Arial' | 'Helvetica' | 'Verdana' | 'Georgia' | 'Times New Roman' | 'serif' | 'sans-serif' | 'monospace' | 'cursive' | 'fantasy';
|
|
3
|
+
type FontFormat = 'woff' | 'woff2' | 'truetype' | 'opentype' | 'embedded-opentype' | 'svg';
|
|
4
|
+
type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number;
|
|
5
|
+
type FontStyle = 'normal' | 'italic' | 'oblique';
|
|
6
|
+
export declare const EFont: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
7
|
+
fontFamily: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
fallbackFontFamily: {
|
|
12
|
+
type: PropType<FallbackFont | FallbackFont[]>;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
webFont: {
|
|
16
|
+
type: PropType<{
|
|
17
|
+
url: string;
|
|
18
|
+
format: FontFormat;
|
|
19
|
+
}>;
|
|
20
|
+
default: undefined;
|
|
21
|
+
};
|
|
22
|
+
fontStyle: {
|
|
23
|
+
type: PropType<FontStyle>;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
fontWeight: {
|
|
27
|
+
type: PropType<FontWeight>;
|
|
28
|
+
default: number;
|
|
29
|
+
};
|
|
30
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
33
|
+
fontFamily: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
fallbackFontFamily: {
|
|
38
|
+
type: PropType<FallbackFont | FallbackFont[]>;
|
|
39
|
+
default: string;
|
|
40
|
+
};
|
|
41
|
+
webFont: {
|
|
42
|
+
type: PropType<{
|
|
43
|
+
url: string;
|
|
44
|
+
format: FontFormat;
|
|
45
|
+
}>;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
fontStyle: {
|
|
49
|
+
type: PropType<FontStyle>;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
fontWeight: {
|
|
53
|
+
type: PropType<FontWeight>;
|
|
54
|
+
default: number;
|
|
55
|
+
};
|
|
56
|
+
}>> & Readonly<{}>, {
|
|
57
|
+
fontStyle: FontStyle;
|
|
58
|
+
fontWeight: FontWeight;
|
|
59
|
+
fallbackFontFamily: FallbackFont | FallbackFont[];
|
|
60
|
+
webFont: {
|
|
61
|
+
url: string;
|
|
62
|
+
format: FontFormat;
|
|
63
|
+
};
|
|
64
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
65
|
+
export default EFont;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`<EFont> component > renders correctly 1`] = `
|
|
4
|
+
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><style>
|
|
5
|
+
@font-face {
|
|
6
|
+
font-family: 'Roboto';
|
|
7
|
+
font-style: normal;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
mso-font-alt: 'Verdana';
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
* {
|
|
14
|
+
font-family: 'Roboto', Verdana;
|
|
15
|
+
}
|
|
16
|
+
</style>"
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
exports[`<EFont> component > renders with webFont prop 1`] = `
|
|
20
|
+
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><style>
|
|
21
|
+
@font-face {
|
|
22
|
+
font-family: 'Arial';
|
|
23
|
+
font-style: normal;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
mso-font-alt: 'Helvetica';
|
|
26
|
+
src: url(example.com/font.woff) format('woff');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
* {
|
|
30
|
+
font-family: 'Arial', Helvetica;
|
|
31
|
+
}
|
|
32
|
+
</style>"
|
|
33
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export const EHead = defineComponent({
|
|
4
|
+
name: "EHead",
|
|
5
|
+
setup(_, { slots }) {
|
|
6
|
+
return () => {
|
|
7
|
+
return h("head", [
|
|
8
|
+
h("meta", { httpEquiv: "Content-Type", content: "text/html; charset=UTF-8" }),
|
|
9
|
+
h("meta", { name: "x-apple-disable-message-reformatting" }),
|
|
10
|
+
slots.default?.()
|
|
11
|
+
]);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default EHead;
|
|
16
|
+
</script>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const EHead: import("@vue/runtime-core").DefineComponent<{}, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export default EHead;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`<EHead> component > renders correctly 1`] = `"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="x-apple-disable-message-reformatting">Lorem ipsum</head>"`;
|
|
4
|
+
|
|
5
|
+
exports[`<EHead> component > renders style tags 1`] = `
|
|
6
|
+
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><head style="body{
|
|
7
|
+
color:red;"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="x-apple-disable-message-reformatting"></head>"
|
|
8
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
type MarginCSSProperty = CSSProperties['margin' | 'marginLeft' | 'marginRight' | 'marginTop' | 'marginBottom'];
|
|
3
|
+
export interface Margin {
|
|
4
|
+
m?: number | string;
|
|
5
|
+
mx?: number | string;
|
|
6
|
+
my?: number | string;
|
|
7
|
+
mt?: number | string;
|
|
8
|
+
mr?: number | string;
|
|
9
|
+
mb?: number | string;
|
|
10
|
+
ml?: number | string;
|
|
11
|
+
}
|
|
12
|
+
export declare const withMargin: (props: Margin) => {};
|
|
13
|
+
export declare const withSpace: (value: number | string | undefined, properties: MarginCSSProperty[]) => {};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const withMargin = (props) => {
|
|
2
|
+
const nonEmptyStyles = [
|
|
3
|
+
withSpace(props.m, ["margin"]),
|
|
4
|
+
withSpace(props.mx, ["marginLeft", "marginRight"]),
|
|
5
|
+
withSpace(props.my, ["marginTop", "marginBottom"]),
|
|
6
|
+
withSpace(props.mt, ["marginTop"]),
|
|
7
|
+
withSpace(props.mr, ["marginRight"]),
|
|
8
|
+
withSpace(props.mb, ["marginBottom"]),
|
|
9
|
+
withSpace(props.ml, ["marginLeft"])
|
|
10
|
+
].filter((s) => Object.keys(s).length);
|
|
11
|
+
const mergedStyles = nonEmptyStyles.reduce((acc, style) => {
|
|
12
|
+
return { ...acc, ...style };
|
|
13
|
+
}, {});
|
|
14
|
+
return mergedStyles;
|
|
15
|
+
};
|
|
16
|
+
export const withSpace = (value, properties) => {
|
|
17
|
+
return properties.reduce((styles, property) => {
|
|
18
|
+
if (!Number.isNaN(Number.parseFloat(value))) {
|
|
19
|
+
return { ...styles, [property]: `${value}px` };
|
|
20
|
+
}
|
|
21
|
+
return styles;
|
|
22
|
+
}, {});
|
|
23
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { computed, defineComponent, h } from "vue";
|
|
3
|
+
import { withMargin } from "./EHeading.utils";
|
|
4
|
+
export const EHeading = defineComponent({
|
|
5
|
+
name: "EHeading",
|
|
6
|
+
props: {
|
|
7
|
+
as: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "h1"
|
|
10
|
+
},
|
|
11
|
+
m: {
|
|
12
|
+
type: [String, Number],
|
|
13
|
+
default: void 0
|
|
14
|
+
},
|
|
15
|
+
mx: {
|
|
16
|
+
type: [String, Number],
|
|
17
|
+
default: void 0
|
|
18
|
+
},
|
|
19
|
+
my: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
mt: {
|
|
24
|
+
type: [String, Number],
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
mr: {
|
|
28
|
+
type: [String, Number],
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
mb: {
|
|
32
|
+
type: [String, Number],
|
|
33
|
+
default: void 0
|
|
34
|
+
},
|
|
35
|
+
ml: {
|
|
36
|
+
type: [String, Number],
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
style: {
|
|
40
|
+
type: [Object, String],
|
|
41
|
+
default: void 0
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
setup(props, { slots }) {
|
|
45
|
+
const styleObject = computed(() => {
|
|
46
|
+
if (typeof props.style === "string" || Array.isArray(props.style)) {
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
return props.style;
|
|
50
|
+
});
|
|
51
|
+
return () => {
|
|
52
|
+
return h(
|
|
53
|
+
props.as,
|
|
54
|
+
{
|
|
55
|
+
style: {
|
|
56
|
+
...withMargin({
|
|
57
|
+
m: props.m,
|
|
58
|
+
mx: props.mx,
|
|
59
|
+
my: props.my,
|
|
60
|
+
mt: props.mt,
|
|
61
|
+
mr: props.mr,
|
|
62
|
+
mb: props.mb,
|
|
63
|
+
ml: props.ml
|
|
64
|
+
}),
|
|
65
|
+
...styleObject.value
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
slots.default?.()
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export default EHeading;
|
|
74
|
+
</script>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue';
|
|
2
|
+
export declare const EHeading: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
3
|
+
as: {
|
|
4
|
+
type: PropType<"h1" | "h2" | "h3" | "h4" | "h5" | "h6">;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
m: {
|
|
8
|
+
type: PropType<string | number>;
|
|
9
|
+
default: undefined;
|
|
10
|
+
};
|
|
11
|
+
mx: {
|
|
12
|
+
type: PropType<string | number>;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
15
|
+
my: {
|
|
16
|
+
type: PropType<string | number>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
mt: {
|
|
20
|
+
type: PropType<string | number>;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
mr: {
|
|
24
|
+
type: PropType<string | number>;
|
|
25
|
+
default: undefined;
|
|
26
|
+
};
|
|
27
|
+
mb: {
|
|
28
|
+
type: PropType<string | number>;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
31
|
+
ml: {
|
|
32
|
+
type: PropType<string | number>;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
style: {
|
|
36
|
+
type: PropType<CSSProperties | string>;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
42
|
+
as: {
|
|
43
|
+
type: PropType<"h1" | "h2" | "h3" | "h4" | "h5" | "h6">;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
m: {
|
|
47
|
+
type: PropType<string | number>;
|
|
48
|
+
default: undefined;
|
|
49
|
+
};
|
|
50
|
+
mx: {
|
|
51
|
+
type: PropType<string | number>;
|
|
52
|
+
default: undefined;
|
|
53
|
+
};
|
|
54
|
+
my: {
|
|
55
|
+
type: PropType<string | number>;
|
|
56
|
+
default: undefined;
|
|
57
|
+
};
|
|
58
|
+
mt: {
|
|
59
|
+
type: PropType<string | number>;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
mr: {
|
|
63
|
+
type: PropType<string | number>;
|
|
64
|
+
default: undefined;
|
|
65
|
+
};
|
|
66
|
+
mb: {
|
|
67
|
+
type: PropType<string | number>;
|
|
68
|
+
default: undefined;
|
|
69
|
+
};
|
|
70
|
+
ml: {
|
|
71
|
+
type: PropType<string | number>;
|
|
72
|
+
default: undefined;
|
|
73
|
+
};
|
|
74
|
+
style: {
|
|
75
|
+
type: PropType<CSSProperties | string>;
|
|
76
|
+
default: undefined;
|
|
77
|
+
};
|
|
78
|
+
}>> & Readonly<{}>, {
|
|
79
|
+
style: string | CSSProperties;
|
|
80
|
+
as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
81
|
+
m: string | number;
|
|
82
|
+
mx: string | number;
|
|
83
|
+
my: string | number;
|
|
84
|
+
mt: string | number;
|
|
85
|
+
mr: string | number;
|
|
86
|
+
mb: string | number;
|
|
87
|
+
ml: string | number;
|
|
88
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
89
|
+
export default EHeading;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`<EHeading> component > renders the <EHeading> component 1`] = `"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><h2 style="margin-left:4px;margin-right:4px;">Lorem ipsum</h2>"`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export const EHr = defineComponent({
|
|
4
|
+
name: "EHr",
|
|
5
|
+
setup() {
|
|
6
|
+
return () => {
|
|
7
|
+
return h("hr", {
|
|
8
|
+
style: "width: 100%; border: none; border-top: 1px solid #eaeaea;"
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export default EHr;
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const EHr: import("@vue/runtime-core").DefineComponent<{}, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export default EHr;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`<EHr> component > renders correctly 1`] = `"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><hr style="width: 100%; border: none; border-top: 1px solid #eaeaea;">"`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
export const EHtml = defineComponent({
|
|
4
|
+
name: "EHtml",
|
|
5
|
+
props: {
|
|
6
|
+
lang: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "en"
|
|
9
|
+
},
|
|
10
|
+
dir: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "ltr"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(props, { slots }) {
|
|
16
|
+
return () => {
|
|
17
|
+
return h(
|
|
18
|
+
"html",
|
|
19
|
+
{
|
|
20
|
+
lang: props.lang,
|
|
21
|
+
dir: props.dir
|
|
22
|
+
},
|
|
23
|
+
slots.default?.()
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export default EHtml;
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
export declare const EHtml: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
3
|
+
lang: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
dir: {
|
|
8
|
+
type: PropType<"ltr" | "rtl" | "auto">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
14
|
+
lang: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
dir: {
|
|
19
|
+
type: PropType<"ltr" | "rtl" | "auto">;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {
|
|
23
|
+
dir: "auto" | "ltr" | "rtl";
|
|
24
|
+
lang: string;
|
|
25
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
export default EHtml;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`<EHtml> component > renders correctly 1`] = `"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" dir="ltr">Lorem ipsum</html>"`;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent, h, ref } from "vue";
|
|
3
|
+
export const EImg = defineComponent({
|
|
4
|
+
name: "EImg",
|
|
5
|
+
props: {
|
|
6
|
+
src: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
width: {
|
|
11
|
+
type: [String, Number],
|
|
12
|
+
required: false
|
|
13
|
+
},
|
|
14
|
+
height: {
|
|
15
|
+
type: [String, Number],
|
|
16
|
+
required: false
|
|
17
|
+
},
|
|
18
|
+
alt: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(props) {
|
|
24
|
+
const src = ref(props.src);
|
|
25
|
+
return () => {
|
|
26
|
+
return h("img", {
|
|
27
|
+
style: "display: block; outline: none; border: none; text-decoration: none",
|
|
28
|
+
src: src.value,
|
|
29
|
+
width: props.width,
|
|
30
|
+
height: props.height,
|
|
31
|
+
alt: props.alt
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export default EImg;
|
|
37
|
+
</script>
|