@graview/core 0.1.12 → 0.1.14

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 (139) hide show
  1. package/README.md +23 -2
  2. package/dist/address.d.ts +31 -0
  3. package/dist/address.d.ts.map +1 -0
  4. package/dist/address.js +53 -0
  5. package/dist/address.js.map +1 -0
  6. package/dist/app.d.ts +1 -1
  7. package/dist/app.d.ts.map +1 -1
  8. package/dist/arrange.d.ts +13 -183
  9. package/dist/arrange.d.ts.map +1 -1
  10. package/dist/arrange.js +12 -470
  11. package/dist/arrange.js.map +1 -1
  12. package/dist/arrangement.d.ts +169 -0
  13. package/dist/arrangement.d.ts.map +1 -0
  14. package/dist/arrangement.js +220 -0
  15. package/dist/arrangement.js.map +1 -0
  16. package/dist/arranging.d.ts +28 -0
  17. package/dist/arranging.d.ts.map +1 -0
  18. package/dist/arranging.js +264 -0
  19. package/dist/arranging.js.map +1 -0
  20. package/dist/capabilities.js +1 -1
  21. package/dist/capabilities.js.map +1 -1
  22. package/dist/cli/check/hidden-reads.d.ts.map +1 -1
  23. package/dist/cli/check/hidden-reads.js +31 -0
  24. package/dist/cli/check/hidden-reads.js.map +1 -1
  25. package/dist/cli/check/lenses.d.ts.map +1 -1
  26. package/dist/cli/check/lenses.js +29 -1
  27. package/dist/cli/check/lenses.js.map +1 -1
  28. package/dist/cli/describe.d.ts.map +1 -1
  29. package/dist/cli/describe.js +16 -6
  30. package/dist/cli/describe.js.map +1 -1
  31. package/dist/cli/docs.js +1 -1
  32. package/dist/cli/docs.js.map +1 -1
  33. package/dist/columns.d.ts +48 -16
  34. package/dist/columns.d.ts.map +1 -1
  35. package/dist/columns.js +65 -22
  36. package/dist/columns.js.map +1 -1
  37. package/dist/conformance/fixtures.d.ts.map +1 -1
  38. package/dist/conformance/fixtures.js +19 -1
  39. package/dist/conformance/fixtures.js.map +1 -1
  40. package/dist/describe.d.ts +2 -2
  41. package/dist/describe.d.ts.map +1 -1
  42. package/dist/describe.js +1 -1
  43. package/dist/describe.js.map +1 -1
  44. package/dist/document/act-findings.d.ts +5 -0
  45. package/dist/document/act-findings.d.ts.map +1 -0
  46. package/dist/document/act-findings.js +84 -0
  47. package/dist/document/act-findings.js.map +1 -0
  48. package/dist/document/compile-checked.d.ts.map +1 -1
  49. package/dist/document/compile-checked.js +11 -4
  50. package/dist/document/compile-checked.js.map +1 -1
  51. package/dist/document/compile.d.ts +15 -4
  52. package/dist/document/compile.d.ts.map +1 -1
  53. package/dist/document/compile.js +102 -18
  54. package/dist/document/compile.js.map +1 -1
  55. package/dist/document/describe-coverage.d.ts +37 -0
  56. package/dist/document/describe-coverage.d.ts.map +1 -0
  57. package/dist/document/describe-coverage.js +162 -0
  58. package/dist/document/describe-coverage.js.map +1 -0
  59. package/dist/document/describe-place.d.ts.map +1 -1
  60. package/dist/document/describe-place.js +14 -1
  61. package/dist/document/describe-place.js.map +1 -1
  62. package/dist/document/diff.d.ts +5 -0
  63. package/dist/document/diff.d.ts.map +1 -1
  64. package/dist/document/diff.js +12 -3
  65. package/dist/document/diff.js.map +1 -1
  66. package/dist/document/edit.d.ts +1 -1
  67. package/dist/document/edit.d.ts.map +1 -1
  68. package/dist/document/edit.js +63 -6
  69. package/dist/document/edit.js.map +1 -1
  70. package/dist/document/far-end.d.ts +15 -0
  71. package/dist/document/far-end.d.ts.map +1 -0
  72. package/dist/document/far-end.js +26 -0
  73. package/dist/document/far-end.js.map +1 -0
  74. package/dist/document/index.d.ts +1 -1
  75. package/dist/document/index.d.ts.map +1 -1
  76. package/dist/document/migrate.d.ts.map +1 -1
  77. package/dist/document/migrate.js +7 -5
  78. package/dist/document/migrate.js.map +1 -1
  79. package/dist/document/range.d.ts +17 -0
  80. package/dist/document/range.d.ts.map +1 -0
  81. package/dist/document/range.js +46 -0
  82. package/dist/document/range.js.map +1 -0
  83. package/dist/document/schema.d.ts +23 -0
  84. package/dist/document/schema.d.ts.map +1 -1
  85. package/dist/document/schema.js +16 -0
  86. package/dist/document/schema.js.map +1 -1
  87. package/dist/document/thumbnail.d.ts +21 -0
  88. package/dist/document/thumbnail.d.ts.map +1 -1
  89. package/dist/document/thumbnail.js +139 -32
  90. package/dist/document/thumbnail.js.map +1 -1
  91. package/dist/document/to-document.d.ts.map +1 -1
  92. package/dist/document/to-document.js +16 -2
  93. package/dist/document/to-document.js.map +1 -1
  94. package/dist/index.d.ts +3 -2
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +3 -2
  97. package/dist/index.js.map +1 -1
  98. package/dist/mutations/define-mutation.d.ts.map +1 -1
  99. package/dist/mutations/define-mutation.js +9 -1
  100. package/dist/mutations/define-mutation.js.map +1 -1
  101. package/dist/mutations/derive-edits.d.ts +8 -0
  102. package/dist/mutations/derive-edits.d.ts.map +1 -1
  103. package/dist/mutations/derive-edits.js +30 -7
  104. package/dist/mutations/derive-edits.js.map +1 -1
  105. package/dist/mutations/form.d.ts +2 -0
  106. package/dist/mutations/form.d.ts.map +1 -1
  107. package/dist/mutations/form.js +1 -0
  108. package/dist/mutations/form.js.map +1 -1
  109. package/dist/mutations/node-ref.d.ts +4 -1
  110. package/dist/mutations/node-ref.d.ts.map +1 -1
  111. package/dist/mutations/node-ref.js +6 -0
  112. package/dist/mutations/node-ref.js.map +1 -1
  113. package/dist/mutations/types.d.ts +16 -0
  114. package/dist/mutations/types.d.ts.map +1 -1
  115. package/dist/places.js +1 -1
  116. package/dist/places.js.map +1 -1
  117. package/dist/refusal.d.ts.map +1 -1
  118. package/dist/refusal.js +4 -0
  119. package/dist/refusal.js.map +1 -1
  120. package/dist/refused.d.ts +20 -0
  121. package/dist/refused.d.ts.map +1 -0
  122. package/dist/refused.js +24 -0
  123. package/dist/refused.js.map +1 -0
  124. package/dist/scaffold/project.d.ts.map +1 -1
  125. package/dist/scaffold/project.js +3 -0
  126. package/dist/scaffold/project.js.map +1 -1
  127. package/dist/search.d.ts +1 -1
  128. package/dist/search.d.ts.map +1 -1
  129. package/dist/search.js +1 -1
  130. package/dist/search.js.map +1 -1
  131. package/dist/theme/derive.d.ts.map +1 -1
  132. package/dist/theme/derive.js +5 -4
  133. package/dist/theme/derive.js.map +1 -1
  134. package/dist/theme/types.d.ts.map +1 -1
  135. package/dist/theme/types.js +5 -0
  136. package/dist/theme/types.js.map +1 -1
  137. package/dist/version.d.ts +1 -1
  138. package/dist/version.js +1 -1
  139. package/package.json +5 -1
