@prismicio/editor-fields 0.4.67 → 0.4.69

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.
Files changed (30) hide show
  1. package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +13 -13
  2. package/dist/core/MediaLibrary/hooks/tagData.d.ts +3 -3
  3. package/dist/core/MediaLibrary/hooks/useMediaLibraryUpload.d.ts +1 -1
  4. package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +1 -1
  5. package/dist/core/service/customType.d.ts +9 -9
  6. package/dist/core/service/document.d.ts +85 -85
  7. package/dist/core/service/documentSearch.d.ts +15 -15
  8. package/dist/core/service/repository.d.ts +6 -6
  9. package/dist/core/service/role.d.ts +10 -10
  10. package/dist/fields/ImageField/useImageField.d.ts +1 -1
  11. package/dist/fields/ImageField/useImageFieldImageUpload.d.ts +1 -1
  12. package/dist/fields/IntegrationField/integrationData.d.ts +5 -5
  13. package/dist/fields/LinkField/Documents/documentsData.d.ts +4 -4
  14. package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
  15. package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +1 -1
  16. package/dist/slices/utils.d.ts +4 -4
  17. package/package.json +4 -4
  18. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPlugin.d.ts +0 -8
  19. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/events.d.ts +0 -19
  20. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/index.d.ts +0 -1
  21. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/utils.d.ts +0 -23
  22. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/index.d.ts +0 -1
  23. package/dist/fields/RichTextField/extensions/Table/TableControlsWrapper.d.ts +0 -3
  24. package/dist/fields/RichTextField/extensions/Table/plugins/TableHandles/TableHandlesPluginDef.d.ts +0 -8
  25. package/dist/fields/RichTextField/extensions/Table/plugins/TableHandles/TableHandlesPluginView.d.ts +0 -34
  26. package/dist/fields/RichTextField/extensions/Table/plugins/TableHandles/TableHandlesPluginViewClass.d.ts +0 -34
  27. /package/dist/fields/RichTextField/extensions/Table/plugins/{TableHandles → tableHandles}/index.d.ts +0 -0
  28. /package/dist/fields/RichTextField/extensions/Table/plugins/{TableHandles/TableHandlesPlugin.d.ts → tableHandles/tableHandlesPlugin.d.ts} +0 -0
  29. /package/dist/fields/RichTextField/extensions/Table/{TableCell/plugins/TableHandles/TableHandlesPluginView.d.ts → plugins/tableHandles/tableHandlesPluginView.d.ts} +0 -0
  30. /package/dist/fields/RichTextField/extensions/Table/plugins/{TableHandles → tableHandles}/utils.d.ts +0 -0
@@ -20,8 +20,8 @@ interface SearchDocumentsArgs {
20
20
  }
