@graview/core 0.2.15 → 0.2.17
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/README.md +8 -2
- package/dist/cli/document-schema.js +1 -1
- package/dist/cli/document-schema.js.map +1 -1
- package/dist/document/connection-findings.d.ts.map +1 -1
- package/dist/document/connection-findings.js +103 -10
- package/dist/document/connection-findings.js.map +1 -1
- package/dist/document/connection-spec.d.ts +43 -3
- package/dist/document/connection-spec.d.ts.map +1 -1
- package/dist/document/connection-spec.js +51 -4
- package/dist/document/connection-spec.js.map +1 -1
- package/dist/document/describe-place.d.ts.map +1 -1
- package/dist/document/describe-place.js +2 -0
- package/dist/document/describe-place.js.map +1 -1
- package/dist/document/described.d.ts +6 -0
- package/dist/document/described.d.ts.map +1 -1
- package/dist/document/edit.js +1 -1
- package/dist/document/edit.js.map +1 -1
- package/dist/document/kept-in-step-with.d.ts +4 -4
- package/dist/document/kept-in-step-with.d.ts.map +1 -1
- package/dist/document/kept-in-step-with.js +5 -1
- package/dist/document/kept-in-step-with.js.map +1 -1
- package/dist/document/kept-in-step.js +1 -1
- package/dist/document/kept-in-step.js.map +1 -1
- package/dist/document.schema.json +154 -3
- package/dist/scaffold/domain.js +1 -1
- package/dist/scaffold/from-template.js +3 -3
- package/dist/scaffold/from-template.js.map +1 -1
- package/dist/scaffold/index.d.ts.map +1 -1
- package/dist/scaffold/index.js +2 -3
- package/dist/scaffold/index.js.map +1 -1
- package/dist/scaffold/names.d.ts +0 -1
- package/dist/scaffold/names.d.ts.map +1 -1
- package/dist/scaffold/names.js.map +1 -1
- package/dist/scaffold/project.d.ts.map +1 -1
- package/dist/scaffold/project.js +18 -13
- package/dist/scaffold/project.js.map +1 -1
- package/dist/scaffold/ui.d.ts +1 -1
- package/dist/scaffold/ui.d.ts.map +1 -1
- package/dist/scaffold/ui.js +115 -164
- package/dist/scaffold/ui.js.map +1 -1
- package/dist/sync/connection.d.ts +22 -5
- package/dist/sync/connection.d.ts.map +1 -1
- package/dist/sync/connection.js +274 -6
- package/dist/sync/connection.js.map +1 -1
- package/dist/sync/engine.d.ts +38 -1
- package/dist/sync/engine.d.ts.map +1 -1
- package/dist/sync/engine.js +184 -12
- package/dist/sync/engine.js.map +1 -1
- package/dist/sync/google-calendar.d.ts.map +1 -1
- package/dist/sync/google-calendar.js +27 -4
- package/dist/sync/google-calendar.js.map +1 -1
- package/dist/sync/guests.d.ts +7 -2
- package/dist/sync/guests.d.ts.map +1 -1
- package/dist/sync/guests.js +33 -15
- package/dist/sync/guests.js.map +1 -1
- package/dist/sync/index.d.ts +10 -3
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +6 -2
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/notion.d.ts.map +1 -1
- package/dist/sync/notion.js +18 -10
- package/dist/sync/notion.js.map +1 -1
- package/dist/sync/todoist-due.d.ts +35 -0
- package/dist/sync/todoist-due.d.ts.map +1 -0
- package/dist/sync/todoist-due.js +132 -0
- package/dist/sync/todoist-due.js.map +1 -0
- package/dist/sync/todoist-stub.d.ts +85 -0
- package/dist/sync/todoist-stub.d.ts.map +1 -0
- package/dist/sync/todoist-stub.js +316 -0
- package/dist/sync/todoist-stub.js.map +1 -0
- package/dist/sync/todoist-types.d.ts +27 -0
- package/dist/sync/todoist-types.d.ts.map +1 -0
- package/dist/sync/todoist-types.js +46 -0
- package/dist/sync/todoist-types.js.map +1 -0
- package/dist/sync/todoist.d.ts +112 -0
- package/dist/sync/todoist.d.ts.map +1 -0
- package/dist/sync/todoist.js +892 -0
- package/dist/sync/todoist.js.map +1 -0
- package/dist/sync/types.d.ts +53 -2
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/scaffold/ui.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { escapeComment, escapeHtml, escapeJsxText, escapeString } from "./names.js";
|
|
2
2
|
/*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* WHAT A NEW PROJECT DRAWS: the page, the embed, the views the app's city
|
|
4
|
+
* and its pages draw with, the pages in your own words, the seat and the
|
|
5
|
+
* studio on its bar, and the entry that opens the store and mounts the one
|
|
6
|
+
* face.
|
|
5
7
|
*/
|
|
6
8
|
export function indexHtml(ids) {
|
|
7
9
|
return `<!doctype html>
|
|
@@ -9,7 +11,7 @@ export function indexHtml(ids) {
|
|
|
9
11
|
<meta charset="utf-8" />
|
|
10
12
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
11
13
|
<title>${escapeHtml(ids.name)}</title>
|
|
12
|
-
<!-- No icon of its own until the
|
|
14
|
+
<!-- No icon of its own until the face draws the brand's mark: Chrome asks for /favicon.ico before any script runs, and a 404 there is an error on the console. -->
|
|
13
15
|
<link rel="icon" href="data:," />
|
|
14
16
|
<style>
|
|
15
17
|
/* The theme is injected by src/main.tsx from the declared brand; this is
|
|
@@ -76,10 +78,11 @@ import { views } from "./ui/views.js";
|
|
|
76
78
|
/**
|
|
77
79
|
* ${escapeComment(ids.name).toUpperCase()} ON SOMEBODY ELSE'S PAGE.
|
|
78
80
|
*
|
|
79
|
-
* The embed brings its own
|
|
80
|
-
* given, and
|
|
81
|
-
*
|
|
82
|
-
*
|
|
81
|
+
* The embed brings its own bar, its own theme scoped to the element it is
|
|
82
|
+
* given, and the one face — each page over the app's own city, Page ·
|
|
83
|
+
* Nearby · Map — held to that element: nothing on the host page touched.
|
|
84
|
+
* Pass \`seats\` once a policy exists and the reader can sit in each one:
|
|
85
|
+
* the bar, the pages and the acts all narrow together.
|
|
83
86
|
*/
|
|
84
87
|
const store = createStore();
|
|
85
88
|
|
|
@@ -89,7 +92,6 @@ mount(document.getElementById("here")!, {
|
|
|
89
92
|
// The app's own registry, in the app's own schema — no casts.
|
|
90
93
|
views,
|
|
91
94
|
scheme: "auto",
|
|
92
|
-
stop: "#overview=1",
|
|
93
95
|
label: "${escapeString(ids.name)}",
|
|
94
96
|
});
|
|
95
97
|
`;
|
|
@@ -121,124 +123,6 @@ export function views() {
|
|
|
121
123
|
}
|
|
122
124
|
`;
|
|
123
125
|
}
|
|
124
|
-
export function uiAppTsx(ids) {
|
|
125
|
-
return `import type { HostFiles } from "@graview/core";
|
|
126
|
-
import { EMPTY_VIEW, type ViewState } from "@graview/layout";
|
|
127
|
-
import { GraviewProvider, useGraph, useGraview, type Scheme } from "@graview/react";
|
|
128
|
-
import { AgentSeat, Shell } from "@graview/primitives";
|
|
129
|
-
import { StudioPlace } from "@graview/studio";
|
|
130
|
-
import { templateIntelligence, type ToolCall } from "@graview/tools";
|
|
131
|
-
import { useMemo, useState } from "react";
|
|
132
|
-
import { ${ids.appVar}, createStore, type ${ids.StoreType} } from "../domain/app.js";
|
|
133
|
-
import { ${ids.brandVar} } from "../domain/brand.js";
|
|
134
|
-
import type { ${ids.SchemaType} } from "../domain/schema.js";
|
|
135
|
-
import { views } from "./views.js";
|
|
136
|
-
|
|
137
|
-
type S = ${ids.SchemaType};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* The app opens from ALTITUDE: every kind a district, each saying how many
|
|
141
|
-
* it holds — or "none yet", which is an invitation rather than a void.
|
|
142
|
-
*/
|
|
143
|
-
export const INITIAL_VIEW: ViewState = { ...EMPTY_VIEW, overview: true };
|
|
144
|
-
|
|
145
|
-
export interface ${ids.AppComponent}Props {
|
|
146
|
-
readonly store?: ${ids.StoreType};
|
|
147
|
-
readonly initialView?: ViewState;
|
|
148
|
-
readonly syncUrl?: boolean;
|
|
149
|
-
readonly initialScheme?: Scheme;
|
|
150
|
-
readonly onSchemeChange?: (scheme: Scheme) => void;
|
|
151
|
-
/** Whether the store behind this app is remembered in the browser (see main.tsx). */
|
|
152
|
-
readonly remembers?: boolean;
|
|
153
|
-
/** Where a picture or a file put on a record goes (see main.tsx). */
|
|
154
|
-
readonly files?: HostFiles;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The whole application. \`Shell\` is the command bar, the scene, the
|
|
159
|
-
* inspector and the rail, derived; what ${escapeComment(ids.name)} adds is a
|
|
160
|
-
* sentence for when nothing is wrong and a seat for an agent. If this file
|
|
161
|
-
* grows, ask whether the declaration should have grown instead.
|
|
162
|
-
*/
|
|
163
|
-
export function ${ids.AppComponent}({
|
|
164
|
-
store,
|
|
165
|
-
initialView = INITIAL_VIEW,
|
|
166
|
-
syncUrl = false,
|
|
167
|
-
initialScheme = "light",
|
|
168
|
-
onSchemeChange,
|
|
169
|
-
remembers = false,
|
|
170
|
-
files,
|
|
171
|
-
}: ${ids.AppComponent}Props) {
|
|
172
|
-
const created = useMemo(() => store ?? createStore(), [store]);
|
|
173
|
-
const registry = useMemo(() => views(), []);
|
|
174
|
-
const [scheme, setScheme] = useState<Scheme>(initialScheme);
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
<GraviewProvider
|
|
178
|
-
store={created}
|
|
179
|
-
views={registry}
|
|
180
|
-
initialView={initialView}
|
|
181
|
-
scheme={scheme}
|
|
182
|
-
brand={${ids.brandVar}}
|
|
183
|
-
settings={${ids.appVar}.settings ?? []}
|
|
184
|
-
app={${ids.appVar}}
|
|
185
|
-
>
|
|
186
|
-
<Shell<S>
|
|
187
|
-
standing="Everything is in order"
|
|
188
|
-
/*
|
|
189
|
-
* THE APP'S OWN DECLARATION, one press away and in place. The
|
|
190
|
-
* kinds, fields, edges, acts and rules of \`src/domain\` are a graph
|
|
191
|
-
* here: change one with the ordinary acts, watch the checker judge
|
|
192
|
-
* it, and apply to get the files to write back. Offered to the seat
|
|
193
|
-
* that administers where there is one, and to whoever is here where
|
|
194
|
-
* there is not — which is this project, today.
|
|
195
|
-
*/
|
|
196
|
-
studio={<StudioPlace app={${ids.appVar}} />}
|
|
197
|
-
seat={(onCall) => <Starter onCall={onCall} />}
|
|
198
|
-
remembers={remembers}
|
|
199
|
-
files={files}
|
|
200
|
-
syncUrl={syncUrl}
|
|
201
|
-
scheme={scheme}
|
|
202
|
-
onScheme={(next) => {
|
|
203
|
-
setScheme(next);
|
|
204
|
-
onSchemeChange?.(next);
|
|
205
|
-
}}
|
|
206
|
-
/>
|
|
207
|
-
</GraviewProvider>
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* The seat at zero. An empty graph plus a seat that proposes starter data is
|
|
213
|
-
* the "describe your domain, get a working app" moment. Every proposal is an
|
|
214
|
-
* ordinary mutation through the derived tool surface — logged, attributed to
|
|
215
|
-
* the seat, reviewable, undoable.
|
|
216
|
-
*/
|
|
217
|
-
function Starter({ onCall }: { onCall: (call: ToolCall) => void }) {
|
|
218
|
-
const { store } = useGraview<S>();
|
|
219
|
-
const nodes = useGraph();
|
|
220
|
-
const empty = nodes.length === 0;
|
|
221
|
-
return (
|
|
222
|
-
<AgentSeat<S>
|
|
223
|
-
who="starter"
|
|
224
|
-
testId="agent-starter"
|
|
225
|
-
count={empty ? 1 : 0}
|
|
226
|
-
gate="${ids.gate}"
|
|
227
|
-
label={() => "Add some starter data"}
|
|
228
|
-
busyLabel="Adding…"
|
|
229
|
-
idle="There is something here already"
|
|
230
|
-
onCall={onCall}
|
|
231
|
-
run={async (agent) => {
|
|
232
|
-
const starter = templateIntelligence<S>();
|
|
233
|
-
for (const proposal of await starter.propose(store)) {
|
|
234
|
-
await agent.run(proposal.mutation, { ...proposal.args });
|
|
235
|
-
}
|
|
236
|
-
}}
|
|
237
|
-
/>
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
`;
|
|
241
|
-
}
|
|
242
126
|
export function pagesTsx(ids) {
|
|
243
127
|
return `import { isCurrent, nounOf, withArticle } from "@graview/core";
|
|
244
128
|
import { Begin, EditableValue } from "@graview/primitives";
|
|
@@ -255,7 +139,6 @@ import {
|
|
|
255
139
|
recordFacts,
|
|
256
140
|
relationFacts,
|
|
257
141
|
Repairs,
|
|
258
|
-
spatialHref,
|
|
259
142
|
titleFieldOf,
|
|
260
143
|
useStoreTick,
|
|
261
144
|
type PageComponent,
|
|
@@ -267,8 +150,9 @@ import { ${ids.schemaVar}, type ${ids.SchemaType} } from "../domain/schema.js";
|
|
|
267
150
|
type S = ${ids.SchemaType};
|
|
268
151
|
|
|
269
152
|
/**
|
|
270
|
-
*
|
|
271
|
-
* application derived from the declaration
|
|
153
|
+
* YOUR PAGES, IN YOUR OWN WORDS. The app is an ordinary routed web
|
|
154
|
+
* application derived from the declaration, standing over its own city
|
|
155
|
+
* (the control at the window's foot): a list and a record per kind,
|
|
272
156
|
* forms from the mutations, a problems page from the rules. Every one of
|
|
273
157
|
* those can be replaced per kind — or per surface: shell, home, problems —
|
|
274
158
|
* with a page you write. This is the ${ids.spoken}'s record page; delete it
|
|
@@ -354,9 +238,7 @@ function ${ids.KindPascal}Page({ context }: { context: PageContext<S> }) {
|
|
|
354
238
|
{isCurrent(store.schema.tryDefinition(node.kind), node) ? null : "In the past: out of the picture, never out of the record. "}
|
|
355
239
|
{ties.length === 0 ? "Connected to nothing yet." : null}
|
|
356
240
|
</p>
|
|
357
|
-
|
|
358
|
-
See it in the scene ↗
|
|
359
|
-
</a>
|
|
241
|
+
{/* Where it stands in the app's city is the control at the window's foot: Nearby draws a line from this page to it. */}
|
|
360
242
|
</header>
|
|
361
243
|
{facts.violations.length > 0 ? (
|
|
362
244
|
<section style={{ ...pageStyles.rule, display: "grid", gap: 10 }} data-testid="record-violations">
|
|
@@ -392,7 +274,7 @@ function ${ids.KindPascal}Page({ context }: { context: PageContext<S> }) {
|
|
|
392
274
|
* own sentence. Dropping it teaches a person the software is broken —
|
|
393
275
|
* they watched a colleague do this yesterday and now the control is
|
|
394
276
|
* gone — so it is drawn struck through with the reason beside it, the
|
|
395
|
-
* way the derived pages
|
|
277
|
+
* way the derived pages draw it.
|
|
396
278
|
*/}
|
|
397
279
|
{facts.actions.withheld.length > 0 ? (
|
|
398
280
|
<section style={{ ...pageStyles.rule, display: "grid", gap: 8 }} data-testid="record-withheld">
|
|
@@ -461,6 +343,76 @@ export function pages() {
|
|
|
461
343
|
}
|
|
462
344
|
`;
|
|
463
345
|
}
|
|
346
|
+
export function seatTsx(ids) {
|
|
347
|
+
return `import { AgentSeat } from "@graview/primitives";
|
|
348
|
+
import { useGraph, useGraview } from "@graview/react";
|
|
349
|
+
import { templateIntelligence, type ToolCall } from "@graview/tools";
|
|
350
|
+
import { lazy, Suspense } from "react";
|
|
351
|
+
import { ${ids.appVar} } from "../domain/app.js";
|
|
352
|
+
import type { ${ids.SchemaType} } from "../domain/schema.js";
|
|
353
|
+
|
|
354
|
+
type S = ${ids.SchemaType};
|
|
355
|
+
|
|
356
|
+
/*
|
|
357
|
+
* THE SEAT AND THE STUDIO, ON THE APP'S BAR. The bell's Activity holds the
|
|
358
|
+
* seat under "The agent's seat", with every call it makes; the person's
|
|
359
|
+
* menu holds the studio under "Keeping this app". \`src/main.tsx\` hands
|
|
360
|
+
* both to the face.
|
|
361
|
+
*/
|
|
362
|
+
|
|
363
|
+
/** The agent's seat, handed the call recorder Activity shows its calls with. */
|
|
364
|
+
export function seat(onCall: (call: ToolCall) => void) {
|
|
365
|
+
return <Starter onCall={onCall} />;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* The seat at zero. An empty graph plus a seat that proposes starter data is
|
|
370
|
+
* the "describe your domain, get a working app" moment. Every proposal is an
|
|
371
|
+
* ordinary mutation through the derived tool surface — logged, attributed to
|
|
372
|
+
* the seat, reviewable, undoable.
|
|
373
|
+
*/
|
|
374
|
+
function Starter({ onCall }: { onCall: (call: ToolCall) => void }) {
|
|
375
|
+
const { store } = useGraview<S>();
|
|
376
|
+
const nodes = useGraph();
|
|
377
|
+
const empty = nodes.length === 0;
|
|
378
|
+
return (
|
|
379
|
+
<AgentSeat<S>
|
|
380
|
+
who="starter"
|
|
381
|
+
testId="agent-starter"
|
|
382
|
+
count={empty ? 1 : 0}
|
|
383
|
+
gate="${ids.gate}"
|
|
384
|
+
label={() => "Add some starter data"}
|
|
385
|
+
busyLabel="Adding…"
|
|
386
|
+
idle="There is something here already"
|
|
387
|
+
onCall={onCall}
|
|
388
|
+
run={async (agent) => {
|
|
389
|
+
const starter = templateIntelligence<S>();
|
|
390
|
+
for (const proposal of await starter.propose(store)) {
|
|
391
|
+
await agent.run(proposal.mutation, { ...proposal.args });
|
|
392
|
+
}
|
|
393
|
+
}}
|
|
394
|
+
/>
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/*
|
|
399
|
+
* THE APP'S OWN DECLARATION, one press away and in place. The kinds,
|
|
400
|
+
* fields, edges, acts and rules of \`src/domain\` are a graph here: change
|
|
401
|
+
* one with the ordinary acts, watch the checker judge it, and Apply writes
|
|
402
|
+
* the files back into \`src/domain\` through the dev server's door
|
|
403
|
+
* (\`studioDoor\` in vite.config.ts). Offered to the seat that administers
|
|
404
|
+
* where there is one, and to whoever is here where there is not — which is
|
|
405
|
+
* this project, today. In a chunk of its own, never the page's first load.
|
|
406
|
+
*/
|
|
407
|
+
const StudioPlace = lazy(() => import("@graview/studio").then((studio) => ({ default: studio.StudioPlace })));
|
|
408
|
+
|
|
409
|
+
export const studio = (
|
|
410
|
+
<Suspense fallback={null}>
|
|
411
|
+
<StudioPlace app={${ids.appVar}} />
|
|
412
|
+
</Suspense>
|
|
413
|
+
);
|
|
414
|
+
`;
|
|
415
|
+
}
|
|
464
416
|
export function mainTsx(ids) {
|
|
465
417
|
return `import { PagesApp } from "@graview/pages";
|
|
466
418
|
import { themeCss, type Scheme } from "@graview/primitives";
|
|
@@ -468,8 +420,8 @@ import { browserStartsFresh, createBrowserAdapter, filesAt, forgetFreshParam, op
|
|
|
468
420
|
import { createRoot } from "react-dom/client";
|
|
469
421
|
import { ${ids.appVar} } from "./domain/app.js";
|
|
470
422
|
import { ${ids.brandVar} } from "./domain/brand.js";
|
|
471
|
-
import { ${ids.AppComponent} } from "./ui/app.js";
|
|
472
423
|
import { pages } from "./ui/pages.js";
|
|
424
|
+
import { seat, studio } from "./ui/seat.js";
|
|
473
425
|
import { views } from "./ui/views.js";
|
|
474
426
|
|
|
475
427
|
const sheet = new CSSStyleSheet();
|
|
@@ -529,36 +481,35 @@ forgetFreshParam();
|
|
|
529
481
|
*/
|
|
530
482
|
const devHostFiles = (import.meta as { env?: { DEV?: boolean } }).env?.DEV ? filesAt("/__graview/files", { maxBytes: 10_000_000, kinds: ["image/*", "video/*", "application/pdf", "text/plain"] }) : undefined;
|
|
531
483
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
484
|
+
/*
|
|
485
|
+
* ONE FACE. The app's pages are ordinary addresses — a list and a record
|
|
486
|
+
* per kind, the places you title, the problems — and they stand over the
|
|
487
|
+
* app's own city: the control at the bottom left (Page · Nearby · Map, or
|
|
488
|
+
* Alt+↑ and Alt+↓, or a pinch) moves the page you are on out into a panel
|
|
489
|
+
* beside the records it shows, then to the whole map of the app. Handed
|
|
490
|
+
* \`views\`, the registry the city draws with, the pages land on a gallery
|
|
491
|
+
* of them — every kind as a card until you title a lens, then the lens by
|
|
492
|
+
* its name. The bar's bell holds the agent's seat in its Activity, and the
|
|
493
|
+
* person's menu the studio (see ui/seat.tsx). \`sceneUnderPages: false\`
|
|
494
|
+
* would keep the pages alone, without the city.
|
|
495
|
+
*/
|
|
496
|
+
createRoot(root).render(
|
|
497
|
+
<PagesApp
|
|
498
|
+
context={{
|
|
499
|
+
store: opened.store,
|
|
500
|
+
brand: ${ids.brandVar},
|
|
501
|
+
remembers: true,
|
|
502
|
+
views: views(),
|
|
503
|
+
settings: ${ids.appVar}.settings ?? [],
|
|
504
|
+
app: ${ids.appVar},
|
|
505
|
+
files: devHostFiles,
|
|
506
|
+
seat,
|
|
507
|
+
studio,
|
|
508
|
+
}}
|
|
509
|
+
// Your own pages over the derived ones: see ui/pages.tsx.
|
|
510
|
+
registry={pages()}
|
|
511
|
+
/>,
|
|
512
|
+
);
|
|
562
513
|
|
|
563
514
|
// A flag a harness can wait for, rather than a timer and a hope.
|
|
564
515
|
(window as unknown as Record<string, unknown>)["__graviewReady"] = { scheme };
|
package/dist/scaffold/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/scaffold/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9F
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/scaffold/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9F;;;;;GAKG;AAEH,MAAM,UAAU,SAAS,CAAC,GAAQ;IAChC,OAAO;;;;SAIA,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;;;;;;;;;;CAU5B,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,GAAQ;IAChC,OAAO;;;;SAIA,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;;;iDAGoB,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;eACrE,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;MAsB5C,UAAU,CAAC,GAAG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BAAgB,GAAG,CAAC,UAAU;;;CAGtD,CAAC;AACF,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAQ;IAC9B,OAAO;;;;WAIE,GAAG,CAAC,MAAM;gBACL,GAAG,CAAC,UAAU;;WAEnB,GAAG,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6BX,GAAG,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4BE,GAAG,CAAC,MAAM;;;CAGjC,CAAC;AACF,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAQ;IAC9B,OAAO;;;;WAIE,GAAG,CAAC,MAAM;WACV,GAAG,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;uCAuBgB,GAAG,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;SAwB1C,GAAG,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA+BJ,GAAG,CAAC,QAAQ;;;kBAGT,GAAG,CAAC,MAAM;aACf,GAAG,CAAC,MAAM;;;;;;;;;;;;CAYtB,CAAC;AACF,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { GraviewApp } from "../app.js";
|
|
2
2
|
import type { AnySchema } from "../schema/schema.js";
|
|
3
3
|
import type { Store } from "../store.js";
|
|
4
|
-
import { type ConnectionSpec, type NotionConnectionSpec, type NotionSourceSpec } from "../document/connection-spec.js";
|
|
4
|
+
import { type ConnectionSpec, type NotionConnectionSpec, type NotionSourceSpec, type TodoistConnectionSpec } from "../document/connection-spec.js";
|
|
5
5
|
import { SyncEngine, type SharedLinks } from "./engine.js";
|
|
6
6
|
import { type Fetcher, type GoogleTokenRequest } from "./google-calendar.js";
|
|
7
7
|
import { type GuestGraph } from "./guests.js";
|
|
8
8
|
import { type NotionMade } from "./notion.js";
|
|
9
|
+
import { type TodoistRefs } from "./todoist.js";
|
|
9
10
|
import type { RemoteSystem, ResourceMapping, SyncMapping, SyncState } from "./types.js";
|
|
10
11
|
/**
|
|
11
12
|
* A DECLARED CONNECTION, RUN.
|
|
@@ -57,13 +58,21 @@ import type { RemoteSystem, ResourceMapping, SyncMapping, SyncState } from "./ty
|
|
|
57
58
|
* names it, or, matched by name, as the field reads ("Due date"). The
|
|
58
59
|
* name field is the title Notion always has. None is made for a
|
|
59
60
|
* connection that only reads, or that says `create: false`.
|
|
61
|
+
* - A TODOIST PROJECT's tasks (or one section's, or one label's) are the
|
|
62
|
+
* kind's records, each part the field the declaration maps. What Todoist
|
|
63
|
+
* always has is compared as it has it: a record that says no priority is
|
|
64
|
+
* at p4, one that does not say it is completed is not. A due date that
|
|
65
|
+
* repeats is the repeat beside its date, where `todoist-due.ts` can read
|
|
66
|
+
* Todoist's words for it and say them back; a repeat it cannot is left
|
|
67
|
+
* there, and one here that Todoist's words cannot say is held unsent. A
|
|
68
|
+
* subtask's parent is a relation of one, found through `links`.
|
|
60
69
|
* - READ means the other system owns the kind: an act here that would change
|
|
61
70
|
* a record of it is refused with a sentence saying so (`SyncEngine.guard`),
|
|
62
71
|
* rather than accepted and never sent.
|
|
63
72
|
* - Inbound changes land through the app's own acts — one that creates the
|
|
64
73
|
* kind from the fields mapped alone (`creatingAct`), `edit-<kind>` and
|
|
65
74
|
* `remove-<kind>` — authored by the system
|
|
66
|
-
* (`google-calendar`, `notion`), so Activity credits it and undo works.
|
|
75
|
+
* (`google-calendar`, `notion`, `todoist`), so Activity credits it and undo works.
|
|
67
76
|
*/
|
|
68
77
|
export { CONNECTION_TAG, GOOGLE_COLORS, MADE_BY_GRAVIEW, inConnectionFilter } from "./connection-filter.js";
|
|
69
78
|
export type ConnectionDeclaration = ConnectionSpec;
|
|
@@ -77,13 +86,15 @@ export interface ConnectionRun<S extends AnySchema> {
|
|
|
77
86
|
readonly calendarId?: string;
|
|
78
87
|
/** A Notion connection's database id, resolved likewise. */
|
|
79
88
|
readonly databaseId?: string;
|
|
89
|
+
/** A Todoist connection's project, its id or its name, resolved likewise. */
|
|
90
|
+
readonly projectId?: string;
|
|
80
91
|
/**
|
|
81
92
|
* An access token for Google, asked again with `{ refresh: true }` when
|
|
82
93
|
* Google refuses the last one; for Notion, the internal integration's
|
|
83
|
-
* secret.
|
|
94
|
+
* secret; for Todoist, the account's personal API token.
|
|
84
95
|
*/
|
|
85
96
|
token(request?: GoogleTokenRequest): Promise<string> | string;
|
|
86
|
-
/** What the secret is called where the host keeps it (`NOTION_TOKEN`), for the sentence a refusal says. Never its value. */
|
|
97
|
+
/** What the secret is called where the host keeps it (`NOTION_TOKEN`, `TODOIST_TOKEN`), for the sentence a refusal says. Never its value. */
|
|
87
98
|
readonly secretName?: string;
|
|
88
99
|
readonly fetch?: Fetcher;
|
|
89
100
|
/** What the engine kept from the last run: its cursor, its links. */
|
|
@@ -92,7 +103,7 @@ export interface ConnectionRun<S extends AnySchema> {
|
|
|
92
103
|
say?(line: string): void;
|
|
93
104
|
/**
|
|
94
105
|
* THE APP'S LINKS, shared by every connection it runs (`sharedLinks()`):
|
|
95
|
-
* where a relation finds the record a Notion page is, whichever
|
|
106
|
+
* where a relation finds the record a Notion page or a Todoist task is, whichever
|
|
96
107
|
* connection linked it. This connection's engine is added to it. Absent:
|
|
97
108
|
* the connection's own links alone.
|
|
98
109
|
*/
|
|
@@ -134,6 +145,12 @@ export declare function notionConnectionMapping(app: GraviewApp, declaration: No
|
|
|
134
145
|
readonly spec: NotionSourceSpec;
|
|
135
146
|
})[];
|
|
136
147
|
};
|
|
148
|
+
/** What a Todoist connection maps: the engine's mapping, and the parts of a task the transport reads. */
|
|
149
|
+
export declare function todoistMapping(app: GraviewApp, declaration: TodoistConnectionSpec, zone?: string): {
|
|
150
|
+
readonly mapping: SyncMapping;
|
|
151
|
+
readonly refs: TodoistRefs;
|
|
152
|
+
readonly zone?: string;
|
|
153
|
+
};
|
|
137
154
|
/**
|
|
138
155
|
* The act a record of the kind from another system is made through: one
|
|
139
156
|
* that creates it, takes no subject and asks for nothing the connection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/sync/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAqD,KAAK,cAAc,EAAqC,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/sync/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAqD,KAAK,cAAc,EAAqC,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAQzO,OAAO,EAAE,UAAU,EAAqB,KAAK,WAAW,EAAqC,MAAM,aAAa,CAAC;AACjH,OAAO,EAAkB,KAAK,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAA6D,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzG,OAAO,EAAqB,KAAK,UAAU,EAA4B,MAAM,aAAa,CAAC;AAE3F,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,KAAK,EAAgB,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEtG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,OAAO,E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