@ixo/editor 2.4.0 → 2.6.0

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/dist/index.d.ts CHANGED
@@ -1,2597 +1,148 @@
1
- import * as _blocknote_core from '@blocknote/core';
2
- import { BlockSchemaFromSpecs, InlineContentSchema, StyleSchema, BlockNoteEditor, PartialBlock } from '@blocknote/core';
1
+ import { F as FlowNode, a as FlowNodeAuthzExtension, b as FlowNodeRuntimeState, I as IxoEditorType, S as SignedCapability, E as EvaluationStatus, C as Capability, c as CapabilityValidationResult } from './graphql-client-ppGpOvLH.mjs';
2
+ export { a3 as Addr, J as ApiRequestBlockProps, t as ApiRequestBlockSpec, A as AuthorizationTab, i as AuthorizationTabState, U as AuthzExecActionTypes, Y as BlockRequirements, X as BlocknoteContextValue, W as BlocknoteHandlers, N as BlocknoteProvider, x as CheckboxBlockProps, s as CheckboxBlockSpec, aa as CosmosMsgForEmpty, g as CoverImage, h as CoverImageProps, D as DelegationGrant, ad as Entity, ae as EntityResponse, l as EntitySigningSetup, af as EntityVariables, j as EvaluationTab, k as EvaluationTabState, a6 as Expiration, m as FlowPermissionsPanel, G as GrantPermissionModal, ag as GraphQLClient, aj as GraphQLRequest, ai as GraphQLResponse, K as HttpMethod, r as IxoCollaborativeEditorOptions, q as IxoCollaborativeUser, e as IxoEditor, p as IxoEditorConfig, n as IxoEditorOptions, f as IxoEditorProps, o as IxoEditorTheme, M as KeyValuePair, z as ListBlockProps, y as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, B as OverviewBlockProps, ab as ProposalAction, H as ProposalBlockProps, P as ProposalBlockSpec, Z as ProposalResponse, _ as SingleChoiceProposal, T as StakeType, T as StakeTypeValue, a7 as Status, a8 as Threshold, a5 as Timestamp, a4 as Uint128, a2 as User, V as ValidatorActionType, a1 as Vote, a0 as VoteInfo, $ as VoteResponse, a9 as Votes, v as blockSpecs, ac as getEntity, w as getExtraSlashMenuItems, ah as ixoGraphQLClient, Q as useBlocknoteContext, R as useBlocknoteHandlers, d as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor } from './graphql-client-ppGpOvLH.mjs';
3
+ import { Map } from 'yjs';
3
4
  export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
4
- import { MatrixClient } from 'matrix-js-sdk';
5
- import { Map, Array as Array$1, Text, Doc } from 'yjs';
6
- import React from 'react';
5
+ import 'react';
6
+ import 'matrix-js-sdk';
7
7
 
