@lupinum/ginko 0.4.0 → 0.6.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 (90) hide show
  1. package/CHANGELOG.md +161 -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 +59 -56
  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 +108 -15
  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.BBkZW2nW.d.ts → ginko.6cI8KXZP.d.mts} +2 -2
  55. package/dist/shared/{ginko.CrNRBkS5.mjs → ginko.B1-DoOea.mjs} +253 -309
  56. package/dist/shared/ginko.BNVC-g9n.mjs +10389 -0
  57. package/dist/shared/{ginko.Bwan3BB-.d.mts → ginko.B_pACpVU.d.ts} +2 -2
  58. package/dist/shared/ginko.BaFweQcB.d.mts +91 -0
  59. package/dist/shared/ginko.BiDXgjLy.d.ts +91 -0
  60. package/dist/shared/ginko.C-oz8wwI.mjs +95 -0
  61. package/dist/shared/{ginko.BDF3bW0C.d.ts → ginko.CLzVaDi4.d.ts} +56 -5
  62. package/dist/shared/ginko.C_nq6vk7.d.mts +1622 -0
  63. package/dist/shared/ginko.CjWB8N7f.d.ts +128 -0
  64. package/dist/shared/ginko.D1PeQ3ds.mjs +36 -0
  65. package/dist/shared/ginko.D2oht0Kx.d.ts +1622 -0
  66. package/dist/shared/ginko.DCHGkQ7P.mjs +116 -0
  67. package/dist/shared/ginko.DIl7l-75.mjs +26 -0
  68. package/dist/shared/{ginko.akHewCGt.d.mts → ginko.DkIc0ZZk.d.mts} +56 -5
  69. package/dist/shared/{ginko.D-fNojn9.d.mts → ginko.DrkUeYFP.d.mts} +824 -10
  70. package/dist/shared/{ginko.D-fNojn9.d.ts → ginko.DrkUeYFP.d.ts} +824 -10
  71. package/dist/shared/ginko.WAfoMhv1.mjs +601 -0
  72. package/dist/shared/ginko.o1yIKlgj.d.mts +128 -0
  73. package/dist/shared/{ginko.Dht0xxE5.mjs → ginko.raCzOPYC.mjs} +1 -2
  74. package/dist/shared/{ginko.C90fPpMP.mjs → ginko.t-gbwzxh.mjs} +128 -101
  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.CQvxhyez.mjs +0 -40
  89. package/dist/shared/ginko.Dc0oNcDv.d.ts +0 -172
  90. package/dist/shared/ginko.Mn30dmlm.mjs +0 -20
