@fileverse-dev/ddoc 2.5.0 → 2.5.1-patch-1

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/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-bhLnp2pg.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-BwZlGgbY.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
@@ -1,3 +1,3 @@
1
1
  import { CommentDrawerProps } from './types';
2
2
 
3
- export declare const CommentDrawer: ({ isOpen, onClose, isNavbarVisible, isPresentationMode, activeCommentId, isPreviewMode, }: CommentDrawerProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const CommentDrawer: ({ isOpen, onClose, isNavbarVisible, isPresentationMode, activeCommentId, isPreviewMode, disableOnlineFeatures, }: CommentDrawerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { CommentSectionProps } from './types';
2
2
 
3
- export declare const CommentSection: ({ activeCommentId, isNavbarVisible, isPresentationMode, }: CommentSectionProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const CommentSection: ({ activeCommentId, isNavbarVisible, isPresentationMode, disableOnlineFeatures, }: CommentSectionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { CommentUsernameProps } from './context/types';
2
2
 
3
- declare const CommentUsername: ({ username, setUsername, isNavbarVisible, isConnected, connectViaUsername, connectViaWallet, isLoading, }: CommentUsernameProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const CommentUsername: ({ username, setUsername, isNavbarVisible, isConnected, connectViaUsername, connectViaWallet, isLoading, disableOnlineFeatures, }: CommentUsernameProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export { CommentUsername };
@@ -86,6 +86,7 @@ export interface CommentUsernameProps extends CommentAccountProps {
86
86
  username?: string | null;
87
87
  setUsername?: React.Dispatch<SetStateAction<string>>;
88
88
  isNavbarVisible?: boolean;
89
+ disableOnlineFeatures?: boolean;
89
90
  }
90
91
  export interface EnsEntry {
91
92
  name: string;
@@ -31,6 +31,7 @@ export interface CommentDrawerProps {
31
31
  isPresentationMode: boolean;
32
32
  activeCommentId: string | null;
33
33
  isPreviewMode: boolean;
34
+ disableOnlineFeatures?: boolean;
34
35
  }
35
36
  export interface CommentCardProps extends IComment {
36
37
  comment?: string;
@@ -44,6 +45,7 @@ export interface CommentCardProps extends IComment {
44
45
  isCommentOwner?: boolean;
45
46
  version?: string;
46
47
  emptyComment?: boolean;
48
+ disableOnlineFeatures?: boolean;
47
49
  }
48
50
  export type CommentBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
49
51
  zoomLevel: string;
@@ -62,6 +64,7 @@ export interface CommentSectionProps {
62
64
  activeCommentId: string | null;
63
65
  isNavbarVisible?: boolean;
64
66
  isPresentationMode?: boolean;
67
+ disableOnlineFeatures?: boolean;
65
68
  }
66
69
  export interface UserDisplayProps {
67
70
  username: string;
@@ -1,3 +1,3 @@
1
1
  import { DocumentOutlineProps } from './types';
2
2
 
3
- export declare const DocumentOutline: ({ editor, hasToC, items, setItems, showTOC, setShowTOC, isPreviewMode, }: DocumentOutlineProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const DocumentOutline: ({ editor, hasToC, items, setItems, showTOC, setShowTOC, isPreviewMode, orientation, }: DocumentOutlineProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { ToCProps, ToCItemProps } from './types';
2
2
 
3
- export declare const ToCItem: import('react').MemoExoticComponent<({ item, onItemClick, index, }: ToCItemProps) => import("react/jsx-runtime").JSX.Element>;
3
+ export declare const ToCItem: import('react').MemoExoticComponent<({ item, onItemClick, index, orientation, }: ToCItemProps) => import("react/jsx-runtime").JSX.Element>;
4
4
  export declare const ToCEmptyState: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
5
- export declare const ToC: import('react').MemoExoticComponent<({ items, editor, setItems }: ToCProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export declare const ToC: import('react').MemoExoticComponent<({ items, editor, setItems, orientation }: ToCProps) => import("react/jsx-runtime").JSX.Element>;
@@ -12,12 +12,14 @@ export type ToCProps = {
12
12
  items: ToCItemType[];
13
13
  setItems: (items: ToCItemType[] | ((prev: ToCItemType[]) => ToCItemType[])) => void;
14
14
  editor: Editor;
15
+ orientation?: 'portrait' | 'landscape';
15
16
  };
16
17
  export type ToCItemProps = {
17
18
  item: ToCItemType;
18
19
  onItemClick: (e: React.MouseEvent, id: string) => void;
19
20
  onItemRemove: (e: React.MouseEvent, id: string) => void;
20
21
  index: number;
22
+ orientation?: 'portrait' | 'landscape';
21
23
  };
22
24
  export interface DocumentOutlineProps {
23
25
  editor: Editor;
@@ -27,4 +29,5 @@ export interface DocumentOutlineProps {
27
29
  showTOC: boolean | undefined;
28
30
  setShowTOC: React.Dispatch<SetStateAction<boolean>> | undefined;
29
31
  isPreviewMode: boolean;
32
+ orientation?: 'portrait' | 'landscape';
30
33
  }
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Canvas dimension constants
3
+ * Design Philosophy: Canvas mimics real paper (A4) - fixed dimensions regardless of screen size
4
+ * Paper doesn't change size in the real world, so our canvas shouldn't either
5
+ */
6
+ /**
7
+ * Constraints for zoom 1.4 (fit mode)
8
+ * These percentages account for the 1.4x transform scaling applied to the canvas
9
+ */
10
+ export declare const ORIENTATION_CONSTRAINTS: {
11
+ readonly portrait: {
12
+ readonly zoomFitWidth: "55%";
13
+ readonly zoomFitMaxWidth: 1100;
14
+ };
15
+ readonly landscape: {
16
+ readonly zoomFitWidth: "60%";
17
+ readonly zoomFitMaxWidth: 1200;
18
+ };
19
+ };
20
+ /**
21
+ * Canvas dimension constants for different orientations and zoom levels
22
+ * Portrait: Standard document width (850px at 100% zoom)
23
+ * Landscape: Wider canvas for horizontal layouts (1190px at 100% zoom, ~1.4x portrait)
24
+ *
25
+ * Note: Zoom level 1.4 uses percentage widths that are scaled by transform: scaleX(1.4)
26
+ * The effective width is baseWidth * 1.4, so percentages are reduced accordingly
27
+ */
28
+ export declare const CANVAS_DIMENSIONS: {
29
+ readonly portrait: {
30
+ readonly '0.5': {
31
+ readonly width: 700;
32
+ readonly minHeight: "150%";
33
+ };
34
+ readonly '0.75': {
35
+ readonly width: 800;
36
+ readonly minHeight: "200%";
37
+ };
38
+ readonly '1': {
39
+ readonly width: 850;
40
+ readonly minHeight: "100%";
41
+ };
42
+ readonly '1.4': {
43
+ readonly width: "70%";
44
+ readonly minHeight: "200%";
45
+ };
46
+ readonly '1.5': {
47
+ readonly width: 1062.5;
48
+ readonly minHeight: "100%";
49
+ };
50
+ readonly '2': {
51
+ readonly width: 1548;
52
+ readonly minHeight: undefined;
53
+ };
54
+ };
55
+ readonly landscape: {
56
+ readonly '0.5': {
57
+ readonly width: 980;
58
+ readonly minHeight: "150%";
59
+ };
60
+ readonly '0.75': {
61
+ readonly width: 1135;
62
+ readonly minHeight: "200%";
63
+ };
64
+ readonly '1': {
65
+ readonly width: 1190;
66
+ readonly minHeight: "100%";
67
+ };
68
+ readonly '1.4': {
69
+ readonly width: "90%";
70
+ readonly minHeight: "200%";
71
+ };
72
+ readonly '1.5': {
73
+ readonly width: 1487.5;
74
+ readonly minHeight: "100%";
75
+ };
76
+ readonly '2': {
77
+ readonly width: 2166;
78
+ readonly minHeight: undefined;
79
+ };
80
+ };
81
+ };
@@ -3,7 +3,7 @@ import { InputRule } from '@tiptap/core';
3
3
  import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
4
4
  import { ToCItemType } from '../components/toc/types';
5
5
 
6
- export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataProxyUrl, onCopyHeadingLink, ipfsImageUploadFn, fetchV1ImageFn, onTocUpdate, }: {
6
+ export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataProxyUrl, onCopyHeadingLink, ipfsImageUploadFn, fetchV1ImageFn, onTocUpdate, disableOnlineFeatures, }: {
7
7
  ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
8
8
  url: string;
9
9
  file: File;
@@ -14,5 +14,6 @@ export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataPr
14
14
  onCopyHeadingLink?: (link: string) => void;
15
15
  fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
16
16
  onTocUpdate?: (data: ToCItemType[], isCreate?: boolean) => void;
17
+ disableOnlineFeatures?: boolean;
17
18
  }) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
18
19
  export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
@@ -2,6 +2,7 @@ import { Extension } from '@tiptap/core';
2
2
 
3
3
  export interface LinkPreviewOptions {
4
4
  metadataProxyUrl: string;
5
+ disableOnlineFeatures?: boolean;
5
6
  }
6
7
  declare const LinkPreview: Extension<LinkPreviewOptions, any>;
7
8
  export default LinkPreview;
@@ -2,5 +2,5 @@ import { Extension } from '@tiptap/core';
2
2
  import { IpfsImageUploadResponse } from '../../types';
3
3
 
4
4
  export declare const Command: Extension<any, any>;
5
- declare const SlashCommand: (onError?: (errorString: string) => void, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, isConnected?: boolean, enableCollaboration?: boolean) => Extension<any, any>;
5
+ declare const SlashCommand: (onError?: (errorString: string) => void, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, isConnected?: boolean, enableCollaboration?: boolean, disableOnlineFeatures?: boolean) => Extension<any, any>;
6
6
  export default SlashCommand;
@@ -1,22 +1,15 @@
1
1
  import { CommandProps } from './types';
2
2
  import { IpfsImageUploadResponse } from '../../types';
3
3
 
4
- export declare const getSuggestionItems: ({ query, onError, isConnected, ipfsImageUploadFn, editor, enableCollaboration, }: {
4
+ export declare const getSuggestionItems: ({ query, onError, isConnected, ipfsImageUploadFn, editor, enableCollaboration, disableOnlineFeatures, }: {
5
5
  query: string;
6
6
  onError?: (errorString: string) => void;
7
7
  ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
8
8
  isConnected?: boolean;
9
9
  editor?: any;
10
10
  enableCollaboration?: boolean;
11
+ disableOnlineFeatures?: boolean;
11
12
  }) => ({
12
- title: string;
13
- description: string;
14
- searchTerms: string[];
15
- icon: import("react/jsx-runtime").JSX.Element;
16
- image: string;
17
- command: ({ editor, range }: CommandProps) => void;
18
- isDisabled: boolean;
19
- } | {
20
13
  title: string;
21
14
  description: string;
22
15
  searchTerms: string[];
@@ -31,6 +24,6 @@ export declare const getSuggestionItems: ({ query, onError, isConnected, ipfsIma
31
24
  icon: import("react/jsx-runtime").JSX.Element;
32
25
  image: string;
33
26
  isDisabled: boolean | undefined;
34
- command: ({ editor, range }: CommandProps) => true | undefined;
27
+ command: ({ editor, range }: CommandProps) => void;
35
28
  })[];
36
29
  export declare const updateScrollView: (container: HTMLElement, item: HTMLElement) => void;
@@ -62,6 +62,13 @@ export interface DocumentStyling {
62
62
  * @example "Inter" | "Arial" | "Georgia"
63
63
  */
64
64
  fontFamily?: string;
65
+ /**
66
+ * Canvas orientation
67
+ * @description Controls the orientation and dimensions of the editor canvas. Portrait is the default orientation with standard document width. Landscape provides a wider canvas for horizontal content layouts.
68
+ * @default "portrait"
69
+ * @example "portrait" | "landscape"
70
+ */
71
+ orientation?: 'portrait' | 'landscape';
65
72
  }
66
73
  export interface DdocProps extends CommentAccountProps {
67
74
  isCollabDocumentPublished?: boolean;
@@ -164,6 +171,7 @@ export interface DdocProps extends CommentAccountProps {
164
171
  onUnMergedUpdates?: (state: boolean) => void;
165
172
  onCollabError?: (error: any) => void;
166
173
  isExistingCollabSession?: boolean;
174
+ disableOnlineFeatures?: boolean;
167
175
  }
168
176
  export interface IEditorSelectionData {
169
177
  from: number;
@@ -4,7 +4,7 @@ import { IpfsImageUploadResponse } from '../types';
4
4
 
5
5
  declare const UploadImagesPlugin: () => Plugin<DecorationSet>;
6
6
  export default UploadImagesPlugin;
7
- export declare function startImageUpload(file: File, view: EditorView, pos: number, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>): Promise<void>;
7
+ export declare function startImageUpload(file: File, view: EditorView, pos: number, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, disableOnlineFeatures?: boolean): Promise<void>;
8
8
  export declare const uploadFn: (image: File) => Promise<string>;
9
9
  export declare const uploadSecureImage: (url: string, image: File, publicKey: ArrayBuffer) => Promise<any>;
10
10
  export declare const handleDecryptImage: (url: string, encryptedKey: string, privateKey: string, iv: string) => Promise<string | undefined>;