@caseparts-org/caseblocks 0.0.194 → 0.0.196
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Admonition.css +1 -0
- package/dist/assets/MainNav.css +1 -1
- package/dist/assets/Markdown.css +1 -1
- package/dist/main-browser.d.ts +4 -6
- package/dist/main-browser.js +3 -5
- package/dist/main-client.js +54 -52
- package/dist/main-server.d.ts +2 -0
- package/dist/main-server.js +16 -14
- package/dist/main.d.ts +2 -0
- package/dist/main.js +18 -16
- package/dist/molecules/Admonition/Admonition.d.ts +10 -0
- package/dist/molecules/Admonition/Admonition.js +46 -0
- package/dist/molecules/Admonition/Admonition.stories.d.ts +13 -0
- package/dist/molecules/Admonition/Admonition.stories.js +51 -0
- package/dist/molecules/Markdown/Markdown.d.ts +12 -0
- package/dist/{atoms → molecules}/Markdown/Markdown.js +891 -855
- package/dist/{atoms → molecules}/Markdown/Markdown.stories.d.ts +2 -0
- package/dist/molecules/Markdown/Markdown.stories.js +148 -0
- package/dist/molecules/Markdown/remarkAdmonition.d.ts +15 -0
- package/dist/molecules/Markdown/remarkAdmonition.js +120 -0
- package/dist/{atoms → molecules}/Markdown/usePreprocessedMarkdown.d.ts +1 -1
- package/dist/molecules/Markdown/usePreprocessedMarkdown.js +86 -0
- package/dist/organisms/MainNav/MainNav.js +77 -75
- package/package.json +1 -1
- package/dist/atoms/Markdown/Markdown.d.ts +0 -7
- package/dist/atoms/Markdown/Markdown.stories.js +0 -69
- package/dist/atoms/Markdown/PreprocessedMarkdown.d.ts +0 -10
- package/dist/atoms/Markdown/PreprocessedMarkdown.js +0 -39
- package/dist/atoms/Markdown/PreprocessedMarkdown.stories.d.ts +0 -8
- package/dist/atoms/Markdown/PreprocessedMarkdown.stories.js +0 -73
- package/dist/atoms/Markdown/usePreprocessedMarkdown.js +0 -74
|
@@ -10,5 +10,7 @@ declare const meta: {
|
|
|
10
10
|
};
|
|
11
11
|
export default meta;
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Playground: Story;
|
|
13
14
|
export declare const Basic: Story;
|
|
14
15
|
export declare const ItemDescription: Story;
|
|
16
|
+
export declare const Admonitions: Story;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useEffect as p } from "react";
|
|
3
|
+
import { Markdown as s } from "./Markdown.js";
|
|
4
|
+
const f = {
|
|
5
|
+
title: "Case Parts/Molecules/Markdown",
|
|
6
|
+
component: s,
|
|
7
|
+
parameters: { layout: "padded" },
|
|
8
|
+
tags: ["autodocs"]
|
|
9
|
+
}, r = `Kason 171 Latch
|
|
10
|
+
|
|
11
|
+
:::important[Compatibility]
|
|
12
|
+
Fits only selected revisions.
|
|
13
|
+
:::
|
|
14
|
+
|
|
15
|
+
This fits part [171] and an invalid token [bad].
|
|
16
|
+
Already linked should remain: [171](https://example.com/should-stay).
|
|
17
|
+
`;
|
|
18
|
+
function u(e) {
|
|
19
|
+
const [o, i] = m(e.children ?? r);
|
|
20
|
+
return p(() => {
|
|
21
|
+
i(e.children ?? r);
|
|
22
|
+
}, [e.children]), /* @__PURE__ */ c("div", { style: { display: "grid", gap: 12 }, children: [
|
|
23
|
+
/* @__PURE__ */ n("label", { style: { fontWeight: 600 }, children: "Edit Markdown (preprocess + admonitions live):" }),
|
|
24
|
+
/* @__PURE__ */ n(
|
|
25
|
+
"textarea",
|
|
26
|
+
{
|
|
27
|
+
value: o,
|
|
28
|
+
onChange: (t) => i(t.target.value),
|
|
29
|
+
rows: 14,
|
|
30
|
+
style: { width: "100%", fontFamily: "monospace" }
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ n(
|
|
34
|
+
s,
|
|
35
|
+
{
|
|
36
|
+
...e,
|
|
37
|
+
url: (t) => `https://example.com/parts/${encodeURIComponent(t)}`,
|
|
38
|
+
validate: async (t) => {
|
|
39
|
+
if (await new Promise((a) => setTimeout(a, 50)), /^\d+$/.test(t)) return !0;
|
|
40
|
+
throw new Error("invalid");
|
|
41
|
+
},
|
|
42
|
+
debug: !0,
|
|
43
|
+
children: o
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
const y = {
|
|
49
|
+
name: "Live Playground",
|
|
50
|
+
args: {
|
|
51
|
+
children: r
|
|
52
|
+
},
|
|
53
|
+
render: (e) => /* @__PURE__ */ n(u, { ...e })
|
|
54
|
+
}, v = {
|
|
55
|
+
args: {
|
|
56
|
+
children: `# Heading 1
|
|
57
|
+
|
|
58
|
+
Paragraph with a [link](https://example.com).
|
|
59
|
+
|
|
60
|
+
## Heading 2
|
|
61
|
+
|
|
62
|
+
- Item 1
|
|
63
|
+
- Item 2
|
|
64
|
+
|
|
65
|
+
> Blockquote example
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
Inline code: \`const x = 1;\`
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
Code block:
|
|
77
|
+
|
|
78
|
+
\`\`\`ts
|
|
79
|
+
function greet(name: string) {
|
|
80
|
+
console.log('Hello', name);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default greet;
|
|
84
|
+
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
| Col A | Col B |
|
|
88
|
+
|------:|:------|
|
|
89
|
+
| 123 | text |`
|
|
90
|
+
}
|
|
91
|
+
}, x = {
|
|
92
|
+
name: "Item Description Variant",
|
|
93
|
+
render: (e) => /* @__PURE__ */ n(({ text: l }) => /* @__PURE__ */ n(
|
|
94
|
+
s,
|
|
95
|
+
{
|
|
96
|
+
...e,
|
|
97
|
+
url: (a) => `https://example.com/parts/${encodeURIComponent(a)}`,
|
|
98
|
+
validate: async (a) => {
|
|
99
|
+
if (await new Promise((d) => setTimeout(d, 50)), /^\d+$/.test(a)) return !0;
|
|
100
|
+
throw new Error("invalid");
|
|
101
|
+
},
|
|
102
|
+
debug: !0,
|
|
103
|
+
children: l
|
|
104
|
+
}
|
|
105
|
+
), { text: `Kason 171 Latch
|
|
106
|
+
|
|
107
|
+
This fits part [171] and an invalid token [bad]. Already linked should remain: [171](https://example.com/should-stay).
|
|
108
|
+
|
|
109
|
+
Another valid numeric: [172].` })
|
|
110
|
+
}, b = {
|
|
111
|
+
args: {
|
|
112
|
+
children: `# Admonitions
|
|
113
|
+
|
|
114
|
+
:::note
|
|
115
|
+
Confirm model and serial number before ordering.
|
|
116
|
+
:::
|
|
117
|
+
|
|
118
|
+
:::important[Compatibility]
|
|
119
|
+
Fits only selected revisions.
|
|
120
|
+
:::
|
|
121
|
+
|
|
122
|
+
:::warning[Electrical Hazard]{icon="fa-solid fa-bolt"}
|
|
123
|
+
Disconnect power before servicing this unit.
|
|
124
|
+
:::
|
|
125
|
+
|
|
126
|
+
:::tip[Screw Size]{icon="fa-solid fa-screwdriver-wrench"}
|
|
127
|
+
Uses (6) #12 Flat Head screws
|
|
128
|
+
:::
|
|
129
|
+
|
|
130
|
+
:::custom-alert{title="Compatibility Note"}
|
|
131
|
+
Unknown type is preserved and rendered with neutral styling.
|
|
132
|
+
:::
|
|
133
|
+
|
|
134
|
+
Malformed opening should remain plain markdown:
|
|
135
|
+
|
|
136
|
+
:::warning[Missing end title
|
|
137
|
+
This block should not be transformed.
|
|
138
|
+
:::
|
|
139
|
+
`
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
export {
|
|
143
|
+
b as Admonitions,
|
|
144
|
+
v as Basic,
|
|
145
|
+
x as ItemDescription,
|
|
146
|
+
y as Playground,
|
|
147
|
+
f as default
|
|
148
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type MarkdownNode = {
|
|
2
|
+
type: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
children?: MarkdownNode[];
|
|
5
|
+
data?: {
|
|
6
|
+
hName?: string;
|
|
7
|
+
hProperties?: Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
type MarkdownRoot = {
|
|
11
|
+
type: "root";
|
|
12
|
+
children: MarkdownNode[];
|
|
13
|
+
};
|
|
14
|
+
export declare function remarkAdmonition(): (tree: MarkdownRoot) => void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
const g = /^[a-z][a-z0-9_-]*/, y = /^\s*(?:[a-z][a-z0-9_-]*="(?:[^"\\]|\\.)*"(?:[ \t]+[a-z][a-z0-9_-]*="(?:[^"\\]|\\.)*")*)?\s*$/, x = /([a-z][a-z0-9_-]*)="((?:[^"\\]|\\.)*)"/g, d = /^:::[ \t]*$/, b = /* @__PURE__ */ new Set(["note", "tip", "important", "caution", "warning"]), f = (n) => {
|
|
2
|
+
if (n.type !== "paragraph" || !n.children || n.children.length === 0) return null;
|
|
3
|
+
let t = "";
|
|
4
|
+
for (const e of n.children) {
|
|
5
|
+
if (e.type === "text" && typeof e.value == "string") {
|
|
6
|
+
t += e.value;
|
|
7
|
+
continue;
|
|
8
|
+
}
|
|
9
|
+
if (e.type === "break") {
|
|
10
|
+
t += `
|
|
11
|
+
`;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
|
+
}, T = (n) => ({
|
|
18
|
+
type: "paragraph",
|
|
19
|
+
children: [{ type: "text", value: n }]
|
|
20
|
+
}), _ = (n) => n.replace(/\\(.)/g, "$1"), v = (n) => {
|
|
21
|
+
if (!y.test(n)) return null;
|
|
22
|
+
const t = {};
|
|
23
|
+
for (const e of n.matchAll(x)) {
|
|
24
|
+
const i = e[1], o = _(e[2]);
|
|
25
|
+
(i === "icon" || i === "title") && (t[i] = o);
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}, E = (n) => {
|
|
29
|
+
let t = !1, e = !1;
|
|
30
|
+
for (let i = 1; i < n.length; i += 1) {
|
|
31
|
+
const o = n[i];
|
|
32
|
+
if (e) {
|
|
33
|
+
e = !1;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (o === "\\") {
|
|
37
|
+
e = !0;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (o === '"') {
|
|
41
|
+
t = !t;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (o === "}" && !t)
|
|
45
|
+
return i;
|
|
46
|
+
}
|
|
47
|
+
return -1;
|
|
48
|
+
}, I = (n) => {
|
|
49
|
+
if (!n.startsWith(":::")) return null;
|
|
50
|
+
let t = n.slice(3);
|
|
51
|
+
const e = t.match(g);
|
|
52
|
+
if (!e) return null;
|
|
53
|
+
const i = e[0];
|
|
54
|
+
t = t.slice(i.length);
|
|
55
|
+
let o;
|
|
56
|
+
if (t.startsWith("[")) {
|
|
57
|
+
const r = t.indexOf("]");
|
|
58
|
+
if (r < 0) return null;
|
|
59
|
+
o = t.slice(1, r), t = t.slice(r + 1);
|
|
60
|
+
}
|
|
61
|
+
let c = {};
|
|
62
|
+
if (t.startsWith("{")) {
|
|
63
|
+
const r = E(t);
|
|
64
|
+
if (r < 0) return null;
|
|
65
|
+
const a = v(t.slice(1, r));
|
|
66
|
+
if (!a) return null;
|
|
67
|
+
c = a, t = t.slice(r + 1);
|
|
68
|
+
}
|
|
69
|
+
return /^[ \t]*$/.test(t) ? { name: i, title: o, attributes: c } : null;
|
|
70
|
+
}, A = (n, t) => {
|
|
71
|
+
for (let e = t; e < n.length; e += 1) {
|
|
72
|
+
const i = f(n[e]);
|
|
73
|
+
if (i && d.test(i))
|
|
74
|
+
return e;
|
|
75
|
+
}
|
|
76
|
+
return -1;
|
|
77
|
+
}, N = (n) => {
|
|
78
|
+
const t = n.join(`
|
|
79
|
+
`);
|
|
80
|
+
return t.trim() ? t.split(/\n{2,}/).map((e) => e.trim()).filter(Boolean).map((e) => T(e)) : [];
|
|
81
|
+
};
|
|
82
|
+
function z() {
|
|
83
|
+
return (n) => {
|
|
84
|
+
if (!(!n || n.type !== "root" || !Array.isArray(n.children)))
|
|
85
|
+
for (let t = 0; t < n.children.length; t += 1) {
|
|
86
|
+
const e = f(n.children[t]);
|
|
87
|
+
if (!e) continue;
|
|
88
|
+
const i = e.split(/\r?\n/), o = I(i[0] ?? "");
|
|
89
|
+
if (!o) continue;
|
|
90
|
+
let c = [], r = 0;
|
|
91
|
+
if (i.length > 1) {
|
|
92
|
+
const l = i.findIndex((u, m) => m > 0 && d.test(u));
|
|
93
|
+
if (l < 0 || i.slice(l + 1).some((u) => u.trim().length > 0))
|
|
94
|
+
continue;
|
|
95
|
+
c = N(i.slice(1, l)), r = 1;
|
|
96
|
+
} else {
|
|
97
|
+
const l = A(n.children, t + 1);
|
|
98
|
+
if (l < 0) continue;
|
|
99
|
+
c = n.children.slice(t + 1, l), r = l - t + 1;
|
|
100
|
+
}
|
|
101
|
+
const a = o.title ?? o.attributes.title, h = b.has(o.name) ? o.name : "unknown", s = {
|
|
102
|
+
"data-admonition": o.name,
|
|
103
|
+
"data-admonition-variant": h
|
|
104
|
+
};
|
|
105
|
+
a !== void 0 && (s["data-admonition-title"] = a), o.attributes.icon !== void 0 && (s["data-admonition-icon"] = o.attributes.icon);
|
|
106
|
+
const p = {
|
|
107
|
+
type: "admonition",
|
|
108
|
+
data: {
|
|
109
|
+
hName: "aside",
|
|
110
|
+
hProperties: s
|
|
111
|
+
},
|
|
112
|
+
children: c
|
|
113
|
+
};
|
|
114
|
+
n.children.splice(t, r, p);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export {
|
|
119
|
+
z as remarkAdmonition
|
|
120
|
+
};
|
|
@@ -10,4 +10,4 @@ export type PreprocessedMarkdownResult = {
|
|
|
10
10
|
* Extracts bracketed tokens not already followed by parentheses, validates them, and
|
|
11
11
|
* returns the input with validated tokens converted to markdown links.
|
|
12
12
|
*/
|
|
13
|
-
export declare function usePreprocessedMarkdown(input: string | null | undefined, url
|
|
13
|
+
export declare function usePreprocessedMarkdown(input: string | null | undefined, url?: LinkTarget, validate?: ValidateToken, debug?: boolean, batchValidate?: BatchValidateTokens): PreprocessedMarkdownResult;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useState as q, useRef as E, useEffect as v, useMemo as H } from "react";
|
|
2
|
+
const x = (e, s) => {
|
|
3
|
+
const u = e.lastIndexOf(`
|
|
4
|
+
`, Math.max(0, s - 1)) + 1, h = e.indexOf(`
|
|
5
|
+
`, s), d = h === -1 ? e.length : h;
|
|
6
|
+
return e.slice(u, d).trimStart().startsWith(":::");
|
|
7
|
+
};
|
|
8
|
+
function N(e, s, u, h = !1, d) {
|
|
9
|
+
const [A, w] = q(e ?? ""), [L, m] = q(!1), c = E(/* @__PURE__ */ new Map()), M = E(u), O = E(
|
|
10
|
+
d
|
|
11
|
+
);
|
|
12
|
+
v(() => {
|
|
13
|
+
M.current = u, O.current = d;
|
|
14
|
+
}, [u, d]);
|
|
15
|
+
const S = H(() => /\[(.+?)\](?!\()/g, []), l = H(() => {
|
|
16
|
+
if (!e || !s) return [];
|
|
17
|
+
const f = Array.from(e.matchAll(S)).filter(
|
|
18
|
+
(a) => typeof a.index == "number" ? !x(e, a.index) : !0
|
|
19
|
+
).map((a) => a[1]);
|
|
20
|
+
return Array.from(new Set(f));
|
|
21
|
+
}, [e, S, s]), R = (f) => {
|
|
22
|
+
const r = f.split(/\r?\n/);
|
|
23
|
+
if (r.length === 0) return f;
|
|
24
|
+
const a = r[0];
|
|
25
|
+
return /^\s*#\s/.test(a) || (r[0] = `# ${a.trim()}`), r.join(`
|
|
26
|
+
`);
|
|
27
|
+
};
|
|
28
|
+
return v(() => {
|
|
29
|
+
if (!e) {
|
|
30
|
+
w(""), m(!1);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (!s) {
|
|
34
|
+
w(e), m(!1);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!l.length) {
|
|
38
|
+
w(R(e)), m(!1);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let f = !1;
|
|
42
|
+
m(!0);
|
|
43
|
+
const r = l.filter((y) => !c.current.has(y));
|
|
44
|
+
return (async () => {
|
|
45
|
+
if (r.length) {
|
|
46
|
+
const t = O.current, o = M.current;
|
|
47
|
+
if (t)
|
|
48
|
+
try {
|
|
49
|
+
const n = await t(r), i = n instanceof Set ? n : new Set(n);
|
|
50
|
+
r.forEach((g) => {
|
|
51
|
+
c.current.set(g, i.has(g));
|
|
52
|
+
});
|
|
53
|
+
} catch {
|
|
54
|
+
r.forEach((n) => {
|
|
55
|
+
c.current.set(n, !1);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else o ? (await Promise.allSettled(
|
|
59
|
+
r.map(async (i) => {
|
|
60
|
+
try {
|
|
61
|
+
await o(i), c.current.set(i, !0);
|
|
62
|
+
} catch {
|
|
63
|
+
c.current.set(i, !1);
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
)).forEach((i, g) => {
|
|
67
|
+
const $ = r[g];
|
|
68
|
+
c.current.has($) || c.current.set($, i.status === "fulfilled");
|
|
69
|
+
}) : r.forEach((n) => {
|
|
70
|
+
c.current.set(n, !0);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const y = new Set(
|
|
74
|
+
l.filter((t) => c.current.get(t) === !0)
|
|
75
|
+
), P = new Set(
|
|
76
|
+
l.filter((t) => c.current.get(t) === !1)
|
|
77
|
+
), j = (t) => typeof s == "function" ? s(t) : s, p = e.replace(S, (t, o, n) => x(e, n) ? t : y.has(o) ? `**[${o}](${j(o)})**` : t), C = h ? p.replace(S, (t, o, n) => x(p, n) ? t : P.has(o) ? `[${o}]⚠️` : t) : p, F = R(C);
|
|
78
|
+
f || (w(F), m(!1));
|
|
79
|
+
})(), () => {
|
|
80
|
+
f = !0;
|
|
81
|
+
};
|
|
82
|
+
}, [e, l, h, s, S]), { output: A, loading: L, tokens: l };
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
N as usePreprocessedMarkdown
|
|
86
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import S from "react";
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Link as
|
|
3
|
+
import { Text as d } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Link as u } from "../../atoms/Link/Link.js";
|
|
5
5
|
import { Icon as s } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { Flex as a } from "../../atoms/Flex/Flex.js";
|
|
7
7
|
import { Grid as U, Column as C } from "../../atoms/Grid/Grid.js";
|
|
8
8
|
import { Logo as F } from "../../molecules/Logo/Logo.js";
|
|
9
|
-
import { SearchBox as
|
|
9
|
+
import { SearchBox as w } from "../../molecules/SearchBox/SearchBox.js";
|
|
10
10
|
import { HamburgerMenu as H } from "../../molecules/HamburgerMenu/HamburgerMenu.js";
|
|
11
11
|
import { ShoppingCart as q } from "../../molecules/Cart/Cart.js";
|
|
12
12
|
import { Account as B } from "../../molecules/Account/Account.js";
|
|
13
13
|
import { CategoryNav as G } from "../../molecules/CategoryNav/CategoryNav.js";
|
|
14
14
|
import { getHideAtStyles as g } from "../../atoms/HideAt.js";
|
|
15
|
-
import { c as
|
|
16
|
-
import '../../assets/MainNav.css';const P = "
|
|
15
|
+
import { c as o } from "../../clsx-OuTLNxxd.js";
|
|
16
|
+
import '../../assets/MainNav.css';const P = "_main_jwl39_1", Q = "_column_jwl39_8", T = "_topNav_jwl39_13", W = "_logo_jwl39_21", E = "_operations_jwl39_24", J = "_search_jwl39_31", O = "_siteLink_jwl39_34", R = "_accountArea_jwl39_54", V = "_category_jwl39_66", X = "_menuList_jwl39_94", Y = "_menuItemAction_jwl39_112", n = {
|
|
17
17
|
main: P,
|
|
18
18
|
column: Q,
|
|
19
19
|
topNav: T,
|
|
@@ -23,100 +23,101 @@ import '../../assets/MainNav.css';const P = "_main_t25b8_1", Q = "_column_t25b8_
|
|
|
23
23
|
siteLink: O,
|
|
24
24
|
accountArea: R,
|
|
25
25
|
category: V,
|
|
26
|
-
menuList: X
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
menuList: X,
|
|
27
|
+
menuItemAction: Y
|
|
28
|
+
}, ue = S.forwardRef(function({
|
|
29
|
+
account: l,
|
|
29
30
|
categories: t,
|
|
30
|
-
homeRoute:
|
|
31
|
-
faqRoute:
|
|
32
|
-
customPartsRoute:
|
|
33
|
-
aboutUsRoute:
|
|
34
|
-
contactRoute:
|
|
35
|
-
cart:
|
|
36
|
-
open:
|
|
31
|
+
homeRoute: h,
|
|
32
|
+
faqRoute: I,
|
|
33
|
+
customPartsRoute: p,
|
|
34
|
+
aboutUsRoute: v,
|
|
35
|
+
contactRoute: N,
|
|
36
|
+
cart: j,
|
|
37
|
+
open: L,
|
|
37
38
|
// consume external panel control props from CartPropsBase
|
|
38
|
-
className:
|
|
39
|
-
onLoginClick:
|
|
39
|
+
className: x,
|
|
40
|
+
onLoginClick: b,
|
|
40
41
|
onSearch: _,
|
|
41
|
-
onCategoryClick:
|
|
42
|
-
onClickModelSerial:
|
|
43
|
-
onCartClick:
|
|
44
|
-
accountPopoverContent:
|
|
45
|
-
isAccountLoading:
|
|
46
|
-
isCategoriesLoading:
|
|
42
|
+
onCategoryClick: r,
|
|
43
|
+
onClickModelSerial: A,
|
|
44
|
+
onCartClick: y,
|
|
45
|
+
accountPopoverContent: z,
|
|
46
|
+
isAccountLoading: k,
|
|
47
|
+
isCategoriesLoading: K,
|
|
47
48
|
...D
|
|
48
49
|
}, M) {
|
|
49
|
-
return /* @__PURE__ */ e(U, { ...D, gridWrapperClassName:
|
|
50
|
-
/* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ e(U, { ...D, gridWrapperClassName: o(n.main, x), children: /* @__PURE__ */ i(C, { span: 12, className: n.column, children: [
|
|
51
|
+
/* @__PURE__ */ i(
|
|
51
52
|
a,
|
|
52
53
|
{
|
|
53
54
|
flexDirection: "row",
|
|
54
55
|
alignItems: "center",
|
|
55
56
|
justifyContent: "space-between",
|
|
56
|
-
className:
|
|
57
|
+
className: n.topNav,
|
|
57
58
|
children: [
|
|
58
|
-
/* @__PURE__ */ e("div", { className:
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ e("div", { className: n.logo, children: /* @__PURE__ */ e(u, { href: h, children: /* @__PURE__ */ e(F, {}) }) }),
|
|
60
|
+
/* @__PURE__ */ i(
|
|
60
61
|
a,
|
|
61
62
|
{
|
|
62
63
|
flexDirection: "row",
|
|
63
64
|
alignItems: "center",
|
|
64
65
|
justifyContent: "flex-end",
|
|
65
|
-
className:
|
|
66
|
+
className: n.operations,
|
|
66
67
|
children: [
|
|
67
|
-
/* @__PURE__ */ e(a, { flexDirection: "row", hideAt: ["sm"], className:
|
|
68
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
69
|
-
/* @__PURE__ */ e(
|
|
70
|
-
/* @__PURE__ */ e(
|
|
71
|
-
/* @__PURE__ */ e("div", { className:
|
|
68
|
+
/* @__PURE__ */ e(a, { flexDirection: "row", hideAt: ["sm"], className: n.search, children: /* @__PURE__ */ e(w, { onSearch: _, inputName: "cpc-search" }) }),
|
|
69
|
+
/* @__PURE__ */ e("button", { onClick: A, className: o(n.siteLink, n.menuItemAction, g(["sm", "md"])), children: "Model/Serial" }),
|
|
70
|
+
/* @__PURE__ */ e(c, { href: p, hideAt: ["sm", "md"], className: n.menuItemAction, children: "Custom Parts" }),
|
|
71
|
+
/* @__PURE__ */ e(c, { href: N, hideAt: ["sm", "md"], className: n.menuItemAction, children: "Contact Us" }),
|
|
72
|
+
/* @__PURE__ */ e("div", { className: n.accountArea, children: /* @__PURE__ */ e(
|
|
72
73
|
B,
|
|
73
74
|
{
|
|
74
|
-
account:
|
|
75
|
-
onLoginClick:
|
|
76
|
-
className:
|
|
77
|
-
popoverContent:
|
|
78
|
-
isAccountLoading:
|
|
75
|
+
account: l,
|
|
76
|
+
onLoginClick: b,
|
|
77
|
+
className: n.avatar,
|
|
78
|
+
popoverContent: z,
|
|
79
|
+
isAccountLoading: k
|
|
79
80
|
}
|
|
80
81
|
) }),
|
|
81
82
|
/* @__PURE__ */ e(
|
|
82
83
|
q,
|
|
83
84
|
{
|
|
84
85
|
ref: M,
|
|
85
|
-
cart:
|
|
86
|
-
open:
|
|
87
|
-
onCartClick:
|
|
86
|
+
cart: j,
|
|
87
|
+
open: L,
|
|
88
|
+
onCartClick: y
|
|
88
89
|
}
|
|
89
90
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */ e(
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ i(H, { hideAt: ["lg"], children: [
|
|
92
|
+
/* @__PURE__ */ i("section", { children: [
|
|
93
|
+
/* @__PURE__ */ e(d, { size: "md", weight: "semibold", children: "Useful shortcuts" }),
|
|
94
|
+
/* @__PURE__ */ i("ul", { className: n.menuList, children: [
|
|
95
|
+
/* @__PURE__ */ e("li", { className: n.menuItem, children: /* @__PURE__ */ i("button", { onClick: A, className: o(n.siteLink, n.menuItemAction, g(["lg"])), children: [
|
|
95
96
|
/* @__PURE__ */ e(s, { iconKey: "fa-regular fa-book", size: "sm" }),
|
|
96
|
-
/* @__PURE__ */ e("
|
|
97
|
-
] }),
|
|
98
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ e("span", { children: "Model/Serial" })
|
|
98
|
+
] }) }),
|
|
99
|
+
/* @__PURE__ */ e("li", { className: n.menuItem, children: /* @__PURE__ */ i(c, { href: p, className: n.menuItemAction, children: [
|
|
99
100
|
/* @__PURE__ */ e(s, { iconKey: "fa-regular fa-screwdriver-wrench", size: "sm" }),
|
|
100
|
-
/* @__PURE__ */ e(
|
|
101
|
-
] }),
|
|
102
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ e("span", { children: "Custom Parts" })
|
|
102
|
+
] }) }),
|
|
103
|
+
/* @__PURE__ */ e("li", { className: n.menuItem, children: /* @__PURE__ */ i(c, { href: N, className: n.menuItemAction, children: [
|
|
103
104
|
/* @__PURE__ */ e(s, { iconKey: "fa-regular fa-envelope", size: "sm" }),
|
|
104
|
-
/* @__PURE__ */ e(
|
|
105
|
-
] }),
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ e("span", { children: "Contact Us" })
|
|
106
|
+
] }) }),
|
|
107
|
+
/* @__PURE__ */ e("li", { className: n.menuItem, children: /* @__PURE__ */ i(c, { href: I, className: n.menuItemAction, children: [
|
|
107
108
|
/* @__PURE__ */ e(s, { iconKey: "fa-solid fa-question", size: "sm" }),
|
|
108
|
-
/* @__PURE__ */ e(
|
|
109
|
-
] }),
|
|
110
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ e("span", { children: "FAQ" })
|
|
110
|
+
] }) }),
|
|
111
|
+
/* @__PURE__ */ e("li", { className: n.menuItem, children: /* @__PURE__ */ i(c, { href: v, className: n.menuItemAction, children: [
|
|
111
112
|
/* @__PURE__ */ e(s, { iconKey: "fa-regular fa-people-group", size: "sm" }),
|
|
112
|
-
/* @__PURE__ */ e(
|
|
113
|
-
] })
|
|
113
|
+
/* @__PURE__ */ e("span", { children: "About Us" })
|
|
114
|
+
] }) })
|
|
114
115
|
] })
|
|
115
116
|
] }),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */ e(
|
|
118
|
-
/* @__PURE__ */ e("ul", { className:
|
|
119
|
-
/* @__PURE__ */ e(
|
|
117
|
+
/* @__PURE__ */ i("section", { children: [
|
|
118
|
+
/* @__PURE__ */ e(d, { size: "md", weight: "semibold", children: "Shop by category" }),
|
|
119
|
+
/* @__PURE__ */ e("ul", { className: n.menuList, children: t && t.map((m) => /* @__PURE__ */ e("li", { className: n.category, children: /* @__PURE__ */ i(u, { href: m.route, onClick: () => r == null ? void 0 : r(m), children: [
|
|
120
|
+
/* @__PURE__ */ e(d, { size: "sm", children: m.label }),
|
|
120
121
|
/* @__PURE__ */ e(
|
|
121
122
|
s,
|
|
122
123
|
{
|
|
@@ -125,7 +126,7 @@ import '../../assets/MainNav.css';const P = "_main_t25b8_1", Q = "_column_t25b8_
|
|
|
125
126
|
size: "sm"
|
|
126
127
|
}
|
|
127
128
|
)
|
|
128
|
-
] }) },
|
|
129
|
+
] }) }, m.id)) })
|
|
129
130
|
] })
|
|
130
131
|
] })
|
|
131
132
|
]
|
|
@@ -134,24 +135,25 @@ import '../../assets/MainNav.css';const P = "_main_t25b8_1", Q = "_column_t25b8_
|
|
|
134
135
|
]
|
|
135
136
|
}
|
|
136
137
|
),
|
|
137
|
-
/* @__PURE__ */ e(a, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(
|
|
138
|
+
/* @__PURE__ */ e(a, { flexDirection: "row", hideAt: ["md", "lg"], children: /* @__PURE__ */ e(w, { onSearch: _, inputName: "cpc-search", className: n.search }) }),
|
|
138
139
|
/* @__PURE__ */ e(
|
|
139
140
|
G,
|
|
140
141
|
{
|
|
141
142
|
categories: t,
|
|
142
|
-
isCategoriesLoading:
|
|
143
|
-
onCategoryClick:
|
|
143
|
+
isCategoriesLoading: K,
|
|
144
|
+
onCategoryClick: r
|
|
144
145
|
}
|
|
145
146
|
)
|
|
146
147
|
] }) });
|
|
147
148
|
});
|
|
148
|
-
function
|
|
149
|
+
function c({
|
|
149
150
|
href: f,
|
|
150
|
-
children:
|
|
151
|
-
|
|
151
|
+
children: l,
|
|
152
|
+
className: t,
|
|
153
|
+
...h
|
|
152
154
|
}) {
|
|
153
|
-
return /* @__PURE__ */ e(
|
|
155
|
+
return /* @__PURE__ */ e(u, { href: f, className: o(n.siteLink, t), ...h, children: l });
|
|
154
156
|
}
|
|
155
157
|
export {
|
|
156
|
-
|
|
158
|
+
ue as MainNav
|
|
157
159
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Components } from 'react-markdown';
|
|
2
|
-
export type MarkdownProps = {
|
|
3
|
-
children?: string | null;
|
|
4
|
-
className?: string;
|
|
5
|
-
components?: Components;
|
|
6
|
-
};
|
|
7
|
-
export declare function Markdown({ children, className, components }: MarkdownProps): import("react/jsx-runtime").JSX.Element | null;
|