@ixo/editor 3.1.0 → 3.2.1

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.
@@ -1,6 +1,6 @@
1
- import { n as ActionDefinition, o as ActionServices } from '../setup-eMnRk02Q.mjs';
2
- export { q as ActionContext, r as ActionResult, h as ActivationResult, u as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, v as CompiledBlock, w as CompiledEdge, m as CompiledFlow, x as CompiledFlowNode, C as CompilerRegistry, t as ConditionRef, E as ExecuteNodeParams, g as ExecutionContext, f as ExecutionOutcome, l as FlowCapability, F as FlowRuntimeStateManager, N as NodeActionResult, O as OutputSchemaField, R as RuntimeRef, S as SetupFlowOptions, k as SetupFlowResult, T as TTLConstraint, d as buildAuthzFromProps, b as buildFlowNodeFromBlock, p as clearRuntimeForTemplateClone, j as compileBaseUcanFlow, c as createRuntimeStateManager, e as executeNode, i as isAuthorized, a as isNodeActive, y as isRuntimeRef, s as setupFlowFromBaseUcan } from '../setup-eMnRk02Q.mjs';
3
- export { A as ActivationCondition, C as ClaimCollectionURI, G as CreateDelegationParams, H as CreateInvocationParams, B as CreateRootDelegationParams, s as DID, D as DelegationChainValidationResult, k as DelegationGrant, E as EvaluationStatus, y as ExecutionWithInvocationResult, z as FindProofsResult, v as FlowNode, F as FlowNodeAuthzExtension, u as FlowNodeBase, t as FlowNodeRuntimeState, w as InvocationRequest, x as InvocationResult, I as InvocationStore, L as LinkedClaim, N as NodeState, S as StoredDelegation, j as StoredInvocation, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService } from '../index-Ch49AFng.mjs';
1
+ import { n as ActionDefinition, o as ActionServices } from '../setup-B0la8n04.mjs';
2
+ export { q as ActionContext, r as ActionResult, h as ActivationResult, u as ActorConstraint, A as AuthorizationResult, B as BaseUcanFlow, v as CompiledBlock, w as CompiledEdge, m as CompiledFlow, x as CompiledFlowNode, C as CompilerRegistry, t as ConditionRef, E as ExecuteNodeParams, g as ExecutionContext, f as ExecutionOutcome, l as FlowCapability, F as FlowRuntimeStateManager, N as NodeActionResult, O as OutputSchemaField, R as RuntimeRef, S as SetupFlowOptions, k as SetupFlowResult, T as TTLConstraint, d as buildAuthzFromProps, b as buildFlowNodeFromBlock, p as clearRuntimeForTemplateClone, j as compileBaseUcanFlow, c as createRuntimeStateManager, e as executeNode, i as isAuthorized, a as isNodeActive, y as isRuntimeRef, s as setupFlowFromBaseUcan } from '../setup-B0la8n04.mjs';
3
+ export { A as ActivationCondition, C as ClaimCollectionURI, G as CreateDelegationParams, H as CreateInvocationParams, B as CreateRootDelegationParams, s as DID, D as DelegationChainValidationResult, k as DelegationGrant, E as EvaluationStatus, y as ExecutionWithInvocationResult, z as FindProofsResult, v as FlowNode, F as FlowNodeAuthzExtension, u as FlowNodeBase, t as FlowNodeRuntimeState, w as InvocationRequest, x as InvocationResult, I as InvocationStore, L as LinkedClaim, N as NodeState, S as StoredDelegation, j as StoredInvocation, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService } from '../index-DMrZ4EwQ.mjs';
4
4
  import 'yjs';
5
5
  import 'matrix-js-sdk';
6
6
  import '@blocknote/core';
