@fileverse-dev/ddoc 3.1.5 → 3.1.6-patch-001

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 (60) hide show
  1. package/dist/index.es.js +38295 -37789
  2. package/dist/package/components/editor-toolbar.d.ts +1 -2
  3. package/dist/package/components/editor-utils.d.ts +1 -2
  4. package/dist/package/components/inline-comment/comment-card.d.ts +1 -1
  5. package/dist/package/components/inline-comment/comment-drawer.d.ts +1 -1
  6. package/dist/package/components/inline-comment/comment-dropdown.d.ts +1 -1
  7. package/dist/package/components/inline-comment/comment-floating-container.d.ts +1 -0
  8. package/dist/package/components/inline-comment/comment-floating-layout.d.ts +31 -0
  9. package/dist/package/components/inline-comment/comment-input-field.d.ts +3 -0
  10. package/dist/package/components/inline-comment/comment-reply-input.d.ts +7 -0
  11. package/dist/package/components/inline-comment/comment-section.d.ts +1 -1
  12. package/dist/package/components/inline-comment/comment-username.d.ts +1 -1
  13. package/dist/package/components/inline-comment/constants.d.ts +1 -0
  14. package/dist/package/components/inline-comment/context/types.d.ts +46 -89
  15. package/dist/package/components/inline-comment/delete-confirm-overlay.d.ts +10 -0
  16. package/dist/package/components/inline-comment/empty-comments.d.ts +4 -1
  17. package/dist/package/components/inline-comment/floating-comment/comment-floating-container.d.ts +3 -0
  18. package/dist/package/components/inline-comment/floating-comment/draft-floating-card.d.ts +3 -0
  19. package/dist/package/components/inline-comment/floating-comment/floating-auth-prompt.d.ts +1 -0
  20. package/dist/package/components/inline-comment/floating-comment/floating-card-shell.d.ts +3 -0
  21. package/dist/package/components/inline-comment/floating-comment/index.d.ts +1 -0
  22. package/dist/package/components/inline-comment/floating-comment/thread-floating-card.d.ts +3 -0
  23. package/dist/package/components/inline-comment/floating-comment/types.d.ts +32 -0
  24. package/dist/package/components/inline-comment/floating-comment-layout-utils.d.ts +78 -0
  25. package/dist/package/components/inline-comment/resize-inline-comment-textarea.d.ts +1 -0
  26. package/dist/package/components/inline-comment/types.d.ts +22 -0
  27. package/dist/package/components/inline-comment/use-anchor-registry.d.ts +34 -0
  28. package/dist/package/components/inline-comment/use-comment-card.d.ts +29 -0
  29. package/dist/package/components/inline-comment/use-comment-list-container.d.ts +17 -0
  30. package/dist/package/components/inline-comment/use-ens-status.d.ts +3 -0
  31. package/dist/package/components/inline-comment/use-floating-card-state.d.ts +36 -0
  32. package/dist/package/components/inline-comment/use-floating-comment-card-layout.d.ts +23 -0
  33. package/dist/package/components/inline-comment/use-floating-comment-card-state.d.ts +13 -0
  34. package/dist/package/components/inline-comment/use-floating-layout-engine.d.ts +26 -0
  35. package/dist/package/components/presentation-mode/presentation-mode.d.ts +2 -2
  36. package/dist/package/components/presentation-mode/preview-panel.d.ts +2 -2
  37. package/dist/package/components/preview-export-trigger.d.ts +1 -2
  38. package/dist/package/components/tabs/document-tabs-sidebar.d.ts +2 -1
  39. package/dist/package/context/editor-context.d.ts +3 -3
  40. package/dist/package/extensions/comment/comment-decoration-plugin.d.ts +67 -0
  41. package/dist/package/extensions/comment/comment.d.ts +27 -0
  42. package/dist/package/extensions/default-extension.d.ts +1 -1
  43. package/dist/package/hooks/use-ddoc-export.d.ts +1 -1
  44. package/dist/package/hooks/use-export-headless-editor-content.d.ts +1 -1
  45. package/dist/package/hooks/use-tab-editor.d.ts +5 -3
  46. package/dist/package/hooks/use-tab-manager.d.ts +1 -2
  47. package/dist/package/stores/comment-store-provider.d.ts +50 -0
  48. package/dist/package/stores/comment-store.d.ts +185 -0
  49. package/dist/package/sync-local/SyncManager.d.ts +0 -12
  50. package/dist/package/sync-local/types/index.d.ts +0 -4
  51. package/dist/package/types.d.ts +17 -7
  52. package/dist/package/use-ddoc-editor.d.ts +1 -0
  53. package/dist/package/utils/colors.d.ts +1 -3
  54. package/dist/package/utils/document-styling.d.ts +3 -3
  55. package/dist/style.css +1 -1
  56. package/package.json +3 -3
  57. package/dist/package/components/inline-comment/context/comment-context.d.ts +0 -4
  58. package/dist/package/extensions/custom-link/index.d.ts +0 -19
  59. package/dist/package/extensions/odt-export/index.d.ts +0 -30
  60. package/dist/package/utils/heading-link.d.ts +0 -23
@@ -19,10 +19,21 @@ export type InlineCommentData = {
19
19
  highlightedTextContent: string;
20
20
  handleClick: boolean;
21
21
  };
