@ixo/editor 1.0.1 → 1.1.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 +160 -136
- package/dist/chunk-57TP5N42.mjs +1784 -0
- package/dist/chunk-57TP5N42.mjs.map +1 -0
- package/dist/chunk-MXVDN3FO.mjs +169 -0
- package/dist/chunk-MXVDN3FO.mjs.map +1 -0
- package/dist/graphql-client-BmODcqPE.d.mts +135 -0
- package/dist/index.d.mts +1328 -0
- package/dist/index.mjs +27 -0
- package/dist/index.mjs.map +1 -0
- package/dist/mantine/index.d.mts +1253 -0
- package/dist/mantine/index.mjs +413 -0
- package/dist/mantine/index.mjs.map +1 -0
- package/dist/shadcn/index.d.mts +6 -0
- package/dist/shadcn/index.mjs +27 -0
- package/dist/shadcn/index.mjs.map +1 -0
- package/fonts/inter-v12-latin/inter-v12-latin-100.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-100.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-200.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-200.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-300.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-300.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-500.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-500.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-600.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-600.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-700.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-700.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-800.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-800.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-900.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-900.woff2 +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-regular.woff +0 -0
- package/fonts/inter-v12-latin/inter-v12-latin-regular.woff2 +0 -0
- package/package.json +32 -10
- package/style-core.css +243 -0
- package/style-mantine.css +340 -0
- package/style-shadcn.css +340 -0
- package/style.css +94 -0
- package/dist/blocks/index.d.ts +0 -85
- package/dist/blocks/index.d.ts.map +0 -1
- package/dist/blocks/index.js +0 -50
- package/dist/blocks/list/ListBlock.d.ts +0 -59
- package/dist/blocks/list/ListBlock.d.ts.map +0 -1
- package/dist/blocks/list/ListBlock.js +0 -51
- package/dist/blocks/list/ListBlockToolbar.d.ts +0 -9
- package/dist/blocks/list/ListBlockToolbar.d.ts.map +0 -1
- package/dist/blocks/list/ListBlockToolbar.js +0 -26
- package/dist/blocks/list/ListContainer.d.ts +0 -5
- package/dist/blocks/list/ListContainer.d.ts.map +0 -1
- package/dist/blocks/list/ListContainer.js +0 -10
- package/dist/blocks/list/ListGeneralTab.d.ts +0 -11
- package/dist/blocks/list/ListGeneralTab.d.ts.map +0 -1
- package/dist/blocks/list/ListGeneralTab.js +0 -134
- package/dist/blocks/list/ListItem.d.ts +0 -8
- package/dist/blocks/list/ListItem.d.ts.map +0 -1
- package/dist/blocks/list/ListItem.js +0 -24
- package/dist/blocks/list/ListPreviewTab.d.ts +0 -9
- package/dist/blocks/list/ListPreviewTab.d.ts.map +0 -1
- package/dist/blocks/list/ListPreviewTab.js +0 -51
- package/dist/blocks/list/ListSettings.d.ts +0 -3
- package/dist/blocks/list/ListSettings.d.ts.map +0 -1
- package/dist/blocks/list/ListSettings.js +0 -115
- package/dist/blocks/list/ListSettingsTab.d.ts +0 -10
- package/dist/blocks/list/ListSettingsTab.d.ts.map +0 -1
- package/dist/blocks/list/ListSettingsTab.js +0 -64
- package/dist/blocks/list/index.d.ts +0 -3
- package/dist/blocks/list/index.d.ts.map +0 -1
- package/dist/blocks/list/index.js +0 -5
- package/dist/blocks/list/useList.d.ts +0 -5
- package/dist/blocks/list/useList.d.ts.map +0 -1
- package/dist/blocks/list/useList.js +0 -11
- package/dist/blocks/overview/OverviewBlock.d.ts +0 -33
- package/dist/blocks/overview/OverviewBlock.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewBlock.js +0 -34
- package/dist/blocks/overview/OverviewBlockToolbar.d.ts +0 -8
- package/dist/blocks/overview/OverviewBlockToolbar.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewBlockToolbar.js +0 -16
- package/dist/blocks/overview/OverviewGeneralTab.d.ts +0 -11
- package/dist/blocks/overview/OverviewGeneralTab.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewGeneralTab.js +0 -134
- package/dist/blocks/overview/OverviewPreviewTab.d.ts +0 -10
- package/dist/blocks/overview/OverviewPreviewTab.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewPreviewTab.js +0 -30
- package/dist/blocks/overview/OverviewSettings.d.ts +0 -3
- package/dist/blocks/overview/OverviewSettings.d.ts.map +0 -1
- package/dist/blocks/overview/OverviewSettings.js +0 -114
- package/dist/blocks/overview/index.d.ts +0 -3
- package/dist/blocks/overview/index.d.ts.map +0 -1
- package/dist/blocks/overview/index.js +0 -5
- package/dist/blocks/overview/useOverview.d.ts +0 -11
- package/dist/blocks/overview/useOverview.d.ts.map +0 -1
- package/dist/blocks/overview/useOverview.js +0 -61
- package/dist/components/GlobeIcon.d.ts +0 -9
- package/dist/components/GlobeIcon.d.ts.map +0 -1
- package/dist/components/GlobeIcon.js +0 -20
- package/dist/components/IxoEditor.d.ts +0 -14
- package/dist/components/IxoEditor.d.ts.map +0 -1
- package/dist/components/IxoEditor.js +0 -41
- package/dist/components/PenIcon.d.ts +0 -9
- package/dist/components/PenIcon.d.ts.map +0 -1
- package/dist/components/PenIcon.js +0 -20
- package/dist/components/SettingsIcon.d.ts +0 -9
- package/dist/components/SettingsIcon.d.ts.map +0 -1
- package/dist/components/SettingsIcon.js +0 -21
- package/dist/components/SettingsModal/AdvancedTab.d.ts +0 -8
- package/dist/components/SettingsModal/AdvancedTab.d.ts.map +0 -1
- package/dist/components/SettingsModal/AdvancedTab.js +0 -14
- package/dist/components/SettingsModal/DomainPreview.d.ts +0 -7
- package/dist/components/SettingsModal/DomainPreview.d.ts.map +0 -1
- package/dist/components/SettingsModal/DomainPreview.js +0 -22
- package/dist/components/SettingsModal/FeatureASettings.d.ts +0 -3
- package/dist/components/SettingsModal/FeatureASettings.d.ts.map +0 -1
- package/dist/components/SettingsModal/FeatureASettings.js +0 -74
- package/dist/components/SettingsModal/GeneralTab.d.ts +0 -10
- package/dist/components/SettingsModal/GeneralTab.d.ts.map +0 -1
- package/dist/components/SettingsModal/GeneralTab.js +0 -111
- package/dist/components/SettingsModal/PreviewTab.d.ts +0 -8
- package/dist/components/SettingsModal/PreviewTab.d.ts.map +0 -1
- package/dist/components/SettingsModal/PreviewTab.js +0 -14
- package/dist/components/SettingsModal/SettingsModal.d.ts +0 -16
- package/dist/components/SettingsModal/SettingsModal.d.ts.map +0 -1
- package/dist/components/SettingsModal/SettingsModal.js +0 -61
- package/dist/components/SettingsModal/SettingsNavigation.d.ts +0 -15
- package/dist/components/SettingsModal/SettingsNavigation.d.ts.map +0 -1
- package/dist/components/SettingsModal/SettingsNavigation.js +0 -21
- package/dist/components/SettingsModal/index.d.ts +0 -8
- package/dist/components/SettingsModal/index.d.ts.map +0 -1
- package/dist/components/SettingsModal/index.js +0 -17
- package/dist/components/SwitchOption.d.ts +0 -9
- package/dist/components/SwitchOption.d.ts.map +0 -1
- package/dist/components/SwitchOption.js +0 -45
- package/dist/components/icons/ArchiveIcon.d.ts +0 -9
- package/dist/components/icons/ArchiveIcon.d.ts.map +0 -1
- package/dist/components/icons/ArchiveIcon.js +0 -18
- package/dist/components/icons/AudioIcon.d.ts +0 -9
- package/dist/components/icons/AudioIcon.d.ts.map +0 -1
- package/dist/components/icons/AudioIcon.js +0 -17
- package/dist/components/icons/DefaultIcon.d.ts +0 -9
- package/dist/components/icons/DefaultIcon.d.ts.map +0 -1
- package/dist/components/icons/DefaultIcon.js +0 -17
- package/dist/components/icons/DocumentIcon.d.ts +0 -9
- package/dist/components/icons/DocumentIcon.d.ts.map +0 -1
- package/dist/components/icons/DocumentIcon.js +0 -20
- package/dist/components/icons/ImageIcon.d.ts +0 -9
- package/dist/components/icons/ImageIcon.d.ts.map +0 -1
- package/dist/components/icons/ImageIcon.js +0 -18
- package/dist/components/icons/JsonIcon.d.ts +0 -9
- package/dist/components/icons/JsonIcon.d.ts.map +0 -1
- package/dist/components/icons/JsonIcon.js +0 -19
- package/dist/components/icons/PdfIcon.d.ts +0 -9
- package/dist/components/icons/PdfIcon.d.ts.map +0 -1
- package/dist/components/icons/PdfIcon.js +0 -20
- package/dist/components/icons/VideoIcon.d.ts +0 -9
- package/dist/components/icons/VideoIcon.d.ts.map +0 -1
- package/dist/components/icons/VideoIcon.js +0 -17
- package/dist/components/icons/XmlIcon.d.ts +0 -9
- package/dist/components/icons/XmlIcon.d.ts.map +0 -1
- package/dist/components/icons/XmlIcon.js +0 -19
- package/dist/components/icons/index.d.ts +0 -10
- package/dist/components/icons/index.d.ts.map +0 -1
- package/dist/components/icons/index.js +0 -24
- package/dist/components/ui/button.d.ts +0 -11
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js +0 -68
- package/dist/components/ui/card.d.ts +0 -9
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/card.js +0 -56
- package/dist/components/ui/dialog.d.ts +0 -16
- package/dist/components/ui/dialog.d.ts.map +0 -1
- package/dist/components/ui/dialog.js +0 -85
- package/dist/components/ui/dropdown-menu.d.ts +0 -26
- package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu.js +0 -110
- package/dist/components/ui/input.d.ts +0 -4
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/input.js +0 -41
- package/dist/components/ui/label.d.ts +0 -5
- package/dist/components/ui/label.d.ts.map +0 -1
- package/dist/components/ui/label.js +0 -42
- package/dist/components/ui/switch.d.ts +0 -5
- package/dist/components/ui/switch.d.ts.map +0 -1
- package/dist/components/ui/switch.js +0 -44
- package/dist/components/ui/tabs.d.ts +0 -8
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js +0 -54
- package/dist/components/ui/toggle-group.d.ts +0 -8
- package/dist/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/components/ui/toggle-group.js +0 -57
- package/dist/components/ui/toggle.d.ts +0 -10
- package/dist/components/ui/toggle.d.ts.map +0 -1
- package/dist/components/ui/toggle.js +0 -62
- package/dist/hooks/useCollaborativeIxoEditor.d.ts +0 -571
- package/dist/hooks/useCollaborativeIxoEditor.d.ts.map +0 -1
- package/dist/hooks/useCollaborativeIxoEditor.js +0 -127
- package/dist/hooks/useCreateIxoEditor.d.ts +0 -568
- package/dist/hooks/useCreateIxoEditor.d.ts.map +0 -1
- package/dist/hooks/useCreateIxoEditor.js +0 -62
- package/dist/hooks/useMatrixProvider.d.ts +0 -13
- package/dist/hooks/useMatrixProvider.d.ts.map +0 -1
- package/dist/hooks/useMatrixProvider.js +0 -147
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -24
- package/dist/lib/graphql-client.d.ts +0 -27
- package/dist/lib/graphql-client.d.ts.map +0 -1
- package/dist/lib/graphql-client.js +0 -36
- package/dist/lib/graphql-queries.d.ts +0 -31
- package/dist/lib/graphql-queries.d.ts.map +0 -1
- package/dist/lib/graphql-queries.js +0 -40
- package/dist/lib/utils/getMediaTypeIcon.d.ts +0 -20
- package/dist/lib/utils/getMediaTypeIcon.d.ts.map +0 -1
- package/dist/lib/utils/getMediaTypeIcon.js +0 -96
- package/dist/lib/utils/index.d.ts +0 -4
- package/dist/lib/utils/index.d.ts.map +0 -1
- package/dist/lib/utils/index.js +0 -12
- package/dist/lib/utils.d.ts +0 -3
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -8
- package/dist/types/Domain.d.ts +0 -18
- package/dist/types/Domain.d.ts.map +0 -1
- package/dist/types/Domain.js +0 -2
- package/dist/types/index.d.ts +0 -77
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GraphQLClient,
|
|
3
|
+
getEntity,
|
|
4
|
+
ixoGraphQLClient,
|
|
5
|
+
useMatrixProvider
|
|
6
|
+
} from "../chunk-MXVDN3FO.mjs";
|
|
7
|
+
|
|
8
|
+
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
9
|
+
import { useCreateBlockNote } from "@blocknote/react";
|
|
10
|
+
import { BlockNoteSchema, defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "@blocknote/core";
|
|
11
|
+
|
|
12
|
+
// src/mantine/blocks/list/ListBlock.tsx
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { createReactBlockSpec } from "@blocknote/react";
|
|
15
|
+
var ListBlockContent = ({ block, editor }) => {
|
|
16
|
+
return /* @__PURE__ */ React.createElement(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
style: {
|
|
20
|
+
width: "100%",
|
|
21
|
+
borderRadius: "6px",
|
|
22
|
+
padding: "16px",
|
|
23
|
+
backgroundColor: "#FFFFFF",
|
|
24
|
+
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
25
|
+
border: "1px solid #e5e7eb"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
/* @__PURE__ */ React.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React.createElement(
|
|
29
|
+
"input",
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
value: block.props.title || "",
|
|
33
|
+
placeholder: "New list",
|
|
34
|
+
style: {
|
|
35
|
+
color: "#2F2F2F",
|
|
36
|
+
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
37
|
+
fontSize: "14px",
|
|
38
|
+
fontWeight: 600,
|
|
39
|
+
border: "none",
|
|
40
|
+
outline: "none",
|
|
41
|
+
background: "transparent",
|
|
42
|
+
width: "100%"
|
|
43
|
+
},
|
|
44
|
+
onChange: (e) => {
|
|
45
|
+
editor.updateBlock(block, {
|
|
46
|
+
props: {
|
|
47
|
+
...block.props,
|
|
48
|
+
title: e.target.value
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
)),
|
|
54
|
+
/* @__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"))
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
var ListBlock = createReactBlockSpec(
|
|
58
|
+
{
|
|
59
|
+
type: "list",
|
|
60
|
+
propSchema: {
|
|
61
|
+
title: {
|
|
62
|
+
default: ""
|
|
63
|
+
},
|
|
64
|
+
did: {
|
|
65
|
+
default: ""
|
|
66
|
+
},
|
|
67
|
+
fragmentIdentifier: {
|
|
68
|
+
default: ""
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
content: "none"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
render: (props) => /* @__PURE__ */ React.createElement(ListBlockContent, { ...props })
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// src/mantine/blocks/overview/OverviewBlock.tsx
|
|
79
|
+
import React2 from "react";
|
|
80
|
+
import { createReactBlockSpec as createReactBlockSpec2 } from "@blocknote/react";
|
|
81
|
+
var OverviewBlockContent = ({ block, editor }) => {
|
|
82
|
+
return /* @__PURE__ */ React2.createElement(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
style: {
|
|
86
|
+
width: "100%",
|
|
87
|
+
borderRadius: "6px",
|
|
88
|
+
padding: "16px",
|
|
89
|
+
backgroundColor: "#FFFFFF",
|
|
90
|
+
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
91
|
+
border: "1px solid #e5e7eb"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ React2.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React2.createElement(
|
|
95
|
+
"input",
|
|
96
|
+
{
|
|
97
|
+
type: "text",
|
|
98
|
+
value: block.props.did || "",
|
|
99
|
+
placeholder: "Enter DID",
|
|
100
|
+
style: {
|
|
101
|
+
color: "#2F2F2F",
|
|
102
|
+
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
103
|
+
fontSize: "14px",
|
|
104
|
+
fontWeight: 600,
|
|
105
|
+
border: "none",
|
|
106
|
+
outline: "none",
|
|
107
|
+
background: "transparent",
|
|
108
|
+
width: "100%"
|
|
109
|
+
},
|
|
110
|
+
onChange: (e) => {
|
|
111
|
+
editor.updateBlock(block, {
|
|
112
|
+
props: {
|
|
113
|
+
...block.props,
|
|
114
|
+
did: e.target.value
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
)),
|
|
120
|
+
/* @__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"))
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
var OverviewBlock = createReactBlockSpec2(
|
|
124
|
+
{
|
|
125
|
+
type: "overview",
|
|
126
|
+
propSchema: {
|
|
127
|
+
did: {
|
|
128
|
+
default: ""
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
content: "none"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
render: (props) => /* @__PURE__ */ React2.createElement(OverviewBlockContent, { ...props })
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
// src/mantine/blocks/index.ts
|
|
139
|
+
var blockSpecs = {
|
|
140
|
+
list: ListBlock,
|
|
141
|
+
overview: OverviewBlock
|
|
142
|
+
};
|
|
143
|
+
var getExtraSlashMenuItems = (editor) => [
|
|
144
|
+
{
|
|
145
|
+
title: "List",
|
|
146
|
+
onItemClick: () => {
|
|
147
|
+
editor.insertBlocks(
|
|
148
|
+
[
|
|
149
|
+
{
|
|
150
|
+
type: "list",
|
|
151
|
+
props: {
|
|
152
|
+
title: "",
|
|
153
|
+
did: "",
|
|
154
|
+
fragmentIdentifier: ""
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
editor.getTextCursorPosition().block,
|
|
159
|
+
"after"
|
|
160
|
+
);
|
|
161
|
+
},
|
|
162
|
+
aliases: ["list", "data", "dynamic"],
|
|
163
|
+
group: "Domains",
|
|
164
|
+
subtext: "Create a dynamic list from DID data"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
title: "Overview",
|
|
168
|
+
onItemClick: () => {
|
|
169
|
+
editor.insertBlocks(
|
|
170
|
+
[
|
|
171
|
+
{
|
|
172
|
+
type: "overview",
|
|
173
|
+
props: {
|
|
174
|
+
did: ""
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
editor.getTextCursorPosition().block,
|
|
179
|
+
"after"
|
|
180
|
+
);
|
|
181
|
+
},
|
|
182
|
+
aliases: ["overview", "overview-block", "data-overview"],
|
|
183
|
+
group: "Domains",
|
|
184
|
+
subtext: "Create an overview from DID data"
|
|
185
|
+
}
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
189
|
+
function useCreateIxoEditor(options) {
|
|
190
|
+
const {
|
|
191
|
+
theme = "light",
|
|
192
|
+
uploadFile,
|
|
193
|
+
initialContent,
|
|
194
|
+
editable = true,
|
|
195
|
+
sideMenu = true,
|
|
196
|
+
slashMenu = true,
|
|
197
|
+
formattingToolbar = true,
|
|
198
|
+
linkToolbar = true,
|
|
199
|
+
filePanel = true,
|
|
200
|
+
tableHandles = true
|
|
201
|
+
} = options || {};
|
|
202
|
+
const defaultUploadFile = uploadFile || (async (file) => {
|
|
203
|
+
return new Promise((resolve, reject) => {
|
|
204
|
+
const reader = new FileReader();
|
|
205
|
+
reader.onloadend = () => {
|
|
206
|
+
const dataUrl = reader.result;
|
|
207
|
+
resolve(dataUrl);
|
|
208
|
+
};
|
|
209
|
+
reader.onerror = reject;
|
|
210
|
+
reader.readAsDataURL(file);
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
const schema = BlockNoteSchema.create({
|
|
214
|
+
blockSpecs: {
|
|
215
|
+
...defaultBlockSpecs,
|
|
216
|
+
...blockSpecs
|
|
217
|
+
},
|
|
218
|
+
inlineContentSpecs: {
|
|
219
|
+
...defaultInlineContentSpecs
|
|
220
|
+
},
|
|
221
|
+
styleSpecs: {
|
|
222
|
+
...defaultStyleSpecs
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
const editor = useCreateBlockNote({
|
|
226
|
+
schema,
|
|
227
|
+
initialContent,
|
|
228
|
+
uploadFile: defaultUploadFile
|
|
229
|
+
});
|
|
230
|
+
if (editor) {
|
|
231
|
+
editor._ixoConfig = {
|
|
232
|
+
theme,
|
|
233
|
+
editable,
|
|
234
|
+
sideMenu,
|
|
235
|
+
slashMenu,
|
|
236
|
+
formattingToolbar,
|
|
237
|
+
linkToolbar,
|
|
238
|
+
filePanel,
|
|
239
|
+
tableHandles
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
return editor;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
246
|
+
import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
247
|
+
import {
|
|
248
|
+
BlockNoteSchema as BlockNoteSchema2,
|
|
249
|
+
defaultBlockSpecs as defaultBlockSpecs2,
|
|
250
|
+
defaultInlineContentSpecs as defaultInlineContentSpecs2,
|
|
251
|
+
defaultStyleSpecs as defaultStyleSpecs2
|
|
252
|
+
} from "@blocknote/core";
|
|
253
|
+
import * as Y from "yjs";
|
|
254
|
+
import { useMemo } from "react";
|
|
255
|
+
function useCreateCollaborativeIxoEditor(options) {
|
|
256
|
+
const yDoc = useMemo(() => new Y.Doc(), []);
|
|
257
|
+
const {
|
|
258
|
+
theme = "light",
|
|
259
|
+
uploadFile,
|
|
260
|
+
initialContent,
|
|
261
|
+
editable = true,
|
|
262
|
+
sideMenu = true,
|
|
263
|
+
slashMenu = true,
|
|
264
|
+
formattingToolbar = true,
|
|
265
|
+
linkToolbar = true,
|
|
266
|
+
filePanel = true,
|
|
267
|
+
tableHandles = true,
|
|
268
|
+
user,
|
|
269
|
+
matrixClient
|
|
270
|
+
} = options || {};
|
|
271
|
+
const memoizedUser = useMemo(() => ({
|
|
272
|
+
id: user?.id || "",
|
|
273
|
+
name: user?.name || "",
|
|
274
|
+
color: user?.color || "",
|
|
275
|
+
accessToken: user?.accessToken || ""
|
|
276
|
+
}), [user?.id, user?.name, user?.color, user?.accessToken]);
|
|
277
|
+
const { matrixProvider, connectionStatus } = useMatrixProvider({
|
|
278
|
+
yDoc,
|
|
279
|
+
matrixClient,
|
|
280
|
+
roomId: options.roomId
|
|
281
|
+
});
|
|
282
|
+
const defaultUploadFile = useMemo(() => uploadFile || (async (file) => {
|
|
283
|
+
return new Promise((resolve, reject) => {
|
|
284
|
+
const reader = new FileReader();
|
|
285
|
+
reader.onloadend = () => {
|
|
286
|
+
const dataUrl = reader.result;
|
|
287
|
+
resolve(dataUrl);
|
|
288
|
+
};
|
|
289
|
+
reader.onerror = reject;
|
|
290
|
+
reader.readAsDataURL(file);
|
|
291
|
+
});
|
|
292
|
+
}), [uploadFile]);
|
|
293
|
+
const schema = useMemo(() => BlockNoteSchema2.create({
|
|
294
|
+
blockSpecs: {
|
|
295
|
+
...defaultBlockSpecs2,
|
|
296
|
+
...blockSpecs
|
|
297
|
+
},
|
|
298
|
+
inlineContentSpecs: {
|
|
299
|
+
...defaultInlineContentSpecs2
|
|
300
|
+
},
|
|
301
|
+
styleSpecs: {
|
|
302
|
+
...defaultStyleSpecs2
|
|
303
|
+
}
|
|
304
|
+
}), []);
|
|
305
|
+
const collaborationConfig = useMemo(() => ({
|
|
306
|
+
provider: matrixProvider,
|
|
307
|
+
fragment: yDoc.getXmlFragment("document"),
|
|
308
|
+
user: {
|
|
309
|
+
name: memoizedUser.name,
|
|
310
|
+
color: memoizedUser.color
|
|
311
|
+
}
|
|
312
|
+
}), [matrixProvider, yDoc, memoizedUser.name, memoizedUser.color]);
|
|
313
|
+
const ixoConfig = useMemo(() => ({
|
|
314
|
+
theme,
|
|
315
|
+
editable,
|
|
316
|
+
sideMenu,
|
|
317
|
+
slashMenu,
|
|
318
|
+
formattingToolbar,
|
|
319
|
+
linkToolbar,
|
|
320
|
+
filePanel,
|
|
321
|
+
tableHandles
|
|
322
|
+
}), [theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]);
|
|
323
|
+
const editor = useCreateBlockNote2({
|
|
324
|
+
schema,
|
|
325
|
+
initialContent,
|
|
326
|
+
uploadFile: defaultUploadFile,
|
|
327
|
+
collaboration: collaborationConfig
|
|
328
|
+
});
|
|
329
|
+
if (editor) {
|
|
330
|
+
editor._ixoConfig = ixoConfig;
|
|
331
|
+
}
|
|
332
|
+
return { editor, connectionStatus };
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/mantine/IxoEditor.tsx
|
|
336
|
+
import React3 from "react";
|
|
337
|
+
import {
|
|
338
|
+
getDefaultReactSlashMenuItems,
|
|
339
|
+
SuggestionMenuController
|
|
340
|
+
} from "@blocknote/react";
|
|
341
|
+
import { BlockNoteView } from "@blocknote/mantine";
|
|
342
|
+
import { filterSuggestionItems } from "@blocknote/core";
|
|
343
|
+
function IxoEditor({
|
|
344
|
+
editor,
|
|
345
|
+
className = "",
|
|
346
|
+
onChange,
|
|
347
|
+
onSelectionChange,
|
|
348
|
+
children
|
|
349
|
+
}) {
|
|
350
|
+
if (!editor) {
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
const config = editor._ixoConfig || {
|
|
354
|
+
theme: "light",
|
|
355
|
+
editable: true,
|
|
356
|
+
sideMenu: true,
|
|
357
|
+
slashMenu: true,
|
|
358
|
+
formattingToolbar: true,
|
|
359
|
+
linkToolbar: true,
|
|
360
|
+
filePanel: true,
|
|
361
|
+
tableHandles: true
|
|
362
|
+
};
|
|
363
|
+
return /* @__PURE__ */ React3.createElement(
|
|
364
|
+
"div",
|
|
365
|
+
{
|
|
366
|
+
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`
|
|
367
|
+
},
|
|
368
|
+
/* @__PURE__ */ React3.createElement(
|
|
369
|
+
BlockNoteView,
|
|
370
|
+
{
|
|
371
|
+
editor,
|
|
372
|
+
editable: config.editable,
|
|
373
|
+
sideMenu: config.sideMenu,
|
|
374
|
+
slashMenu: false,
|
|
375
|
+
formattingToolbar: config.formattingToolbar,
|
|
376
|
+
linkToolbar: config.linkToolbar,
|
|
377
|
+
filePanel: config.filePanel,
|
|
378
|
+
tableHandles: config.tableHandles,
|
|
379
|
+
theme: config.theme,
|
|
380
|
+
onChange,
|
|
381
|
+
onSelectionChange
|
|
382
|
+
},
|
|
383
|
+
config.slashMenu && /* @__PURE__ */ React3.createElement(
|
|
384
|
+
SuggestionMenuController,
|
|
385
|
+
{
|
|
386
|
+
triggerCharacter: "/",
|
|
387
|
+
getItems: async (query) => {
|
|
388
|
+
const defaultItems = getDefaultReactSlashMenuItems(editor);
|
|
389
|
+
const customItems = getExtraSlashMenuItems(editor);
|
|
390
|
+
return filterSuggestionItems(
|
|
391
|
+
[...defaultItems, ...customItems],
|
|
392
|
+
query
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
),
|
|
397
|
+
children
|
|
398
|
+
)
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
export {
|
|
402
|
+
GraphQLClient,
|
|
403
|
+
IxoEditor,
|
|
404
|
+
ListBlock,
|
|
405
|
+
OverviewBlock,
|
|
406
|
+
blockSpecs,
|
|
407
|
+
getEntity,
|
|
408
|
+
getExtraSlashMenuItems,
|
|
409
|
+
ixoGraphQLClient,
|
|
410
|
+
useCreateCollaborativeIxoEditor,
|
|
411
|
+
useCreateIxoEditor
|
|
412
|
+
};
|
|
413
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +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 { BlockNoteSchema, defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } 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(\n options?: IxoEditorOptions\n) {\n \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 = uploadFile || (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}","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);","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);","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];","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(\n options: IxoCollaborativeEditorOptions\n) {\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 id: user?.id || \"\",\n name: user?.name || \"\",\n color: user?.color || \"\",\n accessToken: user?.accessToken || \"\",\n }), [user?.id, user?.name, user?.color, user?.accessToken]);\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 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 }), [uploadFile]);\n\n // Memoize schema to prevent recreation\n const schema = useMemo(() => BlockNoteSchema.create({\n blockSpecs: {\n ...defaultBlockSpecs,\n ...blockSpecs,\n },\n inlineContentSpecs: {\n ...defaultInlineContentSpecs,\n },\n styleSpecs: {\n ...defaultStyleSpecs,\n },\n }), []);\n\n // Memoize collaboration config to prevent recreation\n const collaborationConfig = useMemo(() => ({\n provider: matrixProvider,\n fragment: yDoc.getXmlFragment(\"document\"),\n user: {\n name: memoizedUser.name,\n color: memoizedUser.color,\n },\n }), [matrixProvider, yDoc, memoizedUser.name, memoizedUser.color]);\n\n // Memoize IXO config to prevent recreation\n const ixoConfig = useMemo(() => ({\n theme,\n editable,\n sideMenu,\n slashMenu,\n formattingToolbar,\n linkToolbar,\n filePanel,\n tableHandles,\n }), [theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]);\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}","import React from \"react\";\nimport {\n getDefaultReactSlashMenuItems,\n SuggestionMenuController,\n} 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\n className={`ixo-editor ixo-editor--theme-${config.theme} ${className}`}\n >\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(\n [...defaultItems, ...customItems],\n query\n );\n }}\n />\n )}\n {children}\n </BlockNoteView>\n </div>\n );\n}"],"mappings":";;;;;;;;AAAA,SAAS,0BAA0B;AACnC,SAAS,iBAAiB,mBAAmB,2BAA2B,yBAAyB;;;ACDjG,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;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AqB;AAC9B,SAAS,6BAA6B;AAgB/B,SAAS,UAAU;AAAA,EACxB;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AAGA,QAAM,SAA2B,OAAe,cAAc;AAAA,IAC5D,OAAO;AAAA,IACP,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,IACX,mBAAmB;AAAA,IACnB,aAAa;AAAA,IACb,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AAEA,SACE,gBAAAC,OAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,gCAAgC,OAAO,KAAK,IAAI,SAAS;AAAA;AAAA,IAEpE,gBAAAA,OAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,UAAU,OAAO;AAAA,QACjB,UAAU,OAAO;AAAA,QACjB,WAAW;AAAA,QACX,mBAAmB,OAAO;AAAA,QAC1B,aAAa,OAAO;AAAA,QACpB,WAAW,OAAO;AAAA,QAClB,cAAc,OAAO;AAAA,QACrB,OAAO,OAAO;AAAA,QACd;AAAA,QACA;AAAA;AAAA,MAEC,OAAO,aACN,gBAAAA,OAAA;AAAA,QAAC;AAAA;AAAA,UACC,kBAAkB;AAAA,UAClB,UAAU,OAAO,UAAU;AAEzB,kBAAM,eAAe,8BAA8B,MAAM;AAEzD,kBAAM,cAAc,uBAAuB,MAAM;AAEjD,mBAAO;AAAA,cACL,CAAC,GAAG,cAAc,GAAG,WAAW;AAAA,cAChC;AAAA,YACF;AAAA,UACF;AAAA;AAAA,MACF;AAAA,MAED;AAAA,IACH;AAAA,EACF;AAEJ;","names":["React","createReactBlockSpec","useCreateBlockNote","BlockNoteSchema","defaultBlockSpecs","defaultInlineContentSpecs","defaultStyleSpecs","BlockNoteSchema","defaultBlockSpecs","defaultInlineContentSpecs","defaultStyleSpecs","useCreateBlockNote","React","React"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { IxoEditor, IxoEditorProps, ListBlock, ListBlockProps, ListBlockSettings, OverviewBlock, OverviewBlockProps, OverviewBlockSettings, blockSpecs, getExtraSlashMenuItems, useCreateCollaborativeIxoEditor, useCreateIxoEditor } from '../index.mjs';
|
|
2
|
+
export { E as Entity, e as EntityResponse, f as EntityVariables, G as GraphQLClient, j as GraphQLRequest, h as GraphQLResponse, a as IxoCollaborativeEditorOptions, d as IxoCollaborativeUser, c as IxoEditorConfig, I as IxoEditorOptions, b as IxoEditorTheme, g as getEntity, i as ixoGraphQLClient } from '../graphql-client-BmODcqPE.mjs';
|
|
3
|
+
export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '@blocknote/react';
|
|
6
|
+
import 'matrix-js-sdk';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IxoEditor,
|
|
3
|
+
ListBlock,
|
|
4
|
+
OverviewBlock,
|
|
5
|
+
blockSpecs,
|
|
6
|
+
getExtraSlashMenuItems,
|
|
7
|
+
useCreateCollaborativeIxoEditor,
|
|
8
|
+
useCreateIxoEditor
|
|
9
|
+
} from "../chunk-57TP5N42.mjs";
|
|
10
|
+
import {
|
|
11
|
+
GraphQLClient,
|
|
12
|
+
getEntity,
|
|
13
|
+
ixoGraphQLClient
|
|
14
|
+
} from "../chunk-MXVDN3FO.mjs";
|
|
15
|
+
export {
|
|
16
|
+
GraphQLClient,
|
|
17
|
+
IxoEditor,
|
|
18
|
+
ListBlock,
|
|
19
|
+
OverviewBlock,
|
|
20
|
+
blockSpecs,
|
|
21
|
+
getEntity,
|
|
22
|
+
getExtraSlashMenuItems,
|
|
23
|
+
ixoGraphQLClient,
|
|
24
|
+
useCreateCollaborativeIxoEditor,
|
|
25
|
+
useCreateIxoEditor
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,28 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixo/editor",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A custom BlockNote editor wrapper for IXO team",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/",
|
|
9
|
+
"fonts/",
|
|
9
10
|
"style.css",
|
|
11
|
+
"style-shadcn.css",
|
|
12
|
+
"style-mantine.css",
|
|
13
|
+
"style-core.css",
|
|
10
14
|
"style.css.d.ts",
|
|
11
15
|
"README.md"
|
|
12
16
|
],
|
|
13
17
|
"exports": {
|
|
14
18
|
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
15
20
|
"import": "./dist/index.js",
|
|
16
|
-
"require": "./dist/index.js"
|
|
17
|
-
"types": "./dist/index.d.ts"
|
|
21
|
+
"require": "./dist/index.js"
|
|
18
22
|
},
|
|
19
|
-
"./
|
|
23
|
+
"./shadcn": {
|
|
24
|
+
"types": "./dist/shadcn/index.d.ts",
|
|
25
|
+
"import": "./dist/shadcn/index.js",
|
|
26
|
+
"require": "./dist/shadcn/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./mantine": {
|
|
29
|
+
"types": "./dist/mantine/index.d.ts",
|
|
30
|
+
"import": "./dist/mantine/index.js",
|
|
31
|
+
"require": "./dist/mantine/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./style.css": "./style.css",
|
|
34
|
+
"./style-shadcn.css": "./style-shadcn.css",
|
|
35
|
+
"./style-mantine.css": "./style-mantine.css",
|
|
36
|
+
"./style-core.css": "./style-core.css"
|
|
20
37
|
},
|
|
21
38
|
"scripts": {
|
|
22
|
-
"build": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"dev": "tsc --watch",
|
|
39
|
+
"build": "tsup",
|
|
40
|
+
"build:watch": "tsup --watch",
|
|
41
|
+
"dev": "tsup --watch",
|
|
26
42
|
"clean": "rimraf dist style.css",
|
|
27
43
|
"prepare": "npm run clean && npm run build",
|
|
28
44
|
"type-check": "tsc --noEmit",
|
|
@@ -39,11 +55,15 @@
|
|
|
39
55
|
"license": "MIT",
|
|
40
56
|
"private": false,
|
|
41
57
|
"peerDependencies": {
|
|
58
|
+
"@mantine/core": "^8.2.8",
|
|
59
|
+
"@mantine/hooks": "^8.2.8",
|
|
60
|
+
"matrix-js-sdk": "^37.5.0",
|
|
42
61
|
"react": "^18.0.0",
|
|
43
62
|
"react-dom": "^18.0.0"
|
|
44
63
|
},
|
|
45
64
|
"dependencies": {
|
|
46
65
|
"@blocknote/core": "^0.15.0",
|
|
66
|
+
"@blocknote/mantine": "^0.15.0",
|
|
47
67
|
"@blocknote/react": "^0.15.0",
|
|
48
68
|
"@blocknote/shadcn": "^0.15.0",
|
|
49
69
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
@@ -58,12 +78,14 @@
|
|
|
58
78
|
"clsx": "^2.1.1",
|
|
59
79
|
"ixo-matrix-crdt": "github:ixoworld/ixo-matrix-crdt#main",
|
|
60
80
|
"lucide-react": "^0.542.0",
|
|
61
|
-
"matrix-js-sdk": "^
|
|
81
|
+
"matrix-js-sdk": "^37.5.0",
|
|
62
82
|
"tailwind-merge": "^3.3.1",
|
|
63
83
|
"tw-animate-css": "^1.3.7",
|
|
64
84
|
"yjs": "^13.6.27"
|
|
65
85
|
},
|
|
66
86
|
"devDependencies": {
|
|
87
|
+
"@mantine/core": "^8.2.8",
|
|
88
|
+
"@mantine/hooks": "^8.2.8",
|
|
67
89
|
"@semantic-release/changelog": "^6.0.3",
|
|
68
90
|
"@semantic-release/commit-analyzer": "^11.1.0",
|
|
69
91
|
"@semantic-release/git": "^10.0.1",
|
|
@@ -75,7 +97,7 @@
|
|
|
75
97
|
"react-dom": "^18.2.0",
|
|
76
98
|
"rimraf": "^5.0.0",
|
|
77
99
|
"semantic-release": "^22.0.12",
|
|
78
|
-
"
|
|
100
|
+
"tsup": "^8.5.0",
|
|
79
101
|
"typescript": "^5.0.0"
|
|
80
102
|
},
|
|
81
103
|
"repository": {
|