@@ -3,7 +3,7 @@ import {
3
3
  isRuntimeRef,
4
4
  resolveRuntimeRefs,
5
5
  setupFlowFromBaseUcan
6
- } from "../chunk-KXKEXO53.mjs";
6
+ } from "../chunk-IQX6H7AK.mjs";
7
7
  import {
8
8
  buildAuthzFromProps,
9
9
  buildFlowNodeFromBlock,
@@ -26,7 +26,7 @@ import {
26
26
  isNodeActive,
27
27
  registerAction,
28
28
  typeToCan
29
- } from "../chunk-5D26UG3I.mjs";
29
+ } from "../chunk-F2JSGDES.mjs";
30
30
  import {
31
31
  computeCID,
32
32
  computeJsonCID
@@ -1,5 +1,5 @@
1
1
  import * as _blocknote_core from '@blocknote/core';
2
- import { K as IxoBlockProps, J as IxoEditorType, l as IxoEditorOptions, p as IxoCollaborativeEditorOptions, k as DelegationGrant } from './index-Ch49AFng.mjs';
2
+ import { K as IxoBlockProps, J as IxoEditorType, l as IxoEditorOptions, p as IxoCollaborativeEditorOptions, k as DelegationGrant } from './index-DMrZ4EwQ.mjs';
3
3
  import { Text, Doc, Map, Array as Array$1 } from 'yjs';
4
4
  import React from 'react';
5
5
  import { MatrixClient } from 'matrix-js-sdk';
@@ -2250,6 +2250,8 @@ interface BlocknoteContextValue {
2250
2250
  mapConfig?: UnlMapConfig;
2251
2251
  editable?: boolean;
2252
2252
  docType: DocType;
2253
+ /** Current flow schema version (e.g., '0.3', '1.0.0') */
2254
+ flowVersion: string;
2253
2255
  sharedProposals: SharedProposalData;
2254
2256
  fetchSharedProposal: (proposalId: string, contractAddress: string, force?: boolean) => Promise<ProposalResponse>;
2255
2257
  invalidateProposal: (proposalId: string) => void;
@@ -2428,6 +2428,11 @@ interface IxoEditorType<BSchema extends IxoBlockSchema = IxoBlockSchema, ISchema
2428
2428
  * @internal
2429
2429
  */
2430
2430
  _yInvocations?: Map<any>;
2431
+ /**
2432
+ * Y.Map for migration state persistence
2433
+ * @internal
2434
+ */
2435
+ _yMigration?: Map<any>;
2431
2436
  /**
2432
2437
  * UCAN delegation store (new @ixo/ucan integration)
2433
2438
  * Supports both CAR format (new) and JSON format (legacy)
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { N as Addr, n as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, t as AuthzExecActionTypes, B as BlockPresenceUser, x as BlockRequirements, w as BlocknoteContextValue, v as BlocknoteHandlers, q as BlocknoteProvider, i as CheckboxBlockProps, g as CheckboxBlockSpec, Z as CosmosMsgForEmpty, C as CoverImage, c as CoverImageProps, a0 as Entity, a1 as EntityResponse, f as EntitySigningSetup, a2 as EntityVariables, E as EvaluationTab, e as EvaluationTabState, R as Expiration, F as FlowPermissionsPanel, G as GrantPermissionModal, a3 as GraphQLClient, a6 as GraphQLRequest, a5 as GraphQLResponse, H as HttpMethod, I as IxoEditor, b as IxoEditorProps, K as KeyValuePair, k as ListBlockProps, j as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, l as OverviewBlockProps, _ as ProposalAction, m as ProposalBlockProps, P as ProposalBlockSpec, y as ProposalResponse, z as SingleChoiceProposal, S as StakeType, S as StakeTypeValue, W as Status, X as Threshold, T as Timestamp, Q as Uint128, U as User, V as ValidatorActionType, M as Vote, J as VoteInfo, D as VoteResponse, Y as Votes, $ as getEntity, a4 as ixoGraphQLClient, o as useBlockPresence, r as useBlocknoteContext, s as useBlocknoteHandlers, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, p as useTrackBlockFocus } from './graphql-client-B49ND-qp.mjs';
2
- export { h as ActivationResult, A as AuthorizationResult, B as BaseUcanFlow, m as CompiledFlow, C as CompilerRegistry, E as ExecuteNodeParams, g as ExecutionContext, f as ExecutionOutcome, l as FlowCapability, F as FlowRuntimeStateManager, N as NodeActionResult, S as SetupFlowOptions, k as SetupFlowResult, d as buildAuthzFromProps, b as buildFlowNodeFromBlock, j as compileBaseUcanFlow, c as createRuntimeStateManager, e as executeNode, i as isAuthorized, a as isNodeActive, s as setupFlowFromBaseUcan } from './setup-eMnRk02Q.mjs';
3
- export { D as DelegationChainValidationResult, k as DelegationGrant, I as InvocationStore, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, S as StoredDelegation, j as StoredInvocation, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, q as blockSpecs, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService, r as getExtraSlashMenuItems } from './index-Ch49AFng.mjs';
4
- export { CloneDocumentResult, cloneDocument } from '@ixo/matrix-crdt';
1
+ export { N as Addr, n as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, t as AuthzExecActionTypes, B as BlockPresenceUser, x as BlockRequirements, w as BlocknoteContextValue, v as BlocknoteHandlers, q as BlocknoteProvider, i as CheckboxBlockProps, g as CheckboxBlockSpec, Z as CosmosMsgForEmpty, C as CoverImage, c as CoverImageProps, a0 as Entity, a1 as EntityResponse, f as EntitySigningSetup, a2 as EntityVariables, E as EvaluationTab, e as EvaluationTabState, R as Expiration, F as FlowPermissionsPanel, G as GrantPermissionModal, a3 as GraphQLClient, a6 as GraphQLRequest, a5 as GraphQLResponse, H as HttpMethod, I as IxoEditor, b as IxoEditorProps, K as KeyValuePair, k as ListBlockProps, j as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, l as OverviewBlockProps, _ as ProposalAction, m as ProposalBlockProps, P as ProposalBlockSpec, y as ProposalResponse, z as SingleChoiceProposal, S as StakeType, S as StakeTypeValue, W as Status, X as Threshold, T as Timestamp, Q as Uint128, U as User, V as ValidatorActionType, M as Vote, J as VoteInfo, D as VoteResponse, Y as Votes, $ as getEntity, a4 as ixoGraphQLClient, o as useBlockPresence, r as useBlocknoteContext, s as useBlocknoteHandlers, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, p as useTrackBlockFocus } from './graphql-client-BxmM6bOC.mjs';
2
+ export { h as ActivationResult, A as AuthorizationResult, B as BaseUcanFlow, m as CompiledFlow, C as CompilerRegistry, E as ExecuteNodeParams, g as ExecutionContext, f as ExecutionOutcome, l as FlowCapability, F as FlowRuntimeStateManager, N as NodeActionResult, S as SetupFlowOptions, k as SetupFlowResult, d as buildAuthzFromProps, b as buildFlowNodeFromBlock, j as compileBaseUcanFlow, c as createRuntimeStateManager, e as executeNode, i as isAuthorized, a as isNodeActive, s as setupFlowFromBaseUcan } from './setup-B0la8n04.mjs';
3
+ export { D as DelegationChainValidationResult, k as DelegationGrant, I as InvocationStore, p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, S as StoredDelegation, j as StoredInvocation, i as UcanCapability, U as UcanDelegationStore, f as UcanService, g as UcanServiceConfig, h as UcanServiceHandlers, q as blockSpecs, b as createInvocationStore, d as createMemoryInvocationStore, a as createMemoryUcanDelegationStore, c as createUcanDelegationStore, e as createUcanService, r as getExtraSlashMenuItems } from './index-DMrZ4EwQ.mjs';
5
4
  export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
5
+ export { CloneDocumentResult, cloneDocument } from '@ixo/matrix-crdt';
6
6
  import 'yjs';
7
7
  import 'react';
8
8
  import 'matrix-js-sdk';
package/dist/index.mjs CHANGED
@@ -26,11 +26,11 @@ import {
26
26
  useCreateCollaborativeIxoEditor,
27
27
  useCreateIxoEditor,
28
28
  useTrackBlockFocus
29
- } from "./chunk-FM2G22RS.mjs";
29
+ } from "./chunk-ZCRLP7QH.mjs";
30
30
  import {
31
31
  compileBaseUcanFlow,
32
32
  setupFlowFromBaseUcan
33
- } from "./chunk-KXKEXO53.mjs";
33
+ } from "./chunk-IQX6H7AK.mjs";
34
34
  import {
35
35
  buildAuthzFromProps,
36
36
  buildFlowNodeFromBlock,
@@ -43,7 +43,7 @@ import {
43
43
  executeNode,
44
44
  isAuthorized,
45
45
  isNodeActive
46
- } from "./chunk-5D26UG3I.mjs";
46
+ } from "./chunk-F2JSGDES.mjs";
47
47
 
48
48
  // src/index.ts
49
49
  import { cloneDocument } from "@ixo/matrix-crdt";
@@ -1,8 +1,8 @@
1
- import { v as BlocknoteHandlers } from '../graphql-client-B49ND-qp.mjs';
2
- export { N as Addr, n as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, t as AuthzExecActionTypes, B as BlockPresenceUser, x as BlockRequirements, w as BlocknoteContextValue, q as BlocknoteProvider, i as CheckboxBlockProps, g as CheckboxBlockSpec, Z as CosmosMsgForEmpty, C as CoverImage, c as CoverImageProps, ae as DomainCardData, ad as DomainCardRenderer, a8 as DropPosition, aa as DynamicListData, ab as DynamicListDataProvider, ac as DynamicListPanelRenderer, a0 as Entity, a1 as EntityResponse, f as EntitySigningSetup, a2 as EntityVariables, E as EvaluationTab, e as EvaluationTabState, R as Expiration, a7 as ExternalDropZone, F as FlowPermissionsPanel, G as GrantPermissionModal, a3 as GraphQLClient, a6 as GraphQLRequest, a5 as GraphQLResponse, H as HttpMethod, I as IxoEditor, b as IxoEditorProps, K as KeyValuePair, k as ListBlockProps, j as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, l as OverviewBlockProps, _ as ProposalAction, m as ProposalBlockProps, P as ProposalBlockSpec, y as ProposalResponse, z as SingleChoiceProposal, S as StakeType, S as StakeTypeValue, W as Status, X as Threshold, T as Timestamp, Q as Uint128, U as User, V as ValidatorActionType, a9 as VisualizationRenderer, M as Vote, J as VoteInfo, D as VoteResponse, Y as Votes, $ as getEntity, a4 as ixoGraphQLClient, o as useBlockPresence, r as useBlocknoteContext, s as useBlocknoteHandlers, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, p as useTrackBlockFocus } from '../graphql-client-B49ND-qp.mjs';
1
+ import { v as BlocknoteHandlers } from '../graphql-client-BxmM6bOC.mjs';
2
+ export { N as Addr, n as ApiRequestBlockProps, h as ApiRequestBlockSpec, A as AuthorizationTab, d as AuthorizationTabState, t as AuthzExecActionTypes, B as BlockPresenceUser, x as BlockRequirements, w as BlocknoteContextValue, q as BlocknoteProvider, i as CheckboxBlockProps, g as CheckboxBlockSpec, Z as CosmosMsgForEmpty, C as CoverImage, c as CoverImageProps, ae as DomainCardData, ad as DomainCardRenderer, a8 as DropPosition, aa as DynamicListData, ab as DynamicListDataProvider, ac as DynamicListPanelRenderer, a0 as Entity, a1 as EntityResponse, f as EntitySigningSetup, a2 as EntityVariables, E as EvaluationTab, e as EvaluationTabState, R as Expiration, a7 as ExternalDropZone, F as FlowPermissionsPanel, G as GrantPermissionModal, a3 as GraphQLClient, a6 as GraphQLRequest, a5 as GraphQLResponse, H as HttpMethod, I as IxoEditor, b as IxoEditorProps, K as KeyValuePair, k as ListBlockProps, j as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, l as OverviewBlockProps, _ as ProposalAction, m as ProposalBlockProps, P as ProposalBlockSpec, y as ProposalResponse, z as SingleChoiceProposal, S as StakeType, S as StakeTypeValue, W as Status, X as Threshold, T as Timestamp, Q as Uint128, U as User, V as ValidatorActionType, a9 as VisualizationRenderer, M as Vote, J as VoteInfo, D as VoteResponse, Y as Votes, $ as getEntity, a4 as ixoGraphQLClient, o as useBlockPresence, r as useBlocknoteContext, s as useBlocknoteHandlers, a as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor, p as useTrackBlockFocus } from '../graphql-client-BxmM6bOC.mjs';
3
3
  import React$1, { PropsWithChildren } from 'react';
4
- import { K as IxoBlockProps, J as IxoEditorType, t as FlowNodeRuntimeState } from '../index-Ch49AFng.mjs';
5
- export { p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, q as blockSpecs, r as getExtraSlashMenuItems } from '../index-Ch49AFng.mjs';
4
+ import { K as IxoBlockProps, J as IxoEditorType, t as FlowNodeRuntimeState } from '../index-DMrZ4EwQ.mjs';
5
+ export { p as IxoCollaborativeEditorOptions, o as IxoCollaborativeUser, n as IxoEditorConfig, l as IxoEditorOptions, m as IxoEditorTheme, q as blockSpecs, r as getExtraSlashMenuItems } from '../index-DMrZ4EwQ.mjs';
6
6
  import * as zustand from 'zustand';
7
7
  import * as _blocknote_core from '@blocknote/core';
8
8
  export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
@@ -49,13 +49,13 @@ import {
49
49
  usePanel,
50
50
  usePanelStore,
51
51
  useTrackBlockFocus
52
- } from "../chunk-FM2G22RS.mjs";
52
+ } from "../chunk-ZCRLP7QH.mjs";
53
53
  import {
54
54
  didToMatrixUserId,
55
55
  findOrCreateDMRoom,
56
56
  getHomeserver,
57
57
  sendDirectMessage
58
- } from "../chunk-5D26UG3I.mjs";
58
+ } from "../chunk-F2JSGDES.mjs";
59
59
  export {
60
60
  ApiRequestBlockSpec,
61
61
  AuthorizationTab,
@@ -1,4 +1,4 @@
1
- import { v as FlowNode, F as FlowNodeAuthzExtension, t as FlowNodeRuntimeState, J as IxoEditorType, f as UcanService, I as InvocationStore, E as EvaluationStatus } from './index-Ch49AFng.mjs';
1
+ import { v as FlowNode, F as FlowNodeAuthzExtension, t as FlowNodeRuntimeState, J as IxoEditorType, f as UcanService, I as InvocationStore, E as EvaluationStatus } from './index-DMrZ4EwQ.mjs';
2
2
  import { Doc } from 'yjs';
3
3
  import { MatrixClient } from 'matrix-js-sdk';
4
4
 
@@ -178,11 +178,15 @@ interface NodeActionResult {
178
178
  }
179
179
  interface ExecutionContext {
180
180
  runtime: FlowRuntimeStateManager;
181
- ucanService: UcanService;
182
- invocationStore: InvocationStore;
181
+ /** UCAN service — optional for v0.x flows, required for v1.0.0+ */
182
+ ucanService?: UcanService;
183
+ /** Invocation store — optional for v0.x flows */
184
+ invocationStore?: InvocationStore;
183
185
  flowUri: string;
184
186
  flowId: string;
185
187
  flowOwnerDid: string;
188
+ /** Flow schema version. When set, controls whether UCAN is enforced. */
189
+ schemaVersion?: string;
186
190
  now?: () => number;
187
191
  }
188
192
  interface ExecutionOutcome {
@@ -203,15 +207,15 @@ interface ExecuteNodeParams {
203
207
  pin: string;
204
208
  }
205
209
  /**
206
- * Execute a node with UCAN invocation-based authorization.
210
+ * Execute a node.
207
211
  *
208
- * Pipeline:
209
- * 1. Check activation (upstream conditions)
210
- * 2. Check authorization (UCAN delegation chain)
211
- * 3. Create invocation (signed proof of execution)
212
- * 4. Execute action
213
- * 5. Store invocation result
214
- * 6. Update runtime state
212
+ * The pipeline adapts based on the flow's schema version (via context.schemaVersion):
213
+ *
214
+ * **v0.x (legacy):** activation action → runtime update.
215
+ * UCAN authorization and invocations are skipped when ucanService is not available.
216
+ *
217
+ * **v1.0.0+:** activation → UCAN authorization → invocation → action → runtime update.
218
+ * Requires a configured ucanService with valid delegation chains.
215
219
  */
216
220
  declare const executeNode: ({ node, actorDid, actorType, entityRoomId, context, action, pin }: ExecuteNodeParams) => Promise<ExecutionOutcome>;
217
221
 
@@ -222,12 +226,14 @@ interface AuthorizationResult {
222
226
  proofCids?: string[];
223
227
  }
224
228
  /**
225
- * Check if an actor is authorized to execute a block via UCAN delegation chain.
229
+ * Check if an actor is authorized to execute a block.
226
230
  *
227
- * Every execution requires a valid delegation chain from the flow owner to the actor.
228
- * There is no default-allow or whitelist bypass.
231
+ * Behaviour depends on the flow's schema version:
232
+ * - v0.x (or no version): UCAN is optional. If ucanService is unavailable,
233
+ * execution is allowed without a delegation chain.
234
+ * - v1.0.0+: UCAN is required. A valid delegation chain must exist.
229
235
  */
230
- declare const isAuthorized: (blockId: string, actorDid: string, ucanService: UcanService, flowUri: string) => Promise<AuthorizationResult>;
236
+ declare const isAuthorized: (blockId: string, actorDid: string, ucanService: UcanService | undefined, flowUri: string, schemaVersion?: string) => Promise<AuthorizationResult>;
231
237
 
232
238
  interface ActivationResult {
233
239
  active: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/editor",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "A custom BlockNote editor wrapper for IXO team",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",