@crossworks/content-core 0.300.66 → 0.300.70

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/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@crossworks/content-core",
3
- "version": "0.300.66",
3
+ "version": "0.300.70",
4
4
  "description": "Browser-safe content logic — markdown, blocks, pages, tables, formulas — shared by the server and any client. Zero server deps by design: nothing here may reach @mantle/db, node-only APIs, or the network (the jackdaw-repo-split P0 boundary).",
5
+ "type": "module",
5
6
  "exports": {
6
7
  "./app-nav": "./src/app-nav.ts",
7
8
  "./block-diff": "./src/block-diff.ts",
@@ -33,7 +34,7 @@
33
34
  "./tree": "./src/tree.ts"
34
35
  },
35
36
  "dependencies": {
36
- "@mantle/client-types": "npm:@crossworks/client-types@0.300.66",
37
+ "@mantle/client-types": "npm:@crossworks/client-types@0.300.70",
37
38
  "marked": "^18.1.0",
38
39
  "mathjs": "15.2.0"
39
40
  },
@@ -78,6 +78,11 @@ describe('projectAppNav (tolerant read)', () => {
78
78
  const nav = projectAppNav({ entries: [app(1), app(1), null, { kind: 'x', id: id(2) }] })!;
79
79
  expect(nav).toEqual({ rev: 0, entries: [app(1)] });
80
80
  });
81
+ it('reads an id in either case as its lower case (A10 #15: the regex reads either case)', () => {
82
+ const lower = '0000000a-0000-4000-8000-00000000000b';
83
+ const nav = projectAppNav({ entries: [{ kind: 'app', id: lower.toUpperCase() }] });
84
+ expect(nav).toEqual({ rev: 0, entries: [{ kind: 'app', id: lower }] });
85
+ });
81
86
  it('is undefined for garbage', () => {
82
87
  expect(projectAppNav(null)).toBeUndefined();
83
88
  expect(projectAppNav({ entries: 'no' })).toBeUndefined();
package/src/app-nav.ts CHANGED
@@ -27,7 +27,9 @@ import {
27
27
  type AppTint,
28
28
  } from '@mantle/client-types/app-nav';
29
29
 
30
- const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
30
+ /** Either case, as @mantle/std's UUID_RE (this published package takes no
31
+ * dependency): asId lower-cases before it tests, so an id reads as before. */
32
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
31
33
  const LUCIDE_NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
32
34
 
33
35
  function asId(raw: unknown): string | undefined {