@fileverse-dev/ddoc 2.3.0 → 2.3.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/README.md +53 -1
- package/dist/{ccip-Um-ci_OZ.mjs → ccip-iE3tr7jb.mjs} +1 -1
- package/dist/{index-CCdUy9ON.mjs → index-DnFRu9cp.mjs} +33369 -32325
- package/dist/index.es.js +1 -1
- package/dist/package/components/editor-bubble-menu/props.d.ts +5 -0
- package/dist/package/components/editor-bubble-menu/types.d.ts +6 -1
- package/dist/package/components/editor-toolbar.d.ts +7 -2
- package/dist/package/components/editor-utils.d.ts +7 -2
- package/dist/package/components/mobile-toolbar.d.ts +7 -2
- package/dist/package/components/presentation-mode/presentation-mode.d.ts +7 -1
- package/dist/package/components/presentation-mode/preview-panel.d.ts +4 -1
- package/dist/package/components/secure-image-v2.d.ts +21 -0
- package/dist/package/context/editor-context.d.ts +3 -0
- package/dist/package/extensions/d-block/dblock.d.ts +2 -1
- package/dist/package/extensions/default-extension.d.ts +11 -1
- package/dist/package/extensions/iframe/iframe.d.ts +5 -0
- package/dist/package/extensions/mardown-paste-handler/index.d.ts +10 -3
- package/dist/package/extensions/reminder-block/reminder-menu-renderer.d.ts +1 -1
- package/dist/package/extensions/resizable-media/media-paste-drop-plugin/media-paste-drop-plugin.d.ts +2 -1
- package/dist/package/extensions/resizable-media/resizable-media-node-view.d.ts +5 -1
- package/dist/package/extensions/resizable-media/resizable-media.d.ts +6 -3
- package/dist/package/extensions/slash-command/slash-comand.d.ts +2 -1
- package/dist/package/extensions/slash-command/slash-command-utils.d.ts +3 -2
- package/dist/package/types.d.ts +55 -1
- package/dist/package/use-ddoc-editor.d.ts +1 -1
- package/dist/package/utils/md-to-slides.d.ts +5 -1
- package/dist/package/utils/upload-images.d.ts +2 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
@@ -74,6 +74,57 @@ The `DdocProps` interface is a TypeScript interface that defines the properties
|
|
74
74
|
| `isPresentationMode` | `boolean` | Controls presentation mode |
|
75
75
|
| `setIsPresentationMode` | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle presentation mode |
|
76
76
|
| `sharedSlidesLink` | `string` | Link for shared presentation slides |
|
77
|
+
| `documentStyling` | `DocumentStyling` | Custom styling for document appearance |
|
78
|
+
|
79
|
+
## Document Styling
|
80
|
+
|
81
|
+
The `documentStyling` prop allows you to customize the visual appearance of your document with three distinct styling areas:
|
82
|
+
|
83
|
+
```typescript
|
84
|
+
interface DocumentStyling {
|
85
|
+
/**
|
86
|
+
* Background styling for the outer document area.
|
87
|
+
* Supports CSS background values including gradients.
|
88
|
+
* Example: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
|
89
|
+
*/
|
90
|
+
background?: string;
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Background color for the editor canvas/content area.
|
94
|
+
* Should be a solid color value.
|
95
|
+
* Example: "#ffffff" or "rgb(255, 255, 255)"
|
96
|
+
*/
|
97
|
+
canvasBackground?: string;
|
98
|
+
|
99
|
+
/**
|
100
|
+
* Text color for the editor content.
|
101
|
+
* Example: "#333333" or "rgb(51, 51, 51)"
|
102
|
+
*/
|
103
|
+
textColor?: string;
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Font family for the editor content.
|
107
|
+
* Example: "Inter, sans-serif" or "'Times New Roman', serif"
|
108
|
+
*/
|
109
|
+
fontFamily?: string;
|
110
|
+
}
|
111
|
+
```
|
112
|
+
|
113
|
+
### Usage Example
|
114
|
+
|
115
|
+
```tsx
|
116
|
+
<DdocEditor
|
117
|
+
documentStyling={{
|
118
|
+
background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
|
119
|
+
canvasBackground: "#ffffff",
|
120
|
+
textColor: "#333333",
|
121
|
+
fontFamily: "Inter, sans-serif"
|
122
|
+
}}
|
123
|
+
// ... other props
|
124
|
+
/>
|
125
|
+
```
|
126
|
+
|
127
|
+
**Note:** Document styling works in both regular editor mode and presentation mode. In presentation mode, only `canvasBackground`, `textColor`, and `fontFamily` are applied to maintain clean slide appearance.
|
77
128
|
|
78
129
|
## Comments & Collaboration Props
|
79
130
|
|
@@ -107,7 +158,8 @@ The `DdocProps` interface is a TypeScript interface that defines the properties
|
|
107
158
|
| `setCharacterCount` | `React.Dispatch<SetStateAction<number>>` | Updates character count |
|
108
159
|
| `setWordCount` | `React.Dispatch<SetStateAction<number>>` | Updates word count |
|
109
160
|
| `ensResolutionUrl` | `string` | URL for ENS name resolution |
|
110
|
-
| `
|
161
|
+
| `ipfsImageUploadFn` | ` (file: File) => Promise<IpfsImageUploadResponse>` | function for secure image uploads |
|
162
|
+
| `ipfsImageFetchFn` | ` (_data: IpfsImageFetchPayload) => Promise<{ url: string;file: File;}>` | function for fetch secure image from IPFS |
|
111
163
|
| `onError` | `(error: string) => void` | General error handler |
|
112
164
|
| `onInlineComment` | `() => void` | Callback for inline comments |
|
113
165
|
| `onMarkdownExport` | `() => void` | Callback for markdown export |
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-
|
1
|
+
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-DnFRu9cp.mjs";
|
2
2
|
class S extends p {
|
3
3
|
constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
|
4
4
|
var o;
|