@jaroslava/plugin-core-components 1.0.0
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 +22 -0
- package/dist/components/code.d.ts +3 -0
- package/dist/components/code.d.ts.map +1 -0
- package/dist/components/code.js +46 -0
- package/dist/components/code.js.map +1 -0
- package/dist/components/grid-and-card.d.ts +4 -0
- package/dist/components/grid-and-card.d.ts.map +1 -0
- package/dist/components/grid-and-card.js +98 -0
- package/dist/components/grid-and-card.js.map +1 -0
- package/dist/components/hero.d.ts +3 -0
- package/dist/components/hero.d.ts.map +1 -0
- package/dist/components/hero.js +28 -0
- package/dist/components/hero.js.map +1 -0
- package/dist/components/list.d.ts +3 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +50 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/page.d.ts +3 -0
- package/dist/components/page.d.ts.map +1 -0
- package/dist/components/page.js +181 -0
- package/dist/components/page.js.map +1 -0
- package/dist/components/post.d.ts +3 -0
- package/dist/components/post.d.ts.map +1 -0
- package/dist/components/post.js +66 -0
- package/dist/components/post.js.map +1 -0
- package/dist/components/profile.d.ts +4 -0
- package/dist/components/profile.d.ts.map +1 -0
- package/dist/components/profile.js +43 -0
- package/dist/components/profile.js.map +1 -0
- package/dist/components/sidebar.d.ts +3 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +71 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jaroslava SDK Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
6
|
+
copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included
|
|
14
|
+
in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
17
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/components/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAiB,MAAM,kBAAkB,CAAC;AAE3E,eAAO,MAAM,aAAa,EAAE,mBAqC3B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const codeComponent = {
|
|
2
|
+
kind: "code",
|
|
3
|
+
displayName: "Code Block",
|
|
4
|
+
parse: {
|
|
5
|
+
// The inline header after `@code` (e.g. "bash") is captured as the
|
|
6
|
+
// `language` attribute. The actual body is consumed verbatim by the
|
|
7
|
+
// parser's builder (special-cased for kind === "code") rather than via
|
|
8
|
+
// parseBodyLine, since code content must never be attribute/inline-parsed.
|
|
9
|
+
parseInlineHeader(remainder) {
|
|
10
|
+
return remainder ? { language: remainder } : undefined;
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
render(node) {
|
|
14
|
+
const codeChild = node.children.find((c) => c.type === "CodeBlock");
|
|
15
|
+
const code = codeChild?.code ?? "";
|
|
16
|
+
const language = codeChild?.language ?? node.attrs.language;
|
|
17
|
+
const langClass = language ? ` class="language-${language}"` : "";
|
|
18
|
+
return {
|
|
19
|
+
html: [
|
|
20
|
+
`<div class="jaro-code-block">`,
|
|
21
|
+
` <pre><code${langClass}>${escapeHtml(code)}</code></pre>`,
|
|
22
|
+
`</div>`,
|
|
23
|
+
].join("\n"),
|
|
24
|
+
css: [
|
|
25
|
+
".jaro-code-block { background: var(--jaro-code-bg); border: 0.5px solid var(--line); border-radius: 3px; padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--jaro-code); margin-bottom: 0.6rem; font-family: 'JetBrains Mono', monospace;}",
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
serialize(node, ctx) {
|
|
30
|
+
const codeChild = node.children.find((c) => c.type === "CodeBlock");
|
|
31
|
+
if (!codeChild)
|
|
32
|
+
return undefined;
|
|
33
|
+
const indent = ctx.indentUnit.repeat(ctx.depth);
|
|
34
|
+
const bodyIndent = ctx.indentUnit.repeat(ctx.depth + 1);
|
|
35
|
+
const header = codeChild.language ? `${indent}@code ${codeChild.language}` : `${indent}@code`;
|
|
36
|
+
const bodyLines = codeChild.code.split("\n").map((l) => `${bodyIndent}${l}`);
|
|
37
|
+
return [header, ...bodyLines];
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
function escapeHtml(value) {
|
|
41
|
+
return value
|
|
42
|
+
.replace(/&/g, "&")
|
|
43
|
+
.replace(/</g, "<")
|
|
44
|
+
.replace(/>/g, ">");
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sourceRoot":"","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AAG,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,OAAO,CAAC;QAC9F,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU,GAAG,CAAC,EAAE,CAAC,CAAC;QAC7E,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IAChC,CAAC;CACF,CAAC;AAEF,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-and-card.d.ts","sourceRoot":"","sources":["../../src/components/grid-and-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,eAAO,MAAM,aAAa,EAAE,mBAe3B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,mBAuE3B,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export const gridComponent = {
|
|
2
|
+
kind: "grid",
|
|
3
|
+
displayName: "Grid",
|
|
4
|
+
schema: {
|
|
5
|
+
kind: "grid",
|
|
6
|
+
allowedChildKinds: ["card"],
|
|
7
|
+
},
|
|
8
|
+
render(_node, renderedChildren) {
|
|
9
|
+
return {
|
|
10
|
+
html: `<div class="jaro-grid">\n${renderedChildren}\n</div>`,
|
|
11
|
+
css: [
|
|
12
|
+
".jaro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin: 15px 0 }",
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export const cardComponent = {
|
|
18
|
+
kind: "card",
|
|
19
|
+
displayName: "Card",
|
|
20
|
+
schema: {
|
|
21
|
+
kind: "card",
|
|
22
|
+
attributes: {
|
|
23
|
+
title: { type: "string", required: true },
|
|
24
|
+
description: { type: "string", required: false },
|
|
25
|
+
// `cover` is intentionally NOT schema-typed here: its raw value is
|
|
26
|
+
// a call-expression (e.g. img("finflow.jpg")), represented as a
|
|
27
|
+
// JaroAttributeCallValue object rather than a plain string/number/
|
|
28
|
+
// boolean/array/object — shapes the generic AttributeSchema checker
|
|
29
|
+
// in @jaroslava/validator currently understands. Components whose
|
|
30
|
+
// attributes use call syntax validate that attribute in their own
|
|
31
|
+
// `validate` hook instead of via the generic schema, until/unless
|
|
32
|
+
// AttributeSchema grows a "call" type (see ARCHITECTURE.md, future
|
|
33
|
+
// language versions / extensibility notes).
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
parse: {
|
|
37
|
+
parseInlineHeader(remainder) {
|
|
38
|
+
return remainder && remainder.includes("->") ? { link: remainder.split("->")[1].replace(/["]/g, "").trim() } : undefined;
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
validate(node) {
|
|
42
|
+
const diagnostics = [];
|
|
43
|
+
if (!node.attrs.title) {
|
|
44
|
+
diagnostics.push({
|
|
45
|
+
severity: "error",
|
|
46
|
+
code: "card-missing-title",
|
|
47
|
+
message: "@card requires a `title` attribute.",
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (node.attrs.cover !== undefined && extractCoverUrl(node.attrs.cover) === undefined) {
|
|
51
|
+
diagnostics.push({
|
|
52
|
+
severity: "warning",
|
|
53
|
+
code: "card-invalid-cover",
|
|
54
|
+
message: '@card\'s `cover` attribute should be a call expression like img("url.jpg") or a plain URL string.',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return diagnostics;
|
|
58
|
+
},
|
|
59
|
+
render(node) {
|
|
60
|
+
const title = String(node.attrs.title ?? "");
|
|
61
|
+
const description = node.attrs.description ? String(node.attrs.description) : undefined;
|
|
62
|
+
// `cover` is typically a Call node (img("...")) but may already have
|
|
63
|
+
// been coerced to a plain string by the generic attribute parser;
|
|
64
|
+
// handle both shapes defensively.
|
|
65
|
+
const cover = extractCoverUrl(node.attrs.cover);
|
|
66
|
+
const link = node.attrs.link ? String(node.attrs.link) : undefined;
|
|
67
|
+
return {
|
|
68
|
+
html: [
|
|
69
|
+
link ? `<a href="${link.startsWith("https://") ? link : "https://" + link}" target="_blank" class="jaro-card-link">` : "",
|
|
70
|
+
`<article class="jaro-card">`,
|
|
71
|
+
cover ? ` <img class="jaro-card-cover" src="${cover}" />` : "<div class='jaro-card-cover'></div>",
|
|
72
|
+
` <h3 class="jaro-card-title">${title}</h3>`,
|
|
73
|
+
description ? ` <p class="jaro-card-description">${description}</p>` : "",
|
|
74
|
+
`</article>`,
|
|
75
|
+
link ? `</a>` : "",
|
|
76
|
+
]
|
|
77
|
+
.filter(Boolean)
|
|
78
|
+
.join("\n"),
|
|
79
|
+
css: [
|
|
80
|
+
".jaro-card { background: var(--line); border: 0.5px solid var(--line); border-radius: 3px; overflow: hidden; max-height: 300px;}",
|
|
81
|
+
".jaro-card-cover { width: calc(100% - 4px); aspect-ratio: 16/9; object-fit: cover; margin: 2px; background: var(--jaro-bg); display: flex; align-items: center; justify-content: center;}",
|
|
82
|
+
".jaro-card-title {font-size: 0.82rem; font-weight: 600; color: var(--text); padding: 0 12px}",
|
|
83
|
+
".jaro-card-description {font-size: 0.7rem; color: var(--muted); padding: 0 12px}",
|
|
84
|
+
".jaro-card-link { text-decoration: none; }",
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
function extractCoverUrl(value) {
|
|
90
|
+
if (typeof value === "string")
|
|
91
|
+
return value;
|
|
92
|
+
if (value && typeof value === "object" && value.__call) {
|
|
93
|
+
const args = value.args;
|
|
94
|
+
return typeof args[0] === "string" ? args[0] : undefined;
|
|
95
|
+
}
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=grid-and-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-and-card.js","sourceRoot":"","sources":["../../src/components/grid-and-card.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,iBAAiB,EAAE,CAAC,MAAM,CAAC;KAC5B;IACD,MAAM,CAAC,KAAK,EAAE,gBAAgB;QAC5B,OAAO;YACL,IAAI,EAAE,4BAA4B,gBAAgB,UAAU;YAC5D,GAAG,EAAE;gBACH,wHAAwH;aACzH;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACzC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;YAChD,mEAAmE;YACnE,gEAAgE;YAChE,mEAAmE;YACnE,oEAAoE;YACpE,kEAAkE;YAClE,kEAAkE;YAClE,kEAAkE;YAClE,mEAAmE;YACnE,4CAA4C;SAC7C;KACF;IACD,KAAK,EAAE;QACL,iBAAiB,CAAC,SAAS;YACzB,OAAO,SAAS,IAAI,SAAS,CAA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":"hero.d.ts","sourceRoot":"","sources":["../../src/components/hero.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,eAAO,MAAM,aAAa,EAAE,mBA0B3B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const heroComponent = {
|
|
2
|
+
kind: "hero",
|
|
3
|
+
displayName: "Hero",
|
|
4
|
+
schema: {
|
|
5
|
+
kind: "hero",
|
|
6
|
+
attributes: {
|
|
7
|
+
heading: { type: "string", required: true },
|
|
8
|
+
id: { type: "string", required: false },
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
render(node, renderedChildren) {
|
|
12
|
+
const heading = String(node.attrs.heading ?? "");
|
|
13
|
+
const anchor = node.attrs.id ? ` id="${String(node.attrs.id)}"` : "";
|
|
14
|
+
return {
|
|
15
|
+
html: [
|
|
16
|
+
`<section class="jaro-hero"${anchor}>`,
|
|
17
|
+
` <h2 class="jaro-hero-heading">${heading}</h2>`,
|
|
18
|
+
renderedChildren ? ` <div class="jaro-hero-body">${renderedChildren}</div>` : "",
|
|
19
|
+
`</section>`,
|
|
20
|
+
].join("\n"),
|
|
21
|
+
css: [
|
|
22
|
+
".jaro-hero {margin-bottom: 3rem;}",
|
|
23
|
+
".jaro-hero-heading {font-size: 1.1rem; font-weight: 700; color: var(--text);}"
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=hero.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../src/components/hero.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC3C,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;SACxC;KACF;IACD,MAAM,CAAC,IAAI,EAAE,gBAAgB;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,OAAO;YACL,IAAI,EAAE;gBACJ,6BAA6B,MAAM,GAAG;gBACtC,mCAAmC,OAAO,OAAO;gBACjD,gBAAgB,CAAC,CAAC,CAAC,iCAAiC,gBAAgB,QAAQ,CAAC,CAAC,CAAC,EAAE;gBACjF,YAAY;aACb,CAAC,IAAI,CAAC,IAAI,CAAC;YACZ,GAAG,EAAE;gBACH,mCAAmC;gBACnC,+EAA+E;aAChF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/components/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EAIpB,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,aAAa,EAAE,mBAqC3B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { parseInline } from "@jaroslava/utils";
|
|
2
|
+
export const listComponent = {
|
|
3
|
+
kind: "list",
|
|
4
|
+
displayName: "List",
|
|
5
|
+
schema: {
|
|
6
|
+
kind: "list",
|
|
7
|
+
attributes: {
|
|
8
|
+
direction: { type: "enum", enumValues: ["row", "column"], required: false },
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
parse: {
|
|
12
|
+
parseBodyLine(line, ctx) {
|
|
13
|
+
// A list "row" is any line containing the `->` link arrow. Plain
|
|
14
|
+
// `key: value` attribute lines (e.g. `direction: column`) never reach
|
|
15
|
+
// here — the generic builder claims attribute-shaped lines before
|
|
16
|
+
// offering the line to plugin hooks.
|
|
17
|
+
if (!line.includes("->"))
|
|
18
|
+
return null;
|
|
19
|
+
return parseInline(line, {
|
|
20
|
+
generateId: ctx.generateId,
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
render(node, _renderedChildren, ctx) {
|
|
25
|
+
const direction = node.attrs.direction ?? "column";
|
|
26
|
+
const rows = node.children.map((child) => renderRow(child, ctx)).join("\n");
|
|
27
|
+
return {
|
|
28
|
+
html: `<ul class="jaro-list jaro-list-${direction}">\n${rows}\n</ul>`,
|
|
29
|
+
css: [
|
|
30
|
+
".jaro-list { list-style: none; padding: 0; display: flex; gap: 0.75rem; margin: 0; flex-wrap: wrap; justify-content: center; margin-bottom: 10px;}",
|
|
31
|
+
".jaro-list-column {flex-direction: column;}",
|
|
32
|
+
".jaro-list-row { flex-direction: row; }",
|
|
33
|
+
".jaro-list-item { transition: transform 0.3s ease; display: flex; align-items: center; justify-content: space-between; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--line);font-size: 0.82rem; color: #DDD; padding: 0 15px 0 10px; outline: none;transition: border-color .2s;}",
|
|
34
|
+
".jaro-list-item:hover {transform: scale(1.1);}",
|
|
35
|
+
".jaro-list-item img {height: 75%; margin: 5px;border-radius: 8px;}",
|
|
36
|
+
""
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
function renderRow(node, ctx) {
|
|
42
|
+
if (node.type === "InlineGroup") {
|
|
43
|
+
return `<li class="jaro-list-item">${renderInlineGroup(node, ctx)}</li>`;
|
|
44
|
+
}
|
|
45
|
+
return `<li class="jaro-list-item">${ctx.renderNode(node).html}</li>`;
|
|
46
|
+
}
|
|
47
|
+
function renderInlineGroup(group, ctx) {
|
|
48
|
+
return group.items.map((item) => ctx.renderNode(item).html).join(" ");
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/components/list.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE;YACV,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;SAC5E;KACF;IACD,KAAK,EAAE;QACL,aAAa,CAAC,IAAI,EAAE,GAAG;YACrB,iEAAiE;YACjE,sEAAsE;YACtE,kEAAkE;YAClE,qCAAqC;YACrC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC;YACtC,OAAO,WAAW,CAAC,IAAI,EAAE;gBACvB,UAAU,EAAE,GAAG,CAAC,UAAU;aAC3B,CAAC,CAAC;QACL,CAAC;KACF;IACD,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG;QACjC,MAAM,SAAS,GAAI,IAAI,CAAC,KAAK,CAAC,SAAoB,IAAI,QAAQ,CAAC;QAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5E,OAAO;YACL,IAAI,EAAE,kCAAkC,SAAS,OAAO,IAAI,SAAS;YACrE,GAAG,EAAE;gBACH,oJAAoJ;gBACpJ,6CAA6C;gBAC7C,yCAAyC;gBACzC,yTAAyT;gBACzT,gDAAgD;gBAChD,oEAAoE;gBACpE,EAAE;aACH;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,SAAS,SAAS,CAAC,IAAa,EAAE,GAAkB;IAClD,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QAChC,OAAO,8BAA8B,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;IAC3E,CAAC;IACD,OAAO,8BAA8B,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC;AACxE,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAsB,EAAE,GAAkB;IACnE,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/components/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,eAAO,MAAM,aAAa,EAAE,mBAsC3B,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export const pageComponent = {
|
|
2
|
+
kind: "page",
|
|
3
|
+
displayName: "Page",
|
|
4
|
+
schema: {
|
|
5
|
+
kind: "page",
|
|
6
|
+
attributes: {
|
|
7
|
+
title: { type: "string", required: true },
|
|
8
|
+
layout: {
|
|
9
|
+
type: "enum",
|
|
10
|
+
enumValues: ["linkhub", "blog", "newsletter", "documentation", "portfolio", "docs"],
|
|
11
|
+
required: false,
|
|
12
|
+
},
|
|
13
|
+
theme: { type: "enum", enumValues: ["light", "dark", "toggled"], required: false },
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
render(node, renderedChildren, ctx) {
|
|
17
|
+
const theme = node.attrs.theme ?? ctx.theme ?? "light";
|
|
18
|
+
const title = node.attrs.title ?? "Untitled";
|
|
19
|
+
const layout = String(node.attrs.layout ?? "default");
|
|
20
|
+
const html = [
|
|
21
|
+
"<!doctype html>",
|
|
22
|
+
`<html lang="en" data-theme="${escapeAttr(theme)}">`,
|
|
23
|
+
"<head>",
|
|
24
|
+
' <meta charset="utf-8" />',
|
|
25
|
+
' <meta name="viewport" content="width=device-width, initial-scale=1" />',
|
|
26
|
+
` <title>${escapeHtml(title)}</title>`,
|
|
27
|
+
"</head>",
|
|
28
|
+
`<style>${getPageStyle(layout)}</style>`,
|
|
29
|
+
`<body class="jaro-page jaro-layout-${escapeAttr(String(node.attrs.layout ?? "default"))}">`,
|
|
30
|
+
wrap(renderedChildren, layout),
|
|
31
|
+
"</body>",
|
|
32
|
+
"</html>",
|
|
33
|
+
].join("\n");
|
|
34
|
+
return {
|
|
35
|
+
html,
|
|
36
|
+
css: [BASE_PAGE_CSS],
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
const DEFAULT_CSS = `
|
|
41
|
+
.jaro-page {
|
|
42
|
+
max-width: 1200px;
|
|
43
|
+
margin: 0 auto;
|
|
44
|
+
padding: 2rem;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.jaro-layout-default {
|
|
48
|
+
display: block;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.jaro-text {font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem;}
|
|
52
|
+
|
|
53
|
+
.jaro-link {text-decoration: none;color: var(--jaro-fg);}
|
|
54
|
+
`;
|
|
55
|
+
const DOC_CSS = `
|
|
56
|
+
.jaro-docs {
|
|
57
|
+
display: grid;
|
|
58
|
+
grid-template-columns: 110px 1fr;
|
|
59
|
+
gap: 1rem;
|
|
60
|
+
height: 100%;
|
|
61
|
+
}
|
|
62
|
+
.jaro-layout-doc {
|
|
63
|
+
max-width: 800px;
|
|
64
|
+
margin: 0 auto;
|
|
65
|
+
padding: 3rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
article {
|
|
69
|
+
line-height: 1.8;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
pre {
|
|
73
|
+
overflow-x: auto;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
code {
|
|
77
|
+
font-family: monospace;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
`;
|
|
81
|
+
const PORTFOLIO_CSS = `
|
|
82
|
+
.jaro-layout-portfolio {
|
|
83
|
+
max-width: 800px;
|
|
84
|
+
margin: 0 auto;
|
|
85
|
+
padding: 2rem;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.jaro-layout-portfolio .projects {
|
|
89
|
+
display: grid;
|
|
90
|
+
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
91
|
+
gap: 1.5rem;
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
const BLOG_CSS = `
|
|
95
|
+
.jaro-layout-blog {
|
|
96
|
+
max-width: 680px;
|
|
97
|
+
margin: 0 auto;
|
|
98
|
+
padding: 2rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.jaro-layout-blog article {
|
|
102
|
+
margin-bottom: 3rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.jaro-layout-blog h1,
|
|
106
|
+
.jaro-layout-blog h2 {
|
|
107
|
+
margin-bottom: 1rem;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.jaro-layout-blog p {
|
|
111
|
+
line-height: 1.8;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.jaro-post {
|
|
115
|
+
border-bottom: 1px solid var(--muted);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
`;
|
|
119
|
+
const LINKHUB_CSS = `
|
|
120
|
+
.jaro-layout-linkhub {
|
|
121
|
+
max-width: 400px;
|
|
122
|
+
margin: 0 auto;
|
|
123
|
+
padding: 2rem;
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 1rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.jaro-container-linkhub {
|
|
130
|
+
border-radius: 10px;
|
|
131
|
+
padding: 2rem;
|
|
132
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
const PAGE_STYLES = {
|
|
136
|
+
default: DEFAULT_CSS,
|
|
137
|
+
linkhub: LINKHUB_CSS,
|
|
138
|
+
blog: BLOG_CSS,
|
|
139
|
+
portfolio: PORTFOLIO_CSS,
|
|
140
|
+
doc: DOC_CSS,
|
|
141
|
+
};
|
|
142
|
+
function getPageStyle(style) {
|
|
143
|
+
const layout = PAGE_STYLES[style.toLowerCase()] ?? "";
|
|
144
|
+
return `${DEFAULT_CSS}\n${layout}`;
|
|
145
|
+
}
|
|
146
|
+
function escapeHtml(value) {
|
|
147
|
+
return value
|
|
148
|
+
.replace(/&/g, "&")
|
|
149
|
+
.replace(/</g, "<")
|
|
150
|
+
.replace(/>/g, ">");
|
|
151
|
+
}
|
|
152
|
+
function escapeAttr(value) {
|
|
153
|
+
return value.replace(/"/g, """);
|
|
154
|
+
}
|
|
155
|
+
function wrap(value, style) {
|
|
156
|
+
if (style === 'doc') {
|
|
157
|
+
return `<div class="jaro-docs">${wrapContentDoc(value)}</div>`;
|
|
158
|
+
}
|
|
159
|
+
if (style === 'linkhub')
|
|
160
|
+
return `<div class="jaro-container-linkhub">${value}</div>`;
|
|
161
|
+
return value;
|
|
162
|
+
}
|
|
163
|
+
function wrapContentDoc(html) {
|
|
164
|
+
const marker = "</div>\n<section";
|
|
165
|
+
const index = html.indexOf(marker);
|
|
166
|
+
if (index === -1)
|
|
167
|
+
return html;
|
|
168
|
+
const sidebar = html.substring(0, index + 6); // inclui </div>
|
|
169
|
+
const content = html.substring(index + 6);
|
|
170
|
+
return `${sidebar}
|
|
171
|
+
<div class="jaro-content">
|
|
172
|
+
${content}
|
|
173
|
+
</div>`;
|
|
174
|
+
}
|
|
175
|
+
const BASE_PAGE_CSS = `
|
|
176
|
+
:root[data-theme="dark"] { --jaro-bg: #0F0F0D; --jaro-fg: #f4f4f5; --line: #1E1C18; --muted: #666; --text: #F0EFEB; --jaro-code: #8BAD6B; --jaro-code-bg: #0C0C0B;}
|
|
177
|
+
:root[data-theme="light"] { --jaro-bg: #EBDFC7; --jaro-fg: #0b0b0d; --line: #EBEBDF; --muted: #0b0b0d; --text: #C47A45; --jaro-code: #8BAD6B; --jaro-code-bg: #EBEBDF;}
|
|
178
|
+
.jaro-page { --jaro: #C47A45; background: var(--jaro-bg, #fff); color: var(--jaro-fg, #0b0b0d); font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; margin: 0; }
|
|
179
|
+
.jaro-img {width: 100%;}
|
|
180
|
+
`;
|
|
181
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/components/page.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACzC,MAAM,EAAE;gBACN,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,CAAC;gBACnF,QAAQ,EAAE,KAAK;aAChB;YACD,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAA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;MAEf,OAAO;WACF,CAAC;AACZ,CAAC;AAED,MAAM,aAAa,GAAG;;;;;CAKrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/components/post.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,eAAO,MAAM,aAAa,EAAE,mBAsC3B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const postComponent = {
|
|
2
|
+
kind: "post",
|
|
3
|
+
displayName: "Blog Post",
|
|
4
|
+
schema: {
|
|
5
|
+
kind: "post",
|
|
6
|
+
attributes: {
|
|
7
|
+
title: { type: "string", required: true },
|
|
8
|
+
date: { type: "string", required: false },
|
|
9
|
+
// Declared as "string" here because the generic parser intentionally
|
|
10
|
+
// does not auto-split comma-bearing attribute values (splitting is
|
|
11
|
+
// component-specific — see coerceAttrValue in @jaroslava/parser).
|
|
12
|
+
// @post accepts either a comma-separated string ("UX, Psychology")
|
|
13
|
+
// or, if constructed programmatically, a real string[]; both are
|
|
14
|
+
// normalized to an array at render time via `splitTags` below.
|
|
15
|
+
tags: { type: "string", required: false },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
render(node, renderedChildren) {
|
|
19
|
+
const title = String(node.attrs.title ?? "");
|
|
20
|
+
const date = node.attrs.date ? String(node.attrs.date) : '';
|
|
21
|
+
const tags = splitTags(node.attrs.tags);
|
|
22
|
+
const html = [
|
|
23
|
+
`<article class="jaro-post">`,
|
|
24
|
+
` <span class="jaro-post-meta">${formatDate(date)} · ${tags.map((t) => `${String(t).trim()}`).join(" · ")}</span>`,
|
|
25
|
+
` <h2 class="jaro-post-title">${title}</h2>`,
|
|
26
|
+
` <div class="jaro-post-body">${renderedChildren}</div>`,
|
|
27
|
+
`</article>`,
|
|
28
|
+
]
|
|
29
|
+
.filter(Boolean)
|
|
30
|
+
.join("\n");
|
|
31
|
+
const css = [
|
|
32
|
+
".jaro-post {margin-bottom: 2rem;}",
|
|
33
|
+
".jaro-post-meta {font-size: 0.68rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.3rem;}",
|
|
34
|
+
".jaro-post-title {font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem;}",
|
|
35
|
+
];
|
|
36
|
+
return { html, css };
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* `tags` is conceptually a list, but the generic parser deliberately keeps
|
|
41
|
+
* comma-bearing attribute values as plain strings (splitting is component-
|
|
42
|
+
* specific, not a language-level rule). @post owns the decision to split
|
|
43
|
+
* its own `tags` field here, at render time.
|
|
44
|
+
*/
|
|
45
|
+
function splitTags(value) {
|
|
46
|
+
if (Array.isArray(value))
|
|
47
|
+
return value.map(String);
|
|
48
|
+
if (typeof value === "string") {
|
|
49
|
+
return value
|
|
50
|
+
.split(",")
|
|
51
|
+
.map((t) => t.trim())
|
|
52
|
+
.filter(Boolean);
|
|
53
|
+
}
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
function formatDate(dateStr) {
|
|
57
|
+
if (dateStr == "")
|
|
58
|
+
return "";
|
|
59
|
+
const date = new Date(dateStr);
|
|
60
|
+
return date.toLocaleDateString('en-US', {
|
|
61
|
+
month: 'short',
|
|
62
|
+
day: 'numeric',
|
|
63
|
+
year: 'numeric'
|
|
64
|
+
}).replace(',', '');
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../src/components/post.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,WAAW;IACxB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IA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AI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK;aACT,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,UAAU,CAAC,OAAgB;IAClC,IAAG,OAAO,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC;IAE5B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IAE/B,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;QACtC,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/components/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,eAAO,MAAM,gBAAgB,EAAE,mBAsC9B,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,UAGxC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const profileComponent = {
|
|
2
|
+
kind: "profile",
|
|
3
|
+
displayName: "Profile",
|
|
4
|
+
schema: {
|
|
5
|
+
kind: "profile",
|
|
6
|
+
attributes: {
|
|
7
|
+
name: { type: "string", required: true },
|
|
8
|
+
role: { type: "string", required: false },
|
|
9
|
+
avatar: { type: "string", required: false },
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
render(node) {
|
|
13
|
+
const name = String(node.attrs.name ?? "");
|
|
14
|
+
const role = String(node.attrs.role ?? "");
|
|
15
|
+
const avatar = String(node.attrs.avatar ?? "");
|
|
16
|
+
const html = [
|
|
17
|
+
`<section class="jaro-profile">`,
|
|
18
|
+
avatar
|
|
19
|
+
? ` <img class="jaro-avatar" src="${avatar}" alt="${name}" />`
|
|
20
|
+
: ` <div class="jaro-avatar">${getInicials(name)}</div>`,
|
|
21
|
+
` <h1 class="jaro-profile-name">${name}</h1>`,
|
|
22
|
+
role ? ` <p class="jaro-profile-role">${role}</p>` : "",
|
|
23
|
+
`</section>`,
|
|
24
|
+
]
|
|
25
|
+
.filter(Boolean)
|
|
26
|
+
.join("\n");
|
|
27
|
+
return {
|
|
28
|
+
html,
|
|
29
|
+
css: [
|
|
30
|
+
".jaro-profile { display:flex; flex-direction:column; align-items:center; text-align:center; padding:4rem 1.5rem; }",
|
|
31
|
+
".jaro-avatar { display: flex; justify-content: center; align-items: center; width:88px; height:88px; border-radius:50%; object-fit:cover; border:2px solid var(--line); margin-bottom:1.5rem; color: white; font-size: xx-large;}",
|
|
32
|
+
".jaro-profile-name { margin:0; font-size:2rem; font-weight:400; line-height:1.2; color:var(--jaro-text,#fff); }",
|
|
33
|
+
".jaro-profile-role { margin-top:0.5rem; margin-bottom:0; font-size:0.875rem; color:var(--muted); letter-spacing:0.08em; }",
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export function getInicials(value) {
|
|
39
|
+
if (value.trim() === "")
|
|
40
|
+
return "";
|
|
41
|
+
return `${value.split(" ")?.at(0)?.at(0)?.toUpperCase()}${value.split(" ")?.at(1)?.at(0)?.toUpperCase()}`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/components/profile.ts"],"names":[],"mappings":"AAEA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AAK,EAAE;QAAE,OAAO,EAAE,CAAC;IAClC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC;AAC5G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/components/sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAY,MAAM,kBAAkB,CAAC;AAEtE,eAAO,MAAM,gBAAgB,EAAE,mBAqE9B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export const sidebarComponent = {
|
|
2
|
+
kind: "sidebar",
|
|
3
|
+
displayName: "Sidebar",
|
|
4
|
+
render(node, _renderedChildren, ctx) {
|
|
5
|
+
const items = node.children
|
|
6
|
+
.filter((c) => c.type === "Link")
|
|
7
|
+
.map((link, index) => {
|
|
8
|
+
const href = link.internal ? `#${link.href.replace(/^id:/, "")}` : link.href;
|
|
9
|
+
return ` <div class="jaro-sidebar-item"><a href="${href}">${link.label ?? href}</a></div>`;
|
|
10
|
+
})
|
|
11
|
+
.join("\n");
|
|
12
|
+
return {
|
|
13
|
+
html: `<div class="jaro-sidebar">\n
|
|
14
|
+
<div class="jaro-sidebar-label">Docs</div>
|
|
15
|
+
<div class="jaro-sidebar-list">
|
|
16
|
+
${items}
|
|
17
|
+
</div>
|
|
18
|
+
</div>`,
|
|
19
|
+
css: [
|
|
20
|
+
".jaro-sidebar { border-right: 0.5px solid var(--line); padding-right: 0.75rem; }",
|
|
21
|
+
".jaro-sidebar-label {font-size: 0.68rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1.6rem; font-family: 'Space Grotesk', sans-serif;}",
|
|
22
|
+
".jaro-sidebar-list {display: flex; flex-direction: column; gap: 1rem;}",
|
|
23
|
+
".jaro-sidebar-item {font-size: 0.75rem; color: #444;}",
|
|
24
|
+
"a {font-size: 0.75rem; color: #444; text-decoration: none;}",
|
|
25
|
+
".active > a, a:hover {font-weight: 500; color: var(--jaro)}",
|
|
26
|
+
],
|
|
27
|
+
head: [
|
|
28
|
+
`<script>
|
|
29
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
30
|
+
const heroes = document.querySelectorAll(".jaro-hero");
|
|
31
|
+
const items = document.querySelectorAll(".jaro-sidebar-item");
|
|
32
|
+
const links = document.querySelectorAll('.jaro-sidebar a[href^="#"]');
|
|
33
|
+
|
|
34
|
+
heroes.forEach(hero => {
|
|
35
|
+
hero.style.display = "none";
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
if (heroes.length > 0) {
|
|
39
|
+
heroes[0].style.display = "";
|
|
40
|
+
items[0].classList.add("active");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
links.forEach(link => {
|
|
44
|
+
link.addEventListener("click", e => {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
|
|
47
|
+
const id = link.getAttribute("href").substring(1);
|
|
48
|
+
const hero = document.getElementById(id);
|
|
49
|
+
|
|
50
|
+
if (hero) {
|
|
51
|
+
heroes.forEach(hero => {
|
|
52
|
+
hero.style.display = "none";
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
items.forEach(item => {
|
|
56
|
+
item.classList.remove("active");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
hero.style.display = "";
|
|
61
|
+
link.parentNode.classList.add("active");
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
</script>`
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../src/components/sidebar.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAwB;IACnD,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,SAAS;IACtB,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ;aACxB,MAAM,CAAC,CAAC,CAAC,EAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;aAC/C,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACnB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC7E,OAAO,6CAA6C,IAAI,KAAK,IAAI,CAAC,KAAK,IAAI,IAAI,YAAY,CAAC;QAC9F,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,OAAO;YACL,IAAI,EAAE;;;YAGA,KAAK;;aAEJ;YACP,GAAG,EAAE;gBACH,kFAAkF;gBAClF,mLAAmL;gBACnL,wEAAwE;gBACxE,uDAAuD;gBACvD,6DAA6D;gBAC7D,6DAA6D;aAC9D;YACD,IAAI,EAAE;gBACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsCY;aACb;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { JaroslavaPlugin } from "@jaroslava/types";
|
|
2
|
+
import { pageComponent } from "./components/page.js";
|
|
3
|
+
import { profileComponent } from "./components/profile.js";
|
|
4
|
+
import { listComponent } from "./components/list.js";
|
|
5
|
+
import { postComponent } from "./components/post.js";
|
|
6
|
+
import { heroComponent } from "./components/hero.js";
|
|
7
|
+
import { gridComponent, cardComponent } from "./components/grid-and-card.js";
|
|
8
|
+
import { sidebarComponent } from "./components/sidebar.js";
|
|
9
|
+
import { codeComponent } from "./components/code.js";
|
|
10
|
+
/**
|
|
11
|
+
* The standard Jaroslava component set, packaged as an ordinary plugin.
|
|
12
|
+
* Consumers opt in explicitly:
|
|
13
|
+
*
|
|
14
|
+
* import { coreComponentsPlugin } from "@jaroslava/plugin-core-components";
|
|
15
|
+
* const ctx = await JaroslavaContext.create({ plugins: [coreComponentsPlugin] });
|
|
16
|
+
*
|
|
17
|
+
* Nothing in @jaroslava/core, @jaroslava/parser, @jaroslava/validator, or
|
|
18
|
+
* @jaroslava/renderer-html imports this package. A third-party plugin
|
|
19
|
+
* (e.g. @acme/jaroslava-plugin-testimonial) is installed exactly the same
|
|
20
|
+
* way and has equal standing in the registry.
|
|
21
|
+
*/
|
|
22
|
+
export declare const coreComponentsPlugin: JaroslavaPlugin;
|
|
23
|
+
export { pageComponent, profileComponent, listComponent, postComponent, heroComponent, gridComponent, cardComponent, sidebarComponent, codeComponent, };
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAalC,CAAC;AAEF,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,aAAa,GACd,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { pageComponent } from "./components/page.js";
|
|
2
|
+
import { profileComponent } from "./components/profile.js";
|
|
3
|
+
import { listComponent } from "./components/list.js";
|
|
4
|
+
import { postComponent } from "./components/post.js";
|
|
5
|
+
import { heroComponent } from "./components/hero.js";
|
|
6
|
+
import { gridComponent, cardComponent } from "./components/grid-and-card.js";
|
|
7
|
+
import { sidebarComponent } from "./components/sidebar.js";
|
|
8
|
+
import { codeComponent } from "./components/code.js";
|
|
9
|
+
/**
|
|
10
|
+
* The standard Jaroslava component set, packaged as an ordinary plugin.
|
|
11
|
+
* Consumers opt in explicitly:
|
|
12
|
+
*
|
|
13
|
+
* import { coreComponentsPlugin } from "@jaroslava/plugin-core-components";
|
|
14
|
+
* const ctx = await JaroslavaContext.create({ plugins: [coreComponentsPlugin] });
|
|
15
|
+
*
|
|
16
|
+
* Nothing in @jaroslava/core, @jaroslava/parser, @jaroslava/validator, or
|
|
17
|
+
* @jaroslava/renderer-html imports this package. A third-party plugin
|
|
18
|
+
* (e.g. @acme/jaroslava-plugin-testimonial) is installed exactly the same
|
|
19
|
+
* way and has equal standing in the registry.
|
|
20
|
+
*/
|
|
21
|
+
export const coreComponentsPlugin = {
|
|
22
|
+
name: "@jaroslava/plugin-core-components",
|
|
23
|
+
components: [
|
|
24
|
+
pageComponent,
|
|
25
|
+
profileComponent,
|
|
26
|
+
listComponent,
|
|
27
|
+
postComponent,
|
|
28
|
+
heroComponent,
|
|
29
|
+
gridComponent,
|
|
30
|
+
cardComponent,
|
|
31
|
+
sidebarComponent,
|
|
32
|
+
codeComponent,
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
export { pageComponent, profileComponent, listComponent, postComponent, heroComponent, gridComponent, cardComponent, sidebarComponent, codeComponent, };
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAoB;IACnD,IAAI,EAAE,mCAAmC;IACzC,UAAU,EAAE;QACV,aAAa;QACb,gBAAgB;QAChB,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,gBAAgB;QAChB,aAAa;KACd;CACF,CAAC;AAEF,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,aAAa,GACd,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jaroslava/plugin-core-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The standard Jaroslava component set (page, profile, list, post, hero, grid, card, sidebar, code) implemented as an ordinary plugin — no special privileges over third-party plugins.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@jaroslava/types": "1.0.0",
|
|
20
|
+
"@jaroslava/utils": "1.0.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.5.0",
|
|
24
|
+
"rimraf": "^5.0.0",
|
|
25
|
+
"vitest": "^1.6.0"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc -b",
|
|
32
|
+
"dev": "tsc -b --watch",
|
|
33
|
+
"clean": "rimraf dist *.tsbuildinfo",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"test": "vitest run"
|
|
36
|
+
}
|
|
37
|
+
}
|