bearminion 1.20.0 → 1.22.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 (47) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +3 -3
  3. package/dist/astro.d.ts +16 -7
  4. package/dist/astro.js +212 -93
  5. package/dist/cli.js +903 -4
  6. package/dist/content-types-46XqPaW4.js +505 -0
  7. package/dist/content.d.ts +24 -3
  8. package/dist/content.js +83 -6
  9. package/dist/{editor-context-DzRwKENi.d.ts → editor-context-D1yfPp21.d.ts} +95 -8
  10. package/dist/{github-store-Dt_YuOPD.js → github-store-B2folBeq.js} +551 -206
  11. package/dist/{github-store-DsLCe5MR.d.ts → github-store-CuhvbFCh.d.ts} +1 -1
  12. package/dist/hosted-astro.js +1 -1
  13. package/dist/{hosted-middleware-CsROahka.js → hosted-middleware-DHLIedeV.js} +1 -1
  14. package/dist/hosted-overlay.js +1 -1
  15. package/dist/hosted.d.ts +10 -4
  16. package/dist/hosted.js +68 -9
  17. package/dist/index.d.ts +4 -4
  18. package/dist/index.js +11 -6
  19. package/dist/{migrate-b408EaLp.js → migrate-Cm30puW8.js} +2 -2
  20. package/dist/{page-wlcQJAA-.js → page-C7zE_HD1.js} +5 -1
  21. package/dist/{page-BGSTL63-.d.ts → page-CpVElMPH.d.ts} +193 -37
  22. package/dist/{request-guards-BcSUj8Gc.js → request-guards-DtNVdqQ7.js} +1 -1
  23. package/dist/{collections-Bm3RWg2K.js → routing-jKeq4LwO.js} +213 -57
  24. package/dist/routing-yPy8hEfZ.d.ts +137 -0
  25. package/dist/{theme-BvqJ8UnS.js → theme-DTVVNMlr.js} +1 -1
  26. package/dist/ui/mount.js +3294 -1259
  27. package/package.json +2 -2
  28. package/registry/default/files/src/components/organisms/EntryList.astro +83 -0
  29. package/registry/default/files/src/components/organisms/Pagination.astro +56 -0
  30. package/registry/default/files/src/components/sections/contact/definition.ts +6 -2
  31. package/registry/default/files/src/components/sections/faq/definition.ts +2 -2
  32. package/registry/default/files/src/components/sections/media/Media.astro +2 -2
  33. package/registry/default/files/src/components/sections/media/MediaPlayer.astro +2 -2
  34. package/registry/default/files/src/components/sections/pricing/definition.ts +16 -1
  35. package/registry/default/files/src/components/sections/shared.ts +3 -0
  36. package/registry/default/files/src/components/sections/stats/definition.ts +6 -1
  37. package/registry/default/files/src/components/sections/testimonials/definition.ts +13 -1
  38. package/registry/default/files/src/components/sections/text-image/definition.ts +1 -1
  39. package/registry/default/files/src/components/seo/Seo.astro +3 -1
  40. package/registry/default/files/src/content.config.ts +21 -0
  41. package/registry/default/files/src/env.d.ts +2 -0
  42. package/registry/default/files/src/lib/content.ts +81 -0
  43. package/registry/default/files/src/lib/editing.ts +6 -0
  44. package/registry/default/files/src/lib/sitemap.ts +48 -0
  45. package/registry/default/files/src/pages/[...slug].astro +30 -16
  46. package/registry/default/registry.json +77 -21
  47. package/dist/preview-DFLna-Be.d.ts +0 -42
@@ -1,4 +1,4 @@
1
- import { _ as SectionRegistry, ht as SiteDefinition, n as PageRules, w as ContentMigrator, y as ThemeDefinition } from "./page-BGSTL63-.js";
1
+ import { Ft as SiteDefinition, M as ResolvedTypes, b as ContentMigrator, h as ThemeDefinition, n as PageRules, p as SectionRegistry } from "./page-CpVElMPH.js";
2
2
  import { ZodType, z } from "zod";
3
3
  //#region src/upload-names.d.ts
4
4
  type ImageKind = 'png' | 'jpeg' | 'webp' | 'gif' | 'avif';
