bearminion 1.18.0 → 1.19.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/dist/hosted.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as CollectionOptions, n as ImageConvertOptions, t as EditorContext, v as collection, y as ContentStore } from "./editor-context-ESJwMFpS.js";
2
- import { i as StoreKeyError, n as githubStore, r as StoreError, t as GithubStoreOptions } from "./github-store-CDQNvoKQ.js";
3
- import { g as ContentModel, n as PageRules, t as Page } from "./page-D1pdneYm.js";
1
+ import { _ as CollectionOptions, n as ImageConvertOptions, t as EditorContext, v as collection, y as ContentStore } from "./editor-context-DzRwKENi.js";
2
+ import { i as StoreKeyError, n as githubStore, r as StoreError, t as GithubStoreOptions } from "./github-store-DsLCe5MR.js";
3
+ import { g as ContentModel, n as PageRules, t as Page } from "./page-BGSTL63-.js";
4
4
  //#region src/api.d.ts
5
5
  interface HandleMeta {
6
6
  /**
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as CollectionOptions, a as CommitRequest, c as HistoryEntry, d as SaveResponse, f as SitePreview, g as GitInfo, h as ChangedFile, i as ApiProblem, l as PageListItem, m as UploadedVideo, o as CommitResult, p as UploadedImage, r as ApiIssue, s as CreatePageRequest, u as SaveRequest, v as collection } from "./editor-context-ESJwMFpS.js";
1
+ import { _ as CollectionOptions, a as CommitRequest, c as HistoryEntry, d as SaveResponse, f as SitePreview, g as GitInfo, h as ChangedFile, i as ApiProblem, l as PageListItem, m as UploadedVideo, o as CommitResult, p as UploadedImage, r as ApiIssue, s as CreatePageRequest, u as SaveRequest, v as collection } from "./editor-context-DzRwKENi.js";
2
2
  import { _ as renderMarkedHtml, a as WeightMark, f as markClass, g as reconcileMarks, i as TextRun, l as fontMarks, m as marksFromEmphasis, o as applyTextMark, r as TextMark, t as FontMark, v as splitMarkedText, y as weightMarks } from "./marks-BzLa48Y9.js";
3
- import { $ as mergeJsonLd, $t as tones, A as SectionDefinition, At as MAX_NAV_DEPTH, B as FieldIcons, Bt as toneSchema, C as ContentMigration, Ct as siteConsentSchema, D as SCHEMA_VERSION_KEY, Dt as ButtonStyle, E as DocumentKind, Et as themeSchema, F as defineWireframe, Ft as imageSchema, G as SiteJsonLdIds, Gt as EnumOption, H as ShowWhen, Ht as withEmphasis, I as wireKinds, It as linkSchema, J as generateSiteJsonLd, Jt as StringOption, K as SiteJsonLdSource, Kt as NumberOption, L as wireframeIssues, Lt as richTextSchema, M as WireKind, Mt as Text, N as WireRect, Nt as Tone, O as createMigrator, Ot as Image, P as Wireframe, Pt as htmlIdSchema, Q as jsonLdWarnings, Qt as toneOption, R as OptionalContent, Rt as textMarkSchema, S as defineTheme, St as siteAnalyticsSchema, T as ContentVersioning, Tt as themeColorsSchema, U as JsonLdBlock, Ut as BooleanOption, V as ShowCondition, Vt as trackingIdSchema, W as JsonLdResult, Wt as CountRule, X as isPlaceholderSiteUrl, Xt as motionOption, Y as hasJsonLdId, Yt as buttonStyles, Z as jsonLdSchema, Zt as themeModes, _ as SectionRegistry, _t as SiteSeo, a as createPageSchema, at as DEFAULT_MAX_HEADER_ACTIONS, b as ThemeFont, bt as brandLogoSchema, c as withoutOrphanSections, ct as FooterConfig, d as SectionOf, dt as Site, en as variantOption, et as parseJsonLdInput, f as anchorSchema, ft as SiteAnalytics, g as ContentModel, gt as SiteOf, h as API_PREFIX, ht as SiteDefinition, i as Seo, it as DEFAULT_MAX_FOOTER_COLUMNS, j as defineSection, jt as RichText, k as SectionConfig, kt as Link, l as BaseSection, lt as Header, m as sectionIdSchema, mt as SiteConsent, nt as upsertJsonLd, o as isSystemPage, ot as Footer, p as createSectionSchema, pt as SiteConfig, q as formatJsonLd, qt as Option, r as SYSTEM_PAGES, rt as BRAND_LOGO_HEIGHT, s as seoSchema, st as FooterColumn, t as Page, tt as siteJsonLdIds, u as PropsOf, ut as HeaderConfig, v as ThemeConfig, vt as SiteWith, w as ContentMigrator, wt as siteSeoSchema, x as defaultTheme, xt as defineSite, y as ThemeDefinition, yt as Theme, z as FieldChoices, zt as textSchema } from "./page-D1pdneYm.js";
3
+ import { $ as mergeJsonLd, $t as tones, A as SectionDefinition, At as MAX_NAV_DEPTH, B as FieldIcons, Bt as toneSchema, C as ContentMigration, Ct as siteConsentSchema, D as SCHEMA_VERSION_KEY, Dt as ButtonStyle, E as DocumentKind, Et as themeSchema, F as defineWireframe, Ft as imageSchema, G as SiteJsonLdIds, Gt as EnumOption, H as ShowWhen, Ht as withEmphasis, I as wireKinds, It as linkSchema, J as generateSiteJsonLd, Jt as StringOption, K as SiteJsonLdSource, Kt as NumberOption, L as wireframeIssues, Lt as richTextSchema, M as WireKind, Mt as Text, N as WireRect, Nt as Tone, O as createMigrator, Ot as Image, P as Wireframe, Pt as htmlIdSchema, Q as jsonLdWarnings, Qt as toneOption, R as OptionalContent, Rt as textMarkSchema, S as defineTheme, St as siteAnalyticsSchema, T as ContentVersioning, Tt as themeColorsSchema, U as JsonLdBlock, Ut as BooleanOption, V as ShowCondition, Vt as trackingIdSchema, W as JsonLdResult, Wt as CountRule, X as isPlaceholderSiteUrl, Xt as motionOption, Y as hasJsonLdId, Yt as buttonStyles, Z as jsonLdSchema, Zt as themeModes, _ as SectionRegistry, _t as SiteSeo, a as createPageSchema, at as DEFAULT_MAX_HEADER_ACTIONS, b as ThemeFont, bt as brandLogoSchema, c as withoutOrphanSections, ct as FooterConfig, d as SectionOf, dt as Site, en as variantOption, et as parseJsonLdInput, f as anchorSchema, ft as SiteAnalytics, g as ContentModel, gt as SiteOf, h as API_PREFIX, ht as SiteDefinition, i as Seo, it as DEFAULT_MAX_FOOTER_COLUMNS, j as defineSection, jt as RichText, k as SectionConfig, kt as Link, l as BaseSection, lt as Header, m as sectionIdSchema, mt as SiteConsent, nt as upsertJsonLd, o as isSystemPage, ot as Footer, p as createSectionSchema, pt as SiteConfig, q as formatJsonLd, qt as Option, r as SYSTEM_PAGES, rt as BRAND_LOGO_HEIGHT, s as seoSchema, st as FooterColumn, t as Page, tt as siteJsonLdIds, u as PropsOf, ut as HeaderConfig, v as ThemeConfig, vt as SiteWith, w as ContentMigrator, wt as siteSeoSchema, x as defaultTheme, xt as defineSite, y as ThemeDefinition, yt as Theme, z as FieldChoices, zt as textSchema } from "./page-BGSTL63-.js";
4
4
  import { a as TURNSTILE_FIELD, i as HONEYPOT_FIELD, n as FormResult, r as FormSubmission, t as FormFieldErrors } from "./form-contract-BURSJP3Y.js";
5
5
  //#region src/errors.d.ts
6
6
  /** One schema problem, addressed by a dot path such as `sections.0.props.heading`. */
package/dist/index.js CHANGED
@@ -219,7 +219,7 @@ function createHeaderSchema({ variants, defaultVariant, maxActions }) {
219
219
  actions: actions ?? [signIn, cta].filter((link) => link !== void 0)
220
220
  }));
