@ixo/editor 1.1.3 → 1.2.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/README.md +87 -62
- package/dist/chunk-R6LZUDT7.mjs +7976 -0
- package/dist/chunk-R6LZUDT7.mjs.map +1 -0
- package/dist/index.d.ts +1435 -0
- package/dist/index.mjs +20 -6
- package/dist/mantine/index.d.ts +5 -0
- package/dist/mantine/index.mjs +24 -404
- package/dist/mantine/index.mjs.map +1 -1
- package/package.json +37 -32
- package/style-core.css +11 -9
- package/style-mantine.css +11 -9
- package/style.css +12 -10
- package/dist/chunk-2UJGZZWQ.mjs +0 -180
- package/dist/chunk-2UJGZZWQ.mjs.map +0 -1
- package/dist/chunk-GSKWOGSU.mjs +0 -1611
- package/dist/chunk-GSKWOGSU.mjs.map +0 -1
- package/dist/graphql-client-BIr8uzKX.d.mts +0 -135
- package/dist/index.d.mts +0 -1328
- package/dist/mantine/index.d.mts +0 -1253
- package/dist/shadcn/index.d.mts +0 -6
- package/dist/shadcn/index.mjs +0 -27
- package/dist/shadcn/index.mjs.map +0 -1
- package/style-shadcn.css +0 -340
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1435 @@
|
|
|
1
|
+
import * as _blocknote_core from '@blocknote/core';
|
|
2
|
+
import { BlockSchemaFromSpecs, InlineContentSchema, StyleSchema, BlockNoteEditor, PartialBlock } from '@blocknote/core';
|
|
3
|
+
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';
|
|
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
|
+
};
|
|
64
|
+
|
|
65
|
+
type CheckboxBlockProps = IxoBlockProps;
|
|
66
|
+
|
|
67
|
+
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';
|
|
68
|
+
interface Member {
|
|
69
|
+
address: string;
|
|
70
|
+
weight: number;
|
|
71
|
+
}
|
|
72
|
+
interface BaseProposalAction {
|
|
73
|
+
type: ProposalActionType;
|
|
74
|
+
}
|
|
75
|
+
interface SpendData {
|
|
76
|
+
to: string;
|
|
77
|
+
denom: string;
|
|
78
|
+
amount: string;
|
|
79
|
+
}
|
|
80
|
+
interface ManageMembersData {
|
|
81
|
+
add: Member[];
|
|
82
|
+
remove: {
|
|
83
|
+
addr: string;
|
|
84
|
+
}[];
|
|
85
|
+
}
|
|
86
|
+
interface SpendAction extends BaseProposalAction {
|
|
87
|
+
type: 'Spend';
|
|
88
|
+
data: SpendData;
|
|
89
|
+
}
|
|
90
|
+
interface UpdateMembersAction extends BaseProposalAction {
|
|
91
|
+
type: 'UpdateMembers';
|
|
92
|
+
data: ManageMembersData;
|
|
93
|
+
}
|
|
94
|
+
declare const StakeType: {
|
|
95
|
+
readonly Delegate: "delegate";
|
|
96
|
+
readonly Undelegate: "undelegate";
|
|
97
|
+
readonly Redelegate: "redelegate";
|
|
98
|
+
readonly WithdrawDelegatorReward: "withdraw_delegator_reward";
|
|
99
|
+
};
|
|
100
|
+
type StakeType = (typeof StakeType)[keyof typeof StakeType];
|
|
101
|
+
interface StakeData {
|
|
102
|
+
stakeType: StakeType;
|
|
103
|
+
validator: string;
|
|
104
|
+
toValidator: string;
|
|
105
|
+
amount: string;
|
|
106
|
+
denom: string;
|
|
107
|
+
}
|
|
108
|
+
interface JoinData {
|
|
109
|
+
id: string;
|
|
110
|
+
coreAddress: string;
|
|
111
|
+
address: string;
|
|
112
|
+
}
|
|
113
|
+
interface StakeAction extends BaseProposalAction {
|
|
114
|
+
type: 'Stake';
|
|
115
|
+
data: StakeData;
|
|
116
|
+
}
|
|
117
|
+
interface JoinAction extends BaseProposalAction {
|
|
118
|
+
type: 'Join';
|
|
119
|
+
data: JoinData;
|
|
120
|
+
}
|
|
121
|
+
interface Coin {
|
|
122
|
+
denom: string;
|
|
123
|
+
amount: string;
|
|
124
|
+
}
|
|
125
|
+
interface Binary {
|
|
126
|
+
[k: string]: unknown;
|
|
127
|
+
}
|
|
128
|
+
interface Empty {
|
|
129
|
+
[k: string]: unknown;
|
|
130
|
+
}
|
|
131
|
+
interface GenericToken {
|
|
132
|
+
[k: string]: unknown;
|
|
133
|
+
}
|
|
134
|
+
interface SubDao {
|
|
135
|
+
addr: string;
|
|
136
|
+
charter?: string | null;
|
|
137
|
+
[k: string]: unknown;
|
|
138
|
+
}
|
|
139
|
+
interface Counterparty {
|
|
140
|
+
address: string;
|
|
141
|
+
[k: string]: unknown;
|
|
142
|
+
}
|
|
143
|
+
type DepositRefundPolicy = string;
|
|
144
|
+
type VoteOption = number;
|
|
145
|
+
type TProposalActionModel = any;
|
|
146
|
+
interface MsgDelegate {
|
|
147
|
+
[k: string]: unknown;
|
|
148
|
+
}
|
|
149
|
+
interface MsgUndelegate {
|
|
150
|
+
[k: string]: unknown;
|
|
151
|
+
}
|
|
152
|
+
interface MsgBeginRedelegate {
|
|
153
|
+
[k: string]: unknown;
|
|
154
|
+
}
|
|
155
|
+
interface MsgWithdrawDelegatorReward {
|
|
156
|
+
[k: string]: unknown;
|
|
157
|
+
}
|
|
158
|
+
type BankMsg = {
|
|
159
|
+
send: {
|
|
160
|
+
amount: Coin[];
|
|
161
|
+
to_address: string;
|
|
162
|
+
};
|
|
163
|
+
} | {
|
|
164
|
+
burn: {
|
|
165
|
+
amount: Coin[];
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
type StakingMsg = {
|
|
169
|
+
delegate: {
|
|
170
|
+
amount: Coin;
|
|
171
|
+
validator: string;
|
|
172
|
+
};
|
|
173
|
+
} | {
|
|
174
|
+
undelegate: {
|
|
175
|
+
amount: Coin;
|
|
176
|
+
validator: string;
|
|
177
|
+
};
|
|
178
|
+
} | {
|
|
179
|
+
redelegate: {
|
|
180
|
+
amount: Coin;
|
|
181
|
+
dst_validator: string;
|
|
182
|
+
src_validator: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
type DistributionMsg = {
|
|
186
|
+
set_withdraw_address: {
|
|
187
|
+
address: string;
|
|
188
|
+
};
|
|
189
|
+
} | {
|
|
190
|
+
withdraw_delegator_reward: {
|
|
191
|
+
validator: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
interface IbcTimeout {
|
|
195
|
+
[k: string]: unknown;
|
|
196
|
+
}
|
|
197
|
+
type IbcMsg = {
|
|
198
|
+
transfer: {
|
|
199
|
+
amount: Coin;
|
|
200
|
+
channel_id: string;
|
|
201
|
+
timeout: IbcTimeout;
|
|
202
|
+
to_address: string;
|
|
203
|
+
};
|
|
204
|
+
} | {
|
|
205
|
+
send_packet: {
|
|
206
|
+
channel_id: string;
|
|
207
|
+
data: Binary;
|
|
208
|
+
timeout: IbcTimeout;
|
|
209
|
+
};
|
|
210
|
+
} | {
|
|
211
|
+
close_channel: {
|
|
212
|
+
channel_id: string;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
type WasmMsg = {
|
|
216
|
+
execute: {
|
|
217
|
+
contract_addr: string;
|
|
218
|
+
funds: Coin[];
|
|
219
|
+
msg: Binary;
|
|
220
|
+
};
|
|
221
|
+
} | {
|
|
222
|
+
instantiate: {
|
|
223
|
+
admin?: string | null;
|
|
224
|
+
code_id: number;
|
|
225
|
+
funds: Coin[];
|
|
226
|
+
label: string;
|
|
227
|
+
msg: Binary;
|
|
228
|
+
};
|
|
229
|
+
} | {
|
|
230
|
+
migrate: {
|
|
231
|
+
contract_addr: string;
|
|
232
|
+
msg: Binary;
|
|
233
|
+
new_code_id: number;
|
|
234
|
+
};
|
|
235
|
+
} | {
|
|
236
|
+
update_admin: {
|
|
237
|
+
admin: string;
|
|
238
|
+
contract_addr: string;
|
|
239
|
+
};
|
|
240
|
+
} | {
|
|
241
|
+
clear_admin: {
|
|
242
|
+
contract_addr: string;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
type GovMsg = {
|
|
246
|
+
vote: {
|
|
247
|
+
proposal_id: number;
|
|
248
|
+
vote: VoteOption;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
type StargateMsg = {
|
|
252
|
+
stargate: {
|
|
253
|
+
type_url: string;
|
|
254
|
+
value: Binary;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
type CosmosMsgFor_Empty = {
|
|
258
|
+
bank: BankMsg;
|
|
259
|
+
} | {
|
|
260
|
+
custom: Empty;
|
|
261
|
+
} | {
|
|
262
|
+
staking: StakingMsg;
|
|
263
|
+
} | {
|
|
264
|
+
distribution: DistributionMsg;
|
|
265
|
+
} | {
|
|
266
|
+
ibc: IbcMsg;
|
|
267
|
+
} | {
|
|
268
|
+
wasm: WasmMsg;
|
|
269
|
+
} | {
|
|
270
|
+
gov: GovMsg;
|
|
271
|
+
} | StargateMsg;
|
|
272
|
+
declare const AuthzExecActionTypes: {
|
|
273
|
+
readonly Delegate: "/cosmos.staking.v1beta1.MsgDelegate";
|
|
274
|
+
readonly Undelegate: "/cosmos.staking.v1beta1.MsgUndelegate";
|
|
275
|
+
readonly Redelegate: "/cosmos.staking.v1beta1.MsgBeginRedelegate";
|
|
276
|
+
readonly ClaimRewards: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
|
|
277
|
+
readonly Custom: "custom";
|
|
278
|
+
};
|
|
279
|
+
type AuthzExecActionType = (typeof AuthzExecActionTypes)[keyof typeof AuthzExecActionTypes];
|
|
280
|
+
interface AuthzExecData {
|
|
281
|
+
authzExecActionType: AuthzExecActionType;
|
|
282
|
+
delegate: MsgDelegate;
|
|
283
|
+
undelegate: MsgUndelegate;
|
|
284
|
+
redelegate: MsgBeginRedelegate;
|
|
285
|
+
claimRewards: MsgWithdrawDelegatorReward;
|
|
286
|
+
custom: string;
|
|
287
|
+
}
|
|
288
|
+
interface AuthzData {
|
|
289
|
+
custom?: boolean;
|
|
290
|
+
typeUrl: string;
|
|
291
|
+
value: {
|
|
292
|
+
grantee: string;
|
|
293
|
+
msgTypeUrl: string;
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
interface BurnNftData {
|
|
297
|
+
collection: string;
|
|
298
|
+
tokenId: string;
|
|
299
|
+
}
|
|
300
|
+
interface ExecuteData {
|
|
301
|
+
address: string;
|
|
302
|
+
message: string;
|
|
303
|
+
funds: Coin[];
|
|
304
|
+
}
|
|
305
|
+
interface InstantiateData {
|
|
306
|
+
admin: string;
|
|
307
|
+
codeId: number;
|
|
308
|
+
label: string;
|
|
309
|
+
message: string;
|
|
310
|
+
funds: Coin[];
|
|
311
|
+
}
|
|
312
|
+
interface ManageSubDaosData {
|
|
313
|
+
toAdd: SubDao[];
|
|
314
|
+
toRemove: {
|
|
315
|
+
address: string;
|
|
316
|
+
}[];
|
|
317
|
+
}
|
|
318
|
+
interface ManageCw721Data {
|
|
319
|
+
adding: boolean;
|
|
320
|
+
address: string;
|
|
321
|
+
}
|
|
322
|
+
interface ManageCw20Data {
|
|
323
|
+
adding: boolean;
|
|
324
|
+
address: string;
|
|
325
|
+
}
|
|
326
|
+
interface MigrateData {
|
|
327
|
+
contract: string;
|
|
328
|
+
codeId: number;
|
|
329
|
+
msg: string;
|
|
330
|
+
}
|
|
331
|
+
interface MintData {
|
|
332
|
+
to: string;
|
|
333
|
+
amount: number;
|
|
334
|
+
}
|
|
335
|
+
interface TransferNftData {
|
|
336
|
+
collection: string;
|
|
337
|
+
tokenId: string;
|
|
338
|
+
recipient: string;
|
|
339
|
+
executeSmartContract: boolean;
|
|
340
|
+
smartContractMsg: string;
|
|
341
|
+
}
|
|
342
|
+
interface UpdateAdminData {
|
|
343
|
+
contract: string;
|
|
344
|
+
newAdmin: string;
|
|
345
|
+
}
|
|
346
|
+
interface UpdatePreProposeConfigData {
|
|
347
|
+
depositRequired: boolean;
|
|
348
|
+
depositInfo: {
|
|
349
|
+
amount: string;
|
|
350
|
+
type: 'native' | 'cw20' | 'voting_module_token';
|
|
351
|
+
denomOrAddress: string;
|
|
352
|
+
token?: GenericToken;
|
|
353
|
+
refundPolicy: DepositRefundPolicy;
|
|
354
|
+
};
|
|
355
|
+
anyoneCanPropose: boolean;
|
|
356
|
+
}
|
|
357
|
+
interface UpdateProposalConfigData {
|
|
358
|
+
onlyMembersExecute: boolean;
|
|
359
|
+
thresholdType: '%' | 'majority';
|
|
360
|
+
thresholdPercentage?: number;
|
|
361
|
+
quorumEnabled: boolean;
|
|
362
|
+
quorumType: '%' | 'majority';
|
|
363
|
+
quorumPercentage?: number;
|
|
364
|
+
proposalDuration: number;
|
|
365
|
+
proposalDurationUnits: 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds';
|
|
366
|
+
allowRevoting: boolean;
|
|
367
|
+
}
|
|
368
|
+
interface GovernanceVoteData {
|
|
369
|
+
proposalId: string;
|
|
370
|
+
vote: VoteOption;
|
|
371
|
+
}
|
|
372
|
+
interface WithdrawTokenSwapData {
|
|
373
|
+
contractChosen: boolean;
|
|
374
|
+
tokenSwapContractAddress?: string;
|
|
375
|
+
}
|
|
376
|
+
interface UpdateInfoData {
|
|
377
|
+
automatically_add_cw20s: boolean;
|
|
378
|
+
automatically_add_cw721s: boolean;
|
|
379
|
+
dao_uri?: string | null;
|
|
380
|
+
description: string;
|
|
381
|
+
image_url?: string | null;
|
|
382
|
+
name: string;
|
|
383
|
+
[k: string]: unknown;
|
|
384
|
+
}
|
|
385
|
+
interface CustomData {
|
|
386
|
+
message: string;
|
|
387
|
+
}
|
|
388
|
+
interface ManageStorageItemsData {
|
|
389
|
+
setting: boolean;
|
|
390
|
+
key: string;
|
|
391
|
+
value: string;
|
|
392
|
+
}
|
|
393
|
+
declare enum ValidatorActionType {
|
|
394
|
+
CreateValidator = "/cosmos.staking.v1beta1.MsgCreateValidator",
|
|
395
|
+
EditValidator = "/cosmos.staking.v1beta1.MsgEditValidator",
|
|
396
|
+
UnjailValidator = "/cosmos.slashing.v1beta1.MsgUnjail",
|
|
397
|
+
WithdrawValidatorCommission = "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"
|
|
398
|
+
}
|
|
399
|
+
interface ValidatorActionsData {
|
|
400
|
+
validatorActionType: ValidatorActionType;
|
|
401
|
+
createMsg: string;
|
|
402
|
+
editMsg: string;
|
|
403
|
+
}
|
|
404
|
+
interface PerformTokenSwapData {
|
|
405
|
+
contractChosen: boolean;
|
|
406
|
+
tokenSwapContractAddress?: string;
|
|
407
|
+
selfParty?: Omit<Counterparty, 'address'>;
|
|
408
|
+
counterparty?: Counterparty;
|
|
409
|
+
}
|
|
410
|
+
type DaoAdminExecData = {
|
|
411
|
+
coreAddress: string;
|
|
412
|
+
msgs: CosmosMsgFor_Empty[];
|
|
413
|
+
_actions?: TProposalActionModel[];
|
|
414
|
+
};
|
|
415
|
+
interface StakeToGroupData {
|
|
416
|
+
amount: string;
|
|
417
|
+
tokenContract: string;
|
|
418
|
+
stakingContract: string;
|
|
419
|
+
}
|
|
420
|
+
interface SendGroupTokenData {
|
|
421
|
+
amount: string;
|
|
422
|
+
contract: string;
|
|
423
|
+
toAddress: string;
|
|
424
|
+
}
|
|
425
|
+
interface AcceptToMarketplaceData {
|
|
426
|
+
did: string;
|
|
427
|
+
relayerNodeDid: string;
|
|
428
|
+
relayerNodeAddress: string;
|
|
429
|
+
}
|
|
430
|
+
interface AuthzExecAction extends BaseProposalAction {
|
|
431
|
+
type: 'AuthzExec';
|
|
432
|
+
data: AuthzExecData;
|
|
433
|
+
}
|
|
434
|
+
interface AuthzGrantAction extends BaseProposalAction {
|
|
435
|
+
type: 'AuthzGrant';
|
|
436
|
+
data: AuthzData;
|
|
437
|
+
}
|
|
438
|
+
interface AuthzRevokeAction extends BaseProposalAction {
|
|
439
|
+
type: 'AuthzRevoke';
|
|
440
|
+
data: AuthzData;
|
|
441
|
+
}
|
|
442
|
+
interface BurnNftAction extends BaseProposalAction {
|
|
443
|
+
type: 'BurnNft';
|
|
444
|
+
data: BurnNftData;
|
|
445
|
+
}
|
|
446
|
+
interface MintAction extends BaseProposalAction {
|
|
447
|
+
type: 'Mint';
|
|
448
|
+
data: MintData;
|
|
449
|
+
}
|
|
450
|
+
interface ExecuteAction extends BaseProposalAction {
|
|
451
|
+
type: 'Execute';
|
|
452
|
+
data: ExecuteData;
|
|
453
|
+
}
|
|
454
|
+
interface InstantiateAction extends BaseProposalAction {
|
|
455
|
+
type: 'Instantiate';
|
|
456
|
+
data: InstantiateData;
|
|
457
|
+
}
|
|
458
|
+
interface ManageSubDaosAction extends BaseProposalAction {
|
|
459
|
+
type: 'ManageSubDaos';
|
|
460
|
+
data: ManageSubDaosData;
|
|
461
|
+
}
|
|
462
|
+
interface ManageCw721Action extends BaseProposalAction {
|
|
463
|
+
type: 'ManageCw721';
|
|
464
|
+
data: ManageCw721Data;
|
|
465
|
+
}
|
|
466
|
+
interface ManageCw20Action extends BaseProposalAction {
|
|
467
|
+
type: 'ManageCw20';
|
|
468
|
+
data: ManageCw20Data;
|
|
469
|
+
}
|
|
470
|
+
interface MigrateAction extends BaseProposalAction {
|
|
471
|
+
type: 'Migrate';
|
|
472
|
+
data: MigrateData;
|
|
473
|
+
}
|
|
474
|
+
interface TransferNftAction extends BaseProposalAction {
|
|
475
|
+
type: 'TransferNft';
|
|
476
|
+
data: TransferNftData;
|
|
477
|
+
}
|
|
478
|
+
interface UpdateAdminAction extends BaseProposalAction {
|
|
479
|
+
type: 'UpdateAdmin';
|
|
480
|
+
data: UpdateAdminData;
|
|
481
|
+
}
|
|
482
|
+
interface UpdatePreProposeConfigAction extends BaseProposalAction {
|
|
483
|
+
type: 'UpdatePreProposeConfig';
|
|
484
|
+
data: UpdatePreProposeConfigData;
|
|
485
|
+
}
|
|
486
|
+
interface UpdateVotingConfigAction extends BaseProposalAction {
|
|
487
|
+
type: 'UpdateVotingConfig';
|
|
488
|
+
data: UpdateProposalConfigData;
|
|
489
|
+
}
|
|
490
|
+
interface GovernanceVoteAction extends BaseProposalAction {
|
|
491
|
+
type: 'GovernanceVote';
|
|
492
|
+
data: GovernanceVoteData;
|
|
493
|
+
}
|
|
494
|
+
interface WithdrawTokenSwapAction extends BaseProposalAction {
|
|
495
|
+
type: 'WithdrawTokenSwap';
|
|
496
|
+
data: WithdrawTokenSwapData;
|
|
497
|
+
}
|
|
498
|
+
interface UpdateInfoAction extends BaseProposalAction {
|
|
499
|
+
type: 'UpdateInfo';
|
|
500
|
+
data: UpdateInfoData;
|
|
501
|
+
}
|
|
502
|
+
interface CustomAction extends BaseProposalAction {
|
|
503
|
+
type: 'Custom';
|
|
504
|
+
data: CustomData;
|
|
505
|
+
}
|
|
506
|
+
interface ManageStorageItemsAction extends BaseProposalAction {
|
|
507
|
+
type: 'ManageStorageItems';
|
|
508
|
+
data: ManageStorageItemsData;
|
|
509
|
+
}
|
|
510
|
+
interface ValidatorActionsAction extends BaseProposalAction {
|
|
511
|
+
type: 'ValidatorActions';
|
|
512
|
+
data: ValidatorActionsData;
|
|
513
|
+
}
|
|
514
|
+
interface PerformTokenSwapAction extends BaseProposalAction {
|
|
515
|
+
type: 'PerformTokenSwap';
|
|
516
|
+
data: PerformTokenSwapData;
|
|
517
|
+
}
|
|
518
|
+
interface DaoAdminExecAction extends BaseProposalAction {
|
|
519
|
+
type: 'DaoAdminExec';
|
|
520
|
+
data: DaoAdminExecData;
|
|
521
|
+
}
|
|
522
|
+
interface StakeToGroupAction extends BaseProposalAction {
|
|
523
|
+
type: 'StakeToGroup';
|
|
524
|
+
data: StakeToGroupData;
|
|
525
|
+
}
|
|
526
|
+
interface SendGroupTokenAction extends BaseProposalAction {
|
|
527
|
+
type: 'SendGroupToken';
|
|
528
|
+
data: SendGroupTokenData;
|
|
529
|
+
}
|
|
530
|
+
interface AcceptToMarketplaceAction extends BaseProposalAction {
|
|
531
|
+
type: 'AcceptToMarketplace';
|
|
532
|
+
data: AcceptToMarketplaceData;
|
|
533
|
+
}
|
|
534
|
+
interface CreateEntityAction extends BaseProposalAction {
|
|
535
|
+
type: 'CreateEntity';
|
|
536
|
+
data: any;
|
|
537
|
+
}
|
|
538
|
+
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;
|
|
539
|
+
interface SharedProposalData {
|
|
540
|
+
[proposalId: string]: {
|
|
541
|
+
proposal: any;
|
|
542
|
+
lastFetched: number;
|
|
543
|
+
loading: boolean;
|
|
544
|
+
error?: Error;
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
type Addr = string;
|
|
549
|
+
type Uint128 = string;
|
|
550
|
+
type Timestamp = string;
|
|
551
|
+
type Expiration = {
|
|
552
|
+
at_height: number;
|
|
553
|
+
} | {
|
|
554
|
+
at_time: Timestamp;
|
|
555
|
+
} | {
|
|
556
|
+
never: {};
|
|
557
|
+
};
|
|
558
|
+
type Status = 'open' | 'rejected' | 'passed' | 'executed' | 'closed' | 'execution_failed' | 'veto_timelock';
|
|
559
|
+
interface Threshold {
|
|
560
|
+
absolute_count?: {
|
|
561
|
+
weight: Uint128;
|
|
562
|
+
};
|
|
563
|
+
absolute_percentage?: {
|
|
564
|
+
percentage: string;
|
|
565
|
+
};
|
|
566
|
+
threshold_quorum?: {
|
|
567
|
+
threshold: string;
|
|
568
|
+
quorum: string;
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
interface Votes {
|
|
572
|
+
yes: Uint128;
|
|
573
|
+
no: Uint128;
|
|
574
|
+
abstain: Uint128;
|
|
575
|
+
}
|
|
576
|
+
interface CosmosMsgForEmpty {
|
|
577
|
+
[key: string]: any;
|
|
578
|
+
}
|
|
579
|
+
interface SingleChoiceProposal {
|
|
580
|
+
allow_revoting: boolean;
|
|
581
|
+
description: string;
|
|
582
|
+
expiration: Expiration;
|
|
583
|
+
min_voting_period?: Expiration | null;
|
|
584
|
+
msgs: CosmosMsgForEmpty[];
|
|
585
|
+
proposer: Addr;
|
|
586
|
+
start_height: number;
|
|
587
|
+
status: Status;
|
|
588
|
+
threshold: Threshold;
|
|
589
|
+
title: string;
|
|
590
|
+
total_power: Uint128;
|
|
591
|
+
votes: Votes;
|
|
592
|
+
}
|
|
593
|
+
interface ProposalResponse {
|
|
594
|
+
id: number;
|
|
595
|
+
proposal: SingleChoiceProposal;
|
|
596
|
+
}
|
|
597
|
+
type Vote = 'yes' | 'no' | 'abstain' | 'no_with_veto';
|
|
598
|
+
interface VoteInfo {
|
|
599
|
+
power: Uint128;
|
|
600
|
+
rationale?: string | null;
|
|
601
|
+
vote: Vote;
|
|
602
|
+
voter: Addr;
|
|
603
|
+
}
|
|
604
|
+
interface VoteResponse {
|
|
605
|
+
vote?: VoteInfo | null;
|
|
606
|
+
}
|
|
607
|
+
interface User {
|
|
608
|
+
address: string;
|
|
609
|
+
}
|
|
610
|
+
interface LinkedResource {
|
|
611
|
+
id: string;
|
|
612
|
+
type: string;
|
|
613
|
+
proof: string;
|
|
614
|
+
right: string;
|
|
615
|
+
encrypted: string;
|
|
616
|
+
mediaType: string;
|
|
617
|
+
description: string;
|
|
618
|
+
serviceEndpoint: string;
|
|
619
|
+
}
|
|
620
|
+
interface EntityResponse$1 {
|
|
621
|
+
id: string;
|
|
622
|
+
context: string;
|
|
623
|
+
relayerNode: string;
|
|
624
|
+
controller: string;
|
|
625
|
+
type: string;
|
|
626
|
+
startDate: string;
|
|
627
|
+
endDate: string;
|
|
628
|
+
metadata: string;
|
|
629
|
+
linkedResource: LinkedResource[];
|
|
630
|
+
settings: Record<string, LinkedResource>;
|
|
631
|
+
service: string;
|
|
632
|
+
externalId: string;
|
|
633
|
+
}
|
|
634
|
+
interface Asset {
|
|
635
|
+
did: string;
|
|
636
|
+
alsoKnownAs: string;
|
|
637
|
+
}
|
|
638
|
+
interface Transaction {
|
|
639
|
+
transactionHash: string;
|
|
640
|
+
typeUrl: string;
|
|
641
|
+
memo: string;
|
|
642
|
+
time: string;
|
|
643
|
+
}
|
|
644
|
+
interface BlockRequirements {
|
|
645
|
+
proposal?: {
|
|
646
|
+
coreAddress: string;
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
interface VoteParams {
|
|
650
|
+
proposalId: number;
|
|
651
|
+
rationale?: string;
|
|
652
|
+
vote: Vote;
|
|
653
|
+
proposalContractAddress: string;
|
|
654
|
+
}
|
|
655
|
+
interface CreateProposalParams {
|
|
656
|
+
preProposalContractAddress: string;
|
|
657
|
+
title: string;
|
|
658
|
+
description: string;
|
|
659
|
+
actions?: ProposalAction[];
|
|
660
|
+
coreAddress?: string;
|
|
661
|
+
}
|
|
662
|
+
interface BlocknoteHandlers {
|
|
663
|
+
getCurrentDao: () => Promise<{
|
|
664
|
+
coreAddress: string;
|
|
665
|
+
}>;
|
|
666
|
+
getVote: (proposalContractAddress: string, proposalId: string, userAddress: string) => Promise<VoteResponse>;
|
|
667
|
+
getProposal: (proposalContractAddress: string, proposalId: string) => Promise<ProposalResponse>;
|
|
668
|
+
getCurrentUser: () => Promise<User>;
|
|
669
|
+
vote: ({ proposalId, rationale, vote, proposalContractAddress }: VoteParams) => Promise<void>;
|
|
670
|
+
createProposal: (params: CreateProposalParams) => Promise<string>;
|
|
671
|
+
executeProposal: (params: {
|
|
672
|
+
proposalId: number;
|
|
673
|
+
proposalContractAddress: string;
|
|
674
|
+
}) => Promise<void>;
|
|
675
|
+
getProposalContractAddress: (params: {
|
|
676
|
+
coreAddress: string;
|
|
677
|
+
}) => Promise<{
|
|
678
|
+
proposalContractAddress: string;
|
|
679
|
+
}>;
|
|
680
|
+
getPreProposalContractAddress: (params: {
|
|
681
|
+
coreAddress: string;
|
|
682
|
+
}) => Promise<{
|
|
683
|
+
preProposalContractAddress: string;
|
|
684
|
+
}>;
|
|
685
|
+
getEntity: (did: string) => Promise<EntityResponse$1>;
|
|
686
|
+
getAssets: (collectionDid: string) => Promise<Asset[]>;
|
|
687
|
+
getTransactions: (address: string) => Promise<Transaction[]>;
|
|
688
|
+
}
|
|
689
|
+
interface BlocknoteContextValue {
|
|
690
|
+
editor?: IxoEditorType;
|
|
691
|
+
handlers?: BlocknoteHandlers;
|
|
692
|
+
blockRequirements?: BlockRequirements;
|
|
693
|
+
editable?: boolean;
|
|
694
|
+
sharedProposals: SharedProposalData;
|
|
695
|
+
fetchSharedProposal: (proposalId: string, contractAddress: string, force?: boolean) => Promise<ProposalResponse>;
|
|
696
|
+
invalidateProposal: (proposalId: string) => void;
|
|
697
|
+
subscribeToProposal: (proposalId: string) => ProposalResponse | undefined;
|
|
698
|
+
activeDrawerId: string | null;
|
|
699
|
+
drawerContent: React.ReactNode | null;
|
|
700
|
+
openDrawer: (id: string, content: React.ReactNode) => void;
|
|
701
|
+
closeDrawer: () => void;
|
|
702
|
+
}
|
|
703
|
+
declare const BlocknoteProvider: React.FC<{
|
|
704
|
+
children: React.ReactNode;
|
|
705
|
+
editor?: IxoEditorType;
|
|
706
|
+
handlers?: BlocknoteHandlers;
|
|
707
|
+
blockRequirements?: BlockRequirements;
|
|
708
|
+
editable?: boolean;
|
|
709
|
+
}>;
|
|
710
|
+
declare const useBlocknoteContext: () => BlocknoteContextValue;
|
|
711
|
+
declare const useBlocknoteHandlers: () => BlocknoteHandlers;
|
|
712
|
+
|
|
713
|
+
type LinkedResourcesListType = 'linked_resources';
|
|
714
|
+
|
|
715
|
+
type AssetsListType = 'assets';
|
|
716
|
+
|
|
717
|
+
type TransactionsListType = 'transactions';
|
|
718
|
+
|
|
719
|
+
type ListType = LinkedResourcesListType | AssetsListType | TransactionsListType;
|
|
720
|
+
|
|
721
|
+
interface ListBlockSettings {
|
|
722
|
+
listType: ListType | null;
|
|
723
|
+
listConfig: Record<string, any>;
|
|
724
|
+
}
|
|
725
|
+
interface ListBlockProps {
|
|
726
|
+
block: any;
|
|
727
|
+
editor: any;
|
|
728
|
+
}
|
|
729
|
+
declare const ListBlock: {
|
|
730
|
+
config: {
|
|
731
|
+
readonly type: "list";
|
|
732
|
+
readonly propSchema: {
|
|
733
|
+
readonly listType: {
|
|
734
|
+
readonly default: "";
|
|
735
|
+
};
|
|
736
|
+
readonly listConfig: {
|
|
737
|
+
readonly default: "{}";
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
readonly content: "none";
|
|
741
|
+
};
|
|
742
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
743
|
+
readonly type: "list";
|
|
744
|
+
readonly propSchema: {
|
|
745
|
+
readonly listType: {
|
|
746
|
+
readonly default: "";
|
|
747
|
+
};
|
|
748
|
+
readonly listConfig: {
|
|
749
|
+
readonly default: "{}";
|
|
750
|
+
};
|
|
751
|
+
};
|
|
752
|
+
readonly content: "none";
|
|
753
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
interface OverviewBlockSettings {
|
|
757
|
+
did: string;
|
|
758
|
+
}
|
|
759
|
+
interface OverviewBlockProps {
|
|
760
|
+
block: any;
|
|
761
|
+
editor: any;
|
|
762
|
+
}
|
|
763
|
+
declare const OverviewBlock: {
|
|
764
|
+
config: {
|
|
765
|
+
readonly type: "overview";
|
|
766
|
+
readonly propSchema: {
|
|
767
|
+
readonly did: {
|
|
768
|
+
readonly default: "";
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
readonly content: "none";
|
|
772
|
+
};
|
|
773
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
774
|
+
readonly type: "overview";
|
|
775
|
+
readonly propSchema: {
|
|
776
|
+
readonly did: {
|
|
777
|
+
readonly default: "";
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
readonly content: "none";
|
|
781
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
declare const ProposalVoteBlockSpec: {
|
|
785
|
+
config: {
|
|
786
|
+
readonly type: "proposalVote";
|
|
787
|
+
readonly propSchema: {
|
|
788
|
+
readonly dependsOn: {
|
|
789
|
+
readonly default: string;
|
|
790
|
+
};
|
|
791
|
+
readonly proposalBlockId: {
|
|
792
|
+
readonly default: "";
|
|
793
|
+
};
|
|
794
|
+
readonly hasDependencies: {
|
|
795
|
+
readonly default: true;
|
|
796
|
+
};
|
|
797
|
+
readonly dependencies: {
|
|
798
|
+
readonly default: "";
|
|
799
|
+
};
|
|
800
|
+
readonly title: {
|
|
801
|
+
readonly default: "";
|
|
802
|
+
};
|
|
803
|
+
readonly subtitle: {
|
|
804
|
+
readonly default: "";
|
|
805
|
+
};
|
|
806
|
+
readonly icon: {
|
|
807
|
+
readonly default: "checklist";
|
|
808
|
+
};
|
|
809
|
+
readonly status: {
|
|
810
|
+
readonly default: "open";
|
|
811
|
+
};
|
|
812
|
+
readonly daysLeft: {
|
|
813
|
+
readonly default: 0;
|
|
814
|
+
};
|
|
815
|
+
readonly proposalContractAddress: {
|
|
816
|
+
readonly default: "";
|
|
817
|
+
};
|
|
818
|
+
readonly conditions: {
|
|
819
|
+
readonly default: "";
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
readonly content: "none";
|
|
823
|
+
};
|
|
824
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
825
|
+
readonly type: "proposalVote";
|
|
826
|
+
readonly propSchema: {
|
|
827
|
+
readonly dependsOn: {
|
|
828
|
+
readonly default: string;
|
|
829
|
+
};
|
|
830
|
+
readonly proposalBlockId: {
|
|
831
|
+
readonly default: "";
|
|
832
|
+
};
|
|
833
|
+
readonly hasDependencies: {
|
|
834
|
+
readonly default: true;
|
|
835
|
+
};
|
|
836
|
+
readonly dependencies: {
|
|
837
|
+
readonly default: "";
|
|
838
|
+
};
|
|
839
|
+
readonly title: {
|
|
840
|
+
readonly default: "";
|
|
841
|
+
};
|
|
842
|
+
readonly subtitle: {
|
|
843
|
+
readonly default: "";
|
|
844
|
+
};
|
|
845
|
+
readonly icon: {
|
|
846
|
+
readonly default: "checklist";
|
|
847
|
+
};
|
|
848
|
+
readonly status: {
|
|
849
|
+
readonly default: "open";
|
|
850
|
+
};
|
|
851
|
+
readonly daysLeft: {
|
|
852
|
+
readonly default: 0;
|
|
853
|
+
};
|
|
854
|
+
readonly proposalContractAddress: {
|
|
855
|
+
readonly default: "";
|
|
856
|
+
};
|
|
857
|
+
readonly conditions: {
|
|
858
|
+
readonly default: "";
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
readonly content: "none";
|
|
862
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
interface ProposalVoteBlockSettings {
|
|
866
|
+
title: string;
|
|
867
|
+
subtitle: string;
|
|
868
|
+
icon: string;
|
|
869
|
+
status: string;
|
|
870
|
+
daysLeft: number;
|
|
871
|
+
}
|
|
872
|
+
interface ProposalVoteBlockProps {
|
|
873
|
+
block: any;
|
|
874
|
+
editor: any;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
declare const blockSpecs: {
|
|
878
|
+
checkbox: {
|
|
879
|
+
config: {
|
|
880
|
+
readonly type: "checkbox";
|
|
881
|
+
readonly propSchema: {
|
|
882
|
+
readonly checked: {
|
|
883
|
+
readonly default: false;
|
|
884
|
+
};
|
|
885
|
+
readonly allowedCheckers: {
|
|
886
|
+
readonly default: "all";
|
|
887
|
+
};
|
|
888
|
+
readonly initialChecked: {
|
|
889
|
+
readonly default: false;
|
|
890
|
+
};
|
|
891
|
+
readonly title: {
|
|
892
|
+
readonly default: "";
|
|
893
|
+
};
|
|
894
|
+
readonly description: {
|
|
895
|
+
readonly default: "";
|
|
896
|
+
};
|
|
897
|
+
readonly icon: {
|
|
898
|
+
readonly default: "square-check";
|
|
899
|
+
};
|
|
900
|
+
readonly conditions: {
|
|
901
|
+
readonly default: "";
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
readonly content: "inline";
|
|
905
|
+
};
|
|
906
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
907
|
+
readonly type: "checkbox";
|
|
908
|
+
readonly propSchema: {
|
|
909
|
+
readonly checked: {
|
|
910
|
+
readonly default: false;
|
|
911
|
+
};
|
|
912
|
+
readonly allowedCheckers: {
|
|
913
|
+
readonly default: "all";
|
|
914
|
+
};
|
|
915
|
+
readonly initialChecked: {
|
|
916
|
+
readonly default: false;
|
|
917
|
+
};
|
|
918
|
+
readonly title: {
|
|
919
|
+
readonly default: "";
|
|
920
|
+
};
|
|
921
|
+
readonly description: {
|
|
922
|
+
readonly default: "";
|
|
923
|
+
};
|
|
924
|
+
readonly icon: {
|
|
925
|
+
readonly default: "square-check";
|
|
926
|
+
};
|
|
927
|
+
readonly conditions: {
|
|
928
|
+
readonly default: "";
|
|
929
|
+
};
|
|
930
|
+
};
|
|
931
|
+
readonly content: "inline";
|
|
932
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
933
|
+
};
|
|
934
|
+
list: {
|
|
935
|
+
config: {
|
|
936
|
+
readonly type: "list";
|
|
937
|
+
readonly propSchema: {
|
|
938
|
+
readonly listType: {
|
|
939
|
+
readonly default: "";
|
|
940
|
+
};
|
|
941
|
+
readonly listConfig: {
|
|
942
|
+
readonly default: "{}";
|
|
943
|
+
};
|
|
944
|
+
};
|
|
945
|
+
readonly content: "none";
|
|
946
|
+
};
|
|
947
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
948
|
+
readonly type: "list";
|
|
949
|
+
readonly propSchema: {
|
|
950
|
+
readonly listType: {
|
|
951
|
+
readonly default: "";
|
|
952
|
+
};
|
|
953
|
+
readonly listConfig: {
|
|
954
|
+
readonly default: "{}";
|
|
955
|
+
};
|
|
956
|
+
};
|
|
957
|
+
readonly content: "none";
|
|
958
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
959
|
+
};
|
|
960
|
+
overview: {
|
|
961
|
+
config: {
|
|
962
|
+
readonly type: "overview";
|
|
963
|
+
readonly propSchema: {
|
|
964
|
+
readonly did: {
|
|
965
|
+
readonly default: "";
|
|
966
|
+
};
|
|
967
|
+
};
|
|
968
|
+
readonly content: "none";
|
|
969
|
+
};
|
|
970
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
971
|
+
readonly type: "overview";
|
|
972
|
+
readonly propSchema: {
|
|
973
|
+
readonly did: {
|
|
974
|
+
readonly default: "";
|
|
975
|
+
};
|
|
976
|
+
};
|
|
977
|
+
readonly content: "none";
|
|
978
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
979
|
+
};
|
|
980
|
+
proposalVote: {
|
|
981
|
+
config: {
|
|
982
|
+
readonly type: "proposalVote";
|
|
983
|
+
readonly propSchema: {
|
|
984
|
+
readonly dependsOn: {
|
|
985
|
+
readonly default: string;
|
|
986
|
+
};
|
|
987
|
+
readonly proposalBlockId: {
|
|
988
|
+
readonly default: "";
|
|
989
|
+
};
|
|
990
|
+
readonly hasDependencies: {
|
|
991
|
+
readonly default: true;
|
|
992
|
+
};
|
|
993
|
+
readonly dependencies: {
|
|
994
|
+
readonly default: "";
|
|
995
|
+
};
|
|
996
|
+
readonly title: {
|
|
997
|
+
readonly default: "";
|
|
998
|
+
};
|
|
999
|
+
readonly subtitle: {
|
|
1000
|
+
readonly default: "";
|
|
1001
|
+
};
|
|
1002
|
+
readonly icon: {
|
|
1003
|
+
readonly default: "checklist";
|
|
1004
|
+
};
|
|
1005
|
+
readonly status: {
|
|
1006
|
+
readonly default: "open";
|
|
1007
|
+
};
|
|
1008
|
+
readonly daysLeft: {
|
|
1009
|
+
readonly default: 0;
|
|
1010
|
+
};
|
|
1011
|
+
readonly proposalContractAddress: {
|
|
1012
|
+
readonly default: "";
|
|
1013
|
+
};
|
|
1014
|
+
readonly conditions: {
|
|
1015
|
+
readonly default: "";
|
|
1016
|
+
};
|
|
1017
|
+
};
|
|
1018
|
+
readonly content: "none";
|
|
1019
|
+
};
|
|
1020
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
1021
|
+
readonly type: "proposalVote";
|
|
1022
|
+
readonly propSchema: {
|
|
1023
|
+
readonly dependsOn: {
|
|
1024
|
+
readonly default: string;
|
|
1025
|
+
};
|
|
1026
|
+
readonly proposalBlockId: {
|
|
1027
|
+
readonly default: "";
|
|
1028
|
+
};
|
|
1029
|
+
readonly hasDependencies: {
|
|
1030
|
+
readonly default: true;
|
|
1031
|
+
};
|
|
1032
|
+
readonly dependencies: {
|
|
1033
|
+
readonly default: "";
|
|
1034
|
+
};
|
|
1035
|
+
readonly title: {
|
|
1036
|
+
readonly default: "";
|
|
1037
|
+
};
|
|
1038
|
+
readonly subtitle: {
|
|
1039
|
+
readonly default: "";
|
|
1040
|
+
};
|
|
1041
|
+
readonly icon: {
|
|
1042
|
+
readonly default: "checklist";
|
|
1043
|
+
};
|
|
1044
|
+
readonly status: {
|
|
1045
|
+
readonly default: "open";
|
|
1046
|
+
};
|
|
1047
|
+
readonly daysLeft: {
|
|
1048
|
+
readonly default: 0;
|
|
1049
|
+
};
|
|
1050
|
+
readonly proposalContractAddress: {
|
|
1051
|
+
readonly default: "";
|
|
1052
|
+
};
|
|
1053
|
+
readonly conditions: {
|
|
1054
|
+
readonly default: "";
|
|
1055
|
+
};
|
|
1056
|
+
};
|
|
1057
|
+
readonly content: "none";
|
|
1058
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
1059
|
+
};
|
|
1060
|
+
proposal: {
|
|
1061
|
+
config: {
|
|
1062
|
+
readonly type: "proposal";
|
|
1063
|
+
readonly propSchema: {
|
|
1064
|
+
readonly status: {
|
|
1065
|
+
readonly default: "draft";
|
|
1066
|
+
readonly values: readonly ["draft", "open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
|
|
1067
|
+
};
|
|
1068
|
+
readonly title: {
|
|
1069
|
+
readonly default: "";
|
|
1070
|
+
};
|
|
1071
|
+
readonly description: {
|
|
1072
|
+
readonly default: "";
|
|
1073
|
+
};
|
|
1074
|
+
readonly icon: {
|
|
1075
|
+
readonly default: "file-text";
|
|
1076
|
+
};
|
|
1077
|
+
readonly proposalId: {
|
|
1078
|
+
readonly default: "";
|
|
1079
|
+
};
|
|
1080
|
+
};
|
|
1081
|
+
readonly content: "none";
|
|
1082
|
+
};
|
|
1083
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
1084
|
+
readonly type: "proposal";
|
|
1085
|
+
readonly propSchema: {
|
|
1086
|
+
readonly status: {
|
|
1087
|
+
readonly default: "draft";
|
|
1088
|
+
readonly values: readonly ["draft", "open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
|
|
1089
|
+
};
|
|
1090
|
+
readonly title: {
|
|
1091
|
+
readonly default: "";
|
|
1092
|
+
};
|
|
1093
|
+
readonly description: {
|
|
1094
|
+
readonly default: "";
|
|
1095
|
+
};
|
|
1096
|
+
readonly icon: {
|
|
1097
|
+
readonly default: "file-text";
|
|
1098
|
+
};
|
|
1099
|
+
readonly proposalId: {
|
|
1100
|
+
readonly default: "";
|
|
1101
|
+
};
|
|
1102
|
+
};
|
|
1103
|
+
readonly content: "none";
|
|
1104
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
1105
|
+
};
|
|
1106
|
+
proposalActions: {
|
|
1107
|
+
config: {
|
|
1108
|
+
readonly type: "proposalActions";
|
|
1109
|
+
readonly propSchema: {
|
|
1110
|
+
readonly dependsOn: {
|
|
1111
|
+
readonly default: string;
|
|
1112
|
+
};
|
|
1113
|
+
readonly proposalBlockId: {
|
|
1114
|
+
readonly default: "";
|
|
1115
|
+
};
|
|
1116
|
+
readonly hasDependencies: {
|
|
1117
|
+
readonly default: true;
|
|
1118
|
+
};
|
|
1119
|
+
readonly dependencies: {
|
|
1120
|
+
readonly default: "";
|
|
1121
|
+
};
|
|
1122
|
+
readonly actions: {
|
|
1123
|
+
readonly default: "[]";
|
|
1124
|
+
};
|
|
1125
|
+
};
|
|
1126
|
+
readonly content: "none";
|
|
1127
|
+
};
|
|
1128
|
+
implementation: _blocknote_core.TiptapBlockImplementation<{
|
|
1129
|
+
readonly type: "proposalActions";
|
|
1130
|
+
readonly propSchema: {
|
|
1131
|
+
readonly dependsOn: {
|
|
1132
|
+
readonly default: string;
|
|
1133
|
+
};
|
|
1134
|
+
readonly proposalBlockId: {
|
|
1135
|
+
readonly default: "";
|
|
1136
|
+
};
|
|
1137
|
+
readonly hasDependencies: {
|
|
1138
|
+
readonly default: true;
|
|
1139
|
+
};
|
|
1140
|
+
readonly dependencies: {
|
|
1141
|
+
readonly default: "";
|
|
1142
|
+
};
|
|
1143
|
+
readonly actions: {
|
|
1144
|
+
readonly default: "[]";
|
|
1145
|
+
};
|
|
1146
|
+
};
|
|
1147
|
+
readonly content: "none";
|
|
1148
|
+
}, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
|
|
1149
|
+
};
|
|
1150
|
+
};
|
|
1151
|
+
declare const getExtraSlashMenuItems: (editor: any) => {
|
|
1152
|
+
title: string;
|
|
1153
|
+
onItemClick: () => void;
|
|
1154
|
+
aliases: string[];
|
|
1155
|
+
group: string;
|
|
1156
|
+
subtext: string;
|
|
1157
|
+
}[];
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* The schema type for the IXO editor, derived from block specs
|
|
1161
|
+
*/
|
|
1162
|
+
type IxoBlockSchema = BlockSchemaFromSpecs<typeof blockSpecs>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Editor mode representing different use cases
|
|
1165
|
+
*/
|
|
1166
|
+
type EditorMode = 'flow' | 'template' | 'readonly';
|
|
1167
|
+
/**
|
|
1168
|
+
* Flow metadata stored in the Y.Doc root map
|
|
1169
|
+
*/
|
|
1170
|
+
interface FlowMetadata {
|
|
1171
|
+
'@context': string;
|
|
1172
|
+
_type: string;
|
|
1173
|
+
schema_version: string;
|
|
1174
|
+
doc_id: string;
|
|
1175
|
+
title: string;
|
|
1176
|
+
createdAt: string;
|
|
1177
|
+
createdBy: string;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Extended editor type that augments BlockNoteEditor with IXO-specific properties
|
|
1181
|
+
* and methods. This type should be used throughout the application instead of
|
|
1182
|
+
* the base BlockNoteEditor type.
|
|
1183
|
+
*
|
|
1184
|
+
* Type Parameters:
|
|
1185
|
+
* - BSchema: The block schema (defaults to IxoBlockSchema)
|
|
1186
|
+
* - ISchema: The inline content schema (uses BlockNote defaults)
|
|
1187
|
+
* - SSchema: The style schema (uses BlockNote defaults)
|
|
1188
|
+
*/
|
|
1189
|
+
interface IxoEditorType<BSchema extends IxoBlockSchema = IxoBlockSchema, ISchema extends InlineContentSchema = InlineContentSchema, SSchema extends StyleSchema = StyleSchema> extends BlockNoteEditor<BSchema, ISchema, SSchema> {
|
|
1190
|
+
/**
|
|
1191
|
+
* Configuration options for the editor
|
|
1192
|
+
* @internal
|
|
1193
|
+
*/
|
|
1194
|
+
_ixoConfig: IxoEditorConfig;
|
|
1195
|
+
/**
|
|
1196
|
+
* Y.Doc root map for collaborative metadata storage
|
|
1197
|
+
* @internal
|
|
1198
|
+
*/
|
|
1199
|
+
_yRoot?: Map<any>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Y.Array for flow-specific structured block storage
|
|
1202
|
+
* @internal
|
|
1203
|
+
*/
|
|
1204
|
+
_yFlow?: Array$1<any>;
|
|
1205
|
+
/**
|
|
1206
|
+
* Current editor mode (flow, template, readonly)
|
|
1207
|
+
*/
|
|
1208
|
+
mode?: EditorMode;
|
|
1209
|
+
/**
|
|
1210
|
+
* Current user information (for collaborative editing)
|
|
1211
|
+
*/
|
|
1212
|
+
user?: IxoCollaborativeUser;
|
|
1213
|
+
/**
|
|
1214
|
+
* Get user-specific properties for a block
|
|
1215
|
+
* @param block - The block to get user properties for
|
|
1216
|
+
* @returns User-specific properties object
|
|
1217
|
+
*/
|
|
1218
|
+
getUserProps?: (block: any) => Record<string, any>;
|
|
1219
|
+
/**
|
|
1220
|
+
* Update user-specific properties for a block
|
|
1221
|
+
* @param block - The block to update
|
|
1222
|
+
* @param updates - Properties to update
|
|
1223
|
+
*/
|
|
1224
|
+
updateUserProps?: (block: any, updates: Record<string, any>) => void;
|
|
1225
|
+
/**
|
|
1226
|
+
* Get flow-level metadata
|
|
1227
|
+
* @returns Flow metadata object
|
|
1228
|
+
*/
|
|
1229
|
+
getFlowMetadata?: () => FlowMetadata;
|
|
1230
|
+
/**
|
|
1231
|
+
* Update flow-level metadata
|
|
1232
|
+
* @param updates - Metadata fields to update
|
|
1233
|
+
*/
|
|
1234
|
+
updateFlowMetadata?: (updates: Partial<FlowMetadata>) => void;
|
|
1235
|
+
/**
|
|
1236
|
+
* Get the flow array (structured block storage)
|
|
1237
|
+
* @returns Array of flow blocks
|
|
1238
|
+
*/
|
|
1239
|
+
getFlow?: () => any[];
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Re-map BlockNote renderer props to use IxoEditorType instead of BlockNoteEditor.
|
|
1243
|
+
* This is used in block renderers to ensure they receive the augmented editor type.
|
|
1244
|
+
*
|
|
1245
|
+
* @example
|
|
1246
|
+
* ```typescript
|
|
1247
|
+
* export function MyBlock(props: IxoBlockProps) {
|
|
1248
|
+
* const { block, editor } = props;
|
|
1249
|
+
* // editor is now IxoEditorType with full type safety
|
|
1250
|
+
* console.log(editor.user?.name);
|
|
1251
|
+
* }
|
|
1252
|
+
* ```
|
|
1253
|
+
*/
|
|
1254
|
+
interface IxoBlockProps<TBlock = any> {
|
|
1255
|
+
editor: IxoEditorType;
|
|
1256
|
+
block: TBlock;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
type IxoEditorTheme = 'light' | 'dark';
|
|
1260
|
+
interface IxoEditorOptions {
|
|
1261
|
+
/**
|
|
1262
|
+
* The color theme for the editor
|
|
1263
|
+
* @default 'light'
|
|
1264
|
+
*/
|
|
1265
|
+
theme?: IxoEditorTheme;
|
|
1266
|
+
/**
|
|
1267
|
+
* Function to handle file uploads
|
|
1268
|
+
*/
|
|
1269
|
+
uploadFile?: (file: File) => Promise<string>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Initial content for the editor
|
|
1272
|
+
*/
|
|
1273
|
+
initialContent?: PartialBlock[];
|
|
1274
|
+
/**
|
|
1275
|
+
* Whether the editor is editable
|
|
1276
|
+
* @default true
|
|
1277
|
+
*/
|
|
1278
|
+
editable?: boolean;
|
|
1279
|
+
/**
|
|
1280
|
+
* Whether to show the side menu (drag handle, plus button)
|
|
1281
|
+
* @default true
|
|
1282
|
+
*/
|
|
1283
|
+
sideMenu?: boolean;
|
|
1284
|
+
/**
|
|
1285
|
+
* Whether to enable the slash menu
|
|
1286
|
+
* @default true
|
|
1287
|
+
*/
|
|
1288
|
+
slashMenu?: boolean;
|
|
1289
|
+
/**
|
|
1290
|
+
* Whether to show the formatting toolbar
|
|
1291
|
+
* @default true
|
|
1292
|
+
*/
|
|
1293
|
+
formattingToolbar?: boolean;
|
|
1294
|
+
/**
|
|
1295
|
+
* Whether to show the link toolbar
|
|
1296
|
+
* @default true
|
|
1297
|
+
*/
|
|
1298
|
+
linkToolbar?: boolean;
|
|
1299
|
+
/**
|
|
1300
|
+
* Whether to show the file panel
|
|
1301
|
+
* @default true
|
|
1302
|
+
*/
|
|
1303
|
+
filePanel?: boolean;
|
|
1304
|
+
/**
|
|
1305
|
+
* Whether to show table handles
|
|
1306
|
+
* @default true
|
|
1307
|
+
*/
|
|
1308
|
+
tableHandles?: boolean;
|
|
1309
|
+
}
|
|
1310
|
+
interface IxoCollaborativeUser {
|
|
1311
|
+
name: string;
|
|
1312
|
+
color: string;
|
|
1313
|
+
accessToken: string;
|
|
1314
|
+
address: string;
|
|
1315
|
+
id: string;
|
|
1316
|
+
}
|
|
1317
|
+
interface IxoCollaborativeEditorOptions extends IxoEditorOptions {
|
|
1318
|
+
user: IxoCollaborativeUser;
|
|
1319
|
+
matrixClient: MatrixClient;
|
|
1320
|
+
roomId: string;
|
|
1321
|
+
/**
|
|
1322
|
+
* Unique identifier for the document/flow
|
|
1323
|
+
*/
|
|
1324
|
+
docId?: string;
|
|
1325
|
+
/**
|
|
1326
|
+
* Title of the flow document
|
|
1327
|
+
*/
|
|
1328
|
+
title?: string;
|
|
1329
|
+
}
|
|
1330
|
+
interface IxoEditorConfig {
|
|
1331
|
+
theme: IxoEditorTheme;
|
|
1332
|
+
editable: boolean;
|
|
1333
|
+
sideMenu: boolean;
|
|
1334
|
+
slashMenu: boolean;
|
|
1335
|
+
formattingToolbar: boolean;
|
|
1336
|
+
linkToolbar: boolean;
|
|
1337
|
+
filePanel: boolean;
|
|
1338
|
+
tableHandles: boolean;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* Custom hook that wraps useCreateBlockNote with IXO-specific configurations (Mantine version)
|
|
1343
|
+
* @param options - Configuration options for the IxoEditor
|
|
1344
|
+
* @returns A configured IxoEditor instance with augmented type properties
|
|
1345
|
+
*/
|
|
1346
|
+
declare function useCreateIxoEditor(options?: IxoEditorOptions): IxoEditorType | undefined;
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Custom hook that wraps useCreateBlockNote with IXO-specific configurations (Mantine version)
|
|
1350
|
+
* @param options - Configuration options for the IxoEditor
|
|
1351
|
+
* @returns A configured collaborative IxoEditor instance with augmented type properties
|
|
1352
|
+
*/
|
|
1353
|
+
declare function useCreateCollaborativeIxoEditor(options: IxoCollaborativeEditorOptions): {
|
|
1354
|
+
editor: IxoEditorType | undefined;
|
|
1355
|
+
connectionStatus: string;
|
|
1356
|
+
title: Text;
|
|
1357
|
+
yDoc: Doc;
|
|
1358
|
+
root: Map<any>;
|
|
1359
|
+
flowArray: Array$1<any>;
|
|
1360
|
+
};
|
|
1361
|
+
|
|
1362
|
+
interface IxoEditorProps {
|
|
1363
|
+
editor: IxoEditorType | undefined;
|
|
1364
|
+
editable?: boolean;
|
|
1365
|
+
className?: string;
|
|
1366
|
+
onChange?: () => void;
|
|
1367
|
+
onSelectionChange?: () => void;
|
|
1368
|
+
children?: React.ReactNode;
|
|
1369
|
+
mantineTheme?: any;
|
|
1370
|
+
handlers?: BlocknoteHandlers;
|
|
1371
|
+
blockRequirements?: BlockRequirements;
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* IxoEditor component - A customized BlockNote editor for IXO (Mantine UI)
|
|
1375
|
+
*/
|
|
1376
|
+
declare function IxoEditor({ editor, editable, className, onChange, onSelectionChange, children, mantineTheme, handlers, blockRequirements, }: IxoEditorProps): React.ReactElement | null;
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* GraphQL queries and types for IXO network
|
|
1380
|
+
*/
|
|
1381
|
+
interface Entity {
|
|
1382
|
+
context: string;
|
|
1383
|
+
relayerNode: string;
|
|
1384
|
+
controller: string;
|
|
1385
|
+
id: string;
|
|
1386
|
+
type: string;
|
|
1387
|
+
startDate: string;
|
|
1388
|
+
endDate: string;
|
|
1389
|
+
metadata: string;
|
|
1390
|
+
linkedResource: any[];
|
|
1391
|
+
settings: Record<string, Record<string, any>>;
|
|
1392
|
+
service: string;
|
|
1393
|
+
externalId: string;
|
|
1394
|
+
}
|
|
1395
|
+
interface EntityResponse {
|
|
1396
|
+
entity: Entity;
|
|
1397
|
+
}
|
|
1398
|
+
interface EntityVariables {
|
|
1399
|
+
entityId: string;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Fetches entity data by ID from the IXO network
|
|
1403
|
+
* @param entityId - The unique identifier for the entity
|
|
1404
|
+
* @returns Promise resolving to the entity data
|
|
1405
|
+
*/
|
|
1406
|
+
declare function getEntity(entityId: string): Promise<Entity>;
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Lightweight GraphQL client for IXO network queries
|
|
1410
|
+
*/
|
|
1411
|
+
interface GraphQLResponse<T = any> {
|
|
1412
|
+
data?: T;
|
|
1413
|
+
errors?: Array<{
|
|
1414
|
+
message: string;
|
|
1415
|
+
locations?: Array<{
|
|
1416
|
+
line: number;
|
|
1417
|
+
column: number;
|
|
1418
|
+
}>;
|
|
1419
|
+
path?: Array<string | number>;
|
|
1420
|
+
}>;
|
|
1421
|
+
}
|
|
1422
|
+
interface GraphQLRequest {
|
|
1423
|
+
query: string;
|
|
1424
|
+
variables?: Record<string, any>;
|
|
1425
|
+
operationName?: string;
|
|
1426
|
+
}
|
|
1427
|
+
declare class GraphQLClient {
|
|
1428
|
+
private endpoint;
|
|
1429
|
+
private headers;
|
|
1430
|
+
constructor(endpoint: string, headers?: Record<string, string>);
|
|
1431
|
+
request<T = any>(request: GraphQLRequest): Promise<T>;
|
|
1432
|
+
}
|
|
1433
|
+
declare const ixoGraphQLClient: GraphQLClient;
|
|
1434
|
+
|
|
1435
|
+
export { type Addr, AuthzExecActionTypes, type BlockRequirements, type BlocknoteContextValue, type BlocknoteHandlers, BlocknoteProvider, type CheckboxBlockProps, CheckboxBlockSpec, type CosmosMsgForEmpty, type Entity, type EntityResponse, type EntityVariables, type Expiration, GraphQLClient, type GraphQLRequest, type GraphQLResponse, type IxoCollaborativeEditorOptions, type IxoCollaborativeUser, IxoEditor, type IxoEditorConfig, type IxoEditorOptions, type IxoEditorProps, type IxoEditorTheme, ListBlock, type ListBlockProps, type ListBlockSettings, OverviewBlock, type OverviewBlockProps, type OverviewBlockSettings, type ProposalAction, type ProposalResponse, ProposalVoteBlockSpec as ProposalVoteBlock, type ProposalVoteBlockProps, type ProposalVoteBlockSettings, 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 };
|