@ixo/editor 1.1.4 → 1.3.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-N4T5JPKZ.mjs +9254 -0
- package/dist/chunk-N4T5JPKZ.mjs.map +1 -0
- package/dist/index.d.ts +1658 -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.mjs
CHANGED
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AuthzExecActionTypes,
|
|
3
|
+
BlocknoteProvider,
|
|
4
|
+
CheckboxBlockSpec,
|
|
5
|
+
GraphQLClient,
|
|
2
6
|
IxoEditor,
|
|
3
7
|
ListBlock,
|
|
4
8
|
OverviewBlock,
|
|
9
|
+
ProposalVoteBlockSpec,
|
|
10
|
+
StakeType,
|
|
11
|
+
ValidatorActionType,
|
|
5
12
|
blockSpecs,
|
|
13
|
+
getEntity,
|
|
6
14
|
getExtraSlashMenuItems,
|
|
15
|
+
ixoGraphQLClient,
|
|
16
|
+
useBlocknoteContext,
|
|
17
|
+
useBlocknoteHandlers,
|
|
7
18
|
useCreateCollaborativeIxoEditor,
|
|
8
19
|
useCreateIxoEditor
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
GraphQLClient,
|
|
12
|
-
getEntity,
|
|
13
|
-
ixoGraphQLClient
|
|
14
|
-
} from "./chunk-2UJGZZWQ.mjs";
|
|
20
|
+
} from "./chunk-N4T5JPKZ.mjs";
|
|
15
21
|
export {
|
|
22
|
+
AuthzExecActionTypes,
|
|
23
|
+
BlocknoteProvider,
|
|
24
|
+
CheckboxBlockSpec,
|
|
16
25
|
GraphQLClient,
|
|
17
26
|
IxoEditor,
|
|
18
27
|
ListBlock,
|
|
19
28
|
OverviewBlock,
|
|
29
|
+
ProposalVoteBlockSpec as ProposalVoteBlock,
|
|
30
|
+
StakeType,
|
|
31
|
+
ValidatorActionType,
|
|
20
32
|
blockSpecs,
|
|
21
33
|
getEntity,
|
|
22
34
|
getExtraSlashMenuItems,
|
|
23
35
|
ixoGraphQLClient,
|
|
36
|
+
useBlocknoteContext,
|
|
37
|
+
useBlocknoteHandlers,
|
|
24
38
|
useCreateCollaborativeIxoEditor,
|
|
25
39
|
useCreateIxoEditor
|
|
26
40
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Addr, AuthzExecActionTypes, BlockRequirements, BlocknoteContextValue, BlocknoteHandlers, BlocknoteProvider, CheckboxBlockProps, CheckboxBlockSpec, CosmosMsgForEmpty, Entity, EntityResponse, EntityVariables, Expiration, GraphQLClient, GraphQLRequest, GraphQLResponse, IxoCollaborativeEditorOptions, IxoCollaborativeUser, IxoEditor, IxoEditorConfig, IxoEditorOptions, IxoEditorProps, IxoEditorTheme, ListBlock, ListBlockProps, ListBlockSettings, OverviewBlock, OverviewBlockProps, OverviewBlockSettings, ProposalAction, ProposalResponse, ProposalVoteBlock, ProposalVoteBlockProps, ProposalVoteBlockSettings, SingleChoiceProposal, StakeType, StakeType as StakeTypeValue, Status, Threshold, Timestamp, Uint128, User, ValidatorActionType, Vote, VoteInfo, VoteResponse, Votes, blockSpecs, getEntity, getExtraSlashMenuItems, ixoGraphQLClient, useBlocknoteContext, useBlocknoteHandlers, useCreateCollaborativeIxoEditor, useCreateIxoEditor } from '../index.mjs';
|
|
2
|
+
export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
|
|
3
|
+
import 'matrix-js-sdk';
|
|
4
|
+
import 'yjs';
|
|
5
|
+
import 'react';
|
package/dist/mantine/index.mjs
CHANGED
|
@@ -1,420 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AuthzExecActionTypes,
|
|
3
|
+
BlocknoteProvider,
|
|
4
|
+
CheckboxBlockSpec,
|
|
2
5
|
GraphQLClient,
|
|
6
|
+
IxoEditor,
|
|
7
|
+
ListBlock,
|
|
8
|
+
OverviewBlock,
|
|
9
|
+
ProposalVoteBlockSpec,
|
|
10
|
+
StakeType,
|
|
11
|
+
ValidatorActionType,
|
|
12
|
+
blockSpecs,
|
|
3
13
|
getEntity,
|
|
14
|
+
getExtraSlashMenuItems,
|
|
4
15
|
ixoGraphQLClient,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
BlockNoteSchema,
|
|
12
|
-
defaultBlockSpecs,
|
|
13
|
-
defaultInlineContentSpecs,
|
|
14
|
-
defaultStyleSpecs
|
|
15
|
-
} from "@blocknote/core";
|
|
16
|
-
|
|
17
|
-
// src/mantine/blocks/list/ListBlock.tsx
|
|
18
|
-
import React from "react";
|
|
19
|
-
import { createReactBlockSpec } from "@blocknote/react";
|
|
20
|
-
var ListBlockContent = ({ block, editor }) => {
|
|
21
|
-
return /* @__PURE__ */ React.createElement(
|
|
22
|
-
"div",
|
|
23
|
-
{
|
|
24
|
-
style: {
|
|
25
|
-
width: "100%",
|
|
26
|
-
borderRadius: "6px",
|
|
27
|
-
padding: "16px",
|
|
28
|
-
backgroundColor: "#FFFFFF",
|
|
29
|
-
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
30
|
-
border: "1px solid #e5e7eb"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
/* @__PURE__ */ React.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React.createElement(
|
|
34
|
-
"input",
|
|
35
|
-
{
|
|
36
|
-
type: "text",
|
|
37
|
-
value: block.props.title || "",
|
|
38
|
-
placeholder: "New list",
|
|
39
|
-
style: {
|
|
40
|
-
color: "#2F2F2F",
|
|
41
|
-
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
42
|
-
fontSize: "14px",
|
|
43
|
-
fontWeight: 600,
|
|
44
|
-
border: "none",
|
|
45
|
-
outline: "none",
|
|
46
|
-
background: "transparent",
|
|
47
|
-
width: "100%"
|
|
48
|
-
},
|
|
49
|
-
onChange: (e) => {
|
|
50
|
-
editor.updateBlock(block, {
|
|
51
|
-
props: {
|
|
52
|
-
...block.props,
|
|
53
|
-
title: e.target.value
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
)),
|
|
59
|
-
/* @__PURE__ */ React.createElement("div", { style: { minHeight: "40px", color: "#6b7280" } }, block.props.did ? /* @__PURE__ */ React.createElement("p", null, "Loading data from DID: ", block.props.did) : /* @__PURE__ */ React.createElement("p", null, "Enter a DID to load list data"))
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
var ListBlock = createReactBlockSpec(
|
|
63
|
-
{
|
|
64
|
-
type: "list",
|
|
65
|
-
propSchema: {
|
|
66
|
-
title: {
|
|
67
|
-
default: ""
|
|
68
|
-
},
|
|
69
|
-
did: {
|
|
70
|
-
default: ""
|
|
71
|
-
},
|
|
72
|
-
fragmentIdentifier: {
|
|
73
|
-
default: ""
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
content: "none"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
render: (props) => /* @__PURE__ */ React.createElement(ListBlockContent, { ...props })
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
// src/mantine/blocks/overview/OverviewBlock.tsx
|
|
84
|
-
import React2 from "react";
|
|
85
|
-
import { createReactBlockSpec as createReactBlockSpec2 } from "@blocknote/react";
|
|
86
|
-
var OverviewBlockContent = ({ block, editor }) => {
|
|
87
|
-
return /* @__PURE__ */ React2.createElement(
|
|
88
|
-
"div",
|
|
89
|
-
{
|
|
90
|
-
style: {
|
|
91
|
-
width: "100%",
|
|
92
|
-
borderRadius: "6px",
|
|
93
|
-
padding: "16px",
|
|
94
|
-
backgroundColor: "#FFFFFF",
|
|
95
|
-
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
96
|
-
border: "1px solid #e5e7eb"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
/* @__PURE__ */ React2.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React2.createElement(
|
|
100
|
-
"input",
|
|
101
|
-
{
|
|
102
|
-
type: "text",
|
|
103
|
-
value: block.props.did || "",
|
|
104
|
-
placeholder: "Enter DID",
|
|
105
|
-
style: {
|
|
106
|
-
color: "#2F2F2F",
|
|
107
|
-
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
108
|
-
fontSize: "14px",
|
|
109
|
-
fontWeight: 600,
|
|
110
|
-
border: "none",
|
|
111
|
-
outline: "none",
|
|
112
|
-
background: "transparent",
|
|
113
|
-
width: "100%"
|
|
114
|
-
},
|
|
115
|
-
onChange: (e) => {
|
|
116
|
-
editor.updateBlock(block, {
|
|
117
|
-
props: {
|
|
118
|
-
...block.props,
|
|
119
|
-
did: e.target.value
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
)),
|
|
125
|
-
/* @__PURE__ */ React2.createElement("div", { style: { minHeight: "40px", color: "#6b7280" } }, block.props.did ? /* @__PURE__ */ React2.createElement("p", null, "Loading overview for DID: ", block.props.did) : /* @__PURE__ */ React2.createElement("p", null, "Enter a DID to load overview data"))
|
|
126
|
-
);
|
|
127
|
-
};
|
|
128
|
-
var OverviewBlock = createReactBlockSpec2(
|
|
129
|
-
{
|
|
130
|
-
type: "overview",
|
|
131
|
-
propSchema: {
|
|
132
|
-
did: {
|
|
133
|
-
default: ""
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
content: "none"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
render: (props) => /* @__PURE__ */ React2.createElement(OverviewBlockContent, { ...props })
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
// src/mantine/blocks/index.ts
|
|
144
|
-
var blockSpecs = {
|
|
145
|
-
list: ListBlock,
|
|
146
|
-
overview: OverviewBlock
|
|
147
|
-
};
|
|
148
|
-
var getExtraSlashMenuItems = (editor) => [
|
|
149
|
-
{
|
|
150
|
-
title: "List",
|
|
151
|
-
onItemClick: () => {
|
|
152
|
-
editor.insertBlocks(
|
|
153
|
-
[
|
|
154
|
-
{
|
|
155
|
-
type: "list",
|
|
156
|
-
props: {
|
|
157
|
-
title: "",
|
|
158
|
-
did: "",
|
|
159
|
-
fragmentIdentifier: ""
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
editor.getTextCursorPosition().block,
|
|
164
|
-
"after"
|
|
165
|
-
);
|
|
166
|
-
},
|
|
167
|
-
aliases: ["list", "data", "dynamic"],
|
|
168
|
-
group: "Domains",
|
|
169
|
-
subtext: "Create a dynamic list from DID data"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
title: "Overview",
|
|
173
|
-
onItemClick: () => {
|
|
174
|
-
editor.insertBlocks(
|
|
175
|
-
[
|
|
176
|
-
{
|
|
177
|
-
type: "overview",
|
|
178
|
-
props: {
|
|
179
|
-
did: ""
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
editor.getTextCursorPosition().block,
|
|
184
|
-
"after"
|
|
185
|
-
);
|
|
186
|
-
},
|
|
187
|
-
aliases: ["overview", "overview-block", "data-overview"],
|
|
188
|
-
group: "Domains",
|
|
189
|
-
subtext: "Create an overview from DID data"
|
|
190
|
-
}
|
|
191
|
-
];
|
|
192
|
-
|
|
193
|
-
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
194
|
-
function useCreateIxoEditor(options) {
|
|
195
|
-
const {
|
|
196
|
-
theme = "light",
|
|
197
|
-
uploadFile,
|
|
198
|
-
initialContent,
|
|
199
|
-
editable = true,
|
|
200
|
-
sideMenu = true,
|
|
201
|
-
slashMenu = true,
|
|
202
|
-
formattingToolbar = true,
|
|
203
|
-
linkToolbar = true,
|
|
204
|
-
filePanel = true,
|
|
205
|
-
tableHandles = true
|
|
206
|
-
} = options || {};
|
|
207
|
-
const defaultUploadFile = uploadFile || (async (file) => {
|
|
208
|
-
return new Promise((resolve, reject) => {
|
|
209
|
-
const reader = new FileReader();
|
|
210
|
-
reader.onloadend = () => {
|
|
211
|
-
const dataUrl = reader.result;
|
|
212
|
-
resolve(dataUrl);
|
|
213
|
-
};
|
|
214
|
-
reader.onerror = reject;
|
|
215
|
-
reader.readAsDataURL(file);
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
const schema = BlockNoteSchema.create({
|
|
219
|
-
blockSpecs: {
|
|
220
|
-
...defaultBlockSpecs,
|
|
221
|
-
...blockSpecs
|
|
222
|
-
},
|
|
223
|
-
inlineContentSpecs: {
|
|
224
|
-
...defaultInlineContentSpecs
|
|
225
|
-
},
|
|
226
|
-
styleSpecs: {
|
|
227
|
-
...defaultStyleSpecs
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
const editor = useCreateBlockNote({
|
|
231
|
-
schema,
|
|
232
|
-
initialContent,
|
|
233
|
-
uploadFile: defaultUploadFile
|
|
234
|
-
});
|
|
235
|
-
if (editor) {
|
|
236
|
-
editor._ixoConfig = {
|
|
237
|
-
theme,
|
|
238
|
-
editable,
|
|
239
|
-
sideMenu,
|
|
240
|
-
slashMenu,
|
|
241
|
-
formattingToolbar,
|
|
242
|
-
linkToolbar,
|
|
243
|
-
filePanel,
|
|
244
|
-
tableHandles
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
return editor;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
251
|
-
import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
252
|
-
import {
|
|
253
|
-
BlockNoteSchema as BlockNoteSchema2,
|
|
254
|
-
defaultBlockSpecs as defaultBlockSpecs2,
|
|
255
|
-
defaultInlineContentSpecs as defaultInlineContentSpecs2,
|
|
256
|
-
defaultStyleSpecs as defaultStyleSpecs2
|
|
257
|
-
} from "@blocknote/core";
|
|
258
|
-
import * as Y from "yjs";
|
|
259
|
-
import { useMemo } from "react";
|
|
260
|
-
function useCreateCollaborativeIxoEditor(options) {
|
|
261
|
-
const yDoc = useMemo(() => new Y.Doc(), []);
|
|
262
|
-
const {
|
|
263
|
-
theme = "light",
|
|
264
|
-
uploadFile,
|
|
265
|
-
initialContent,
|
|
266
|
-
editable = true,
|
|
267
|
-
sideMenu = true,
|
|
268
|
-
slashMenu = true,
|
|
269
|
-
formattingToolbar = true,
|
|
270
|
-
linkToolbar = true,
|
|
271
|
-
filePanel = true,
|
|
272
|
-
tableHandles = true,
|
|
273
|
-
user,
|
|
274
|
-
matrixClient
|
|
275
|
-
} = options || {};
|
|
276
|
-
const memoizedUser = useMemo(
|
|
277
|
-
() => ({
|
|
278
|
-
id: user?.id || "",
|
|
279
|
-
name: user?.name || "",
|
|
280
|
-
color: user?.color || "",
|
|
281
|
-
accessToken: user?.accessToken || ""
|
|
282
|
-
}),
|
|
283
|
-
[user?.id, user?.name, user?.color, user?.accessToken]
|
|
284
|
-
);
|
|
285
|
-
const { matrixProvider, connectionStatus } = useMatrixProvider({
|
|
286
|
-
yDoc,
|
|
287
|
-
matrixClient,
|
|
288
|
-
roomId: options.roomId
|
|
289
|
-
});
|
|
290
|
-
const defaultUploadFile = useMemo(
|
|
291
|
-
() => uploadFile || (async (file) => {
|
|
292
|
-
return new Promise((resolve, reject) => {
|
|
293
|
-
const reader = new FileReader();
|
|
294
|
-
reader.onloadend = () => {
|
|
295
|
-
const dataUrl = reader.result;
|
|
296
|
-
resolve(dataUrl);
|
|
297
|
-
};
|
|
298
|
-
reader.onerror = reject;
|
|
299
|
-
reader.readAsDataURL(file);
|
|
300
|
-
});
|
|
301
|
-
}),
|
|
302
|
-
[uploadFile]
|
|
303
|
-
);
|
|
304
|
-
const schema = useMemo(
|
|
305
|
-
() => BlockNoteSchema2.create({
|
|
306
|
-
blockSpecs: {
|
|
307
|
-
...defaultBlockSpecs2,
|
|
308
|
-
...blockSpecs
|
|
309
|
-
},
|
|
310
|
-
inlineContentSpecs: {
|
|
311
|
-
...defaultInlineContentSpecs2
|
|
312
|
-
},
|
|
313
|
-
styleSpecs: {
|
|
314
|
-
...defaultStyleSpecs2
|
|
315
|
-
}
|
|
316
|
-
}),
|
|
317
|
-
[]
|
|
318
|
-
);
|
|
319
|
-
const collaborationConfig = useMemo(
|
|
320
|
-
() => ({
|
|
321
|
-
provider: matrixProvider,
|
|
322
|
-
fragment: yDoc.getXmlFragment("document"),
|
|
323
|
-
user: {
|
|
324
|
-
name: memoizedUser.name,
|
|
325
|
-
color: memoizedUser.color
|
|
326
|
-
}
|
|
327
|
-
}),
|
|
328
|
-
[matrixProvider, yDoc, memoizedUser.name, memoizedUser.color]
|
|
329
|
-
);
|
|
330
|
-
const ixoConfig = useMemo(
|
|
331
|
-
() => ({
|
|
332
|
-
theme,
|
|
333
|
-
editable,
|
|
334
|
-
sideMenu,
|
|
335
|
-
slashMenu,
|
|
336
|
-
formattingToolbar,
|
|
337
|
-
linkToolbar,
|
|
338
|
-
filePanel,
|
|
339
|
-
tableHandles
|
|
340
|
-
}),
|
|
341
|
-
[theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]
|
|
342
|
-
);
|
|
343
|
-
const editor = useCreateBlockNote2({
|
|
344
|
-
schema,
|
|
345
|
-
initialContent,
|
|
346
|
-
uploadFile: defaultUploadFile,
|
|
347
|
-
collaboration: collaborationConfig
|
|
348
|
-
});
|
|
349
|
-
if (editor) {
|
|
350
|
-
editor._ixoConfig = ixoConfig;
|
|
351
|
-
}
|
|
352
|
-
return { editor, connectionStatus };
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// src/mantine/IxoEditor.tsx
|
|
356
|
-
import React3 from "react";
|
|
357
|
-
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
358
|
-
import { BlockNoteView } from "@blocknote/mantine";
|
|
359
|
-
import { filterSuggestionItems } from "@blocknote/core";
|
|
360
|
-
function IxoEditor({
|
|
361
|
-
editor,
|
|
362
|
-
className = "",
|
|
363
|
-
onChange,
|
|
364
|
-
onSelectionChange,
|
|
365
|
-
children
|
|
366
|
-
}) {
|
|
367
|
-
if (!editor) {
|
|
368
|
-
return null;
|
|
369
|
-
}
|
|
370
|
-
const config = editor._ixoConfig || {
|
|
371
|
-
theme: "light",
|
|
372
|
-
editable: true,
|
|
373
|
-
sideMenu: true,
|
|
374
|
-
slashMenu: true,
|
|
375
|
-
formattingToolbar: true,
|
|
376
|
-
linkToolbar: true,
|
|
377
|
-
filePanel: true,
|
|
378
|
-
tableHandles: true
|
|
379
|
-
};
|
|
380
|
-
return /* @__PURE__ */ React3.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}` }, /* @__PURE__ */ React3.createElement(
|
|
381
|
-
BlockNoteView,
|
|
382
|
-
{
|
|
383
|
-
editor,
|
|
384
|
-
editable: config.editable,
|
|
385
|
-
sideMenu: config.sideMenu,
|
|
386
|
-
slashMenu: false,
|
|
387
|
-
formattingToolbar: config.formattingToolbar,
|
|
388
|
-
linkToolbar: config.linkToolbar,
|
|
389
|
-
filePanel: config.filePanel,
|
|
390
|
-
tableHandles: config.tableHandles,
|
|
391
|
-
theme: config.theme,
|
|
392
|
-
onChange,
|
|
393
|
-
onSelectionChange
|
|
394
|
-
},
|
|
395
|
-
config.slashMenu && /* @__PURE__ */ React3.createElement(
|
|
396
|
-
SuggestionMenuController,
|
|
397
|
-
{
|
|
398
|
-
triggerCharacter: "/",
|
|
399
|
-
getItems: async (query) => {
|
|
400
|
-
const defaultItems = getDefaultReactSlashMenuItems(editor);
|
|
401
|
-
const customItems = getExtraSlashMenuItems(editor);
|
|
402
|
-
return filterSuggestionItems([...defaultItems, ...customItems], query);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
),
|
|
406
|
-
children
|
|
407
|
-
));
|
|
408
|
-
}
|
|
16
|
+
useBlocknoteContext,
|
|
17
|
+
useBlocknoteHandlers,
|
|
18
|
+
useCreateCollaborativeIxoEditor,
|
|
19
|
+
useCreateIxoEditor
|
|
20
|
+
} from "../chunk-N4T5JPKZ.mjs";
|
|
409
21
|
export {
|
|
22
|
+
AuthzExecActionTypes,
|
|
23
|
+
BlocknoteProvider,
|
|
24
|
+
CheckboxBlockSpec,
|
|
410
25
|
GraphQLClient,
|
|
411
26
|
IxoEditor,
|
|
412
27
|
ListBlock,
|
|
413
28
|
OverviewBlock,
|
|
29
|
+
ProposalVoteBlockSpec as ProposalVoteBlock,
|
|
30
|
+
StakeType,
|
|
31
|
+
ValidatorActionType,
|
|
414
32
|
blockSpecs,
|
|
415
33
|
getEntity,
|
|
416
34
|
getExtraSlashMenuItems,
|
|
417
35
|
ixoGraphQLClient,
|
|
36
|
+
useBlocknoteContext,
|
|
37
|
+
useBlocknoteHandlers,
|
|
418
38
|
useCreateCollaborativeIxoEditor,
|
|
419
39
|
useCreateIxoEditor
|
|
420
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mantine/hooks/useCreateIxoEditor.ts","../../src/mantine/blocks/list/ListBlock.tsx","../../src/mantine/blocks/overview/OverviewBlock.tsx","../../src/mantine/blocks/index.ts","../../src/mantine/hooks/useCollaborativeIxoEditor.ts","../../src/mantine/IxoEditor.tsx"],"sourcesContent":["import { useCreateBlockNote } from '@blocknote/react';\nimport {\n BlockNoteSchema,\n defaultBlockSpecs,\n defaultInlineContentSpecs,\n defaultStyleSpecs,\n} from '@blocknote/core';\nimport { IxoEditorOptions } from '../../core/types';\nimport { blockSpecs } from '../blocks';\n\n/**\n * Custom hook that wraps useCreateBlockNote with IXO-specific configurations (Mantine version)\n * @param options - Configuration options for the IxoEditor\n * @returns A configured BlockNote editor instance\n */\nexport function useCreateIxoEditor(options?: IxoEditorOptions) {\n // Extract IXO-specific options and BlockNote options\n const {\n theme = 'light',\n uploadFile,\n initialContent,\n editable = true,\n sideMenu = true,\n slashMenu = true,\n formattingToolbar = true,\n linkToolbar = true,\n filePanel = true,\n tableHandles = true,\n } = options || {};\n\n // Create default upload handler if not provided\n const defaultUploadFile =\n uploadFile ||\n (async (file: File) => {\n // Default implementation - convert to data URL\n // In production, you'd want to upload to a server\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n const dataUrl = reader.result as string;\n resolve(dataUrl);\n };\n reader.onerror = reject;\n reader.readAsDataURL(file);\n });\n });\n\n // Create custom schema with IXO blocks\n const schema = BlockNoteSchema.create({\n blockSpecs: {\n ...defaultBlockSpecs,\n ...blockSpecs,\n },\n inlineContentSpecs: {\n ...defaultInlineContentSpecs,\n },\n styleSpecs: {\n ...defaultStyleSpecs,\n },\n });\n\n // Create the BlockNote editor with basic configurations\n const editor = useCreateBlockNote({\n schema,\n initialContent,\n uploadFile: defaultUploadFile,\n });\n\n // Store configuration in editor for components to access\n if (editor) {\n (editor as any)._ixoConfig = {\n theme,\n editable,\n sideMenu,\n slashMenu,\n formattingToolbar,\n linkToolbar,\n filePanel,\n tableHandles,\n };\n }\n\n return editor;\n}\n","import React from 'react';\nimport { createReactBlockSpec } from '@blocknote/react';\n\nexport interface ListBlockSettings {\n did: string;\n fragmentIdentifier: string;\n}\n\nexport interface ListBlockProps {\n block: any;\n editor: any;\n}\n\nconst ListBlockContent: React.FC<ListBlockProps> = ({ block, editor }) => {\n return (\n <div\n style={{\n width: '100%',\n borderRadius: '6px',\n padding: '16px',\n backgroundColor: '#FFFFFF',\n fontFamily: 'Inter, Helvetica, Arial, sans-serif',\n border: '1px solid #e5e7eb',\n }}\n >\n <div style={{ marginBottom: '12px' }}>\n <input\n type=\"text\"\n value={block.props.title || ''}\n placeholder=\"New list\"\n style={{\n color: '#2F2F2F',\n fontFamily: 'Inter, Helvetica, Arial, sans-serif',\n fontSize: '14px',\n fontWeight: 600,\n border: 'none',\n outline: 'none',\n background: 'transparent',\n width: '100%',\n }}\n onChange={(e) => {\n editor.updateBlock(block, {\n props: {\n ...block.props,\n title: e.target.value,\n },\n });\n }}\n />\n </div>\n\n <div style={{ minHeight: '40px', color: '#6b7280' }}>\n {block.props.did ? (\n <p>Loading data from DID: {block.props.did}</p>\n ) : (\n <p>Enter a DID to load list data</p>\n )}\n </div>\n </div>\n );\n};\n\nexport const ListBlock = createReactBlockSpec(\n {\n type: 'list' as const,\n propSchema: {\n title: {\n default: '',\n },\n did: {\n default: '',\n },\n fragmentIdentifier: {\n default: '',\n },\n },\n content: 'none',\n },\n {\n render: (props) => <ListBlockContent {...props} />,\n }\n);\n","import React from 'react';\nimport { createReactBlockSpec } from '@blocknote/react';\n\nexport interface OverviewBlockSettings {\n did: string;\n}\n\nexport interface OverviewBlockProps {\n block: any;\n editor: any;\n}\n\nconst OverviewBlockContent: React.FC<OverviewBlockProps> = ({ block, editor }) => {\n return (\n <div\n style={{\n width: '100%',\n borderRadius: '6px',\n padding: '16px',\n backgroundColor: '#FFFFFF',\n fontFamily: 'Inter, Helvetica, Arial, sans-serif',\n border: '1px solid #e5e7eb',\n }}\n >\n <div style={{ marginBottom: '12px' }}>\n <input\n type=\"text\"\n value={block.props.did || ''}\n placeholder=\"Enter DID\"\n style={{\n color: '#2F2F2F',\n fontFamily: 'Inter, Helvetica, Arial, sans-serif',\n fontSize: '14px',\n fontWeight: 600,\n border: 'none',\n outline: 'none',\n background: 'transparent',\n width: '100%',\n }}\n onChange={(e) => {\n editor.updateBlock(block, {\n props: {\n ...block.props,\n did: e.target.value,\n },\n });\n }}\n />\n </div>\n\n <div style={{ minHeight: '40px', color: '#6b7280' }}>\n {block.props.did ? (\n <p>Loading overview for DID: {block.props.did}</p>\n ) : (\n <p>Enter a DID to load overview data</p>\n )}\n </div>\n </div>\n );\n};\n\nexport const OverviewBlock = createReactBlockSpec(\n {\n type: 'overview' as const,\n propSchema: {\n did: {\n default: '',\n },\n },\n content: 'none',\n },\n {\n render: (props) => <OverviewBlockContent {...props} />,\n }\n);\n","import { ListBlock } from './list';\nimport { OverviewBlock } from './overview';\nexport { ListBlock, OverviewBlock };\nexport type { ListBlockSettings, ListBlockProps } from './list';\nexport type { OverviewBlockSettings, OverviewBlockProps } from './overview';\n\n// Block configuration for easy import\nexport const blockSpecs = {\n list: ListBlock,\n overview: OverviewBlock,\n};\n\n// Slash menu items configuration\nexport const getExtraSlashMenuItems = (editor: any) => [\n {\n title: 'List',\n onItemClick: () => {\n editor.insertBlocks(\n [\n {\n type: 'list',\n props: {\n title: '',\n did: '',\n fragmentIdentifier: '',\n },\n },\n ],\n editor.getTextCursorPosition().block,\n 'after'\n );\n },\n aliases: ['list', 'data', 'dynamic'],\n group: 'Domains',\n subtext: 'Create a dynamic list from DID data',\n },\n {\n title: 'Overview',\n onItemClick: () => {\n editor.insertBlocks(\n [\n {\n type: 'overview',\n props: {\n did: '',\n },\n },\n ],\n editor.getTextCursorPosition().block,\n 'after'\n );\n },\n aliases: ['overview', 'overview-block', 'data-overview'],\n group: 'Domains',\n subtext: 'Create an overview from DID data',\n },\n];\n","import { useCreateBlockNote } from '@blocknote/react';\nimport {\n BlockNoteSchema,\n defaultBlockSpecs,\n defaultInlineContentSpecs,\n defaultStyleSpecs,\n} from '@blocknote/core';\nimport { IxoCollaborativeEditorOptions } from '../../core/types';\nimport { blockSpecs } from '../blocks';\nimport { useMatrixProvider } from '../../core/hooks/useMatrixProvider';\nimport * as Y from 'yjs';\nimport { useMemo } from 'react';\n\n/**\n * Custom hook that wraps useCreateBlockNote with IXO-specific configurations (Mantine version)\n * @param options - Configuration options for the IxoEditor\n * @returns A configured BlockNote editor instance\n */\nexport function useCreateCollaborativeIxoEditor(options: IxoCollaborativeEditorOptions) {\n // Extract IXO-specific options and BlockNote options\n // Memoize Y.Doc to prevent recreation on every render\n const yDoc = useMemo(() => new Y.Doc(), []);\n const {\n theme = 'light',\n uploadFile,\n initialContent,\n editable = true,\n sideMenu = true,\n slashMenu = true,\n formattingToolbar = true,\n linkToolbar = true,\n filePanel = true,\n tableHandles = true,\n user,\n matrixClient,\n } = options || {};\n\n // Memoize user data to prevent recreation\n const memoizedUser = useMemo(\n () => ({\n id: user?.id || '',\n name: user?.name || '',\n color: user?.color || '',\n accessToken: user?.accessToken || '',\n }),\n [user?.id, user?.name, user?.color, user?.accessToken]\n );\n\n const { matrixProvider, connectionStatus } = useMatrixProvider({\n yDoc,\n matrixClient,\n roomId: options.roomId,\n });\n\n // Memoize default upload handler to prevent recreation\n const defaultUploadFile = useMemo(\n () =>\n uploadFile ||\n (async (file: File) => {\n // Default implementation - convert to data URL\n // In production, you'd want to upload to a server\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n const dataUrl = reader.result as string;\n resolve(dataUrl);\n };\n reader.onerror = reject;\n reader.readAsDataURL(file);\n });\n }),\n [uploadFile]\n );\n\n // Memoize schema to prevent recreation\n const schema = useMemo(\n () =>\n BlockNoteSchema.create({\n blockSpecs: {\n ...defaultBlockSpecs,\n ...blockSpecs,\n },\n inlineContentSpecs: {\n ...defaultInlineContentSpecs,\n },\n styleSpecs: {\n ...defaultStyleSpecs,\n },\n }),\n []\n );\n\n // Memoize collaboration config to prevent recreation\n const collaborationConfig = useMemo(\n () => ({\n provider: matrixProvider,\n fragment: yDoc.getXmlFragment('document'),\n user: {\n name: memoizedUser.name,\n color: memoizedUser.color,\n },\n }),\n [matrixProvider, yDoc, memoizedUser.name, memoizedUser.color]\n );\n\n // Memoize IXO config to prevent recreation\n const ixoConfig = useMemo(\n () => ({\n theme,\n editable,\n sideMenu,\n slashMenu,\n formattingToolbar,\n linkToolbar,\n filePanel,\n tableHandles,\n }),\n [theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]\n );\n\n // Create the BlockNote editor with basic configurations\n const editor = useCreateBlockNote({\n schema,\n initialContent,\n uploadFile: defaultUploadFile,\n collaboration: collaborationConfig,\n });\n\n // Store configuration in editor for components to access\n if (editor) {\n (editor as any)._ixoConfig = ixoConfig;\n }\n\n return { editor, connectionStatus: connectionStatus };\n}\n","import React from 'react';\nimport { getDefaultReactSlashMenuItems, SuggestionMenuController } from '@blocknote/react';\nimport { BlockNoteView } from '@blocknote/mantine';\nimport { filterSuggestionItems } from '@blocknote/core';\nimport type { BlockNoteEditor } from '@blocknote/core';\nimport { IxoEditorConfig } from '../core/types';\nimport { getExtraSlashMenuItems } from './blocks';\n\nexport interface IxoEditorProps {\n editor: BlockNoteEditor<any, any, any> | undefined;\n className?: string;\n onChange?: () => void;\n onSelectionChange?: () => void;\n children?: React.ReactNode;\n}\n\n/**\n * IxoEditor component - A customized BlockNote editor for IXO (Mantine UI)\n */\nexport function IxoEditor({\n editor,\n className = '',\n onChange,\n onSelectionChange,\n children,\n}: IxoEditorProps) {\n if (!editor) {\n return null;\n }\n\n // Get IXO configuration from editor\n const config: IxoEditorConfig = (editor as any)._ixoConfig || {\n theme: 'light',\n editable: true,\n sideMenu: true,\n slashMenu: true,\n formattingToolbar: true,\n linkToolbar: true,\n filePanel: true,\n tableHandles: true,\n };\n\n return (\n <div className={`ixo-editor ixo-editor--theme-${config.theme} ${className}`}>\n <BlockNoteView\n editor={editor}\n editable={config.editable}\n sideMenu={config.sideMenu}\n slashMenu={false}\n formattingToolbar={config.formattingToolbar}\n linkToolbar={config.linkToolbar}\n filePanel={config.filePanel}\n tableHandles={config.tableHandles}\n theme={config.theme}\n onChange={onChange}\n onSelectionChange={onSelectionChange}\n >\n {config.slashMenu && (\n <SuggestionMenuController\n triggerCharacter={'/'}\n getItems={async (query) => {\n // Get default slash menu items for the current editor\n const defaultItems = getDefaultReactSlashMenuItems(editor);\n // Add our custom items\n const customItems = getExtraSlashMenuItems(editor);\n // Combine and filter based on query\n return filterSuggestionItems([...defaultItems, ...customItems], query);\n }}\n />\n )}\n {children}\n </BlockNoteView>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACNP,OAAO,WAAW;AAClB,SAAS,4BAA4B;AAYrC,IAAM,mBAA6C,CAAC,EAAE,OAAO,OAAO,MAAM;AACxE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,SAAS;AAAA,QACT,iBAAiB;AAAA,QACjB,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA;AAAA,IAEA,oCAAC,SAAI,OAAO,EAAE,cAAc,OAAO,KACjC;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAO,MAAM,MAAM,SAAS;AAAA,QAC5B,aAAY;AAAA,QACZ,OAAO;AAAA,UACL,OAAO;AAAA,UACP,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,OAAO;AAAA,QACT;AAAA,QACA,UAAU,CAAC,MAAM;AACf,iBAAO,YAAY,OAAO;AAAA,YACxB,OAAO;AAAA,cACL,GAAG,MAAM;AAAA,cACT,OAAO,EAAE,OAAO;AAAA,YAClB;AAAA,UACF,CAAC;AAAA,QACH;AAAA;AAAA,IACF,CACF;AAAA,IAEA,oCAAC,SAAI,OAAO,E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,OAAO;AAAA,MACjB,WAAW;AAAA,MACX,mBAAmB,OAAO;AAAA,MAC1B,aAAa,OAAO;AAAA,MACpB,WAAW,OAAO;AAAA,MAClB,cAAc,OAAO;AAAA,MACrB,OAAO,OAAO;AAAA,MACd;AAAA,MACA;AAAA;AAAA,IAEC,OAAO,aACN,gBAAAA,OAAA;AAAA,MAAC;AAAA;AAAA,QACC,kBAAkB;AAAA,QAClB,UAAU,OAAO,UAAU;AAEzB,gBAAM,eAAe,8BAA8B,MAAM;AAEzD,gBAAM,cAAc,uBAAuB,MAAM;AAEjD,iBAAO,sBAAsB,CAAC,GAAG,cAAc,GAAG,WAAW,GAAG,KAAK;AAAA,QACvE;AAAA;AAAA,IACF;AAAA,IAED;AAAA,EACH,CACF;AAEJ;","names":["React","createReactBlockSpec","useCreateBlockNote","BlockNoteSchema","defaultBlockSpecs","defaultInlineContentSpecs","defaultStyleSpecs","BlockNoteSchema","defaultBlockSpecs","defaultInlineContentSpecs","defaultStyleSpecs","useCreateBlockNote","React","React"]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixo/editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "A custom BlockNote editor wrapper for IXO team",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
|
-
"types": "dist/index.d.
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/",
|
|
9
9
|
"fonts/",
|
|
10
10
|
"style.css",
|
|
11
|
-
"style-shadcn.css",
|
|
12
11
|
"style-mantine.css",
|
|
13
12
|
"style-core.css",
|
|
14
13
|
"style.css.d.ts",
|
|
@@ -16,32 +15,28 @@
|
|
|
16
15
|
],
|
|
17
16
|
"exports": {
|
|
18
17
|
".": {
|
|
19
|
-
"types": "./dist/index.d.
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
20
19
|
"import": "./dist/index.mjs"
|
|
21
20
|
},
|
|
22
|
-
"./shadcn": {
|
|
23
|
-
"types": "./dist/shadcn/index.d.mts",
|
|
24
|
-
"import": "./dist/shadcn/index.mjs"
|
|
25
|
-
},
|
|
26
21
|
"./mantine": {
|
|
27
|
-
"types": "./dist/mantine/index.d.
|
|
22
|
+
"types": "./dist/mantine/index.d.ts",
|
|
28
23
|
"import": "./dist/mantine/index.mjs"
|
|
29
24
|
},
|
|
30
25
|
"./style.css": "./style.css",
|
|
31
|
-
"./style-shadcn.css": "./style-shadcn.css",
|
|
32
26
|
"./style-mantine.css": "./style-mantine.css",
|
|
33
27
|
"./style-core.css": "./style-core.css"
|
|
34
28
|
},
|
|
35
29
|
"scripts": {
|
|
36
|
-
"build": "tsup",
|
|
30
|
+
"build": "tsup && node scripts/rename-dts.mjs",
|
|
37
31
|
"build:watch": "tsup --watch",
|
|
38
32
|
"dev": "tsup --watch",
|
|
39
33
|
"clean": "rimraf dist style.css",
|
|
40
|
-
"prepare": "npm run clean && npm run build",
|
|
34
|
+
"prepare": "husky install && npm run clean && npm run build",
|
|
41
35
|
"type-check": "tsc --noEmit",
|
|
42
36
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
43
37
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
44
|
-
"format:check": "prettier --check \"src/**/*.{ts,tsx}\""
|
|
38
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
39
|
+
"lint-staged": "lint-staged"
|
|
45
40
|
},
|
|
46
41
|
"keywords": [
|
|
47
42
|
"editor",
|
|
@@ -54,34 +49,28 @@
|
|
|
54
49
|
"license": "MIT",
|
|
55
50
|
"private": false,
|
|
56
51
|
"peerDependencies": {
|
|
52
|
+
"@ixo/matrix-crdt": "*",
|
|
57
53
|
"@mantine/core": "^7.11.2",
|
|
58
54
|
"@mantine/hooks": "^7.11.2",
|
|
59
55
|
"matrix-js-sdk": "^37.5.0",
|
|
60
56
|
"react": "^18.0.0",
|
|
61
|
-
"react-dom": "^18.0.0"
|
|
62
|
-
"ixo-matrix-crdt": "*"
|
|
57
|
+
"react-dom": "^18.0.0"
|
|
63
58
|
},
|
|
64
59
|
"dependencies": {
|
|
65
60
|
"@blocknote/core": "^0.15.0",
|
|
66
61
|
"@blocknote/mantine": "^0.15.0",
|
|
67
62
|
"@blocknote/react": "^0.15.0",
|
|
68
|
-
"@
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"@radix-ui/react-label": "^2.1.7",
|
|
72
|
-
"@radix-ui/react-slot": "^1.2.3",
|
|
73
|
-
"@radix-ui/react-switch": "^1.2.6",
|
|
74
|
-
"@radix-ui/react-tabs": "^1.1.13",
|
|
75
|
-
"@radix-ui/react-toggle": "^1.1.10",
|
|
76
|
-
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
77
|
-
"class-variance-authority": "^0.7.1",
|
|
78
|
-
"clsx": "^2.1.1",
|
|
79
|
-
"lucide-react": "^0.542.0",
|
|
80
|
-
"tailwind-merge": "^3.3.1",
|
|
81
|
-
"tw-animate-css": "^1.3.7",
|
|
82
|
-
"yjs": "^13.6.27"
|
|
63
|
+
"@tabler/icons-react": "^3.35.0",
|
|
64
|
+
"yjs": "^13.6.27",
|
|
65
|
+
"zustand": "^5.0.8"
|
|
83
66
|
},
|
|
84
67
|
"devDependencies": {
|
|
68
|
+
"@commitlint/cli": "^20.0.0",
|
|
69
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
70
|
+
"@eslint/compat": "^1.4.0",
|
|
71
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
72
|
+
"@eslint/js": "^9.36.0",
|
|
73
|
+
"@ixo/matrix-crdt": "1.0.3",
|
|
85
74
|
"@mantine/core": "^7.11.2",
|
|
86
75
|
"@mantine/hooks": "^7.11.2",
|
|
87
76
|
"@semantic-release/changelog": "^6.0.3",
|
|
@@ -91,8 +80,15 @@
|
|
|
91
80
|
"@semantic-release/release-notes-generator": "^12.1.0",
|
|
92
81
|
"@types/react": "^18.2.0",
|
|
93
82
|
"@types/react-dom": "^18.2.0",
|
|
94
|
-
"
|
|
95
|
-
"
|
|
83
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
84
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
85
|
+
"eslint": "^9.36.0",
|
|
86
|
+
"eslint-config-prettier": "^10.1.8",
|
|
87
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
88
|
+
"eslint-plugin-react": "^7.37.5",
|
|
89
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
90
|
+
"husky": "^8.0.3",
|
|
91
|
+
"lint-staged": "^16.2.0",
|
|
96
92
|
"prettier": "^3.2.5",
|
|
97
93
|
"react": "^18.2.0",
|
|
98
94
|
"react-dom": "^18.2.0",
|
|
@@ -108,5 +104,14 @@
|
|
|
108
104
|
"homepage": "https://github.com/ixoworld/editor#readme",
|
|
109
105
|
"bugs": {
|
|
110
106
|
"url": "https://github.com/ixoworld/editor/issues"
|
|
107
|
+
},
|
|
108
|
+
"lint-staged": {
|
|
109
|
+
"*.{ts,tsx,js,jsx}": [
|
|
110
|
+
"eslint --fix",
|
|
111
|
+
"prettier --write"
|
|
112
|
+
],
|
|
113
|
+
"*.{json,md,css}": [
|
|
114
|
+
"prettier --write"
|
|
115
|
+
]
|
|
111
116
|
}
|
|
112
117
|
}
|