22
- export type CommentMutationType = 'create' | 'resolve' | 'unresolve' | 'delete';
22
+ export type CommentMutationType = 'create' | 'edit' | 'resolve' | 'unresolve' | 'delete';
23
23
  export interface CommentMutationMeta {
24
24
  type: CommentMutationType;
25
- updateChunk: string;
25
+ updateChunk?: string;
26
+ anchorFrom?: string;
27
+ anchorTo?: string;
28
+ selectedContent?: string;
29
+ content?: string;
30
+ }
31
+ export interface SerializedCommentAnchor {
32
+ id: string;
33
+ anchorFrom: string;
34
+ anchorTo: string;
35
+ resolved: boolean;
36
+ deleted: boolean;
26
37
  }
27
38
  export interface CommentAccountProps {
28
39
  isConnected?: boolean;
@@ -40,12 +51,9 @@ export interface CustomModel {
40
51
  apiKey: string;
41
52
  systemPrompt: string;
42
53
  }
43
- export type ThemeKey = 'light' | 'dark' | 'theme-sepia' | 'theme-pink';
44
54
  export interface ThemeVariantValue {
45
55
  light: string;
46
56
  dark: string;
47
- sepia?: string;
48
- [key: string]: string | undefined;
49
57
  }
50
58
  export type DocumentStylingValue = string | ThemeVariantValue;
51
59
  /**
@@ -107,9 +115,12 @@ export interface DdocProps extends CommentAccountProps {
107
115
  commentDrawerOpen?: boolean;
108
116
  setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
109
117
  initialComments?: IComment[];
118
+ initialCommentAnchors?: SerializedCommentAnchor[];
110
119
  setInitialComments?: React.Dispatch<SetStateAction<IComment[]>>;
111
120
  onCommentReply?: (activeCommentId: string, reply: IComment) => void;
112
121
  onNewComment?: (newComment: IComment, meta?: CommentMutationMeta) => void;
122
+ onEditComment?: (activeCommentId: string, meta?: CommentMutationMeta) => void;
123
+ onEditReply?: (activeCommentId: string, replyId: string, meta?: CommentMutationMeta) => void;
113
124
  onResolveComment?: (activeCommentId: string, meta?: CommentMutationMeta) => void;
114
125
  onUnresolveComment?: (activeCommentId: string, meta?: CommentMutationMeta) => void;
115
126
  onDeleteComment?: (activeCommentId: string, meta?: CommentMutationMeta) => void;
@@ -122,7 +133,7 @@ export interface DdocProps extends CommentAccountProps {
122
133
  setIsCommentSectionOpen?: React.Dispatch<SetStateAction<boolean>>;
123
134
  inlineCommentData?: InlineCommentData;
124
135
  setInlineCommentData?: React.Dispatch<React.SetStateAction<InlineCommentData>>;
125
- theme?: ThemeKey;
136
+ theme?: 'dark' | 'light';
126
137
  zoomLevel: string;
127
138
  setZoomLevel: React.Dispatch<SetStateAction<string>>;
128
139
  isNavbarVisible: boolean;
@@ -168,7 +179,6 @@ export interface DdocProps extends CommentAccountProps {
168
179
  onPdfExport?: () => void;
169
180
  onHtmlExport?: () => void;
170
181
  onTxtExport?: () => void;
171
- onOdtExport?: () => void;
172
182
  onDocxImport?: () => void;
173
183
  sharedSlidesLink?: string;
174
184
  documentName?: string;
@@ -38,4 +38,5 @@ export declare const useDdocEditor: ({ isPreviewMode, initialContent, versionHis
38
38
  activeCommentId: string | null;
39
39
  setActiveCommentId: import('react').Dispatch<import('react').SetStateAction<string | null>>;
40
40
  focusCommentWithActiveId: (id: string) => void;
41
+ commentAnchorsRef: import('react').MutableRefObject<import('./extensions/comment/comment-decoration-plugin').CommentAnchor[]>;
41
42
  };
@@ -1,5 +1,3 @@
1
- import { ThemeKey } from '../types';
2
-
3
1
  export declare const colors: {
4
2
  color: string;
5
3
  code: string;
@@ -9,4 +7,4 @@ export declare const textColors: {
9
7
  light: string;
10
8
  dark: string;
11
9
  }[];
12
- export declare const getResponsiveColor: (color?: string, theme?: ThemeKey) => string | undefined;
10
+ export declare const getResponsiveColor: (color?: string, theme?: "light" | "dark") => string | undefined;
@@ -1,5 +1,5 @@
1
- import { DocumentStylingValue, ThemeKey, ThemeVariantValue } from '../types';
1
+ import { DocumentStylingValue, ThemeVariantValue } from '../types';
2
2
 
3
3
  export declare const isThemeVariantValue: (value: DocumentStylingValue | undefined) => value is ThemeVariantValue;
4
- export declare const getThemeStyle: (value?: DocumentStylingValue, theme?: ThemeKey) => string | undefined;
5
- export declare const getResponsiveThemeTextColor: (value?: DocumentStylingValue, theme?: ThemeKey) => string | undefined;
4
+ export declare const getThemeStyle: (value?: DocumentStylingValue, theme?: "light" | "dark") => string | undefined;
5
+ export declare const getResponsiveThemeTextColor: (value?: DocumentStylingValue, theme?: "light" | "dark") => string | undefined;