package/README.md CHANGED
@@ -7,7 +7,10 @@ Everything a Graview app declares, and the checker that verifies it.
7
7
  - **Graph** — nodes and edges, with a tracked reader so a mutation records
8
8
  what it read as well as what it wrote.
9
9
  - **Mutations** — `defineMutation`. Every change is a typed, named,
10
- describable act; nothing writes the graph directly.
10
+ describable act; nothing writes the graph directly. Each kind gets a
11
+ derived `edit-<kind>` offering the fields no other act writes; it takes
12
+ only those, and an act refused as asked throws an `ActRefusal` whose
13
+ `reason` and `sentence` a host can show (`refusalOf` reads one).
11
14
  - **Invariants** — rules that judge the graph and name the mutations that
12
15
  would repair them. That naming is the seam derived affordances ride on.
13
16
  - **Operation log** — the graph is a fold over it. Author, intent, reads and
@@ -31,18 +34,36 @@ Everything a Graview app declares, and the checker that verifies it.
31
34
  back out. Rules say what must hold in a small, budgeted language
32
35
  (`expressionRule`). Every command that takes an entry takes
33
36
  `--document <file>`. A view's blocks resolve with `@graview/core/blocks`.
37
+ A number field may say its range (`min`, `max`, `step`), which every form,
38
+ tool and apply honours; an act's `connects` links from whichever end
39
+ of the relation its subject is, `replaces` severs the links it supersedes and set the record at the
40
+ other end (its "setsOther" key). `editDocument`, `diffDocuments` and
41
+ `planMigration` change a document and say what the change does to stored
42
+ data.
34
43
  - **The city** — `@graview/core/scene`: `sceneThumbnail` draws a document
