@eigenpal/docx-editor-react 1.0.0 → 1.0.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 CHANGED
@@ -45,6 +45,23 @@ export function App() {
45
45
 
46
46
  > **Next.js / SSR:** Use dynamic import. The editor requires the DOM.
47
47
 
48
+ ## Start with a blank document
49
+
50
+ Skip the file picker for new documents. `createEmptyDocument` returns a fresh `Document` model you can pass straight to the editor:
51
+
52
+ ```tsx
53
+ import { DocxEditor, createEmptyDocument } from '@eigenpal/docx-editor-react';
54
+ import '@eigenpal/docx-editor-react/styles.css';
55
+
56
+ const doc = createEmptyDocument();
57
+ // Or with options:
58
+ // createEmptyDocument({ initialText: 'Untitled', pageWidth: 12240 })
59
+
60
+ <DocxEditor document={doc} mode="editing" />;
61
+ ```
62
+
63
+ `createDocumentWithText(text, options?)` is the same idea with a starting paragraph already typed. Both helpers are re-exported from `@eigenpal/docx-editor-core` so you don't need a separate dependency.
64
+
48
65
  ## Packages
49
66
 
50
67
  | Package | Description |
package/dist/index.d.mts CHANGED
@@ -32,6 +32,7 @@ import { SelectionState } from '@eigenpal/docx-editor-core/prosemirror';
32
32
  import { Layout } from '@eigenpal/docx-editor-core/layout-engine';
33
33
  import { RenderedDomContext } from '@eigenpal/docx-editor-core/plugin-api';
34
34
  import { EditorHandle } from '@eigenpal/docx-editor-core';
35
+ export { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from '@eigenpal/docx-editor-core';
35
36
  import * as react_jsx_runtime from 'react/jsx-runtime';
36
37
 
37
38
  /**
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ import { SelectionState } from '@eigenpal/docx-editor-core/prosemirror';
32
32
  import { Layout } from '@eigenpal/docx-editor-core/layout-engine';
33
33
  import { RenderedDomContext } from '@eigenpal/docx-editor-core/plugin-api';
34
34
  import { EditorHandle } from '@eigenpal/docx-editor-core';
35
+ export { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from '@eigenpal/docx-editor-core';
35
36
  import * as react_jsx_runtime from 'react/jsx-runtime';
36
37
 
37
38
  /**