grist-widget-sdk 0.3.25 → 0.3.26

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/advanced.d.cts +3 -2
  3. package/dist/advanced.d.ts +3 -2
  4. package/dist/app.cjs +5176 -0
  5. package/dist/app.cjs.map +1 -0
  6. package/dist/app.d.cts +147 -0
  7. package/dist/app.d.ts +147 -0
  8. package/dist/app.js +527 -0
  9. package/dist/app.js.map +1 -0
  10. package/dist/chunk-PDGEZ24B.js +2366 -0
  11. package/dist/chunk-PDGEZ24B.js.map +1 -0
  12. package/dist/{create-grist-emulator-_3_JK7Rr.d.ts → create-grist-emulator-BCqp1BF9.d.ts} +2 -2
  13. package/dist/{create-grist-emulator-K-iUKUCZ.d.cts → create-grist-emulator-DBM8OSIR.d.cts} +2 -2
  14. package/dist/emulator/testing.d.cts +2 -2
  15. package/dist/emulator/testing.d.ts +2 -2
  16. package/dist/emulator/transports.d.cts +3 -3
  17. package/dist/emulator/transports.d.ts +3 -3
  18. package/dist/emulator.d.cts +5 -5
  19. package/dist/emulator.d.ts +5 -5
  20. package/dist/index.d.cts +9 -500
  21. package/dist/index.d.ts +9 -500
  22. package/dist/index.js +57 -2291
  23. package/dist/index.js.map +1 -1
  24. package/dist/{inline-A8yaddmp.d.cts → inline-C7DkvuET.d.cts} +1 -1
  25. package/dist/{inline-B7QQeWul.d.ts → inline-DpcT8tV9.d.ts} +1 -1
  26. package/dist/{templates-CB_VwjEU.d.cts → templates-8k2LKoO-.d.cts} +1 -1
  27. package/dist/{templates-pRIXc2RR.d.ts → templates-DIwi_mvI.d.ts} +1 -1
  28. package/dist/{types-YcRfo7oy.d.cts → types-D3JxUCfL.d.cts} +1 -1
  29. package/dist/{types-YcRfo7oy.d.ts → types-D3JxUCfL.d.ts} +1 -1
  30. package/dist/{use-grist-widget-options-from-context-hl-NwOwP.d.ts → use-grist-reads-DUMvJgV7.d.ts} +3 -44
  31. package/dist/{use-grist-widget-options-from-context-Bbd5-f39.d.cts → use-grist-reads-DpjVuI0H.d.cts} +3 -44
  32. package/dist/use-grist-types-DdOLEJXN.d.cts +499 -0
  33. package/dist/use-grist-types-kwxoFeub.d.ts +499 -0
  34. package/dist/use-grist-widget-options-from-context-CGOlQ5Vc.d.cts +43 -0
  35. package/dist/use-grist-widget-options-from-context-CGOlQ5Vc.d.ts +43 -0
  36. package/package.json +11 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # grist-widget-sdk
2
2
 
3
+ ## 0.3.26
4
+
5
+ ### Patch Changes
6
+
7
+ - acc1501: New entry point, `grist-widget-sdk/app`: `mountGristWidget({ App, options, dev })` does what a widget's `src/main.tsx` used to wire by hand.
8
+
9
+ - **Inside Grist** it renders the widget in `GristWidgetProvider` and `GristBoundary`, gated on mapped columns when the widget declares any, with the SDK's alerts above it (column mapping, access level, failed writes, an unlinked section). `App` may be a `React.lazy()` component, so a heavy widget's code loads only inside Grist.
10
+ - **Outside Grist** it shows a local-dev page on the dev server, pointing at `pnpm test` and the `dev` loop, and a release page on a deployed URL, linking every channel and version with the URL to paste into Grist. Both are named after the page's `<title>`.
11
+ - **The theme**: inside Grist the widget now follows Grist's light/dark theme (the OS setting until Grist sends it); outside Grist the OS setting applies, a choice made with `setTheme()` is saved, and the `d` key switches themes, as shadcn's theme provider does. `useTheme()` has the shape of shadcn's, for components such as a toaster.
12
+
13
+ The pages and alerts read shadcn's CSS variables (`--background`, `--foreground`, `--border`, `--radius`, …) with neutral fallbacks, so they follow a widget's theme without depending on its Tailwind config, and each one is replaceable (`Alerts`, or `Alerts: null`; `LocalDevPage`; `ReleasePage`). They only surround the widget: the SDK still styles nothing inside it. `<GristWidgetApp>` is the same tree as a component, for tests, and `parseDeployPath()`, `deployChannelLabel()` and `useReleasedVersions()` serve a custom release page.
14
+
3
15
  ## 0.3.25
4
16
 
5
17
  ### Patch Changes