35
44
  (or an app) as the Scene draws it from altitude — the same districts on
36
45
  the same map, in their hues — as one SVG string, with no DOM, for a host
37
- listing apps; `sceneDistricts` is the same answer as data. A kind's
46
+ listing apps; `sceneDistricts` is the same answer as data. At a card's
47
+ size, `fit: "content"` fits it to what stands: each district on its whole
48
+ block from the same corner, cropped to the plots, with a few blocks no
49
+ narrower than `minBuilding` pixels (16 by default) rather than a speck per
50
+ record. A kind's
38
51
  figures are `@graview/core/figures`.
39
52
  - **What a page loads first** — `@graview/core` and `@graview/core/document`
40
53
  hold only what a page draws with. The checker, the city, the figures and
41
54
  the block resolver are on the subpaths above because a bundler places a
42
55
  whole module in every chunk that can reach it: a hosted page imports both
43
56
  barrels up front, and would otherwise carry them before a face is fetched.
57
+ - **A place's address** — `addressOf(place, { basePath })` spells a place
58
+ from `placesOf` as the routed face links to it under a host's base path,
59
+ `pathWithin` reads an address back, and `basePathOf` normalises a base.
44
60
  - **Conformance** — `@graview/core/conformance`: fixtures a host runs against
45
61
  a version (`conformance()`) to prove it reads, compiles and derives the same.
62
+ - **A status board's moves** — `@graview/core/describe`: `columnReach` says
63
+ which acts move a card to which column — the named steps that set the
64
+ field to that column's value, or else an act told the value — and
65
+ `columnMoves` the ones one seat may run on one record, its conditions
66
+ judged.
46
67
 
