grist-widget-sdk 0.3.17 → 0.3.20
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 +8 -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 +5 -5
- package/dist/chunk-D5GBS2NT.js.map +0 -1
- package/dist/chunk-OTIHUVSE.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { GristEmulator } from '../emulator.cjs';
|
|
3
|
+
import { GristReplicaDocument } from '../emulator.cjs';
|
|
4
|
+
import { GristRowRecord, GristReplicaTable, GristReplicaColumn } from '../index.cjs';
|
|
5
|
+
import { EmulatorDocumentState, EmulatorEvent } from '../emulator.cjs';
|
|
5
6
|
|
|
6
7
|
type EmulatorInspectorProps = {
|
|
7
8
|
emulator: GristEmulator;
|
|
@@ -43,4 +44,5 @@ declare function useEmulatorSnapshot(emulator: GristEmulator): {
|
|
|
43
44
|
history: readonly EmulatorEvent[];
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
export {
|
|
47
|
+
export { EmulatorInspector, fetchEmulatorRows, useEmulatorColumns, useEmulatorRows, useEmulatorSnapshot };
|
|
48
|
+
export type { EmulatorColumnsTableView, EmulatorInspectorProps, UseEmulatorColumnsResult, UseEmulatorRowsResult };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { GristEmulator } from '../emulator.js';
|
|
3
|
+
import { GristReplicaDocument } from '../emulator.js';
|
|
4
|
+
import { GristRowRecord, GristReplicaTable, GristReplicaColumn } from '../index.js';
|
|
5
|
+
import { EmulatorDocumentState, EmulatorEvent } from '../emulator.js';
|
|
5
6
|
|
|
6
7
|
type EmulatorInspectorProps = {
|
|
7
8
|
emulator: GristEmulator;
|
|
@@ -43,4 +44,5 @@ declare function useEmulatorSnapshot(emulator: GristEmulator): {
|
|
|
43
44
|
history: readonly EmulatorEvent[];
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
export {
|
|
47
|
+
export { EmulatorInspector, fetchEmulatorRows, useEmulatorColumns, useEmulatorRows, useEmulatorSnapshot };
|
|
48
|
+
export type { EmulatorColumnsTableView, EmulatorInspectorProps, UseEmulatorColumnsResult, UseEmulatorRowsResult };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
3
3
|
export { RenderOptions, RenderResult, act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export { p as presets } from '../templates-
|
|
7
|
-
import '../types-
|
|
4
|
+
import { CreateGristEmulatorOptions, GristEmulator } from '../emulator.cjs';
|
|
5
|
+
import { EmulatorEvent } from '../emulator.cjs';
|
|
6
|
+
export { p as presets } from '../templates-CB_VwjEU.cjs';
|
|
7
|
+
import '../types-YcRfo7oy.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* `renderWithGrist(ui, options)` — drop-in replacement for
|
|
@@ -47,4 +47,5 @@ type WaitForEventOptions = {
|
|
|
47
47
|
declare function waitForEvent(emulator: GristEmulator, kind: WaitForEventKind, options?: WaitForEventOptions): Promise<EmulatorEvent>;
|
|
48
48
|
declare function waitForEvent(emulator: GristEmulator, predicate: (event: EmulatorEvent) => boolean, timeoutMs?: number): Promise<EmulatorEvent>;
|
|
49
49
|
|
|
50
|
-
export {
|
|
50
|
+
export { actionsOf, eventsOf, renderWithGrist, waitForEvent };
|
|
51
|
+
export type { RenderWithGristOptions, RenderWithGristResult, WaitForEventKind, WaitForEventOptions };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { RenderOptions, RenderResult } from '@testing-library/react';
|
|
3
3
|
export { RenderOptions, RenderResult, act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export { p as presets } from '../templates-
|
|
7
|
-
import '../types-
|
|
4
|
+
import { CreateGristEmulatorOptions, GristEmulator } from '../emulator.js';
|
|
5
|
+
import { EmulatorEvent } from '../emulator.js';
|
|
6
|
+
export { p as presets } from '../templates-pRIXc2RR.js';
|
|
7
|
+
import '../types-YcRfo7oy.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* `renderWithGrist(ui, options)` — drop-in replacement for
|
|
@@ -47,4 +47,5 @@ type WaitForEventOptions = {
|
|
|
47
47
|
declare function waitForEvent(emulator: GristEmulator, kind: WaitForEventKind, options?: WaitForEventOptions): Promise<EmulatorEvent>;
|
|
48
48
|
declare function waitForEvent(emulator: GristEmulator, predicate: (event: EmulatorEvent) => boolean, timeoutMs?: number): Promise<EmulatorEvent>;
|
|
49
49
|
|
|
50
|
-
export {
|
|
50
|
+
export { actionsOf, eventsOf, renderWithGrist, waitForEvent };
|
|
51
|
+
export type { RenderWithGristOptions, RenderWithGristResult, WaitForEventKind, WaitForEventOptions };
|
package/dist/emulator/testing.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TransportContext, f as EmulatorTransport } from '../inline-
|
|
2
|
-
export { I as InlineGristGlobal, h as InlineTransportOptions, i as createInlineTransport } from '../inline-
|
|
3
|
-
import '../types-
|
|
1
|
+
import { T as TransportContext, f as EmulatorTransport } from '../inline-A8yaddmp.cjs';
|
|
2
|
+
export { I as InlineGristGlobal, h as InlineTransportOptions, i as createInlineTransport } from '../inline-A8yaddmp.cjs';
|
|
3
|
+
import '../types-YcRfo7oy.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Iframe transport — the production-fidelity path.
|
|
@@ -34,4 +34,5 @@ type IframeTransportOptions = TransportContext & {
|
|
|
34
34
|
};
|
|
35
35
|
declare function createIframeTransport(options: IframeTransportOptions): EmulatorTransport;
|
|
36
36
|
|
|
37
|
-
export { EmulatorTransport,
|
|
37
|
+
export { EmulatorTransport, TransportContext, createIframeTransport };
|
|
38
|
+
export type { IframeTransportOptions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TransportContext, f as EmulatorTransport } from '../inline-
|
|
2
|
-
export { I as InlineGristGlobal, h as InlineTransportOptions, i as createInlineTransport } from '../inline-
|
|
3
|
-
import '../types-
|
|
1
|
+
import { T as TransportContext, f as EmulatorTransport } from '../inline-B7QQeWul.js';
|
|
2
|
+
export { I as InlineGristGlobal, h as InlineTransportOptions, i as createInlineTransport } from '../inline-B7QQeWul.js';
|
|
3
|
+
import '../types-YcRfo7oy.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Iframe transport — the production-fidelity path.
|
|
@@ -34,4 +34,5 @@ type IframeTransportOptions = TransportContext & {
|
|
|
34
34
|
};
|
|
35
35
|
declare function createIframeTransport(options: IframeTransportOptions): EmulatorTransport;
|
|
36
36
|
|
|
37
|
-
export { EmulatorTransport,
|
|
37
|
+
export { EmulatorTransport, TransportContext, createIframeTransport };
|
|
38
|
+
export type { IframeTransportOptions };
|
package/dist/emulator.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
import { b as GristReplicaDocument } from './types-YcRfo7oy.cjs';
|
|
2
|
+
import { GristReplicaTable, GristWidgetColumnMap } from './index.cjs';
|
|
3
|
+
export { C as CreateGristEmulatorOptions, G as GristEmulator, c as createGristEmulator } from './create-grist-emulator-K-iUKUCZ.cjs';
|
|
4
|
+
export { p as presets } from './templates-CB_VwjEU.cjs';
|
|
4
5
|
import { z } from 'zod';
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
6
|
+
import { b as EmulatorColumn, E as EmulatorDocumentState } from './inline-A8yaddmp.cjs';
|
|
7
|
+
export { c as EmulatorApiBundle, a as EmulatorEvent, d as EmulatorRowId, e as EmulatorTable, f as EmulatorTransport, I as InlineGristGlobal } from './inline-A8yaddmp.cjs';
|
|
7
8
|
|
|
8
9
|
declare function safeParseDocument(input: unknown): z.ZodSafeParseResult<{
|
|
9
10
|
generatedAt: string;
|
|
@@ -15,7 +16,7 @@ declare function safeParseDocument(input: unknown): z.ZodSafeParseResult<{
|
|
|
15
16
|
label?: string | undefined;
|
|
16
17
|
parentPos?: number | undefined;
|
|
17
18
|
isFormula?: boolean | undefined;
|
|
18
|
-
formulaKind?: "
|
|
19
|
+
formulaKind?: "computed" | "trigger" | "none" | "empty_slot" | undefined;
|
|
19
20
|
formula?: string | undefined;
|
|
20
21
|
description?: string | undefined;
|
|
21
22
|
widgetOptions?: Record<string, unknown> | undefined;
|
|
@@ -104,4 +105,5 @@ declare class EmulatorActionError extends Error {
|
|
|
104
105
|
|
|
105
106
|
declare function resolveMappings(state: EmulatorDocumentState): GristWidgetColumnMap | null;
|
|
106
107
|
|
|
107
|
-
export {
|
|
108
|
+
export { EmulatorActionError, EmulatorColumn, EmulatorDocumentState, GristReplicaDocument, enrichEmulatorColumnMetadata, parseDocument, resolveMappings, safeParseDocument };
|
|
109
|
+
export type { CreateDocumentInput, CreateDocumentTableInput };
|
package/dist/emulator.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
import { b as GristReplicaDocument } from './types-YcRfo7oy.js';
|
|
2
|
+
import { GristReplicaTable, GristWidgetColumnMap } from './index.js';
|
|
3
|
+
export { C as CreateGristEmulatorOptions, G as GristEmulator, c as createGristEmulator } from './create-grist-emulator-_3_JK7Rr.js';
|
|
4
|
+
export { p as presets } from './templates-pRIXc2RR.js';
|
|
4
5
|
import { z } from 'zod';
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
6
|
+
import { b as EmulatorColumn, E as EmulatorDocumentState } from './inline-B7QQeWul.js';
|
|
7
|
+
export { c as EmulatorApiBundle, a as EmulatorEvent, d as EmulatorRowId, e as EmulatorTable, f as EmulatorTransport, I as InlineGristGlobal } from './inline-B7QQeWul.js';
|
|
7
8
|
|
|
8
9
|
declare function safeParseDocument(input: unknown): z.ZodSafeParseResult<{
|
|
9
10
|
generatedAt: string;
|
|
@@ -15,7 +16,7 @@ declare function safeParseDocument(input: unknown): z.ZodSafeParseResult<{
|
|
|
15
16
|
label?: string | undefined;
|
|
16
17
|
parentPos?: number | undefined;
|
|
17
18
|
isFormula?: boolean | undefined;
|
|
18
|
-
formulaKind?: "
|
|
19
|
+
formulaKind?: "computed" | "trigger" | "none" | "empty_slot" | undefined;
|
|
19
20
|
formula?: string | undefined;
|
|
20
21
|
description?: string | undefined;
|
|
21
22
|
widgetOptions?: Record<string, unknown> | undefined;
|
|
@@ -104,4 +105,5 @@ declare class EmulatorActionError extends Error {
|
|
|
104
105
|
|
|
105
106
|
declare function resolveMappings(state: EmulatorDocumentState): GristWidgetColumnMap | null;
|
|
106
107
|
|
|
107
|
-
export {
|
|
108
|
+
export { EmulatorActionError, EmulatorColumn, EmulatorDocumentState, GristReplicaDocument, enrichEmulatorColumnMetadata, parseDocument, resolveMappings, safeParseDocument };
|
|
109
|
+
export type { CreateDocumentInput, CreateDocumentTableInput };
|
package/dist/index.cjs
CHANGED
|
@@ -3869,11 +3869,7 @@ function useGristCoreFromManager(manager) {
|
|
|
3869
3869
|
);
|
|
3870
3870
|
const status = deriveStatus(snapshot);
|
|
3871
3871
|
const error = deriveErrorMessage(snapshot);
|
|
3872
|
-
const docApi =
|
|
3873
|
-
if (snapshot.lifecycle.phase !== "online") return null;
|
|
3874
|
-
if (typeof grist === "undefined") return null;
|
|
3875
|
-
return grist.docApi ?? null;
|
|
3876
|
-
}, [snapshot.lifecycle.phase, snapshot.generation]);
|
|
3872
|
+
const docApi = snapshot.lifecycle.phase === "online" && typeof grist !== "undefined" ? grist.docApi ?? null : null;
|
|
3877
3873
|
const isAvailable = computeAvailabilityFromSnapshot(snapshot);
|
|
3878
3874
|
const reload = (0, import_react3.useCallback)(async () => {
|
|
3879
3875
|
manager.reload();
|