@ixo/editor 0.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 +345 -0
- package/dist/blocks/index.d.ts +85 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +50 -0
- package/dist/blocks/list/ListBlock.d.ts +59 -0
- package/dist/blocks/list/ListBlock.d.ts.map +1 -0
- package/dist/blocks/list/ListBlock.js +51 -0
- package/dist/blocks/list/ListBlockToolbar.d.ts +9 -0
- package/dist/blocks/list/ListBlockToolbar.d.ts.map +1 -0
- package/dist/blocks/list/ListBlockToolbar.js +26 -0
- package/dist/blocks/list/ListContainer.d.ts +5 -0
- package/dist/blocks/list/ListContainer.d.ts.map +1 -0
- package/dist/blocks/list/ListContainer.js +10 -0
- package/dist/blocks/list/ListGeneralTab.d.ts +11 -0
- package/dist/blocks/list/ListGeneralTab.d.ts.map +1 -0
- package/dist/blocks/list/ListGeneralTab.js +134 -0
- package/dist/blocks/list/ListItem.d.ts +8 -0
- package/dist/blocks/list/ListItem.d.ts.map +1 -0
- package/dist/blocks/list/ListItem.js +24 -0
- package/dist/blocks/list/ListPreviewTab.d.ts +9 -0
- package/dist/blocks/list/ListPreviewTab.d.ts.map +1 -0
- package/dist/blocks/list/ListPreviewTab.js +51 -0
- package/dist/blocks/list/ListSettings.d.ts +3 -0
- package/dist/blocks/list/ListSettings.d.ts.map +1 -0
- package/dist/blocks/list/ListSettings.js +115 -0
- package/dist/blocks/list/ListSettingsTab.d.ts +10 -0
- package/dist/blocks/list/ListSettingsTab.d.ts.map +1 -0
- package/dist/blocks/list/ListSettingsTab.js +64 -0
- package/dist/blocks/list/index.d.ts +3 -0
- package/dist/blocks/list/index.d.ts.map +1 -0
- package/dist/blocks/list/index.js +5 -0
- package/dist/blocks/list/useList.d.ts +5 -0
- package/dist/blocks/list/useList.d.ts.map +1 -0
- package/dist/blocks/list/useList.js +11 -0
- package/dist/blocks/overview/OverviewBlock.d.ts +33 -0
- package/dist/blocks/overview/OverviewBlock.d.ts.map +1 -0
- package/dist/blocks/overview/OverviewBlock.js +34 -0
- package/dist/blocks/overview/OverviewBlockToolbar.d.ts +8 -0
- package/dist/blocks/overview/OverviewBlockToolbar.d.ts.map +1 -0
- package/dist/blocks/overview/OverviewBlockToolbar.js +16 -0
- package/dist/blocks/overview/OverviewGeneralTab.d.ts +11 -0
- package/dist/blocks/overview/OverviewGeneralTab.d.ts.map +1 -0
- package/dist/blocks/overview/OverviewGeneralTab.js +134 -0
- package/dist/blocks/overview/OverviewPreviewTab.d.ts +10 -0
- package/dist/blocks/overview/OverviewPreviewTab.d.ts.map +1 -0
- package/dist/blocks/overview/OverviewPreviewTab.js +30 -0
- package/dist/blocks/overview/OverviewSettings.d.ts +3 -0
- package/dist/blocks/overview/OverviewSettings.d.ts.map +1 -0
- package/dist/blocks/overview/OverviewSettings.js +114 -0
- package/dist/blocks/overview/index.d.ts +3 -0
- package/dist/blocks/overview/index.d.ts.map +1 -0
- package/dist/blocks/overview/index.js +5 -0
- package/dist/blocks/overview/useOverview.d.ts +11 -0
- package/dist/blocks/overview/useOverview.d.ts.map +1 -0
- package/dist/blocks/overview/useOverview.js +61 -0
- package/dist/components/GlobeIcon.d.ts +9 -0
- package/dist/components/GlobeIcon.d.ts.map +1 -0
- package/dist/components/GlobeIcon.js +20 -0
- package/dist/components/IxoEditor.d.ts +14 -0
- package/dist/components/IxoEditor.d.ts.map +1 -0
- package/dist/components/IxoEditor.js +41 -0
- package/dist/components/PenIcon.d.ts +9 -0
- package/dist/components/PenIcon.d.ts.map +1 -0
- package/dist/components/PenIcon.js +20 -0
- package/dist/components/SettingsIcon.d.ts +9 -0
- package/dist/components/SettingsIcon.d.ts.map +1 -0
- package/dist/components/SettingsIcon.js +21 -0
- package/dist/components/SettingsModal/AdvancedTab.d.ts +8 -0
- package/dist/components/SettingsModal/AdvancedTab.d.ts.map +1 -0
- package/dist/components/SettingsModal/AdvancedTab.js +14 -0
- package/dist/components/SettingsModal/DomainPreview.d.ts +7 -0
- package/dist/components/SettingsModal/DomainPreview.d.ts.map +1 -0
- package/dist/components/SettingsModal/DomainPreview.js +22 -0
- package/dist/components/SettingsModal/FeatureASettings.d.ts +3 -0
- package/dist/components/SettingsModal/FeatureASettings.d.ts.map +1 -0
- package/dist/components/SettingsModal/FeatureASettings.js +74 -0
- package/dist/components/SettingsModal/GeneralTab.d.ts +10 -0
- package/dist/components/SettingsModal/GeneralTab.d.ts.map +1 -0
- package/dist/components/SettingsModal/GeneralTab.js +111 -0
- package/dist/components/SettingsModal/PreviewTab.d.ts +8 -0
- package/dist/components/SettingsModal/PreviewTab.d.ts.map +1 -0
- package/dist/components/SettingsModal/PreviewTab.js +14 -0
- package/dist/components/SettingsModal/SettingsModal.d.ts +16 -0
- package/dist/components/SettingsModal/SettingsModal.d.ts.map +1 -0
- package/dist/components/SettingsModal/SettingsModal.js +61 -0
- package/dist/components/SettingsModal/SettingsNavigation.d.ts +15 -0
- package/dist/components/SettingsModal/SettingsNavigation.d.ts.map +1 -0
- package/dist/components/SettingsModal/SettingsNavigation.js +21 -0
- package/dist/components/SettingsModal/index.d.ts +8 -0
- package/dist/components/SettingsModal/index.d.ts.map +1 -0
- package/dist/components/SettingsModal/index.js +17 -0
- package/dist/components/SwitchOption.d.ts +9 -0
- package/dist/components/SwitchOption.d.ts.map +1 -0
- package/dist/components/SwitchOption.js +45 -0
- package/dist/components/icons/ArchiveIcon.d.ts +9 -0
- package/dist/components/icons/ArchiveIcon.d.ts.map +1 -0
- package/dist/components/icons/ArchiveIcon.js +18 -0
- package/dist/components/icons/AudioIcon.d.ts +9 -0
- package/dist/components/icons/AudioIcon.d.ts.map +1 -0
- package/dist/components/icons/AudioIcon.js +17 -0
- package/dist/components/icons/DefaultIcon.d.ts +9 -0
- package/dist/components/icons/DefaultIcon.d.ts.map +1 -0
- package/dist/components/icons/DefaultIcon.js +17 -0
- package/dist/components/icons/DocumentIcon.d.ts +9 -0
- package/dist/components/icons/DocumentIcon.d.ts.map +1 -0
- package/dist/components/icons/DocumentIcon.js +20 -0
- package/dist/components/icons/ImageIcon.d.ts +9 -0
- package/dist/components/icons/ImageIcon.d.ts.map +1 -0
- package/dist/components/icons/ImageIcon.js +18 -0
- package/dist/components/icons/JsonIcon.d.ts +9 -0
- package/dist/components/icons/JsonIcon.d.ts.map +1 -0
- package/dist/components/icons/JsonIcon.js +19 -0
- package/dist/components/icons/PdfIcon.d.ts +9 -0
- package/dist/components/icons/PdfIcon.d.ts.map +1 -0
- package/dist/components/icons/PdfIcon.js +20 -0
- package/dist/components/icons/VideoIcon.d.ts +9 -0
- package/dist/components/icons/VideoIcon.d.ts.map +1 -0
- package/dist/components/icons/VideoIcon.js +17 -0
- package/dist/components/icons/XmlIcon.d.ts +9 -0
- package/dist/components/icons/XmlIcon.d.ts.map +1 -0
- package/dist/components/icons/XmlIcon.js +19 -0
- package/dist/components/icons/index.d.ts +10 -0
- package/dist/components/icons/index.d.ts.map +1 -0
- package/dist/components/icons/index.js +24 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +68 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +56 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +85 -0
- package/dist/components/ui/dropdown-menu.d.ts +26 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +110 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +41 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +42 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +44 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +54 -0
- package/dist/components/ui/toggle-group.d.ts +8 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +57 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +62 -0
- package/dist/hooks/useCollaborativeIxoEditor.d.ts +571 -0
- package/dist/hooks/useCollaborativeIxoEditor.d.ts.map +1 -0
- package/dist/hooks/useCollaborativeIxoEditor.js +127 -0
- package/dist/hooks/useCreateIxoEditor.d.ts +568 -0
- package/dist/hooks/useCreateIxoEditor.d.ts.map +1 -0
- package/dist/hooks/useCreateIxoEditor.js +62 -0
- package/dist/hooks/useMatrixProvider.d.ts +13 -0
- package/dist/hooks/useMatrixProvider.d.ts.map +1 -0
- package/dist/hooks/useMatrixProvider.js +147 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/lib/graphql-client.d.ts +27 -0
- package/dist/lib/graphql-client.d.ts.map +1 -0
- package/dist/lib/graphql-client.js +36 -0
- package/dist/lib/graphql-queries.d.ts +31 -0
- package/dist/lib/graphql-queries.d.ts.map +1 -0
- package/dist/lib/graphql-queries.js +40 -0
- package/dist/lib/utils/getMediaTypeIcon.d.ts +20 -0
- package/dist/lib/utils/getMediaTypeIcon.d.ts.map +1 -0
- package/dist/lib/utils/getMediaTypeIcon.js +96 -0
- package/dist/lib/utils/index.d.ts +4 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/lib/utils/index.js +12 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/types/Domain.d.ts +18 -0
- package/dist/types/Domain.d.ts.map +1 -0
- package/dist/types/Domain.js +2 -0
- package/dist/types/index.d.ts +77 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/package.json +81 -0
- package/style.css +246 -0
- package/style.css.d.ts +5 -0
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
import { IxoCollaborativeEditorOptions } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that wraps useCreateBlockNote with IXO-specific configurations
|
|
4
|
+
* @param options - Configuration options for the IxoEditor
|
|
5
|
+
* @returns A configured BlockNote editor instance
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCreateCollaborativeIxoEditor(options: IxoCollaborativeEditorOptions): {
|
|
8
|
+
editor: import("@blocknote/core").BlockNoteEditor<import("@blocknote/core").BlockSchemaFromSpecs<{
|
|
9
|
+
list: {
|
|
10
|
+
config: {
|
|
11
|
+
readonly type: "list";
|
|
12
|
+
readonly propSchema: {
|
|
13
|
+
readonly title: {
|
|
14
|
+
readonly default: "";
|
|
15
|
+
};
|
|
16
|
+
readonly did: {
|
|
17
|
+
readonly default: "";
|
|
18
|
+
};
|
|
19
|
+
readonly fragmentIdentifier: {
|
|
20
|
+
readonly default: "";
|
|
21
|
+
};
|
|
22
|
+
readonly listItemType: {
|
|
23
|
+
readonly default: "keyvalue";
|
|
24
|
+
};
|
|
25
|
+
readonly showLinkedResources: {
|
|
26
|
+
readonly default: false;
|
|
27
|
+
};
|
|
28
|
+
readonly showAssetsInCollection: {
|
|
29
|
+
readonly default: false;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
readonly content: "none";
|
|
33
|
+
};
|
|
34
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
35
|
+
readonly type: "list";
|
|
36
|
+
readonly propSchema: {
|
|
37
|
+
readonly title: {
|
|
38
|
+
readonly default: "";
|
|
39
|
+
};
|
|
40
|
+
readonly did: {
|
|
41
|
+
readonly default: "";
|
|
42
|
+
};
|
|
43
|
+
readonly fragmentIdentifier: {
|
|
44
|
+
readonly default: "";
|
|
45
|
+
};
|
|
46
|
+
readonly listItemType: {
|
|
47
|
+
readonly default: "keyvalue";
|
|
48
|
+
};
|
|
49
|
+
readonly showLinkedResources: {
|
|
50
|
+
readonly default: false;
|
|
51
|
+
};
|
|
52
|
+
readonly showAssetsInCollection: {
|
|
53
|
+
readonly default: false;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
readonly content: "none";
|
|
57
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
58
|
+
};
|
|
59
|
+
overview: {
|
|
60
|
+
config: {
|
|
61
|
+
type: "overview";
|
|
62
|
+
propSchema: {
|
|
63
|
+
did: {
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
content: "inline";
|
|
68
|
+
};
|
|
69
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
70
|
+
type: "overview";
|
|
71
|
+
propSchema: {
|
|
72
|
+
did: {
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
content: "inline";
|
|
77
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
78
|
+
};
|
|
79
|
+
paragraph: {
|
|
80
|
+
config: {
|
|
81
|
+
type: "paragraph";
|
|
82
|
+
content: "inline";
|
|
83
|
+
propSchema: {
|
|
84
|
+
backgroundColor: {
|
|
85
|
+
default: "default";
|
|
86
|
+
};
|
|
87
|
+
textColor: {
|
|
88
|
+
default: "default";
|
|
89
|
+
};
|
|
90
|
+
textAlignment: {
|
|
91
|
+
default: "left";
|
|
92
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
97
|
+
type: "paragraph";
|
|
98
|
+
content: "inline";
|
|
99
|
+
propSchema: {
|
|
100
|
+
backgroundColor: {
|
|
101
|
+
default: "default";
|
|
102
|
+
};
|
|
103
|
+
textColor: {
|
|
104
|
+
default: "default";
|
|
105
|
+
};
|
|
106
|
+
textAlignment: {
|
|
107
|
+
default: "left";
|
|
108
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
112
|
+
};
|
|
113
|
+
heading: {
|
|
114
|
+
config: {
|
|
115
|
+
type: "heading";
|
|
116
|
+
content: "inline";
|
|
117
|
+
propSchema: {
|
|
118
|
+
level: {
|
|
119
|
+
default: number;
|
|
120
|
+
values: readonly [1, 2, 3];
|
|
121
|
+
};
|
|
122
|
+
backgroundColor: {
|
|
123
|
+
default: "default";
|
|
124
|
+
};
|
|
125
|
+
textColor: {
|
|
126
|
+
default: "default";
|
|
127
|
+
};
|
|
128
|
+
textAlignment: {
|
|
129
|
+
default: "left";
|
|
130
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
135
|
+
type: "heading";
|
|
136
|
+
content: "inline";
|
|
137
|
+
propSchema: {
|
|
138
|
+
level: {
|
|
139
|
+
default: number;
|
|
140
|
+
values: readonly [1, 2, 3];
|
|
141
|
+
};
|
|
142
|
+
backgroundColor: {
|
|
143
|
+
default: "default";
|
|
144
|
+
};
|
|
145
|
+
textColor: {
|
|
146
|
+
default: "default";
|
|
147
|
+
};
|
|
148
|
+
textAlignment: {
|
|
149
|
+
default: "left";
|
|
150
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
154
|
+
};
|
|
155
|
+
bulletListItem: {
|
|
156
|
+
config: {
|
|
157
|
+
type: "bulletListItem";
|
|
158
|
+
content: "inline";
|
|
159
|
+
propSchema: {
|
|
160
|
+
backgroundColor: {
|
|
161
|
+
default: "default";
|
|
162
|
+
};
|
|
163
|
+
textColor: {
|
|
164
|
+
default: "default";
|
|
165
|
+
};
|
|
166
|
+
textAlignment: {
|
|
167
|
+
default: "left";
|
|
168
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
173
|
+
type: "bulletListItem";
|
|
174
|
+
content: "inline";
|
|
175
|
+
propSchema: {
|
|
176
|
+
backgroundColor: {
|
|
177
|
+
default: "default";
|
|
178
|
+
};
|
|
179
|
+
textColor: {
|
|
180
|
+
default: "default";
|
|
181
|
+
};
|
|
182
|
+
textAlignment: {
|
|
183
|
+
default: "left";
|
|
184
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
188
|
+
};
|
|
189
|
+
numberedListItem: {
|
|
190
|
+
config: {
|
|
191
|
+
type: "numberedListItem";
|
|
192
|
+
content: "inline";
|
|
193
|
+
propSchema: {
|
|
194
|
+
backgroundColor: {
|
|
195
|
+
default: "default";
|
|
196
|
+
};
|
|
197
|
+
textColor: {
|
|
198
|
+
default: "default";
|
|
199
|
+
};
|
|
200
|
+
textAlignment: {
|
|
201
|
+
default: "left";
|
|
202
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
207
|
+
type: "numberedListItem";
|
|
208
|
+
content: "inline";
|
|
209
|
+
propSchema: {
|
|
210
|
+
backgroundColor: {
|
|
211
|
+
default: "default";
|
|
212
|
+
};
|
|
213
|
+
textColor: {
|
|
214
|
+
default: "default";
|
|
215
|
+
};
|
|
216
|
+
textAlignment: {
|
|
217
|
+
default: "left";
|
|
218
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
222
|
+
};
|
|
223
|
+
checkListItem: {
|
|
224
|
+
config: {
|
|
225
|
+
type: "checkListItem";
|
|
226
|
+
content: "inline";
|
|
227
|
+
propSchema: {
|
|
228
|
+
checked: {
|
|
229
|
+
default: false;
|
|
230
|
+
};
|
|
231
|
+
backgroundColor: {
|
|
232
|
+
default: "default";
|
|
233
|
+
};
|
|
234
|
+
textColor: {
|
|
235
|
+
default: "default";
|
|
236
|
+
};
|
|
237
|
+
textAlignment: {
|
|
238
|
+
default: "left";
|
|
239
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
244
|
+
type: "checkListItem";
|
|
245
|
+
content: "inline";
|
|
246
|
+
propSchema: {
|
|
247
|
+
checked: {
|
|
248
|
+
default: false;
|
|
249
|
+
};
|
|
250
|
+
backgroundColor: {
|
|
251
|
+
default: "default";
|
|
252
|
+
};
|
|
253
|
+
textColor: {
|
|
254
|
+
default: "default";
|
|
255
|
+
};
|
|
256
|
+
textAlignment: {
|
|
257
|
+
default: "left";
|
|
258
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
262
|
+
};
|
|
263
|
+
table: {
|
|
264
|
+
config: {
|
|
265
|
+
type: "table";
|
|
266
|
+
content: "table";
|
|
267
|
+
propSchema: {
|
|
268
|
+
backgroundColor: {
|
|
269
|
+
default: "default";
|
|
270
|
+
};
|
|
271
|
+
textColor: {
|
|
272
|
+
default: "default";
|
|
273
|
+
};
|
|
274
|
+
textAlignment: {
|
|
275
|
+
default: "left";
|
|
276
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
281
|
+
type: "table";
|
|
282
|
+
content: "table";
|
|
283
|
+
propSchema: {
|
|
284
|
+
backgroundColor: {
|
|
285
|
+
default: "default";
|
|
286
|
+
};
|
|
287
|
+
textColor: {
|
|
288
|
+
default: "default";
|
|
289
|
+
};
|
|
290
|
+
textAlignment: {
|
|
291
|
+
default: "left";
|
|
292
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
296
|
+
};
|
|
297
|
+
file: {
|
|
298
|
+
config: {
|
|
299
|
+
type: "file";
|
|
300
|
+
propSchema: {
|
|
301
|
+
backgroundColor: {
|
|
302
|
+
default: "default";
|
|
303
|
+
};
|
|
304
|
+
name: {
|
|
305
|
+
default: "";
|
|
306
|
+
};
|
|
307
|
+
url: {
|
|
308
|
+
default: "";
|
|
309
|
+
};
|
|
310
|
+
caption: {
|
|
311
|
+
default: "";
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
content: "none";
|
|
315
|
+
isFileBlock: true;
|
|
316
|
+
};
|
|
317
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
318
|
+
type: "file";
|
|
319
|
+
propSchema: {
|
|
320
|
+
backgroundColor: {
|
|
321
|
+
default: "default";
|
|
322
|
+
};
|
|
323
|
+
name: {
|
|
324
|
+
default: "";
|
|
325
|
+
};
|
|
326
|
+
url: {
|
|
327
|
+
default: "";
|
|
328
|
+
};
|
|
329
|
+
caption: {
|
|
330
|
+
default: "";
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
content: "none";
|
|
334
|
+
isFileBlock: true;
|
|
335
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
336
|
+
};
|
|
337
|
+
image: {
|
|
338
|
+
config: {
|
|
339
|
+
type: "image";
|
|
340
|
+
propSchema: {
|
|
341
|
+
textAlignment: {
|
|
342
|
+
default: "left";
|
|
343
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
344
|
+
};
|
|
345
|
+
backgroundColor: {
|
|
346
|
+
default: "default";
|
|
347
|
+
};
|
|
348
|
+
name: {
|
|
349
|
+
default: "";
|
|
350
|
+
};
|
|
351
|
+
url: {
|
|
352
|
+
default: "";
|
|
353
|
+
};
|
|
354
|
+
caption: {
|
|
355
|
+
default: "";
|
|
356
|
+
};
|
|
357
|
+
showPreview: {
|
|
358
|
+
default: true;
|
|
359
|
+
};
|
|
360
|
+
previewWidth: {
|
|
361
|
+
default: number;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
content: "none";
|
|
365
|
+
isFileBlock: true;
|
|
366
|
+
fileBlockAccept: string[];
|
|
367
|
+
};
|
|
368
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
369
|
+
type: "image";
|
|
370
|
+
propSchema: {
|
|
371
|
+
textAlignment: {
|
|
372
|
+
default: "left";
|
|
373
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
374
|
+
};
|
|
375
|
+
backgroundColor: {
|
|
376
|
+
default: "default";
|
|
377
|
+
};
|
|
378
|
+
name: {
|
|
379
|
+
default: "";
|
|
380
|
+
};
|
|
381
|
+
url: {
|
|
382
|
+
default: "";
|
|
383
|
+
};
|
|
384
|
+
caption: {
|
|
385
|
+
default: "";
|
|
386
|
+
};
|
|
387
|
+
showPreview: {
|
|
388
|
+
default: true;
|
|
389
|
+
};
|
|
390
|
+
previewWidth: {
|
|
391
|
+
default: number;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
content: "none";
|
|
395
|
+
isFileBlock: true;
|
|
396
|
+
fileBlockAccept: string[];
|
|
397
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
398
|
+
};
|
|
399
|
+
video: {
|
|
400
|
+
config: {
|
|
401
|
+
type: "video";
|
|
402
|
+
propSchema: {
|
|
403
|
+
textAlignment: {
|
|
404
|
+
default: "left";
|
|
405
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
406
|
+
};
|
|
407
|
+
backgroundColor: {
|
|
408
|
+
default: "default";
|
|
409
|
+
};
|
|
410
|
+
name: {
|
|
411
|
+
default: "";
|
|
412
|
+
};
|
|
413
|
+
url: {
|
|
414
|
+
default: "";
|
|
415
|
+
};
|
|
416
|
+
caption: {
|
|
417
|
+
default: "";
|
|
418
|
+
};
|
|
419
|
+
showPreview: {
|
|
420
|
+
default: true;
|
|
421
|
+
};
|
|
422
|
+
previewWidth: {
|
|
423
|
+
default: number;
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
content: "none";
|
|
427
|
+
isFileBlock: true;
|
|
428
|
+
fileBlockAccept: string[];
|
|
429
|
+
};
|
|
430
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
431
|
+
type: "video";
|
|
432
|
+
propSchema: {
|
|
433
|
+
textAlignment: {
|
|
434
|
+
default: "left";
|
|
435
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
436
|
+
};
|
|
437
|
+
backgroundColor: {
|
|
438
|
+
default: "default";
|
|
439
|
+
};
|
|
440
|
+
name: {
|
|
441
|
+
default: "";
|
|
442
|
+
};
|
|
443
|
+
url: {
|
|
444
|
+
default: "";
|
|
445
|
+
};
|
|
446
|
+
caption: {
|
|
447
|
+
default: "";
|
|
448
|
+
};
|
|
449
|
+
showPreview: {
|
|
450
|
+
default: true;
|
|
451
|
+
};
|
|
452
|
+
previewWidth: {
|
|
453
|
+
default: number;
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
content: "none";
|
|
457
|
+
isFileBlock: true;
|
|
458
|
+
fileBlockAccept: string[];
|
|
459
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
460
|
+
};
|
|
461
|
+
audio: {
|
|
462
|
+
config: {
|
|
463
|
+
type: "audio";
|
|
464
|
+
propSchema: {
|
|
465
|
+
backgroundColor: {
|
|
466
|
+
default: "default";
|
|
467
|
+
};
|
|
468
|
+
name: {
|
|
469
|
+
default: "";
|
|
470
|
+
};
|
|
471
|
+
url: {
|
|
472
|
+
default: "";
|
|
473
|
+
};
|
|
474
|
+
caption: {
|
|
475
|
+
default: "";
|
|
476
|
+
};
|
|
477
|
+
showPreview: {
|
|
478
|
+
default: true;
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
content: "none";
|
|
482
|
+
isFileBlock: true;
|
|
483
|
+
fileBlockAccept: string[];
|
|
484
|
+
};
|
|
485
|
+
implementation: import("@blocknote/core").TiptapBlockImplementation<{
|
|
486
|
+
type: "audio";
|
|
487
|
+
propSchema: {
|
|
488
|
+
backgroundColor: {
|
|
489
|
+
default: "default";
|
|
490
|
+
};
|
|
491
|
+
name: {
|
|
492
|
+
default: "";
|
|
493
|
+
};
|
|
494
|
+
url: {
|
|
495
|
+
default: "";
|
|
496
|
+
};
|
|
497
|
+
caption: {
|
|
498
|
+
default: "";
|
|
499
|
+
};
|
|
500
|
+
showPreview: {
|
|
501
|
+
default: true;
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
content: "none";
|
|
505
|
+
isFileBlock: true;
|
|
506
|
+
fileBlockAccept: string[];
|
|
507
|
+
}, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
|
|
508
|
+
};
|
|
509
|
+
}>, import("@blocknote/core").InlineContentSchemaFromSpecs<{
|
|
510
|
+
text: {
|
|
511
|
+
config: "text";
|
|
512
|
+
implementation: any;
|
|
513
|
+
};
|
|
514
|
+
link: {
|
|
515
|
+
config: "link";
|
|
516
|
+
implementation: any;
|
|
517
|
+
};
|
|
518
|
+
}>, import("@blocknote/core").StyleSchemaFromSpecs<{
|
|
519
|
+
bold: {
|
|
520
|
+
config: {
|
|
521
|
+
type: string;
|
|
522
|
+
propSchema: "boolean";
|
|
523
|
+
};
|
|
524
|
+
implementation: import("@blocknote/core").StyleImplementation;
|
|
525
|
+
};
|
|
526
|
+
italic: {
|
|
527
|
+
config: {
|
|
528
|
+
type: string;
|
|
529
|
+
propSchema: "boolean";
|
|
530
|
+
};
|
|
531
|
+
implementation: import("@blocknote/core").StyleImplementation;
|
|
532
|
+
};
|
|
533
|
+
underline: {
|
|
534
|
+
config: {
|
|
535
|
+
type: string;
|
|
536
|
+
propSchema: "boolean";
|
|
537
|
+
};
|
|
538
|
+
implementation: import("@blocknote/core").StyleImplementation;
|
|
539
|
+
};
|
|
540
|
+
strike: {
|
|
541
|
+
config: {
|
|
542
|
+
type: string;
|
|
543
|
+
propSchema: "boolean";
|
|
544
|
+
};
|
|
545
|
+
implementation: import("@blocknote/core").StyleImplementation;
|
|
546
|
+
};
|
|
547
|
+
code: {
|
|
548
|
+
config: {
|
|
549
|
+
type: string;
|
|
550
|
+
propSchema: "boolean";
|
|
551
|
+
};
|
|
552
|
+
implementation: import("@blocknote/core").StyleImplementation;
|
|
553
|
+
};
|
|
554
|
+
textColor: {
|
|
555
|
+
config: {
|
|
556
|
+
type: string;
|
|
557
|
+
propSchema: "string";
|
|
558
|
+
};
|
|
559
|
+
implementation: import("@blocknote/core").StyleImplementation;
|
|
560
|
+
};
|
|
561
|
+
backgroundColor: {
|
|
562
|
+
config: {
|
|
563
|
+
type: string;
|
|
564
|
+
propSchema: "string";
|
|
565
|
+
};
|
|
566
|
+
implementation: import("@blocknote/core").StyleImplementation;
|
|
567
|
+
};
|
|
568
|
+
}>>;
|
|
569
|
+
connectionStatus: "connecting" | "connected" | "failed" | "disconnected";
|
|
570
|
+
};
|
|
571
|
+
//# sourceMappingURL=useCollaborativeIxoEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCollaborativeIxoEditor.d.ts","sourceRoot":"","sources":["../../src/hooks/useCollaborativeIxoEditor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAMzD;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GvC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.useCreateCollaborativeIxoEditor = useCreateCollaborativeIxoEditor;
|
|
37
|
+
const react_1 = require("@blocknote/react");
|
|
38
|
+
const core_1 = require("@blocknote/core");
|
|
39
|
+
const blocks_1 = require("../blocks");
|
|
40
|
+
const useMatrixProvider_1 = require("./useMatrixProvider");
|
|
41
|
+
const Y = __importStar(require("yjs"));
|
|
42
|
+
const react_2 = require("react");
|
|
43
|
+
/**
|
|
44
|
+
* Custom hook that wraps useCreateBlockNote with IXO-specific configurations
|
|
45
|
+
* @param options - Configuration options for the IxoEditor
|
|
46
|
+
* @returns A configured BlockNote editor instance
|
|
47
|
+
*/
|
|
48
|
+
function useCreateCollaborativeIxoEditor(options) {
|
|
49
|
+
// Extract IXO-specific options and BlockNote options
|
|
50
|
+
// Memoize Y.Doc to prevent recreation on every render
|
|
51
|
+
const yDoc = (0, react_2.useMemo)(() => new Y.Doc(), []);
|
|
52
|
+
const { theme = "light", uploadFile, initialContent, editable = true, sideMenu = true, slashMenu = true, formattingToolbar = true, linkToolbar = true, filePanel = true, tableHandles = true, user, matrix: { roomId, baseUrl, } } = options || {};
|
|
53
|
+
// Memoize user data to prevent recreation
|
|
54
|
+
const memoizedUser = (0, react_2.useMemo)(() => ({
|
|
55
|
+
id: user?.id || "",
|
|
56
|
+
name: user?.name || "",
|
|
57
|
+
color: user?.color || "",
|
|
58
|
+
accessToken: user?.accessToken || "",
|
|
59
|
+
}), [user?.id, user?.name, user?.color, user?.accessToken]);
|
|
60
|
+
const { matrixProvider, connectionStatus } = (0, useMatrixProvider_1.useMatrixProvider)({
|
|
61
|
+
userId: memoizedUser.id,
|
|
62
|
+
accessToken: memoizedUser.accessToken,
|
|
63
|
+
baseUrl: baseUrl,
|
|
64
|
+
roomId: roomId,
|
|
65
|
+
yDoc,
|
|
66
|
+
});
|
|
67
|
+
// Memoize default upload handler to prevent recreation
|
|
68
|
+
const defaultUploadFile = (0, react_2.useMemo)(() => uploadFile ||
|
|
69
|
+
(async (file) => {
|
|
70
|
+
// Default implementation - convert to data URL
|
|
71
|
+
// In production, you'd want to upload to a server
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
73
|
+
const reader = new FileReader();
|
|
74
|
+
reader.onloadend = () => {
|
|
75
|
+
const dataUrl = reader.result;
|
|
76
|
+
resolve(dataUrl);
|
|
77
|
+
};
|
|
78
|
+
reader.onerror = reject;
|
|
79
|
+
reader.readAsDataURL(file);
|
|
80
|
+
});
|
|
81
|
+
}), [uploadFile]);
|
|
82
|
+
// Memoize schema to prevent recreation
|
|
83
|
+
const schema = (0, react_2.useMemo)(() => core_1.BlockNoteSchema.create({
|
|
84
|
+
blockSpecs: {
|
|
85
|
+
...core_1.defaultBlockSpecs,
|
|
86
|
+
...blocks_1.blockSpecs,
|
|
87
|
+
},
|
|
88
|
+
inlineContentSpecs: {
|
|
89
|
+
...core_1.defaultInlineContentSpecs,
|
|
90
|
+
},
|
|
91
|
+
styleSpecs: {
|
|
92
|
+
...core_1.defaultStyleSpecs,
|
|
93
|
+
},
|
|
94
|
+
}), []);
|
|
95
|
+
// Memoize collaboration config to prevent recreation
|
|
96
|
+
const collaborationConfig = (0, react_2.useMemo)(() => ({
|
|
97
|
+
provider: matrixProvider,
|
|
98
|
+
fragment: yDoc.getXmlFragment("document"),
|
|
99
|
+
user: {
|
|
100
|
+
name: memoizedUser.name,
|
|
101
|
+
color: memoizedUser.color,
|
|
102
|
+
},
|
|
103
|
+
}), [matrixProvider, yDoc, memoizedUser.name, memoizedUser.color]);
|
|
104
|
+
// Memoize IXO config to prevent recreation
|
|
105
|
+
const ixoConfig = (0, react_2.useMemo)(() => ({
|
|
106
|
+
theme,
|
|
107
|
+
editable,
|
|
108
|
+
sideMenu,
|
|
109
|
+
slashMenu,
|
|
110
|
+
formattingToolbar,
|
|
111
|
+
linkToolbar,
|
|
112
|
+
filePanel,
|
|
113
|
+
tableHandles,
|
|
114
|
+
}), [theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]);
|
|
115
|
+
// Create the BlockNote editor with basic configurations
|
|
116
|
+
const editor = (0, react_1.useCreateBlockNote)({
|
|
117
|
+
schema,
|
|
118
|
+
initialContent,
|
|
119
|
+
uploadFile: defaultUploadFile,
|
|
120
|
+
collaboration: collaborationConfig,
|
|
121
|
+
});
|
|
122
|
+
// Store configuration in editor for components to access
|
|
123
|
+
if (editor) {
|
|
124
|
+
editor._ixoConfig = ixoConfig;
|
|
125
|
+
}
|
|
126
|
+
return { editor, connectionStatus: connectionStatus };
|
|
127
|
+
}
|