@fileverse-dev/ddoc 3.0.86 → 3.0.87

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 CHANGED
@@ -6,7 +6,6 @@ dDocs enables secure, real-time and asynchronous collaboration without compromis
6
6
 
7
7
  <img width="2308" height="1458" alt="image" src="https://github.com/user-attachments/assets/32875e2e-b30b-431b-bbb6-74ce96f21141" />
8
8
 
9
-
10
9
  This repository contains:
11
10
 
12
11
  - `/package` – The core package code.
@@ -35,16 +34,16 @@ This package requires the following peer dependencies to be installed in your pr
35
34
  npm install @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities @fileverse/ui @fileverse/crypto viem framer-motion frimousse
36
35
  ```
37
36
 
38
- | Package | Version |
39
- | --- | --- |
40
- | `@dnd-kit/core` | `>=6.3.1` |
41
- | `@dnd-kit/sortable` | `>=10.0.0` |
42
- | `@dnd-kit/utilities` | `>=3.2.2` |
43
- | `@fileverse/ui` | `>=5.0.0` |
44
- | `@fileverse/crypto` | `>=0.0.21` |
45
- | `viem` | `>=2.13.8` |
46
- | `framer-motion` | `>=11.2.10` |
47
- | `frimousse` | `>=0.3.0` |
37
+ | Package | Version |
38
+ | -------------------- | ----------- |
39
+ | `@dnd-kit/core` | `>=6.3.1` |
40
+ | `@dnd-kit/sortable` | `>=10.0.0` |
41
+ | `@dnd-kit/utilities` | `>=3.2.2` |
42
+ | `@fileverse/ui` | `>=5.0.0` |
43
+ | `@fileverse/crypto` | `>=0.0.21` |
44
+ | `viem` | `>=2.13.8` |
45
+ | `framer-motion` | `>=11.2.10` |
46
+ | `frimousse` | `>=0.3.0` |
48
47
 
49
48
  These are externalized from the bundle to avoid duplication when your app already uses them. If you don't have them installed, npm (v7+) will auto-install them for you.
50
49
 
@@ -87,17 +86,17 @@ The `DdocProps` interface is a TypeScript interface that defines the properties
87
86
 
88
87
  ## UI/UX Props
89
88
 
90
- | Property | Type | Description |
91
- | ----------------------- | ----------------------------------------- | ------------------------------------ |
92
- | `zoomLevel` | `string` | Current zoom level of the editor |
93
- | `setZoomLevel` | `React.Dispatch<SetStateAction<string>>` | Function to update zoom level |
94
- | `isNavbarVisible` | `boolean` | Controls navbar visibility |
95
- | `setIsNavbarVisible` | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle navbar visibility |
96
- | `renderNavbar` | `() => JSX.Element` | Custom navbar renderer |
97
- | `renderThemeToggle` | `() => JSX.Element` | Custom theme toggle renderer |
98
- | `isPresentationMode` | `boolean` | Controls presentation mode |
99
- | `setIsPresentationMode` | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle presentation mode |
100
- | `sharedSlidesLink` | `string` | Link for shared presentation slides |
89
+ | Property | Type | Description |
90
+ | ----------------------- | ----------------------------------------- | -------------------------------------- |
91
+ | `zoomLevel` | `string` | Current zoom level of the editor |
92
+ | `setZoomLevel` | `React.Dispatch<SetStateAction<string>>` | Function to update zoom level |
93
+ | `isNavbarVisible` | `boolean` | Controls navbar visibility |
94
+ | `setIsNavbarVisible` | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle navbar visibility |
95
+ | `renderNavbar` | `() => JSX.Element` | Custom navbar renderer |
96
+ | `renderThemeToggle` | `() => JSX.Element` | Custom theme toggle renderer |
97
+ | `isPresentationMode` | `boolean` | Controls presentation mode |
98
+ | `setIsPresentationMode` | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle presentation mode |
99
+ | `sharedSlidesLink` | `string` | Link for shared presentation slides |
101
100
  | `documentStyling` | `DocumentStyling` | Custom styling for document appearance |
102
101
 
103
102
  ## Document Styling
@@ -111,27 +110,27 @@ interface ThemeVariantValue {
111
110
  }
112
111
 
113
112
  interface DocumentStyling {
114
- /**
113
+ /**
115
114
  * Background styling for the outer document area.
116
115
  * Supports CSS background values including gradients.
117
116
  * Example: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
118
117
  */
119
118
  background?: string | ThemeVariantValue;
120
-
121
- /**
119
+
120
+ /**
122
121
  * Background color for the editor canvas/content area.
123
122
  * Should be a solid color value.
124
123
  * Example: "#ffffff" or "rgb(255, 255, 255)"
125
124
  */
126
125
  canvasBackground?: string | ThemeVariantValue;
127
-
128
- /**
126
+
127
+ /**
129
128
  * Text color for the editor content.
130
129
  * Example: "#333333" or "rgb(51, 51, 51)"
131
130
  */
132
131
  textColor?: string | ThemeVariantValue;
133
-
134
- /**
132
+
133
+ /**
135
134
  * Font family for the editor content.
136
135
  * Example: "Inter, sans-serif" or "'Times New Roman', serif"
137
136
  */
@@ -145,12 +144,12 @@ interface DocumentStyling {
145
144
  <DdocEditor
146
145
  documentStyling={{
147
146
  background: {
148
- light: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
149
- dark: "linear-gradient(135deg, #2a3145 0%, #3a2f59 100%)",
147
+ light: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
148
+ dark: 'linear-gradient(135deg, #2a3145 0%, #3a2f59 100%)',
150
149
  },
151
- canvasBackground: { light: "#ffffff", dark: "#1e1f22" },
152
- textColor: { light: "#333333", dark: "#e8ebec" },
153
- fontFamily: "Inter, sans-serif"
150
+ canvasBackground: { light: '#ffffff', dark: '#1e1f22' },
151
+ textColor: { light: '#333333', dark: '#e8ebec' },
152
+ fontFamily: 'Inter, sans-serif',
154
153
  }}
155
154
  // ... other props
156
155
  />
@@ -185,29 +184,28 @@ interface DocumentStyling {
185
184
 
186
185
  ## Utility Props
187
186
 
188
- | Property | Type | Description |
189
- | ---------------------- | ---------------------------------------- | ---------------------------- |
190
- | `setCharacterCount` | `React.Dispatch<SetStateAction<number>>` | Updates character count |
191
- | `setWordCount` | `React.Dispatch<SetStateAction<number>>` | Updates word count |
192
- | `ensResolutionUrl` | `string` | URL for ENS name resolution |
193
- | `ipfsImageUploadFn` | ` (file: File) => Promise<IpfsImageUploadResponse>` | function for secure image uploads |
194
- | `ipfsImageFetchFn` | ` (_data: IpfsImageFetchPayload) => Promise<{ url: string;file: File;}>` | function for fetch secure image from IPFS |
195
- | `onError` | `(error: string) => void` | General error handler |
196
- | `onInlineComment` | `() => void` | Callback for inline comments |
197
- | `onMarkdownExport` | `() => void` | Callback for markdown export |
198
- | `onMarkdownImport` | `() => void` | Callback for markdown import |
199
- | `onPdfExport` | `() => void` | Callback for pdf export |
200
- | `onSlidesShare` | `() => void` | Callback for slides sharing |
201
- | `onComment` | `() => void` | General comment callback |
202
-
187
+ | Property | Type | Description |
188
+ | ------------------- | ------------------------------------------------------------------------ | ----------------------------------------- |
189
+ | `setCharacterCount` | `React.Dispatch<SetStateAction<number>>` | Updates character count |
190
+ | `setWordCount` | `React.Dispatch<SetStateAction<number>>` | Updates word count |
191
+ | `ensResolutionUrl` | `string` | URL for ENS name resolution |
192
+ | `ipfsImageUploadFn` | ` (file: File) => Promise<IpfsImageUploadResponse>` | function for secure image uploads |
193
+ | `ipfsImageFetchFn` | ` (_data: IpfsImageFetchPayload) => Promise<{ url: string;file: File;}>` | function for fetch secure image from IPFS |
194
+ | `onError` | `(error: string) => void` | General error handler |
195
+ | `onInlineComment` | `() => void` | Callback for inline comments |
196
+ | `onMarkdownExport` | `() => void` | Callback for markdown export |
197
+ | `onMarkdownImport` | `() => void` | Callback for markdown import |
198
+ | `onPdfExport` | `() => void` | Callback for pdf export |
199
+ | `onSlidesShare` | `() => void` | Callback for slides sharing |
200
+ | `onComment` | `() => void` | General comment callback |
203
201
 
204
202
  ## AI Writer Props
205
203
 
206
- | Property | Type | Description |
207
- | ------------------ | --------- | ---------------------------------------------- |
204
+ | Property | Type | Description |
205
+ | ------------------ | ------------- | ----------------------------------------------- |
208
206
  | `activeModel` | `CustomModel` | Currently selected AI model for text generation |
209
- | `maxTokens` | `number` | Maximum token limit for AI-generated content |
210
- | `isAIAgentEnabled` | `boolean` | Toggle for AI agent functionality |
207
+ | `maxTokens` | `number` | Maximum token limit for AI-generated content |
208
+ | `isAIAgentEnabled` | `boolean` | Toggle for AI agent functionality |
211
209
 
212
210
  ### Steps to run this example locally
213
211
 
package/dist/index.es.js CHANGED
@@ -35580,22 +35580,27 @@ const Q1e = (e, t, n) => yt.create({
35580
35580
  u.toJSON()
35581
35581
  ), d = c.getHTML(), p = un.turndown(d), h = {
35582
35582
  title: (r == null ? void 0 : r.title) || "Untitled",
35583
- date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
35583
+ date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
35584
35584
  // YYYY-MM-DD
35585
- }, g = `---
35585
+ ...r == null ? void 0 : r.metadata
35586
+ };
35587
+ let f;
35588
+ if ((r == null ? void 0 : r.metadataFormat) === "reference-links" ? f = Object.entries(h).map(([y, x]) => `[${y}]: <> (${x})`).join(`
35589
+ `) + `
35590
+
35591
+ ` + p : f = `---
35586
35592
  ` + Object.entries(h).map(([y, x]) => Array.isArray(x) ? `${y}:
35587
35593
  ${x.map((v) => ` - ${v}`).join(`
35588
35594
  `)}` : `${y}: ${x}`).join(`
35589
35595
  `) + `
35590
35596
  ---
35591
35597
 
35592
- ` + p;
35593
- if (r != null && r.returnMDFile)
35594
- return c.destroy(), s(a), g;
35595
- const m = new Blob([g], {
35598
+ ` + p, r != null && r.returnMDFile)
35599
+ return c.destroy(), s(a), f;
35600
+ const g = new Blob([f], {
35596
35601
  type: "text/markdown;charset=utf-8"
35597
- }), b = URL.createObjectURL(m);
35598
- return c.destroy(), s(a), b;
35602
+ }), m = URL.createObjectURL(g);
35603
+ return c.destroy(), s(a), m;
35599
35604
  }
35600
35605
  };
35601
35606
  },
@@ -13,6 +13,8 @@ declare module '@tiptap/core' {
13
13
  exportMarkdownFile: (props?: {
14
14
  title?: string;
15
15
  returnMDFile?: boolean;
16
+ metadataFormat?: 'yaml' | 'reference-links';
17
+ metadata?: Record<string, string>;
16
18
  }) => any;
17
19
  };
18
20
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.0.86",
5
+ "version": "3.0.87",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -152,4 +152,4 @@
152
152
  "typescript": "^5.2.2",
153
153
  "vite": "^5.0.0"
154
154
  }
155
- }
155
+ }