@graview/core 0.1.65 → 0.1.66
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/archived-seen.js +2 -2
- package/dist/archived-seen.js.map +1 -1
- package/dist/capital.d.ts +8 -0
- package/dist/capital.d.ts.map +1 -1
- package/dist/capital.js +8 -0
- package/dist/capital.js.map +1 -1
- package/dist/columns.js +2 -2
- package/dist/columns.js.map +1 -1
- package/dist/conformance/index.d.ts +2 -0
- package/dist/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +1 -0
- package/dist/conformance/index.js.map +1 -1
- package/dist/conformance/view-fork-host.d.ts +26 -0
- package/dist/conformance/view-fork-host.d.ts.map +1 -0
- package/dist/conformance/view-fork-host.js +47 -0
- package/dist/conformance/view-fork-host.js.map +1 -0
- package/dist/css/tables.d.ts.map +1 -1
- package/dist/css/tables.js +5 -1
- package/dist/css/tables.js.map +1 -1
- package/dist/document/compile.d.ts.map +1 -1
- package/dist/document/compile.js +6 -2
- package/dist/document/compile.js.map +1 -1
- package/dist/document.schema.json +2 -2
- package/dist/friction-record.d.ts +2 -1
- package/dist/friction-record.d.ts.map +1 -1
- package/dist/friction.d.ts +4 -0
- package/dist/friction.d.ts.map +1 -1
- package/dist/friction.js +5 -4
- package/dist/friction.js.map +1 -1
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/graph.js +3 -3
- package/dist/graph/graph.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/intelligence-bridge.d.ts +9 -2
- package/dist/intelligence-bridge.d.ts.map +1 -1
- package/dist/mutations/derive-edits.d.ts.map +1 -1
- package/dist/mutations/derive-edits.js +3 -5
- package/dist/mutations/derive-edits.js.map +1 -1
- package/dist/ops/declines.d.ts +41 -0
- package/dist/ops/declines.d.ts.map +1 -0
- package/dist/ops/declines.js +118 -0
- package/dist/ops/declines.js.map +1 -0
- package/dist/ops/log.d.ts +12 -0
- package/dist/ops/log.d.ts.map +1 -1
- package/dist/ops/log.js.map +1 -1
- package/dist/ops/provenance.js +2 -2
- package/dist/ops/provenance.js.map +1 -1
- package/dist/ops/tidying.d.ts +23 -17
- package/dist/ops/tidying.d.ts.map +1 -1
- package/dist/ops/tidying.js +1 -76
- package/dist/ops/tidying.js.map +1 -1
- package/dist/revisions/pinned-dates.d.ts +30 -0
- package/dist/revisions/pinned-dates.d.ts.map +1 -0
- package/dist/revisions/pinned-dates.js +120 -0
- package/dist/revisions/pinned-dates.js.map +1 -0
- package/dist/revisions/touched.d.ts +59 -0
- package/dist/revisions/touched.d.ts.map +1 -0
- package/dist/revisions/touched.js +72 -0
- package/dist/revisions/touched.js.map +1 -0
- package/dist/revisions.d.ts +4 -0
- package/dist/revisions.d.ts.map +1 -1
- package/dist/revisions.js +5 -1
- package/dist/revisions.js.map +1 -1
- package/dist/scaffold/ui.d.ts.map +1 -1
- package/dist/scaffold/ui.js +30 -44
- package/dist/scaffold/ui.js.map +1 -1
- package/dist/schema/define-node.d.ts +7 -0
- package/dist/schema/define-node.d.ts.map +1 -1
- package/dist/schema/define-node.js +8 -1
- package/dist/schema/define-node.js.map +1 -1
- package/dist/seen.js +1 -1
- package/dist/seen.js.map +1 -1
- package/dist/store.d.ts +5 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +12 -4
- package/dist/store.js.map +1 -1
- package/dist/tidying.d.ts +5 -2
- package/dist/tidying.d.ts.map +1 -1
- package/dist/tidying.js +12 -3
- package/dist/tidying.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/views/kept.d.ts +52 -0
- package/dist/views/kept.d.ts.map +1 -1
- package/dist/views/kept.js +45 -0
- package/dist/views/kept.js.map +1 -1
- package/dist/workflows/step-classify.js +1 -1
- package/package.json +1 -1
package/dist/ops/tidying.d.ts
CHANGED
|
@@ -22,8 +22,6 @@ export declare const isLeftAlone: (from: {
|
|
|
22
22
|
} | Reads, id: string) => boolean;
|
|
23
23
|
/** What the declaration says the actor may do to a kind's records, or to one relation of it, on its own. */
|
|
24
24
|
export declare function tidyingOf(schema: AnySchema, kind: string, relation?: string): "never" | "no-links" | undefined;
|
|
25
|
-
/** WHO A SUGGESTION IS, whoever made it and on whatever basis: its calls, in order, each its act and arguments, keys in order. */
|
|
26
|
-
export declare const suggestionKey: (calls: readonly MutationCall[]) => string;
|
|
27
25
|
/**
|
|
28
26
|
* WHAT THE APP KNOWS OF ITS ACTS, for reading what a call means rather than
|
|
29
27
|
* how it was spelled (`meaningKey`): the act a name says, however it is
|
|
@@ -44,24 +42,32 @@ export interface ActMeanings {
|
|
|
44
42
|
readonly has: (id: string) => boolean;
|
|
45
43
|
}
|
|
46
44
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* pair, whichever way round; a record archived, removed or left alone; and
|
|
50
|
-
* anything else its act, in any spelling of it, and its arguments, less the
|
|
51
|
-
* minted id of a record it would make. Worked out from the calls whenever
|
|
52
|
-
* it is asked, so a decline already in a log matches by it too.
|
|
45
|
+
* A DECLINE A CHECKPOINT KEPT (`Epoch.declines`): the op that said it — the
|
|
46
|
+
* undo, or the unlink — gone to the archive since, as who said it and when.
|
|
53
47
|
*/
|
|
54
|
-
export
|
|
48
|
+
export interface KeptDecline {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly at: string;
|
|
51
|
+
readonly author: Author;
|
|
52
|
+
readonly undoes?: string;
|
|
53
|
+
}
|
|
54
|
+
/** A decline: the op in the log that said it, or what a checkpoint kept of one archived since. */
|
|
55
|
+
export type Decline = Operation | KeptDecline;
|
|
55
56
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
57
|
+
* WHAT A PERSON DECLINED, JUDGED OFF THE PAGE. Which ops decline what, and
|
|
58
|
+
* what a call means, are `./declines.ts`'s, taught to the store when
|
|
59
|
+
* `@graview/core/tidying` is loaded — as every host that runs the app's
|
|
60
|
+
* own actor does (`dream`, `suggest`, a workflow, `@graview/ship`'s
|
|
61
|
+
* server) — so a page, where the actor never runs, carries none of it.
|
|
62
|
+
* Shared through the global registry, so two copies of this module agree.
|
|
61
63
|
*/
|
|
62
|
-
export
|
|
63
|
-
/**
|
|
64
|
-
|
|
64
|
+
export interface DeclinesHeld {
|
|
65
|
+
/** The decline that answers these calls, or undefined (`declinedIn`). */
|
|
66
|
+
declined?: (ops: readonly Operation[], calls: readonly MutationCall[], meanings: ActMeanings | undefined, kept: Readonly<Record<string, KeptDecline>> | undefined) => Decline | undefined;
|
|
67
|
+
/** What a checkpoint keeps of a log's declines (`Epoch.declines`). */
|
|
68
|
+
kept?: (ops: readonly Operation[], meanings: ActMeanings | undefined, kept: Readonly<Record<string, KeptDecline>> | undefined) => Record<string, KeptDecline>;
|
|
69
|
+
}
|
|
70
|
+
export declare const DECLINES: DeclinesHeld;
|
|
65
71
|
/**
|
|
66
72
|
* WHY THE APP'S OWN ACTOR MAY NOT MAKE THESE PRIMITIVES, in a sentence, or
|
|
67
73
|
* undefined when it may: a record a person said to leave alone, a kind the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tidying.d.ts","sourceRoot":"","sources":["../../src/ops/tidying.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"tidying.d.ts","sourceRoot":"","sources":["../../src/ops/tidying.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAoBpD,KAAK,KAAK,GAAG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,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,kGAAkG;AAClG,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,YAAY,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GAAG,SAAS,KAAK,OAAO,GAAG,SAAS,CAAC;IAC1L,sEAAsE;IACtE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,SAAS,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GAAG,SAAS,KAAK,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CAC/J;AACD,eAAO,MAAM,QAAQ,EAAE,YAAsH,CAAC;AAE9I;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,SAAS,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,GAAG,SAAS,CAoBnL"}
|
package/dist/ops/tidying.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { LEFT_ALONE } from "../graph/archived.js";
|
|
2
|
-
import { spellingOf } from "../mutations/act-spelling.js";
|
|
3
|
-
import { derivedActOf } from "../mutations/derived-names.js";
|
|
4
2
|
import { labelOf, pluralOf } from "../schema/define-node.js";
|
|
5
|
-
import { undoneIn } from "./log.js";
|
|
6
3
|
/**
|
|
7
4
|
* WHETHER AN AUTHOR IS THE APP'S OWN ACTOR: a `system` or `agent` author
|
|
8
5
|
* that says `automated: true`. A person never is, whatever they say.
|
|
@@ -23,79 +20,7 @@ export function tidyingOf(schema, kind, relation) {
|
|
|
23
20
|
const definition = schema.tryDefinition(kind);
|
|
24
21
|
return relation === undefined ? definition?.tidying : definition?.edges?.[relation]?.tidying;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
const sortedKey = (value) => JSON.stringify(value, (_, inner) => (inner && typeof inner === "object" && !Array.isArray(inner) ? Object.fromEntries(Object.entries(inner).sort()) : inner));
|
|
28
|
-
/** WHO A SUGGESTION IS, whoever made it and on whatever basis: its calls, in order, each its act and arguments, keys in order. */
|
|
29
|
-
export const suggestionKey = (calls) => sortedKey(calls.map((call) => [call.name, call.args]));
|
|
30
|
-
/** The acts said of one record alone: set aside, brought back, removed, left alone, let be tidied. */
|
|
31
|
-
const ON_ONE = /^(archive|unarchive|remove|leave-alone|allow-tidying)$/;
|
|
32
|
-
/** What one call means, as what a key is written from. */
|
|
33
|
-
function meaningOf(call, meanings) {
|
|
34
|
-
const name = spellingOf(call.name);
|
|
35
|
-
const act = meanings?.act(call.name);
|
|
36
|
-
const args = (call.args ?? {});
|
|
37
|
-
// The act's own word on what it is; a bare name is read as one only when nothing knows the act.
|
|
38
|
-
const derived = act ? act.derived : derivedActOf(name);
|
|
39
|
-
const { id } = args;
|
|
40
|
-
if (derived && typeof id === "string") {
|
|
41
|
-
if (ON_ONE.test(derived.act))
|
|
42
|
-
return [derived.act, id];
|
|
43
|
-
// A pair merged, whichever of the two went into the other.
|
|
44
|
-
if (derived.act === "merge")
|
|
45
|
-
return ["merge", ...[id, args["into"]].sort()];
|
|
46
|
-
if (derived.relation)
|
|
47
|
-
return [derived.act, derived.relation, id, args["to"]];
|
|
48
|
-
}
|
|
49
|
-
// A declared act that makes one relation between its subject and one other record is that link, as its relation's own act would make it.
|
|
50
|
-
const subject = act?.subject?.arg ?? "id";
|
|
51
|
-
const [other, more] = Object.keys(args).filter((key) => key !== subject);
|
|
52
|
-
if (act?.connects?.length === 1 && other && !more && meanings.has(args[subject]) && meanings.has(args[other]))
|
|
53
|
-
return ["connect", act.connects[0], args[subject], args[other]];
|
|
54
|
-
// Anything else is its act and arguments, less the id of a record it would make: minted afresh each time it is asked.
|
|
55
|
-
return [name, act?.creates?.length && typeof id === "string" && !meanings.has(id) ? { ...args, id: 0 } : args];
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* WHAT A SUGGESTION MEANS, however its calls were spelled: a link between
|
|
59
|
-
* two records by its relation, whichever act asks for it; a merge of a
|
|
60
|
-
* pair, whichever way round; a record archived, removed or left alone; and
|
|
61
|
-
* anything else its act, in any spelling of it, and its arguments, less the
|
|
62
|
-
* minted id of a record it would make. Worked out from the calls whenever
|
|
63
|
-
* it is asked, so a decline already in a log matches by it too.
|
|
64
|
-
*/
|
|
65
|
-
export const meaningKey = (calls, meanings) => `≈${sortedKey(calls.map((call) => meaningOf(call, meanings)))}`;
|
|
66
|
-
/**
|
|
67
|
-
* THE OP THAT DECLINED THESE CALLS — the whole suggestion, or any one of
|
|
68
|
-
* them on its own, asked exactly as it was or meaning the same
|
|
69
|
-
* (`meaningKey`) — or undefined: a live undo of a suggestion, or of a
|
|
70
|
-
* change made with a lineage (an actor's confident change a person took
|
|
71
|
-
* back). "Do not make this again."
|
|
72
|
-
*/
|
|
73
|
-
export function declinedIn(ops, calls, meanings) {
|
|
74
|
-
const declines = declinesIn(ops, meanings);
|
|
75
|
-
return [calls, ...calls.map((call) => [call])].map((asked) => declines.get(meaningKey(asked, meanings))).find(Boolean);
|
|
76
|
-
}
|
|
77
|
-
/** Every decline in a log, keyed by what the whole suggestion means and what each of its calls alone means (`meaningKey`): calls asked exactly alike always mean the same. */
|
|
78
|
-
export function declinesIn(ops, meanings) {
|
|
79
|
-
const undone = undoneIn(ops);
|
|
80
|
-
const byId = new Map(ops.map((op) => [op.id, op]));
|
|
81
|
-
const declines = new Map();
|
|
82
|
-
// The calls of a suggestion a person accepted one by one before declining the rest: those were said yes to (Roadmap f-job-approvals).
|
|
83
|
-
const took = new Map();
|
|
84
|
-
for (const op of ops)
|
|
85
|
-
if (op.lineage?.suggestion !== undefined && op.lineage.items)
|
|
86
|
-
took.set(op.lineage.suggestion, [...(took.get(op.lineage.suggestion) ?? []), ...op.lineage.items]);
|
|
87
|
-
for (const op of ops) {
|
|
88
|
-
const target = op.undoes !== undefined && !undone.has(op.id) && !op.withheld ? byId.get(op.undoes) : undefined;
|
|
89
|
-
// A suggestion its own maker took back was withdrawn, not declined: nobody said no to it (`withdrawSuggestion`).
|
|
90
|
-
if (target?.suggests && target.author.kind === op.author.kind && target.author.id === op.author.id)
|
|
91
|
-
continue;
|
|
92
|
-
const calls = target?.suggests ? target.suggests.filter((_, at) => !took.get(target.id)?.includes(at)) : target?.mutation && (target.lineage || op.undoneLineage) ? [target.mutation] : [];
|
|
93
|
-
if (calls.length > 0)
|
|
94
|
-
for (const asked of [calls, ...calls.map((call) => [call])])
|
|
95
|
-
declines.set(meaningKey(asked, meanings), op);
|
|
96
|
-
}
|
|
97
|
-
return declines;
|
|
98
|
-
}
|
|
23
|
+
export const DECLINES = (globalThis[Symbol.for("@graview/core:declines")] ??= {});
|
|
99
24
|
/**
|
|
100
25
|
* WHY THE APP'S OWN ACTOR MAY NOT MAKE THESE PRIMITIVES, in a sentence, or
|
|
101
26
|
* undefined when it may: a record a person said to leave alone, a kind the
|
package/dist/ops/tidying.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tidying.js","sourceRoot":"","sources":["../../src/ops/tidying.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"tidying.js","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,IAAI,KAAK,OAAO;gBAAE,OAAO,GAAG,CAAC,UAAU,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,oCAAoC,CAAC,CAAC;YAC3H,IAAI,IAAI,IAAI,IAAI,KAAK,UAAU;gBAAE,OAAO,GAAG,CAAC,kBAAkB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,kDAAkD,CAAC,CAAC;QAC9J,CAAC;QACD,IAAI,IAAI,IAAI,WAAW,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC;YAC/F,OAAO,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,OAAO,IAAI,CAAC,IAAI,mBAAmB,EAAE,4CAA4C,CAAC,CAAC;QACjJ,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** One thing in a view's source that pins a day, and the sentence that says so. */
|
|
2
|
+
export interface PinnedDate {
|
|
3
|
+
/** Where in the source: `source line 12`. */
|
|
4
|
+
readonly at: string;
|
|
5
|
+
/** The words as the source writes them: `TODAY = "2026-11-01"`, `Tomorrow · Mon 2 Nov`, `due Fri 30 Oct`. */
|
|
6
|
+
readonly phrase: string;
|
|
7
|
+
/** `today`, a date given to a name that means today; `day-words`, today's words beside a written date; `past`, a written date already gone by. */
|
|
8
|
+
readonly why: "today" | "day-words" | "past";
|
|
9
|
+
/** "Home may be out of date: it says “Tomorrow · Mon 2 Nov” and today is Wed, Nov 4. Read today from graview instead." */
|
|
10
|
+
readonly says: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DatesPinnedOptions {
|
|
13
|
+
/** The app's today, `YYYY-MM-DD` (`store.today() ?? isoToday()`). */
|
|
14
|
+
readonly today: string;
|
|
15
|
+
/** What the view is called in the sentence: its place's title ("Home"). "This view" when unsaid. */
|
|
16
|
+
readonly title?: string;
|
|
17
|
+
/** The locale today is said in. The app's when unsaid. */
|
|
18
|
+
readonly locale?: string;
|
|
19
|
+
/** How many days back a written date counts as pinning today: 31 by default, so a founding year or a launch long gone is not one. */
|
|
20
|
+
readonly pastDays?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* WHAT IN A VIEW'S SOURCE PINS A DAY, each said against the app's today:
|
|
24
|
+
* a date given to a name that means today, today's words beside a written
|
|
25
|
+
* date ("Tomorrow · Mon 2 Nov"), and a written date that has gone by in the
|
|
26
|
+
* last month ("due Fri 30 Oct"). Empty for a view that reads today from
|
|
27
|
+
* `graview`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function datesPinned(source: string, options: DatesPinnedOptions): readonly PinnedDate[];
|
|
30
|
+
//# sourceMappingURL=pinned-dates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pinned-dates.d.ts","sourceRoot":"","sources":["../../src/revisions/pinned-dates.ts"],"names":[],"mappings":"AAkBA,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,6GAA6G;IAC7G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kJAAkJ;IAClJ,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC;IAC7C,0HAA0H;IAC1H,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oGAAoG;IACpG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,qIAAqI;IACrI,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAqDD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,SAAS,UAAU,EAAE,CA+C9F"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A VIEW THAT PINS TODAY (Roadmap f-views-know-today).
|
|
3
|
+
*
|
|
4
|
+
* A chat added records to a Cloud app, every act succeeded, and the app's
|
|
5
|
+
* home went on saying the day before: its view held `TODAY = "2026-11-01"`,
|
|
6
|
+
* "Tomorrow · Mon 2 Nov" and "due Fri 30 Oct" as written text. Nothing
|
|
7
|
+
* told the agent its home was now wrong, so it said it was done. This
|
|
8
|
+
* reads a view's source for what pins a day — a date given to a name that
|
|
9
|
+
* means today, day words beside a written date, and a written date already
|
|
10
|
+
* past — and says each in a sentence against the app's today, so a check,
|
|
11
|
+
* an act's answer and a headless run can carry it.
|
|
12
|
+
*
|
|
13
|
+
* Read from the source's text alone: a date the view works out from
|
|
14
|
+
* `graview.today` is never written in it, so it is never said.
|
|
15
|
+
*/
|
|
16
|
+
import { weekdayAsRead } from "../days.js";
|
|
17
|
+
import { addDays } from "../wall-time.js";
|
|
18
|
+
const WEEKDAY = String.raw `(?:Mon(?:day)?|Tue(?:s(?:day)?)?|Wed(?:nesday)?|Thu(?:r(?:s(?:day)?)?)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?)\.?`;
|
|
19
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
20
|
+
const MONTH = String.raw `(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sept?(?:ember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\.?`;
|
|
21
|
+
const ORDINAL = String.raw `(?:st|nd|rd|th)?`;
|
|
22
|
+
/** A written date: `2026-11-01`, `Mon 2 Nov`, `2 November 2026`, `Fri, Oct 30`, `Nov 2, 2026`. */
|
|
23
|
+
const DATES = [
|
|
24
|
+
/\b(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})\b/g,
|
|
25
|
+
new RegExp(String.raw `\b(?:${WEEKDAY},?\s+)?(?<day>\d{1,2})${ORDINAL}\s+(?<name>${MONTH})(?![a-z])(?:,?\s+(?<year>\d{4})\b)?`, "g"),
|
|
26
|
+
new RegExp(String.raw `\b(?:${WEEKDAY},?\s+)?(?<name>${MONTH})\s+(?<day>\d{1,2})${ORDINAL}(?!\d)\b(?:,?\s+(?<year>\d{4})\b)?`, "g"),
|
|
27
|
+
];
|
|
28
|
+
/** A name that means today: `TODAY`, `today`, `now`, `currentDay`, `CURRENT_DATE`. */
|
|
29
|
+
const TODAY_NAME = /^(?:.*today.*|now|current_?(?:day|date))$/i;
|
|
30
|
+
/** A date given to a name: `const TODAY = "2026-11-01"`, `today: "2026-11-01"`, `now = new Date("2026-11-01")`. */
|
|
31
|
+
const ASSIGNED = /\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:new\s+Date\(\s*)?(["'`])(\d{4}-\d{2}-\d{2})[^"'`\n]*\2/g;
|
|
32
|
+
const DAY_WORD = String.raw `(?:today|tomorrow|yesterday|tonight)`;
|
|
33
|
+
const BETWEEN = String.raw `[\s·•|,:()\-–—]{1,5}`;
|
|
34
|
+
/** The day a written date names, its year the one nearest today where it says none. */
|
|
35
|
+
function dayOf(groups, today) {
|
|
36
|
+
const month = groups["month"] !== undefined ? Number(groups["month"]) : MONTHS.indexOf(groups["name"].slice(0, 3)) + 1;
|
|
37
|
+
const date = Number(groups["day"]);
|
|
38
|
+
if (!(month >= 1 && month <= 12 && date >= 1 && date <= 31))
|
|
39
|
+
return undefined;
|
|
40
|
+
const at = (year) => `${year}-${String(month).padStart(2, "0")}-${String(date).padStart(2, "0")}`;
|
|
41
|
+
if (groups["year"] !== undefined)
|
|
42
|
+
return at(Number(groups["year"]));
|
|
43
|
+
const year = Number(today.slice(0, 4));
|
|
44
|
+
const away = (day) => Math.abs(Date.parse(day) - Date.parse(today));
|
|
45
|
+
return [year - 1, year, year + 1].map(at).sort((a, b) => away(a) - away(b))[0];
|
|
46
|
+
}
|
|
47
|
+
function writtenDates(source, today) {
|
|
48
|
+
const out = [];
|
|
49
|
+
for (const pattern of DATES) {
|
|
50
|
+
for (const match of source.matchAll(pattern)) {
|
|
51
|
+
const from = match.index;
|
|
52
|
+
const to = from + match[0].length;
|
|
53
|
+
if (out.some((one) => from < one.to && to > one.from))
|
|
54
|
+
continue;
|
|
55
|
+
const day = dayOf(match.groups ?? {}, today);
|
|
56
|
+
if (day !== undefined && !Number.isNaN(Date.parse(day)))
|
|
57
|
+
out.push({ from, to, day });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return out.sort((a, b) => a.from - b.from);
|
|
61
|
+
}
|
|
62
|
+
const lineAt = (source, index) => `source line ${source.slice(0, index).split("\n").length}`;
|
|
63
|
+
/**
|
|
64
|
+
* WHAT IN A VIEW'S SOURCE PINS A DAY, each said against the app's today:
|
|
65
|
+
* a date given to a name that means today, today's words beside a written
|
|
66
|
+
* date ("Tomorrow · Mon 2 Nov"), and a written date that has gone by in the
|
|
67
|
+
* last month ("due Fri 30 Oct"). Empty for a view that reads today from
|
|
68
|
+
* `graview`.
|
|
69
|
+
*/
|
|
70
|
+
export function datesPinned(source, options) {
|
|
71
|
+
if (typeof source !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(options.today))
|
|
72
|
+
return [];
|
|
73
|
+
const { today } = options;
|
|
74
|
+
const title = options.title?.trim() || "This view";
|
|
75
|
+
const todaySaid = weekdayAsRead(today, { weekday: "short", year: false }, options.locale);
|
|
76
|
+
const say = (phrase) => `${title} may be out of date: it says “${phrase}” and today is ${todaySaid}. Read today from graview instead.`;
|
|
77
|
+
const out = [];
|
|
78
|
+
const taken = (from, to) => out.some((one) => from < one.to && to > one.from);
|
|
79
|
+
for (const match of source.matchAll(ASSIGNED)) {
|
|
80
|
+
if (!TODAY_NAME.test(match[1]))
|
|
81
|
+
continue;
|
|
82
|
+
const phrase = `${match[1]} = "${match[3]}"`;
|
|
83
|
+
out.push({ at: lineAt(source, match.index), phrase, why: "today", says: say(phrase), from: match.index, to: match.index + match[0].length });
|
|
84
|
+
}
|
|
85
|
+
const before = new RegExp(String.raw `\b${DAY_WORD}${BETWEEN}$`, "i");
|
|
86
|
+
const after = new RegExp(String.raw `^${BETWEEN}${DAY_WORD}\b`, "i");
|
|
87
|
+
const leading = /\b(?:due|by|until|on)\s+$/i;
|
|
88
|
+
const oldest = addDays(today, -(options.pastDays ?? 31));
|
|
89
|
+
for (const date of writtenDates(source, today)) {
|
|
90
|
+
if (taken(date.from, date.to))
|
|
91
|
+
continue;
|
|
92
|
+
/* A day handed to graview.fromToday is said against today, whatever today is. */
|
|
93
|
+
if (/fromToday\(\s*["'`]$/.test(source.slice(Math.max(0, date.from - 24), date.from)))
|
|
94
|
+
continue;
|
|
95
|
+
const ahead = source.slice(Math.max(0, date.from - 16), date.from);
|
|
96
|
+
const behind = source.slice(date.to, date.to + 16);
|
|
97
|
+
const word = before.exec(ahead);
|
|
98
|
+
const wordAfter = after.exec(behind);
|
|
99
|
+
if (word || wordAfter) {
|
|
100
|
+
const from = word ? date.from - word[0].length : date.from;
|
|
101
|
+
const to = wordAfter ? date.to + wordAfter[0].length : date.to;
|
|
102
|
+
const phrase = source.slice(from, to).replace(/\s+/g, " ").trim();
|
|
103
|
+
out.push({ at: lineAt(source, from), phrase, why: "day-words", says: say(phrase), from, to });
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (date.day < today && date.day >= oldest) {
|
|
107
|
+
const lead = leading.exec(ahead);
|
|
108
|
+
const from = lead ? date.from - lead[0].length : date.from;
|
|
109
|
+
const phrase = source.slice(from, date.to).replace(/\s+/g, " ").trim();
|
|
110
|
+
out.push({ at: lineAt(source, from), phrase, why: "past", says: say(phrase), from, to: date.to });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/* Each phrase once, in the order the source says them. */
|
|
114
|
+
const seen = new Set();
|
|
115
|
+
return out
|
|
116
|
+
.sort((a, b) => a.from - b.from)
|
|
117
|
+
.filter((one) => !seen.has(one.phrase) && seen.add(one.phrase))
|
|
118
|
+
.map(({ at, phrase, why, says }) => ({ at, phrase, why, says }));
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=pinned-dates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pinned-dates.js","sourceRoot":"","sources":["../../src/revisions/pinned-dates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAyB1C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA,mHAAmH,CAAC;AAC9I,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACpG,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA,8IAA8I,CAAC;AACvK,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA,kBAAkB,CAAC;AAC7C,kGAAkG;AAClG,MAAM,KAAK,GAAsB;IAC/B,mDAAmD;IACnD,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,QAAQ,OAAO,yBAAyB,OAAO,cAAc,KAAK,sCAAsC,EAAE,GAAG,CAAC;IACnI,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAA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{ GraviewApp } from "../app.js";
|
|
2
|
+
import type { Primitive } from "../graph/primitives.js";
|
|
3
|
+
import type { AnySchema } from "../schema/schema.js";
|
|
4
|
+
import { type PinnedDate } from "./pinned-dates.js";
|
|
5
|
+
/** A view the host keeps, as its manifest says it, and its source where the host has it. */
|
|
6
|
+
export interface TouchedView {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly title?: string;
|
|
9
|
+
/** The kind it is a picture of, or "home". */
|
|
10
|
+
readonly attach: string;
|
|
11
|
+
readonly cardinality?: "one" | "many";
|
|
12
|
+
readonly hidden?: boolean;
|
|
13
|
+
/** The other kinds it is handed (its manifest's `reads.kinds`). */
|
|
14
|
+
readonly reads?: {
|
|
15
|
+
readonly kinds?: readonly string[];
|
|
16
|
+
};
|
|
17
|
+
/** Its script, read for a day it pins. */
|
|
18
|
+
readonly source?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PlacesTouchedOptions {
|
|
21
|
+
/** A record's kind by its id, for an op that names a record without carrying it (a field changed, a link made): `(id) => store.graph.getNode(id)?.kind`. */
|
|
22
|
+
readonly kindOf?: (id: string) => string | undefined;
|
|
23
|
+
/** The views the host keeps. */
|
|
24
|
+
readonly views?: readonly TouchedView[];
|
|
25
|
+
/** The app's today (`store.today() ?? isoToday()`): with it, a view's source is read for a day it pins. */
|
|
26
|
+
readonly today?: string;
|
|
27
|
+
readonly locale?: string;
|
|
28
|
+
}
|
|
29
|
+
/** A place that draws a record a change touched. */
|
|
30
|
+
export interface TouchedPlace {
|
|
31
|
+
readonly slug: string;
|
|
32
|
+
readonly title: string;
|
|
33
|
+
readonly address: string;
|
|
34
|
+
/** The kinds of the touched records it draws. */
|
|
35
|
+
readonly kinds: readonly string[];
|
|
36
|
+
/** The host's view that draws it, by name, when a script view does: what to look at after the change. */
|
|
37
|
+
readonly view?: string;
|
|
38
|
+
/** What that view's source pins a day to, each in a sentence. */
|
|
39
|
+
readonly pinned?: readonly PinnedDate[];
|
|
40
|
+
}
|
|
41
|
+
export interface PlacesTouched {
|
|
42
|
+
/** The kinds of the records the ops touched. */
|
|
43
|
+
readonly kinds: readonly string[];
|
|
44
|
+
readonly places: readonly TouchedPlace[];
|
|
45
|
+
readonly said: readonly string[];
|
|
46
|
+
/** "These appear on Home and Tasks. Home is drawn by a view (front): look at it after this change." */
|
|
47
|
+
readonly text: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* THE PLACES THAT DRAW WHAT A COMMIT TOUCHED: given its ops (`Operation`s,
|
|
51
|
+
* or anything with their `primitives`), each place of the app — the home,
|
|
52
|
+
* a lens, a kind's list, a view the host keeps — that draws a record of a
|
|
53
|
+
* kind it made, changed, removed or linked, in the app's order, with the
|
|
54
|
+
* view that draws it and what that view pins a day to.
|
|
55
|
+
*/
|
|
56
|
+
export declare function placesTouched<S extends AnySchema>(app: GraviewApp<S>, ops: readonly {
|
|
57
|
+
readonly primitives: readonly Primitive[];
|
|
58
|
+
}[], options?: PlacesTouchedOptions): PlacesTouched;
|
|
59
|
+
//# sourceMappingURL=touched.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touched.d.ts","sourceRoot":"","sources":["../../src/revisions/touched.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEjE,4FAA4F;AAC5F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,GAAG,M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C;CACvB;AA2BD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS;IAAE,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;CAAE,EAAE,EAAE,OAAO,GAAE,oBAAyB,GAAG,aAAa,CA+BvL"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { placesOf } from "../app-places.js";
|
|
2
|
+
import { HOME_SLUG, OVERVIEW_SLUG } from "../places.js";
|
|
3
|
+
import { datesPinned } from "./pinned-dates.js";
|
|
4
|
+
const andList = (items) => (items.length <= 1 ? items.join("") : `${items.slice(0, -1).join(", ")} and ${items.at(-1)}`);
|
|
5
|
+
/** The kinds of the records a commit's primitives touch: a record made, changed or removed, and both ends of a link. */
|
|
6
|
+
function kindsTouched(ops, kindOf) {
|
|
7
|
+
const kinds = new Set();
|
|
8
|
+
const add = (kind) => kind !== undefined && kinds.add(kind);
|
|
9
|
+
for (const op of ops) {
|
|
10
|
+
for (const one of op.primitives ?? []) {
|
|
11
|
+
if (one.op === "add-node" || one.op === "remove-node")
|
|
12
|
+
add(one.node.kind);
|
|
13
|
+
else if (one.op === "patch-node" || one.op === "splice-text")
|
|
14
|
+
add(kindOf(one.id));
|
|
15
|
+
else if (one.op === "add-edge" || one.op === "remove-edge") {
|
|
16
|
+
add(kindOf(one.edge.from));
|
|
17
|
+
add(kindOf(one.edge.to));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return [...kinds];
|
|
22
|
+
}
|
|
23
|
+
/** The kinds a declared home's blocks list (`all('task')`), read from their text. */
|
|
24
|
+
function kindsOfDeclaredHome(home, kinds) {
|
|
25
|
+
const text = JSON.stringify(home ?? null);
|
|
26
|
+
return kinds.filter((kind) => new RegExp(`['"]${kind.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\\\?['"]`).test(text));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* THE PLACES THAT DRAW WHAT A COMMIT TOUCHED: given its ops (`Operation`s,
|
|
30
|
+
* or anything with their `primitives`), each place of the app — the home,
|
|
31
|
+
* a lens, a kind's list, a view the host keeps — that draws a record of a
|
|
32
|
+
* kind it made, changed, removed or linked, in the app's order, with the
|
|
33
|
+
* view that draws it and what that view pins a day to.
|
|
34
|
+
*/
|
|
35
|
+
export function placesTouched(app, ops, options = {}) {
|
|
36
|
+
const kinds = kindsTouched(ops, options.kindOf ?? (() => undefined));
|
|
37
|
+
const views = options.views ?? [];
|
|
38
|
+
const declared = app.schema.kinds;
|
|
39
|
+
const pinnedBy = (view, title) => view?.source !== undefined && options.today !== undefined ? datesPinned(view.source, { today: options.today, title, ...(options.locale ? { locale: options.locale } : {}) }) : [];
|
|
40
|
+
const places = [];
|
|
41
|
+
for (const place of placesOf(app, { views })) {
|
|
42
|
+
if (place.slug === OVERVIEW_SLUG)
|
|
43
|
+
continue;
|
|
44
|
+
let drawn;
|
|
45
|
+
let view;
|
|
46
|
+
if (place.slug === HOME_SLUG) {
|
|
47
|
+
view = views.find((one) => one.attach === "home");
|
|
48
|
+
drawn = view ? (view.reads?.kinds ?? []) : (app.home?.length ?? 0) > 0 ? kindsOfDeclaredHome(app.home, declared) : declared.filter((kind) => !(app.pages?.hide ?? []).includes(kind));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
view = place.view !== undefined ? views.find((one) => one.name === place.view) : undefined;
|
|
52
|
+
drawn = [...(place.over ?? (place.kind ? [place.kind] : [])), ...(view?.reads?.kinds ?? [])];
|
|
53
|
+
}
|
|
54
|
+
const touched = kinds.filter((kind) => drawn.includes(kind));
|
|
55
|
+
if (touched.length === 0)
|
|
56
|
+
continue;
|
|
57
|
+
const pinned = pinnedBy(view, place.title);
|
|
58
|
+
places.push({ slug: place.slug, title: place.title, address: place.address, kinds: touched, ...(view ? { view: view.name } : {}), ...(pinned.length > 0 ? { pinned } : {}) });
|
|
59
|
+
}
|
|
60
|
+
const said = [];
|
|
61
|
+
if (places.length > 0)
|
|
62
|
+
said.push(`These appear on ${andList(places.map((place) => place.title))}.`);
|
|
63
|
+
for (const place of places) {
|
|
64
|
+
if (!place.view)
|
|
65
|
+
continue;
|
|
66
|
+
said.push(place.pinned ? `${place.title} is drawn by a view (${place.view}) that writes its own dates: look at it after this change.` : `${place.title} is drawn by a view (${place.view}): look at it after this change.`);
|
|
67
|
+
for (const one of place.pinned ?? [])
|
|
68
|
+
said.push(one.says);
|
|
69
|
+
}
|
|
70
|
+
return { kinds, places, said, text: said.length > 0 ? said.join(" ") : "Nothing this change touched is drawn on a place of this app." };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=touched.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touched.js","sourceRoot":"","sources":["../../src/revisions/touched.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AAgDjE,MAAM,OAAO,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAE5I,wHAAwH;AACxH,SAAS,YAAY,CAAC,GAA6D,EAAE,MAA0C;IAC7H,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,MAAM,GAAG,GAAG,CAAC,IAAwB,EAAE,EAAE,CAAC,I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IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAChL,CAAC;IACD,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;IACpG,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,SAAS;QAC1B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,wBAAwB,KAAK,CAAC,IAAI,4DAA4D,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,wBAAwB,KAAK,CAAC,IAAI,kCAAkC,CAAC,CAAC;QAC5N,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,8DAA8D,EAAE,CAAC;AAC1I,CAAC"}
|
package/dist/revisions.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export { MEASURE_PICTURED_PAGE, picturedCoverage } from "./revisions/pictured.js
|
|
|
6
6
|
export type { PageMeasure, PictureCoverage, PlacedSection } from "./revisions/pictured.js";
|
|
7
7
|
export { problemsMade, viewProblemKey } from "./revisions/problems.js";
|
|
8
8
|
export type { ChangedProblem, ProblemSet, ProblemsMade, ViewProblem } from "./revisions/problems.js";
|
|
9
|
+
export { datesPinned } from "./revisions/pinned-dates.js";
|
|
10
|
+
export type { DatesPinnedOptions, PinnedDate } from "./revisions/pinned-dates.js";
|
|
11
|
+
export { placesTouched } from "./revisions/touched.js";
|
|
12
|
+
export type { PlacesTouched, PlacesTouchedOptions, TouchedPlace, TouchedView } from "./revisions/touched.js";
|
|
9
13
|
export { beyondAsked } from "./revisions/beyond.js";
|
|
10
14
|
export type { ActReach, BeyondAskedOptions, BeyondChange } from "./revisions/beyond.js";
|
|
11
15
|
//# sourceMappingURL=revisions.d.ts.map
|
package/dist/revisions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revisions.d.ts","sourceRoot":"","sources":["../src/revisions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"revisions.d.ts","sourceRoot":"","sources":["../src/revisions.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACnH,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAClF,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/revisions.js
CHANGED
|
@@ -9,12 +9,16 @@
|
|
|
9
9
|
* page a picture held and the sections it left out (`MEASURE_PICTURED_PAGE`,
|
|
10
10
|
* `picturedCoverage`); the rules that held and fail, and the view problems
|
|
11
11
|
* new, with the act that repairs each (`problemsMade`); and the records and
|
|
12
|
-
* links an act changed beyond what it was asked (`beyondAsked`)
|
|
12
|
+
* links an act changed beyond what it was asked (`beyondAsked`); what a
|
|
13
|
+
* view's source pins a day to (`datesPinned`), and the places that draw
|
|
14
|
+
* what a commit touched, with the views to look at (`placesTouched`). Each is
|
|
13
15
|
* pure, judges nothing on its own, and is a host's: no page imports it.
|
|
14
16
|
*/
|
|
15
17
|
export { compareViewRevision, namesInSelector, selectorsOfStylesheet, stringsOfSource } from "./revisions/view.js";
|
|
16
18
|
export { sectionsOfDrawing } from "./revisions/sections.js";
|
|
17
19
|
export { MEASURE_PICTURED_PAGE, picturedCoverage } from "./revisions/pictured.js";
|
|
18
20
|
export { problemsMade, viewProblemKey } from "./revisions/problems.js";
|
|
21
|
+
export { datesPinned } from "./revisions/pinned-dates.js";
|
|
22
|
+
export { placesTouched } from "./revisions/touched.js";
|
|
19
23
|
export { beyondAsked } from "./revisions/beyond.js";
|
|
20
24
|
//# sourceMappingURL=revisions.js.map
|
package/dist/revisions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revisions.js","sourceRoot":"","sources":["../src/revisions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"revisions.js","sourceRoot":"","sources":["../src/revisions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEnH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAElF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/scaffold/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAA0D,MAAM,YAAY,CAAC;AAO9F,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAgB1C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAyC1C;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAyBzC;AAID,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAyBzC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAqHzC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/scaffold/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAA0D,MAAM,YAAY,CAAC;AAO9F,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAgB1C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAyC1C;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAyBzC;AAID,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAyBzC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAqHzC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CA6NzC;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAsGxC"}
|