@lupinum/ginko 0.4.0 → 0.5.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/README.md +2 -2
  3. package/dist/basics.d.mts +492 -0
  4. package/dist/basics.d.ts +492 -0
  5. package/dist/basics.mjs +416 -0
  6. package/dist/cli/index.mjs +54 -55
  7. package/dist/index.d.mts +5 -4
  8. package/dist/index.d.ts +5 -4
  9. package/dist/index.mjs +3 -3
  10. package/dist/internal/search.mjs +6 -3
  11. package/dist/internal.d.mts +387 -41
  12. package/dist/internal.d.ts +387 -41
  13. package/dist/internal.mjs +267 -101
  14. package/dist/nuxt/module.d.mts +2 -2
  15. package/dist/nuxt/module.d.ts +2 -2
  16. package/dist/nuxt/module.mjs +105 -13
  17. package/dist/nuxt/runtime/GinkoImage.d.mts +1 -1
  18. package/dist/nuxt/runtime/GinkoMarkdown.mjs +2 -2
  19. package/dist/nuxt/runtime/composables.d.mts +4 -3
  20. package/dist/nuxt/runtime/composables.mjs +19 -15
  21. package/dist/nuxt/runtime/fetch.d.mts +3 -1
  22. package/dist/nuxt/runtime/fetch.mjs +12 -6
  23. package/dist/nuxt/runtime/markdown.d.mts +3 -0
  24. package/dist/nuxt/runtime/markdown.mjs +15 -3
  25. package/dist/nuxt/runtime/plugin.mjs +6 -35
  26. package/dist/nuxt/runtime/preview-listener.d.mts +13 -0
  27. package/dist/nuxt/runtime/preview-listener.mjs +37 -0
  28. package/dist/nuxt/runtime/preview.vue +3 -1
  29. package/dist/nuxt/runtime/schema.d.ts +6 -0
  30. package/dist/nuxt/runtime/server/bundles.d.ts +4 -0
  31. package/dist/nuxt/runtime/server/files-md.d.ts +2 -0
  32. package/dist/nuxt/runtime/server/files.d.ts +2 -0
  33. package/dist/nuxt/runtime/server/headers.d.ts +2 -0
  34. package/dist/nuxt/runtime/server/items.d.mts +12 -0
  35. package/dist/nuxt/runtime/server/items.d.ts +12 -0
  36. package/dist/nuxt/runtime/server/items.mjs +17 -0
  37. package/dist/nuxt/runtime/server/llms-full.d.ts +2 -0
  38. package/dist/nuxt/runtime/server/llms.d.ts +2 -0
  39. package/dist/nuxt/runtime/server/markdown-trees.d.ts +2 -0
  40. package/dist/nuxt/runtime/server/markdown.d.ts +2 -0
  41. package/dist/nuxt/runtime/server/markdown.mjs +1 -1
  42. package/dist/nuxt/runtime/server/platform-md.d.mts +3 -0
  43. package/dist/nuxt/runtime/server/platform-md.d.ts +3 -0
  44. package/dist/nuxt/runtime/server/platform-md.mjs +71 -0
  45. package/dist/nuxt/runtime/server/redirects.d.ts +2 -0
  46. package/dist/nuxt/runtime/server/robots.d.ts +2 -0
  47. package/dist/nuxt/runtime/server/search.d.ts +2 -0
  48. package/dist/nuxt/runtime/server/site-config.d.ts +14 -0
  49. package/dist/nuxt/runtime/server/sitemap-source.d.ts +2 -0
  50. package/dist/nuxt/runtime/server/sitemap-xml.d.ts +24 -0
  51. package/dist/nuxt/runtime/server/sitemap.d.ts +2 -0
  52. package/dist/nuxt/runtime/shared.d.mts +10 -3
  53. package/dist/nuxt/runtime/shared.mjs +2 -2
  54. package/dist/shared/ginko.1wwZv4B_.d.ts +1622 -0
  55. package/dist/shared/{ginko.BBkZW2nW.d.ts → ginko.6cI8KXZP.d.mts} +2 -2
  56. package/dist/shared/{ginko.CQvxhyez.mjs → ginko.AprJymER.mjs} +30 -1
  57. package/dist/shared/ginko.BNVC-g9n.mjs +10389 -0
  58. package/dist/shared/{ginko.Bwan3BB-.d.mts → ginko.B_pACpVU.d.ts} +2 -2
  59. package/dist/shared/{ginko.CrNRBkS5.mjs → ginko.C4gcOovG.mjs} +253 -309
  60. package/dist/shared/{ginko.C90fPpMP.mjs → ginko.CXA2R3aS.mjs} +128 -101
  61. package/dist/shared/ginko.CjWB8N7f.d.ts +128 -0
  62. package/dist/shared/ginko.D1PeQ3ds.mjs +36 -0
  63. package/dist/shared/ginko.DIl7l-75.mjs +26 -0
  64. package/dist/shared/ginko.DY7RbCEw.mjs +601 -0
  65. package/dist/shared/ginko.Dmgixfpf.mjs +130 -0
  66. package/dist/shared/{ginko.D-fNojn9.d.mts → ginko.DrkUeYFP.d.mts} +824 -10
  67. package/dist/shared/{ginko.D-fNojn9.d.ts → ginko.DrkUeYFP.d.ts} +824 -10
  68. package/dist/shared/{ginko.akHewCGt.d.mts → ginko.DvPtlHIz.d.mts} +50 -5
  69. package/dist/shared/{ginko.BDF3bW0C.d.ts → ginko.EelR5dt9.d.ts} +50 -5
  70. package/dist/shared/ginko.ULKQnAWd.d.ts +91 -0
  71. package/dist/shared/ginko.loGIxGZg.d.mts +91 -0
  72. package/dist/shared/ginko.o1yIKlgj.d.mts +128 -0
  73. package/dist/shared/ginko.plW4dLmm.d.mts +1622 -0
  74. package/dist/shared/{ginko.Dht0xxE5.mjs → ginko.raCzOPYC.mjs} +1 -2
  75. package/dist/shared/ginko.yKMIjJ68.mjs +84 -0
  76. package/dist/vue.d.mts +5 -4
  77. package/dist/vue.d.ts +5 -4
  78. package/dist/vue.mjs +1 -1
  79. package/i18n/ar.json +212 -0
  80. package/i18n/de.json +9 -1
  81. package/i18n/en.json +9 -1
  82. package/i18n/es.json +12 -4
  83. package/i18n/fr.json +212 -0
  84. package/i18n/it.json +212 -0
  85. package/package.json +7 -3
  86. package/dist/shared/ginko.BTUfZCfa.d.mts +0 -172
  87. package/dist/shared/ginko.C-QjDn3O.mjs +0 -4944
  88. package/dist/shared/ginko.Dc0oNcDv.d.ts +0 -172
  89. package/dist/shared/ginko.Mn30dmlm.mjs +0 -20