package/i18n/it.json ADDED
@@ -0,0 +1,212 @@
1
+ {
2
+ "issues": {
3
+ "unknownBrick": "Il blocco “{brick}” non esiste.",
4
+ "markdown": "“{label}”: {problem}",
5
+ "markdownAt": "“{label}”, riga {line}: {problem}",
6
+ "notObject": "È previsto un oggetto.",
7
+ "unknownField": "Campo sconosciuto.",
8
+ "fieldMissing": "Manca “{label}”.",
9
+ "notLocalized": "“{label}” deve essere salvato per lingua.",
10
+ "unknownLocale": "La lingua “{locale}” non è configurata.",
11
+ "fieldEmpty": "“{label}” è vuoto.",
12
+ "notText": "“{label}” deve essere un testo.",
13
+ "tooLong": "“{label}” è troppo lungo (al massimo {max} caratteri).",
14
+ "controlChars": "“{label}” contiene caratteri di controllo invisibili.",
15
+ "badFormat": "“{label}” non ha un formato valido.",
16
+ "badSlug": "“{label}” non è un indirizzo valido.",
17
+ "notNumber": "“{label}” deve essere un numero.",
18
+ "outOfRange": "“{label}” deve essere compreso tra {min} e {max}.",
19
+ "badStep": "“{label}” non corrisponde al passo {step}.",
20
+ "notMoney": "“{label}” deve essere un importo in centesimi.",
21
+ "moneyOutOfRange": "“{label}” è fuori dai limiti.",
22
+ "notBoolean": "“{label}” deve essere sì o no.",
23
+ "badDate": "“{label}” non è una data valida.",
24
+ "badTime": "“{label}” non è un orario valido.",
25
+ "badDateRange": "“{label}” non è un periodo valido.",
26
+ "dateRangeOrder": "“{label}”: “dal” viene dopo “al”.",
27
+ "timeOrder": "“{end}” deve essere dopo “{start}”.",
28
+ "notWeekStart": "“{label}” deve essere il primo giorno di una settimana.",
29
+ "badChoice": "“{label}” ha un valore non valido.",
30
+ "badChoices": "“{label}” ha valori non validi.",
31
+ "duplicateValues": "“{label}” contiene valori duplicati.",
32
+ "tooManyChosen": "“{label}”: al massimo {max}.",
33
+ "notIdList": "“{label}” deve essere un elenco di ID di voci.",
34
+ "notId": "“{label}” deve essere l’ID di una voce.",
35
+ "duplicateEntries": "“{label}” contiene voci duplicate.",
36
+ "refGone": "“{label}”: la voce non esiste più.",
37
+ "notList": "“{label}” deve essere un elenco.",
38
+ "tooManyRows": "“{label}” ha troppi elementi (al massimo {max}).",
39
+ "tooFewRows": "“{label}” richiede almeno {min} elementi.",
40
+ "duplicateRowValue": "“{label}”: “{value}” compare più di una volta.",
41
+ "badRowId": "“{label}”: la riga {row} non ha un ID valido.",
42
+ "duplicateRowId": "“{label}”: un ID di riga compare due volte.",
43
+ "notImage": "“{label}” non è un’immagine valida.",
44
+ "altMissing": "“{label}”: manca la descrizione dell’immagine (testo alternativo).",
45
+ "fileRefMissing": "“{label}”: un’immagine nel testo non è più nella libreria dei file. Sceglila di nuovo.",
46
+ "fileRefPdf": "Un PDF non può essere mostrato come immagine. Inseriscilo come link: [testo]($file.…).",
47
+ "markdownImageAltMissing": "“{label}”: un’immagine nel testo non ha una descrizione. Descrivila in breve per chi non può vederla.",
48
+ "altTooLong": "“{label}”: il testo alternativo è troppo lungo.",
49
+ "notFile": "“{label}” non è un file valido."
50
+ },
51
+ "file": {
52
+ "typeNotAllowed": "Questo tipo di file non è consentito (consentiti: {allowed}).",
53
+ "tooBig": "Il file è troppo grande (al massimo {max, number} MB)."
54
+ },
55
+ "markdown": {
56
+ "profile": {
57
+ "inline": "solo testo con grassetto, corsivo, codice e link",
58
+ "basic": "paragrafi, titoli, elenchi (anche con caselle di controllo), citazioni, avvisi e note a piè di pagina",
59
+ "rich": "anche tabelle, immagini, blocchi di codice, formule e diagrammi",
60
+ "page": "anche componenti"
61
+ },
62
+ "tagBlocked": "“{tag}” non è consentito.",
63
+ "tagNotInProfile": "“{tag}” non è consentito qui ({allowed}).",
64
+ "propBlocked": "La proprietà “{prop}” non è consentita.",
65
+ "unsafeLink": "Link non consentito (solo http, https, mailto, tel o /percorso).",
66
+ "oneParagraph": "Qui è consentito un solo paragrafo.",
67
+ "tooComplex": "Il testo è troppo complesso (al massimo {max} elementi).",
68
+ "componentNotClosed": "Il componente “{tag}” non è chiuso: dopo il suo contenuto manca una riga con “{close}”.",
69
+ "bracketText": "“[{text}” non è né un link né un’immagine: manca una “]” o l’indirizzo tra parentesi tonde. Parentesi quadre come testo: \\[ e \\]."
70
+ },
71
+ "component": {
72
+ "or": "{first} o {second}",
73
+ "and": "{first}, {second}",
74
+ "quoted": "“{name}”",
75
+ "unknown": "Il componente “{tag}” non esiste.",
76
+ "propUnknown": "Componente “{tag}”: la proprietà “{prop}” non esiste.",
77
+ "propInvalid": "Componente “{tag}”: la proprietà “{prop}” {problem}",
78
+ "propMissing": "Componente “{tag}”: manca la proprietà “{prop}”.",
79
+ "propEmpty": "Componente “{tag}”: la proprietà “{prop}” è vuota.",
80
+ "blockInParagraph": "Il componente “{tag}” è un blocco e non può stare in un paragrafo.",
81
+ "parentOnly": "Il componente “{tag}” può comparire solo in {parents}.",
82
+ "slotUnknown": "Componente “{tag}”: l’area “{slot}” non esiste (consentite: {allowed}).",
83
+ "noSlots": "Componente “{tag}”: non ha aree, “{slot}” non è consentita.",
84
+ "childNotAllowed": "Il componente “{tag}” può contenere solo {children}, non “{child}”.",
85
+ "prop": {
86
+ "notBoolean": "deve essere “true” o “false”.",
87
+ "notNumber": "deve essere un numero.",
88
+ "outOfRange": "deve essere compresa tra {min} e {max}.",
89
+ "badStep": "non corrisponde al passo {step}.",
90
+ "notText": "deve essere un testo.",
91
+ "tooLong": "è troppo lunga (al massimo {max} caratteri).",
92
+ "badChoice": "ha un valore non valido (consentiti: {allowed}).",
93
+ "badChoices": "ha valori non validi (consentiti: {allowed}).",
94
+ "duplicateValues": "contiene valori duplicati.",
95
+ "tooManyChosen": "ammette al massimo {max} valori.",
96
+ "badImage": "deve essere un percorso o un indirizzo web.",
97
+ "notId": "deve essere l’ID di una voce.",
98
+ "badType": "ha un tipo non consentito."
99
+ }
100
+ },
101
+ "links": {
102
+ "snippetMissing": "Frammento di testo “{name}” non trovato (voce snippets/{name} con il campo body).",
103
+ "linkBroken": "Il link {href} non porta a nessuna voce né a nessuna pagina.",
104
+ "linkRedirected": "Il link {href} porta a {to} tramite un reindirizzamento.",
105
+ "pathUnknown": "Il percorso {path} non corrisponde a nessuna voce, pagina o file in public/.",
106
+ "anchorMissing": "Manca l’ancora #{anchor}: nessun titolo ha questo id.",
107
+ "externalBroken": "Il link esterno {href} è interrotto ({reason})."
108
+ },
109
+ "editor": {
110
+ "component": {
111
+ "unknown": "“{tag}” non esiste qui.",
112
+ "more": "{first} Controlla {count, plural, one {# altra impostazione} other {# altre impostazioni}}."
113
+ },
114
+ "prop": {
115
+ "missing": "Manca {label}.",
116
+ "empty": "{label} è vuoto.",
117
+ "invalid": "{label} {problem}"
118
+ },
119
+ "problem": {
120
+ "imageNoDescription": "L’immagine non ha una descrizione."
121
+ },
122
+ "source": {
123
+ "unstable": "Il testo cambierebbe al salvataggio, quindi si modifica come Markdown.",
124
+ "lossy": "Il testo non può essere mostrato nell’editor senza perdere qualcosa.",
125
+ "failed": "Il testo non può essere mostrato nell’editor ({reason})."
126
+ }
127
+ },
128
+ "diff": {
129
+ "freshSetting": "{name}: {value}.",
130
+ "freshLocales": "Lingue: {locales}.",
131
+ "siteRenamed": "Il nome del sito (`site`) non può essere modificato.",
132
+ "currencyChanged": "La valuta del sito non può essere modificata.",
133
+ "mainLocaleChanged": "La lingua principale non può essere modificata.",
134
+ "localeRemoved": "La lingua “{locale}” non può essere rimossa.",
135
+ "localeOrder": "Le nuove lingue vanno in fondo all’elenco.",
136
+ "localeAdded": "Nuova lingua “{locale}”.",
137
+ "timezoneChanged": "Il fuso orario non può essere modificato.",
138
+ "valueChanged": "{name} è cambiato.",
139
+ "pagesChanged": "Le pagine statiche sono cambiate.",
140
+ "agentsChanged": "La revisione delle modifiche dell’IA è cambiata.",
141
+ "tasksChanged": "Le attività sono cambiate.",
142
+ "retiredBack": "“{path}” è stato ritirato e non può tornare.",
143
+ "unretired": "“{path}” è stato ritirato.",
144
+ "retiredRuleChanged": "La regola di “{path}” non può essere modificata.",
145
+ "retiredNow": "“{path}” sta per essere ritirato.",
146
+ "migrationChanged": "La migrazione “{id}” è cambiata.",
147
+ "migrationFillsExisting": "La migrazione “{id}” riempie “{target}”, che esiste già.",
148
+ "migrationAdded": "Nuova migrazione “{id}”.",
149
+ "migrationDropped": "La migrazione “{id}” non è più nella configurazione.",
150
+ "brickRemoved": "Manca il blocco “{key}”.",
151
+ "brickAdded": "Nuovo blocco “{key}”.",
152
+ "singleWithoutDefault": "Nuovo blocco singolo: il campo obbligatorio “{name}” ha bisogno di un valore predefinito.",
153
+ "unknownChange": "“{at}”: la proprietà “{prop}” è cambiata, ma non è consentito.",
154
+ "kindChanged": "“{key}” passa da blocco singolo a raccolta, o viceversa.",
155
+ "textChanged": "Il testo è cambiato.",
156
+ "maxLowered": "“{at}”: max non può essere abbassato.",
157
+ "maxRaised": "max è stato alzato.",
158
+ "routeAdded": "Nuove pagine di dettaglio.",
159
+ "routeAddedLocale": "Indirizzo per la nuova lingua.",
160
+ "routeChanged": "“{key}”: gli indirizzi (route) non possono essere modificati.",
161
+ "fieldRemoved": "Manca il campo “{at}”.",
162
+ "fieldAdded": "Nuovo campo “{at}”.",
163
+ "fieldAddedDefault": "Nuovo campo obbligatorio “{at}” con valore predefinito.",
164
+ "fieldAddedMigration": "Nuovo campo obbligatorio “{at}”, riempito da una migrazione.",
165
+ "requiredWithoutDefault": "Nuovo campo obbligatorio “{at}” senza valore predefinito né migrazione.",
166
+ "typeChanged": "“{at}”: tipo {from} → {to}.",
167
+ "retiredFieldChanged": "“{at}”: un campo ritirato mantiene la definizione di produzione.",
168
+ "madeRequired": "“{at}”: facoltativo → obbligatorio.",
169
+ "madeOptional": "“{at}” ora è facoltativo.",
170
+ "translationChanged": "“{at}”: la traducibilità è cambiata.",
171
+ "defaultChanged": "“{at}”: il valore predefinito non può essere modificato.",
172
+ "minRaised": "“{at}”: min non può essere alzato.",
173
+ "minLowered": "min è stato abbassato.",
174
+ "minOffGrid": "“{at}”: min può essere abbassato solo di un multiplo del passo {step}.",
175
+ "propChanged": "“{at}”: {prop} non può essere modificato.",
176
+ "optionRemoved": "“{at}”: manca l’opzione “{option}”.",
177
+ "optionRenamed": "Opzione rinominata.",
178
+ "optionAdded": "Nuova opzione “{option}”.",
179
+ "uniqueChanged": "“{at}”: unique non può essere impostato né modificato.",
180
+ "uniqueDropped": "“{at}”: unique è stato rimosso.",
181
+ "fix": {
182
+ "newField": "Aggiungi un nuovo campo, riempilo con una migrazione ed elenca il vecchio campo sotto `retired`.",
183
+ "newFieldOnly": "Aggiungi un nuovo campo.",
184
+ "newSite": "Crea un nuovo sito.",
185
+ "moneyFields": "Aggiungi nuovi campi di denaro con una `currency` fissa.",
186
+ "planMigration": "Pianifica una migrazione con il tuo team di sviluppo.",
187
+ "keepLocale": "Mantieni la lingua; le pagine in quella lingua possono essere nascoste.",
188
+ "keepLocaleOrder": "Mantieni l’ordine delle lingue esistenti.",
189
+ "keepTimezone": "Mantieni il fuso orario.",
190
+ "keepRule": "Lascia la regola com’è.",
191
+ "newMigrationId": "Una correzione riceve un nuovo ID.",
192
+ "fillNewFieldsOnly": "Riempi solo campi nuovi; per un campo esistente, aggiungi un nuovo campo.",
193
+ "retireBrick": "Elenca il blocco sotto `retired` invece di eliminarlo.",
194
+ "defaultOrOptional": "Imposta un valore `default` o rendi il campo facoltativo.",
195
+ "keepProperty": "Mantieni la proprietà.",
196
+ "keepMax": "Mantieni max.",
197
+ "keepRoute": "Mantieni l’indirizzo (route).",
198
+ "defaultMigrationOrOptional": "Imposta un valore `default`, scrivi una migrazione o rendi il campo facoltativo.",
199
+ "keepDefinition": "Lascia la definizione com’è; possono cambiare solo i testi.",
200
+ "keepDefault": "Mantieni il valore predefinito.",
201
+ "keepMin": "Mantieni min.",
202
+ "minOnGrid": "Abbassa min in modo che la differenza sia un multiplo di step.",
203
+ "keepOption": "Mantieni l’opzione; può essere rinominata (label).",
204
+ "newList": "Aggiungi un nuovo elenco e riempilo con una migrazione."
205
+ }
206
+ },
207
+ "preview": {
208
+ "notFound": "Questa pagina non esiste.",
209
+ "failed": "L’anteprima non si carica.",
210
+ "loading": "Caricamento dell’anteprima…"
211
+ }
212
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lupinum/ginko",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Ginko: a typed, file-based content model for Nuxt sites (core, CLI and Nuxt module).",
5
5
  "license": "MIT",
6
6
  "author": "Lupinum OG <info@lupinum.com> (https://lupinum.com)",
@@ -36,6 +36,10 @@
36
36
  "types": "./dist/search.d.mts",
37
37
  "import": "./dist/search.mjs"
38
38
  },
