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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sdk/helpers/grist-fetch-with-auth.ts","../src/sdk/internal/hooks/use-grist-core.ts","../src/sdk/internal/handshake-manager-context.ts","../src/sdk/internal/build-manager-options.ts","../src/sdk/low-level-hooks/use-grist-ready.ts","../src/sdk/mid-level-hooks/use-grist-widget-options-from-context.ts","../src/sdk/internal/contexts.tsx","../src/sdk/internal/merge-grist-result.ts","../src/sdk/internal/hooks/use-rpc-heartbeat-coalesce.ts"],"sourcesContent":["import type { GristDocApi } from \"../types\"\n\nexport type GristAccessToken = {\n token: string\n baseUrl: string\n}\n\ntype TokenCacheEntry = {\n token: GristAccessToken\n fetchedAt: number\n}\n\nconst TOKEN_TTL_MS = 45_000\nconst cache = new Map<string, TokenCacheEntry>()\nconst inFlight = new Map<string, Promise<GristAccessToken>>()\n\nfunction cacheKey(readOnly: boolean): string {\n return readOnly ? \"ro\" : \"rw\"\n}\n\n/**\n * Returns an access token suitable for calling Grist's REST API directly.\n * Tokens are short-lived; results are cached briefly and coalesced per readOnly flag.\n */\nexport async function getGristAccessToken(\n docApi: GristDocApi,\n options?: { readOnly?: boolean }\n): Promise<GristAccessToken> {\n if (!docApi.getAccessToken) {\n throw new Error(\"getAccessToken is not available on docApi (need higher access level)\")\n }\n\n const readOnly = options?.readOnly ?? false\n const key = cacheKey(readOnly)\n const now = Date.now()\n const hit = cache.get(key)\n if (hit && now - hit.fetchedAt < TOKEN_TTL_MS) {\n return hit.token\n }\n\n const pending = inFlight.get(key)\n if (pending) return pending\n\n const next = docApi.getAccessToken({ readOnly }).then((token) => {\n cache.set(key, { token, fetchedAt: Date.now() })\n inFlight.delete(key)\n return token\n })\n\n inFlight.set(key, next)\n return next\n}\n\n/** Clear cached tokens (tests or after auth errors). */\nexport function clearGristAccessTokenCache(): void {\n cache.clear()\n inFlight.clear()\n}\n\n/**\n * `fetch()` against Grist's REST API with the doc access token attached.\n */\nexport async function fetchWithGristAuth(\n docApi: GristDocApi,\n path: string,\n init?: RequestInit & { readOnly?: boolean }\n): Promise<Response> {\n const readOnly = init?.readOnly ?? false\n let token: GristAccessToken\n try {\n token = await getGristAccessToken(docApi, { readOnly })\n } catch (err) {\n clearGristAccessTokenCache()\n throw err\n }\n\n const isAbsolute = /^https?:\\/\\//i.test(path)\n const cleanPath = isAbsolute ? path : path.startsWith(\"/\") ? path : `/${path}`\n\n const url = isAbsolute\n ? new URL(path)\n : new URL(`${token.baseUrl.replace(/\\/$/, \"\")}${cleanPath}`)\n\n // Grist signs widget REST calls with a short-lived `auth` query parameter.\n // Do not send `Authorization: Bearer` from the browser: many Grist deployments\n // omit it from Access-Control-Allow-Headers, which breaks POST (e.g. attachment upload).\n if (!url.searchParams.has(\"auth\")) url.searchParams.set(\"auth\", token.token)\n\n const headers = new Headers(init?.headers ?? {})\n headers.delete(\"Authorization\")\n\n const response = await fetch(url.toString(), { ...init, headers })\n if (response.status === 401) {\n clearGristAccessTokenCache()\n const retryToken = await getGristAccessToken(docApi, { readOnly })\n url.searchParams.set(\"auth\", retryToken.token)\n return fetch(url.toString(), { ...init, headers })\n }\n return response\n}\n","import { useCallback, useMemo, useSyncExternalStore } from \"react\"\n\nimport type { GristDocApi, GristReadyOptions } from \"../../types\"\nimport {\n deriveCapabilities,\n deriveErrorMessage,\n deriveStatus,\n initialGristSnapshot,\n type GristCapabilities,\n type GristWidgetSnapshot,\n type GristWidgetStatus as HandshakeStatus,\n} from \"../handshake\"\nimport type { ManagerControls } from \"../handshake/manager\"\nimport { useGristManager } from \"../handshake-manager-context\"\n\n/** Canonical 4-state status — projected from the handshake snapshot. */\nexport type GristWidgetStatus = HandshakeStatus\n\nexport type UseGristCoreOptions = GristReadyOptions & {\n availabilityMaxAttempts?: number\n availabilityIntervalMs?: number\n logWhenNotEmbedded?: boolean\n}\n\nexport type UseGristCoreResult = {\n status: GristWidgetStatus\n isAvailable: boolean | null\n isReady: boolean\n error: string | null\n docApi: GristDocApi | null\n /** Derived from the handshake snapshot — same values as `useGristCapabilities()` on `/advanced`. */\n capabilities: GristCapabilities\n reload: () => Promise<void>\n}\n\n/** Project handshake availability for legacy `isAvailable` consumers. */\nexport function computeAvailabilityFromSnapshot(\n snapshot: GristWidgetSnapshot\n): boolean | null {\n const { phase } = snapshot.lifecycle\n if (phase === \"idle\" || phase === \"detecting\") return null\n if (phase === \"terminated\") {\n const reason = snapshot.lifecycle.reason.kind\n if (reason === \"not_embedded\" || reason === \"script_timeout\") return false\n return true\n }\n return true\n}\n\n/**\n * Core connectivity hook — always backed by {@link GristHandshakeManager}.\n */\nexport function useGristCore(options?: UseGristCoreOptions): UseGristCoreResult {\n const manager = useGristManager(options)\n return useGristCoreFromManager(manager)\n}\n\n/**\n * Subscribe to an existing manager and project its snapshot into\n * {@link UseGristCoreResult}.\n */\nexport function useGristCoreFromManager(manager: ManagerControls): UseGristCoreResult {\n const snapshot = useSyncExternalStore(\n manager.subscribe,\n manager.getSnapshot,\n initialGristSnapshot\n )\n const status = deriveStatus(snapshot)\n const error = deriveErrorMessage(snapshot)\n const docApi = useMemo<GristDocApi | null>(() => {\n if (snapshot.lifecycle.phase !== \"online\") return null\n if (typeof grist === \"undefined\") return null\n return grist.docApi ?? null\n }, [snapshot.lifecycle.phase, snapshot.generation])\n const isAvailable = computeAvailabilityFromSnapshot(snapshot)\n const reload = useCallback(async () => {\n manager.reload()\n }, [manager])\n const capabilities = useMemo(() => deriveCapabilities(snapshot), [snapshot])\n return useMemo(\n () => ({\n status,\n isAvailable,\n isReady: status === \"ready\",\n error,\n docApi,\n capabilities,\n reload,\n }),\n [status, isAvailable, error, docApi, capabilities, reload]\n )\n}\n","/**\n * Internal context that hosts the shared {@link GristHandshakeManager} for a\n * widget subtree.\n *\n * - `<GristWidgetProvider>` publishes the manager via\n * {@link GristHandshakeManagerContext}.\n * - Standalone `useGrist()` / mid-level hooks without a provider acquire the\n * page-level embedded manager ({@link acquireEmbeddedHandshakeManager}).\n *\n * All SDK hooks call {@link useGristManager} — there is no pre-FSM fallback.\n */\n\nimport { createContext, useContext, useEffect, useRef } from \"react\"\n\nimport { buildManagerOptionsFromGristOptions, type BuildManagerOptionsInput } from \"./build-manager-options\"\nimport {\n acquireEmbeddedHandshakeManager,\n releaseEmbeddedHandshakeManager,\n} from \"./embedded-handshake-manager\"\nimport type { ManagerControls } from \"./handshake/manager\"\n\nexport const GristHandshakeManagerContext = createContext<ManagerControls | null>(null)\n\n/** Read the manager from context. Returns `null` outside a provider. */\nexport function useGristManagerOptional(): ManagerControls | null {\n return useContext(GristHandshakeManagerContext)\n}\n\n/**\n * Returns the active handshake manager for this React tree.\n *\n * Inside `<GristWidgetProvider>` this is the provider's manager. Otherwise a\n * single ref-counted embedded manager is shared across all standalone hook\n * instances on the page.\n */\nexport function useGristManager(options?: BuildManagerOptionsInput): ManagerControls {\n const fromProvider = useContext(GristHandshakeManagerContext)\n const optionsRef = useRef(options)\n optionsRef.current = options\n\n const embeddedRef = useRef<ManagerControls | null>(null)\n const ownsEmbeddedRef = useRef(false)\n\n // Same deliberate exception as useGrist() above: whether a manager comes\n // from a provider is fixed per mounted instance, not a per-render\n // condition -- the early return below is structurally invariant.\n if (fromProvider) {\n return fromProvider\n }\n\n if (embeddedRef.current === null) {\n embeddedRef.current = acquireEmbeddedHandshakeManager(\n buildManagerOptionsFromGristOptions(optionsRef.current)\n )\n ownsEmbeddedRef.current = true\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!ownsEmbeddedRef.current) return\n return () => {\n releaseEmbeddedHandshakeManager()\n embeddedRef.current = null\n ownsEmbeddedRef.current = false\n }\n }, [])\n\n return embeddedRef.current\n}\n","import type { ManagerOptions } from \"./handshake/manager\"\nimport { ensureGristReady, resetGristReadySingleton } from \"./ready-singleton\"\nimport type { GristReadyOptions } from \"../types\"\n\nexport type BuildManagerOptionsInput = GristReadyOptions & {\n availabilityMaxAttempts?: number\n availabilityIntervalMs?: number\n logWhenNotEmbedded?: boolean\n}\n\n/**\n * Map public widget options to {@link ManagerOptions} for\n * {@link createGristHandshakeManager}.\n */\nexport function buildManagerOptionsFromGristOptions(\n options?: BuildManagerOptionsInput\n): ManagerOptions {\n const opts: ManagerOptions = {\n requiredAccess: options?.requiredAccess ?? \"read table\",\n columns: options?.columns ?? [],\n allowSelectBy: options?.allowSelectBy,\n hasCustomOptions: options?.hasCustomOptions,\n onEditOptions: options?.onEditOptions,\n negotiate: {\n readyImpl: (payload) => ensureGristReady(payload),\n },\n onBeforeReload: () => resetGristReadySingleton(),\n }\n if (\n options?.availabilityMaxAttempts !== undefined ||\n options?.availabilityIntervalMs !== undefined\n ) {\n const interval = options?.availabilityIntervalMs ?? 1000\n const max = options?.availabilityMaxAttempts ?? 10\n opts.detect = {\n pollSequenceMs: Array.from({ length: max }, () => interval),\n budgetMs: interval * max,\n }\n }\n return opts\n}\n","import { useGristCore } from \"../internal/hooks/use-grist-core\"\nimport type { GristDocApi, GristReadyOptions } from \"../types\"\n\nexport type UseGristReadyOptions = GristReadyOptions & {\n availabilityMaxAttempts?: number\n availabilityIntervalMs?: number\n logWhenNotEmbedded?: boolean\n}\n\nexport type UseGristReadyResult = {\n isAvailable: boolean | null\n docApi: GristDocApi | null\n error: string | null\n reload: () => Promise<void>\n}\n\n/**\n * Handshake-backed `grist.ready` — delegates to {@link useGristCore} (FSM).\n *\n * Prefer `<GristWidgetProvider>` + `useGrist()` for full widget state; use this\n * hook when you only need `docApi` and connection status.\n */\nexport function useGristReady(options?: UseGristReadyOptions): UseGristReadyResult {\n const { isAvailable, docApi, error, reload } = useGristCore(options)\n return { isAvailable, docApi, error, reload }\n}\n","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\"\n\nimport {\n useGristSelectionContext,\n useGristWidgetOptionsApiContext,\n} from \"../internal/contexts\"\n\nexport type UseGristWidgetOptionsFromContextConfig<T> = {\n /** Default values returned before Grist responds and merged with stored options. */\n defaults: T\n /** Debounce window for `setOptions` writes (ms). Default: 250. */\n debounceMs?: number\n /**\n * Optional namespace key. When set, this hook reads/writes\n * `options[namespace]` instead of the whole options blob.\n */\n namespace?: string\n}\n\nexport type UseGristWidgetOptionsFromContextResult<T> = {\n options: T\n /** True until Grist has responded with the initial `onOptions` payload. */\n loading: boolean\n /** Replace the options object (debounced write to Grist). */\n setOptions: (next: T) => void\n /** Patch a subset of keys (debounced write to Grist). */\n patchOptions: (patch: Partial<T>) => void\n /** Reset to `defaults` (immediate write to Grist). */\n reset: () => Promise<void>\n}\n\nfunction mergeWithDefaults<T>(defaults: T, stored: unknown, namespace?: string): T {\n if (stored === null || stored === undefined) return { ...defaults }\n const source = (namespace ? (stored as Record<string, unknown>)[namespace] : stored) as Partial<T> | undefined\n if (!source || typeof source !== \"object\") return { ...defaults }\n return { ...defaults, ...source }\n}\n\n/**\n * Typed widget options hook designed for use **inside a `<GristWidgetProvider>`**.\n *\n * Unlike `useGristWidgetOptions()` (which calls `useGristReady()` and conflicts\n * with the provider), this hook reads from the provider's existing context —\n * `widgetOptions` for reactive reads, and `patchWidgetOptions` / `setWidgetOptions`\n * for writes.\n *\n * ```tsx\n * function MyConfigPanel() {\n * const { options, patchOptions } = useGristWidgetOptionsFromContext({\n * defaults: { color: '#FF0000', showLabels: true },\n * })\n * return <input value={options.color} onChange={e => patchOptions({ color: e.target.value })} />\n * }\n * ```\n */\nexport function useGristWidgetOptionsFromContext<T extends Record<string, unknown>>(\n config: UseGristWidgetOptionsFromContextConfig<T>\n): UseGristWidgetOptionsFromContextResult<T> {\n const debounceMs = config.debounceMs ?? 250\n const selection = useGristSelectionContext()\n const optionsApi = useGristWidgetOptionsApiContext()\n\n const defaultsRef = useRef(config.defaults)\n useEffect(() => {\n defaultsRef.current = config.defaults\n }, [config.defaults])\n\n const rawOptions = selection.widgetOptions\n const hasReceived = rawOptions !== null\n\n const merged = useMemo(\n () => mergeWithDefaults(defaultsRef.current, rawOptions, config.namespace),\n [rawOptions, config.namespace]\n )\n\n const [localOverride, setLocalOverride] = useState<T | null>(null)\n const options = localOverride ?? merged\n\n useEffect(() => {\n setLocalOverride(null)\n }, [rawOptions])\n\n const debounceRef = useRef<number | null>(null)\n\n const flushWrite = useCallback(\n async (value: T) => {\n if (config.namespace) {\n await optionsApi.setWidgetOption(config.namespace, value)\n } else {\n await optionsApi.setWidgetOptions({ ...value })\n }\n },\n [config.namespace, optionsApi]\n )\n\n const scheduleWrite = useCallback(\n (value: T) => {\n if (debounceRef.current) window.clearTimeout(debounceRef.current)\n debounceRef.current = window.setTimeout(() => {\n debounceRef.current = null\n void flushWrite(value)\n }, debounceMs)\n },\n [debounceMs, flushWrite]\n )\n\n useEffect(() => {\n return () => {\n if (debounceRef.current) window.clearTimeout(debounceRef.current)\n }\n }, [])\n\n const setOptions = useCallback(\n (next: T) => {\n setLocalOverride(next)\n scheduleWrite(next)\n },\n [scheduleWrite]\n )\n\n const patchOptions = useCallback(\n (patch: Partial<T>) => {\n setLocalOverride((prev) => {\n const base = prev ?? merged\n const next = { ...base, ...patch }\n scheduleWrite(next)\n return next\n })\n },\n [merged, scheduleWrite]\n )\n\n const reset = useCallback(async () => {\n if (debounceRef.current) {\n window.clearTimeout(debounceRef.current)\n debounceRef.current = null\n }\n const next = { ...defaultsRef.current }\n setLocalOverride(null)\n await flushWrite(next)\n }, [flushWrite])\n\n return useMemo(\n () => ({\n options,\n loading: !hasReceived,\n setOptions,\n patchOptions,\n reset,\n }),\n [options, hasReceived, setOptions, patchOptions, reset]\n )\n}\n","import { createContext, useContext, useMemo, type Context } from \"react\"\n\nimport type { ComposedGristWidgetSlices } from \"./compose-grist-widget\"\nimport { mergeGristResultFromSlices } from \"./merge-grist-result\"\nimport type { UseGristResult } from \"../use-grist-types\"\nimport type { UseGristAttachmentsRestResult } from \"./hooks/use-grist-attachments-rest\"\nimport type { UseGristCoreResult } from \"./hooks/use-grist-core\"\nimport type { UseGristCurrentTableResult } from \"./hooks/use-grist-current-table\"\nimport type { UseGristLinkingResult } from \"./hooks/use-grist-linking\"\nimport type { UseGristReadsResult } from \"./hooks/use-grist-reads\"\nimport type { UseGristSectionApiResult } from \"./hooks/use-grist-section-api\"\nimport type { UseGristSelectionResult } from \"./hooks/use-grist-selection\"\nimport type { UseGristTableOpsBoundResult } from \"./hooks/use-grist-table-ops-bound\"\nimport type { UseGristThemeResult } from \"./hooks/use-grist-theme\"\nimport type { UseGristWidgetOptionsApiResult } from \"./hooks/use-grist-widget-options-api\"\n\nexport type GristCoreContextValue = UseGristCoreResult & {\n tableError: string | null\n}\n\nexport type GristStatusSliceValue = GristCoreContextValue & UseGristCurrentTableResult\n\nexport const GristCoreContext = createContext<GristCoreContextValue | null>(null)\nexport const GristSelectionContext = createContext<UseGristSelectionResult | null>(null)\nexport const GristCurrentTableContext = createContext<UseGristCurrentTableResult | null>(null)\nexport const GristWritesContext = createContext<UseGristTableOpsBoundResult | null>(null)\nexport const GristReadsContext = createContext<UseGristReadsResult | null>(null)\nexport const GristWidgetOptionsApiContext = createContext<UseGristWidgetOptionsApiResult | null>(null)\nexport const GristLinkingContext = createContext<UseGristLinkingResult | null>(null)\nexport const GristAttachmentsRestContext = createContext<UseGristAttachmentsRestResult | null>(null)\nexport const GristThemeContext = createContext<UseGristThemeResult | null>(null)\nexport const GristSectionApiContext = createContext<UseGristSectionApiResult | null>(null)\n\nfunction useRequiredContext<T>(ctx: Context<T | null>, name: string): T {\n const value = useContext(ctx)\n if (!value) {\n throw new Error(`${name} must be used inside <GristWidgetProvider>`)\n }\n return value\n}\n\nexport function useGristCoreContext(): GristCoreContextValue {\n return useRequiredContext(GristCoreContext, \"useGristCoreContext()\")\n}\n\nexport function useGristSelectionContext<\n TRow = Record<string, unknown>,\n TMapped = Record<string, unknown>,\n>(): UseGristSelectionResult<TRow, TMapped> {\n return useRequiredContext(GristSelectionContext, \"useGristSelectionContext()\") as UseGristSelectionResult<\n TRow,\n TMapped\n >\n}\n\nexport function useGristCurrentTableContext(): UseGristCurrentTableResult {\n return useRequiredContext(GristCurrentTableContext, \"useGristCurrentTableContext()\")\n}\n\nexport function useGristWritesContext(): UseGristTableOpsBoundResult {\n return useRequiredContext(GristWritesContext, \"useGristWritesContext()\")\n}\n\nexport function useGristReadsContext(): UseGristReadsResult {\n return useRequiredContext(GristReadsContext, \"useGristReadsContext()\")\n}\n\nexport function useGristWidgetOptionsApiContext(): UseGristWidgetOptionsApiResult {\n return useRequiredContext(GristWidgetOptionsApiContext, \"useGristWidgetOptionsApiContext()\")\n}\n\nexport function useGristLinkingContext(): UseGristLinkingResult {\n return useRequiredContext(GristLinkingContext, \"useGristLinkingContext()\")\n}\n\nexport function useGristAttachmentsRestContext(): UseGristAttachmentsRestResult {\n return useRequiredContext(GristAttachmentsRestContext, \"useGristAttachmentsRestContext()\")\n}\n\nexport function useGristThemeContext(): UseGristThemeResult {\n return useRequiredContext(GristThemeContext, \"useGristThemeContext()\")\n}\n\nexport function useGristSectionApiContext(): UseGristSectionApiResult {\n return useRequiredContext(GristSectionApiContext, \"useGristSectionApiContext()\")\n}\n\n/**\n * Live merge of all provider slices — used by `useGrist()` / `useGristContext()` so\n * cursor-driven `onRecord` updates are not lost behind a stale memoized snapshot.\n */\nexport function useGristFromProvider<\n TRow = Record<string, unknown>,\n TMapped = Record<string, unknown>,\n>(): UseGristResult<TRow, TMapped> {\n const core = useGristCoreContext()\n const selection = useGristSelectionContext<TRow, TMapped>()\n const currentTable = useGristCurrentTableContext()\n const writes = useGristWritesContext()\n const reads = useGristReadsContext()\n const widgetOptionsApi = useGristWidgetOptionsApiContext()\n const linking = useGristLinkingContext()\n const attachmentsRest = useGristAttachmentsRestContext()\n const theme = useGristThemeContext()\n const sectionApi = useGristSectionApiContext()\n\n return useMemo(\n () =>\n mergeGristResultFromSlices<TRow, TMapped>({\n core,\n selection,\n currentTable,\n writes,\n reads,\n widgetOptionsApi,\n linking,\n attachmentsRest,\n theme,\n sectionApi,\n } as ComposedGristWidgetSlices),\n [\n core,\n selection,\n currentTable,\n writes,\n reads,\n widgetOptionsApi,\n linking,\n attachmentsRest,\n theme,\n sectionApi,\n ]\n )\n}\n","import type { ComposedGristWidgetSlices } from \"./compose-grist-widget\"\nimport type { UseGristResult } from \"../use-grist-types\"\n\nexport function mergeGristResultFromSlices<TRow = Record<string, unknown>, TMapped = Record<string, unknown>>(\n slices: ComposedGristWidgetSlices\n): UseGristResult<TRow, TMapped> {\n const { core, selection, currentTable, writes, reads, widgetOptionsApi, linking, attachmentsRest, theme, sectionApi, suppressAlerts, allowSelectBy } =\n slices\n return {\n status: core.status,\n isAvailable: core.isAvailable,\n isReady: core.isReady,\n error: core.error,\n capabilities: core.capabilities,\n record: selection.record as UseGristResult<TRow, TMapped>[\"record\"],\n records: selection.records as UseGristResult<TRow, TMapped>[\"records\"],\n mappedRecord: selection.mappedRecord as TMapped | null,\n mappings: selection.mappings,\n recordsMappings: selection.recordsMappings,\n columnMappingStatus: selection.columnMappingStatus,\n mode: selection.mode,\n resolveMappedColumnId: selection.resolveMappedColumnId,\n mapBack: selection.mapBack as (patch: Partial<TMapped>) => Record<string, unknown>,\n mapBackSkipped: selection.mapBackSkipped,\n isNewRecord: selection.isNewRecord,\n newRecordMappings: selection.newRecordMappings,\n currentTableId: currentTable.currentTableId,\n currentTableLoading: currentTable.currentTableLoading,\n refreshCurrentTable: currentTable.refreshCurrentTable,\n table: writes.table,\n getTable: writes.getTable,\n actionStatus: writes.actionStatus,\n actionError: writes.actionError,\n applyActions: writes.applyActions,\n reload: core.reload,\n fetchTable: reads.fetchTable,\n fetchTableRows: reads.fetchTableRows,\n fetchRow: reads.fetchRow,\n listTables: reads.listTables,\n listColumns: reads.listColumns,\n getDocName: reads.getDocName,\n buildReplicaDocumentFromDocApi: reads.buildReplicaDocumentFromDocApi,\n getAttachmentUrl: attachmentsRest.getAttachmentUrl,\n fetchAttachmentBase64: attachmentsRest.fetchAttachmentBase64,\n fetchAttachmentBlob: attachmentsRest.fetchAttachmentBlob,\n widgetOptions: selection.widgetOptions,\n widgetInteraction: selection.widgetInteraction,\n getWidgetOptions: widgetOptionsApi.getWidgetOptions,\n getWidgetOption: widgetOptionsApi.getWidgetOption,\n setWidgetOption: widgetOptionsApi.setWidgetOption,\n setWidgetOptions: widgetOptionsApi.setWidgetOptions,\n patchWidgetOptions: widgetOptionsApi.patchWidgetOptions,\n clearWidgetOptions: widgetOptionsApi.clearWidgetOptions,\n fetchSelectedTable: reads.fetchSelectedTable,\n fetchSelectedRecord: reads.fetchSelectedRecord,\n readError: reads.readError ?? attachmentsRest.readError,\n setCursorPosition: linking.setCursorPosition,\n setLinkedRowSelection: linking.setLinkedRowSelection,\n getAccessToken: attachmentsRest.getAccessToken,\n fetchWithAuth: attachmentsRest.fetchWithAuth,\n uploadAttachment: attachmentsRest.uploadAttachment,\n theme: theme.theme,\n configure: sectionApi.configure,\n refreshMappings: sectionApi.refreshMappings,\n suppressAlerts,\n allowSelectBy,\n }\n}\n","/**\n * `useRpcHeartbeatCoalesce()` — coalesce real RPC traffic with the handshake\n * heartbeat.\n *\n * When a {@link GristHandshakeManager} is mounted (via `<GristWidgetProvider>`\n * or `<GristHandshakeProvider>`), every successful Grist RPC call is treated\n * as a natural heartbeat: the manager's `recordRpcSuccess()` resets the\n * missed-ping counter and pushes the next probe out by a full interval, so\n * a chatty widget never burns dedicated heartbeat probes.\n *\n * Failures are NOT coalesced: semantic errors (validation, \"row not found\",\n * \"no such column\") would briefly flash a connection-degraded indicator even\n * though the channel is alive. Instead we let the regular heartbeat probe\n * detect real transport failures on its own schedule (~30 s). The user\n * already sees the action error immediately, so the heartbeat indicator\n * doesn't need to race.\n *\n * Outside a provider (no manager in context), the wrapper is a zero-cost\n * passthrough — every slice hook keeps working exactly like the pre-FSM\n * release.\n */\n\nimport { useCallback } from \"react\"\n\nimport { useGristManagerOptional } from \"../handshake-manager-context\"\n\nexport type RpcHeartbeatCoalesce = <T>(fn: () => Promise<T>) => Promise<T>\n\nexport function useRpcHeartbeatCoalesce(): RpcHeartbeatCoalesce {\n const manager = useGristManagerOptional()\n return useCallback<RpcHeartbeatCoalesce>(\n async (fn) => {\n // No catch here, deliberately -- see the module docstring: failures\n // are not coalesced, so a rejection just propagates as-is.\n const result = await fn()\n manager?.recordRpcSuccess()\n return result\n },\n [manager]\n )\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,eAAe;AACrB,IAAM,QAAQ,oBAAI,IAA6B;AAC/C,IAAM,WAAW,oBAAI,IAAuC;AAE5D,SAAS,SAAS,UAA2B;AAC3C,SAAO,WAAW,OAAO;AAC3B;AAMA,eAAsB,oBACpB,QACA,SAC2B;AAC3B,MAAI,CAAC,OAAO,gBAAgB;AAC1B,UAAM,IAAI,MAAM,sEAAsE;AAAA,EACxF;AAEA,QAAM,WAAW,SAAS,YAAY;AACtC,QAAM,MAAM,SAAS,QAAQ;AAC7B,QAAM,MAAM,KAAK,IAAI;AACrB,QAAM,MAAM,MAAM,IAAI,GAAG;AACzB,MAAI,OAAO,MAAM,IAAI,YAAY,cAAc;AAC7C,WAAO,IAAI;AAAA,EACb;AAEA,QAAM,UAAU,SAAS,IAAI,GAAG;AAChC,MAAI,QAAS,QAAO;AAEpB,QAAM,OAAO,OAAO,eAAe,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC,UAAU;AAC/D,UAAM,IAAI,KAAK,EAAE,OAAO,WAAW,KAAK,IAAI,EAAE,CAAC;AAC/C,aAAS,OAAO,GAAG;AACnB,WAAO;AAAA,EACT,CAAC;AAED,WAAS,IAAI,KAAK,IAAI;AACtB,SAAO;AACT;AAGO,SAAS,6BAAmC;AACjD,QAAM,MAAM;AACZ,WA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;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AAEA,QAAM,eAAeA;AAAA,IACnB,CAAC,UAAsB;AACrB,uBAAiB,CAAC,SAAS;AACzB,cAAM,OAAO,QAAQ;AACrB,cAAM,OAAO,EAAE,GAAG,MAAM,GAAG,MAAM;AACjC,sBAAc,IAAI;AAClB,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,IACA,CAAC,QAAQ,aAAa;AAAA,EACxB;AAEA,QAAM,QAAQA,aAAY,YAAY;AACpC,QAAI,YAAY,SAAS;AACvB,aAAO,aAAa,YAAY,OAAO;AACvC,kBAAY,UAAU;AAAA,IACxB;AACA,UAAM,OAAO,EAAE,GAAG,YAAY,QAAQ;AACtC,qBAAiB,IAAI;AACrB,UAAM,WAAW,IAAI;AAAA,EACvB,GAAG,CAAC,UAAU,CAAC;AAEf,SAAOD;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA,SAAS,CAAC;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,SAAS,aAAa,YAAY,cAAc,KAAK;AAAA,EACxD;AACF;;;AGlIA,SAAS,eAAAE,oBAAmB;AAMrB,SAAS,0BAAgD;AAC9D,QAAM,UAAU,wBAAwB;AACxC,SAAOC;AAAA,IACL,OAAO,OAAO;AAGZ,YAAM,SAAS,MAAM,GAAG;AACxB,eAAS,iBAAiB;AAC1B,aAAO;AAAA,IACT;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AACF;","names":["useCallback","useEffect","useMemo","useRef","createContext","useContext","useMemo","createContext","useContext","useMemo","useRef","useEffect","useMemo","useCallback","useCallback","useCallback"]}
|