47
68
  ```sh
48
69
  npx graview create my-app # a product on Graview, started (also: npm create graview)
@@ -0,0 +1,31 @@
1
+ /**
2
+ * AN APP'S ADDRESS UNDER A HOST'S BASE PATH (FR-106).
3
+ *
4
+ * A host that owns the page gives the routed face the address bar
5
+ * (`routing: "address"` on the embed), and serves the app at `/` or under a
6
+ * path of its own — `/apps/<id>/`, say. `placesOf(app)` says each place's
7
+ * address relative to the app (`/`, `/<plural>`, `/places/<as>`); these say
8
+ * it under the base, spelled the way the face's own links are, and read an
9
+ * address in the bar back to the app's own path.
10
+ */
11
+ /** A base path as the router holds it: a leading slash, no trailing one, and the root as `""`. */
12
+ export declare function basePathOf(basePath: string | undefined): string;
13
+ /**
14
+ * A place's address under a base: `addressOf("/places/the-board", { basePath:
15
+ * "/apps/a1/" })` is `/apps/a1/places/the-board`. The home is the base itself
16
+ * (`/apps/a1`), as the routed face's own link home spells it. Takes an
17
+ * `AppPlace` from `placesOf` or its `address`; what is encoded stays encoded.
18
+ */
19
+ export declare function addressOf(place: string | {
20
+ readonly address: string;
21
+ }, options?: {
22
+ readonly basePath?: string;
23
+ }): string;
24
+ /**
25
+ * An address in the bar, read back to the app's own path: `/apps/a1/tasks`
26
+ * under `/apps/a1` is `/tasks`, the base itself is `/`, and an address that
27
+ * is not under the base at all is `null`. Compared as the router compares,
28
+ * ignoring case; what is encoded stays encoded.
29
+ */
30
+ export declare function pathWithin(pathname: string, basePath: string | undefined): string | null;
31
+ //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI/D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,CAQ5H;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAOxF"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * AN APP'S ADDRESS UNDER A HOST'S BASE PATH (FR-106).
3
+ *
4
+ * A host that owns the page gives the routed face the address bar
5
+ * (`routing: "address"` on the embed), and serves the app at `/` or under a
6
+ * path of its own — `/apps/<id>/`, say. `placesOf(app)` says each place's
7
+ * address relative to the app (`/`, `/<plural>`, `/places/<as>`); these say
8
+ * it under the base, spelled the way the face's own links are, and read an
9
+ * address in the bar back to the app's own path.
10
+ */
11
+ /** A base path as the router holds it: a leading slash, no trailing one, and the root as `""`. */
12
+ export function basePathOf(basePath) {
13
+ const trimmed = (basePath ?? "").replace(/\/+$/, "");
14
+ if (trimmed === "")
15
+ return "";
16
+ return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
17
+ }
18
+ /**
19
+ * A place's address under a base: `addressOf("/places/the-board", { basePath:
20
+ * "/apps/a1/" })` is `/apps/a1/places/the-board`. The home is the base itself
21
+ * (`/apps/a1`), as the routed face's own link home spells it. Takes an
22
+ * `AppPlace` from `placesOf` or its `address`; what is encoded stays encoded.
23
+ */
24
+ export function addressOf(place, options = {}) {
25
+ const address = typeof place === "string" ? place : place.address;
26
+ const base = basePathOf(options.basePath);
27
+ const path = address.startsWith("/") ? address : `/${address}`;
28
+ if (base === "")
29
+ return path;
30
+ if (path === "/")
31
+ return base;
32
+ if (path.startsWith("/?") || path.startsWith("/#"))
33
+ return `${base}${path.slice(1)}`;
34
+ return `${base}${path}`;
35
+ }
36
+ /**
37
+ * An address in the bar, read back to the app's own path: `/apps/a1/tasks`
38
+ * under `/apps/a1` is `/tasks`, the base itself is `/`, and an address that
39
+ * is not under the base at all is `null`. Compared as the router compares,
40
+ * ignoring case; what is encoded stays encoded.
41
+ */
42
+ export function pathWithin(pathname, basePath) {
43
+ const base = basePathOf(basePath);
44
+ if (base === "")
45
+ return pathname.startsWith("/") ? pathname : `/${pathname}`;
46
+ if (!pathname.toLowerCase().startsWith(base.toLowerCase()))
47
+ return null;
48
+ const rest = pathname.slice(base.length);
49
+ if (rest === "" || rest === "/")
50
+ return "/";
51
+ return rest.startsWith("/") ? rest : null;
52
+ }
53
+ //# sourceMappingURL=address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.js","sourceRoot":"","sources":["../src/address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kGAAkG;AAClG,MAAM,UAAU,UAAU,CAAC,QAA4B;IACrD,MAAM,OAAO,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACrD,IAAI,OAAO,KAAK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EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IACxE,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,GAAG;QAAE,OAAO,GAAG,CAAC;IAC5C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5C,CAAC"}
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ArrangementWords } from "./arrange.js";
1
+ import type { ArrangementWords } from "./arrangement.js";
2
2
  import type { InvariantDefinition } from "./invariants/types.js";
3
3
  import type { AnyMutationDefinition } from "./mutations/types.js";
4
4
  import type { Policy } from "./permissions/types.js";
package/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAA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UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAEhF"}
package/dist/arrange.d.ts CHANGED
@@ -1,186 +1,16 @@
1
- import type { AnySchema } from "./schema/schema.js";
2
1
  /**
3
- * ARRANGEMENT IS A CAPABILITY OF THE DECLARATION, not of a view.
2
+ * `@graview/core/arrange` — WHAT A KIND CAN BE ARRANGED BY, AND ARRANGING IT.
4
3
  *
5
- * Every surface that lists things arranges them, and each did it its own
6
- * way or not at all: the list page grouped by an edge through a URL key of
7
- * its own, the districts sorted by id, the board and the calendar took no
8
- * sort, filter or group whatever. What a kind CAN be arranged by is already
9
- * written down — its fields have types, its edges have far ends, its
10
- * lifecycle names the past, the rules name what is flagged — so the offers
11
- * are derived here once, headless, and the same string carries the chosen
12
- * arrangement in a stop's fragment (`in.sort`, `in.filter`, `in.group`) and
13
- * in a page's search, so an arranged picture is a link.
14
- */
15
- export type SortDirection = "asc" | "desc";
16
- export interface Sort {
17
- /** `label`, a field name, or an edge kind (by the far end's label). */
18
- readonly by: string;
19
- readonly direction: SortDirection;
20
- }
21
- /**
22
- * One condition; a filter is the conjunction of several.
23
- *
24
- * `key` is a field name, an edge kind, or `is`. The value's grammar depends
25
- * on the key: a boolean, enum or text field takes one of its values; a date
26
- * field takes `before:<date>`, `after:<date>` or `on:<date>`; a number field
27
- * takes `at-most:<n>`, `at-least:<n>` or a value; an edge takes a
28
- * node id, `*` (tied to anything) or `none`; `is` takes `current`, `past`,
29
- * `any`, `flagged` or `clear`. Anything else is dropped, not thrown.
30
- */
31
- export interface Condition {
32
- readonly key: string;
33
- readonly value: string;
34
- }
35
- /** How wide a date group is. A year and a decade are what a catalogue of thirty years reads by. */
36
- export type DateBucket = "day" | "week" | "month" | "year" | "decade";
37
- export interface Grouping {
38
- /** A field name or an edge kind. */
39
- readonly by: string;
40
- /** For a date field: how wide a group is. Day when unsaid. */
41
- readonly bucket?: DateBucket;
42
- }
43
- export interface Arrangement {
44
- readonly sort?: Sort;
45
- readonly filter?: readonly Condition[];
46
- readonly group?: Grouping;
47
- /**
48
- * Words to look for: a node stays when its label or any scalar field
49
- * contains them, case aside. The narrowing a person types, beside the
50
- * conditions a person picks — and the same matcher a search would use.
51
- */
52
- readonly query?: string;
53
- }
54
- export declare const NO_ARRANGEMENT: Arrangement;
55
- /** What a lens says to decline arrangement, wholly or a part at a time. */
56
- export type ArrangeOption = boolean | {
57
- readonly sort?: boolean;
58
- readonly filter?: boolean;
59
- readonly group?: boolean;
60
- };
61
- /** Whether a lens offers a part, given what it declared. Everything is on unless declined. */
62
- export declare function arrangeAllows(option: ArrangeOption | undefined, part: "sort" | "filter" | "group"): boolean;
63
- export type OfferType = "text" | "number" | "date" | "boolean" | "choice";
64
- /** One thing a kind can be sorted, filtered or grouped by, in the declaration's own words. */
65
- export interface ArrangeOffer {
66
- readonly key: string;
67
- /** The words for it: the field's reading, the edge kind humanised, or the reserved word's sentence. */
68
- readonly label: string;
69
- readonly about: "label" | "field" | "edge" | "is";
70
- readonly type?: OfferType;
71
- /** For a choice field, its options; for `is`, its words; for an edge, nothing — the far ends are the graph's. */
72
- readonly options?: readonly string[];
73
- /** For a date field, how it may be bucketed when grouped. */
74
- readonly buckets?: readonly DateBucket[];
75
- /** For an edge: the kinds at the far end, and how it reads from this kind. */
76
- readonly far?: readonly string[];
77
- }
78
- export interface Arrangeable {
79
- readonly kind: string;
80
- readonly sorts: readonly ArrangeOffer[];
81
- readonly filters: readonly ArrangeOffer[];
82
- readonly groups: readonly ArrangeOffer[];
83
- /** The kind's natural order, when `fieldRoles.order` names one. */
84
- readonly natural?: Sort;
85
- }
86
- /** The edges this kind takes part in, from either end, with how each reads from here. */
87
- export declare function edgesOf(schema: AnySchema, kind: string): readonly ArrangeOffer[];
88
- /**
89
- * Whether a condition names one of a kind's RETIRED states — `status:demo`
90
- * where demos are behind the horizon — which is asking for the past by
91
- * name. The search box and the list page both left the past out for it and
92
- * found nothing.
93
- */
94
- export declare function asksForThePast(definition: {
95
- readonly lifecycle?: {
96
- readonly field: string;
97
- readonly retired: readonly unknown[] | "date";
98
- };
99
- } | undefined, conditions: readonly {
100
- readonly key: string;
101
- readonly value: string;
102
- }[]): boolean;
103
- /**
104
- * What a kind can be arranged by, derived from its declaration alone.
105
- *
106
- * Sorts: the label, every field with a scalar type, every edge (by the far
107
- * end's label). Filters: boolean and choice fields by value, date fields by
108
- * before/after/on, every edge by a node or by having one at all, and `is`
109
- * for the lifecycle and the standing. Groups: boolean and choice fields,
110
- * date fields by day, week or month, and every edge by its far end. A field
111
- * the declaration hides is not offered — an ordering key is not a thing a
112
- * person groups by.
113
- */
114
- export declare function arrangeable(schema: AnySchema, kind: string): Arrangeable;
115
- export interface ArrangementWords {
116
- readonly sort?: string;
117
- readonly filter?: string;
118
- readonly group?: string;
119
- readonly q?: string;
120
- }
121
- export declare function parseArrangement(words: ArrangementWords): Arrangement;
122
- export declare function formatArrangement(arrangement: Arrangement): ArrangementWords;
123
- /**
124
- * Keeps only the parts a kind can actually be arranged by, and says which
125
- * were dropped — a stale link names a field that was renamed, and the
126
- * honest thing is to show the rest arranged and say what was ignored.
127
- */
128
- export declare function admitArrangement(arrangement: Arrangement, offers: Arrangeable): {
129
- readonly arrangement: Arrangement;
130
- readonly dropped: readonly string[];
131
- };
132
- /** What arranging needs of a node: its identity. Fields are read off it by name. */
133
- export type ArrangeNode = {
134
- readonly id: string;
135
- readonly kind: string;
136
- };
137
- /**
138
- * The little of a graph arranging needs, said structurally so a `Graph<S>`
139
- * over any concrete schema fits — `GraphReader`'s generic `nodesOfKind`
140
- * does not, once the kinds are literal.
141
- */
142
- export interface ArrangeGraph {
143
- getNode(id: string): ArrangeNode | undefined;
144
- allNodes(): readonly ArrangeNode[];
145
- out(id: string, kind?: string): readonly ArrangeNode[];
146
- in(id: string, kind?: string): readonly ArrangeNode[];
147
- }
148
- export interface ArrangeContext {
149
- readonly schema: AnySchema;
150
- readonly graph: ArrangeGraph;
151
- /** Node ids the rules currently implicate, for `is:flagged` and `is:clear`. */
152
- readonly flagged?: ReadonlySet<string>;
153
- /** For the lifecycle: today, as YYYY-MM-DD. */
154
- readonly today?: string;
155
- }
156
- export interface ArrangedGroup<N extends ArrangeNode = ArrangeNode> {
157
- /** Stable, sortable: the value, the date bucket's first day, the far end's id, or `` for none. */
158
- readonly key: string;
159
- /** The words for the group: a value as it reads, a date, a far end's label, or "No <reading>". */
160
- readonly label: string;
161
- readonly nodes: readonly N[];
162
- }
163
- export interface Arranged<N extends ArrangeNode = ArrangeNode> {
164
- /** The nodes that passed the filter, in order. */
165
- readonly nodes: readonly N[];
166
- /** The same nodes, grouped when a grouping was asked; one unnamed group otherwise. */
167
- readonly groups: readonly ArrangedGroup<N>[];
168
- readonly grouped: boolean;
169
- }
170
- /** The first day of the bucket a date falls in, as YYYY-MM-DD; weeks start on Monday, in UTC. */
171
- export declare function bucketStart(date: string, bucket: DateBucket): string | undefined;
172
- /** Whether a node meets one condition of a filter. Search judges its `key:value` tokens with this too. */
173
- export declare function conditionHolds(ctx: ArrangeContext, node: ArrangeNode, condition: Condition): boolean;
174
- /**
175
- * Whether the words find the node — search's own matcher, so a list's `q`
176
- * and the Find box never disagree: every word the start of a word in the
177
- * label or a readable field, case, diacritics and punctuation aside.
178
- */
179
- export declare function matches(ctx: ArrangeContext, node: ArrangeNode, query: string): boolean;
180
- /**
181
- * Filters, sorts and groups. The filter is a conjunction; the sort is
182
- * stable; a grouping puts the group with nothing to say last. Nodes whose
183
- * kind the context cannot describe are kept and sort by what they carry.
184
- */
185
- export declare function arrange<N extends ArrangeNode>(nodes: readonly N[], arrangement: Arrangement, ctx: ArrangeContext): Arranged<N>;
4
+ * The offers a kind's declaration makes (`arrangeable`), the grammar that
5
+ * carries a chosen arrangement in an address (`parseArrangement`,
6
+ * `formatArrangement`), and the filtering, sorting and grouping itself
7
+ * (`arrange`). Apart from `@graview/core` because a bundler places a whole
8
+ * file in a page's first chunk when the first chunk can reach it and any
9
+ * chunk uses it: a page that has drawn no list yet carries none of the
10
+ * arranging. The types stay on `@graview/core`, where a declaration names
11
+ * them.
12
+ */
13
+ export { arrangeable, asksForThePast, conditionHolds, edgesOf, NO_ARRANGEMENT, parseArrangement } from "./arrangement.js";
14
+ export { admitArrangement, arrange, arrangeAllows, bucketStart, formatArrangement, matches } from "./arranging.js";
15
+ export type { Arrangeable, ArrangeContext, Arranged, ArrangeGraph, ArrangedGroup, Arrangement, ArrangementWords, ArrangeNode, ArrangeOffer, ArrangeOption, Condition, DateBucket, Grouping, OfferType, Sort, SortDirection, } from "./arrangement.js";
186
16
  //# sourceMappingURL=arrange.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"arrange.d.ts","sourceRoot":"","sources":["../src/arrange.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,IAAI;IACnB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CACnC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,mGAAmG;AACnG,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEtE,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EA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