8
- declare const CheckboxBlockSpec: {
9
- config: {
10
- readonly type: "checkbox";
11
- readonly propSchema: {
12
- readonly checked: {
13
- readonly default: false;
14
- };
15
- readonly allowedCheckers: {
16
- readonly default: "all";
17
- };
18
- readonly initialChecked: {
19
- readonly default: false;
20
- };
21
- readonly title: {
22
- readonly default: "";
23
- };
24
- readonly description: {
25
- readonly default: "";
26
- };
27
- readonly icon: {
28
- readonly default: "square-check";
29
- };
30
- readonly conditions: {
31
- readonly default: "";
32
- };
33
- };
34
- readonly content: "inline";
35
- };
36
- implementation: _blocknote_core.TiptapBlockImplementation<{
37
- readonly type: "checkbox";
38
- readonly propSchema: {
39
- readonly checked: {
40
- readonly default: false;
41
- };
42
- readonly allowedCheckers: {
43
- readonly default: "all";
44
- };
45
- readonly initialChecked: {
46
- readonly default: false;
47
- };
48
- readonly title: {
49
- readonly default: "";
50
- };
51
- readonly description: {
52
- readonly default: "";
53
- };
54
- readonly icon: {
55
- readonly default: "square-check";
56
- };
57
- readonly conditions: {
58
- readonly default: "";
59
- };
60
- };
61
- readonly content: "inline";
62
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
63
- };
8
+ declare const buildAuthzFromProps: (props: Record<string, any>) => FlowNodeAuthzExtension;
9
+ declare const buildFlowNodeFromBlock: (block: any) => FlowNode;
64
10
 
65
- type CheckboxBlockProps = IxoBlockProps;
66
-
67
- declare const ListBlockSpec: {
68
- config: {
69
- readonly type: "list";
70
- readonly propSchema: {
71
- readonly listType: {
72
- readonly default: "";
73
- };
74
- readonly sort: {
75
- readonly default: "{}";
76
- };
77
- readonly filter: {
78
- readonly default: "{}";
79
- };
80
- readonly filterOptions: {
81
- readonly default: "{}";
82
- };
83
- readonly sortOptions: {
84
- readonly default: "{}";
85
- };
86
- readonly listConfig: {
87
- readonly default: "{}";
88
- };
89
- readonly icon: {
90
- readonly default: "📋";
91
- };
92
- };
93
- readonly content: "none";
94
- };
95
- implementation: _blocknote_core.TiptapBlockImplementation<{
96
- readonly type: "list";
97
- readonly propSchema: {
98
- readonly listType: {
99
- readonly default: "";
100
- };
101
- readonly sort: {
102
- readonly default: "{}";
103
- };
104
- readonly filter: {
105
- readonly default: "{}";
106
- };
107
- readonly filterOptions: {
108
- readonly default: "{}";
109
- };
110
- readonly sortOptions: {
111
- readonly default: "{}";
112
- };
113
- readonly listConfig: {
114
- readonly default: "{}";
115
- };
116
- readonly icon: {
117
- readonly default: "📋";
118
- };
119
- };
120
- readonly content: "none";
121
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
122
- };
123
-
124
- interface ListBlockSettings {
125
- listType: string | null;
126
- listConfig: string;
127
- }
128
- interface ListBlockProps extends IxoBlockProps {
11
+ interface FlowRuntimeStateManager {
12
+ get: (nodeId: string) => FlowNodeRuntimeState;
13
+ update: (nodeId: string, updates: Partial<FlowNodeRuntimeState>) => void;
129
14
  }
15
+ declare const createRuntimeStateManager: (editor?: IxoEditorType | null) => FlowRuntimeStateManager;
130
16
 
131
- type ProposalActionType = 'Spend' | 'UpdateMembers' | 'Stake' | 'Join' | 'AuthzExec' | 'AuthzGrant' | 'AuthzRevoke' | 'BurnNft' | 'Mint' | 'Execute' | 'Instantiate' | 'ManageSubDaos' | 'ManageCw721' | 'ManageCw20' | 'Migrate' | 'TransferNft' | 'UpdateAdmin' | 'UpdatePreProposeConfig' | 'UpdateVotingConfig' | 'GovernanceVote' | 'WithdrawTokenSwap' | 'UpdateInfo' | 'Custom' | 'ManageStorageItems' | 'ValidatorActions' | 'PerformTokenSwap' | 'DaoAdminExec' | 'StakeToGroup' | 'SendGroupToken' | 'AcceptToMarketplace' | 'CreateEntity';
132
- interface Member$1 {
133
- addr: string;
134
- weight: number;
135
- }
136
- interface BaseProposalAction {
137
- type: ProposalActionType;
138
- }
139
- interface SpendData {
140
- to: string;
141
- denom: string;
142
- amount: string;
143
- }
144
- interface ManageMembersData {
145
- add: Member$1[];
146
- remove: {
147
- addr: string;
148
- }[];
149
- }
150
- interface SpendAction extends BaseProposalAction {
151
- type: 'Spend';
152
- data: SpendData;
153
- }
154
- interface UpdateMembersAction extends BaseProposalAction {
155
- type: 'UpdateMembers';
156
- data: ManageMembersData;
157
- }
158
- declare const StakeType: {
159
- readonly Delegate: "delegate";
160
- readonly Undelegate: "undelegate";
161
- readonly Redelegate: "redelegate";
162
- readonly WithdrawDelegatorReward: "withdraw_delegator_reward";
163
- };
164
- type StakeType = (typeof StakeType)[keyof typeof StakeType];
165
- interface StakeData {
166
- stakeType: StakeType;
167
- validator: string;
168
- toValidator: string;
169
- amount: string;
170
- denom: string;
171
- }
172
- interface JoinData {
173
- id: string;
174
- coreAddress: string;
175
- address: string;
176
- }
177
- interface StakeAction extends BaseProposalAction {
178
- type: 'Stake';
179
- data: StakeData;
180
- }
181
- interface JoinAction extends BaseProposalAction {
182
- type: 'Join';
183
- data: JoinData;
184
- }
185
- interface Coin$1 {
186
- denom: string;
187
- amount: string;
188
- }
189
- interface Binary {
190
- [k: string]: unknown;
191
- }
192
- interface Empty {
193
- [k: string]: unknown;
194
- }
195
- interface GenericToken {
196
- [k: string]: unknown;
197
- }
198
- interface SubDao {
199
- addr: string;
200
- charter?: string | null;
201
- [k: string]: unknown;
202
- }
203
- interface Counterparty {
204
- address: string;
205
- [k: string]: unknown;
206
- }
207
- type DepositRefundPolicy = string;
208
- type VoteOption = number;
209
- type TProposalActionModel = any;
210
- interface MsgDelegate {
211
- [k: string]: unknown;
212
- }
213
- interface MsgUndelegate {
214
- [k: string]: unknown;
215
- }
216
- interface MsgBeginRedelegate {
217
- [k: string]: unknown;
218
- }
219
- interface MsgWithdrawDelegatorReward {
220
- [k: string]: unknown;
221
- }
222
- type BankMsg = {
223
- send: {
224
- amount: Coin$1[];
225
- to_address: string;
226
- };
227
- } | {
228
- burn: {
229
- amount: Coin$1[];
230
- };
231
- };
232
- type StakingMsg = {
233
- delegate: {
234
- amount: Coin$1;
235
- validator: string;
236
- };
237
- } | {
238
- undelegate: {
239
- amount: Coin$1;
240
- validator: string;
241
- };
242
- } | {
243
- redelegate: {
244
- amount: Coin$1;
245
- dst_validator: string;
246
- src_validator: string;
247
- };
248
- };
249
- type DistributionMsg = {
250
- set_withdraw_address: {
251
- address: string;
252
- };
253
- } | {
254
- withdraw_delegator_reward: {
255
- validator: string;
256
- };
257
- };
258
- interface IbcTimeout {
259
- [k: string]: unknown;
260
- }
261
- type IbcMsg = {
262
- transfer: {
263
- amount: Coin$1;
264
- channel_id: string;
265
- timeout: IbcTimeout;
266
- to_address: string;
267
- };
268
- } | {
269
- send_packet: {
270
- channel_id: string;
271
- data: Binary;
272
- timeout: IbcTimeout;
273
- };
274
- } | {
275
- close_channel: {
276
- channel_id: string;
277
- };
278
- };
279
- type WasmMsg = {
280
- execute: {
281
- contract_addr: string;
282
- funds: Coin$1[];
283
- msg: Binary;
284
- };
285
- } | {
286
- instantiate: {
287
- admin?: string | null;
288
- code_id: number;
289
- funds: Coin$1[];
290
- label: string;
291
- msg: Binary;
292
- };
293
- } | {
294
- migrate: {
295
- contract_addr: string;
296
- msg: Binary;
297
- new_code_id: number;
298
- };
299
- } | {
300
- update_admin: {
301
- admin: string;
302
- contract_addr: string;
303
- };
304
- } | {
305
- clear_admin: {
306
- contract_addr: string;
307
- };
308
- };
309
- type GovMsg = {
310
- vote: {
311
- proposal_id: number;
312
- vote: VoteOption;
313
- };
314
- };
315
- type StargateMsg = {
316
- stargate: {
317
- type_url: string;
318
- value: Binary;
319
- };
320
- };
321
- type CosmosMsgFor_Empty = {
322
- bank: BankMsg;
323
- } | {
324
- custom: Empty;
325
- } | {
326
- staking: StakingMsg;
327
- } | {
328
- distribution: DistributionMsg;
329
- } | {
330
- ibc: IbcMsg;
331
- } | {
332
- wasm: WasmMsg;
333
- } | {
334
- gov: GovMsg;
335
- } | StargateMsg;
336
- declare const AuthzExecActionTypes: {
337
- readonly Delegate: "/cosmos.staking.v1beta1.MsgDelegate";
338
- readonly Undelegate: "/cosmos.staking.v1beta1.MsgUndelegate";
339
- readonly Redelegate: "/cosmos.staking.v1beta1.MsgBeginRedelegate";
340
- readonly ClaimRewards: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
341
- readonly Custom: "custom";
342
- };
343
- type AuthzExecActionType = (typeof AuthzExecActionTypes)[keyof typeof AuthzExecActionTypes];
344
- interface AuthzExecData {
345
- authzExecActionType: AuthzExecActionType;
346
- delegate: MsgDelegate;
347
- undelegate: MsgUndelegate;
348
- redelegate: MsgBeginRedelegate;
349
- claimRewards: MsgWithdrawDelegatorReward;
350
- custom: string;
351
- }
352
- interface AuthzData {
353
- custom?: boolean;
354
- typeUrl: string;
355
- value: {
356
- grantee: string;
357
- msgTypeUrl: string;
358
- };
359
- }
360
- interface BurnNftData {
361
- collection: string;
362
- tokenId: string;
363
- }
364
- interface ExecuteData {
365
- address: string;
366
- message: string;
367
- funds: Coin$1[];
368
- }
369
- interface InstantiateData {
370
- admin: string;
371
- codeId: number;
372
- label: string;
373
- message: string;
374
- funds: Coin$1[];
375
- }
376
- interface ManageSubDaosData {
377
- toAdd: SubDao[];
378
- toRemove: {
379
- address: string;
380
- }[];
381
- }
382
- interface ManageCw721Data {
383
- adding: boolean;
384
- address: string;
385
- }
386
- interface ManageCw20Data {
387
- adding: boolean;
388
- address: string;
389
- }
390
- interface MigrateData {
391
- contract: string;
392
- codeId: number;
393
- msg: string;
394
- }
395
- interface MintData {
396
- to: string;
397
- amount: number;
398
- }
399
- interface TransferNftData {
400
- collection: string;
401
- tokenId: string;
402
- recipient: string;
403
- executeSmartContract: boolean;
404
- smartContractMsg: string;
405
- }
406
- interface UpdateAdminData {
407
- contract: string;
408
- newAdmin: string;
409
- }
410
- interface UpdatePreProposeConfigData {
411
- depositRequired: boolean;
412
- depositInfo: {
413
- amount: string;
414
- type: 'native' | 'cw20' | 'voting_module_token';
415
- denomOrAddress: string;
416
- token?: GenericToken;
417
- refundPolicy: DepositRefundPolicy;
418
- };
419
- anyoneCanPropose: boolean;
420
- }
421
- interface UpdateProposalConfigData {
422
- onlyMembersExecute: boolean;
423
- thresholdType: '%' | 'majority';
424
- thresholdPercentage?: number;
425
- quorumEnabled: boolean;
426
- quorumType: '%' | 'majority';
427
- quorumPercentage?: number;
428
- proposalDuration: number;
429
- proposalDurationUnits: 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds';
430
- allowRevoting: boolean;
431
- }
432
- interface GovernanceVoteData {
433
- proposalId: string;
434
- vote: VoteOption;
435
- }
436
- interface WithdrawTokenSwapData {
437
- contractChosen: boolean;
438
- tokenSwapContractAddress?: string;
439
- }
440
- interface UpdateInfoData {
441
- automatically_add_cw20s: boolean;
442
- automatically_add_cw721s: boolean;
443
- dao_uri?: string | null;
444
- description: string;
445
- image_url?: string | null;
446
- name: string;
447
- [k: string]: unknown;
448
- }
449
- interface CustomData {
450
- message: string;
451
- }
452
- interface ManageStorageItemsData {
453
- setting: boolean;
454
- key: string;
455
- value: string;
456
- }
457
- declare enum ValidatorActionType {
458
- CreateValidator = "/cosmos.staking.v1beta1.MsgCreateValidator",
459
- EditValidator = "/cosmos.staking.v1beta1.MsgEditValidator",
460
- UnjailValidator = "/cosmos.slashing.v1beta1.MsgUnjail",
461
- WithdrawValidatorCommission = "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"
462
- }
463
- interface ValidatorActionsData {
464
- validatorActionType: ValidatorActionType;
465
- createMsg: string;
466
- editMsg: string;
467
- }
468
- interface PerformTokenSwapData {
469
- contractChosen: boolean;
470
- tokenSwapContractAddress?: string;
471
- selfParty?: Omit<Counterparty, 'address'>;
472
- counterparty?: Counterparty;
473
- }
474
- type DaoAdminExecData = {
475
- coreAddress: string;
476
- msgs: CosmosMsgFor_Empty[];
477
- _actions?: TProposalActionModel[];
478
- };
479
- interface StakeToGroupData {
480
- amount: string;
481
- tokenContract: string;
482
- stakingContract: string;
483
- }
484
- interface SendGroupTokenData {
485
- amount: string;
486
- contract: string;
487
- toAddress: string;
488
- }
489
- interface AcceptToMarketplaceData {
490
- did: string;
491
- relayerNodeDid: string;
492
- relayerNodeAddress: string;
493
- }
494
- interface AuthzExecAction extends BaseProposalAction {
495
- type: 'AuthzExec';
496
- data: AuthzExecData;
497
- }
498
- interface AuthzGrantAction extends BaseProposalAction {
499
- type: 'AuthzGrant';
500
- data: AuthzData;
501
- }
502
- interface AuthzRevokeAction extends BaseProposalAction {
503
- type: 'AuthzRevoke';
504
- data: AuthzData;
505
- }
506
- interface BurnNftAction extends BaseProposalAction {
507
- type: 'BurnNft';
508
- data: BurnNftData;
509
- }
510
- interface MintAction extends BaseProposalAction {
511
- type: 'Mint';
512
- data: MintData;
513
- }
514
- interface ExecuteAction extends BaseProposalAction {
515
- type: 'Execute';
516
- data: ExecuteData;
517
- }
518
- interface InstantiateAction extends BaseProposalAction {
519
- type: 'Instantiate';
520
- data: InstantiateData;
521
- }
522
- interface ManageSubDaosAction extends BaseProposalAction {
523
- type: 'ManageSubDaos';
524
- data: ManageSubDaosData;
525
- }
526
- interface ManageCw721Action extends BaseProposalAction {
527
- type: 'ManageCw721';
528
- data: ManageCw721Data;
529
- }
530
- interface ManageCw20Action extends BaseProposalAction {
531
- type: 'ManageCw20';
532
- data: ManageCw20Data;
533
- }
534
- interface MigrateAction extends BaseProposalAction {
535
- type: 'Migrate';
536
- data: MigrateData;
537
- }
538
- interface TransferNftAction extends BaseProposalAction {
539
- type: 'TransferNft';
540
- data: TransferNftData;
541
- }
542
- interface UpdateAdminAction extends BaseProposalAction {
543
- type: 'UpdateAdmin';
544
- data: UpdateAdminData;
545
- }
546
- interface UpdatePreProposeConfigAction extends BaseProposalAction {
547
- type: 'UpdatePreProposeConfig';
548
- data: UpdatePreProposeConfigData;
549
- }
550
- interface UpdateVotingConfigAction extends BaseProposalAction {
551
- type: 'UpdateVotingConfig';
552
- data: UpdateProposalConfigData;
553
- }
554
- interface GovernanceVoteAction extends BaseProposalAction {
555
- type: 'GovernanceVote';
556
- data: GovernanceVoteData;
557
- }
558
- interface WithdrawTokenSwapAction extends BaseProposalAction {
559
- type: 'WithdrawTokenSwap';
560
- data: WithdrawTokenSwapData;
561
- }
562
- interface UpdateInfoAction extends BaseProposalAction {
563
- type: 'UpdateInfo';
564
- data: UpdateInfoData;
565
- }
566
- interface CustomAction extends BaseProposalAction {
567
- type: 'Custom';
568
- data: CustomData;
569
- }
570
- interface ManageStorageItemsAction extends BaseProposalAction {
571
- type: 'ManageStorageItems';
572
- data: ManageStorageItemsData;
573
- }
574
- interface ValidatorActionsAction extends BaseProposalAction {
575
- type: 'ValidatorActions';
576
- data: ValidatorActionsData;
577
- }
578
- interface PerformTokenSwapAction extends BaseProposalAction {
579
- type: 'PerformTokenSwap';
580
- data: PerformTokenSwapData;
581
- }
582
- interface DaoAdminExecAction extends BaseProposalAction {
583
- type: 'DaoAdminExec';
584
- data: DaoAdminExecData;
585
- }
586
- interface StakeToGroupAction extends BaseProposalAction {
587
- type: 'StakeToGroup';
588
- data: StakeToGroupData;
589
- }
590
- interface SendGroupTokenAction extends BaseProposalAction {
591
- type: 'SendGroupToken';
592
- data: SendGroupTokenData;
593
- }
594
- interface AcceptToMarketplaceAction extends BaseProposalAction {
595
- type: 'AcceptToMarketplace';
596
- data: AcceptToMarketplaceData;
597
- }
598
- interface CreateEntityAction extends BaseProposalAction {
599
- type: 'CreateEntity';
600
- data: any;
601
- }
602
- type ProposalAction = SpendAction | UpdateMembersAction | StakeAction | JoinAction | AuthzExecAction | AuthzGrantAction | AuthzRevokeAction | BurnNftAction | MintAction | ExecuteAction | InstantiateAction | ManageSubDaosAction | ManageCw721Action | ManageCw20Action | MigrateAction | TransferNftAction | UpdateAdminAction | UpdatePreProposeConfigAction | UpdateVotingConfigAction | GovernanceVoteAction | WithdrawTokenSwapAction | UpdateInfoAction | CustomAction | ManageStorageItemsAction | ValidatorActionsAction | PerformTokenSwapAction | DaoAdminExecAction | StakeToGroupAction | SendGroupTokenAction | AcceptToMarketplaceAction | CreateEntityAction;
603
- interface SharedProposalData {
604
- [proposalId: string]: {
605
- proposal: any;
606
- lastFetched: number;
607
- loading: boolean;
608
- error?: Error;
609
- };
610
- }
611
-
612
- type Addr = string;
613
- type Uint128 = string;
614
- type Timestamp = string;
615
- interface Coin {
616
- denom: string;
617
- amount: string;
618
- }
619
- type Expiration = {
620
- at_height: number;
621
- } | {
622
- at_time: Timestamp;
623
- } | {
624
- never: {};
625
- };
626
- type Status = 'open' | 'rejected' | 'passed' | 'executed' | 'closed' | 'execution_failed' | 'veto_timelock';
627
- interface Threshold {
628
- absolute_count?: {
629
- weight: Uint128;
630
- };
631
- absolute_percentage?: {
632
- percentage: string;
633
- };
634
- threshold_quorum?: {
635
- threshold: string;
636
- quorum: string;
637
- };
638
- }
639
- interface Votes {
640
- yes: Uint128;
641
- no: Uint128;
642
- abstain: Uint128;
643
- }
644
- interface CosmosMsgForEmpty {
645
- [key: string]: any;
646
- }
647
- interface SingleChoiceProposal {
648
- allow_revoting: boolean;
649
- description: string;
650
- expiration: Expiration;
651
- min_voting_period?: Expiration | null;
652
- msgs: CosmosMsgForEmpty[];
653
- proposer: Addr;
654
- start_height: number;
655
- status: Status;
656
- threshold: Threshold;
657
- title: string;
658
- total_power: Uint128;
659
- votes: Votes;
660
- }
661
- interface ProposalResponse {
662
- id: number;
663
- proposal: SingleChoiceProposal;
664
- }
665
- type Vote = 'yes' | 'no' | 'abstain' | 'no_with_veto';
666
- interface VoteInfo {
667
- power: Uint128;
668
- rationale?: string | null;
669
- vote: Vote;
670
- voter: Addr;
671
- }
672
- interface VoteResponse {
673
- vote?: VoteInfo | null;
674
- }
675
- interface User {
676
- address: string;
677
- }
678
- type IUserMatrixProfile = {
679
- walletAddress: string;
680
- displayname: string;
681
- avatarUrl: string | null;
682
- did: string;
683
- verified?: boolean;
684
- };
685
- interface LinkedResource {
686
- id: string;
687
- type: string;
688
- proof: string;
689
- right: string;
690
- encrypted: string;
691
- mediaType: string;
692
- description: string;
693
- serviceEndpoint: string;
694
- }
695
- interface Service {
696
- id: string;
697
- type: string;
698
- serviceEndpoint: string;
699
- }
700
- interface GQLLinkedResource {
701
- id: string;
702
- type: string;
703
- description: string;
704
- mediaType: string;
705
- serviceEndpoint: string;
706
- proof: string;
707
- encrypted: string;
708
- right: string;
709
- }
710
- interface EntityNode {
711
- id: string;
712
- type: string;
713
- startDate?: string;
714
- endDate?: string;
715
- status: number;
716
- relayerNode: string;
717
- credentials?: string[];
718
- entityVerified: boolean;
719
- metadata: any;
720
- accounts: any;
721
- externalId?: string;
722
- owner?: string;
723
- context: any;
724
- controller: string[];
725
- verificationMethod: any;
726
- service: Service[];
727
- authentication: string[];
728
- assertionMethod: string[];
729
- keyAgreement: string[];
730
- capabilityInvocation: string[];
731
- capabilityDelegation: string[];
732
- linkedResource: LinkedResource[];
733
- linkedClaim: any;
734
- accordedRight: any;
735
- linkedEntity: any;
736
- alsoKnownAs: string;
737
- settings: any;
738
- profile?: {
739
- name?: string;
740
- [key: string]: any;
741
- };
742
- iidById: {
743
- id: string;
744
- linkedResource: GQLLinkedResource[];
745
- };
746
- }
747
- interface EntityResponse$1 {
748
- id: string;
749
- context: string;
750
- relayerNode: string;
751
- controller: string;
752
- type: string;
753
- startDate: string;
754
- endDate: string;
755
- metadata: string;
756
- linkedResource: LinkedResource[];
757
- settings: Record<string, LinkedResource>;
758
- service: string;
759
- externalId: string;
760
- }
761
- interface Asset {
762
- did: string;
763
- alsoKnownAs: string;
764
- name: string;
765
- icon: string;
766
- issuer: string;
767
- owned: boolean;
768
- price: number;
769
- available: boolean;
770
- currency: string;
771
- description?: string;
772
- }
773
- interface POD {
774
- did: string;
775
- name: string;
776
- icon: string;
777
- members: number;
778
- isMember: boolean;
779
- totalProposals: number;
780
- startDate: string;
781
- endDate: string;
782
- description?: string;
783
- }
784
- interface Request {
785
- did: string;
786
- name: string;
787
- icon: string;
788
- budget: number;
789
- isMember: boolean;
790
- currency: string;
791
- brand: string;
792
- totalApplications: number;
793
- description?: string;
794
- }
795
- interface Project {
796
- did: string;
797
- name: string;
798
- icon: string;
799
- description?: string;
800
- }
801
- interface Dao {
802
- did: string;
803
- name: string;
804
- icon: string;
805
- description?: string;
806
- }
807
- interface Balance {
808
- denom: string;
809
- tokenName: string;
810
- chainCount: number;
811
- tokenImage: string;
812
- amount: number;
813
- usdAmount: number;
814
- isCoin: boolean;
815
- isShare: boolean;
816
- isCredit: boolean;
817
- }
818
- interface Oracle {
819
- did: string;
820
- name: string;
821
- icon: string;
822
- isActive: boolean;
823
- isInvited: boolean;
824
- minPoints: number;
825
- maxPoints: number;
826
- currency: string;
827
- brand: string;
828
- flowsAmount: number;
829
- description?: string;
830
- }
831
- interface Proposal {
832
- did: string;
833
- name: string;
834
- icon: string;
835
- description: string;
836
- isVotedOn: boolean;
837
- vote: string | null;
838
- status: string;
839
- }
840
- interface Member {
841
- did: string;
842
- username: string;
843
- address: string;
844
- icon: string;
845
- percentage: string;
846
- role: string;
847
- description?: string;
848
- }
849
- interface Validator {
850
- did: string;
851
- name: string;
852
- description: string;
853
- icon: string;
854
- amount: number;
855
- currency: string;
856
- commission: number;
857
- isStaked: boolean;
858
- isBonding: boolean;
859
- isActive: boolean;
860
- }
861
- interface Investment {
862
- did: string;
863
- name: string;
864
- icon: string;
865
- brand: string;
866
- isSubscribed: boolean;
867
- isOpen: boolean;
868
- currency: string;
869
- currentAmount: number;
870
- maxAmount: number;
871
- status: string;
872
- price: number;
873
- description?: string;
874
- }
875
- interface Collection {
876
- did: string;
877
- name: string;
878
- brand: string;
879
- icon: string;
880
- price: number;
881
- currency: string;
882
- totalAssets: number;
883
- description?: string;
884
- }
885
- interface Transaction {
886
- transactionHash: string;
887
- typeUrl: string;
888
- memo: string;
889
- time: string;
890
- description?: string;
891
- }
892
- interface Bid {
893
- id: string;
894
- did: string;
895
- collection: string;
896
- type: 'bid';
897
- address: string;
898
- data: string;
899
- role: string;
900
- created: string;
901
- }
902
- interface SubmitBidParams {
903
- collectionId: string;
904
- role: EAAgentRoles;
905
- surveyAnswers: any;
906
- }
907
- interface QueryBidsParams {
908
- collectionId: string;
909
- pagination?: {
910
- nextPageToken?: string;
911
- };
912
- }
913
- interface QueryBidsByDidParams {
914
- collectionId: string;
915
- did: string;
916
- }
917
- interface ApproveBidParams {
918
- bidId: string;
919
- collectionId: string;
920
- did: string;
921
- }
922
- interface RejectBidParams {
923
- bidId: string;
924
- collectionId: string;
925
- did: string;
926
- reason: string;
927
- }
928
- interface BidResponse {
929
- success: boolean;
930
- bidId: string;
931
- }
932
- interface QueryBidsResponse {
933
- data: Bid[];
934
- nextPageToken?: string;
935
- }
936
- declare enum EAAgentRoles {
937
- owners = "PO",
938
- evaluators = "EA",
939
- serviceProviders = "SA",
940
- investors = "IA"
941
- }
942
- declare enum AgentRole {
943
- Owner = "PO",// Collection Controller
944
- Evaluator = "EA",// Evaluator
945
- ServiceProvider = "SA",// Contributor/Service Agent
946
- Investor = "IA"
17
+ interface DelegationStore {
18
+ get: (capabilityId: string) => SignedCapability | null;
19
+ set: (capability: SignedCapability) => void;
20
+ remove: (capabilityId: string) => void;
21
+ getRoot: () => SignedCapability | null;
22
+ setRootId: (capabilityId: string) => void;
23
+ getAll: () => SignedCapability[];
24
+ has: (capabilityId: string) => boolean;
947
25
  }
948
- type CheckUserRoleParams = {
949
- /** Address to check role for */
950
- userAddress: string;
951
- /** Admin account address of the entity */
952
- adminAddress: string;
953
- /** Deed DID */
954
- deedDid: string;
955
- /** Claim collection IDs to check roles for */
956
- collectionIds: string[];
957
- };
958
- type ClaimCollectionRole = {
959
- collectionId: string;
960
- role: AgentRole;
961
- };
962
- type ClaimCollection = {
963
- id: string;
964
- name: string;
965
- description: string;
966
- entity: string;
967
- protocol: EntityNode | null;
968
- admin: string;
969
- };
970
- type ClaimCollectionResponse = {
971
- adminAddress: string;
972
- collections: ClaimCollection[];
973
- };
974
- type Claim = {
975
- claimId: string;
976
- collectionId: string;
977
- agentDid: string;
978
- agentAddress: string;
979
- submissionDate: string;
980
- paymentsStatus: {
981
- approval: string;
982
- rejection: string;
983
- evaluation: string;
984
- submission: string;
985
- };
986
- schemaType: string | null;
987
- };
988
- interface GetClaimsPerCollectionIdParams {
989
- collectionId: string;
990
- }
991
- interface GetClaimsPerUserAddressParams {
992
- collectionId: string;
993
- userAddress: string;
994
- }
995
- interface FAQItem {
996
- question: string;
997
- answer: string;
998
- }
999
- interface ContactInfo {
1000
- email: string;
1001
- location: string;
1002
- socialLinks: string[];
1003
- website: string;
1004
- }
1005
- interface Relationships {
1006
- funders?: string[];
1007
- memberOf?: string[];
1008
- partners?: string[];
1009
- }
1010
- interface LogoUrl {
1011
- alt: string;
1012
- url: string;
1013
- }
1014
- interface AdditionalProperties {
1015
- content_hashes?: Record<string, string>;
1016
- content_summaries?: Record<string, string>;
1017
- fetch_errors?: Array<{
1018
- error: string;
1019
- url: string;
1020
- }>;
1021
- last_fetch_date?: string;
1022
- }
1023
- interface Coordinates {
1024
- type: string;
1025
- coordinates: [number, number];
1026
- }
1027
- interface DomainCard {
1028
- additional_properties?: AdditionalProperties;
1029
- address?: string;
1030
- alternate_names?: string[];
1031
- area_served?: string;
1032
- categories?: string[];
1033
- contact?: ContactInfo;
1034
- coordinates?: Coordinates;
1035
- credential_type?: string[];
1036
- description?: string;
1037
- entity_type?: string[];
1038
- faq?: FAQItem[];
1039
- id: string;
1040
- image_urls?: Array<Record<string, any>>;
1041
- indexed_at?: string;
1042
- issuer?: string;
1043
- keywords?: string[];
1044
- knows_about?: string[];
1045
- location?: string;
1046
- logo_url?: LogoUrl;
1047
- name: string;
1048
- overview?: string;
1049
- relationships?: Relationships;
1050
- same_as?: string[];
1051
- schema_id?: string;
1052
- summary?: string;
1053
- updated_at?: string;
1054
- url?: string;
1055
- valid_from?: string;
1056
- }
1057
- interface AssetDetails extends Asset {
1058
- actionSections: SelectionActionSection[];
1059
- }
1060
- interface CollectionDetails extends Collection {
1061
- actionSections: SelectionActionSection[];
1062
- }
1063
- interface TransactionDetails extends Transaction {
1064
- actionSections: SelectionActionSection[];
1065
- }
1066
- interface InvestmentDetails extends Investment {
1067
- actionSections: SelectionActionSection[];
1068
- }
1069
- interface OracleDetails extends Oracle {
1070
- actionSections: SelectionActionSection[];
1071
- }
1072
- interface PODDetails extends POD {
1073
- actionSections: SelectionActionSection[];
1074
- }
1075
- interface ProposalDetails extends Proposal {
1076
- actionSections: SelectionActionSection[];
1077
- }
1078
- interface RequestDetails extends Request {
1079
- actionSections: SelectionActionSection[];
1080
- }
1081
- interface MemberDetails extends Member {
1082
- actionSections: SelectionActionSection[];
1083
- }
1084
- interface ValidatorDetails extends Validator {
1085
- actionSections: SelectionActionSection[];
1086
- }
1087
- interface LinkedResourceDetails extends LinkedResource {
1088
- actionSections: SelectionActionSection[];
1089
- }
1090
- interface DAOGroup {
1091
- id: string;
1092
- name: string;
1093
- coreAddress: string;
1094
- }
1095
- interface BlockRequirements {
1096
- proposal?: {
1097
- coreAddress: string;
1098
- };
1099
- }
1100
- interface VoteParams {
1101
- proposalId: number;
1102
- rationale?: string;
1103
- vote: Vote;
1104
- proposalContractAddress: string;
1105
- }
1106
- interface CreateProposalParams {
1107
- preProposalContractAddress: string;
1108
- title: string;
1109
- description: string;
1110
- actions?: ProposalAction[];
1111
- coreAddress?: string;
1112
- groupContractAddress?: string;
1113
- }
1114
- interface EmailNotificationParams {
1115
- channel: 'email';
1116
- to: string[];
1117
- cc?: string[];
1118
- bcc?: string[];
1119
- subject: string;
1120
- body: string;
1121
- bodyType?: 'text' | 'html';
1122
- from?: string;
1123
- replyTo?: string;
1124
- }
1125
- interface SmsNotificationParams {
1126
- channel: 'sms';
1127
- to: string[];
1128
- body: string;
1129
- }
1130
- interface WhatsAppNotificationParams {
1131
- channel: 'whatsapp';
1132
- to: string[];
1133
- body: string;
1134
- templateId?: string;
1135
- templateVariables?: Record<string, string>;
1136
- }
1137
- type NotificationParams = EmailNotificationParams | SmsNotificationParams | WhatsAppNotificationParams;
1138
- interface NotificationResponse {
1139
- messageId: string;
1140
- status: 'accepted' | 'rejected';
1141
- timestamp: string;
1142
- }
1143
- interface BlocknoteHandlers {
1144
- getVote: (proposalContractAddress: string, proposalId: string, userAddress: string) => Promise<VoteResponse>;
1145
- getProposal: (proposalContractAddress: string, proposalId: string) => Promise<ProposalResponse>;
1146
- getCurrentUser: () => User;
1147
- getMatrixInfoPerDid: (did: string) => Promise<IUserMatrixProfile>;
1148
- getDaoGroupsIds: () => Promise<string[] | undefined>;
1149
- getDAOGroups: () => Promise<DAOGroup[]>;
1150
- getRelayerDid: () => string | undefined;
1151
- getEntityDid: () => string | undefined;
1152
- vote: ({ proposalId, rationale, vote, proposalContractAddress }: VoteParams) => Promise<void>;
1153
- createProposal: (params: CreateProposalParams) => Promise<string>;
1154
- getEntity: (did: string) => Promise<EntityResponse$1>;
1155
- getDomainCard: () => Promise<DomainCard>;
1156
- askCompanion: (prompt: string) => Promise<void>;
1157
- getAssets: (collectionDid: string, page: number, ownerAddress?: string) => Promise<{
1158
- data: Asset[];
1159
- totalCount: number;
1160
- }>;
1161
- getCollections: (relayerDid: string, page: number) => Promise<{
1162
- data: Collection[];
1163
- totalCount: number;
1164
- }>;
1165
- getTransactions: (address: string, page: number) => Promise<{
1166
- data: Transaction[];
1167
- totalCount: number;
1168
- }>;
1169
- getInvestments: (relayerDid: string, page: number) => Promise<{
1170
- data: Investment[];
1171
- totalCount: number;
1172
- }>;
1173
- getOracles: (relayerDid: string, page: number) => Promise<{
1174
- data: Oracle[];
1175
- totalCount: number;
1176
- }>;
1177
- getPODs: (relayerDid: string, page: number) => Promise<{
1178
- data: POD[];
1179
- totalCount: number;
1180
- }>;
1181
- getProposals: (relayerDid: string, page: number) => Promise<{
1182
- data: Proposal[];
1183
- totalCount: number;
1184
- }>;
1185
- getRequests: (relayerDid: string, page: number) => Promise<{
1186
- data: Request[];
1187
- totalCount: number;
1188
- }>;
1189
- getDaos: (relayerDid: string, page: number) => Promise<{
1190
- data: Dao[];
1191
- totalCount: number;
1192
- }>;
1193
- getProjects: (relayerDid: string, page: number) => Promise<{
1194
- data: Project[];
1195
- totalCount: number;
1196
- }>;
1197
- getMembers: (address: string, groupCoreAddress: string, withBalance: boolean, page: number) => Promise<{
1198
- data: Member[];
1199
- totalCount: number;
1200
- }>;
1201
- getDaoMembers: (address: string, groupIds: string[], withBalance: boolean, page: number) => Promise<{
1202
- data: Member[];
1203
- totalCount: number;
1204
- }>;
1205
- getValidators: (relayerDid: string, page: number) => Promise<{
1206
- data: Validator[];
1207
- totalCount: number;
1208
- }>;
1209
- executeProposal: (params: {
1210
- proposalId: number;
1211
- proposalContractAddress: string;
1212
- }) => Promise<void>;
1213
- getProposalContractAddress: (params: {
1214
- coreAddress: string;
1215
- }) => Promise<{
1216
- proposalContractAddress: string;
1217
- }>;
1218
- getPreProposalContractAddress: (params: {
1219
- coreAddress: string;
1220
- }) => Promise<{
1221
- preProposalContractAddress: string;
1222
- }>;
1223
- getGroupContractAddress: (params: {
1224
- coreAddress: string;
1225
- }) => Promise<{
1226
- groupContractAddress: string;
1227
- }>;
1228
- getBalances: (address: string) => Promise<{
1229
- data: Balance[];
1230
- }>;
1231
- sendNotification: (params: NotificationParams) => Promise<NotificationResponse>;
1232
- getAssetDetails?: (id: string) => Promise<AssetDetails>;
1233
- getCollectionDetails?: (id: string) => Promise<CollectionDetails>;
1234
- getTransactionDetails?: (id: string) => Promise<TransactionDetails>;
1235
- getInvestmentDetails?: (id: string) => Promise<InvestmentDetails>;
1236
- getOracleDetails?: (id: string) => Promise<OracleDetails>;
1237
- getPODDetails?: (id: string) => Promise<PODDetails>;
1238
- getProposalDetails?: (id: string) => Promise<ProposalDetails>;
1239
- getRequestDetails?: (id: string) => Promise<RequestDetails>;
1240
- getMemberDetails?: (id: string) => Promise<MemberDetails>;
1241
- getValidatorDetails?: (id: string) => Promise<ValidatorDetails>;
1242
- getLinkedResourceDetails?: (id: string) => Promise<LinkedResourceDetails>;
1243
- getDaoMemberDetails?: (id: string) => Promise<MemberDetails>;
1244
- getDeedSurveyTemplate: (deedDid: string) => Promise<{
1245
- surveyTemplate: any;
1246
- claimCollectionId: string;
1247
- } | null>;
1248
- submitClaim: (params: {
1249
- surveyData: any;
1250
- deedDid: string;
1251
- collectionId: string;
1252
- adminAddress: string;
1253
- pin: string;
1254
- }) => Promise<{
1255
- transactionHash: string;
1256
- claimId: string;
1257
- }>;
1258
- requestPin: (config?: {
1259
- title?: string;
1260
- description?: string;
1261
- submitText?: string;
1262
- }) => Promise<string>;
1263
- getClaimCollections: (params: {
1264
- deedDid: string;
1265
- }) => Promise<ClaimCollectionResponse>;
1266
- getClaimsPerCollectionId: (params: GetClaimsPerCollectionIdParams) => Promise<Claim[]>;
1267
- getClaimsPerUserAddress: (params: GetClaimsPerUserAddressParams) => Promise<Claim[]>;
1268
- getClaimData: (collectionId: string, claimId: string) => Promise<any>;
1269
- evaluateClaim: (granteeAddress: string, did: string, payload: {
1270
- claimId: string;
1271
- collectionId: string;
1272
- adminAddress: string;
1273
- status?: number;
1274
- verificationProof: string;
1275
- amount?: Coin;
1276
- }) => Promise<void>;
1277
- submitBid: (params: SubmitBidParams) => Promise<BidResponse>;
1278
- queryBids: (params: QueryBidsParams) => Promise<QueryBidsResponse>;
1279
- queryBidsByDid: (params: QueryBidsByDidParams) => Promise<{
1280
- data: Bid[];
1281
- }>;
1282
- approveBid: (params: ApproveBidParams) => Promise<BidResponse>;
1283
- rejectBid: (params: RejectBidParams) => Promise<BidResponse>;
1284
- getUserRoles: (params: CheckUserRoleParams) => Promise<ClaimCollectionRole[]>;
1285
- getBidContributorSurveyTemplate: (deedId: string) => Promise<{
1286
- surveyTemplate: any;
1287
- } | null>;
1288
- getBidEvaluatorSurveyTemplate: (deedId: string) => Promise<{
1289
- surveyTemplate: any;
1290
- } | null>;
1291
- approveServiceAgentApplication: (params: {
1292
- adminAddress: string;
1293
- collectionId: string;
1294
- agentQuota: number;
1295
- deedDid: string;
1296
- currentUserAddress: string;
1297
- }) => Promise<void>;
1298
- approveEvaluatorApplication: (params: {
1299
- adminAddress: string;
1300
- collectionId: string;
1301
- deedDid: string;
1302
- evaluatorAddress: string;
1303
- agentQuota?: number;
1304
- claimIds?: string[];
1305
- maxAmounts?: Coin[];
1306
- }) => Promise<void>;
1307
- publicFileUpload: (file: File) => Promise<{
1308
- encrypted: string;
1309
- cid: string;
1310
- proof: string;
1311
- serviceEndpoint: string;
1312
- url: string;
1313
- mxc: string;
1314
- }>;
1315
- }
1316
- type DocType = 'template' | 'page' | 'flow';
1317
- interface BlocknoteContextValue {
1318
- editor?: IxoEditorType;
1319
- handlers?: BlocknoteHandlers;
1320
- blockRequirements?: BlockRequirements;
1321
- editable?: boolean;
1322
- docType: DocType;
1323
- sharedProposals: SharedProposalData;
1324
- fetchSharedProposal: (proposalId: string, contractAddress: string, force?: boolean) => Promise<ProposalResponse>;
1325
- invalidateProposal: (proposalId: string) => void;
1326
- subscribeToProposal: (proposalId: string) => ProposalResponse | undefined;
1327
- activeDrawerId: string | null;
1328
- drawerContent: React.ReactNode | null;
1329
- openDrawer: (id: string, content: React.ReactNode) => void;
1330
- closeDrawer: () => void;
1331
- }
1332
- declare const BlocknoteProvider: React.FC<{
1333
- children: React.ReactNode;
1334
- editor?: IxoEditorType;
1335
- handlers?: BlocknoteHandlers;
1336
- blockRequirements?: BlockRequirements;
1337
- editable?: boolean;
1338
- }>;
1339
- declare const useBlocknoteContext: () => BlocknoteContextValue;
1340
- declare const useBlocknoteHandlers: () => BlocknoteHandlers;
1341
-
1342
- interface SelectionActionItem {
1343
- id: string;
1344
- label: string;
1345
- icon?: string;
1346
- onClick: (itemId: string, itemData: any) => void | Promise<void>;
1347
- }
1348
- interface SelectionActionSection {
1349
- title: string;
1350
- description?: string;
1351
- actions: SelectionActionItem[];
1352
- }
1353
-
1354
- interface OverviewBlockProps {
1355
- block: any;
1356
- editor: any;
1357
- }
1358
- declare const OverviewBlock: {
1359
- config: {
1360
- readonly type: "overview";
1361
- readonly propSchema: {};
1362
- readonly content: "none";
1363
- };
1364
- implementation: _blocknote_core.TiptapBlockImplementation<{
1365
- readonly type: "overview";
1366
- readonly propSchema: {};
1367
- readonly content: "none";
1368
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1369
- };
1370
-
1371
- declare const ProposalBlockSpec: {
1372
- config: {
1373
- readonly type: "proposal";
1374
- readonly propSchema: {
1375
- readonly status: {
1376
- readonly default: "draft";
1377
- readonly values: readonly ["draft", "open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
1378
- };
1379
- readonly title: {
1380
- readonly default: "";
1381
- };
1382
- readonly description: {
1383
- readonly default: "";
1384
- };
1385
- readonly icon: {
1386
- readonly default: "file-text";
1387
- };
1388
- readonly proposalId: {
1389
- readonly default: "";
1390
- };
1391
- readonly actions: {
1392
- readonly default: "[]";
1393
- };
1394
- readonly voteEnabled: {
1395
- readonly default: true;
1396
- };
1397
- readonly voteTitle: {
1398
- readonly default: "";
1399
- };
1400
- readonly voteSubtitle: {
1401
- readonly default: "";
1402
- };
1403
- readonly voteIcon: {
1404
- readonly default: "checklist";
1405
- };
1406
- readonly daysLeft: {
1407
- readonly default: 0;
1408
- };
1409
- readonly proposalContractAddress: {
1410
- readonly default: "";
1411
- };
1412
- readonly coreAddress: {
1413
- readonly default: "";
1414
- };
1415
- readonly conditions: {
1416
- readonly default: "";
1417
- };
1418
- };
1419
- readonly content: "none";
1420
- };
1421
- implementation: _blocknote_core.TiptapBlockImplementation<{
1422
- readonly type: "proposal";
1423
- readonly propSchema: {
1424
- readonly status: {
1425
- readonly default: "draft";
1426
- readonly values: readonly ["draft", "open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
1427
- };
1428
- readonly title: {
1429
- readonly default: "";
1430
- };
1431
- readonly description: {
1432
- readonly default: "";
1433
- };
1434
- readonly icon: {
1435
- readonly default: "file-text";
1436
- };
1437
- readonly proposalId: {
1438
- readonly default: "";
1439
- };
1440
- readonly actions: {
1441
- readonly default: "[]";
1442
- };
1443
- readonly voteEnabled: {
1444
- readonly default: true;
1445
- };
1446
- readonly voteTitle: {
1447
- readonly default: "";
1448
- };
1449
- readonly voteSubtitle: {
1450
- readonly default: "";
1451
- };
1452
- readonly voteIcon: {
1453
- readonly default: "checklist";
1454
- };
1455
- readonly daysLeft: {
1456
- readonly default: 0;
1457
- };
1458
- readonly proposalContractAddress: {
1459
- readonly default: "";
1460
- };
1461
- readonly coreAddress: {
1462
- readonly default: "";
1463
- };
1464
- readonly conditions: {
1465
- readonly default: "";
1466
- };
1467
- };
1468
- readonly content: "none";
1469
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1470
- };
1471
-
1472
- type ProposalBlockProps = IxoBlockProps;
1473
-
1474
- declare const ApiRequestBlockSpec: {
1475
- config: {
1476
- readonly type: "apiRequest";
1477
- readonly propSchema: {
1478
- readonly title: {
1479
- readonly default: "";
1480
- };
1481
- readonly description: {
1482
- readonly default: "";
1483
- };
1484
- readonly icon: {
1485
- readonly default: "square-check";
1486
- };
1487
- readonly endpoint: {
1488
- readonly default: "";
1489
- };
1490
- readonly method: {
1491
- readonly default: "GET";
1492
- };
1493
- readonly headers: {
1494
- readonly default: "[]";
1495
- };
1496
- readonly body: {
1497
- readonly default: "[]";
1498
- };
1499
- readonly response: {
1500
- readonly default: "";
1501
- };
1502
- readonly status: {
1503
- readonly default: "idle";
1504
- };
1505
- readonly responseSchema: {
1506
- readonly default: "";
1507
- };
1508
- readonly conditions: {
1509
- readonly default: "";
1510
- };
1511
- };
1512
- readonly content: "inline";
1513
- };
1514
- implementation: _blocknote_core.TiptapBlockImplementation<{
1515
- readonly type: "apiRequest";
1516
- readonly propSchema: {
1517
- readonly title: {
1518
- readonly default: "";
1519
- };
1520
- readonly description: {
1521
- readonly default: "";
1522
- };
1523
- readonly icon: {
1524
- readonly default: "square-check";
1525
- };
1526
- readonly endpoint: {
1527
- readonly default: "";
1528
- };
1529
- readonly method: {
1530
- readonly default: "GET";
1531
- };
1532
- readonly headers: {
1533
- readonly default: "[]";
1534
- };
1535
- readonly body: {
1536
- readonly default: "[]";
1537
- };
1538
- readonly response: {
1539
- readonly default: "";
1540
- };
1541
- readonly status: {
1542
- readonly default: "idle";
1543
- };
1544
- readonly responseSchema: {
1545
- readonly default: "";
1546
- };
1547
- readonly conditions: {
1548
- readonly default: "";
1549
- };
1550
- };
1551
- readonly content: "inline";
1552
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1553
- };
1554
-
1555
- type ApiRequestBlockProps = IxoBlockProps;
1556
- type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
1557
- type KeyValuePair = {
1558
- key: string;
1559
- value: string;
1560
- };
1561
-
1562
- declare const blockSpecs: {
1563
- checkbox: {
1564
- config: {
1565
- readonly type: "checkbox";
1566
- readonly propSchema: {
1567
- readonly checked: {
1568
- readonly default: false;
1569
- };
1570
- readonly allowedCheckers: {
1571
- readonly default: "all";
1572
- };
1573
- readonly initialChecked: {
1574
- readonly default: false;
1575
- };
1576
- readonly title: {
1577
- readonly default: "";
1578
- };
1579
- readonly description: {
1580
- readonly default: "";
1581
- };
1582
- readonly icon: {
1583
- readonly default: "square-check";
1584
- };
1585
- readonly conditions: {
1586
- readonly default: "";
1587
- };
1588
- };
1589
- readonly content: "inline";
1590
- };
1591
- implementation: _blocknote_core.TiptapBlockImplementation<{
1592
- readonly type: "checkbox";
1593
- readonly propSchema: {
1594
- readonly checked: {
1595
- readonly default: false;
1596
- };
1597
- readonly allowedCheckers: {
1598
- readonly default: "all";
1599
- };
1600
- readonly initialChecked: {
1601
- readonly default: false;
1602
- };
1603
- readonly title: {
1604
- readonly default: "";
1605
- };
1606
- readonly description: {
1607
- readonly default: "";
1608
- };
1609
- readonly icon: {
1610
- readonly default: "square-check";
1611
- };
1612
- readonly conditions: {
1613
- readonly default: "";
1614
- };
1615
- };
1616
- readonly content: "inline";
1617
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1618
- };
1619
- list: {
1620
- config: {
1621
- readonly type: "list";
1622
- readonly propSchema: {
1623
- readonly listType: {
1624
- readonly default: "";
1625
- };
1626
- readonly sort: {
1627
- readonly default: "{}";
1628
- };
1629
- readonly filter: {
1630
- readonly default: "{}";
1631
- };
1632
- readonly filterOptions: {
1633
- readonly default: "{}";
1634
- };
1635
- readonly sortOptions: {
1636
- readonly default: "{}";
1637
- };
1638
- readonly listConfig: {
1639
- readonly default: "{}";
1640
- };
1641
- readonly icon: {
1642
- readonly default: "📋";
1643
- };
1644
- };
1645
- readonly content: "none";
1646
- };
1647
- implementation: _blocknote_core.TiptapBlockImplementation<{
1648
- readonly type: "list";
1649
- readonly propSchema: {
1650
- readonly listType: {
1651
- readonly default: "";
1652
- };
1653
- readonly sort: {
1654
- readonly default: "{}";
1655
- };
1656
- readonly filter: {
1657
- readonly default: "{}";
1658
- };
1659
- readonly filterOptions: {
1660
- readonly default: "{}";
1661
- };
1662
- readonly sortOptions: {
1663
- readonly default: "{}";
1664
- };
1665
- readonly listConfig: {
1666
- readonly default: "{}";
1667
- };
1668
- readonly icon: {
1669
- readonly default: "📋";
1670
- };
1671
- };
1672
- readonly content: "none";
1673
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1674
- };
1675
- enumChecklist: {
1676
- config: {
1677
- readonly type: "enumChecklist";
1678
- readonly propSchema: {
1679
- readonly listType: {
1680
- readonly default: "";
1681
- };
1682
- readonly listConfig: {
1683
- readonly default: "{}";
1684
- };
1685
- readonly selectedIds: {
1686
- readonly default: "[]";
1687
- };
1688
- };
1689
- readonly content: "none";
1690
- };
1691
- implementation: _blocknote_core.TiptapBlockImplementation<{
1692
- readonly type: "enumChecklist";
1693
- readonly propSchema: {
1694
- readonly listType: {
1695
- readonly default: "";
1696
- };
1697
- readonly listConfig: {
1698
- readonly default: "{}";
1699
- };
1700
- readonly selectedIds: {
1701
- readonly default: "[]";
1702
- };
1703
- };
1704
- readonly content: "none";
1705
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1706
- };
1707
- overview: {
1708
- config: {
1709
- readonly type: "overview";
1710
- readonly propSchema: {};
1711
- readonly content: "none";
1712
- };
1713
- implementation: _blocknote_core.TiptapBlockImplementation<{
1714
- readonly type: "overview";
1715
- readonly propSchema: {};
1716
- readonly content: "none";
1717
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1718
- };
1719
- proposal: {
1720
- config: {
1721
- readonly type: "proposal";
1722
- readonly propSchema: {
1723
- readonly status: {
1724
- readonly default: "draft";
1725
- readonly values: readonly ["draft", "open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
1726
- };
1727
- readonly title: {
1728
- readonly default: "";
1729
- };
1730
- readonly description: {
1731
- readonly default: "";
1732
- };
1733
- readonly icon: {
1734
- readonly default: "file-text";
1735
- };
1736
- readonly proposalId: {
1737
- readonly default: "";
1738
- };
1739
- readonly actions: {
1740
- readonly default: "[]";
1741
- };
1742
- readonly voteEnabled: {
1743
- readonly default: true;
1744
- };
1745
- readonly voteTitle: {
1746
- readonly default: "";
1747
- };
1748
- readonly voteSubtitle: {
1749
- readonly default: "";
1750
- };
1751
- readonly voteIcon: {
1752
- readonly default: "checklist";
1753
- };
1754
- readonly daysLeft: {
1755
- readonly default: 0;
1756
- };
1757
- readonly proposalContractAddress: {
1758
- readonly default: "";
1759
- };
1760
- readonly coreAddress: {
1761
- readonly default: "";
1762
- };
1763
- readonly conditions: {
1764
- readonly default: "";
1765
- };
1766
- };
1767
- readonly content: "none";
1768
- };
1769
- implementation: _blocknote_core.TiptapBlockImplementation<{
1770
- readonly type: "proposal";
1771
- readonly propSchema: {
1772
- readonly status: {
1773
- readonly default: "draft";
1774
- readonly values: readonly ["draft", "open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
1775
- };
1776
- readonly title: {
1777
- readonly default: "";
1778
- };
1779
- readonly description: {
1780
- readonly default: "";
1781
- };
1782
- readonly icon: {
1783
- readonly default: "file-text";
1784
- };
1785
- readonly proposalId: {
1786
- readonly default: "";
1787
- };
1788
- readonly actions: {
1789
- readonly default: "[]";
1790
- };
1791
- readonly voteEnabled: {
1792
- readonly default: true;
1793
- };
1794
- readonly voteTitle: {
1795
- readonly default: "";
1796
- };
1797
- readonly voteSubtitle: {
1798
- readonly default: "";
1799
- };
1800
- readonly voteIcon: {
1801
- readonly default: "checklist";
1802
- };
1803
- readonly daysLeft: {
1804
- readonly default: 0;
1805
- };
1806
- readonly proposalContractAddress: {
1807
- readonly default: "";
1808
- };
1809
- readonly coreAddress: {
1810
- readonly default: "";
1811
- };
1812
- readonly conditions: {
1813
- readonly default: "";
1814
- };
1815
- };
1816
- readonly content: "none";
1817
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1818
- };
1819
- apiRequest: {
1820
- config: {
1821
- readonly type: "apiRequest";
1822
- readonly propSchema: {
1823
- readonly title: {
1824
- readonly default: "";
1825
- };
1826
- readonly description: {
1827
- readonly default: "";
1828
- };
1829
- readonly icon: {
1830
- readonly default: "square-check";
1831
- };
1832
- readonly endpoint: {
1833
- readonly default: "";
1834
- };
1835
- readonly method: {
1836
- readonly default: "GET";
1837
- };
1838
- readonly headers: {
1839
- readonly default: "[]";
1840
- };
1841
- readonly body: {
1842
- readonly default: "[]";
1843
- };
1844
- readonly response: {
1845
- readonly default: "";
1846
- };
1847
- readonly status: {
1848
- readonly default: "idle";
1849
- };
1850
- readonly responseSchema: {
1851
- readonly default: "";
1852
- };
1853
- readonly conditions: {
1854
- readonly default: "";
1855
- };
1856
- };
1857
- readonly content: "inline";
1858
- };
1859
- implementation: _blocknote_core.TiptapBlockImplementation<{
1860
- readonly type: "apiRequest";
1861
- readonly propSchema: {
1862
- readonly title: {
1863
- readonly default: "";
1864
- };
1865
- readonly description: {
1866
- readonly default: "";
1867
- };
1868
- readonly icon: {
1869
- readonly default: "square-check";
1870
- };
1871
- readonly endpoint: {
1872
- readonly default: "";
1873
- };
1874
- readonly method: {
1875
- readonly default: "GET";
1876
- };
1877
- readonly headers: {
1878
- readonly default: "[]";
1879
- };
1880
- readonly body: {
1881
- readonly default: "[]";
1882
- };
1883
- readonly response: {
1884
- readonly default: "";
1885
- };
1886
- readonly status: {
1887
- readonly default: "idle";
1888
- };
1889
- readonly responseSchema: {
1890
- readonly default: "";
1891
- };
1892
- readonly conditions: {
1893
- readonly default: "";
1894
- };
1895
- };
1896
- readonly content: "inline";
1897
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1898
- };
1899
- notify: {
1900
- config: {
1901
- readonly type: "notify";
1902
- readonly propSchema: {
1903
- readonly title: {
1904
- readonly default: "";
1905
- };
1906
- readonly description: {
1907
- readonly default: "";
1908
- };
1909
- readonly icon: {
1910
- readonly default: "bell";
1911
- };
1912
- readonly channel: {
1913
- readonly default: "email";
1914
- };
1915
- readonly to: {
1916
- readonly default: "[]";
1917
- };
1918
- readonly cc: {
1919
- readonly default: "[]";
1920
- };
1921
- readonly bcc: {
1922
- readonly default: "[]";
1923
- };
1924
- readonly subject: {
1925
- readonly default: "";
1926
- };
1927
- readonly body: {
1928
- readonly default: "";
1929
- };
1930
- readonly bodyType: {
1931
- readonly default: "text";
1932
- };
1933
- readonly from: {
1934
- readonly default: "";
1935
- };
1936
- readonly replyTo: {
1937
- readonly default: "";
1938
- };
1939
- readonly templateId: {
1940
- readonly default: "";
1941
- };
1942
- readonly templateVariables: {
1943
- readonly default: "{}";
1944
- };
1945
- readonly status: {
1946
- readonly default: "idle";
1947
- };
1948
- readonly messageId: {
1949
- readonly default: "";
1950
- };
1951
- readonly sentAt: {
1952
- readonly default: "";
1953
- };
1954
- readonly errorMessage: {
1955
- readonly default: "";
1956
- };
1957
- readonly conditions: {
1958
- readonly default: "";
1959
- };
1960
- };
1961
- readonly content: "inline";
1962
- };
1963
- implementation: _blocknote_core.TiptapBlockImplementation<{
1964
- readonly type: "notify";
1965
- readonly propSchema: {
1966
- readonly title: {
1967
- readonly default: "";
1968
- };
1969
- readonly description: {
1970
- readonly default: "";
1971
- };
1972
- readonly icon: {
1973
- readonly default: "bell";
1974
- };
1975
- readonly channel: {
1976
- readonly default: "email";
1977
- };
1978
- readonly to: {
1979
- readonly default: "[]";
1980
- };
1981
- readonly cc: {
1982
- readonly default: "[]";
1983
- };
1984
- readonly bcc: {
1985
- readonly default: "[]";
1986
- };
1987
- readonly subject: {
1988
- readonly default: "";
1989
- };
1990
- readonly body: {
1991
- readonly default: "";
1992
- };
1993
- readonly bodyType: {
1994
- readonly default: "text";
1995
- };
1996
- readonly from: {
1997
- readonly default: "";
1998
- };
1999
- readonly replyTo: {
2000
- readonly default: "";
2001
- };
2002
- readonly templateId: {
2003
- readonly default: "";
2004
- };
2005
- readonly templateVariables: {
2006
- readonly default: "{}";
2007
- };
2008
- readonly status: {
2009
- readonly default: "idle";
2010
- };
2011
- readonly messageId: {
2012
- readonly default: "";
2013
- };
2014
- readonly sentAt: {
2015
- readonly default: "";
2016
- };
2017
- readonly errorMessage: {
2018
- readonly default: "";
2019
- };
2020
- readonly conditions: {
2021
- readonly default: "";
2022
- };
2023
- };
2024
- readonly content: "inline";
2025
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
2026
- };
2027
- claim: {
2028
- config: {
2029
- readonly type: "claim";
2030
- readonly propSchema: {
2031
- readonly title: {
2032
- readonly default: "";
2033
- };
2034
- readonly description: {
2035
- readonly default: "";
2036
- };
2037
- readonly icon: {
2038
- readonly default: "square-check";
2039
- };
2040
- readonly deedDid: {
2041
- readonly default: "";
2042
- };
2043
- readonly selectedCollections: {
2044
- readonly default: "[]";
2045
- };
2046
- readonly adminAddress: {
2047
- readonly default: "";
2048
- };
2049
- };
2050
- readonly content: "none";
2051
- };
2052
- implementation: _blocknote_core.TiptapBlockImplementation<{
2053
- readonly type: "claim";
2054
- readonly propSchema: {
2055
- readonly title: {
2056
- readonly default: "";
2057
- };
2058
- readonly description: {
2059
- readonly default: "";
2060
- };
2061
- readonly icon: {
2062
- readonly default: "square-check";
2063
- };
2064
- readonly deedDid: {
2065
- readonly default: "";
2066
- };
2067
- readonly selectedCollections: {
2068
- readonly default: "[]";
2069
- };
2070
- readonly adminAddress: {
2071
- readonly default: "";
2072
- };
2073
- };
2074
- readonly content: "none";
2075
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
2076
- };
2077
- bid: {
2078
- config: {
2079
- readonly type: "bid";
2080
- readonly propSchema: {
2081
- readonly title: {
2082
- readonly default: "";
2083
- };
2084
- readonly description: {
2085
- readonly default: "";
2086
- };
2087
- readonly did: {
2088
- readonly default: "";
2089
- };
2090
- readonly selectedCollections: {
2091
- readonly default: "[]";
2092
- };
2093
- readonly adminAddress: {
2094
- readonly default: "";
2095
- };
2096
- };
2097
- readonly content: "none";
2098
- };
2099
- implementation: _blocknote_core.TiptapBlockImplementation<{
2100
- readonly type: "bid";
2101
- readonly propSchema: {
2102
- readonly title: {
2103
- readonly default: "";
2104
- };
2105
- readonly description: {
2106
- readonly default: "";
2107
- };
2108
- readonly did: {
2109
- readonly default: "";
2110
- };
2111
- readonly selectedCollections: {
2112
- readonly default: "[]";
2113
- };
2114
- readonly adminAddress: {
2115
- readonly default: "";
2116
- };
2117
- };
2118
- readonly content: "none";
2119
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
2120
- };
2121
- evaluator: {
2122
- config: {
2123
- readonly type: "evaluator";
2124
- readonly propSchema: {
2125
- readonly title: {
2126
- readonly default: "";
2127
- };
2128
- readonly description: {
2129
- readonly default: "";
2130
- };
2131
- readonly icon: {
2132
- readonly default: "checklist";
2133
- };
2134
- readonly deedDid: {
2135
- readonly default: "";
2136
- };
2137
- readonly selectedCollections: {
2138
- readonly default: "[]";
2139
- };
2140
- readonly adminAddress: {
2141
- readonly default: "";
2142
- };
2143
- };
2144
- readonly content: "none";
2145
- };
2146
- implementation: _blocknote_core.TiptapBlockImplementation<{
2147
- readonly type: "evaluator";
2148
- readonly propSchema: {
2149
- readonly title: {
2150
- readonly default: "";
2151
- };
2152
- readonly description: {
2153
- readonly default: "";
2154
- };
2155
- readonly icon: {
2156
- readonly default: "checklist";
2157
- };
2158
- readonly deedDid: {
2159
- readonly default: "";
2160
- };
2161
- readonly selectedCollections: {
2162
- readonly default: "[]";
2163
- };
2164
- readonly adminAddress: {
2165
- readonly default: "";
2166
- };
2167
- };
2168
- readonly content: "none";
2169
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
2170
- };
2171
- };
2172
- declare const getExtraSlashMenuItems: (editor: any) => {
2173
- title: string;
2174
- onItemClick: () => void;
2175
- aliases: string[];
2176
- group: string;
2177
- subtext: string;
2178
- }[];
2179
-
2180
26
  /**
2181
- * Page metadata stored in Matrix state events
2182
- * Now stores only URL strings in separate events
27
+ * Create a delegation store backed by Y.Map
2183
28
  */
2184
- interface PageMetadata {
2185
- /** Cover image URL */
2186
- cover?: string;
2187
- /** Icon/logo image URL */
2188
- icon?: string;
2189
- }
29
+ declare const createDelegationStore: (yMap: Map<any>) => DelegationStore;
2190
30
  /**
2191
- * Callback type for metadata change subscriptions
31
+ * Create an in-memory delegation store (for testing or when Y.Map unavailable)
2192
32
  */
2193
- type MetadataChangeCallback = (metadata: PageMetadata) => void;
2194
- /**
2195
- * Manager for Matrix state events containing page metadata (cover, icon)
2196
- *
2197
- * Stores cover and icon as separate state events, each containing only the URL string.
2198
- */
2199
- declare class MatrixMetadataManager {
2200
- private matrixClient;
2201
- private roomId;
2202
- private subscribers;
2203
- private eventHandler;
2204
- constructor(matrixClient: MatrixClient, roomId: string);
2205
- /**
2206
- * Set up Matrix event listener for real-time updates
2207
- */
2208
- private setupEventListener;
2209
- /**
2210
- * Notify all subscribers of metadata changes
2211
- */
2212
- private notifySubscribers;
2213
- /**
2214
- * Send metadata to Matrix state events (separate events for cover and icon)
2215
- *
2216
- * @param metadata - The metadata to store (only URL strings)
2217
- * @param permissions - Permission check object
2218
- * @returns Promise that resolves when state events are sent
2219
- */
2220
- setMetadata(metadata: PageMetadata, permissions: {
2221
- write: boolean;
2222
- }): Promise<void>;
2223
- /**
2224
- * Get current metadata from Matrix state (reads from separate events)
2225
- *
2226
- * @returns Current metadata or null if not set
2227
- */
2228
- getMetadata(): PageMetadata | null;
2229
- /**
2230
- * Subscribe to metadata changes
2231
- *
2232
- * @param callback - Function to call when metadata changes
2233
- * @returns Unsubscribe function
2234
- */
2235
- subscribe(callback: MetadataChangeCallback): () => void;
2236
- /**
2237
- * Clean up event listeners and subscriptions
2238
- * Call this when the manager is no longer needed
2239
- */
2240
- dispose(): void;
2241
- }
33
+ declare const createMemoryDelegationStore: () => DelegationStore;
2242
34
 
2243
- /**
2244
- * The schema type for the IXO editor, derived from block specs
2245
- */
2246
- type IxoBlockSchema = BlockSchemaFromSpecs<typeof blockSpecs>;
2247
- /**
2248
- * Editor mode representing different use cases
2249
- */
2250
- type EditorMode = 'flow' | 'template' | 'readonly';
2251
- /**
2252
- * Flow metadata stored in the Y.Doc root map
2253
- */
2254
- interface FlowMetadata {
2255
- '@context': string;
2256
- _type: string;
2257
- schema_version: string;
2258
- doc_id: string;
2259
- title: string;
2260
- createdAt: string;
2261
- createdBy: string;
2262
- }
2263
- /**
2264
- * Image data returned from publicFileUpload handler
2265
- */
2266
- interface ImageData {
2267
- url: string;
2268
- cid: string;
2269
- encrypted: string;
2270
- proof: string;
2271
- serviceEndpoint: string;
2272
- mxc: string;
2273
- }
2274
- /**
2275
- * Extended editor type that augments BlockNoteEditor with IXO-specific properties
2276
- * and methods. This type should be used throughout the application instead of
2277
- * the base BlockNoteEditor type.
2278
- *
2279
- * Type Parameters:
2280
- * - BSchema: The block schema (defaults to IxoBlockSchema)
2281
- * - ISchema: The inline content schema (uses BlockNote defaults)
2282
- * - SSchema: The style schema (uses BlockNote defaults)
2283
- */
2284
- interface IxoEditorType<BSchema extends IxoBlockSchema = IxoBlockSchema, ISchema extends InlineContentSchema = InlineContentSchema, SSchema extends StyleSchema = StyleSchema> extends BlockNoteEditor<BSchema, ISchema, SSchema> {
2285
- /**
2286
- * Configuration options for the editor
2287
- * @internal
2288
- */
2289
- _ixoConfig: IxoEditorConfig;
2290
- /**
2291
- * Y.Doc root map for collaborative metadata storage
2292
- * @internal
2293
- */
2294
- _yRoot?: Map<any>;
2295
- /**
2296
- * Y.Array for flow-specific structured block storage
2297
- * @internal
2298
- */
2299
- _yFlow?: Array$1<any>;
2300
- /**
2301
- * Current editor mode (flow, template, readonly)
2302
- */
2303
- mode?: EditorMode;
2304
- /**
2305
- * Current user information (for collaborative editing)
2306
- */
2307
- user?: IxoCollaborativeUser;
2308
- /**
2309
- * Document type (template, flow, page)
2310
- * This is a local prop-based value, NOT synced via CRDT
2311
- */
2312
- docType?: 'template' | 'flow' | 'page';
2313
- /**
2314
- * Get user-specific properties for a block
2315
- * @param block - The block to get user properties for
2316
- * @returns User-specific properties object
2317
- */
2318
- getUserProps?: (block: any) => Record<string, any>;
2319
- /**
2320
- * Update user-specific properties for a block
2321
- * @param block - The block to update
2322
- * @param updates - Properties to update
2323
- */
2324
- updateUserProps?: (block: any, updates: Record<string, any>) => void;
2325
- /**
2326
- * Get flow-level metadata
2327
- * @returns Flow metadata object
2328
- */
2329
- getFlowMetadata?: () => FlowMetadata;
2330
- /**
2331
- * Update flow-level metadata
2332
- * @param updates - Metadata fields to update
2333
- */
2334
- updateFlowMetadata?: (updates: Partial<FlowMetadata>) => void;
2335
- /**
2336
- * Get the flow array (structured block storage)
2337
- * @returns Array of flow blocks
2338
- */
2339
- getFlow?: () => any[];
2340
- /**
2341
- * Matrix metadata manager for page metadata (cover, icon)
2342
- * @internal
2343
- */
2344
- _metadataManager?: MatrixMetadataManager;
2345
- /**
2346
- * Set page metadata (cover image and/or icon)
2347
- * @param metadata - Partial metadata to update (merges with existing)
2348
- * @returns Promise that resolves when metadata is updated
2349
- */
2350
- setPageMetadata?: (metadata: Partial<PageMetadata>) => Promise<void>;
2351
- /**
2352
- * Get current page metadata (cover image and icon)
2353
- * @returns Current metadata or null if not set
2354
- */
2355
- getPageMetadata?: () => PageMetadata | null;
2356
- /**
2357
- * @deprecated Use setPageMetadata({ cover: imageData }) instead
2358
- */
2359
- setCoverImage?: (imageData?: ImageData) => void;
2360
- /**
2361
- * @deprecated Use getPageMetadata()?.cover instead
2362
- */
2363
- getCoverImage?: () => ImageData | undefined;
2364
- /**
2365
- * @deprecated Use setPageMetadata({ icon: imageData }) instead
2366
- */
2367
- setLogo?: (imageData?: ImageData) => void;
2368
- /**
2369
- * @deprecated Use getPageMetadata()?.icon instead
2370
- */
2371
- getLogo?: () => ImageData | undefined;
35
+ interface CapabilityGrant {
36
+ raw: string;
37
+ with?: string;
38
+ audience?: string;
39
+ expiresAt?: number;
40
+ action?: string;
2372
41
  }
2373
- /**
2374
- * Re-map BlockNote renderer props to use IxoEditorType instead of BlockNoteEditor.
2375
- * This is used in block renderers to ensure they receive the augmented editor type.
2376
- *
2377
- * @example
2378
- * ```typescript
2379
- * export function MyBlock(props: IxoBlockProps) {
2380
- * const { block, editor } = props;
2381
- * // editor is now IxoEditorType with full type safety
2382
- * console.log(editor.user?.name);
2383
- * }
2384
- * ```
2385
- */
2386
- interface IxoBlockProps<TBlock = any> {
2387
- editor: IxoEditorType;
2388
- block: TBlock;
42
+ type DerivedCapability = CapabilityGrant;
43
+ interface UCANManager {
44
+ loadParentCapability: (capability: string) => Promise<CapabilityGrant>;
45
+ deriveNodeCapability: (parent: CapabilityGrant, nodeId: string, actorDid: string) => Promise<DerivedCapability>;
46
+ validateDerivedCapability: (derived: DerivedCapability, nodeId: string, actorDid: string) => Promise<void>;
2389
47
  }
2390
48
 
2391
- type IxoEditorTheme = 'light' | 'dark';
2392
- interface IxoEditorOptions {
2393
- /**
2394
- * The color theme for the editor
2395
- * @default 'light'
2396
- */
2397
- theme?: IxoEditorTheme;
2398
- /**
2399
- * Function to handle file uploads
2400
- */
2401
- uploadFile?: (file: File) => Promise<string>;
2402
- /**
2403
- * Initial content for the editor
2404
- */
2405
- initialContent?: PartialBlock[];
2406
- /**
2407
- * Whether the editor is editable
2408
- * @default true
2409
- */
2410
- editable?: boolean;
2411
- /**
2412
- * Whether to show the side menu (drag handle, plus button)
2413
- * @default true
2414
- */
2415
- sideMenu?: boolean;
2416
- /**
2417
- * Whether to enable the slash menu
2418
- * @default true
2419
- */
2420
- slashMenu?: boolean;
2421
- /**
2422
- * Whether to show the formatting toolbar
2423
- * @default true
2424
- */
2425
- formattingToolbar?: boolean;
2426
- /**
2427
- * Whether to show the link toolbar
2428
- * @default true
2429
- */
2430
- linkToolbar?: boolean;
2431
- /**
2432
- * Whether to show the file panel
2433
- * @default true
2434
- */
2435
- filePanel?: boolean;
2436
- /**
2437
- * Whether to show table handles
2438
- * @default true
2439
- */
2440
- tableHandles?: boolean;
2441
- /**
2442
- * Document type (template, flow, page)
2443
- * This is a local prop and NOT synced via CRDT
2444
- * @default 'flow'
2445
- */
2446
- docType?: 'template' | 'flow' | 'page';
2447
- }
2448
- interface IxoCollaborativeUser {
2449
- name: string;
2450
- color: string;
2451
- accessToken: string;
2452
- address: string;
2453
- id: string;
2454
- }
2455
- interface IxoCollaborativeEditorPermissions {
2456
- /**
2457
- * Whether the user has write permissions
2458
- * @default false
2459
- */
2460
- write: boolean;
49
+ interface NodeActionResult {
50
+ claimId?: string;
51
+ evaluationStatus?: EvaluationStatus;
52
+ submittedByDid?: string;
53
+ payload?: any;
2461
54
  }
2462
- interface IxoCollaborativeEditorOptions extends IxoEditorOptions {
2463
- user: IxoCollaborativeUser;
2464
- matrixClient: MatrixClient;
2465
- roomId: string;
2466
- /**
2467
- * User permissions for the collaborative document
2468
- * @default { write: false }
2469
- */
2470
- permissions?: IxoCollaborativeEditorPermissions;
2471
- /**
2472
- * Unique identifier for the document/flow
2473
- */
2474
- docId?: string;
2475
- /**
2476
- * Title of the flow document
2477
- */
2478
- title?: string;
2479
- }
2480
- interface IxoEditorConfig {
2481
- theme: IxoEditorTheme;
2482
- editable: boolean;
2483
- sideMenu: boolean;
2484
- slashMenu: boolean;
2485
- formattingToolbar: boolean;
2486
- linkToolbar: boolean;
2487
- filePanel: boolean;
2488
- tableHandles: boolean;
2489
- }
2490
-
2491
- /**
2492
- * Custom hook that wraps useCreateBlockNote with IXO-specific configurations (Mantine version)
2493
- * @param options - Configuration options for the IxoEditor
2494
- * @returns A configured IxoEditor instance with augmented type properties
2495
- */
2496
- declare function useCreateIxoEditor(options?: IxoEditorOptions): IxoEditorType | undefined;
2497
-
2498
- /**
2499
- * Custom hook that wraps useCreateBlockNote with IXO-specific configurations (Mantine version)
2500
- * @param options - Configuration options for the IxoEditor
2501
- * @returns A configured collaborative IxoEditor instance with augmented type properties
2502
- */
2503
- declare function useCreateCollaborativeIxoEditor(options: IxoCollaborativeEditorOptions): {
2504
- editor: IxoEditorType | undefined;
2505
- connectionStatus: string;
2506
- title: Text;
2507
- yDoc: Doc;
2508
- root: Map<any>;
2509
- flowArray: Array$1<any>;
2510
- };
2511
-
2512
- interface IxoEditorProps {
2513
- editor: IxoEditorType | undefined;
2514
- editable?: boolean;
2515
- className?: string;
2516
- onChange?: () => void;
2517
- onSelectionChange?: () => void;
2518
- children?: React.ReactNode;
2519
- mantineTheme?: any;
2520
- handlers?: BlocknoteHandlers;
2521
- blockRequirements?: BlockRequirements;
2522
- isPanelVisible?: boolean;
2523
- coverImageUrl?: string;
2524
- logoUrl?: string;
2525
- }
2526
- /**
2527
- * IxoEditor component - A customized BlockNote editor for IXO (Mantine UI)
2528
- */
2529
- declare function IxoEditor({ editor, editable, className, onChange, onSelectionChange, children, mantineTheme, handlers, blockRequirements, isPanelVisible, coverImageUrl, logoUrl, }: IxoEditorProps): React.ReactElement | null;
2530
-
2531
- interface CoverImageProps {
2532
- coverImageUrl?: string;
2533
- logoUrl?: string;
2534
- }
2535
- /**
2536
- * CoverImage component - Notion-like cover image with logo
2537
- */
2538
- declare function CoverImage({ coverImageUrl, logoUrl }: CoverImageProps): React.ReactElement | null;
2539
-
2540
- /**
2541
- * GraphQL queries and types for IXO network
2542
- */
2543
- interface Entity {
2544
- context: string;
2545
- relayerNode: string;
2546
- controller: string;
2547
- id: string;
2548
- type: string;
2549
- startDate: string;
2550
- endDate: string;
2551
- metadata: string;
2552
- linkedResource: any[];
2553
- settings: Record<string, Record<string, any>>;
2554
- service: string;
2555
- externalId: string;
2556
- }
2557
- interface EntityResponse {
2558
- entity: Entity;
2559
- }
2560
- interface EntityVariables {
2561
- entityId: string;
2562
- }
2563
- /**
2564
- * Fetches entity data by ID from the IXO network
2565
- * @param entityId - The unique identifier for the entity
2566
- * @returns Promise resolving to the entity data
2567
- */
2568
- declare function getEntity(entityId: string): Promise<Entity>;
2569
-
2570
- /**
2571
- * Lightweight GraphQL client for IXO network queries
2572
- */
2573
- interface GraphQLResponse<T = any> {
2574
- data?: T;
2575
- errors?: Array<{
2576
- message: string;
2577
- locations?: Array<{
2578
- line: number;
2579
- column: number;
2580
- }>;
2581
- path?: Array<string | number>;
55
+ interface ExecutionContext {
56
+ runtime: FlowRuntimeStateManager;
57
+ /** @deprecated Use delegationStore instead */
58
+ ucanManager?: UCANManager;
59
+ delegationStore?: DelegationStore;
60
+ verifySignature?: (capabilityRaw: string, issuerDid: string) => Promise<{
61
+ valid: boolean;
62
+ error?: string;
2582
63
  }>;
64
+ rootIssuer?: string;
65
+ flowUri?: string;
66
+ now?: () => number;
2583
67
  }
2584
- interface GraphQLRequest {
2585
- query: string;
2586
- variables?: Record<string, any>;
2587
- operationName?: string;
2588
- }
2589
- declare class GraphQLClient {
2590
- private endpoint;
2591
- private headers;
2592
- constructor(endpoint: string, headers?: Record<string, string>);
2593
- request<T = any>(request: GraphQLRequest): Promise<T>;
2594
- }
2595
- declare const ixoGraphQLClient: GraphQLClient;
68
+ interface ExecutionOutcome {
69
+ success: boolean;
70
+ stage: 'activation' | 'authorization' | 'claim' | 'action' | 'complete';
71
+ error?: string;
72
+ result?: NodeActionResult;
73
+ capabilityId?: string;
74
+ }
75
+ interface ExecuteNodeParams {
76
+ node: FlowNode;
77
+ actorDid: string;
78
+ context: ExecutionContext;
79
+ action: () => Promise<NodeActionResult>;
80
+ }
81
+ declare const executeNode: ({ node, actorDid, context, action }: ExecuteNodeParams) => Promise<ExecutionOutcome>;
82
+
83
+ interface AuthorizationResult {
84
+ authorized: boolean;
85
+ reason?: string;
86
+ capabilityId?: string;
87
+ /** @deprecated */
88
+ derived?: DerivedCapability;
89
+ }
90
+ interface AuthorizationContext {
91
+ /** @deprecated Use delegationStore instead */
92
+ ucanManager?: UCANManager;
93
+ delegationStore?: DelegationStore;
94
+ verifySignature?: (capabilityRaw: string, issuerDid: string) => Promise<{
95
+ valid: boolean;
96
+ error?: string;
97
+ }>;
98
+ rootIssuer?: string;
99
+ flowUri?: string;
100
+ }
101
+ declare const isActorAuthorized: (node: FlowNode, actorDid: string, context?: AuthorizationContext) => Promise<AuthorizationResult>;
102
+
103
+ interface ActivationResult {
104
+ active: boolean;
105
+ reason?: string;
106
+ }
107
+ declare const isNodeActive: (node: FlowNode, runtime: FlowRuntimeStateManager) => ActivationResult;
108
+
109
+ interface ValidateChainParams {
110
+ /** The capability to validate */
111
+ capability: SignedCapability;
112
+ /** The actor DID trying to use the capability */
113
+ actorDid: string;
114
+ /** Required capability (what the actor wants to do) */
115
+ requiredCapability: Capability;
116
+ /** The delegation store */
117
+ delegationStore: DelegationStore;
118
+ /** Handler to verify signatures */
119
+ verifySignature: (capabilityRaw: string, issuerDid: string) => Promise<{
120
+ valid: boolean;
121
+ error?: string;
122
+ }>;
123
+ /** Expected root issuer (entity DID) */
124
+ rootIssuer: string;
125
+ }
126
+ /**
127
+ * Validate a capability chain back to the root
128
+ */
129
+ declare const validateCapabilityChain: (params: ValidateChainParams) => Promise<CapabilityValidationResult>;
130
+ /**
131
+ * Find a valid capability for an actor to perform an action
132
+ */
133
+ declare const findValidCapability: (params: {
134
+ actorDid: string;
135
+ requiredCapability: Capability;
136
+ delegationStore: DelegationStore;
137
+ verifySignature: (capabilityRaw: string, issuerDid: string) => Promise<{
138
+ valid: boolean;
139
+ error?: string;
140
+ }>;
141
+ rootIssuer: string;
142
+ }) => Promise<{
143
+ found: boolean;
144
+ capabilityId?: string;
145
+ error?: string;
146
+ }>;
2596
147
 
2597
- export { type Addr, type ApiRequestBlockProps, ApiRequestBlockSpec, AuthzExecActionTypes, type BlockRequirements, type BlocknoteContextValue, type BlocknoteHandlers, BlocknoteProvider, type CheckboxBlockProps, CheckboxBlockSpec, type CosmosMsgForEmpty, CoverImage, type CoverImageProps, type Entity, type EntityResponse, type EntityVariables, type Expiration, GraphQLClient, type GraphQLRequest, type GraphQLResponse, type HttpMethod, type IxoCollaborativeEditorOptions, type IxoCollaborativeUser, IxoEditor, type IxoEditorConfig, type IxoEditorOptions, type IxoEditorProps, type IxoEditorTheme, type KeyValuePair, type ListBlockProps, type ListBlockSettings, ListBlockSpec, OverviewBlock, type OverviewBlockProps, type ProposalAction, type ProposalBlockProps, ProposalBlockSpec, type ProposalResponse, type SingleChoiceProposal, StakeType, StakeType as StakeTypeValue, type Status, type Threshold, type Timestamp, type Uint128, type User, ValidatorActionType, type Vote, type VoteInfo, type VoteResponse, type Votes, blockSpecs, getEntity, getExtraSlashMenuItems, ixoGraphQLClient, useBlocknoteContext, useBlocknoteHandlers, useCreateCollaborativeIxoEditor, useCreateIxoEditor };
148
+ export { type ActivationResult, type AuthorizationContext, type AuthorizationResult, Capability, CapabilityValidationResult, type DelegationStore, type ExecuteNodeParams, type ExecutionContext, type ExecutionOutcome, type FlowRuntimeStateManager, type NodeActionResult, SignedCapability, buildAuthzFromProps, buildFlowNodeFromBlock, createDelegationStore, createMemoryDelegationStore, createRuntimeStateManager, executeNode, findValidCapability, isActorAuthorized, isNodeActive, validateCapabilityChain };