@pilates/core 1.0.0 → 1.1.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 (53) hide show
  1. package/dist/algorithm/index.d.ts +31 -0
  2. package/dist/algorithm/index.d.ts.map +1 -1
  3. package/dist/algorithm/index.js +85 -1
  4. package/dist/algorithm/index.js.map +1 -1
  5. package/dist/algorithm/round.d.ts +13 -0
  6. package/dist/algorithm/round.d.ts.map +1 -1
  7. package/dist/algorithm/round.js +17 -0
  8. package/dist/algorithm/round.js.map +1 -1
  9. package/dist/algorithm/spineless/flex-grammar.d.ts +394 -0
  10. package/dist/algorithm/spineless/flex-grammar.d.ts.map +1 -0
  11. package/dist/algorithm/spineless/flex-grammar.js +2373 -0
  12. package/dist/algorithm/spineless/flex-grammar.js.map +1 -0
  13. package/dist/algorithm/spineless/grammar.d.ts +150 -0
  14. package/dist/algorithm/spineless/grammar.d.ts.map +1 -0
  15. package/dist/algorithm/spineless/grammar.js +144 -0
  16. package/dist/algorithm/spineless/grammar.js.map +1 -0
  17. package/dist/algorithm/spineless/layout.d.ts +130 -0
  18. package/dist/algorithm/spineless/layout.d.ts.map +1 -0
  19. package/dist/algorithm/spineless/layout.js +755 -0
  20. package/dist/algorithm/spineless/layout.js.map +1 -0
  21. package/dist/algorithm/spineless/order-maintenance.bench.d.ts +25 -0
  22. package/dist/algorithm/spineless/order-maintenance.bench.d.ts.map +1 -0
  23. package/dist/algorithm/spineless/order-maintenance.bench.js +78 -0
  24. package/dist/algorithm/spineless/order-maintenance.bench.js.map +1 -0
  25. package/dist/algorithm/spineless/order-maintenance.d.ts +192 -0
  26. package/dist/algorithm/spineless/order-maintenance.d.ts.map +1 -0
  27. package/dist/algorithm/spineless/order-maintenance.js +294 -0
  28. package/dist/algorithm/spineless/order-maintenance.js.map +1 -0
  29. package/dist/algorithm/spineless/priority-queue.bench.d.ts +17 -0
  30. package/dist/algorithm/spineless/priority-queue.bench.d.ts.map +1 -0
  31. package/dist/algorithm/spineless/priority-queue.bench.js +57 -0
  32. package/dist/algorithm/spineless/priority-queue.bench.js.map +1 -0
  33. package/dist/algorithm/spineless/priority-queue.d.ts +73 -0
  34. package/dist/algorithm/spineless/priority-queue.d.ts.map +1 -0
  35. package/dist/algorithm/spineless/priority-queue.js +149 -0
  36. package/dist/algorithm/spineless/priority-queue.js.map +1 -0
  37. package/dist/algorithm/spineless/runtime.d.ts +239 -0
  38. package/dist/algorithm/spineless/runtime.d.ts.map +1 -0
  39. package/dist/algorithm/spineless/runtime.js +458 -0
  40. package/dist/algorithm/spineless/runtime.js.map +1 -0
  41. package/dist/algorithm/spineless/style-dirty.d.ts +65 -0
  42. package/dist/algorithm/spineless/style-dirty.d.ts.map +1 -0
  43. package/dist/algorithm/spineless/style-dirty.js +75 -0
  44. package/dist/algorithm/spineless/style-dirty.js.map +1 -0
  45. package/dist/index.d.ts +3 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +6 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/inspect.d.ts +27 -0
  50. package/dist/inspect.d.ts.map +1 -0
  51. package/dist/inspect.js +61 -0
  52. package/dist/inspect.js.map +1 -0
  53. package/package.json +1 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;AAEpC,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,eAAe;AACf,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAajC,mBAAmB;AACnB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhD,yEAAyE;AACzE,uDAAuD;AACvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAiB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,eAAe;AACf,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAajC,mBAAmB;AACnB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhD,iEAAiE;AACjE,oCAAoC;AACpC,OAAO,EAAE,iBAAiB,EAAyC,MAAM,sBAAsB,CAAC;AAEhG,mEAAmE;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,yEAAyE;AACzE,uDAAuD;AACvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAiB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `inspectLayout` — a devtools / console dump of a computed-layout