@@ -0,0 +1,130 @@
1
+ function defineSite(site) {
2
+ return site;
3
+ }
4
+ function withoutFiles(site) {
5
+ const bricks = Object.fromEntries(Object.entries(site.bricks).map(([key, { source: _, ...brick }]) => [key, brick]));
6
+ return { ...site, bricks };
7
+ }
8
+ function single(input) {
9
+ return { kind: "single", ...input, tasks: input.tasks };
10
+ }
11
+ function collection(input) {
12
+ return { kind: "collection", ...input, tasks: input.tasks };
13
+ }
14
+
15
+ function seoHead(input) {
16
+ const { siteName, description, image, noindex } = input;
17
+ const title = input.title || void 0;
18
+ const template = input.titleTemplate ?? `%s \xB7 ${siteName}`;
19
+ const fullTitle = title ? template.replace("%s", () => title) : siteName;
20
+ const meta = [
21
+ { name: "description", content: description ?? "" },
22
+ { name: "robots", content: noindex ? "noindex, follow" : "" },
23
+ { property: "og:title", content: title ?? siteName },
24
+ { property: "og:description", content: description ?? "" },
25
+ { property: "og:type", content: input.type ?? "website" },
26
+ { property: "og:site_name", content: siteName },
27
+ { property: "og:image", content: image?.url ?? "" },
28
+ { property: "og:image:width", content: image?.width === void 0 ? "" : String(image.width) },
29
+ { property: "og:image:height", content: image?.height === void 0 ? "" : String(image.height) },
30
+ { property: "og:image:alt", content: image?.alt ?? "" },
31
+ { name: "twitter:card", content: image ? "summary_large_image" : "summary" }
32
+ ];
33
+ return { title: fullTitle, meta: meta.filter((m) => m.content !== "") };
34
+ }
35
+ function isPreviewHost(host, siteUrl) {
36
+ const bare = (h) => h.toLowerCase().replace(/^www\./, "");
37
+ return bare(host ?? "") !== bare(new URL(siteUrl).host);
38
+ }
39
+ function robotsTxt(options) {
40
+ if (options.noindex) return "User-agent: *\nDisallow: /\n";
41
+ const rules = options.disallow?.length ? options.disallow.map((path) => `Disallow: ${path}`) : ["Allow: /"];
42
+ const lines = ["User-agent: *", ...rules];
43
+ if (options.sitemap) lines.push("", `Sitemap: ${options.sitemap}`);
44
+ return `${lines.join("\n")}
45
+ `;
46
+ }
47
+ const compact = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0 && v !== "" && !(Array.isArray(v) && v.length === 0)));
48
+ function postalAddressLd(a) {
49
+ if (!a.street && !a.postalCode && !a.city) return void 0;
50
+ return compact({ "@type": "PostalAddress", streetAddress: a.street, postalCode: a.postalCode, addressLocality: a.city, addressCountry: a.country });
51
+ }
52
+ function websiteLd(o) {
53
+ return { "@context": "https://schema.org", "@type": "WebSite", name: o.name, url: o.url, inLanguage: o.lang };
54
+ }
55
+ function withCountry(node, country) {
56
+ if (!country || node === null || typeof node !== "object") return node;
57
+ if (Array.isArray(node)) return node.map((item) => withCountry(item, country));
58
+ const out = Object.fromEntries(Object.entries(node).map(([key, value]) => [key, withCountry(value, country)]));
59
+ if (out["@type"] === "PostalAddress" && out.addressCountry === void 0) out.addressCountry = country;
60
+ if (out["@type"] === "JobPosting" && out.jobLocationType === "TELECOMMUTE" && out.applicantLocationRequirements === void 0) {
61
+ out.applicantLocationRequirements = { "@type": "Country", name: country };
62
+ }
63
+ return out;
64
+ }
65
+ const ORGANIZATION_TYPES = ["Organization", "LocalBusiness", "NGO"];
66
+ function organizationLd(o) {
67
+ return compact({
68
+ "@context": "https://schema.org",
69
+ "@type": o.type ?? "Organization",
70
+ name: o.name,
71
+ legalName: o.legalName,
72
+ url: o.url,
73
+ logo: o.logo,
74
+ email: o.email,
75
+ telephone: o.telephone,
76
+ address: o.address && postalAddressLd(o.address),
77
+ vatID: o.vatID,
78
+ sameAs: o.sameAs
79
+ });
80
+ }
81
+ function breadcrumbJsonLd(steps, siteUrl) {
82
+ return {
83
+ "@context": "https://schema.org",
84
+ "@type": "BreadcrumbList",
85
+ itemListElement: steps.map((step, i) => ({ "@type": "ListItem", position: i + 1, name: step.title, item: new URL(step.path, siteUrl).href }))
86
+ };
87
+ }
88
+ function articleLd(o) {
89
+ const person = (a) => compact({ "@type": "Person", name: a.name, url: a.url });
90
+ return compact({
91
+ "@context": "https://schema.org",
92
+ "@type": o.type ?? "Article",
93
+ headline: o.title,
94
+ url: o.url,
95
+ description: o.description,
96
+ image: o.image,
97
+ datePublished: o.published,
98
+ dateModified: o.modified,
99
+ author: typeof o.author === "string" ? person({ name: o.author }) : o.author?.map(person),
100
+ keywords: o.keywords?.join(", "),
101
+ inLanguage: o.lang
102
+ });
103
+ }
104
+ function faqLd(pairs) {
105
+ return {
106
+ "@context": "https://schema.org",
107
+ "@type": "FAQPage",
108
+ mainEntity: pairs.map((p) => ({ "@type": "Question", name: p.question, acceptedAnswer: { "@type": "Answer", text: p.answer } }))
109
+ };
110
+ }
111
+ function siteHeaders(input) {
112
+ return {
113
+ "content-security-policy": input.preview && input.platformOrigin ? `frame-ancestors ${input.platformOrigin}` : `frame-ancestors 'self'`,
114
+ "x-content-type-options": "nosniff",
115
+ "referrer-policy": "strict-origin-when-cross-origin",
116
+ ...input.noindex ? { "x-robots-tag": "noindex" } : {}
117
+ };
118
+ }
119
+
120
+ function minorDigits(currency) {
121
+ return new Intl.NumberFormat("en", { style: "currency", currency }).resolvedOptions().maximumFractionDigits ?? 2;
122
+ }
123
+ function formatMoney(money, language, options = {}) {
124
+ const digits = minorDigits(money.currency);
125
+ const whole = options.wholeWithoutMinor === true && money.amount % 10 ** digits === 0;
126
+ const text = new Intl.NumberFormat(language, { style: "currency", currency: money.currency, ...whole ? { minimumFractionDigits: 0, maximumFractionDigits: 0 } : {} }).format(money.amount / 10 ** digits);
127
+ return text.replace(/\s/g, "\xA0");
128
+ }
129
+
130
+ export { ORGANIZATION_TYPES as O, compact as a, breadcrumbJsonLd as b, collection as c, defineSite as d, articleLd as e, formatMoney as f, faqLd as g, seoHead as h, isPreviewHost as i, siteHeaders as j, websiteLd as k, withCountry as l, minorDigits as m, organizationLd as o, postalAddressLd as p, robotsTxt as r, single as s, withoutFiles as w };