221
221
  }
222
- function createFooterSchema({ variants, defaultVariant, maxColumns, badge }) {
222
+ function createFooterSchema({ variants, defaultVariant, maxColumns, badge, poweredBy }) {
223
223
  return z.object({
224
224
  variant: z.enum(variants).default(defaultVariant),
225
225
  tone: toneSchema,
@@ -227,6 +227,8 @@ function createFooterSchema({ variants, defaultVariant, maxColumns, badge }) {
227
227
  legal: z.string().optional(),
228
228
  /** Pill on the columns variant. Hidden when omitted. Only themes that enable it accept it. */
229
229
  badge: z.string().min(1).optional(),
230
+ /** The "Powered by BearMinion" link. Only `false` hides it. Only themes that enable it accept it. */
231
+ poweredBy: z.boolean().optional(),
230
232
  columns: z.array(footerColumnSchema).max(maxColumns)
231
233
  }).strict().superRefine((footer, ctx) => {
232
234
  if (!badge && footer.badge !== void 0) ctx.addIssue({
@@ -234,6 +236,11 @@ function createFooterSchema({ variants, defaultVariant, maxColumns, badge }) {
234
236
  message: "This site has no footer badge",
235
237
  path: ["badge"]
236
238
  });
239
+ if (!poweredBy && footer.poweredBy !== void 0) ctx.addIssue({
240
+ code: "custom",
241
+ message: "This site has no \"Powered by BearMinion\" link",
242
+ path: ["poweredBy"]
243
+ });
237
244
  });
238
245
  }
239
246
  /** Defaults used when a page does not set its own SEO fields. */
@@ -345,6 +352,7 @@ function defineSite(config) {
345
352
  const maxActions = header.maxActions ?? 2;
346
353
  const maxColumns = footer.maxColumns ?? 3;
347
354
  const badge = footer.badge === true;
355
+ const poweredBy = footer.poweredBy === true;
348
356
  for (const [name, part] of [["header", header], ["footer", footer]]) if (!part.variants.includes(part.defaultVariant)) throw new Error(`defineSite: ${name}.defaultVariant "${part.defaultVariant}" is not in ${name}.variants.`);
349
357
  if (!Number.isInteger(maxActions) || maxActions < 1) throw new Error("defineSite: header.maxActions must be a positive integer.");
350
358
  if (!Number.isInteger(maxColumns) || maxColumns < 1) throw new Error("defineSite: footer.maxColumns must be a positive integer.");
@@ -357,7 +365,8 @@ function defineSite(config) {
357
365
  variants: footer.variants,
358
366
  defaultVariant: footer.defaultVariant,
359
367
  maxColumns,
360
- badge
368
+ badge,
369
+ poweredBy
361
370
  }),
362
371
  options: [
363
372
  {
@@ -418,6 +427,12 @@ function defineSite(config) {
418
427
  label: "Footer badge",
419
428
  type: "string",
420
429
  default: ""
430
+ }] : [],
431
+ ...poweredBy ? [{
432
+ name: "footer.poweredBy",
433
+ label: "Powered by BearMinion",
434
+ type: "boolean",
435
+ default: true
421
436
  }] : []
422
437
  ],
423
438
  counts: {
@@ -438,7 +453,8 @@ function defineSite(config) {
438
453
  footer: {
439
454
  variants: footer.variants,
440
455
  defaultVariant: footer.defaultVariant,
441
- badge
456
+ badge,
457
+ poweredBy
442
458
  }
443
459
  };
444
460
  }
@@ -394,6 +394,7 @@ interface FooterParts {
394
394
  defaultVariant: string;
395
395
  maxColumns: number;
396
396
  badge: boolean;
397
+ poweredBy: boolean;
397
398
  }
398
399
  /** Defaults used when a page does not set its own SEO fields. */
399
400
  declare const siteSeoSchema: z.ZodObject<{
@@ -665,6 +666,7 @@ declare function createSiteSchema(header: HeaderParts, footer: FooterParts): z.Z
665
666
  text: z.ZodOptional<z.ZodString>;
666
667
  legal: z.ZodOptional<z.ZodString>;
667
668
  badge: z.ZodOptional<z.ZodString>;
669
+ poweredBy: z.ZodOptional<z.ZodBoolean>;
668
670
  columns: z.ZodArray<z.ZodObject<{
669
671
  title: z.ZodString;
670
672
  links: z.ZodArray<z.ZodType<Link, unknown, z.core.$ZodTypeInternals<Link, unknown>>>;
@@ -798,6 +800,7 @@ declare function createSiteSchema(header: HeaderParts, footer: FooterParts): z.Z
798
800
  text?: string | undefined;
799
801
  legal?: string | undefined;
800
802
  badge?: string | undefined;
803
+ poweredBy?: boolean | undefined;
801
804
  };
802
805
  lang?: string | undefined;
803
806
  brandLogo?: {
@@ -934,6 +937,7 @@ declare function createSiteSchema(header: HeaderParts, footer: FooterParts): z.Z
934
937
  text?: string | undefined;
935
938
  legal?: string | undefined;
936
939
  badge?: string | undefined;
940
+ poweredBy?: boolean | undefined;
937
941
  };
938
942
  nameEm?: string | undefined;
939
943
  nameMarks?: {
@@ -1013,6 +1017,8 @@ interface FooterConfig<TVariants extends readonly [string, ...string[]]> {
1013
1017
  maxColumns?: number;
1014
1018
  /** The footer has a pill whose text the editor sets. Default false. */
1015
1019
  badge?: boolean;
1020
+ /** The footer has a "Powered by BearMinion" link that the editor can switch off. Default false. */
1021
+ poweredBy?: boolean;
1016
1022
  }
1017
1023
  interface SiteConfig<THeaderVariants extends readonly [string, ...string[]], TFooterVariants extends readonly [string, ...string[]]> {
1018
1024
  header: HeaderConfig<THeaderVariants>;
@@ -1046,6 +1052,7 @@ interface SiteDefinition<THeader extends string = string, TFooter extends string
1046
1052
  readonly variants: readonly TFooter[];
1047
1053
  readonly defaultVariant: TFooter;
1048
1054
  readonly badge: boolean;
1055
+ readonly poweredBy: boolean;
1049
1056
  };
1050
1057
  }
1051
1058
  /** The site type a definition validates to. */
package/dist/ui/mount.js CHANGED
@@ -14750,7 +14750,7 @@ const getHistoryVersion = (scope, slug, id) => request(`${historyPath(scope, slu
14750
14750
  const PAGE_DEBOUNCE_MS = 160;
14751
14751
  const SITE_DEBOUNCE_MS = 200;
14752
14752
  /** Site edits that change the header or footer markup. Text typed on the page itself is skipped at render time. */
14753
- const SITE_PREVIEW_PATH = /^(name|nameMarks|brandLogo|header\.(variant|tone|sticky|actions|links)|footer\.(variant|tone|columns|text|legal|badge))(\.|$)/;
14753
+ const SITE_PREVIEW_PATH = /^(name|nameMarks|brandLogo|header\.(variant|tone|sticky|actions|links)|footer\.(variant|tone|columns|text|legal|badge|poweredBy))(\.|$)/;
14754
14754
  function affectsSitePreview(path) {
14755
14755
  return SITE_PREVIEW_PATH.test(path);
14756
14756
  }
@@ -22319,7 +22319,8 @@ function JsonLdGroup({ site, onEdit }) {
22319
22319
  //#region src/ui/forms/footer-form.tsx
22320
22320
  /** Footer tab: layout, text, and the columns with their links. */
22321
22321
  function FooterForm({ site, options, maxColumns, pages, currentSlug, currentAnchors, onField, onOptional }) {
22322
- const layout = options.filter((option) => option.name.startsWith("footer.") && option.name !== "footer.badge");
22322
+ const layout = options.filter((option) => option.name.startsWith("footer.") && option.name !== "footer.badge" && option.name !== "footer.poweredBy");
22323
+ const poweredBy = options.find((option) => option.name === "footer.poweredBy");
22323
22324
  return /* @__PURE__ */ jsxs("div", {
22324
22325
  class: "bm-stack",
22325
22326
  children: [
@@ -22359,7 +22360,8 @@ function FooterForm({ site, options, maxColumns, pages, currentSlug, currentAnch
22359
22360
  value: text(getAt(site, "footer.badge")),
22360
22361
  onChange: (value) => onOptional("footer.badge", value),
22361
22362
  hint: "Pill on the footer. Empty hides it."
22362
- })
22363
+ }),
22364
+ poweredBy && siteOptionControl(site, poweredBy, onField)
22363
22365
  ]
22364
22366
  }),
22365
22367
  /* @__PURE__ */ jsx(FooterColumns, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bearminion",
3
- "version": "1.18.0",
3
+ "version": "1.19.0",
4
4
  "description": "A git-based CMS for Astro with no database and no server: JSON content in your repo, edited by clicking on the page during astro dev.",
5
5
  "license": "MIT",
6
6
  "author": "Jakub Lange",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "template": "default",
4
- "version": "1.18.0",
4
+ "version": "1.19.0",
5
5
  "files": {
6
6
  "src/components/atoms/Button.astro": {
7
7
  "hash": "7be42b3dc3a3b59bec169de32a9d801904689e2705473d1945724658dc799043",