@particle-academy/fancy-cms-ui 0.0.1-dev.2 → 0.0.1-dev.4

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/index.js CHANGED
@@ -1,49 +1,4 @@
1
+ export { keyBetween } from './chunk-7YYLYBLI.js';
1
2
  export { DEFAULT_BREAKPOINTS, childrenOf, descendantIds, emitDocCss, emptyDoc, invert, isBinding, reduce, reduceAll } from './chunk-HYHNMW47.js';
2
-
3
- // src/document/fractional.ts
4
- var BASE = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
5
- var RADIX = BASE.length;
6
- var MID = Math.floor(RADIX / 2);
7
- function val(c) {
8
- const i = BASE.indexOf(c);
9
- return i < 0 ? 0 : i;
10
- }
11
- function keyBetween(a, b) {
12
- if (a === null) a = "";
13
- if (b === null) {
14
- return a + BASE[MID];
15
- }
16
- if (a >= b) {
17
- throw new Error(`keyBetween: lower bound "${a}" is not below upper bound "${b}"`);
18
- }
19
- let result = "";
20
- let i = 0;
21
- for (; ; ) {
22
- const ca = i < a.length ? val(a[i]) : 0;
23
- const cb = i < b.length ? val(b[i]) : RADIX;
24
- if (cb - ca > 1) {
25
- result += BASE[ca + Math.floor((cb - ca) / 2)];
26
- return result;
27
- }
28
- if (ca === cb) {
29
- result += BASE[ca];
30
- i++;
31
- continue;
32
- }
33
- result += BASE[ca];
34
- i++;
35
- for (; ; ) {
36
- const da = i < a.length ? val(a[i]) : 0;
37
- if (RADIX - da > 1) {
38
- result += BASE[da + Math.floor((RADIX - da) / 2)];
39
- return result;
40
- }
41
- result += BASE[da];
42
- i++;
43
- }
44
- }
45
- }
46
-
47
- export { keyBetween };
48
3
  //# sourceMappingURL=index.js.map
49
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/document/fractional.ts"],"names":[],"mappings":";;;AAaA,IAAM,IAAA,GAA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;AAAA,IACF;AAGA,IAAA,MAAA,IAAU,KAAK,EAAE,CAAA;AACjB,IAAA,CAAA,EAAA;AACA,IAAA,WAAS;AACP,MAAA,MAAM,EAAA,GAAK,IAAI,CAAA,CAAE,MAAA,GAAS,IAAI,CAAA,CAAE,CAAC,CAAW,CAAA,GAAI,CAAA;AAChD,MAAA,IAAI,KAAA,GAAQ,KAAK,CAAA,EAAG;AAClB,QAAA,MAAA,IAAU,KAAK,EAAA,GAAK,IAAA,CAAK,OAAO,KAAA,GAAQ,EAAA,IAAM,CAAC,CAAC,CAAA;AAChD,QAAA,OAAO,MAAA;AAAA,MACT;AACA,MAAA,MAAA,IAAU,KAAK,EAAE,CAAA;AACjB,MAAA,CAAA,EAAA;AAAA,IACF;AAAA,EACF;AACF","file":"index.js","sourcesContent":["/**\n * Minimal collab-safe fractional ordering keys.\n *\n * Sibling `order` is a string over a base-62 alphabet interpreted as a fraction\n * in (0, 1). `keyBetween(a, b)` returns a key that sorts strictly between `a`\n * and `b` (lexicographically), extending precision when the bounds are\n * adjacent. Concurrent inserts at the same spot produce different keys (vary by\n * actor), so reorders never collide.\n *\n * This is intentionally compact for Phase 0. Before live collaboration ships it\n * should be swapped for a hardened implementation with jitter + bucket bounds.\n */\n\nconst BASE = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\nconst RADIX = BASE.length; // 62\nconst MID = Math.floor(RADIX / 2);\n\nfunction val(c: string): number {\n const i = BASE.indexOf(c);\n return i < 0 ? 0 : i;\n}\n\n/**\n * Return a key strictly between `a` and `b`. Pass `null` for an open bound\n * (`keyBetween(null, null)` for the first key, `keyBetween(last, null)` to\n * append, `keyBetween(null, first)` to prepend).\n */\nexport function keyBetween(a: string | null, b: string | null): string {\n if (a === null) a = \"\";\n if (b === null) {\n // Append: a key greater than `a`. Appending a mid digit always sorts after.\n return a + BASE[MID];\n }\n if (a >= b) {\n throw new Error(`keyBetween: lower bound \"${a}\" is not below upper bound \"${b}\"`);\n }\n\n let result = \"\";\n let i = 0;\n // Walk the common prefix, then split at the first differing digit.\n for (;;) {\n const ca = i < a.length ? val(a[i] as string) : 0;\n const cb = i < b.length ? val(b[i] as string) : RADIX;\n if (cb - ca > 1) {\n result += BASE[ca + Math.floor((cb - ca) / 2)];\n return result;\n }\n if (ca === cb) {\n result += BASE[ca];\n i++;\n continue;\n }\n // Adjacent digits (cb - ca === 1): take the lower path, then descend into\n // `a`'s remainder with RADIX as the upper bound until a gap opens.\n result += BASE[ca];\n i++;\n for (;;) {\n const da = i < a.length ? val(a[i] as string) : 0;\n if (RADIX - da > 1) {\n result += BASE[da + Math.floor((RADIX - da) / 2)];\n return result;\n }\n result += BASE[da];\n i++;\n }\n }\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-academy/fancy-cms-ui",
3
- "version": "0.0.1-dev.2",
3
+ "version": "0.0.1-dev.4",
4
4
  "description": "Editor + isomorphic renderer for fancy-cms — the Stages document model, PageOp op-spine, the JS style→CSS emitter (one half of the dual-emitter pair with the PHP particle-academy/fancy-cms), and the React renderer. Built on the Fancy UI suite.",
5
5
  "repository": {
6
6
  "type": "git",