3
+ * subtree (phase 9). Pairs with `setLayoutProfiler`: the profiler
4
+ * tells you *what the engine did*, this tells you *what it produced*.
5
+ */
6
+ import type { Node } from './node.js';
7
+ /**
8
+ * A human-readable, indented dump of `node`'s computed-layout
9
+ * subtree — one line per node, two spaces of indent per depth:
10
+ *
11
+ * ```
12
+ * incremental 0,0 100x40
13
+ * 0,0 30x40
14
+ * 30,0 30x40 dirty
15
+ * ```
16
+ *
17
+ * Each line is `left,top WxH` followed by any flags (`scroll=WxH`
18
+ * when the content extent overflows the box; `dirty` / `dirty-desc`
19
+ * for pending-relayout state). The root line is prefixed with the
20
+ * engine path its most recent `calculateLayout` took (`imperative` /
21
+ * `build` / `graft` / `incremental`), when known.
22
+ *
23
+ * Pure — allocates only the returned string; for devtools and
24
+ * console debugging, not a hot path.
25
+ */
26
+ export declare function inspectLayout(node: Node): string;
27
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAuBtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAYhD"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * `inspectLayout` — a devtools / console dump of a computed-layout
3
+ * subtree (phase 9). Pairs with `setLayoutProfiler`: the profiler
4
+ * tells you *what the engine did*, this tells you *what it produced*.
5
+ */
6
+ import { lastLayoutPath } from './algorithm/index.js';
7
+ /** `left,top widthxheight` from a node's computed (rounded) layout. */
8
+ function boxOf(node) {
9
+ const l = node.layout;
10
+ return `${l.left},${l.top} ${l.width}x${l.height}`;
11
+ }
12
+ /**
13
+ * Space-joined flags for one node: `scroll=WxH` when the content
14
+ * extent overflows the box, and the node's dirty state.
15
+ */
16
+ function flagsOf(node) {
17
+ const l = node.layout;
18
+ const flags = [];
19
+ if (l.scrollWidth > l.width || l.scrollHeight > l.height) {
20
+ flags.push(`scroll=${l.scrollWidth}x${l.scrollHeight}`);
21
+ }
22
+ if (node.isDirty())
23
+ flags.push('dirty');
24
+ else if (node._hasDirtyDescendant)
25
+ flags.push('dirty-desc');
26
+ return flags.join(' ');
27
+ }
28
+ /**
29
+ * A human-readable, indented dump of `node`'s computed-layout
30
+ * subtree — one line per node, two spaces of indent per depth:
31
+ *
32
+ * ```
33
+ * incremental 0,0 100x40
34
+ * 0,0 30x40
35
+ * 30,0 30x40 dirty
36
+ * ```
37
+ *
38
+ * Each line is `left,top WxH` followed by any flags (`scroll=WxH`
39
+ * when the content extent overflows the box; `dirty` / `dirty-desc`
40
+ * for pending-relayout state). The root line is prefixed with the
41
+ * engine path its most recent `calculateLayout` took (`imperative` /
42
+ * `build` / `graft` / `incremental`), when known.
43
+ *
44
+ * Pure — allocates only the returned string; for devtools and
45
+ * console debugging, not a hot path.
46
+ */
47
+ export function inspectLayout(node) {
48
+ const lines = [];
49
+ const visit = (n, depth) => {
50
+ const flags = flagsOf(n);
51
+ lines.push(`${' '.repeat(depth)}${boxOf(n)}${flags === '' ? '' : ` ${flags}`}`);
52
+ for (let i = 0; i < n.getChildCount(); i++)
53
+ visit(n.getChild(i), depth + 1);
54
+ };
55
+ visit(node, 0);
56
+ const path = lastLayoutPath(node);
57
+ if (path !== undefined)
58
+ lines[0] = `${path} ${lines[0]}`;
59
+ return lines.join('\n');
60
+ }
61
+ //# sourceMappingURL=inspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.js","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,uEAAuE;AACvE,SAAS,KAAK,CAAC,IAAU;IACvB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IACtB,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,SAAS,OAAO,CAAC,IAAU;IACzB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IACtB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QACzD,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACnC,IAAI,IAAI,CAAC,mBAAmB;QAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,aAAa,CAAC,IAAU;IACtC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,CAAC,CAAO,EAAE,KAAa,EAAQ,EAAE;QAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC,CAAC;QAClF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,EAAE;YAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAE,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC;IACF,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAEf,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,IAAI,KAAK,SAAS;QAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilates/core",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Headless flex layout engine for terminal UIs. Pure TypeScript, zero dependencies.",
5
5
  "license": "MIT",
6
6
  "author": "Zhijie Wang",