@fileverse-dev/ddoc 2.5.0-tiptap-2 → 2.5.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/{ccip-C5pydaSE.mjs → ccip-EalcS3eB.mjs} +1 -1
- package/dist/{index-DHhy3vCx.mjs → index-Bq57qeQw.mjs} +48290 -50817
- package/dist/index.es.js +1 -1
- package/dist/package/common/toolbar-button.d.ts +2 -3
- package/dist/package/components/editor-bubble-menu/editor-bubble-menu.d.ts +1 -1
- package/dist/package/components/editor-bubble-menu/props.d.ts +65 -0
- package/dist/package/components/editor-bubble-menu/types.d.ts +1 -2
- package/dist/package/components/inline-comment/types.d.ts +1 -2
- package/dist/package/components/toc/document-outline.d.ts +1 -1
- package/dist/package/components/toc/toc.d.ts +2 -2
- package/dist/package/components/toc/types.d.ts +3 -0
- package/dist/package/constants/canvas-dimensions.d.ts +81 -0
- package/dist/package/extensions/ai-writer/ai-writer-node-view.d.ts +1 -1
- package/dist/package/extensions/default-extension.d.ts +1 -1
- package/dist/package/extensions/font-size/font-size.d.ts +1 -1
- package/dist/package/types.d.ts +7 -0
- package/dist/style.css +1 -1
- package/package.json +32 -31
package/dist/index.es.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
declare const ToolbarButton: import('react').ForwardRefExoticComponent<{
|
|
2
2
|
icon: string;
|
|
3
|
-
isActive
|
|
4
|
-
onClick
|
|
3
|
+
isActive: boolean;
|
|
4
|
+
onClick: () => void;
|
|
5
5
|
tooltip?: string;
|
|
6
6
|
classNames?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
-
variant?: "default" | "danger" | "secondary" | "ghost" | null | undefined;
|
|
9
8
|
size?: "sm" | "md" | "lg";
|
|
10
9
|
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
11
10
|
export default ToolbarButton;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EditorBubbleMenuProps } from './types';
|
|
2
2
|
|
|
3
|
-
export declare const EditorBubbleMenu: (props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element
|
|
3
|
+
export declare const EditorBubbleMenu: (props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { EditorBubbleMenuProps } from './types';
|
|
2
3
|
|
|
4
|
+
export declare const bubbleMenuProps: (props: EditorBubbleMenuProps) => {
|
|
5
|
+
tippyOptions: {
|
|
6
|
+
moveTransition: string;
|
|
7
|
+
duration: number;
|
|
8
|
+
animation: string;
|
|
9
|
+
zIndex: number;
|
|
10
|
+
appendTo: () => HTMLElement | null;
|
|
11
|
+
popperOptions: {
|
|
12
|
+
strategy: string;
|
|
13
|
+
modifiers: ({
|
|
14
|
+
name: string;
|
|
15
|
+
options: {
|
|
16
|
+
fallbackPlacements: string[];
|
|
17
|
+
altAxis?: undefined;
|
|
18
|
+
tether?: undefined;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
name: string;
|
|
22
|
+
options: {
|
|
23
|
+
altAxis: boolean;
|
|
24
|
+
tether: boolean;
|
|
25
|
+
fallbackPlacements?: undefined;
|
|
26
|
+
};
|
|
27
|
+
})[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
editor: import('@tiptap/extension-bubble-menu').BubbleMenuPluginProps["editor"] | null;
|
|
32
|
+
pluginKey?: string | import('prosemirror-state').PluginKey<any> | undefined;
|
|
33
|
+
updateDelay?: number | undefined;
|
|
34
|
+
shouldShow?: ((props: {
|
|
35
|
+
editor: Editor;
|
|
36
|
+
element: HTMLElement;
|
|
37
|
+
view: import('prosemirror-view').EditorView;
|
|
38
|
+
state: import('prosemirror-state').EditorState;
|
|
39
|
+
oldState?: import('prosemirror-state').EditorState;
|
|
40
|
+
from: number;
|
|
41
|
+
to: number;
|
|
42
|
+
}) => boolean) | null | undefined;
|
|
43
|
+
activeCommentId: string | null;
|
|
44
|
+
isPreviewMode: boolean;
|
|
45
|
+
disableInlineComment: boolean;
|
|
46
|
+
onError?: (errorString: string) => void;
|
|
47
|
+
zoomLevel: string;
|
|
48
|
+
setIsCommentSectionOpen?: (isOpen: boolean) => void;
|
|
49
|
+
inlineCommentData?: import('../../types').InlineCommentData;
|
|
50
|
+
setInlineCommentData?: React.Dispatch<React.SetStateAction<import('../../types').InlineCommentData>>;
|
|
51
|
+
walletAddress?: string;
|
|
52
|
+
username?: string;
|
|
53
|
+
onInlineComment?: () => void;
|
|
54
|
+
commentDrawerOpen?: boolean;
|
|
55
|
+
setCommentDrawerOpen?: React.Dispatch<import('react').SetStateAction<boolean>>;
|
|
56
|
+
isCollabDocumentPublished?: boolean | undefined;
|
|
57
|
+
ipfsImageUploadFn?: (file: File) => Promise<import('../../types').IpfsImageUploadResponse>;
|
|
58
|
+
ipfsImageFetchFn?: (_data: import('../../types').IpfsImageFetchPayload) => Promise<{
|
|
59
|
+
url: string;
|
|
60
|
+
file: File;
|
|
61
|
+
}>;
|
|
62
|
+
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
63
|
+
onReminderCreate?: (reminder: import('../../..').Reminder, type: string) => void;
|
|
64
|
+
isConnected?: boolean;
|
|
65
|
+
isCollabDocOwner?: boolean;
|
|
66
|
+
enableCollaboration?: boolean;
|
|
67
|
+
};
|
|
3
68
|
export declare const shouldShow: ({ editor }: {
|
|
4
69
|
editor: Editor;
|
|
5
70
|
}) => boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { BubbleMenuProps } from '@tiptap/react/menus';
|
|
1
|
+
import { BubbleMenuProps, Editor } from '@tiptap/react';
|
|
3
2
|
import { SetStateAction } from 'react';
|
|
4
3
|
import { InlineCommentData, IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
|
|
5
4
|
import { Reminder } from '../../extensions/reminder-block/types';
|
|
@@ -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
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { NodeViewProps } from '@tiptap/react';
|
|
3
3
|
|
|
4
|
-
export declare const AIWriterNodeView: React.MemoExoticComponent<({ node, editor: parentEditor, getPos, updateAttributes
|
|
4
|
+
export declare const AIWriterNodeView: React.MemoExoticComponent<({ node, editor: parentEditor, getPos, updateAttributes }: NodeViewProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -14,5 +14,5 @@ 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
|
-
}) => (import('@tiptap/core').
|
|
17
|
+
}) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
|
|
18
18
|
export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
|
package/dist/package/types.d.ts
CHANGED
|
@@ -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;
|