21
21
  export declare function searchDocuments(args: SearchDocumentsArgs): Promise<{
22
22
  results: {
23
- title: string;
24
23
  id: string;
24
+ title: string;
25
25
  custom_type_id: string;
26
26
  group_lang_id: string;
27
27
  language: {
@@ -57,8 +57,8 @@ export declare function searchDocuments(args: SearchDocumentsArgs): Promise<{
57
57
  }[];
58
58
  } | {
59
59
  results: {
60
- title: string;
61
60
  id: string;
61
+ title: string;
62
62
  custom_type_id: string;
63
63
  group_lang_id: string;
64
64
  locale_id?: string | undefined;
@@ -75,10 +75,10 @@ export declare function searchDocuments(args: SearchDocumentsArgs): Promise<{
75
75
  version_id: string;
76
76
  tags: string[];
77
77
  last_modified_date: Date;
78
- summary?: string | undefined;
79
78
  preview_image?: string | undefined;
80
79
  uid?: string | undefined;
81
80
  custom_type_id?: string | undefined;
81
+ summary?: string | undefined;
82
82
  author_ids?: string[] | undefined;
83
83
  highlights?: {
84
84
  uid?: string | undefined;
@@ -101,8 +101,8 @@ interface SearchDocumentsQueryOptionsArgs {
101
101
  }
102
102
  export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOptionsArgs): import("@tanstack/react-query/build/legacy/types").UseQueryOptions<{
103
103
  results: {
104
- title: string;
105
104
  id: string;
105
+ title: string;
106
106
  custom_type_id: string;
107
107
  group_lang_id: string;
108
108
  language: {
@@ -138,8 +138,8 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
138
138
  }[];
139
139
  } | {
140
140
  results: {
141
- title: string;
142
141
  id: string;
142
+ title: string;
143
143
  custom_type_id: string;
144
144
  group_lang_id: string;
145
145
  locale_id?: string | undefined;
@@ -156,10 +156,10 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
156
156
  version_id: string;
157
157
  tags: string[];
158
158
  last_modified_date: Date;
159
- summary?: string | undefined;
160
159
  preview_image?: string | undefined;
161
160
  uid?: string | undefined;
162
161
  custom_type_id?: string | undefined;
162
+ summary?: string | undefined;
163
163
  author_ids?: string[] | undefined;
164
164
  highlights?: {
165
165
  uid?: string | undefined;
@@ -168,8 +168,8 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
168
168
  }[];
169
169
  }, Error, {
170
170
  results: {
171
- title: string;
172
171
  id: string;
172
+ title: string;
173
173
  custom_type_id: string;
174
174
  group_lang_id: string;
175
175
  language: {
@@ -205,8 +205,8 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
205
205
  }[];
206
206
  } | {
207
207
  results: {
208
- title: string;
209
208
  id: string;
209
+ title: string;
210
210
  custom_type_id: string;
211
211
  group_lang_id: string;
212
212
  locale_id?: string | undefined;
@@ -223,10 +223,10 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
223
223
  version_id: string;
224
224
  tags: string[];
225
225
  last_modified_date: Date;
226
- summary?: string | undefined;
227
226
  preview_image?: string | undefined;
228
227
  uid?: string | undefined;
229
228
  custom_type_id?: string | undefined;
229
+ summary?: string | undefined;
230
230
  author_ids?: string[] | undefined;
231
231
  highlights?: {
232
232
  uid?: string | undefined;
@@ -251,8 +251,8 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
251
251
  }]> & {
252
252
  initialData?: import("@tanstack/query-core/build/legacy/hydration-DTVzC0E7").L<{
253
253
  results: {
254
- title: string;
255
254
  id: string;
255
+ title: string;
256
256
  custom_type_id: string;
257
257
  group_lang_id: string;
258
258
  language: {
@@ -288,8 +288,8 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
288
288
  }[];
289
289
  } | {
290
290
  results: {
291
- title: string;
292
291
  id: string;
292
+ title: string;
293
293
  custom_type_id: string;
294
294
  group_lang_id: string;
295
295
  locale_id?: string | undefined;
@@ -306,10 +306,10 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
306
306
  version_id: string;
307
307
  tags: string[];
308
308
  last_modified_date: Date;
309
- summary?: string | undefined;
310
309
  preview_image?: string | undefined;
311
310
  uid?: string | undefined;
312
311
  custom_type_id?: string | undefined;
312
+ summary?: string | undefined;
313
313
  author_ids?: string[] | undefined;
314
314
  highlights?: {
315
315
  uid?: string | undefined;
@@ -335,8 +335,8 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
335
335
  } | undefined;
336
336
  }], {
337
337
  results: {
338
- title: string;
339
338
  id: string;
339
+ title: string;
340
340
  custom_type_id: string;
341
341
  group_lang_id: string;
342
342
  language: {
@@ -372,8 +372,8 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
372
372
  }[];
373
373
  } | {
374
374
  results: {
375
- title: string;
376
375
  id: string;
376
+ title: string;
377
377
  custom_type_id: string;
378
378
  group_lang_id: string;
379
379
  locale_id?: string | undefined;
@@ -390,10 +390,10 @@ export declare function searchDocumentsQueryOptions(args: SearchDocumentsQueryOp
390
390
  version_id: string;
391
391
  tags: string[];
392
392
  last_modified_date: Date;
393
- summary?: string | undefined;
394
393
  preview_image?: string | undefined;
395
394
  uid?: string | undefined;
396
395
  custom_type_id?: string | undefined;
396
+ summary?: string | undefined;
397
397
  author_ids?: string[] | undefined;
398
398
  highlights?: {
399
399
  uid?: string | undefined;
@@ -37,28 +37,28 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
37
37
  name: z.ZodString;
38
38
  is_master: z.ZodOptional<z.ZodBoolean>;
39
39
  }, "strip", z.ZodTypeAny, {
40
- name: string;
41
40
  id: string;
41
+ name: string;
42
42
  is_master?: boolean | undefined;
43
43
  }, {
44
- name: string;
45
44
  id: string;
45
+ name: string;
46
46
  is_master?: boolean | undefined;
47
47
  }>, {
48
48
  isMaster?: boolean | undefined;
49
49
  id: string;
50
50
  label: string;
51
51
  }, {
52
- name: string;
53
52
  id: string;
53
+ name: string;
54
54
  is_master?: boolean | undefined;
55
55
  }>, "many">, {
56
56
  isMaster?: boolean | undefined;
57
57
  id: string;
58
58
  label: string;
59
59
  }[], {
60
- name: string;
61
60
  id: string;
61
+ name: string;
62
62
  is_master?: boolean | undefined;
63
63
  }[]>;
64
64
  authors: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -126,8 +126,8 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
126
126
  starterId?: string | undefined;
127
127
  }, {
128
128
  languages: {
129
- name: string;
130
129
  id: string;
130
+ name: string;
131
131
  is_master?: boolean | undefined;
132
132
  }[];
133
133
  storageVersion: {
@@ -175,8 +175,8 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
175
175
  starterId?: string | undefined;
176
176
  }, {
177
177
  languages: {
178
- name: string;
179
178
  id: string;
179
+ name: string;
180
180
  is_master?: boolean | undefined;
181
181
  }[];
182
182
  storageVersion: {
@@ -284,12 +284,12 @@ export declare const TeamSpace: z.ZodObject<{
284
284
  name: z.ZodString;
285
285
  customTypes: z.ZodArray<z.ZodString, "many">;
286
286
  }, "strip", z.ZodTypeAny, {
287
- name: string;
288
287
  id: string;
288
+ name: string;
289
289
  customTypes: string[];
290
290
  }, {
291
- name: string;
292
291
  id: string;
292
+ name: string;
293
293
  customTypes: string[];
294
294
  }>;
295
295
  export type TeamSpace = z.infer<typeof TeamSpace>;
@@ -310,24 +310,24 @@ declare const TeamSpacesResponse: z.ZodObject<{
310
310
  name: z.ZodString;
311
311
  customTypes: z.ZodArray<z.ZodString, "many">;
312
312
  }, "strip", z.ZodTypeAny, {
313
- name: string;
314
313
  id: string;
314
+ name: string;
315
315
  customTypes: string[];
316
316
  }, {
317
- name: string;
318
317
  id: string;
318
+ name: string;
319
319
  customTypes: string[];
320
320
  }>, "many">;
321
321
  }, "strip", z.ZodTypeAny, {
322
322
  results: {
323
- name: string;
324
323
  id: string;
324
+ name: string;
325
325
  customTypes: string[];
326
326
  }[];
327
327
  }, {
328
328
  results: {
329
- name: string;
330
329
  id: string;
330
+ name: string;
331
331
  customTypes: string[];
332
332
  }[];
333
333
  }>;
@@ -340,27 +340,27 @@ interface GetTeamSpacesArgs {
340
340
  export declare function getTeamSpaces(args: GetTeamSpacesArgs): Promise<TeamSpacesResponse>;
341
341
  export declare function getTeamSpacesOptions(args: GetTeamSpacesArgs): import("@tanstack/react-query/build/legacy/types").UseQueryOptions<{
342
342
  results: {
343
- name: string;
344
343
  id: string;
344
+ name: string;
345
345
  customTypes: string[];
346
346
  }[];
347
347
  }, Error, {
348
- name: string;
349
348
  id: string;
349
+ name: string;
350
350
  customTypes: string[];
351
351
  }[], (string | GetTeamSpacesArgs)[]> & {
352
352
  initialData?: import("@tanstack/query-core/build/legacy/hydration-DTVzC0E7").L<{
353
353
  results: {
354
- name: string;
355
354
  id: string;
355
+ name: string;
356
356
  customTypes: string[];
357
357
  }[];
358
358
  }> | undefined;
359
359
  } & {
360
360
  queryKey: import("@tanstack/query-core/build/legacy/hydration-DTVzC0E7").E<(string | GetTeamSpacesArgs)[], {
361
361
  results: {
362
- name: string;
363
362
  id: string;
363
+ name: string;
364
364
  customTypes: string[];
365
365
  }[];
366
366
  }>;
@@ -93,8 +93,8 @@ export declare function useImageField(props: useImageFieldProps): {
93
93
  kind: string;
94
94
  size: number;
95
95
  tags: {
96
- name: string;
97
96
  id: string;
97
+ name: string;
98
98
  created_at: number;
99
99
  last_modified: number;
100
100
  count: number;
@@ -9,8 +9,8 @@ export declare function useImageFieldImageUpload(args: UseImageFieldImageUploadA
9
9
  kind: string;
10
10
  size: number;
11
11
  tags: {
12
- name: string;
13
12
  id: string;
13
+ name: string;
14
14
  created_at: number;
15
15
  last_modified: number;
16
16
  count: number;
@@ -5,16 +5,16 @@ interface IntegrationCatalogSearchArgs {
5
5
  }
6
6
  export declare function useIntegrationCatalogSearch(args: IntegrationCatalogSearchArgs): {
7
7
  items: {
8
- title: string;
9
8
  id: string;
9
+ title: string;
10
10
  description?: string | undefined;
11
11
  imageURL?: string | undefined;
12
12
  }[];
13
13
  response: {
14
14
  page: number;
15
15
  items: {
16
- title: string;
17
16
  id: string;
17
+ title: string;
18
18
  description?: string | undefined;
19
19
  imageURL?: string | undefined;
20
20
  }[];
@@ -29,13 +29,13 @@ declare const integrationItem: z.ZodObject<{
29
29
  imageURL: z.ZodOptional<z.ZodString>;
30
30
  description: z.ZodOptional<z.ZodString>;
31
31
  }, "strip", z.ZodTypeAny, {
32
- title: string;
33
32
  id: string;
33
+ title: string;
34
34
  description?: string | undefined;
35
35
  imageURL?: string | undefined;
36
36
  }, {
37
- title: string;
38
37
  id: string;
38
+ title: string;
39
39
  description?: string | undefined;
40
40
  imageURL?: string | undefined;
41
41
  }>;
@@ -46,8 +46,8 @@ interface IntegrationCatalogReadArgs {
46
46
  }
47
47
  export declare function useIntegrationCatalogRead(args: IntegrationCatalogReadArgs): {
48
48
  item: {
49
- title: string;
50
49
  id: string;
50
+ title: string;
51
51
  description?: string | undefined;
52
52
  imageURL?: string | undefined;
53
53
  };
@@ -43,17 +43,17 @@ export declare function useDocuments(params: {
43
43
  version_id: string;
44
44
  tags: string[];
45
45
  last_modified_date: Date;
46
- summary?: string | undefined;
47
46
  preview_image?: string | undefined;
48
47
  uid?: string | undefined;
49
48
  custom_type_id?: string | undefined;
49
+ summary?: string | undefined;
50
50
  author_ids?: string[] | undefined;
51
51
  highlights?: {
52
52
  uid?: string | undefined;
53
53
  } | undefined;
54
54
  }))[];
55
- title: string;
56
55
  id: string;
56
+ title: string;
57
57
  custom_type_id: string;
58
58
  group_lang_id: string;
59
59
  language: {
@@ -99,17 +99,17 @@ export declare function useDocuments(params: {
99
99
  version_id: string;
100
100
  tags: string[];
101
101
  last_modified_date: Date;
102
- summary?: string | undefined;
103
102
  preview_image?: string | undefined;
104
103
  uid?: string | undefined;
105
104
  custom_type_id?: string | undefined;
105
+ summary?: string | undefined;
106
106
  author_ids?: string[] | undefined;
107
107
  highlights?: {
108
108
  uid?: string | undefined;
109
109
  } | undefined;
110
110
  }))[];
111
- title: string;
112
111
  id: string;
112
+ title: string;
113
113
  custom_type_id: string;
114
114
  group_lang_id: string;
115
115
  locale_id?: string | undefined;
@@ -3,7 +3,7 @@ declare const _default: {
3
3
  component: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
4
4
  converter: {
5
5
  fromPrismic(schema: Schema<any, any>): (list: {
6
- type: "em" | "embed" | "strong" | "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
6
+ type: "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
7
7
  content: {
8
8
  text: string;
9
9
  } & {
@@ -56,7 +56,7 @@ declare const _default: {
56
56
  } | {
57
57
  start: number;
58
58
  end: number;
59
- type: "em" | "strong" | "list-item";
59
+ type: "strong" | "em" | "list-item";
60
60
  })[] | undefined;
61
61
  };
62
62
  } & {
@@ -64,7 +64,7 @@ declare const _default: {
64
64
  direction?: string | undefined;
65
65
  }) => ProsemirrorNode | undefined;
66
66
  toPrismic(node: ProsemirrorNode, nodeType: "list-item" | "o-list-item"): readonly ({
67
- type: "em" | "embed" | "strong" | "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
67
+ type: "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
68
68
  content: {
69
69
  text: string;
70
70
  } & {
@@ -117,7 +117,7 @@ declare const _default: {
117
117
  } | {
118
118
  start: number;
119
119
  end: number;
120
- type: "em" | "strong" | "list-item";
120
+ type: "strong" | "em" | "list-item";
121
121
  })[] | undefined;
122
122
  };
123
123
  } & {
@@ -25,8 +25,8 @@ export declare function useImageView(props: useImageViewProps): {
25
25
  kind: string;
26
26
  size: number;
27
27
  tags: {
28
- name: string;
29
28
  id: string;
29
+ name: string;
30
30
  created_at: number;
31
31
  last_modified: number;
32
32
  count: number;
@@ -291,7 +291,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
291
291
  label?: string | null | undefined;
292
292
  direction?: string | null | undefined;
293
293
  }) | ({
294
- type: "image" | "em" | "embed" | "strong" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
294
+ type: "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
295
295
  content: {
296
296
  text: string;
297
297
  } & {
@@ -344,7 +344,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
344
344
  } | {
345
345
  start: number;
346
346
  end: number;
347
- type: "em" | "strong" | "list-item";
347
+ type: "strong" | "em" | "list-item";
348
348
  })[] | undefined;
349
349
  };
350
350
  } & {
@@ -456,7 +456,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
456
456
  label?: string | null | undefined;
457
457
  direction?: string | null | undefined;
458
458
  }) | ({
459
- type: "image" | "em" | "embed" | "strong" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
459
+ type: "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
460
460
  content: {
461
461
  text: string;
462
462
  } & {
@@ -509,7 +509,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
509
509
  } | {
510
510
  start: number;
511
511
  end: number;
512
- type: "em" | "strong" | "list-item";
512
+ type: "strong" | "em" | "list-item";
513
513
  })[] | undefined;
514
514
  };
515
515
  } & {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "dependencies": {
3
3
  "@floating-ui/react-dom-interactions": "0.9.3",
4
4
  "@prismicio/client": "7.15.1",
5
- "@prismicio/editor-support": "0.4.67",
5
+ "@prismicio/editor-support": "0.4.69",
6
6
  "@prismicio/richtext": "2.1.1",
7
7
  "@prismicio/types-internal": "3.8.0",
8
8
  "@tiptap/core": "2.11.5",
@@ -38,7 +38,7 @@
38
38
  "zod": "3.23.8"
39
39
  },
40
40
  "devDependencies": {
41
- "@prismicio/editor-ui": "^0.4.67",
41
+ "@prismicio/editor-ui": "^0.4.69",
42
42
  "@testing-library/react": "15.0.7",
43
43
  "@types/react": "18.0.18",
44
44
  "@types/react-dom": "18.3.0",
@@ -72,7 +72,7 @@
72
72
  "module": "./dist/index.es.js",
73
73
  "name": "@prismicio/editor-fields",
74
74
  "peerDependencies": {
75
- "@prismicio/editor-ui": "^0.4.67",
75
+ "@prismicio/editor-ui": "^0.4.69",
76
76
  "@tanstack/react-query": "5.55.4",
77
77
  "react": "18",
78
78
  "react-dom": "18"
@@ -90,5 +90,5 @@
90
90
  "sideEffects": false,
91
91
  "stableVersion": "0.0.0",
92
92
  "types": "./dist/index.d.ts",
93
- "version": "0.4.67"
93
+ "version": "0.4.69"
94
94
  }
@@ -1,8 +0,0 @@
1
- import type { Editor } from "@tiptap/core";
2
- import { Plugin } from "@tiptap/pm/state";
3
- import { DecorationSet } from "@tiptap/pm/view";
4
- /** Plugin responsible for showing and hiding the row and column handles. */
5
- export declare function TableHandlesPlugin(this: {
6
- editor: Editor;
7
- name: string;
8
- }): Plugin<DecorationSet>;
@@ -1,19 +0,0 @@
1
- import type { Editor } from "@tiptap/core";
2
- export type TableHandleEventDetail = {
3
- type: "row" | "column";
4
- referenceElement: HTMLElement;
5
- };
6
- export type TableHandleEventType = {
7
- name: "handleClick";
8
- detail: TableHandleEventDetail;
9
- };
10
- export declare class TableHandleEvent extends CustomEvent<TableHandleEventType["detail"]> {
11
- constructor({ name, detail }: TableHandleEventType);
12
- static dispatch<TEvent extends TableHandleEventType>(name: TEvent["name"], args: {
13
- editor: Editor;
14
- } & TEvent["detail"]): void;
15
- static listen<TEvent extends TableHandleEventType>(name: TEvent["name"], args: {
16
- editor: Editor;
17
- callback: (detail: TEvent["detail"]) => void;
18
- }): () => void;
19
- }
@@ -1 +0,0 @@
1
- export { TableHandlesPlugin } from "./TableHandlesPlugin";
@@ -1,23 +0,0 @@
1
- import { type Editor } from "@tiptap/core";
2
- import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
3
- import type { Selection } from "@tiptap/pm/state";
4
- interface NodePos {
5
- pos: number;
6
- start: number;
7
- node: ProseMirrorNode | null | undefined;
8
- }
9
- export declare function getCellsInColumn(columnIndex: number | number[]): (selection: Selection) => NodePos[] | null;
10
- export declare function getCellsInRow(rowIndex: number | number[]): (selection: Selection) => NodePos[] | null;
11
- /** Finds the table handle element for the given type and element. */
12
- export declare function findTableHandleElement(args: {
13
- type: "row" | "column";
14
- element: Element;
15
- }): Element;
16
- /** Creates a table handle element for the given type. */
17
- export declare function createTableHandleElement(args: {
18
- type: "row" | "column";
19
- editor: Editor;
20
- rowIndex: number;
21
- columnIndex: number;
22
- }): HTMLButtonElement;
23
- export {};
@@ -1 +0,0 @@
1
- export { TableHandlesPlugin } from "./TableHandles";
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { type NodeViewProps } from "@tiptap/react";
3
- export declare function TableControlsWrapper({ editor }: NodeViewProps): JSX.Element;
@@ -1,8 +0,0 @@
1
- import type { Editor } from "@tiptap/core";
2
- import { Plugin } from "@tiptap/pm/state";
3
- import { DecorationSet } from "@tiptap/pm/view";
4
- /** Plugin responsible for showing and hiding the row and column handles. */
5
- export declare function tableHandlesPlugin(args: {
6
- editor: Editor;
7
- name: string;
8
- }): Plugin<DecorationSet>;
@@ -1,34 +0,0 @@
1
- import { type PluginView } from "@tiptap/pm/state";
2
- import type { EditorView } from "@tiptap/pm/view";
3
- /**
4
- * This plugin centralizes the logic for showing and hiding the row and column
5
- * handle buttons (the ones that on click open a floating menu).
6
- *
7
- * Ideally, hiding and showing the handles would be handled using only CSS,
8
- * but identifying the topmost cell in a column is not trivial, as the grouping
9
- * of cells in a column is not clearly defined in the DOM (only by colgroup),
10
- * and CSS cannot dynamically select it depending on the hovered cell.
11
- *
12
- * Another option was to dynamically generate hardcoded selectors, given that
13
- * we know the number of rows and cells, but inline styles can only contain
14
- * property declarations, not pseudo-classes like :hover.
15
- *
16
- * That leaves us with handling it solely in JavaScript, which is what this
17
- * plugin does.
18
- */
19
- export declare class TableHandlesPluginView implements PluginView {
20
- private readonly view;
21
- private abortController;
22
- private currentRowHandle;
23
- private currentColumnHandle;
24
- constructor(view: EditorView);
25
- update(view: EditorView): void;
26
- destroy(): void;
27
- private attachEventListeners;
28
- private showCurrentHandles;
29
- private hidePreviousHandles;
30
- private getRowHandle;
31
- private getColumnHandle;
32
- private displayHandle;
33
- private hideHandle;
34
- }
@@ -1,34 +0,0 @@
1
- import { type PluginView } from "@tiptap/pm/state";
2
- import type { EditorView } from "@tiptap/pm/view";
3
- /**
4
- * This plugin centralizes the logic for showing and hiding the row and column
5
- * handle buttons (the ones that on click open a floating menu).
6
- *
7
- * Ideally, hiding and showing the handles would be handled using only CSS,
8
- * but identifying the topmost cell in a column is not trivial, as the grouping
9
- * of cells in a column is not clearly defined in the DOM (only by colgroup),
10
- * and CSS cannot dynamically select it depending on the hovered cell.
11
- *
12
- * Another option was to dynamically generate hardcoded selectors, given that
13
- * we know the number of rows and cells, but inline styles can only contain
14
- * property declarations, not pseudo-classes like :hover.
15
- *
16
- * That leaves us with handling it solely in JavaScript, which is what this
17
- * plugin does.
18
- */
19
- export declare class TableHandlesPluginView implements PluginView {
20
- private readonly view;
21
- private abortController;
22
- private currentRowHandle;
23
- private currentColumnHandle;
24
- constructor(view: EditorView);
25
- update(view: EditorView): void;
26
- destroy(): void;
27
- private attachEventListeners;
28
- private showCurrentHandles;
29
- private hidePreviousHandles;
30
- private getRowHandle;
31
- private getColumnHandle;
32
- private displayHandle;
33
- private hideHandle;
34
- }