@@ -46,6 +46,11 @@ interface ContentStore {
46
46
  /** The text at `key`, or `undefined` when there is none. */
47
47
  read(key: string): Promise<string | undefined>;
48
48
  exists(key: string): Promise<boolean>;
49
+ /**
50
+ * When the file at `key` last changed, in milliseconds since the epoch, or `undefined` when there is no such file or
51
+ * the store cannot tell. Optional: the editor's listings show no time without it.
52
+ */
53
+ modified?(key: string): Promise<number | undefined>;
49
54
  /** Names of the files directly inside the directory `dir`, sorted, or `undefined` when it does not exist. */
50
55
  list(dir: string): Promise<string[] | undefined>;
51
56
  /**
@@ -191,7 +196,16 @@ interface ApiIssue {
191
196
  file?: 'page' | 'site';
192
197
  }
193
198
  /** `GET /pages`. */
194
- interface PageListItem {
199
+ /** What the editor's listings show beside a document's title. All optional: older servers leave them out. */
200
+ interface ListMeta {
201
+ /** True when the document is a draft: left out of the build, the listings and the sitemap. */
202
+ draft?: boolean;
203
+ /** True when the document is marked `noindex`. */
204
+ noindex?: boolean;
205
+ /** When the file last changed (ISO 8601), when the content store can tell. */
206
+ updatedAt?: string;
207
+ }
208
+ interface PageListItem extends ListMeta {
195
209
  slug: string;
196
210
  title: string;
197
211
  /** File name inside the pages directory. */
@@ -199,12 +213,75 @@ interface PageListItem {
199
213
  system?: boolean;
200
214
  anchors?: string[];
201
215
  }
216
+ /** One type in `GET /types`. */
217
+ interface ContentTypeInfo {
218
+ id: string;
219
+ kind: 'single' | 'multi';
220
+ label: string;
221
+ /** The address: `/about` for a single, `/blog/{slug}` for the entries of a multi type. */
222
+ path: string;
223
+ /** True for the home page, the 404 page and `pages`, which every site has. */
224
+ builtIn: boolean;
225
+ /** The type's own fields as JSON Schema, one per key, or null when it declares none. */
226
+ fields: {
227
+ name: string;
228
+ required: boolean;
229
+ schema: Record<string, unknown> | null;
230
+ readOnly: boolean;
231
+ }[] | null;
232
+ /** The section types a document of this type may use, or null for all of them. */
233
+ sections: string[] | null;
234
+ /** Multi types only. Null keeps the order of the files. */
235
+ sort?: {
236
+ by: string;
237
+ order: 'asc' | 'desc';
238
+ } | null;
239
+ /** Multi types only. */
240
+ listing?: {
241
+ slug: string;
242
+ perPage: number;
243
+ path: string;
244
+ } | null;
245
+ rename?: boolean;
246
+ delete?: boolean;
247
+ }
248
+ /** `GET /document?path=…`: the document an address shows, and what it is. */
249
+ interface DocumentAt<TDocument = unknown> {
250
+ /** Id of the content type. The home and 404 pages answer as `pages`. */
251
+ type: string;
252
+ kind: 'entry' | 'single' | 'listing';
253
+ /** The entry's slug, the single's address segment, or the listing's slug. */
254
+ slug: string;
255
+ /** The page number, for a listing. */
256
+ page?: number;
257
+ document: TDocument;
258
+ }
259
+ /** The body of `POST /pages` and `POST /types/:id/entries`. */
260
+ interface CreateEntryRequest {
261
+ slug: string;
262
+ title: string;
263
+ template?: string;
264
+ fields?: Record<string, unknown>;
265
+ }
266
+ /** `GET /types/:id/entries`. */
267
+ interface EntryListItem extends ListMeta {
268
+ slug: string;
269
+ title: string;
270
+ file: string;
271
+ /** The entry's address, such as `/blog/first-post`. */
272
+ path: string;
273
+ /** The value the list is ordered by, when that is one of the type's fields. */
274
+ sortValue?: unknown;
275
+ anchors: string[];
276
+ }
202
277
  /** `GET /images` entries and the body of a successful `POST /images`. */
203
278
  interface UploadedImage {
204
279
  filename: string;
205
280
  /** Project-relative path, the value image fields store. */
206
281
  path: string;
207
282
  bytes?: number;
283
+ /** With `GET /images?usage=1`: where the saved content uses the image ("Home page › Hero"). */
284
+ usages?: string[];
208
285
  }
209
286
  /** `GET /videos` entries and the body of a successful `POST /videos`. */
210
287
  interface UploadedVideo {
@@ -223,11 +300,13 @@ interface HistoryEntry {
223
300
  /** `POST /save`. At least one of `page` and `site`. */
224
301
  interface SaveRequest<TPage = unknown, TSite = unknown> {
225
302
  page?: {
226
- /** Slug the page is stored under now. When `document.slug` differs, the page is renamed (or made home). */
227
- from: string;
303
+ /** The id of the entry's content type. Default `pages`. */
304
+ type?: string;
305
+ /** True when `document` is the listing page of `type`. */
306
+ listing?: boolean;
307
+ /** Slug the page is stored under now. When `document.slug` differs, the page is renamed. A single and a listing page need none. */
308
+ from?: string;
228
309
  document: TPage;
229
- /** Where the current home page moves when this page becomes `index`. Required when a home page exists. */
230
- previousHomeSlug?: string;
231
310
  };
232
311
  site?: TSite;
233
312
  }
@@ -241,6 +320,8 @@ interface CreatePageRequest {
241
320
  slug: string;
242
321
  title: string;
243
322
  template?: string;
323
+ /** `draft` starts the document as a draft. Absent: published. */
324
+ status?: 'published' | 'draft';
244
325
  }
245
326
  /** `POST /git/commit`. */
246
327
  interface CommitRequest {
@@ -258,7 +339,11 @@ interface SitePreview {
258
339
  }
259
340
  //#endregion
260
341
  //#region src/history-types.d.ts
261
- type HistoryScope = 'page' | 'site';
342
+ /**
343
+ * `page` is a page by slug (the home and 404 pages included). `entry` is a document of a declared content type, with
344
+ * `<type>/<slug>` as its slug, `<type>/_listing` for a listing page and `<type>/_single` for a single.
345
+ */
346
+ type HistoryScope = 'page' | 'site' | 'entry';
262
347
  /** Local copies of what was saved, so an earlier version can be loaded back into the draft. */
263
348
  interface HistoryPort {
264
349
  /** Newest first. */
@@ -308,6 +393,8 @@ interface EditorContext {
308
393
  migrator: ContentMigrator;
309
394
  /** Commit changes is enabled. */
310
395
  git: boolean;
396
+ /** The site's content types. Absent means only the built-in ones: the home page, the 404 page and `pages`. */
397
+ types?: ResolvedTypes;
311
398
  /** Markdown collections the editor can edit, by id. Absent when the site has none. */
312
399
  collections?: Record<string, Collection>;
313
400
  /** The folder with the site's form handlers, or `null` when the `forms` option turns them off. */
@@ -323,4 +410,4 @@ interface EditorContext {
323
410
  formFile?: (name: string) => string | null;
324
411
  }
325
412
  //#endregion
326
- export { CollectionOptions as _, CommitRequest as a, StoreOperation as b, HistoryEntry as c, SaveResponse as d, SitePreview as f, GitInfo as g, ChangedFile as h, ApiProblem as i, PageListItem as l, UploadedVideo as m, ImageConvertOptions as n, CommitResult as o, UploadedImage as p, ApiIssue as r, CreatePageRequest as s, EditorContext as t, SaveRequest as u, collection as v, UploadStore as x, ContentStore as y };
413
+ export { collection as C, UploadStore as E, CollectionOptions as S, StoreOperation as T, SitePreview as _, CommitRequest as a, ChangedFile as b, CreateEntryRequest as c, EntryListItem as d, HistoryEntry as f, SaveResponse as g, SaveRequest as h, ApiProblem as i, CreatePageRequest as l, PageListItem as m, ImageConvertOptions as n, CommitResult as o, ListMeta as p, ApiIssue as r, ContentTypeInfo as s, EditorContext as t, DocumentAt as u, UploadedImage as v, ContentStore as w, GitInfo as x, UploadedVideo as y };