@notionhq/custom-blocks-dev-shell 0.1.114 → 0.1.116

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 (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +108 -22
  3. package/THIRD_PARTY_LICENSES.md +133 -0
  4. package/bin/cli.js +3 -1
  5. package/dist/assets/index-DSaseWP_.js +11 -0
  6. package/dist/assets/index-Do-x8yIt.css +2 -0
  7. package/dist/index.html +2 -2
  8. package/dist-cli/cli/published-cli.js +8476 -0
  9. package/docs/bindings.md +84 -27
  10. package/docs/bridge/changelog.md +67 -0
  11. package/docs/bridge/protocol.md +204 -0
  12. package/docs/bridge/versioning.md +38 -0
  13. package/docs/data-sources.md +49 -36
  14. package/docs/host/README.md +177 -0
  15. package/docs/host/docs/compatibility.md +68 -0
  16. package/docs/host/docs/handlers.md +199 -0
  17. package/docs/host/docs/lifecycle.md +117 -0
  18. package/package.json +9 -28
  19. package/dist/assets/index-E1j3FxAu.css +0 -2
  20. package/dist/assets/index-F02ZboyS.js +0 -11
  21. package/dist-cli/block-csp.js +0 -84
  22. package/dist-cli/build-block-registry.js +0 -28
  23. package/dist-cli/convert-values.js +0 -222
  24. package/dist-cli/convert.js +0 -210
  25. package/dist-cli/data-sources.js +0 -167
  26. package/dist-cli/date-value.js +0 -46
  27. package/dist-cli/dev-shell-launcher.js +0 -226
  28. package/dist-cli/dev-shell-run.js +0 -72
  29. package/dist-cli/errors.js +0 -8
  30. package/dist-cli/materialize.js +0 -105
  31. package/dist-cli/ports.js +0 -20
  32. package/dist-cli/prebuilt.js +0 -23
  33. package/dist-cli/published-cli.js +0 -60
  34. package/dist-cli/resolve-bindings.js +0 -39
  35. package/dist-cli/runtime-error-client.js +0 -52
  36. package/dist-cli/serve-ui.js +0 -110
  37. package/dist-cli/shared-server.js +0 -70
  38. package/dist-cli/source-bindings.js +0 -17
  39. package/dist-cli/utils.js +0 -52
  40. package/dist-cli/vite-block-server.js +0 -125
  41. package/dist-cli/vite-middleware.js +0 -111
  42. package/dist-cli/worker-manifest.js +0 -141
@@ -0,0 +1,177 @@
1
+ # @notionhq/custom-blocks-host
2
+
3
+ The host manages the bridge between your application and a custom block iframe. Your application
4
+ owns the iframe, permissions, data access, persistence, analytics, and UI. Block authors use
5
+ `@notionhq/custom-blocks`.
6
+
7
+ Create the host before navigating the iframe. Pass the full block URL as `sandboxUrl`, and call
8
+ `stop()` when removing the iframe.
9
+
10
+ For configuration and lifecycle details, see [Initialization and lifecycle](docs/lifecycle.md).
11
+
12
+ ## Create a host
13
+
14
+ Install `@notionhq/custom-blocks-host` in your embedding application. Run this TypeScript through
15
+ your browser bundler after the document body exists.
16
+
17
+ This example embeds a block with no data sources and supplies fixed demo context. Replace
18
+ `https://blocks.example.com/hello` with your block's URL. Serve the block from a different origin
19
+ than the embedding application.
20
+
21
+ ```ts
22
+ import { createCustomBlockHost } from "@notionhq/custom-blocks-host"
23
+
24
+ function mountCustomBlock(container: HTMLElement, blockUrl: URL): () => void {
25
+ if (
26
+ !["http:", "https:"].includes(blockUrl.protocol) ||
27
+ blockUrl.origin === window.location.origin
28
+ ) {
29
+ throw new Error("The block needs an HTTP or HTTPS URL on a separate origin")
30
+ }
31
+
32
+ const wrapper = document.createElement("section")
33
+ const status = document.createElement("p")
34
+ status.setAttribute("role", "status")
35
+ status.textContent = "Loading block…"
36
+ const iframe = document.createElement("iframe")
37
+ iframe.title = "Hello custom block"
38
+ iframe.setAttribute("sandbox", "allow-scripts allow-same-origin")
39
+ iframe.allow = "clipboard-write"
40
+ iframe.style.width = "100%"
41
+ iframe.style.height = "300px"
42
+ iframe.style.visibility = "hidden"
43
+ wrapper.append(status, iframe)
44
+ container.append(wrapper)
45
+
46
+ function setHeight(height: number) {
47
+ iframe.style.height = `${Math.min(1200, Math.max(120, height))}px`
48
+ }
49
+
50
+ const host = createCustomBlockHost({
51
+ iframe,
52
+ sandboxUrl: blockUrl.href,
53
+ manifestSource: "host",
54
+ getPersistedManifest: async () => ({
55
+ status: "success",
56
+ manifest: { version: 1, dataSources: {} },
57
+ }),
58
+ prepareInitialState: async () => ({
59
+ status: "success",
60
+ initialState: {
61
+ theme: "light",
62
+ contrastMode: "standard",
63
+ blockId: "11111111-1111-4111-8111-111111111111",
64
+ parent: {
65
+ type: "page_id",
66
+ page_id: "22222222-2222-4222-8222-222222222222",
67
+ },
68
+ page: {
69
+ type: "page",
70
+ id: "22222222-2222-4222-8222-222222222222",
71
+ parent: { type: "workspace", workspace: true },
72
+ },
73
+ currentUser: {
74
+ object: "user",
75
+ id: "33333333-3333-4333-8333-333333333333",
76
+ name: "Demo viewer",
77
+ avatar_url: null,
78
+ type: "person",
79
+ person: { email: "viewer@example.com" },
80
+ },
81
+ dataSources: { bindings: {} },
82
+ },
83
+ }),
84
+ handlers: {
85
+ queryDataSource: () => ({
86
+ status: "error",
87
+ error: {
88
+ code: "unknown_data_source_key",
89
+ message: "This demo has no data sources.",
90
+ isRetryable: false,
91
+ },
92
+ }),
93
+ resize: message => setHeight(message.height),
94
+ },
95
+ onStatusChange: state => {
96
+ if (state.status === "initialized") {
97
+ setHeight(state.initialHeight ?? 300)
98
+ status.hidden = true
99
+ iframe.style.visibility = "visible"
100
+ } else if (state.status === "failed") {
101
+ iframe.style.visibility = "hidden"
102
+ status.hidden = false
103
+ status.textContent = `Block failed: ${state.error.code}`
104
+ }
105
+ },
106
+ onQueryUnsubscribed: undefined,
107
+ })
108
+
109
+ // The host must listen before the block starts its handshake.
110
+ iframe.src = blockUrl.href
111
+
112
+ return () => {
113
+ host.stop()
114
+ wrapper.remove()
115
+ }
116
+ }
117
+
118
+ const dispose = mountCustomBlock(document.body, new URL("https://blocks.example.com/hello"))
119
+ window.addEventListener("pagehide", dispose, { once: true })
120
+ ```
121
+
122
+ You should see “Loading block…” until the block completes initialization, then the block iframe. A
123
+ connection failure displays its error code. The example limits the iframe height to 120–1,200 CSS
124
+ pixels.
125
+
126
+ Call `dispose()` when your application removes the embed. To retry a failed connection or change the
127
+ block URL, dispose of the current embed and call `mountCustomBlock()` again.
128
+
129
+ For a production integration, replace the demo context and manifest with your application's values.
130
+ Supply data-source bindings and handlers for the APIs your block uses. Your application must enforce
131
+ permissions and record access.
132
+
133
+ To connect workspace data, see [Connect a data source](docs/handlers.md#connect-a-data-source).
134
+
135
+ ## Guides and reference
136
+
137
+ - [Initialization and lifecycle](docs/lifecycle.md): manifests, context, timeouts, live state, and
138
+ cleanup.
139
+ - [Handlers and data](docs/handlers.md): application handlers, data-source integration, queries, and
140
+ navigation.
141
+ - [Host compatibility](docs/compatibility.md): supported versions and response conversions.
142
+
143
+ The runtime handles the wire handshake and message validation. The shared protocol references cover
144
+ payload semantics, version rules, and contract history:
145
+
146
+ - [Wire protocol](../bridge/protocol.md)
147
+ - [Protocol versioning](../bridge/versioning.md)
148
+ - [Protocol changelog](../bridge/changelog.md)
149
+
150
+ ## Protocol schemas and types
151
+
152
+ The `/protocol` entrypoint exposes the protocol definitions bundled with this host release. It
153
+ provides message schemas and types, data shapes, IDs, error definitions, and protocol-version
154
+ constants.
155
+
156
+ Import these definitions through the host package to use the protocol version shipped with that
157
+ host:
158
+
159
+ ```ts
160
+ import {
161
+ sandboxToHostMessageSchema,
162
+ type SandboxToHostMessage,
163
+ } from "@notionhq/custom-blocks-host/protocol"
164
+ ```
165
+
166
+ `LATEST_BRIDGE_PROTOCOL_VERSION` identifies the latest bridge protocol version defined by the
167
+ bundled protocol.
168
+
169
+ Host APIs, configuration, handler results, and `*MessageInput` types are available from
170
+ `@notionhq/custom-blocks-host`.
171
+
172
+ These schemas validate wire payloads. Your application still enforces permissions.
173
+
174
+ ## Standalone browser module
175
+
176
+ `dist/browser.js` is one ES module with all dependencies. Use it when the browser must not fetch
177
+ additional modules, such as under an exact-URL Content Security Policy.
@@ -0,0 +1,68 @@
1
+ # Host compatibility
2
+
3
+ A host can update while deployed blocks keep older SDKs. The runtime accepts supported protocol
4
+ versions and converts current handler results to each block's declared contract. This reference
5
+ covers version admission, normalization, and the formats sent to older blocks. Protocol version
6
+ rules and release history are in the [versioning guide](../../bridge/versioning.md) and
7
+ [changelog](../../bridge/changelog.md).
8
+
9
+ ## Supported versions
10
+
11
+ The protocol subpath exports `LATEST_BRIDGE_PROTOCOL_VERSION` and
12
+ `MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION`. These constants define the package's latest known
13
+ protocol and runtime minimum. Embedders can raise the minimum but cannot enable retired versions.
14
+ The host admits future positive integer versions and validates them against known schemas. Admission
15
+ does not guarantee that future features work.
16
+
17
+ `sdkVersion` is analytics metadata. Compatibility behavior depends on the protocol version.
18
+
19
+ The current SDK declares protocol 8. The shared runtime minimum is 3. The dev shell uses the Worker
20
+ manifest in host mode and accepts the shared runtime's supported protocol versions. Protocols 7 and
21
+ 8 use the same page and query response formats. Protocol 8's local manifest declaration is selected
22
+ only in sandbox mode; host mode uses the persisted manifest. See the
23
+ [protocol 8 release entry](../../bridge/changelog.md#protocol-8-local-manifest-declarations).
24
+
25
+ The `minBridgeProtocolVersion` option defaults to the runtime minimum. Raising the option rejects
26
+ older SDKs for this embedding application. Lowering it cannot restore retired versions. Raising
27
+ `MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION` retires those versions across the runtime.
28
+
29
+ ## Host normalization
30
+
31
+ The host validates sandbox requests before dispatching them to handlers. Handlers use current data
32
+ shapes, and the host converts responses to the sandbox's declared protocol. Setters, query
33
+ refreshes, and handler responses use the same conversion. Unchanged messages and errors pass
34
+ through.
35
+
36
+ ## Current compatibility behavior
37
+
38
+ | Target | Query results | Page operation results | Binding schemas |
39
+ | ------ | --------------------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------ |
40
+ | 3–4 | Flat ID-keyed values, including synthetic metadata entries | ID-keyed properties with unsupported property objects omitted | Synthetic metadata read schemas restored in outgoing copies |
41
+ | 5 | Same query values as protocols 3–4 | Same page format as protocols 3–4 | Actual database schemas. The SDK supplies synthetic read schemas locally |
42
+ | 6 | Unified name-keyed properties. Text fallback property objects become `null` | Same unified page format | Actual database schemas |
43
+ | 7+ | Unified pages with typed text fallback properties | Same unified page format | Actual database schemas |
44
+
45
+ The synthetic metadata IDs are `created_time`, `last_edited_time`, `created_by`, and
46
+ `last_edited_by`. They retain metadata meaning if an actual property uses the same raw ID. This
47
+ matches the protocol 3–4 binding schema precedence. Host validation always uses the unmodified
48
+ actual database schema.
49
+
50
+ Release-specific compatibility limits are documented in the changelog entries for
51
+ [protocol 5 page context](../../bridge/changelog.md#protocol-5-unavailable-containing-page-context)
52
+ and
53
+ [protocol 6 text fallback properties](../../bridge/changelog.md#protocol-6-richer-fallback-properties).
54
+
55
+ ### Unavailable containing-page context
56
+
57
+ Protocols 3–4 receive `context_unavailable` during initialization or stop when containing-page
58
+ context becomes unavailable. This concerns `init.page` and `pageChanged.page`, not a page
59
+ operation's `page_unavailable` error.
60
+
61
+ ### Protocol 3–5 metadata query semantics
62
+
63
+ Page creation and edit metadata is readable without corresponding database columns. Current page
64
+ objects carry these fields at the top level. Protocol 3–5 query adapters copy them into
65
+ `propertiesById` for older SDKs.
66
+
67
+ Filters and sorts require actual database properties in the bound schema. The host does not support
68
+ queries against synthetic metadata IDs without corresponding database properties.
@@ -0,0 +1,199 @@
1
+ # Host handlers and data
2
+
3
+ Handlers connect block requests to your application's data access, persistence, and navigation. The
4
+ runtime validates bridge messages and manages subscriptions. Your application enforces viewer
5
+ permissions and implements the requested operations. This guide covers handler contracts, a
6
+ data-source example, refreshes, and external navigation.
7
+
8
+ The [dev shell](https://www.npmjs.com/package/@notionhq/custom-blocks-dev-shell) is a working host
9
+ implementation with local sample data. Use it as a reference for a larger integration. Production
10
+ hosts must provide their own permissions, data access, and persistence.
11
+
12
+ ## Handler contracts
13
+
14
+ `queryDataSource` is required. Other handlers are optional. Omitting a one-shot request handler
15
+ sends no response to that request. A handler returns a result synchronously or as a promise. Errors
16
+ carry `{ code, message, isRetryable }`, with open string codes.
17
+
18
+ Handler requests are validated messages with branded IDs. Initial state, setters, handler results,
19
+ and `*MessageInput` types accept plain string IDs. The runtime validates these inputs and applies
20
+ schema defaults. ID brands do not check record existence or access.
21
+
22
+ Query filters and sorts are validated against the actual bound database schema before
23
+ `queryDataSource` runs. See the [wire reference](../../bridge/protocol.md#data-sources) for
24
+ query semantics.
25
+
26
+ ## Connect a data source
27
+
28
+ Connect an embedded block to an in-memory Tasks data source with one numeric Estimate property. This
29
+ walkthrough extends the [README's embed example](../README.md#create-a-host): declare the data
30
+ source, bind its keys to IDs, return a query result, and refresh that result after a value changes.
31
+
32
+ Keep the iframe, context, and lifecycle callbacks from the embed example. The block must declare the
33
+ same manifest and query `tasks` through the SDK's public APIs.
34
+
35
+ ### Declare and bind the data source
36
+
37
+ The manifest uses block-defined keys. Bindings connect those keys to actual data-source and property
38
+ IDs. Add these definitions before creating the host:
39
+
40
+ ```ts
41
+ import type {
42
+ CustomBlockHostDataSourcesPayload,
43
+ CustomBlockHostHandlers,
44
+ } from "@notionhq/custom-blocks-host"
45
+ import type { BridgeCustomBlockManifest, BridgePage } from "@notionhq/custom-blocks-host/protocol"
46
+
47
+ const tasksId = "44444444-4444-4444-8444-444444444444"
48
+
49
+ const manifest: BridgeCustomBlockManifest = {
50
+ version: 1,
51
+ dataSources: {
52
+ tasks: {
53
+ name: "Tasks",
54
+ properties: {
55
+ estimate: { name: "Estimate", type: "number" },
56
+ },
57
+ },
58
+ },
59
+ }
60
+
61
+ const taskBindings: CustomBlockHostDataSourcesPayload = {
62
+ bindings: {
63
+ tasks: {
64
+ collectionPointer: { table: "collection", id: tasksId },
65
+ collectionSchema: {
66
+ propertiesById: {
67
+ "estimate-id": { name: "Estimate", type: "number" },
68
+ },
69
+ },
70
+ propertyIdsByKey: { estimate: "estimate-id" },
71
+ },
72
+ },
73
+ }
74
+ ```
75
+
76
+ In the embed example, return `{ status: "success", manifest }` from `getPersistedManifest` and
77
+ replace `initialState.dataSources` with `taskBindings`. Here, `tasks` and `estimate` are semantic
78
+ keys; `tasksId` and `estimate-id` identify the bound data source and property.
79
+
80
+ ### Return query results
81
+
82
+ Add this handler and use it as the embed example's `handlers.queryDataSource`. Keep its existing
83
+ `resize` handler.
84
+
85
+ ```ts
86
+ let estimate = 3
87
+
88
+ const handlers: CustomBlockHostHandlers = {
89
+ queryDataSource: message => {
90
+ if (message.dataSourceId !== tasksId) {
91
+ return {
92
+ status: "error",
93
+ error: {
94
+ code: "unmapped_data_source",
95
+ message: "This data source is not available.",
96
+ isRetryable: false,
97
+ },
98
+ }
99
+ }
100
+
101
+ if (message.filter || message.sorts?.length) {
102
+ return {
103
+ status: "error",
104
+ error: {
105
+ code: "invalid_data_source_query",
106
+ message: "This demo supports only unfiltered, unsorted queries.",
107
+ isRetryable: false,
108
+ },
109
+ }
110
+ }
111
+
112
+ const items: BridgePage[] = [
113
+ {
114
+ object: "page",
115
+ id: "55555555-5555-4555-8555-555555555555",
116
+ parent: { type: "data_source_id", data_source_id: tasksId },
117
+ is_archived: false,
118
+ in_trash: false,
119
+ properties: {
120
+ Estimate: { id: "estimate-id", type: "number", number: estimate },
121
+ },
122
+ },
123
+ ]
124
+
125
+ return {
126
+ status: "success",
127
+ items: items.slice(0, message.limit),
128
+ hasMore: items.length > message.limit,
129
+ }
130
+ },
131
+ }
132
+ ```
133
+
134
+ The SDK resolves `tasks` to `tasksId` before the host receives the request. Result properties use
135
+ display names as keys (`Estimate`) and include their raw property IDs (`estimate-id`). The runtime
136
+ handles subscription IDs, validates results, and converts them for supported older SDKs.
137
+
138
+ This demo rejects filters and sorts rather than silently ignoring them. A production adapter must
139
+ enforce record access, execute the requested filter and sorts, and honor the result limit. See
140
+ [query semantics](../../bridge/protocol.md#data-sources).
141
+
142
+ ## Refresh active queries
143
+
144
+ After creating the host, update the in-memory value and notify active subscriptions:
145
+
146
+ ```ts
147
+ estimate = 5
148
+ host.refreshQuery({ dataSourceId: tasksId })
149
+ ```
150
+
151
+ If the block has an active query for Tasks, its next result contains an estimate of `5`. A query
152
+ started later also reads the updated value. The application triggers refreshes when its underlying
153
+ data changes; the runtime re-runs matching subscriptions. Call `host.stop()` when removing the
154
+ embed.
155
+
156
+ `refreshQuery()` re-runs active subscriptions for the supplied data-source ID with their existing
157
+ filter, sorts, and limit. Overlapping refreshes queue one follow-up query. The running query
158
+ delivers its result first. Unsubscribe, replacement, and stop discard queued work and suppress late
159
+ results. Non-retryable query errors end subscriptions. Retryable errors retain them.
160
+
161
+ ## Page and user operations
162
+
163
+ `createPage`, `getPage`, and `updatePage` connect page requests to your application's data access
164
+ and persistence. `getUser` and `listUsers` supply user data. Each handler returns a success payload
165
+ or an error. The runtime adds the request's correlation ID and sends the response. The application
166
+ enforces record access before reading or writing data.
167
+
168
+ `openPage` handles navigation to a Notion page. `resize` receives the block's requested height in
169
+ CSS pixels. The application owns navigation and iframe sizing.
170
+
171
+ ## External navigation
172
+
173
+ `openExternalUrl` receives an `AbortSignal` and an absolute HTTP or HTTPS URL without credentials.
174
+ The URL is limited to 2,048 JavaScript code units before and after normalization. The adapter
175
+ displays the exact URL, obtains approval, and navigates only after approval. It may apply further
176
+ restrictions. Dismiss pending confirmation UI when the signal aborts.
177
+
178
+ Each iframe permits one pending navigation. A different request receives `pending_navigation`. A
179
+ duplicate of the active request is ignored. Completed requests are forgotten, so later requests
180
+ require fresh approval. The runtime redacts the URL from `onLog` payloads and suppresses results
181
+ after stop.
182
+
183
+ ## Property binding
184
+
185
+ `getAutoBoundPropertyIdsByKey({ manifestProperties, propertySchemasById })` requires matching
186
+ property types and either an exact raw ID match or a display-name match after trimming and
187
+ lowercasing. IDs are not trimmed or case-folded. Exactly one candidate creates a binding. Zero or
188
+ multiple candidates leave the property unmapped. The result maps manifest property keys to database
189
+ property IDs. An ID match has no priority over a name match: if they identify different compatible
190
+ properties, the manifest property stays unmapped.
191
+
192
+ ## Date conversion and types
193
+
194
+ `toNotionDateValue()` converts `NotionDateInput` into the four `CustomBlockDateValue` variants,
195
+ including reminders. Invalid input throws `InvalidNotionDateError`.
196
+
197
+ The root exports host configuration, handlers, results, and `*MessageInput` types. Wire schemas,
198
+ message and page types, and constants such as `LATEST_BRIDGE_PROTOCOL_VERSION` use the
199
+ [protocol subpath](../README.md#protocol-schemas-and-types).
@@ -0,0 +1,117 @@
1
+ # Host initialization and lifecycle
2
+
3
+ The host prepares a block's manifest and context, completes initialization, and manages the
4
+ connection until the iframe is removed. This reference covers state preparation, timeouts,
5
+ callbacks, live state, and cleanup. Start with the [embed example](../README.md#create-a-host).
6
+
7
+ ## Manifest and initial state
8
+
9
+ Pass the full block URL as `sandboxUrl`. The host derives the origin used to authenticate incoming
10
+ messages and target outgoing messages. `CustomBlockManifestSource` selects the manifest:
11
+
12
+ | `manifestSource` | Manifest source |
13
+ | ---------------- | ---------------------------------------------------------------------------------------------------------- |
14
+ | `"host"` | The manifest returned by `getPersistedManifest({ signal })` |
15
+ | `"sandbox"` | The local declaration supplied in `connect.manifest`, subject to the [local URL policy](#local-block-urls) |
16
+
17
+ `getPersistedManifest` is required in both modes and starts when the host is created. It returns
18
+ `CustomBlockHostManifestResult`: either `{ status: "success", manifest }` or
19
+ `{ status: "error", error }`. It must not resolve to `null` or `undefined`. A definition that is
20
+ still loading keeps the promise pending; a failed load returns an error result. The host validates
21
+ the result and normalizes the manifest before calling `prepareInitialState`. Omitted `dataSources`
22
+ and each source's omitted `properties` default to `{}`.
23
+
24
+ The sandbox loads independently and sends `connect`. In sandbox mode, the SDK reads the manifest
25
+ from JSON metadata injected into the local block HTML by dev tooling. The host validates the
26
+ declaration in `connect`. The two sources do not wait for each other; only the selected result
27
+ determines initialization. Sandbox mode has no persisted fallback. The
28
+ [wire reference](../../bridge/protocol.md#initialization) describes the declaration and its
29
+ validation errors.
30
+
31
+ Once the selected manifest is ready, the host calls `prepareInitialState({ manifest, signal })`
32
+ once. Return `{ status: "success", initialState }` with context and data-source bindings, or
33
+ `{ status: "error", error }`. This callback also must not resolve to `null` or `undefined`. The host
34
+ validates its result. The prepared state omits the manifest; the host adds the selected manifest to
35
+ `init`. Host-mode preparation runs concurrently with connection setup. Sandbox-mode preparation
36
+ starts after `connect` supplies the declaration. The host sends `init` after preparation and a valid
37
+ connection succeed. A preparation failure is retained until the sandbox connects.
38
+
39
+ Errors from the selected manifest source retain their `code`, `message`, and `isRetryable`. A
40
+ missing sandbox declaration produces `manifest_unavailable`. A sandbox `manifest_invalid` error is
41
+ ignored in host mode because that mode uses the persisted manifest; other connect errors remain
42
+ fatal. Unexpected exceptions or invalid results from either callback produce `unknown_error`.
43
+ Diagnostics go to `onLog("warn", payload)`. Stopping aborts preparation and suppresses late results
44
+ without a cancellation warning.
45
+
46
+ ## Timeouts
47
+
48
+ | Option | Waits for | Default | Failure code |
49
+ | ----------------------- | ------------------------------------- | --------- | ----------------------- |
50
+ | `noConnectTimeoutMs` | `connect` after the first iframe load | 5 seconds | `no_connect` |
51
+ | `initialStateTimeoutMs` | State preparation after `connect` | 5 seconds | `initial_state_timeout` |
52
+ | `noInitResultTimeoutMs` | `initResult` after `init` | 5 seconds | `no_init_result` |
53
+
54
+ The SDK waits for `init` without its own timeout. Handshake failures abort preparation and suppress
55
+ late results. Manifest and state preparation providers must respect their `signal`.
56
+
57
+ ## Live state
58
+
59
+ `setTheme()`, `setContrastMode()`, `setParent()`, `setPage()`, `setDataSources()`, and
60
+ `setCurrentUser()` hold updates during initialization and send them after `initResult.success`. For
61
+ data-source query refreshes, see [Handlers and data](handlers.md#refresh-active-queries).
62
+
63
+ ## Callbacks
64
+
65
+ The required `onStatusChange(state)` callback receives the `CustomBlockHostStatus` union:
66
+
67
+ | Status | Behavior | Payload |
68
+ | ---------------------- | -------------------------------------------------------------- | ------------------------------------------------------ |
69
+ | `waitingForConnect` | The host is listening; reported synchronously during creation | None |
70
+ | `preparingInit` | The host accepted a connection and is preparing initialization | `localManifest`, `sdkVersion`, `bridgeProtocolVersion` |
71
+ | `waitingForInitResult` | Successful `init` was sent; acknowledgment is pending | None |
72
+ | `initialized` | The sandbox accepted initialization | `resolvedManifest`, optional `initialHeight` |
73
+ | `failed` | Initialization or runtime failed | `error` |
74
+ | `stopped` | The application explicitly disposed of the host | None |
75
+
76
+ `localManifest` is optional and comes only from a permitted local sandbox. It is available before
77
+ initialization completes, so an adapter can use its requirements to prepare bindings.
78
+ `resolvedManifest` is the selected declaration sent in `init`. Rejected connections can skip
79
+ intermediate statuses. Both `failed` and `stopped` are terminal; stopping a failed host releases
80
+ resources without replacing its failure status.
81
+
82
+ Connection failures contain `{ phase, source, code, message, isRetryable }`. The phase is `connect`,
83
+ `init`, `initResult`, or `runtime`. The source identifies who reported the failure. Failures can
84
+ occur after initialization succeeds.
85
+
86
+ At `initialized`, apply a supplied `initialHeight` in CSS pixels before revealing the iframe. If the
87
+ height is absent, use your application's default size. The `resize` handler applies later height
88
+ changes. Reveal, sizing, and failure UI belong to the embedding application.
89
+
90
+ | Other callback | Behavior |
91
+ | ------------------------------------- | -------------------------------------------------------------------------------------------- |
92
+ | `onQueryUnsubscribed(subscriptionId)` | Runs once when a subscription ends through unsubscribe, replacement, terminal error, or stop |
93
+ | `onLog(direction, payload)` | Receives bridge messages and warnings |
94
+
95
+ ## Iframe lifetime
96
+
97
+ Each host handles one handshake. Create a new host and iframe to retry or replace the block URL. The
98
+ [wire reference](../../bridge/protocol.md#initialization) defines handshake and
99
+ malformed-message behavior.
100
+
101
+ The first observed iframe `load` is allowed. A second load stops the host and reports retryable
102
+ `iframe_reloaded`. Load-event cleanup does not isolate documents before that event. A replacement
103
+ document at the same origin can receive messages and invoke handlers until the host stops.
104
+
105
+ `stop()` removes listeners, cancels preparation, clears timers, ends subscriptions, and suppresses
106
+ pending responses. Call it when removing the iframe.
107
+
108
+ ## Local block URLs
109
+
110
+ `isAllowedLocalPreviewUrl({ url, hostOrigin })` accepts HTTP or HTTPS URLs on `localhost`,
111
+ `*.localhost`, or `127.0.0.1` without credentials. It rejects the embedding page's origin.
112
+ `hostOrigin` must be nonempty. Pass the embedding page's serialized origin.
113
+
114
+ The protocol helper `isLocalBlockServerUrl(url)` checks the server URL without requiring origin
115
+ isolation. The host adds the embedding-origin restriction. `manifestSource: "sandbox"` enforces this
116
+ policy before the host starts. An invalid sandbox-mode URL throws `CustomBlockInitializationError`
117
+ with code `invalid_local_preview_url`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@notionhq/custom-blocks-dev-shell",
3
- "version": "0.1.114",
4
- "description": "Local preview shell for Notion custom block workers.",
3
+ "version": "0.1.116",
4
+ "description": "Local development shell for Notion custom block workers.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
@@ -16,33 +16,14 @@
16
16
  "dist",
17
17
  "dist-cli",
18
18
  "docs",
19
- "README.md"
19
+ "README.md",
20
+ "LICENSE",
21
+ "THIRD_PARTY_LICENSES.md"
20
22
  ],
21
23
  "dependencies": {
22
- "react": "^19.2.8",
23
- "react-dom": "^19.2.8",
24
- "temporal-polyfill": "^1.0.5",
25
- "valibot": "^1.4.2"
26
- },
27
- "devDependencies": {
28
- "@tailwindcss/vite": "^4.3.3",
29
- "@types/node": "^26.5.0",
30
- "@types/react": "^19.2.18",
31
- "@types/react-dom": "^19.2.7",
32
- "@vitejs/plugin-react": "^6.1.1",
33
- "@vitest/coverage-v8": "^5.0.0",
34
- "tailwindcss": "^4.3.3",
35
- "typescript": "^7.0.2",
36
- "vite": "^8.2.2",
37
- "vitest": "^5.0.0",
38
- "@notionhq/custom-blocks-protocol": "0.1.0",
39
- "@notionhq/custom-blocks-host": "0.3.7"
40
- },
41
- "scripts": {
42
- "dev": "vite",
43
- "build": "vite build && tsc --project cli/tsconfig.build.json",
44
- "test": "vitest run",
45
- "test:coverage": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=json",
46
- "typecheck": "tsc --project tsconfig.json && tsc --project cli/tsconfig.json"
24
+ "react": "^19.3.1",
25
+ "react-dom": "^19.3.1",
26
+ "temporal-polyfill": "^1.0.6",
27
+ "valibot": "^1.5.0"
47
28
  }
48
29
  }
@@ -1,2 +0,0 @@
1
- /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-ink:#32302c;--color-ink-muted:#6b6b68;--color-ink-faint:#9b9a97;--color-ink-fainter:#b3b3b0;--color-nav-ink:#2c2c2b;--color-paper:#fbfbfa;--color-hairline:#e6e5e3;--color-ui-hover:#3b14000d;--color-panel:#42230308;--color-canvas:#fff;--color-pill:#0000000d;--color-pill-dark:#ffffff0e;--color-dark-ink:#ffffffcf;--color-dark-ink-muted:#ffffff75;--color-sidebar:#f7f7f5;--color-sidebar-active:#00000008;--color-sidebar-ink:#5f5e59;--color-sidebar-ink-strong:#1d1b16;--color-sidebar-ink-muted:#7d7a75;--color-hairline-soft:#f0efed;--color-toggle:#e9e9e7;--color-accent:#2383e2;--color-match:#dcf3e3;--color-match-ink:#1f6d3d;--color-mismatch:#fbe4e4;--color-mismatch-ink:#a33}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}body{background:var(--color-paper);color:var(--color-ink);margin:0}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-ink:#ffffffcf;--color-ink-muted:#ffffff94;--color-ink-faint:#ffffff6b;--color-ink-fainter:#ffffff52;--color-nav-ink:#ffffffcf;--color-paper:#202020;--color-hairline:#3a3a3a;--color-ui-hover:#ffffff14;--color-panel:#ffffff0e;--color-canvas:#191919;--color-pill:#ffffff14;--color-sidebar:#191919;--color-sidebar-active:#ffffff14;--color-sidebar-ink:#ffffffb8;--color-sidebar-ink-strong:#ffffffe6;--color-sidebar-ink-muted:#ffffff80;--color-hairline-soft:#2b2b2b;--color-hover:#2a2a2a;--color-toggle:#303030;--color-tooltip:#f7f7f5;--color-match:#46b47838;--color-match-ink:#7bd59d;--color-mismatch:#dc505033;--color-mismatch-ink:#f08b8b}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.top-1\/2{top:50%}.top-full{top:100%}.right-0{right:0}.right-1\.5{right:calc(var(--spacing) * 1.5)}.bottom-full{bottom:100%}.left-0{left:0}.isolate{isolation:isolate}.z-10{z-index:10}.z-50{z-index:50}.row-1{grid-row:1}.row-2{grid-row:2}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-1{margin-bottom:var(--spacing)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-100{height:calc(var(--spacing) * 100)}.h-\[30px\]{height:30px}.h-\[38px\]{height:38px}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[85vh\]{max-height:85vh}.max-h-full{max-height:100%}.max-h-none{max-height:none}.min-h-0{min-height:0}.w-70{width:calc(var(--spacing) * 70)}.w-\[172px\]{width:172px}.w-full{width:100%}.max-w-120{max-width:calc(var(--spacing) * 120)}.max-w-160{max-width:calc(var(--spacing) * 160)}.max-w-190{max-width:calc(var(--spacing) * 190)}.max-w-\[560px\]{max-width:560px}.max-w-\[720px\]{max-width:720px}.max-w-\[960px\]{max-width:960px}.max-w-full{max-width:100%}.max-w-none{max-width:none}.min-w-0{min-width:0}.min-w-40{min-width:calc(var(--spacing) * 40)}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[6px\]{border-radius:6px}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-hairline{border-color:var(--color-hairline)}.border-hairline-soft{border-color:var(--color-hairline-soft)}.border-mismatch{border-color:var(--color-mismatch)}.bg-accent{background-color:var(--color-accent)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-canvas{background-color:var(--color-canvas)}.bg-match{background-color:var(--color-match)}.bg-panel{background-color:var(--color-panel)}.bg-paper{background-color:var(--color-paper)}.bg-pill{background-color:var(--color-pill)}.bg-pill-dark{background-color:var(--color-pill-dark)}.bg-sidebar{background-color:var(--color-sidebar)}.bg-sidebar-active{background-color:var(--color-sidebar-active)}.bg-transparent{background-color:#0000}.bg-ui-hover{background-color:var(--color-ui-hover)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-0\.5{padding-left:calc(var(--spacing) * .5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-body{letter-spacing:-.154px;font-size:14px;line-height:20px}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-caption{font-size:12px;line-height:16px}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[17px\]{font-size:17px}.text-\[32px\]{font-size:32px}.text-\[40px\]{font-size:40px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-10{--tw-leading:calc(var(--spacing) * 10);line-height:calc(var(--spacing) * 10)}.leading-\[1\.2\]{--tw-leading:1.2;line-height:1.2}.leading-\[20px\]{--tw-leading:20px;line-height:20px}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.442px\]{--tw-tracking:-.442px;letter-spacing:-.442px}.tracking-\[-1\.55px\]{--tw-tracking:-1.55px;letter-spacing:-1.55px}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-dark-ink{color:var(--color-dark-ink)}.text-dark-ink-muted{color:var(--color-dark-ink-muted)}.text-ink{color:var(--color-ink)}.text-ink-faint{color:var(--color-ink-faint)}.text-ink-fainter{color:var(--color-ink-fainter)}.text-ink-muted{color:var(--color-ink-muted)}.text-match-ink{color:var(--color-match-ink)}.text-mismatch-ink{color:var(--color-mismatch-ink)}.text-nav-ink{color:var(--color-nav-ink)}.text-sidebar-ink{color:var(--color-sidebar-ink)}.text-sidebar-ink-muted{color:var(--color-sidebar-ink-muted)}.text-sidebar-ink-strong{color:var(--color-sidebar-ink-strong)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_4px_12px_rgb\(0_0_0\/10\%\)\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_12px_40px_rgb\(0_0_0\/25\%\)\]{--tw-shadow:0 12px 40px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.select-all{-webkit-user-select:all;user-select:all}.select-text{-webkit-user-select:text;user-select:text}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.backdrop\:bg-black\/40::backdrop{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.backdrop\:bg-black\/40::backdrop{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.open\:flex:is([open],:popover-open,:open){display:flex}@media (hover:hover){.hover\:bg-sidebar-active:hover{background-color:var(--color-sidebar-active)}.hover\:bg-ui-hover:hover{background-color:var(--color-ui-hover)}.hover\:opacity-90:hover{opacity:.9}}.focus-visible\:opacity-100:focus-visible{opacity:1}.disabled\:cursor-default:disabled{cursor:default}.disabled\:bg-toggle:disabled{background-color:var(--color-toggle)}.disabled\:text-ink-faint:disabled{color:var(--color-ink-faint)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}