@monkedevlife/solidjs-email-code-inline 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Monke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ import { Component, JSX } from "solid-js";
2
+
3
+ //#region src/code-inline.d.ts
4
+ type RootProps = JSX.HTMLAttributes<HTMLElement> & JSX.HTMLAttributes<HTMLSpanElement>;
5
+ type CodeInlineProps = Readonly<RootProps>;
6
+ declare const CodeInline: Component<CodeInlineProps>;
7
+ //#endregion
8
+ export { CodeInline, type CodeInlineProps };
9
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/code-inline.tsx"],"sourcesContent":[],"mappings":";;;KAGK,SAAA,GAAY,GAAA,CAAI,eAAe,eAAe,GAAA,CAAI,eAAe;KAE1D,eAAA,GAAkB,SAAS;AAFlC,cAIQ,UAJC,EAIW,SAJX,CAIqB,eAJrB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { Component, JSX } from "solid-js";
2
+
3
+ //#region src/code-inline.d.ts
4
+ type RootProps = JSX.HTMLAttributes<HTMLElement> & JSX.HTMLAttributes<HTMLSpanElement>;
5
+ type CodeInlineProps = Readonly<RootProps>;
6
+ declare const CodeInline: Component<CodeInlineProps>;
7
+ //#endregion
8
+ export { CodeInline, type CodeInlineProps };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/code-inline.tsx"],"sourcesContent":[],"mappings":";;;KAGK,SAAA,GAAY,GAAA,CAAI,eAAe,eAAe,GAAA,CAAI,eAAe;KAE1D,eAAA,GAAkB,SAAS;AAFlC,cAIQ,UAJC,EAIW,SAJX,CAIqB,eAJrB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,59 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+ const solid_js = __toESM(require("solid-js"));
25
+ const solid_js_jsx_runtime = __toESM(require("solid-js/jsx-runtime"));
26
+
27
+ //#region src/code-inline.tsx
28
+ const CodeInline = (props) => {
29
+ const [local, others] = (0, solid_js.splitProps)(props, ["children", "class"]);
30
+ return /* @__PURE__ */ (0, solid_js_jsx_runtime.jsxs)(solid_js_jsx_runtime.Fragment, { children: [
31
+ /* @__PURE__ */ (0, solid_js_jsx_runtime.jsx)("style", { children: `
32
+ meta ~ .cino {
33
+ display: none !important;
34
+ opacity: 0 !important;
35
+ }
36
+
37
+ meta ~ .cio {
38
+ display: block !important;
39
+ }
40
+ ` }),
41
+ /* @__PURE__ */ (0, solid_js_jsx_runtime.jsx)("code", {
42
+ ...others,
43
+ class: `${local.class ? local.class : ""} cino`.trim(),
44
+ children: local.children
45
+ }),
46
+ /* @__PURE__ */ (0, solid_js_jsx_runtime.jsx)("span", {
47
+ ...others,
48
+ class: `${local.class ? local.class : ""} cio`.trim(),
49
+ style: {
50
+ display: "none",
51
+ ...others.style
52
+ },
53
+ children: local.children
54
+ })
55
+ ] });
56
+ };
57
+
58
+ //#endregion
59
+ exports.CodeInline = CodeInline;
package/dist/index.mjs ADDED
@@ -0,0 +1,37 @@
1
+ import { splitProps } from "solid-js";
2
+ import { Fragment, jsx, jsxs } from "solid-js/jsx-runtime";
3
+
4
+ //#region src/code-inline.tsx
5
+ const CodeInline = (props) => {
6
+ const [local, others] = splitProps(props, ["children", "class"]);
7
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
8
+ /* @__PURE__ */ jsx("style", { children: `
9
+ meta ~ .cino {
10
+ display: none !important;
11
+ opacity: 0 !important;
12
+ }
13
+
14
+ meta ~ .cio {
15
+ display: block !important;
16
+ }
17
+ ` }),
18
+ /* @__PURE__ */ jsx("code", {
19
+ ...others,
20
+ class: `${local.class ? local.class : ""} cino`.trim(),
21
+ children: local.children
22
+ }),
23
+ /* @__PURE__ */ jsx("span", {
24
+ ...others,
25
+ class: `${local.class ? local.class : ""} cio`.trim(),
26
+ style: {
27
+ display: "none",
28
+ ...others.style
29
+ },
30
+ children: local.children
31
+ })
32
+ ] });
33
+ };
34
+
35
+ //#endregion
36
+ export { CodeInline };
37
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["CodeInline: Component<CodeInlineProps>"],"sources":["../src/code-inline.tsx"],"sourcesContent":["import type { Component, JSX } from 'solid-js';\nimport { splitProps } from 'solid-js';\n\ntype RootProps = JSX.HTMLAttributes<HTMLElement> & JSX.HTMLAttributes<HTMLSpanElement>;\n\nexport type CodeInlineProps = Readonly<RootProps>;\n\nexport const CodeInline: Component<CodeInlineProps> = (props) => {\n const [local, others] = splitProps(props, ['children', 'class']);\n\n return (\n <>\n {/* \n This style tag is targeted at fixing an issue for the Orange.fr email client\n See:\n - https://www.caniemail.com/features/html-code/\n - https://www.howtotarget.email/#2019-03-26-freenet-2\n\n On that email client, the head and html elements are removed, making the meta tag a sibling of them\n allowing us to use a selector on them. Also <style> tags are supported on it.\n */}\n <style>{`\n meta ~ .cino {\n display: none !important;\n opacity: 0 !important;\n }\n\n meta ~ .cio {\n display: block !important;\n }\n `}</style>\n\n {/* Does not render on Orange.fr */}\n <code\n {...others}\n class={`${local.class ? local.class : ''} cino`.trim()}\n >\n {local.children}\n </code>\n\n {/* Renders only on Orange.fr */}\n <span\n {...others}\n class={`${local.class ? local.class : ''} cio`.trim()}\n style={{ display: 'none', ...others.style as JSX.CSSProperties }}\n >\n {local.children}\n </span>\n </>\n );\n};\n"],"mappings":";;;;AAOA,MAAaA,aAAyC,CAAC,UAAU;CAC/D,MAAM,CAAC,OAAO,OAAO,GAAG,WAAW,OAAO,CAAC,YAAY,OAAQ,EAAC;AAEhE,wBACE;kBAUE,IAAC,sBAAQ;;;;;;;;;UASC;kBAGV,IAAC;GACC,GAAI;GACJ,OAAO,CAAC,EAAE,MAAM,QAAQ,MAAM,QAAQ,GAAG,OAAO,MAAM;aAErD,MAAM;IACF;kBAGP,IAAC;GACC,GAAI;GACJ,OAAO,CAAC,EAAE,MAAM,QAAQ,MAAM,QAAQ,GAAG,MAAM,MAAM;GACrD,OAAO;IAAE,SAAS;IAAQ,GAAG,OAAO;GAA4B;aAE/D,MAAM;IACF;KACN;AAEN"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@monkedevlife/solidjs-email-code-inline",
3
+ "version": "0.0.1",
4
+ "description": "Inline code component for SolidJS email templates",
5
+ "sideEffects": false,
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist/**"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.mjs"
17
+ },
18
+ "require": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/index.js"
21
+ }
22
+ }
23
+ },
24
+ "license": "MIT",
25
+ "keywords": [
26
+ "solidjs",
27
+ "email"
28
+ ],
29
+ "engines": {
30
+ "node": ">=20.0.0"
31
+ },
32
+ "peerDependencies": {
33
+ "solid-js": "^1.9.0"
34
+ },
35
+ "devDependencies": {
36
+ "solid-js": "^1.9.0",
37
+ "typescript": "^5.8.0",
38
+ "vitest": "^4.0.0",
39
+ "@monkedevlife/solidjs-email-render": "0.0.1"
40
+ },
41
+ "author": "monkedevlife",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/monkedevlife/solidjs-email.git",
45
+ "directory": "packages/code-inline"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "scripts": {
51
+ "build": "tsdown src/index.ts --format esm,cjs --dts",
52
+ "build:watch": "tsdown src/index.ts --format esm,cjs --dts --watch",
53
+ "clean": "rm -rf dist",
54
+ "test": "vitest run"
55
+ }
56
+ }