@mistriwork/kit 1.0.0-rc.12 → 1.0.0-rc.13

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.
@@ -19,6 +19,7 @@ interface FieldArrangerProps {
19
19
  /** Redraw everything after a hand-over: two groups change and the other one may be open. */
20
20
  onSend?: () => void;
21
21
  }
22
+ /** @public the database browser's (scripts/boundary/entries.json, "host") */
22
23
  export declare const carriedField: () => {
23
24
  name: string;
24
25
  owner: unknown;
@@ -11,6 +11,7 @@ import { useEffect, useRef, useState } from 'react';
11
11
  import { say } from '../copy/record/components/FieldArranger.js';
12
12
  /** The field being dragged between groups, or null. */
13
13
  let carried = null;
14
+ /** @public the database browser's (scripts/boundary/entries.json, "host") */
14
15
  export const carriedField = () => carried;
15
16
  export function FieldArranger({ all, chosen, columns = 1, noun = 'layout', heading = say('fields'), label = (n) => n, typeOf = () => '', onChange, owner, others = [], onSend, }) {
16
17
  const list = useRef(null);
@@ -2,7 +2,10 @@
2
2
  export declare function bootstrapRequestIdentity(requested: any): Promise<void>;
3
3
  export declare function initConnections(onSwitched: any): Promise<void>;
4
4
  export declare function refreshConnections(): Promise<void>;
5
- /** @param {{ draw(picker: HTMLElement): void, retire(picker: HTMLElement): void }} next */
5
+ /**
6
+ * @param {{ draw(picker: HTMLElement): void, retire(picker: HTMLElement): void }} next
7
+ * @public the database browser's (scripts/boundary/entries.json, "host")
8
+ */
6
9
  export declare function whenConnectionControls(next: {
7
10
  draw(picker: HTMLElement): void;
8
11
  retire(picker: HTMLElement): void;
@@ -129,7 +129,10 @@ export async function refreshConnections() {
129
129
  * @type {{ draw(picker: HTMLElement): void, retire(picker: HTMLElement): void } | null}
130
130
  */
131
131
  let controls = null;
132
- /** @param {{ draw(picker: HTMLElement): void, retire(picker: HTMLElement): void }} next */
132
+ /**
133
+ * @param {{ draw(picker: HTMLElement): void, retire(picker: HTMLElement): void }} next
134
+ * @public the database browser's (scripts/boundary/entries.json, "host")
135
+ */
133
136
  export function whenConnectionControls(next) {
134
137
  controls = next;
135
138
  }
@@ -166,8 +166,14 @@ export declare function renderCrumbs(): void;
166
166
  */
167
167
  export declare function go(entry: any, mode?: string): void;
168
168
  export declare function backTo(index: any): void;
169
- /** A table view, optionally filtered. The query text is what the bar shows. */
170
- export declare function tableView(tableId: any, query: any, tab: any): {
169
+ /**
170
+ * A table view, optionally filtered. The query text is what the bar shows.
171
+ *
172
+ * @param {*} tableId
173
+ * @param {*} [query]
174
+ * @param {*} [tab]
175
+ */
176
+ export declare function tableView(tableId: any, query?: any, tab?: any): {
171
177
  kind: string;
172
178
  table: any;
173
179
  query: any;
@@ -199,8 +205,13 @@ export declare function rowView(tableId: any, key: any, label: any): {
199
205
  * `table` is the page's base rather than a table being browsed, so that the
200
206
  * sidebar highlights the right thing and a page can find its way back to a
201
207
  * suggested layout when the id names no configured page.
208
+ *
209
+ * @param {*} pageId
210
+ * @param {*} [tableId]
211
+ * @param {*} [key]
212
+ * @param {*} [label]
202
213
  */
203
- export declare function pageView(pageId: any, tableId: any, key: any, label: any): {
214
+ export declare function pageView(pageId: any, tableId?: any, key?: any, label?: any): {
204
215
  kind: string;
205
216
  pageId: any;
206
217
  table: any;
@@ -306,7 +317,11 @@ export declare function quote(value: any): string;
306
317
  * and sending them to a menu to find Undo wastes the seconds in which they
307
318
  * still remember what they did. Anything that needs more than one verb belongs
308
319
  * in a dialog rather than here.
320
+ *
321
+ * @param {*} message
322
+ * @param {string} [tone]
323
+ * @param {*} [action]
309
324
  */
310
- export declare function toast(message: any, tone: string, action: any): void;
325
+ export declare function toast(message: any, tone?: string, action?: any): void;
311
326
  export declare function loadJson(key: any, fallback: any): any;
312
327
  export declare function saveJson(key: any, value: any): boolean;
@@ -656,7 +656,13 @@ export function backTo(index) {
656
656
  state.navMode = 'push';
657
657
  render();
658
658
  }
659
- /** A table view, optionally filtered. The query text is what the bar shows. */
659
+ /**
660
+ * A table view, optionally filtered. The query text is what the bar shows.
661
+ *
662
+ * @param {*} tableId
663
+ * @param {*} [query]
664
+ * @param {*} [tab]
665
+ */
660
666
  export function tableView(tableId, query, tab) {
661
667
  return { kind: 'table', table: tableId, query: query ?? tableId, tab: tab ?? 'rows' };
662
668
  }
@@ -681,6 +687,11 @@ export function rowView(tableId, key, label) {
681
687
  * `table` is the page's base rather than a table being browsed, so that the
682
688
  * sidebar highlights the right thing and a page can find its way back to a
683
689
  * suggested layout when the id names no configured page.
690
+ *
691
+ * @param {*} pageId
692
+ * @param {*} [tableId]
693
+ * @param {*} [key]
694
+ * @param {*} [label]
684
695
  */
685
696
  export function pageView(pageId, tableId, key, label) {
686
697
  return { kind: 'page', pageId, table: tableId, key, label };
@@ -1029,6 +1040,10 @@ export function quote(value) {
1029
1040
  * and sending them to a menu to find Undo wastes the seconds in which they
1030
1041
  * still remember what they did. Anything that needs more than one verb belongs
1031
1042
  * in a dialog rather than here.
1043
+ *
1044
+ * @param {*} message
1045
+ * @param {string} [tone]
1046
+ * @param {*} [action]
1032
1047
  */
1033
1048
  export function toast(message, tone = 'info', action) {
1034
1049
  const host = $('toast');
@@ -1,4 +1,7 @@
1
- /** Browser recovery is a separate document from acknowledged server state. */
1
+ /**
2
+ * Browser recovery is a separate document from acknowledged server state.
3
+ * @public the database browser's (scripts/boundary/entries.json, "host")
4
+ */
2
5
  export interface RecoveredDraft<T> {
3
6
  version: 1;
4
7
  original: string;
@@ -6,7 +6,10 @@ export type PaletteItem = {
6
6
  run: () => unknown;
7
7
  };
8
8
  /** @typedef {{ kind: string, label: string, search: string, detail?: string, run: () => unknown }} PaletteItem */
9
- /** @param {'places' | 'databases'} where @param {() => PaletteItem[]} source */
9
+ /**
10
+ * @param {'places' | 'databases'} where @param {() => PaletteItem[]} source
11
+ * @public the database browser's (scripts/boundary/entries.json, "host")
12
+ */
10
13
  export declare function addPaletteSource(where: 'places' | 'databases', source: () => PaletteItem[]): void;
11
14
  /** Everything the palette can take you to, before filtering. */
12
15
  export declare function entries(): any[];
@@ -41,7 +41,10 @@ import { addHostListener, portalRoot, shellBody, shellQuery } from './shellHost.
41
41
  */
42
42
  const sources = { places: [], databases: [] };
43
43
  /** @typedef {{ kind: string, label: string, search: string, detail?: string, run: () => unknown }} PaletteItem */
44
- /** @param {'places' | 'databases'} where @param {() => PaletteItem[]} source */
44
+ /**
45
+ * @param {'places' | 'databases'} where @param {() => PaletteItem[]} source
46
+ * @public the database browser's (scripts/boundary/entries.json, "host")
47
+ */
45
48
  export function addPaletteSource(where, source) {
46
49
  sources[where].push(source);
47
50
  }
@@ -1,7 +1,11 @@
1
1
  /** @param {() => void} fn */
2
2
  export declare function whenSavedPagesChange(fn: () => void): void;
3
- /** Pages saved for the connection in hand, read from the local mirror. */
4
- export declare function savedPages(tableId: any): import("@mistriwork/engine/shared/pageModel.js").PageDef[];
3
+ /**
4
+ * Pages saved for the connection in hand, read from the local mirror.
5
+ *
6
+ * @param {*} [tableId] only the pages based on this table
7
+ */
8
+ export declare function savedPages(tableId?: any): import("@mistriwork/engine/shared/pageModel.js").PageDef[];
5
9
  /**
6
10
  * Pull this connection's saved pages from the server into the mirror.
7
11
  *
@@ -11,5 +15,13 @@ export declare function savedPages(tableId: any): import("@mistriwork/engine/sha
11
15
  * browser saved.
12
16
  */
13
17
  export declare function loadSavedPages(): Promise<void>;
14
- export declare function savePage(page: any, connection?: string): Promise<void>;
15
- export declare function deletePage(id: any, connection?: string): Promise<void>;
18
+ /**
19
+ * @param {*} page
20
+ * @param {string | null} [connection] the connection written to; the one in hand, unless given
21
+ */
22
+ export declare function savePage(page: any, connection?: string | null): Promise<void>;
23
+ /**
24
+ * @param {*} id
25
+ * @param {string | null} [connection] the connection written to; the one in hand, unless given
26
+ */
27
+ export declare function deletePage(id: any, connection?: string | null): Promise<void>;
@@ -54,7 +54,11 @@ async function writePage(id, page, connection) {
54
54
  clearTimeout(timer);
55
55
  }
56
56
  }
57
- /** Pages saved for the connection in hand, read from the local mirror. */
57
+ /**
58
+ * Pages saved for the connection in hand, read from the local mirror.
59
+ *
60
+ * @param {*} [tableId] only the pages based on this table
61
+ */
58
62
  export function savedPages(tableId) {
59
63
  const all = mirrorFor(state.activeConnection);
60
64
  const pages = Object.values(all);
@@ -93,6 +97,10 @@ export async function loadSavedPages() {
93
97
  /* Server-side pages unavailable; the mirror stands. */
94
98
  }
95
99
  }
100
+ /**
101
+ * @param {*} page
102
+ * @param {string | null} [connection] the connection written to; the one in hand, unless given
103
+ */
96
104
  export async function savePage(page, connection = state.activeConnection) {
97
105
  const owner = sessionIdentity();
98
106
  if (!connection)
@@ -108,6 +116,10 @@ export async function savePage(page, connection = state.activeConnection) {
108
116
  if (state.activeConnection === connection)
109
117
  pagesChanged?.();
110
118
  }
119
+ /**
120
+ * @param {*} id
121
+ * @param {string | null} [connection] the connection written to; the one in hand, unless given
122
+ */
111
123
  export async function deletePage(id, connection = state.activeConnection) {
112
124
  const owner = sessionIdentity();
113
125
  if (!connection)
@@ -2,6 +2,7 @@ import { booleanChoices, canEditRow } from './rowEditing.js';
2
2
  export declare function initWriteMode(): void;
3
3
  /** Mode changes must not hide pending work or interrupt an acknowledged save. */
4
4
  export declare function prepareEditingExit(): Promise<boolean>;
5
+ /** @public the database browser's (scripts/boundary/entries.json, "host") */
5
6
  export declare function toggleWriteMode(): Promise<void>;
6
7
  /** Re-evaluate on connection switch, since the setting is per database. */
7
8
  export declare function syncWriteMode(): void;
@@ -35,6 +36,7 @@ export declare const dirtyDraft: () => {
35
36
  */
36
37
  export declare function takeTheirs(column: string, value: unknown): void;
37
38
  export declare const draftNeedsReview: (table: any, key: any) => boolean;
39
+ /** @public the database browser's (scripts/boundary/entries.json, "host") */
38
40
  export declare const draftRequiresManualSave: (table: any, key: any) => boolean;
39
41
  export declare const draftSchemaChanged: (table: any) => boolean;
40
42
  export declare const retainedValues: () => {};
@@ -81,6 +83,7 @@ export { sameRow };
81
83
  export declare const applyingStaged: () => boolean;
82
84
  /** Deferred intent only: an already dispatched write still settles normally. */
83
85
  export declare function cancelRecordAutosave(): void;
86
+ /** @public the database browser's (scripts/boundary/entries.json, "host") */
84
87
  export declare function recordAutosavePending(): boolean;
85
88
  /** Capture only for a fresh user edit leaving its complete interaction surface.
86
89
  * This predicate does not schedule or send anything. The interaction owner must
@@ -89,6 +89,7 @@ export async function prepareEditingExit() {
89
89
  discardStaged();
90
90
  return true;
91
91
  }
92
+ /** @public the database browser's (scripts/boundary/entries.json, "host") */
92
93
  export async function toggleWriteMode() {
93
94
  if (state.canWrite) {
94
95
  if (await prepareEditingExit())
@@ -194,6 +195,7 @@ export function takeTheirs(column, value) {
194
195
  tell();
195
196
  }
196
197
  export const draftNeedsReview = (table, key) => sameRow(table, key) && staged.needsReview;
198
+ /** @public the database browser's (scripts/boundary/entries.json, "host") */
197
199
  export const draftRequiresManualSave = (table, key) => sameRow(table, key) && staged.manualSaveRequired;
198
200
  export const draftSchemaChanged = (table) => staged.schemaKey !== draftSchemaKey(table);
199
201
  export const retainedValues = () => ({ ...staged.values });
@@ -525,6 +527,7 @@ let autosaveOwner;
525
527
  export function cancelRecordAutosave() {
526
528
  autosaveCancellation++;
527
529
  }
530
+ /** @public the database browser's (scripts/boundary/entries.json, "host") */
528
531
  export function recordAutosavePending() {
529
532
  // Ordinary uncertainty keeps the record locked, not every route. Tenant
530
533
  // uncertainty still has its independent stronger navigation gate in core.
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Where the page every server sends comes from. The page is the kit's: its index.html, its entry (boot.js) and the
3
3
  * shell, which start the main of the product that built it (shellStart.js, `virtual:mistri/shell-main`). Each product
4
- * builds it into its own dist/client with the kit's Vite preset (`@mistriwork/kit/vite`) — the database browser's with
5
- * config/vite.tablewalk.config.ts, the App framework's with config/vite.mistri.config.ts — and names that build with
4
+ * builds it into its own dist/client with the kit's Vite preset (`@mistriwork/kit/vite`) — the App framework's with
5
+ * config/vite.mistri.config.ts, the database browser's with its own in its own repository — and names that build with
6
6
  * `clientFiles`; the engine serves whichever files it is handed (clientHttp.ts, devclient.ts).
7
7
  *
8
8
  * From source — under tsx — Vite serves the kit's client folder with the vite.config.ts of the product's workspace,
package/dist/vite.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * `@mistriwork/kit/vite`: how a product bundles the kit's page, and how it serves it from source.
3
3
  *
4
4
  * The page is the kit's — its index.html, its entry (boot.js), the shell — and each product builds it into its own
5
- * dist/client with its own main: the database browser's (config/vite.tablewalk.config.ts in this repository) and the
6
- * App framework's (config/vite.mistri.config.ts). This is the part they share, so a product checked out on its own,
5
+ * dist/client with its own main: the App framework's (config/vite.mistri.config.ts) and the database browser's (in
6
+ * its own repository, over the published kit). This is the part they share, so a product checked out on its own,
7
7
  * over the published kit, builds the same page the same way:
8
8
  *
9
9
  * - the page's entry starts `virtual:mistri/shell-main`, which `shellMain` answers with the product's main: the kit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/kit",
3
- "version": "1.0.0-rc.12",
3
+ "version": "1.0.0-rc.13",
4
4
  "description": "The shared React client both shells are drawn with: the walk and the address, Grid, Value, the record page, lists, filters and charts.",
5
5
  "homepage": "https://mistriwork.dev",
6
6
  "bugs": {
@@ -26,6 +26,7 @@
26
26
  "./client/components/Dropdown.js": "./dist/client/components/Dropdown.js",
27
27
  "./client/components/FieldArranger.js": "./dist/client/components/FieldArranger.js",
28
28
  "./client/components/Grid.js": "./dist/client/components/Grid.js",
29
+ "./client/components/NewRecord.js": "./dist/client/components/NewRecord.js",
29
30
  "./client/components/Page.js": "./dist/client/components/Page.js",
30
31
  "./client/components/Prompt.js": "./dist/client/components/Prompt.js",
31
32
  "./client/components/mount.js": "./dist/client/components/mount.js",
@@ -38,10 +39,12 @@
38
39
  "./client/copy/shell/startup.js": "./dist/client/copy/shell/startup.js",
39
40
  "./client/core.js": "./dist/client/core.js",
40
41
  "./client/deeplink.js": "./dist/client/deeplink.js",
42
+ "./client/delete.js": "./dist/client/delete.js",
41
43
  "./client/density.js": "./dist/client/density.js",
42
44
  "./client/draftRecovery.js": "./dist/client/draftRecovery.js",
43
45
  "./client/help.js": "./dist/client/help.js",
44
46
  "./client/historyToken.js": "./dist/client/historyToken.js",
47
+ "./client/insert.js": "./dist/client/insert.js",
45
48
  "./client/locale.js": "./dist/client/locale.js",
46
49
  "./client/menu.js": "./dist/client/menu.js",
47
50
  "./client/messages.js": "./dist/client/messages.js",
@@ -50,7 +53,9 @@
50
53
  "./client/peek.js": "./dist/client/peek.js",
51
54
  "./client/peekpanel.js": "./dist/client/peekpanel.js",
52
55
  "./client/prompt.js": "./dist/client/prompt.js",
56
+ "./client/recordEditValidation.js": "./dist/client/recordEditValidation.js",
53
57
  "./client/recordSource.js": "./dist/client/recordSource.js",
58
+ "./client/recordWriteRefresh.js": "./dist/client/recordWriteRefresh.js",
54
59
  "./client/requestIdentity.js": "./dist/client/requestIdentity.js",
55
60
  "./client/resourceRequests.js": "./dist/client/resourceRequests.js",
56
61
  "./client/savedPages.js": "./dist/client/savedPages.js",
@@ -61,6 +66,7 @@
61
66
  "./client/startup.js": "./dist/client/startup.js",
62
67
  "./client/surfaces.js": "./dist/client/surfaces.js",
63
68
  "./client/theme.js": "./dist/client/theme.js",
69
+ "./client/url.js": "./dist/client/url.js",
64
70
  "./client/visualTheme.js": "./dist/client/visualTheme.js",
65
71
  "./client/write.js": "./dist/client/write.js",
66
72
  "./clientFiles.js": "./dist/clientFiles.js",
@@ -69,8 +75,8 @@
69
75
  "./package.json": "./package.json"
70
76
  },
71
77
  "dependencies": {
72
- "@mistriwork/engine": "1.0.0-rc.12",
73
- "@mistriwork/ui": "1.0.0-rc.12",
78
+ "@mistriwork/engine": "1.0.0-rc.13",
79
+ "@mistriwork/ui": "1.0.0-rc.13",
74
80
  "intl-messageformat": "12.1.2",
75
81
  "qrcode-generator": "^2.0.4"
76
82
  },