grist-widget-sdk 0.3.17 → 0.3.25
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/CHANGELOG.md +14 -0
- package/dist/advanced.cjs +1 -5
- package/dist/advanced.cjs.map +1 -1
- package/dist/advanced.d.cts +6 -4
- package/dist/advanced.d.ts +6 -4
- package/dist/advanced.js +2 -2
- package/dist/{chunk-OTIHUVSE.js → chunk-EPEBKXVN.js} +3 -7
- package/dist/chunk-EPEBKXVN.js.map +1 -0
- package/dist/{chunk-D5GBS2NT.js → chunk-TZB3OZA6.js} +1 -1
- package/dist/chunk-TZB3OZA6.js.map +1 -0
- package/dist/{create-grist-emulator-DBS6gmiI.d.cts → create-grist-emulator-K-iUKUCZ.d.cts} +4 -3
- package/dist/{create-grist-emulator-C_0I4wax.d.ts → create-grist-emulator-_3_JK7Rr.d.ts} +4 -3
- package/dist/emulator/devtools.d.cts +6 -4
- package/dist/emulator/devtools.d.ts +6 -4
- package/dist/emulator/testing.d.cts +6 -5
- package/dist/emulator/testing.d.ts +6 -5
- package/dist/emulator/testing.js +1 -1
- package/dist/emulator/transports.d.cts +5 -4
- package/dist/emulator/transports.d.ts +5 -4
- package/dist/emulator.d.cts +9 -7
- package/dist/emulator.d.ts +9 -7
- package/dist/index.cjs +1 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -7
- package/dist/index.d.ts +13 -7
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{inline-QitZwXKP.d.ts → inline-A8yaddmp.d.cts} +3 -2
- package/dist/{inline-CRwQQ-GW.d.cts → inline-B7QQeWul.d.ts} +3 -2
- package/dist/{templates-DBq719O_.d.cts → templates-CB_VwjEU.d.cts} +1 -1
- package/dist/{templates-BC7FoSdW.d.ts → templates-pRIXc2RR.d.ts} +1 -1
- package/dist/{types-Fb2wplkv.d.ts → types-YcRfo7oy.d.cts} +1 -1
- package/dist/{types-Fb2wplkv.d.cts → types-YcRfo7oy.d.ts} +1 -1
- package/dist/{use-grist-widget-options-from-context-BFhQBGRY.d.ts → use-grist-widget-options-from-context-Bbd5-f39.d.cts} +5 -6
- package/dist/{use-grist-widget-options-from-context-qpFMdoBJ.d.cts → use-grist-widget-options-from-context-hl-NwOwP.d.ts} +5 -6
- package/package.json +9 -6
- package/tsconfig/app.json +38 -0
- package/tsconfig/node.json +36 -0
- package/dist/chunk-D5GBS2NT.js.map +0 -1
- package/dist/chunk-OTIHUVSE.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as GristCursorPos, f as GristWidgetInteraction, d as GristWidgetColumnMap, c as GristReplicaColumn, G as GristRowRecord, g as GristReplicaSelection, h as GristWidgetConfiguration, i as GristReadyOptions, j as GristFetchSelectedOptions, k as GristTableOperations } from './types-YcRfo7oy.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Tiny pub-sub used to broadcast every emulator state change to:
|
|
@@ -308,4 +308,5 @@ declare function createInlineTransport(options: InlineTransportOptions): Emulato
|
|
|
308
308
|
grist: InlineGristGlobal;
|
|
309
309
|
};
|
|
310
310
|
|
|
311
|
-
export {
|
|
311
|
+
export { createInlineTransport as i };
|
|
312
|
+
export type { EmulatorDocumentState as E, InlineGristGlobal as I, TransportContext as T, EmulatorEvent as a, EmulatorColumn as b, EmulatorApiBundle as c, EmulatorRowId as d, EmulatorTable as e, EmulatorTransport as f, EventBus as g, InlineTransportOptions as h };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as GristCursorPos, f as GristWidgetInteraction, d as GristWidgetColumnMap, c as GristReplicaColumn, G as GristRowRecord, g as GristReplicaSelection, h as GristWidgetConfiguration, i as GristReadyOptions, j as GristFetchSelectedOptions, k as GristTableOperations } from './types-YcRfo7oy.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Tiny pub-sub used to broadcast every emulator state change to:
|
|
@@ -308,4 +308,5 @@ declare function createInlineTransport(options: InlineTransportOptions): Emulato
|
|
|
308
308
|
grist: InlineGristGlobal;
|
|
309
309
|
};
|
|
310
310
|
|
|
311
|
-
export {
|
|
311
|
+
export { createInlineTransport as i };
|
|
312
|
+
export type { EmulatorDocumentState as E, InlineGristGlobal as I, TransportContext as T, EmulatorEvent as a, EmulatorColumn as b, EmulatorApiBundle as c, EmulatorRowId as d, EmulatorTable as e, EmulatorTransport as f, EventBus as g, InlineTransportOptions as h };
|
|
@@ -225,4 +225,4 @@ type GristDocApi = {
|
|
|
225
225
|
fetchSelectedRecord?: (rowId: number, options?: GristFetchSelectedOptions) => Promise<Record<string, unknown>>;
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
-
export type {
|
|
228
|
+
export type { GristRowRecord as G, GristReplicaTable as a, GristReplicaDocument as b, GristReplicaColumn as c, GristWidgetColumnMap as d, GristCursorPos as e, GristWidgetInteraction as f, GristReplicaSelection as g, GristWidgetConfiguration as h, GristReadyOptions as i, GristFetchSelectedOptions as j, GristTableOperations as k, GristDocApi as l, GristFormulaKind as m, GristReplicaRow as n, GristColumnsToMap as o, GristApplyUserActionsOptions as p, GristRequiredAccess as q, GristDocumentMode as r, GristColumnToMap as s, GristMinimalRecord as t, GristTableNewRecord as u, GristTableOpOptions as v, GristTableUpdateRecord as w, GristTableUpsertOptions as x, GristTableUpsertRecord as y, GristWidgetLinkingInfo as z };
|
|
@@ -225,4 +225,4 @@ type GristDocApi = {
|
|
|
225
225
|
fetchSelectedRecord?: (rowId: number, options?: GristFetchSelectedOptions) => Promise<Record<string, unknown>>;
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
-
export type {
|
|
228
|
+
export type { GristRowRecord as G, GristReplicaTable as a, GristReplicaDocument as b, GristReplicaColumn as c, GristWidgetColumnMap as d, GristCursorPos as e, GristWidgetInteraction as f, GristReplicaSelection as g, GristWidgetConfiguration as h, GristReadyOptions as i, GristFetchSelectedOptions as j, GristTableOperations as k, GristDocApi as l, GristFormulaKind as m, GristReplicaRow as n, GristColumnsToMap as o, GristApplyUserActionsOptions as p, GristRequiredAccess as q, GristDocumentMode as r, GristColumnToMap as s, GristMinimalRecord as t, GristTableNewRecord as u, GristTableOpOptions as v, GristTableUpdateRecord as w, GristTableUpsertOptions as x, GristTableUpsertRecord as y, GristWidgetLinkingInfo as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as GristReplicaColumn, G as GristRowRecord, l as GristDocApi, q as GristRequiredAccess, o as GristColumnsToMap, d as GristWidgetColumnMap, i as GristReadyOptions } from './types-YcRfo7oy.cjs';
|
|
2
2
|
import { z, ZodType } from 'zod';
|
|
3
3
|
|
|
4
4
|
type GristSafeParseIssueCode = "grist_error" | "invalid_format" | "type_mismatch" | "helper_mismatch" | "zod_error";
|
|
@@ -413,8 +413,8 @@ type GristWidgetSnapshot = {
|
|
|
413
413
|
config: GristConfig;
|
|
414
414
|
sync: GristSync;
|
|
415
415
|
};
|
|
416
|
-
/**
|
|
417
|
-
type GristWidgetStatus
|
|
416
|
+
/** Canonical 4-state status — projected from the handshake snapshot. */
|
|
417
|
+
type GristWidgetStatus = "booting" | "ready" | "unavailable" | "error";
|
|
418
418
|
/**
|
|
419
419
|
* Pre-computed booleans that widget code should consume directly instead of
|
|
420
420
|
* re-deriving from `status` + mapping flags + writes flags.
|
|
@@ -443,8 +443,6 @@ type GristCapabilities = {
|
|
|
443
443
|
emptyMultipleMappings: readonly string[];
|
|
444
444
|
};
|
|
445
445
|
|
|
446
|
-
/** Canonical 4-state status — projected from the handshake snapshot. */
|
|
447
|
-
type GristWidgetStatus = GristWidgetStatus$1;
|
|
448
446
|
type UseGristCoreOptions = GristReadyOptions & {
|
|
449
447
|
availabilityMaxAttempts?: number;
|
|
450
448
|
availabilityIntervalMs?: number;
|
|
@@ -519,4 +517,5 @@ type UseGristWidgetOptionsFromContextResult<T> = {
|
|
|
519
517
|
*/
|
|
520
518
|
declare function useGristWidgetOptionsFromContext<T extends Record<string, unknown>>(config: UseGristWidgetOptionsFromContextConfig<T>): UseGristWidgetOptionsFromContextResult<T>;
|
|
521
519
|
|
|
522
|
-
export {
|
|
520
|
+
export { gristSetDocumentInfoAction as $, fetchGristTableRows as A, fetchWithGristAuth as B, findRowIndexById as C, getGristAccessToken as D, gristAddColumnAction as E, gristAddRecordAction as H, gristAddTableAction as I, gristAddVisibleColumnAction as J, gristBulkAddRecordAction as K, gristBulkRemoveRecordAction as M, gristBulkUpdateRecordAction as N, gristCellValueSchema as O, gristDuplicateTableAction as P, gristModifyColumnAction as Q, gristRemoveColumnAction as R, gristRemoveRecordAction as T, gristRemoveTableAction as V, gristRenameColumnAction as W, gristRenameTableAction as X, gristReplaceTableDataAction as Y, gristSafeRefListValueSchema as Z, gristSafeRefValueSchema as _, gristUpdateRecordAction as a0, inferDisplayHelpersByRef as a1, isGristNoiseColumn as a2, materializeGristRowsFromColumnar as a3, rowAtIndex as a4, safeParseGristTableData as a5, safeParseGristValues as a6, safeParseRowsToDisplayRows as a7, sortRowsByGristOrder as a8, tableDataToRows as a9, useGristWidgetOptionsFromContext as aa, computeRowCount as x, decodeColumnarToReplicaRows as y, fetchGristRow as z };
|
|
521
|
+
export type { FetchGristTableRowsOptions as F, GristWidgetSnapshot as G, ListTablesOptions as L, SafeParseGristTableDataOptions as S, UseGristCoreResult as U, GristWidgetStatus as a, GristTerminationReason as ab, GristGeneration as ac, GristMappingSource as ad, GristAuthz as ae, GristConfig as af, GristCurrentTableState as ag, GristLifecycle as ah, GristLifecyclePhase as ai, GristLink as aj, GristLinkState as ak, GristMappingComplete as al, GristMappingIncomplete as am, GristMappingState as an, GristStreamFreshness as ao, GristSync as ap, GristUserActionTuple as b, UseGristCoreOptions as c, GristCapabilities as d, GristColumnarTable as e, GristSafeParseCellResult as f, ListColumnsOptions as g, GristColumnInfo as h, GristAccessToken as i, GristNoiseColumnsOptions as j, GristCellValue as k, GristColumnLike as l, GristSafeParseIssue as m, GristSafeParseIssueCode as n, GristSafeRefListValue as o, GristSafeRefValue as p, GristSafeTableCellIssue as q, GristSafeTableCellMeta as r, GristTableRowsOrder as s, SafeParseGristTableDataResult as t, SafeParseGristValuesOptions as u, UseGristWidgetOptionsFromContextConfig as v, UseGristWidgetOptionsFromContextResult as w };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as GristReplicaColumn, G as GristRowRecord, l as GristDocApi, q as GristRequiredAccess, o as GristColumnsToMap, d as GristWidgetColumnMap, i as GristReadyOptions } from './types-YcRfo7oy.js';
|
|
2
2
|
import { z, ZodType } from 'zod';
|
|
3
3
|
|
|
4
4
|
type GristSafeParseIssueCode = "grist_error" | "invalid_format" | "type_mismatch" | "helper_mismatch" | "zod_error";
|
|
@@ -413,8 +413,8 @@ type GristWidgetSnapshot = {
|
|
|
413
413
|
config: GristConfig;
|
|
414
414
|
sync: GristSync;
|
|
415
415
|
};
|
|
416
|
-
/**
|
|
417
|
-
type GristWidgetStatus
|
|
416
|
+
/** Canonical 4-state status — projected from the handshake snapshot. */
|
|
417
|
+
type GristWidgetStatus = "booting" | "ready" | "unavailable" | "error";
|
|
418
418
|
/**
|
|
419
419
|
* Pre-computed booleans that widget code should consume directly instead of
|
|
420
420
|
* re-deriving from `status` + mapping flags + writes flags.
|
|
@@ -443,8 +443,6 @@ type GristCapabilities = {
|
|
|
443
443
|
emptyMultipleMappings: readonly string[];
|
|
444
444
|
};
|
|
445
445
|
|
|
446
|
-
/** Canonical 4-state status — projected from the handshake snapshot. */
|
|
447
|
-
type GristWidgetStatus = GristWidgetStatus$1;
|
|
448
446
|
type UseGristCoreOptions = GristReadyOptions & {
|
|
449
447
|
availabilityMaxAttempts?: number;
|
|
450
448
|
availabilityIntervalMs?: number;
|
|
@@ -519,4 +517,5 @@ type UseGristWidgetOptionsFromContextResult<T> = {
|
|
|
519
517
|
*/
|
|
520
518
|
declare function useGristWidgetOptionsFromContext<T extends Record<string, unknown>>(config: UseGristWidgetOptionsFromContextConfig<T>): UseGristWidgetOptionsFromContextResult<T>;
|
|
521
519
|
|
|
522
|
-
export {
|
|
520
|
+
export { gristSetDocumentInfoAction as $, fetchGristTableRows as A, fetchWithGristAuth as B, findRowIndexById as C, getGristAccessToken as D, gristAddColumnAction as E, gristAddRecordAction as H, gristAddTableAction as I, gristAddVisibleColumnAction as J, gristBulkAddRecordAction as K, gristBulkRemoveRecordAction as M, gristBulkUpdateRecordAction as N, gristCellValueSchema as O, gristDuplicateTableAction as P, gristModifyColumnAction as Q, gristRemoveColumnAction as R, gristRemoveRecordAction as T, gristRemoveTableAction as V, gristRenameColumnAction as W, gristRenameTableAction as X, gristReplaceTableDataAction as Y, gristSafeRefListValueSchema as Z, gristSafeRefValueSchema as _, gristUpdateRecordAction as a0, inferDisplayHelpersByRef as a1, isGristNoiseColumn as a2, materializeGristRowsFromColumnar as a3, rowAtIndex as a4, safeParseGristTableData as a5, safeParseGristValues as a6, safeParseRowsToDisplayRows as a7, sortRowsByGristOrder as a8, tableDataToRows as a9, useGristWidgetOptionsFromContext as aa, computeRowCount as x, decodeColumnarToReplicaRows as y, fetchGristRow as z };
|
|
521
|
+
export type { FetchGristTableRowsOptions as F, GristWidgetSnapshot as G, ListTablesOptions as L, SafeParseGristTableDataOptions as S, UseGristCoreResult as U, GristWidgetStatus as a, GristTerminationReason as ab, GristGeneration as ac, GristMappingSource as ad, GristAuthz as ae, GristConfig as af, GristCurrentTableState as ag, GristLifecycle as ah, GristLifecyclePhase as ai, GristLink as aj, GristLinkState as ak, GristMappingComplete as al, GristMappingIncomplete as am, GristMappingState as an, GristStreamFreshness as ao, GristSync as ap, GristUserActionTuple as b, UseGristCoreOptions as c, GristCapabilities as d, GristColumnarTable as e, GristSafeParseCellResult as f, ListColumnsOptions as g, GristColumnInfo as h, GristAccessToken as i, GristNoiseColumnsOptions as j, GristCellValue as k, GristColumnLike as l, GristSafeParseIssue as m, GristSafeParseIssueCode as n, GristSafeRefListValue as o, GristSafeRefValue as p, GristSafeTableCellIssue as q, GristSafeTableCellMeta as r, GristTableRowsOrder as s, SafeParseGristTableDataResult as t, SafeParseGristValuesOptions as u, UseGristWidgetOptionsFromContextConfig as v, UseGristWidgetOptionsFromContextResult as w };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grist-widget-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.25",
|
|
4
4
|
"description": "React hooks and helpers for Grist custom widgets",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -89,10 +89,13 @@
|
|
|
89
89
|
"types": "./dist/emulator/devtools.d.cts",
|
|
90
90
|
"default": "./dist/emulator/devtools.cjs"
|
|
91
91
|
}
|
|
92
|
-
}
|
|
92
|
+
},
|
|
93
|
+
"./tsconfig/app.json": "./tsconfig/app.json",
|
|
94
|
+
"./tsconfig/node.json": "./tsconfig/node.json"
|
|
93
95
|
},
|
|
94
96
|
"files": [
|
|
95
97
|
"dist",
|
|
98
|
+
"tsconfig",
|
|
96
99
|
"CHANGELOG.md",
|
|
97
100
|
"LICENSE"
|
|
98
101
|
],
|
|
@@ -109,18 +112,18 @@
|
|
|
109
112
|
"@types/react": "^19.3.0",
|
|
110
113
|
"@types/react-dom": "^19.3.0",
|
|
111
114
|
"@vitejs/plugin-react": "^6.1.2",
|
|
112
|
-
"@vitest/coverage-v8": "^
|
|
115
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
113
116
|
"eslint": "^10.13.0",
|
|
114
117
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
115
118
|
"fast-check": "^4.10.2",
|
|
116
119
|
"globals": "^17.13.0",
|
|
117
120
|
"grist-plugin-api": "^0.0.1",
|
|
118
121
|
"jsdom": "^30.1.3",
|
|
119
|
-
"tsup": "^
|
|
120
|
-
"typescript": "^
|
|
122
|
+
"tsup": "^9.0.0",
|
|
123
|
+
"typescript": "^6.0.3",
|
|
121
124
|
"typescript-eslint": "^8.72.0",
|
|
122
125
|
"vite": "^8.3.5",
|
|
123
|
-
"vitest": "^
|
|
126
|
+
"vitest": "^5.0.5"
|
|
124
127
|
},
|
|
125
128
|
"dependencies": {
|
|
126
129
|
"grain-rpc": "^0.1.7",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Shared TypeScript settings for a widget's browser code (src/).
|
|
3
|
+
//
|
|
4
|
+
// // tsconfig.app.json
|
|
5
|
+
// { "extends": "grist-widget-sdk/tsconfig/app.json", ... }
|
|
6
|
+
//
|
|
7
|
+
// The widget's own file keeps whatever names its files and packages:
|
|
8
|
+
// tsBuildInfoFile, paths and include (TypeScript resolves those relative
|
|
9
|
+
// to the file that declares them), and types (its own list of global type
|
|
10
|
+
// packages, e.g. "vite/client"; a list set there would replace this one).
|
|
11
|
+
//
|
|
12
|
+
// Needs TypeScript 5.8 or later (erasableSyntaxOnly). Making a check
|
|
13
|
+
// stricter can fail a widget's typecheck, so it only happens in a minor
|
|
14
|
+
// (breaking, before 1.0) release of grist-widget-sdk.
|
|
15
|
+
"compilerOptions": {
|
|
16
|
+
"target": "ES2022",
|
|
17
|
+
"useDefineForClassFields": true,
|
|
18
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
19
|
+
"module": "ESNext",
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
|
|
22
|
+
/* Bundler mode */
|
|
23
|
+
"moduleResolution": "bundler",
|
|
24
|
+
"allowImportingTsExtensions": true,
|
|
25
|
+
"verbatimModuleSyntax": true,
|
|
26
|
+
"moduleDetection": "force",
|
|
27
|
+
"noEmit": true,
|
|
28
|
+
"jsx": "react-jsx",
|
|
29
|
+
|
|
30
|
+
/* Linting */
|
|
31
|
+
"strict": true,
|
|
32
|
+
"noUnusedLocals": true,
|
|
33
|
+
"noUnusedParameters": true,
|
|
34
|
+
"erasableSyntaxOnly": true,
|
|
35
|
+
"noFallthroughCasesInSwitch": true,
|
|
36
|
+
"noUncheckedSideEffectImports": true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Shared TypeScript settings for a widget's build config (vite.config.ts),
|
|
3
|
+
// which runs in Node.
|
|
4
|
+
//
|
|
5
|
+
// // tsconfig.node.json
|
|
6
|
+
// { "extends": "grist-widget-sdk/tsconfig/node.json", ... }
|
|
7
|
+
//
|
|
8
|
+
// The widget's own file keeps tsBuildInfoFile and include (TypeScript
|
|
9
|
+
// resolves those relative to the file that declares them) and types
|
|
10
|
+
// (e.g. "node").
|
|
11
|
+
//
|
|
12
|
+
// Needs TypeScript 5.8 or later (erasableSyntaxOnly). Making a check
|
|
13
|
+
// stricter can fail a widget's typecheck, so it only happens in a minor
|
|
14
|
+
// (breaking, before 1.0) release of grist-widget-sdk.
|
|
15
|
+
"compilerOptions": {
|
|
16
|
+
"target": "ES2023",
|
|
17
|
+
"lib": ["ES2023"],
|
|
18
|
+
"module": "ESNext",
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
|
|
21
|
+
/* Bundler mode */
|
|
22
|
+
"moduleResolution": "bundler",
|
|
23
|
+
"allowImportingTsExtensions": true,
|
|
24
|
+
"verbatimModuleSyntax": true,
|
|
25
|
+
"moduleDetection": "force",
|
|
26
|
+
"noEmit": true,
|
|
27
|
+
|
|
28
|
+
/* Linting */
|
|
29
|
+
"strict": true,
|
|
30
|
+
"noUnusedLocals": true,
|
|
31
|
+
"noUnusedParameters": true,
|
|
32
|
+
"erasableSyntaxOnly": true,
|
|
33
|
+
"noFallthroughCasesInSwitch": true,
|
|
34
|
+
"noUncheckedSideEffectImports": true
|
|
35
|
+
}
|
|
36
|
+
}
|