@statelyai/sdk 0.12.2 → 0.12.3

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/README.md CHANGED
@@ -30,11 +30,14 @@ embed.init({
30
30
 
31
31
  Restrict an embed by passing a resolved access policy:
32
32
 
33
+ <!-- restricted MachineInitOptions from src/protocol.ts -->
34
+
33
35
  ```ts
34
36
  embed.init({
35
37
  machine: myMachineConfig,
36
38
  mode: 'viewing',
37
39
  readOnly: true,
40
+ readOnlyReason: 'free-plan',
38
41
  capabilities: {
39
42
  edit: false,
40
43
  export: false,
@@ -51,6 +54,10 @@ embed.on('capabilityDenied', (event) => {
51
54
  });
52
55
  ```
53
56
 
57
+ `readOnlyReason: 'free-plan'` shows a persistent **Upgrade to edit** action.
58
+ Use `access-unverified` when reopening or signing in, rather than upgrading, is
59
+ the appropriate recovery action.
60
+
54
61
  Key capabilities:
55
62
 
56
63
  - **Mount or attach** to any container element or existing iframe
package/dist/embed.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as toInitMessage, i as createPendingExportManager, r as createEventRegistry, t as createPostMessageTransport } from "./transport-D0nlFaLn.mjs";
1
+ import { a as toInitMessage, i as createPendingExportManager, r as createEventRegistry, t as createPostMessageTransport } from "./transport-DysvAtl5.mjs";
2
2
 
3
3
  //#region src/embed.ts
4
4
  function buildEmbedUrl(options) {
@@ -26,6 +26,7 @@ function extractInitOptions(options) {
26
26
  mode: options.mode,
27
27
  theme: options.theme,
28
28
  readOnly: options.readOnly,
29
+ readOnlyReason: options.readOnlyReason,
29
30
  depth: options.depth,
30
31
  capabilities: options.capabilities,
31
32
  panels: options.panels,
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as createWebSocketTransport, t as createPostMessageTransport } from "./transport-D0nlFaLn.mjs";
1
+ import { n as createWebSocketTransport, t as createPostMessageTransport } from "./transport-DysvAtl5.mjs";
2
2
  import { createStatelyEmbed } from "./embed.mjs";
3
3
  import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
4
4
  import { createStatelyInspector } from "./inspect.mjs";
package/dist/inspect.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as createPendingExportManager, n as createWebSocketTransport, r as createEventRegistry } from "./transport-D0nlFaLn.mjs";
1
+ import { i as createPendingExportManager, n as createWebSocketTransport, r as createEventRegistry } from "./transport-DysvAtl5.mjs";
2
2
 
3
3
  //#region src/inspect.ts
4
4
  const defaultSerializeSnapshot = (snapshot) => ({
@@ -29,6 +29,7 @@ interface EditorCapabilities {
29
29
  panels?: string[];
30
30
  commands?: string[];
31
31
  }
32
+ type ReadOnlyReason = "free-plan" | "access-unverified";
32
33
  type CapabilityDeniedCapability = "edit" | "export" | "ai" | "simulate" | "inspect" | "navigateHierarchy" | "panel" | "mode";
33
34
  interface CapabilityDeniedEvent {
34
35
  capability: CapabilityDeniedCapability;
@@ -178,6 +179,7 @@ interface MachineInitOptions {
178
179
  mode?: EmbedMode;
179
180
  theme?: "light" | "dark";
180
181
  readOnly?: boolean;
182
+ readOnlyReason?: ReadOnlyReason;
181
183
  depth?: number;
182
184
  capabilities?: EditorCapabilities;
183
185
  panels?: {
@@ -233,6 +235,7 @@ interface InitMessage {
233
235
  mode?: EmbedMode;
234
236
  theme?: "light" | "dark";
235
237
  readOnly?: boolean;
238
+ readOnlyReason?: ReadOnlyReason;
236
239
  depth?: number;
237
240
  capabilities?: EditorCapabilities;
238
241
  leftPanels?: string[];
@@ -510,4 +513,4 @@ type SessionMessage = RegisterMessage | RegisteredMessage | RequestOpenMessage |
510
513
  type ProtocolMessage = ClientMessage | VizMessage | SessionMessage;
511
514
  declare const PREFIX = "@statelyai.";
512
515
  //#endregion
513
- export { ActorSystemEntry, AddSessionMessage, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, CommentsConfig, EditorCapabilities, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, InitMessage, InitOptions, InspectSnapshotMessage, LoadedMessage, MachineInitOptions, MachineSourceLocations, PREFIX, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectUpdateMessage, ProtocolMessage, ReadyMessage, RegisterMessage, RegisteredMessage, RequestOpenMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SessionAddedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VizMessage };
516
+ export { ActorSystemEntry, AddSessionMessage, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, CommentsConfig, EditorCapabilities, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, InitMessage, InitOptions, InspectSnapshotMessage, LoadedMessage, MachineInitOptions, MachineSourceLocations, PREFIX, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectUpdateMessage, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RequestOpenMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SessionAddedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VizMessage };
@@ -113,6 +113,7 @@ function toInitMessage(options) {
113
113
  mode: options.mode,
114
114
  theme: options.theme,
115
115
  readOnly: options.readOnly,
116
+ readOnlyReason: options.readOnlyReason,
116
117
  depth: options.depth,
117
118
  capabilities: options.capabilities,
118
119
  leftPanels: options.panels?.leftPanels,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statelyai/sdk",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",
@@ -76,7 +76,7 @@
76
76
  "jsdom": "^27.4.0",
77
77
  "tsdown": "0.21.0-beta.2",
78
78
  "vitest": "^3.2.4",
79
- "@statelyai/graph-tools": "0.0.3"
79
+ "@statelyai/graph-tools": "0.0.4"
80
80
  },
81
81
  "scripts": {
82
82
  "build": "tsdown",