39
+ "./basics": {
40
+ "types": "./dist/basics.d.mts",
41
+ "import": "./dist/basics.mjs"
42
+ },
39
43
  "./nuxt": {
40
44
  "types": "./dist/nuxt/module.d.mts",
41
45
  "import": "./dist/nuxt/module.mjs"
@@ -62,14 +66,14 @@
62
66
  },
63
67
  "dependencies": {
64
68
  "@comark/vue": "0.7.0",
65
- "@lupinum/ginko-i18n": "^0.4.0",
69
+ "@lupinum/ginko-i18n": "^0.6.0",
66
70
  "@nuxt/kit": "^4.6.0",
67
71
  "@zbsearch/stemmers": "4.0.1",
68
72
  "comark": "0.7.0",
69
73
  "minisearch": "7.2.0"
70
74
  },
71
75
  "devDependencies": {
72
- "@lupinum/ginko-content": "^0.4.0",
76
+ "@lupinum/ginko-content": "^0.6.0",
73
77
  "@vue/test-utils": "2.5.1",
74
78
  "happy-dom": "20.14.5",
75
79
  "nuxt": "4.6.0",
@@ -1,172 +0,0 @@
1
- import './ginko.akHewCGt.mjs';
2
- import { Z as Money, F as Fields, L as Locale } from './ginko.D-fNojn9.mjs';
3
- import { a as BundleItem, B as Bundle } from './ginko.Bwan3BB-.mjs';
4
-
5
- /** http(s), mailto, tel, a same-site path or fragment, or a `$` route link. Everything else (javascript:, data:, //host) is unsafe. */
6
- declare function isSafeHref(href: string): boolean;
7
- /** The link or image URL when it is safe (see `isSafeHref`), else undefined: for `href`/`src` from content. */
8
- declare function safeHref(href: string | undefined): string | undefined;
9
-
10
- /**
11
- * Money is stored as an integer count of the currency's minor units (cents for EUR, whole yen for JPY).
12
- * `minorDigits` says how many decimals one unit has: 2 for EUR, 0 for JPY, 3 for KWD.
13
- */
14
- declare function minorDigits(currency: string): number;
15
- /**
16
- * The amount in the notation of `language`, a BCP 47 tag such as `de-AT` (use `useI18n().language`, not the URL
17
- * code): `12,50 €` in de, `€ 12,50` in de-AT, `€12.50` in en, `¥1,250` for JPY.
18
- * Every space is a no-break space: Node and browsers ship different ICU data (one uses a plain
19
- * space), so a server-rendered price would otherwise differ from the hydrated one.
20
- */
21
- declare function formatMoney(money: Money, language: string): string;
22
-
23
- type Data = Record<string, unknown>;
24
- /** What a condition compares a value with: one element of a list value, money by `amount`, a daterange by its start date. */
25
- type Comparable<V> = V extends readonly (infer E)[] ? E : V extends Money ? Pick<Money, 'amount'> : V extends {
26
- from: string;
27
- } ? string : V;
28
- /**
29
- * A test on one field. `eq`/`ne`: equal or not (for a list value: one element is). `gt`, `gte`, `lt`, `lte`: compare.
30
- * `in`: equal to one of these. `contains`: a text contains this text (case-insensitive), a list contains this element.
31
- */
32
- interface Condition<V = unknown> {
33
- eq?: Comparable<V> | null;
34
- ne?: Comparable<V> | null;
35
- gt?: Comparable<V>;
36
- gte?: Comparable<V>;
37
- lt?: Comparable<V>;
38
- lte?: Comparable<V>;
39
- in?: readonly Comparable<V>[];
40
- contains?: Comparable<V>;
41
- }
42
- /** A sort order: the text `'price desc, name'` (`asc` is the default) or `{ field, dir? }` like a brick's `order`. */
43
- type QueryOrder<D = Data> = string | {
44
- field: keyof D & string;
45
- dir?: 'asc' | 'desc';
46
- };
47
- /** `D` is the data of the brick's entries; `useGinkoQuery` sets it, so field names and values are checked. */
48
- interface Query<D = Data> {
49
- /** Per field a value (equal to it) or a `Condition`; every field must match. */
50
- where?: {
51
- [K in keyof D]?: Comparable<D[K]> | null | Condition<D[K]>;
52
- };
53
- /** Default: the bundle's item order. */
54
- order?: QueryOrder<D>;
55
- /** At least 1; without it, every matching entry. */
56
- limit?: number;
57
- /** 1-based. */
58
- page?: number;
59
- fields?: (keyof D & string)[];
60
- facets?: (keyof D & string)[];
61
- include?: (keyof D & string)[];
62
- }
63
- interface QueryResult {
64
- items: BundleItem[];
65
- total: number;
66
- page: number;
67
- pages: number;
68
- facets?: Record<string, Record<string, number>>;
69
- }
70
- /** What `query` reads of the schema: the fields of each brick (a full `Schema` fits). */
71
- interface QuerySchema {
72
- bricks: Record<string, {
73
- fields: Fields;
74
- }>;
75
- }
76
- /** Filter, order, page, project and enrich the items of one collection brick. Pure; throws on a field the brick does not have. */
77
- declare function query(bundle: Bundle, brick: string, q?: Query, schema?: QuerySchema): QueryResult;
78
- /** The items before and after `id` in the given (or default) order. Both are missing for an unknown id. */
79
- declare function neighbors(bundle: Bundle, brick: string, id: string, order?: QueryOrder): {
80
- prev?: BundleItem;
81
- next?: BundleItem;
82
- };
83
-
84
- interface NavNode {
85
- title: string;
86
- path: string;
87
- id?: string;
88
- brick?: string;
89
- children: NavNode[];
90
- }
91
- /**
92
- * Navigation tree of the collections `bricks` in `locale`, built from item URLs. An item is a child of the
93
- * node at its nearest existing path prefix, else a root node. A string `parent` field (item id) overrides that.
94
- * Siblings keep the item order of the bundle (bricks in the given order).
95
- */
96
- declare function navTree(bundle: Bundle, bricks: string[], locale: Locale): NavNode[];
97
- /** Nodes from the root down to the node at `path`; empty when the path is not in the tree. */
98
- declare function breadcrumbs(tree: NavNode[], path: string): NavNode[];
99
-
100
- interface SeoImage {
101
- url: string;
102
- width?: number;
103
- height?: number;
104
- alt?: string;
105
- }
106
- interface SeoInput {
107
- siteName: string;
108
- /** `%s` is replaced by the page title; default '%s · <siteName>'. A page without title gets siteName alone. */
109
- titleTemplate?: string;
110
- title?: string;
111
- description?: string;
112
- image?: SeoImage;
113
- type?: 'website' | 'article';
114
- noindex?: boolean;
115
- }
116
- interface SeoHead {
117
- title: string;
118
- meta: (({
119
- name: string;
120
- } | {
121
- property: string;
122
- }) & {
123
- content: string;
124
- })[];
125
- }
126
- declare function seoHead(input: SeoInput): SeoHead;
127
- /** True when a request for `host` (with port, as in the Host header) is not for the site's own address: preview deployments, staging, localhost. Those must never be indexed. */
128
- declare function isPreviewHost(host: string | undefined, siteUrl: string): boolean;
129
- declare function robotsTxt(options: {
130
- sitemap?: string;
131
- noindex?: boolean;
132
- disallow?: string[];
133
- }): string;
134
- declare function websiteLd(o: {
135
- name: string;
136
- url: string;
137
- lang: string;
138
- }): Record<string, unknown>;
139
- declare function organizationLd(o: {
140
- name: string;
141
- url: string;
142
- logo?: string;
143
- sameAs?: string[];
144
- }): Record<string, unknown>;
145
- declare function breadcrumbLd(nodes: NavNode[], origin: string): Record<string, unknown>;
146
- declare function articleLd(o: {
147
- title: string;
148
- url: string;
149
- description?: string;
150
- image?: string;
151
- published?: string;
152
- modified?: string;
153
- author?: string;
154
- lang: string;
155
- }): Record<string, unknown>;
156
- declare function faqLd(pairs: {
157
- question: string;
158
- answer: string;
159
- }[]): Record<string, unknown>;
160
- /**
161
- * Headers every response of a Ginko site carries. Only the platform may frame `/__ginko` (the preview); nothing
162
- * else is framed. `nosniff` stops a browser from reading user text (`.md`, `llms.txt`, JSON) as HTML, and the
163
- * referrer policy keeps full URLs from leaving the site.
164
- */
165
- declare function siteHeaders(input: {
166
- preview: boolean;
167
- platformOrigin: string;
168
- noindex: boolean;
169
- }): Record<string, string>;
170
-
171
- export { articleLd as f, breadcrumbLd as g, breadcrumbs as h, faqLd as i, formatMoney as j, isPreviewHost as k, isSafeHref as l, minorDigits as m, navTree as n, neighbors as o, organizationLd as p, query as q, robotsTxt as r, safeHref as s, seoHead as t, siteHeaders as u, websiteLd as w };
172
- export type { Condition as C, NavNode as N, Query as Q, SeoHead as S, QueryOrder as a, QueryResult as b, QuerySchema as c, SeoImage as d, SeoInput as e };