@@ -1,9 +1,10 @@
1
- import { ab as GristTerminationReason, ac as GristGeneration, ad as GristMappingSource, G as GristWidgetSnapshot, d as GristCapabilities } from './use-grist-widget-options-from-context-Bbd5-f39.cjs';
1
+ import { a8 as GristTerminationReason, a9 as GristGeneration, aa as GristMappingSource, G as GristWidgetSnapshot, c as GristCapabilities } from './use-grist-reads-DpjVuI0H.cjs';
2
2
  import { UseGristCoreOptions, GristWidgetStatus, GristUserActionTuple, GristAccessToken, GristColumnarTable } from './index.cjs';
3
- export { ae as GristAuthz, h as GristColumnInfo, af as GristConfig, ag as GristCurrentTableState, ah as GristLifecycle, ai as GristLifecyclePhase, aj as GristLink, ak as GristLinkState, al as GristMappingComplete, am as GristMappingIncomplete, an as GristMappingState, ao as GristStreamFreshness, ap as GristSync, g as ListColumnsOptions, L as ListTablesOptions, v as UseGristWidgetOptionsFromContextConfig, w as UseGristWidgetOptionsFromContextResult, aa as useGristWidgetOptionsFromContext } from './use-grist-widget-options-from-context-Bbd5-f39.cjs';
3
+ export { ab as GristAuthz, e as GristColumnInfo, ac as GristConfig, ad as GristCurrentTableState, ae as GristLifecycle, af as GristLifecyclePhase, ag as GristLink, ah as GristLinkState, ai as GristMappingComplete, aj as GristMappingIncomplete, ak as GristMappingState, al as GristStreamFreshness, am as GristSync, L as ListColumnsOptions, r as ListTablesOptions } from './use-grist-reads-DpjVuI0H.cjs';
4
4
  import { GristRequiredAccess, GristColumnsToMap, GristWidgetColumnMap, GristReadyOptions, GristDocApi, GristApplyUserActionsOptions, GristTableNewRecord, GristTableOpOptions, GristMinimalRecord, GristTableUpdateRecord, GristTableUpsertRecord, GristTableUpsertOptions, GristRowRecord, GristFetchSelectedOptions } from './index.cjs';
5
5
  import * as react from 'react';
6
6
  import { ReactNode } from 'react';
7
+ export { U as UseGristWidgetOptionsFromContextConfig, a as UseGristWidgetOptionsFromContextResult, u as useGristWidgetOptionsFromContext } from './use-grist-widget-options-from-context-CGOlQ5Vc.cjs';
7
8
  import 'zod';
8
9
 
9
10
  /**
@@ -1,9 +1,10 @@
1
- import { ab as GristTerminationReason, ac as GristGeneration, ad as GristMappingSource, G as GristWidgetSnapshot, d as GristCapabilities } from './use-grist-widget-options-from-context-hl-NwOwP.js';
1
+ import { a8 as GristTerminationReason, a9 as GristGeneration, aa as GristMappingSource, G as GristWidgetSnapshot, c as GristCapabilities } from './use-grist-reads-DUMvJgV7.js';
2
2
  import { UseGristCoreOptions, GristWidgetStatus, GristUserActionTuple, GristAccessToken, GristColumnarTable } from './index.js';
3
- export { ae as GristAuthz, h as GristColumnInfo, af as GristConfig, ag as GristCurrentTableState, ah as GristLifecycle, ai as GristLifecyclePhase, aj as GristLink, ak as GristLinkState, al as GristMappingComplete, am as GristMappingIncomplete, an as GristMappingState, ao as GristStreamFreshness, ap as GristSync, g as ListColumnsOptions, L as ListTablesOptions, v as UseGristWidgetOptionsFromContextConfig, w as UseGristWidgetOptionsFromContextResult, aa as useGristWidgetOptionsFromContext } from './use-grist-widget-options-from-context-hl-NwOwP.js';
3
+ export { ab as GristAuthz, e as GristColumnInfo, ac as GristConfig, ad as GristCurrentTableState, ae as GristLifecycle, af as GristLifecyclePhase, ag as GristLink, ah as GristLinkState, ai as GristMappingComplete, aj as GristMappingIncomplete, ak as GristMappingState, al as GristStreamFreshness, am as GristSync, L as ListColumnsOptions, r as ListTablesOptions } from './use-grist-reads-DUMvJgV7.js';
4
4
  import { GristRequiredAccess, GristColumnsToMap, GristWidgetColumnMap, GristReadyOptions, GristDocApi, GristApplyUserActionsOptions, GristTableNewRecord, GristTableOpOptions, GristMinimalRecord, GristTableUpdateRecord, GristTableUpsertRecord, GristTableUpsertOptions, GristRowRecord, GristFetchSelectedOptions } from './index.js';
5
5
  import * as react from 'react';
6
6
  import { ReactNode } from 'react';
7
+ export { U as UseGristWidgetOptionsFromContextConfig, a as UseGristWidgetOptionsFromContextResult, u as useGristWidgetOptionsFromContext } from './use-grist-widget-options-from-context-CGOlQ5Vc.js';
7
8
  import 'zod';
8
9
 
9
10
  /**