riverbankcms 0.29.0 → 0.30.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.
@@ -1,34 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { _ as normalizeLinkValue, a as classifySdkEventSchedule, g as linkSchema, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer, s as RESOLVED_INTERNAL_LINK_ENTITY_TYPES } from "./sdk-event-upsert-CXc13KPT.mjs";
3
- import { m as EVENT_PRESET_VALUES, r as isRecord$4 } from "./src-4CBCWovR.mjs";
2
+ import { Pn as ICON_PICKER_PRESETS, a as classifySdkEventSchedule, g as normalizeLinkValue, h as linkSchema, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer, s as RESOLVED_INTERNAL_LINK_ENTITY_TYPES } from "./sdk-event-upsert-mPJpEQ2x.mjs";
3
+ import { m as EVENT_PRESET_VALUES, r as isRecord$3 } from "./src-DOwrYdTk.mjs";
4
4
  import { z } from "zod";
5
5
 
6
- //#region ../blocks/src/lib/typeGuards.ts
7
- /**
8
- * Strict record guard: excludes null, primitives, and arrays.
9
- */
10
- function isRecord$3(value) {
11
- return typeof value === "object" && value !== null && !Array.isArray(value);
12
- }
13
- /**
14
- * Non-null object guard: includes arrays for behavior parity with legacy helpers.
15
- *
16
- * NOTE: This intentionally narrows to UnknownRecord for compatibility with existing
17
- * callsites even though arrays pass at runtime. Follow-up cleanup should replace
18
- * this API with a more precise predicate type and migrate consumers.
19
- */
20
- function isObjectRecord(value) {
21
- return typeof value === "object" && value !== null;
22
- }
23
- /**
24
- * Coerces unknown input into a strict record, returning an empty object fallback.
25
- */
26
- function asRecord(value) {
27
- return isRecord$3(value) ? value : {};
28
- }
29
-
30
- //#endregion
31
- //#region ../blocks/src/primitives/content/utils/sanitizeHref.ts
6
+ //#region ../core/src/rich-text-href.ts
32
7
  const SAFE_PROTOCOLS = new Set([
33
8
  "http:",
34
9
  "https:",
@@ -68,9 +43,9 @@ function sanitizeHref(raw) {
68
43
  function sanitizeAbsoluteHref(normalized) {
69
44
  const decoded = normalizeInput(decodeForSchemeCheck(normalized));
70
45
  const schemeMatch = decoded.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
71
- if (!schemeMatch) return null;
46
+ if (schemeMatch === null) return null;
72
47
  const rawScheme = schemeMatch[1];
73
- if (!rawScheme) return null;
48
+ if (rawScheme === undefined || rawScheme.length === 0) return null;
74
49
  const protocol = `${rawScheme.toLowerCase()}:`;
75
50
  if (!SAFE_PROTOCOLS.has(protocol)) return null;
76
51
  try {
@@ -90,7 +65,7 @@ function isSafeRichTextHref(raw) {
90
65
  }
91
66
 
92
67
  //#endregion
93
- //#region ../blocks/src/system/manifest/richTextAuthoring.ts
68
+ //#region ../core/src/rich-text-authoring.ts
94
69
  const optionalText = z.string().max(2048).nullable().optional();
95
70
  const destination = z.string().max(2048).refine(isSafeRichTextHref, "Use http, https, mailto, tel, a single-root-relative path or a #fragment without controls or backslashes");
96
71
  const linkAttributes = z.object({
@@ -252,7 +227,7 @@ function treeSize(value, depth = 0) {
252
227
  nodes: 0,
253
228
  text: 0
254
229
  };
255
- if (!isRecord$4(value)) return {
230
+ if (!isRecord$3(value)) return {
256
231
  depth,
257
232
  nodes: 0,
258
233
  text: 0
@@ -381,7 +356,7 @@ function richTextEditingBudget(doc) {
381
356
  }
382
357
 
383
358
  //#endregion
384
- //#region ../blocks/src/system/manifest/richTextSchema.ts
359
+ //#region ../core/src/rich-text-schema.ts
385
360
  /**
386
361
  * Shared Rich Text Schema
387
362
  *
@@ -492,82 +467,26 @@ function createRichTextDoc(paragraphs) {
492
467
  } : { type: "paragraph" })
493
468
  };
494
469
  }
495
- function createHardBreakNode() {
496
- return { type: "hardBreak" };
497
- }
498
470
  /**
499
- * Parse a small markdown subset into TipTap inline nodes.
471
+ * Build Zod validation schema for rich text fields
500
472
  *
501
- * This intentionally supports only bold (`**text**`) because the SDK/content
502
- * import paths use it for lightweight default content, not full markdown.
503
- */
504
- function parseRichTextInlineMarkdown(text) {
505
- const out = [];
506
- const pushText = (value, marks) => {
507
- if (!value) return;
508
- out.push(marks && marks.length > 0 ? {
509
- type: "text",
510
- text: value,
511
- marks
512
- } : {
513
- type: "text",
514
- text: value
515
- });
516
- };
517
- let rest = text;
518
- while (rest.length > 0) {
519
- const start = rest.indexOf("**");
520
- if (start === -1) {
521
- pushText(rest);
522
- break;
523
- }
524
- const end = rest.indexOf("**", start + 2);
525
- if (end === -1) {
526
- pushText(rest);
527
- break;
528
- }
529
- pushText(rest.slice(0, start));
530
- pushText(rest.slice(start + 2, end), [{ type: "bold" }]);
531
- rest = rest.slice(end + 2);
532
- }
533
- return out;
534
- }
535
- function parseRichTextParagraphInlineMarkdown(text) {
536
- return text.split("\n").flatMap((line, index) => {
537
- const lineNodes = parseRichTextInlineMarkdown(line.trim());
538
- return index === 0 ? lineNodes : [createHardBreakNode(), ...lineNodes];
539
- });
540
- }
541
- /**
542
- * Convert a plain string with a tiny markdown subset to canonical TipTap JSON.
473
+ * @param options - Optional configuration
474
+ * @param options.required - If true, validates that content is not empty
475
+ * @param options.label - Field label for error messages (defaults to 'This field')
476
+ * @returns Zod schema for rich text validation
477
+ *
478
+ * @example
479
+ * // Basic usage
480
+ * const schema = buildRichTextSchema()
543
481
  *
544
- * Double newlines create semantic paragraphs. Single newlines remain inside the
545
- * current paragraph as TipTap `hardBreak` nodes for line-oriented content such
546
- * as addresses, opening hours, and contact details.
482
+ * @example
483
+ * // Required field with custom label
484
+ * const schema = buildRichTextSchema({ required: true, label: 'Description' })
547
485
  */
548
- function createRichTextDocFromMarkdown(markdown) {
549
- const normalized = markdown.replace(/\r\n/g, "\n").trim();
550
- if (!normalized) return {
551
- type: "doc",
552
- content: []
553
- };
554
- const paragraphs = normalized.split(/\n{2,}/).map((paragraph) => paragraph.trim()).filter(Boolean);
555
- return {
556
- type: "doc",
557
- content: paragraphs.map((paragraph) => {
558
- const inline = parseRichTextParagraphInlineMarkdown(paragraph);
559
- return inline.length > 0 ? {
560
- type: "paragraph",
561
- content: inline
562
- } : { type: "paragraph" };
563
- })
564
- };
565
- }
566
486
  function buildRichTextSchema(options) {
567
- let schema = RichTextDocSchema;
568
- if (options?.required) {
487
+ if (options?.required === true) {
569
488
  const label = options.label ?? "This field";
570
- schema = schema.refine((val) => {
489
+ return RichTextDocSchema.refine((val) => {
571
490
  const content = val.content;
572
491
  if (!Array.isArray(content) || content.length === 0) return false;
573
492
  const first = content[0];
@@ -577,7 +496,7 @@ function buildRichTextSchema(options) {
577
496
  return true;
578
497
  }, { message: `${label} is required` });
579
498
  }
580
- return schema;
499
+ return RichTextDocSchema;
581
500
  }
582
501
 
583
502
  //#endregion
@@ -1118,7 +1037,6 @@ function parseReferenceKind(referenceKind) {
1118
1037
 
1119
1038
  //#endregion
1120
1039
  //#region ../content-model/src/contentManifest.ts
1121
- const CONTENT_MODEL_ICON_PICKER_PRESETS = ["cta", "feature"];
1122
1040
  function assertNever$1(value) {
1123
1041
  throw new Error(`Unhandled content field mapping decision: ${JSON.stringify(value)}`);
1124
1042
  }
@@ -5183,4 +5101,4 @@ const eventUpsertInputSchema = z.object({
5183
5101
  }));
5184
5102
 
5185
5103
  //#endregion
5186
- export { RichTextDocSchema as a, isObjectRecord as c, findUnfilledSentinels as i, isRecord$3 as l, buildEntryScaffold as n, isRichTextDoc as o, validateEntryInstance as r, sanitizeHref as s, eventUpsertInputSchema as t };
5104
+ export { RichTextDocSchema as a, findUnfilledSentinels as i, buildEntryScaffold as n, isRichTextDoc as o, validateEntryInstance as r, sanitizeHref as s, eventUpsertInputSchema as t };
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { t as loadConfigFile } from "./load-config-Dgw0C6y3.mjs";
3
+
4
+ export { loadConfigFile };
@@ -7,7 +7,7 @@ import { existsSync as existsSync$1 } from "fs";
7
7
  import { fileURLToPath } from "url";
8
8
 
9
9
  //#region package.json
10
- var version = "0.29.0";
10
+ var version = "0.30.0";
11
11
  var peerDependencies = { "@riverbankcms/sdk": ">=0.157.0 <1.0.0" };
12
12
  var package_default = {
13
13
  name: "riverbankcms",
@@ -93,7 +93,7 @@ var package_default = {
93
93
  //#endregion
94
94
  //#region src/version.ts
95
95
  /** The package manifest is the source-run fallback; builds inject this value. */
96
- const CLI_VERSION = typeof "0.29.0" === "string" ? "0.29.0" : version;
96
+ const CLI_VERSION = typeof "0.30.0" === "string" ? "0.30.0" : version;
97
97
  /**
98
98
  * The CLI's SDK peer range is bundled from the CLI manifest alongside its
99
99
  * version. Runtime config loading uses this value as the single compatibility
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { Yn as parseSiteId, or as err, sr as ok } from "./src-4CBCWovR.mjs";
2
+ import { Zn as parseSiteId, cr as err, lr as ok } from "./src-DOwrYdTk.mjs";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "../src-4CBCWovR.mjs";
3
- import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-BppGb0gS.mjs";
2
+ import "../src-DOwrYdTk.mjs";
3
+ import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-cE7TKMc1.mjs";
4
4
 
5
5
  export { deriveGeneratedPackageRanges, deriveScaffoldLocalManifest, deriveScaffoldPlan, findPackageManifestPath, loadGeneratedPackageRanges, preflightScaffoldPlan, preflightScaffoldTargets, prepareScaffoldExecution, writeScaffoldFiles };