@eigenpal/docx-js-editor 0.0.19 → 0.0.21
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 +83 -0
- package/dist/{ClipboardManager-EZ0C6Onq.d.cts → ClipboardManager-B1jZrC6h.d.cts} +1 -1
- package/dist/{ClipboardManager-D6dkOFg6.d.ts → ClipboardManager-jqJVxB6g.d.ts} +1 -1
- package/dist/{DocumentAgent-BcCDg7i2.d.ts → DocumentAgent-CnJ9AEl_.d.cts} +31 -3
- package/dist/{DocumentAgent-B0EC8lPC.d.cts → DocumentAgent-CrbsDniO.d.ts} +31 -3
- package/dist/{FindReplaceDialog-AWQXKEUQ.js → FindReplaceDialog-AQFR4OCT.js} +1 -2
- package/dist/FindReplaceDialog-J3DI3U5I.cjs +1 -0
- package/dist/{FootnotePropertiesDialog-73VT2ZVZ.cjs → FootnotePropertiesDialog-DO5DCAW6.cjs} +1 -2
- package/dist/{FootnotePropertiesDialog-ZM3EF3EF.js → FootnotePropertiesDialog-YYIZU5U6.js} +1 -2
- package/dist/{HyperlinkDialog-BA25XUT5.js → HyperlinkDialog-HGZ2S37Z.js} +1 -2
- package/dist/HyperlinkDialog-PEPS3C2G.cjs +1 -0
- package/dist/{ImagePositionDialog-AIAMKPFK.js → ImagePositionDialog-DQ4JWS4F.js} +1 -2
- package/dist/{ImagePositionDialog-KMK7ROV2.cjs → ImagePositionDialog-UYXYHSP4.cjs} +1 -2
- package/dist/{ImagePropertiesDialog-ERFCUVCW.js → ImagePropertiesDialog-GJMGLM6G.js} +1 -2
- package/dist/{ImagePropertiesDialog-USMMRK6X.cjs → ImagePropertiesDialog-V6SVKINO.cjs} +1 -2
- package/dist/{TablePropertiesDialog-72CIUAZT.cjs → TablePropertiesDialog-A36OXG3A.cjs} +1 -2
- package/dist/{TablePropertiesDialog-EMUEVYB3.js → TablePropertiesDialog-STZOGHJB.js} +1 -2
- package/dist/{agentApi-BFVyKagE.d.cts → agentApi-DfsWRyrP.d.cts} +1 -1
- package/dist/{agentApi-BFVyKagE.d.ts → agentApi-DfsWRyrP.d.ts} +1 -1
- package/dist/{chunk-FDANI5P4.cjs → chunk-2VHQ7YOQ.cjs} +1 -2
- package/dist/chunk-2Y6FLZ5Q.js +3 -0
- package/dist/chunk-32HMU2UV.js +111 -0
- package/dist/chunk-4CUGBNL2.cjs +1 -0
- package/dist/chunk-5GFXHUMP.js +1 -0
- package/dist/chunk-6NDMKJIE.js +9 -0
- package/dist/chunk-6NYA53QC.cjs +258 -0
- package/dist/chunk-7KJ3YVDQ.js +10 -0
- package/dist/{chunk-JOYPFQW2.js → chunk-AARNCPWR.js} +1 -2
- package/dist/{chunk-4QT5LPBA.cjs → chunk-B7TICMXD.cjs} +16 -17
- package/dist/{chunk-2QOEHCBX.js → chunk-BUEMG4NW.js} +1 -2
- package/dist/{chunk-CV5WFE7K.js → chunk-CLDB6TL7.js} +2 -3
- package/dist/{chunk-M2T6XKT5.js → chunk-CTYOM6BE.js} +1 -2
- package/dist/chunk-EH3NY2DQ.cjs +26 -0
- package/dist/{chunk-FGVGZLBL.js → chunk-FVUGBRDD.js} +1 -2
- package/dist/chunk-FXJAIFPR.js +59 -0
- package/dist/chunk-GICVJSFJ.cjs +9 -0
- package/dist/{chunk-Y6VCTLCJ.js → chunk-H5NTJZO4.js} +1 -2
- package/dist/chunk-HT2Z33YM.cjs +111 -0
- package/dist/chunk-JRRTZZ72.cjs +1 -0
- package/dist/{chunk-T2HQYRA7.cjs → chunk-NVAQQYBJ.cjs} +1 -2
- package/dist/chunk-P3AEZKQO.cjs +3 -0
- package/dist/{chunk-GWBTKVFD.cjs → chunk-P7ZF45KZ.cjs} +1 -2
- package/dist/{chunk-QEBO3EQP.cjs → chunk-PCJ5ACUV.cjs} +1 -2
- package/dist/{chunk-Q6HUGWO6.js → chunk-PJVI53AH.js} +1 -2
- package/dist/chunk-Q7YYC75E.js +258 -0
- package/dist/{chunk-7JSPKVOW.js → chunk-QVPR2W5S.js} +1 -2
- package/dist/{chunk-XZNOV52K.cjs → chunk-TAF6KYDM.cjs} +4 -5
- package/dist/chunk-USRMBYI6.js +3 -0
- package/dist/chunk-UTWPV2I4.js +26 -0
- package/dist/{chunk-DJAEBZ33.cjs → chunk-VTAS7VZ6.cjs} +1 -2
- package/dist/chunk-XQNCLN4T.cjs +3 -0
- package/dist/{chunk-S26DZVRQ.cjs → chunk-XS2AQFMF.cjs} +1 -2
- package/dist/chunk-Y6QBJGMO.cjs +59 -0
- package/dist/{chunk-WD2HTKRR.cjs → chunk-YS7FDEZ4.cjs} +1 -2
- package/dist/chunk-ZTVQA46Q.js +1 -0
- package/dist/{clipboard-beGtyabO.d.ts → clipboard-BE8E-szx.d.ts} +1 -1
- package/dist/{clipboard-CqE-UZ2d.d.cts → clipboard-DkfAv07F.d.cts} +1 -1
- package/dist/{colorResolver-B5YbO_a4.d.ts → colorResolver-CYttioMe.d.ts} +46 -3
- package/dist/{colorResolver-Cu46bSKr.d.cts → colorResolver-Dr8kQZAQ.d.cts} +46 -3
- package/dist/core-plugins-reexport.cjs +1 -2
- package/dist/core-plugins-reexport.d.cts +4 -4
- package/dist/core-plugins-reexport.d.ts +4 -4
- package/dist/core-plugins-reexport.js +1 -2
- package/dist/core-reexport.cjs +1 -2
- package/dist/core-reexport.d.cts +10 -10
- package/dist/core-reexport.d.ts +10 -10
- package/dist/core-reexport.js +1 -2
- package/dist/executor-JGWZ7S6Z.cjs +1 -0
- package/dist/executor-L2MVKMXO.js +1 -0
- package/dist/{fontLoader-CFKpg0Ri.d.ts → fontLoader-BsqQnB4v.d.ts} +1 -1
- package/dist/{fontLoader-HZYfILUm.d.cts → fontLoader-DECXIoMr.d.cts} +1 -1
- package/dist/headless-reexport.cjs +4 -5
- package/dist/headless-reexport.d.cts +7 -7
- package/dist/headless-reexport.d.ts +7 -7
- package/dist/headless-reexport.js +4 -5
- package/dist/index.cjs +6 -7
- package/dist/index.css +0 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +6 -7
- package/dist/lib-GD2QD2JK.js +1 -0
- package/dist/lib-HOLGQI5K.cjs +1 -0
- package/dist/mcp-reexport.cjs +9 -10
- package/dist/mcp-reexport.d.cts +2 -2
- package/dist/mcp-reexport.d.ts +2 -2
- package/dist/mcp-reexport.js +4 -5
- package/dist/{processTemplate-G37IM66O.js → processTemplate-3HN7Q3KT.js} +1 -2
- package/dist/processTemplate-BXZKWRQD.cjs +1 -0
- package/dist/{react-BjOCdeTs.d.ts → react-C6bgHDFl.d.ts} +8 -6
- package/dist/{react-UzAn4o7l.d.cts → react-CAlVCYa4.d.cts} +8 -6
- package/dist/react.cjs +1 -2
- package/dist/react.css +0 -1
- package/dist/react.d.cts +5 -5
- package/dist/react.d.ts +5 -5
- package/dist/react.js +1 -2
- package/dist/{registry-DjacfR6Q.d.cts → registry-BU-FbHh-.d.cts} +1 -1
- package/dist/{registry-CV6nYWqP.d.ts → registry-gRbkCooh.d.ts} +1 -1
- package/dist/selectionRects-7QU337P5.cjs +1 -0
- package/dist/selectionRects-V5RC2BYX.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/{types-DwZ3xysp.d.ts → types-7wjInVMW.d.ts} +1 -1
- package/dist/{types-Bnp8rvJn.d.cts → types-DEEpBL9H.d.cts} +1 -1
- package/dist/ui.cjs +1 -2
- package/dist/ui.d.cts +32 -85
- package/dist/ui.d.ts +32 -85
- package/dist/ui.js +1 -2
- package/dist/{variableDetector-CMhJtM96.d.cts → variableDetector-B4oQJa2e.d.cts} +33 -2
- package/dist/{variableDetector-BaDeXz7D.d.ts → variableDetector-BXJaTkiB.d.ts} +33 -2
- package/package.json +2 -1
- package/dist/FindReplaceDialog-AWQXKEUQ.js.map +0 -1
- package/dist/FindReplaceDialog-I4SZDSVP.cjs +0 -2
- package/dist/FindReplaceDialog-I4SZDSVP.cjs.map +0 -1
- package/dist/FootnotePropertiesDialog-73VT2ZVZ.cjs.map +0 -1
- package/dist/FootnotePropertiesDialog-ZM3EF3EF.js.map +0 -1
- package/dist/HyperlinkDialog-BA25XUT5.js.map +0 -1
- package/dist/HyperlinkDialog-V63LPOT2.cjs +0 -2
- package/dist/HyperlinkDialog-V63LPOT2.cjs.map +0 -1
- package/dist/ImagePositionDialog-AIAMKPFK.js.map +0 -1
- package/dist/ImagePositionDialog-KMK7ROV2.cjs.map +0 -1
- package/dist/ImagePropertiesDialog-ERFCUVCW.js.map +0 -1
- package/dist/ImagePropertiesDialog-USMMRK6X.cjs.map +0 -1
- package/dist/TablePropertiesDialog-72CIUAZT.cjs.map +0 -1
- package/dist/TablePropertiesDialog-EMUEVYB3.js.map +0 -1
- package/dist/chunk-2CHPKB5A.cjs +0 -112
- package/dist/chunk-2CHPKB5A.cjs.map +0 -1
- package/dist/chunk-2QOEHCBX.js.map +0 -1
- package/dist/chunk-4QT5LPBA.cjs.map +0 -1
- package/dist/chunk-5DYSI4O4.cjs +0 -60
- package/dist/chunk-5DYSI4O4.cjs.map +0 -1
- package/dist/chunk-5FJXHXFV.cjs +0 -2
- package/dist/chunk-5FJXHXFV.cjs.map +0 -1
- package/dist/chunk-6FEWNF6B.js +0 -4
- package/dist/chunk-6FEWNF6B.js.map +0 -1
- package/dist/chunk-6LF5HZCV.js +0 -10
- package/dist/chunk-6LF5HZCV.js.map +0 -1
- package/dist/chunk-7JSPKVOW.js.map +0 -1
- package/dist/chunk-C33XDRDJ.cjs +0 -28
- package/dist/chunk-C33XDRDJ.cjs.map +0 -1
- package/dist/chunk-CV5WFE7K.js.map +0 -1
- package/dist/chunk-CXJRNISO.js +0 -2
- package/dist/chunk-CXJRNISO.js.map +0 -1
- package/dist/chunk-DJAEBZ33.cjs.map +0 -1
- package/dist/chunk-DP6Q75ZD.js +0 -28
- package/dist/chunk-DP6Q75ZD.js.map +0 -1
- package/dist/chunk-FDANI5P4.cjs.map +0 -1
- package/dist/chunk-FGVGZLBL.js.map +0 -1
- package/dist/chunk-GJ4GKSDU.cjs +0 -2
- package/dist/chunk-GJ4GKSDU.cjs.map +0 -1
- package/dist/chunk-GWBTKVFD.cjs.map +0 -1
- package/dist/chunk-JOYPFQW2.js.map +0 -1
- package/dist/chunk-L54YNLSE.js +0 -2
- package/dist/chunk-L54YNLSE.js.map +0 -1
- package/dist/chunk-LPGMLJMO.js +0 -259
- package/dist/chunk-LPGMLJMO.js.map +0 -1
- package/dist/chunk-M2T6XKT5.js.map +0 -1
- package/dist/chunk-OHG7ROFC.js +0 -11
- package/dist/chunk-OHG7ROFC.js.map +0 -1
- package/dist/chunk-PANKMCFX.cjs +0 -4
- package/dist/chunk-PANKMCFX.cjs.map +0 -1
- package/dist/chunk-Q6HUGWO6.js.map +0 -1
- package/dist/chunk-QDV75OJ4.js +0 -112
- package/dist/chunk-QDV75OJ4.js.map +0 -1
- package/dist/chunk-QEBO3EQP.cjs.map +0 -1
- package/dist/chunk-QVIZ775M.cjs +0 -259
- package/dist/chunk-QVIZ775M.cjs.map +0 -1
- package/dist/chunk-RMUMR42R.cjs +0 -10
- package/dist/chunk-RMUMR42R.cjs.map +0 -1
- package/dist/chunk-S26DZVRQ.cjs.map +0 -1
- package/dist/chunk-T2HQYRA7.cjs.map +0 -1
- package/dist/chunk-ULXNEG66.js +0 -60
- package/dist/chunk-ULXNEG66.js.map +0 -1
- package/dist/chunk-WD2HTKRR.cjs.map +0 -1
- package/dist/chunk-XZNOV52K.cjs.map +0 -1
- package/dist/chunk-Y6VCTLCJ.js.map +0 -1
- package/dist/core-plugins-reexport.cjs.map +0 -1
- package/dist/core-plugins-reexport.js.map +0 -1
- package/dist/core-reexport.cjs.map +0 -1
- package/dist/core-reexport.js.map +0 -1
- package/dist/executor-K5RXUTTR.js +0 -2
- package/dist/executor-K5RXUTTR.js.map +0 -1
- package/dist/executor-XIPIU3H4.cjs +0 -2
- package/dist/executor-XIPIU3H4.cjs.map +0 -1
- package/dist/headless-reexport.cjs.map +0 -1
- package/dist/headless-reexport.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp-reexport.cjs.map +0 -1
- package/dist/mcp-reexport.js.map +0 -1
- package/dist/processTemplate-G37IM66O.js.map +0 -1
- package/dist/processTemplate-RFBGVH7T.cjs +0 -2
- package/dist/processTemplate-RFBGVH7T.cjs.map +0 -1
- package/dist/react.cjs.map +0 -1
- package/dist/react.css.map +0 -1
- package/dist/react.js.map +0 -1
- package/dist/selectionRects-6DU7HN7E.js +0 -2
- package/dist/selectionRects-6DU7HN7E.js.map +0 -1
- package/dist/selectionRects-YZSC24ZP.cjs +0 -2
- package/dist/selectionRects-YZSC24ZP.cjs.map +0 -1
- package/dist/ui.cjs.map +0 -1
- package/dist/ui.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/eigenpal/docx-js-editor">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/eigenpal/docx-js-editor/main/assets/logo.png" alt="DOCX JS Editor" width="600" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@eigenpal/docx-js-editor"><img src="https://img.shields.io/npm/v/@eigenpal/docx-js-editor.svg?style=flat-square&color=00C853" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@eigenpal/docx-js-editor"><img src="https://img.shields.io/npm/dm/@eigenpal/docx-js-editor.svg?style=flat-square&color=00C853" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://github.com/eigenpal/docx-js-editor/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&color=00C853" alt="license" /></a>
|
|
11
|
+
<a href="https://docx-js-editor.vercel.app/"><img src="https://img.shields.io/badge/Live_Demo-00C853?style=flat-square&logo=vercel&logoColor=white" alt="Live Demo" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
# @eigenpal/docx-js-editor
|
|
15
|
+
|
|
16
|
+
Open-source WYSIWYG DOCX editor for the browser. No server required. **[Live demo](https://docx-js-editor.vercel.app/)**
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="https://docx-js-editor.vercel.app/">
|
|
20
|
+
<img src="https://raw.githubusercontent.com/eigenpal/docx-js-editor/main/assets/editor.png" alt="DOCX JS Editor screenshot" width="700" />
|
|
21
|
+
</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
- WYSIWYG editing with Word fidelity — formatting, tables, images, hyperlinks
|
|
25
|
+
- Track changes (suggestion mode) with accept/reject
|
|
26
|
+
- Comments with replies, resolve/reopen, scroll-to-highlight
|
|
27
|
+
- Plugin system, undo/redo, find & replace, print preview
|
|
28
|
+
- Client-side only, zero server dependencies
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @eigenpal/docx-js-editor
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { useRef } from 'react';
|
|
38
|
+
import { DocxEditor, type DocxEditorRef } from '@eigenpal/docx-js-editor';
|
|
39
|
+
import '@eigenpal/docx-js-editor/styles.css';
|
|
40
|
+
|
|
41
|
+
function Editor({ file }: { file: ArrayBuffer }) {
|
|
42
|
+
const editorRef = useRef<DocxEditorRef>(null);
|
|
43
|
+
return <DocxEditor ref={editorRef} documentBuffer={file} onChange={() => {}} />;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **Next.js / SSR:** Use dynamic import — the editor requires the DOM.
|
|
48
|
+
|
|
49
|
+
## Packages
|
|
50
|
+
|
|
51
|
+
| Package | Description |
|
|
52
|
+
| -------------------------------------------- | ------------------------------------------------------------ |
|
|
53
|
+
| [`@eigenpal/docx-js-editor`](https://github.com/eigenpal/docx-js-editor/tree/main/packages/react) | React UI — toolbar, paged editor, plugins. **Install this.** |
|
|
54
|
+
| [`@eigenpal/docx-editor-vue`](https://github.com/eigenpal/docx-js-editor/tree/main/packages/vue) | Vue.js scaffold — contributions welcome |
|
|
55
|
+
|
|
56
|
+
## Plugins
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { DocxEditor, PluginHost, templatePlugin } from '@eigenpal/docx-js-editor';
|
|
60
|
+
|
|
61
|
+
<PluginHost plugins={[templatePlugin]}>
|
|
62
|
+
<DocxEditor documentBuffer={file} />
|
|
63
|
+
</PluginHost>;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
See [docs/PLUGINS.md](https://github.com/eigenpal/docx-js-editor/blob/main/docs/PLUGINS.md) for the full plugin API.
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
bun install
|
|
72
|
+
bun run dev # localhost:5173
|
|
73
|
+
bun run build
|
|
74
|
+
bun run typecheck
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Examples: [Vite](https://github.com/eigenpal/docx-js-editor/tree/main/examples/vite) | [Next.js](https://github.com/eigenpal/docx-js-editor/tree/main/examples/nextjs) | [Remix](https://github.com/eigenpal/docx-js-editor/tree/main/examples/remix) | [Astro](https://github.com/eigenpal/docx-js-editor/tree/main/examples/astro) | [Vue](https://github.com/eigenpal/docx-js-editor/tree/main/examples/vue)
|
|
78
|
+
|
|
79
|
+
**[Props & Ref Methods](https://github.com/eigenpal/docx-js-editor/blob/main/docs/PROPS.md)** | **[Plugins](https://github.com/eigenpal/docx-js-editor/blob/main/docs/PLUGINS.md)** | **[Architecture](https://github.com/eigenpal/docx-js-editor/blob/main/docs/ARCHITECTURE.md)**
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
MIT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Node } from 'prosemirror-model';
|
|
4
|
-
import { D as Document, e as Table, b as Run } from './agentApi-
|
|
4
|
+
import { D as Document, e as Table, b as Run } from './agentApi-DfsWRyrP.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Framework-Agnostic Plugin Interface for the DOCX Editor
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Node } from 'prosemirror-model';
|
|
4
|
-
import { D as Document, e as Table, b as Run } from './agentApi-
|
|
4
|
+
import { D as Document, e as Table, b as Run } from './agentApi-DfsWRyrP.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Framework-Agnostic Plugin Interface for the DOCX Editor
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
import { D as Document, T as TextFormatting, O as StyleInfo, h as AgentContext, P as Position, R as Range, w as ParagraphFormatting, A as AgentCommand } from './agentApi-
|
|
1
|
+
import { D as Document, T as TextFormatting, O as StyleInfo, h as AgentContext, P as Position, R as Range, w as ParagraphFormatting, A as AgentCommand } from './agentApi-DfsWRyrP.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Selective Save Module
|
|
5
|
+
*
|
|
6
|
+
* Orchestrates selective XML patching for the save flow.
|
|
7
|
+
* Serializes full document.xml, validates patch safety, builds patched XML,
|
|
8
|
+
* and calls updateMultipleFiles() to produce the final DOCX.
|
|
9
|
+
*
|
|
10
|
+
* Returns null on any failure, signaling the caller to fall back to full repack.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface SelectiveSaveOptions {
|
|
14
|
+
/** Changed paragraph IDs to selectively patch */
|
|
15
|
+
changedParaIds: Set<string>;
|
|
16
|
+
/** Whether structural changes occurred (paragraph add/delete) */
|
|
17
|
+
structuralChange: boolean;
|
|
18
|
+
/** Whether any changes affected paragraphs without paraId */
|
|
19
|
+
hasUntrackedChanges: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Attempt a selective save — patch only changed paragraphs in document.xml.
|
|
23
|
+
*
|
|
24
|
+
* Returns the saved ArrayBuffer, or null if selective save is not possible
|
|
25
|
+
* (caller should fall back to full repack).
|
|
26
|
+
*/
|
|
27
|
+
declare function attemptSelectiveSave(doc: Document, originalBuffer: ArrayBuffer, options: SelectiveSaveOptions): Promise<ArrayBuffer | null>;
|
|
2
28
|
|
|
3
29
|
/**
|
|
4
30
|
* Flexible input types for DOCX documents.
|
|
@@ -338,7 +364,9 @@ declare class DocumentAgent {
|
|
|
338
364
|
*
|
|
339
365
|
* @returns Promise resolving to DOCX file as ArrayBuffer
|
|
340
366
|
*/
|
|
341
|
-
toBuffer(
|
|
367
|
+
toBuffer(options?: {
|
|
368
|
+
selective?: SelectiveSaveOptions;
|
|
369
|
+
}): Promise<ArrayBuffer>;
|
|
342
370
|
/**
|
|
343
371
|
* Export document to Blob
|
|
344
372
|
*
|
|
@@ -409,4 +437,4 @@ declare function createAgent(buffer: ArrayBuffer): Promise<DocumentAgent>;
|
|
|
409
437
|
*/
|
|
410
438
|
declare function createAgentFromDocument(document: Document): DocumentAgent;
|
|
411
439
|
|
|
412
|
-
export { DocumentAgent as D, type FormattedTextSegment as F, type InsertHyperlinkOptions as I, type InsertImageOptions as a, type InsertTableOptions as b, type InsertTextOptions as c,
|
|
440
|
+
export { DocumentAgent as D, type FormattedTextSegment as F, type InsertHyperlinkOptions as I, type InsertImageOptions as a, type InsertTableOptions as b, type InsertTextOptions as c, attemptSelectiveSave as d, createAgent as e, createAgentFromDocument as f, type DocxInput as g, toArrayBuffer as t };
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
import { D as Document, T as TextFormatting, O as StyleInfo, h as AgentContext, P as Position, R as Range, w as ParagraphFormatting, A as AgentCommand } from './agentApi-
|
|
1
|
+
import { D as Document, T as TextFormatting, O as StyleInfo, h as AgentContext, P as Position, R as Range, w as ParagraphFormatting, A as AgentCommand } from './agentApi-DfsWRyrP.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Selective Save Module
|
|
5
|
+
*
|
|
6
|
+
* Orchestrates selective XML patching for the save flow.
|
|
7
|
+
* Serializes full document.xml, validates patch safety, builds patched XML,
|
|
8
|
+
* and calls updateMultipleFiles() to produce the final DOCX.
|
|
9
|
+
*
|
|
10
|
+
* Returns null on any failure, signaling the caller to fall back to full repack.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface SelectiveSaveOptions {
|
|
14
|
+
/** Changed paragraph IDs to selectively patch */
|
|
15
|
+
changedParaIds: Set<string>;
|
|
16
|
+
/** Whether structural changes occurred (paragraph add/delete) */
|
|
17
|
+
structuralChange: boolean;
|
|
18
|
+
/** Whether any changes affected paragraphs without paraId */
|
|
19
|
+
hasUntrackedChanges: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Attempt a selective save — patch only changed paragraphs in document.xml.
|
|
23
|
+
*
|
|
24
|
+
* Returns the saved ArrayBuffer, or null if selective save is not possible
|
|
25
|
+
* (caller should fall back to full repack).
|
|
26
|
+
*/
|
|
27
|
+
declare function attemptSelectiveSave(doc: Document, originalBuffer: ArrayBuffer, options: SelectiveSaveOptions): Promise<ArrayBuffer | null>;
|
|
2
28
|
|
|
3
29
|
/**
|
|
4
30
|
* Flexible input types for DOCX documents.
|
|
@@ -338,7 +364,9 @@ declare class DocumentAgent {
|
|
|
338
364
|
*
|
|
339
365
|
* @returns Promise resolving to DOCX file as ArrayBuffer
|
|
340
366
|
*/
|
|
341
|
-
toBuffer(
|
|
367
|
+
toBuffer(options?: {
|
|
368
|
+
selective?: SelectiveSaveOptions;
|
|
369
|
+
}): Promise<ArrayBuffer>;
|
|
342
370
|
/**
|
|
343
371
|
* Export document to Blob
|
|
344
372
|
*
|
|
@@ -409,4 +437,4 @@ declare function createAgent(buffer: ArrayBuffer): Promise<DocumentAgent>;
|
|
|
409
437
|
*/
|
|
410
438
|
declare function createAgentFromDocument(document: Document): DocumentAgent;
|
|
411
439
|
|
|
412
|
-
export { DocumentAgent as D, type FormattedTextSegment as F, type InsertHyperlinkOptions as I, type InsertImageOptions as a, type InsertTableOptions as b, type InsertTextOptions as c,
|
|
440
|
+
export { DocumentAgent as D, type FormattedTextSegment as F, type InsertHyperlinkOptions as I, type InsertImageOptions as a, type InsertTableOptions as b, type InsertTextOptions as c, attemptSelectiveSave as d, createAgent as e, createAgentFromDocument as f, type DocxInput as g, toArrayBuffer as t };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export{n as FindReplaceDialog,a as createDefaultFindOptions,c as createSearchPattern,o as default,b as escapeRegexString,d as findAllMatches,j as findInDocument,k as findInParagraph,i as getDefaultHighlightOptions,g as getMatchCountText,h as isEmptySearch,e as replaceAllInContent,f as replaceFirstInContent,l as scrollToMatch,m as useFindReplace}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=FindReplaceDialog-AWQXKEUQ.js.map
|
|
1
|
+
export{n as FindReplaceDialog,a as createDefaultFindOptions,c as createSearchPattern,o as default,b as escapeRegexString,d as findAllMatches,j as findInDocument,k as findInParagraph,i as getDefaultHighlightOptions,g as getMatchCountText,h as isEmptySearch,e as replaceAllInContent,f as replaceFirstInContent,l as scrollToMatch,m as useFindReplace}from'./chunk-CTYOM6BE.js';import'./chunk-H5NTJZO4.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkVTAS7VZ6_cjs=require('./chunk-VTAS7VZ6.cjs');require('./chunk-PCJ5ACUV.cjs');Object.defineProperty(exports,"FindReplaceDialog",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.n}});Object.defineProperty(exports,"createDefaultFindOptions",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.a}});Object.defineProperty(exports,"createSearchPattern",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.c}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.o}});Object.defineProperty(exports,"escapeRegexString",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.b}});Object.defineProperty(exports,"findAllMatches",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.d}});Object.defineProperty(exports,"findInDocument",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.j}});Object.defineProperty(exports,"findInParagraph",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.k}});Object.defineProperty(exports,"getDefaultHighlightOptions",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.i}});Object.defineProperty(exports,"getMatchCountText",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.g}});Object.defineProperty(exports,"isEmptySearch",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.h}});Object.defineProperty(exports,"replaceAllInContent",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.e}});Object.defineProperty(exports,"replaceFirstInContent",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.f}});Object.defineProperty(exports,"scrollToMatch",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.l}});Object.defineProperty(exports,"useFindReplace",{enumerable:true,get:function(){return chunkVTAS7VZ6_cjs.m}});
|
package/dist/{FootnotePropertiesDialog-73VT2ZVZ.cjs → FootnotePropertiesDialog-DO5DCAW6.cjs}
RENAMED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';require('./chunk-
|
|
2
|
-
//# sourceMappingURL=FootnotePropertiesDialog-73VT2ZVZ.cjs.map
|
|
1
|
+
'use strict';require('./chunk-PCJ5ACUV.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var A={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},D={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",padding:24,minWidth:400,maxWidth:500},S={marginBottom:16,padding:12,border:"1px solid #e0e0e0",borderRadius:4},a={display:"block",fontSize:12,color:"#666",marginBottom:4},i={width:"100%",padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},P={width:60,padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},L={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},h={padding:"6px 16px",border:"1px solid #ccc",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"white"},O={...h,backgroundColor:"#2563eb",color:"white",border:"1px solid #2563eb"},f=[{value:"decimal",label:"1, 2, 3, ..."},{value:"lowerRoman",label:"i, ii, iii, ..."},{value:"upperRoman",label:"I, II, III, ..."},{value:"lowerLetter",label:"a, b, c, ..."},{value:"upperLetter",label:"A, B, C, ..."},{value:"chicago",label:"*, \u2020, \u2021, ..."}];function j({isOpen:x,onClose:l,onApply:y,footnotePr:r,endnotePr:s}){let[u,C]=react.useState(r?.position??"pageBottom"),[p,F]=react.useState(r?.numFmt??"decimal"),[m,N]=react.useState(r?.numStart??1),[c,R]=react.useState(r?.numRestart??"continuous"),[d,E]=react.useState(s?.position??"docEnd"),[b,k]=react.useState(s?.numFmt??"lowerRoman"),[v,I]=react.useState(s?.numStart??1),[g,w]=react.useState(s?.numRestart??"continuous"),B=react.useCallback(()=>{y({position:u,numFmt:p,numStart:m,numRestart:c},{position:d,numFmt:b,numStart:v,numRestart:g}),l();},[u,p,m,c,d,b,v,g,y,l]);return x?jsxRuntime.jsx("div",{style:A,onClick:l,children:jsxRuntime.jsxs("div",{style:D,onClick:e=>e.stopPropagation(),children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:"Footnote & Endnote Properties"}),jsxRuntime.jsxs("div",{style:S,children:[jsxRuntime.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:"Footnotes"}),jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:i,value:u,onChange:e=>C(e.target.value),children:[jsxRuntime.jsx("option",{value:"pageBottom",children:"Bottom of page"}),jsxRuntime.jsx("option",{value:"beneathText",children:"Below text"})]}),jsxRuntime.jsx("label",{style:a,children:"Number format"}),jsxRuntime.jsx("select",{style:i,value:p,onChange:e=>F(e.target.value),children:f.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{style:a,children:"Start at"}),jsxRuntime.jsx("input",{type:"number",min:1,style:P,value:m,onChange:e=>N(parseInt(e.target.value,10)||1)})]}),jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("label",{style:a,children:"Numbering"}),jsxRuntime.jsxs("select",{style:i,value:c,onChange:e=>R(e.target.value),children:[jsxRuntime.jsx("option",{value:"continuous",children:"Continuous"}),jsxRuntime.jsx("option",{value:"eachSect",children:"Restart each section"}),jsxRuntime.jsx("option",{value:"eachPage",children:"Restart each page"})]})]})]})]}),jsxRuntime.jsxs("div",{style:S,children:[jsxRuntime.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:"Endnotes"}),jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:i,value:d,onChange:e=>E(e.target.value),children:[jsxRuntime.jsx("option",{value:"docEnd",children:"End of document"}),jsxRuntime.jsx("option",{value:"sectEnd",children:"End of section"})]}),jsxRuntime.jsx("label",{style:a,children:"Number format"}),jsxRuntime.jsx("select",{style:i,value:b,onChange:e=>k(e.target.value),children:f.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{style:a,children:"Start at"}),jsxRuntime.jsx("input",{type:"number",min:1,style:P,value:v,onChange:e=>I(parseInt(e.target.value,10)||1)})]}),jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("label",{style:a,children:"Numbering"}),jsxRuntime.jsxs("select",{style:i,value:g,onChange:e=>w(e.target.value),children:[jsxRuntime.jsx("option",{value:"continuous",children:"Continuous"}),jsxRuntime.jsx("option",{value:"eachSect",children:"Restart each section"})]})]})]})]}),jsxRuntime.jsxs("div",{style:L,children:[jsxRuntime.jsx("button",{style:h,onClick:l,children:"Cancel"}),jsxRuntime.jsx("button",{style:O,onClick:B,children:"Apply"})]})]})}):null}exports.FootnotePropertiesDialog=j;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import'./chunk-
|
|
2
|
-
//# sourceMappingURL=FootnotePropertiesDialog-ZM3EF3EF.js.map
|
|
1
|
+
import'./chunk-H5NTJZO4.js';import {useState,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var A={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},D={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",padding:24,minWidth:400,maxWidth:500},S={marginBottom:16,padding:12,border:"1px solid #e0e0e0",borderRadius:4},a={display:"block",fontSize:12,color:"#666",marginBottom:4},i={width:"100%",padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},P={width:60,padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},L={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},h={padding:"6px 16px",border:"1px solid #ccc",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"white"},O={...h,backgroundColor:"#2563eb",color:"white",border:"1px solid #2563eb"},f=[{value:"decimal",label:"1, 2, 3, ..."},{value:"lowerRoman",label:"i, ii, iii, ..."},{value:"upperRoman",label:"I, II, III, ..."},{value:"lowerLetter",label:"a, b, c, ..."},{value:"upperLetter",label:"A, B, C, ..."},{value:"chicago",label:"*, \u2020, \u2021, ..."}];function j({isOpen:x,onClose:l,onApply:y,footnotePr:r,endnotePr:s}){let[u,C]=useState(r?.position??"pageBottom"),[p,F]=useState(r?.numFmt??"decimal"),[m,N]=useState(r?.numStart??1),[c,R]=useState(r?.numRestart??"continuous"),[d,E]=useState(s?.position??"docEnd"),[b,k]=useState(s?.numFmt??"lowerRoman"),[v,I]=useState(s?.numStart??1),[g,w]=useState(s?.numRestart??"continuous"),B=useCallback(()=>{y({position:u,numFmt:p,numStart:m,numRestart:c},{position:d,numFmt:b,numStart:v,numRestart:g}),l();},[u,p,m,c,d,b,v,g,y,l]);return x?jsx("div",{style:A,onClick:l,children:jsxs("div",{style:D,onClick:e=>e.stopPropagation(),children:[jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:"Footnote & Endnote Properties"}),jsxs("div",{style:S,children:[jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:"Footnotes"}),jsx("label",{style:a,children:"Position"}),jsxs("select",{style:i,value:u,onChange:e=>C(e.target.value),children:[jsx("option",{value:"pageBottom",children:"Bottom of page"}),jsx("option",{value:"beneathText",children:"Below text"})]}),jsx("label",{style:a,children:"Number format"}),jsx("select",{style:i,value:p,onChange:e=>F(e.target.value),children:f.map(e=>jsx("option",{value:e.value,children:e.label},e.value))}),jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxs("div",{children:[jsx("label",{style:a,children:"Start at"}),jsx("input",{type:"number",min:1,style:P,value:m,onChange:e=>N(parseInt(e.target.value,10)||1)})]}),jsxs("div",{style:{flex:1},children:[jsx("label",{style:a,children:"Numbering"}),jsxs("select",{style:i,value:c,onChange:e=>R(e.target.value),children:[jsx("option",{value:"continuous",children:"Continuous"}),jsx("option",{value:"eachSect",children:"Restart each section"}),jsx("option",{value:"eachPage",children:"Restart each page"})]})]})]})]}),jsxs("div",{style:S,children:[jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:"Endnotes"}),jsx("label",{style:a,children:"Position"}),jsxs("select",{style:i,value:d,onChange:e=>E(e.target.value),children:[jsx("option",{value:"docEnd",children:"End of document"}),jsx("option",{value:"sectEnd",children:"End of section"})]}),jsx("label",{style:a,children:"Number format"}),jsx("select",{style:i,value:b,onChange:e=>k(e.target.value),children:f.map(e=>jsx("option",{value:e.value,children:e.label},e.value))}),jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxs("div",{children:[jsx("label",{style:a,children:"Start at"}),jsx("input",{type:"number",min:1,style:P,value:v,onChange:e=>I(parseInt(e.target.value,10)||1)})]}),jsxs("div",{style:{flex:1},children:[jsx("label",{style:a,children:"Numbering"}),jsxs("select",{style:i,value:g,onChange:e=>w(e.target.value),children:[jsx("option",{value:"continuous",children:"Continuous"}),jsx("option",{value:"eachSect",children:"Restart each section"})]})]})]})]}),jsxs("div",{style:L,children:[jsx("button",{style:h,onClick:l,children:"Cancel"}),jsx("button",{style:O,onClick:B,children:"Apply"})]})]})}):null}export{j as FootnotePropertiesDialog};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export{d as HyperlinkDialog,f as createBookmarkLinkData,e as createHyperlinkData,n as default,j as emailToMailto,l as extractBookmarksForDialog,i as getDisplayText,c as getUrlType,h as isBookmarkHyperlinkData,g as isExternalHyperlinkData,a as isValidUrl,b as normalizeUrl,k as phoneToTel,m as useHyperlinkDialog}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=HyperlinkDialog-BA25XUT5.js.map
|
|
1
|
+
export{d as HyperlinkDialog,f as createBookmarkLinkData,e as createHyperlinkData,n as default,j as emailToMailto,l as extractBookmarksForDialog,i as getDisplayText,c as getUrlType,h as isBookmarkHyperlinkData,g as isExternalHyperlinkData,a as isValidUrl,b as normalizeUrl,k as phoneToTel,m as useHyperlinkDialog}from'./chunk-PJVI53AH.js';import'./chunk-H5NTJZO4.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkXS2AQFMF_cjs=require('./chunk-XS2AQFMF.cjs');require('./chunk-PCJ5ACUV.cjs');Object.defineProperty(exports,"HyperlinkDialog",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.d}});Object.defineProperty(exports,"createBookmarkLinkData",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.f}});Object.defineProperty(exports,"createHyperlinkData",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.e}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.n}});Object.defineProperty(exports,"emailToMailto",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.j}});Object.defineProperty(exports,"extractBookmarksForDialog",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.l}});Object.defineProperty(exports,"getDisplayText",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.i}});Object.defineProperty(exports,"getUrlType",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.c}});Object.defineProperty(exports,"isBookmarkHyperlinkData",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.h}});Object.defineProperty(exports,"isExternalHyperlinkData",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.g}});Object.defineProperty(exports,"isValidUrl",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.a}});Object.defineProperty(exports,"normalizeUrl",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.b}});Object.defineProperty(exports,"phoneToTel",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.k}});Object.defineProperty(exports,"useHyperlinkDialog",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.m}});
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import'./chunk-
|
|
2
|
-
//# sourceMappingURL=ImagePositionDialog-AIAMKPFK.js.map
|
|
1
|
+
import'./chunk-H5NTJZO4.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var F={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},G={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},J={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},Q={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},w={display:"flex",flexDirection:"column",gap:8},I={fontSize:13,fontWeight:600,color:"var(--doc-text)"},l={display:"flex",alignItems:"center",gap:8},a={width:75,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},d={...s},U={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},K={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function Z({isOpen:f,onClose:r,onApply:D,currentData:n}){let[v,u]=useState("align"),[y,k]=useState("center"),[c,z]=useState("column"),[b,A]=useState(0),[g,m]=useState("align"),[h,L]=useState("top"),[S,B]=useState("paragraph"),[x,M]=useState(0),[C,N]=useState(0),[P,E]=useState(0),[T,H]=useState(0),[R,V]=useState(0);useEffect(()=>{if(!f)return;let e=n?.horizontal,p=n?.vertical;e?.align?(u("align"),k(e.align)):e?.posOffset!=null&&(u("offset"),A(e.posOffset)),e?.relativeTo&&z(e.relativeTo),p?.align?(m("align"),L(p.align)):p?.posOffset!=null&&(m("offset"),M(p.posOffset)),p?.relativeTo&&B(p.relativeTo),N(n?.distTop??0),E(n?.distBottom??0),H(n?.distLeft??0),V(n?.distRight??0);},[f,n]);let O=useCallback(()=>{let e={};e.horizontal={relativeTo:c,...v==="align"?{align:y}:{posOffset:b}},e.vertical={relativeTo:S,...g==="align"?{align:h}:{posOffset:x}},e.distTop=C,e.distBottom=P,e.distLeft=T,e.distRight=R,D(e),r();},[v,y,c,b,g,h,S,x,C,P,T,R,D,r]),j=useCallback(e=>{e.key==="Escape"&&r(),e.key==="Enter"&&O();},[r,O]);return f?jsx("div",{style:F,onClick:r,onKeyDown:j,children:jsxs("div",{style:G,onClick:e=>e.stopPropagation(),role:"dialog","aria-label":"Image position",children:[jsx("div",{style:J,children:"Image Position"}),jsxs("div",{style:Q,children:[jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Horizontal"}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Position"}),jsxs("select",{style:d,value:v,onChange:e=>u(e.target.value),children:[jsx("option",{value:"align",children:"Alignment"}),jsx("option",{value:"offset",children:"Offset"})]})]}),v==="align"?jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Align"}),jsxs("select",{style:d,value:y,onChange:e=>k(e.target.value),children:[jsx("option",{value:"left",children:"Left"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"right",children:"Right"})]})]}):jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Offset (px)"}),jsx("input",{type:"number",style:s,value:b,onChange:e=>A(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Relative to"}),jsxs("select",{style:d,value:c,onChange:e=>z(e.target.value),children:[jsx("option",{value:"page",children:"Page"}),jsx("option",{value:"column",children:"Column"}),jsx("option",{value:"margin",children:"Margin"}),jsx("option",{value:"character",children:"Character"})]})]})]}),jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Vertical"}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Position"}),jsxs("select",{style:d,value:g,onChange:e=>m(e.target.value),children:[jsx("option",{value:"align",children:"Alignment"}),jsx("option",{value:"offset",children:"Offset"})]})]}),g==="align"?jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Align"}),jsxs("select",{style:d,value:h,onChange:e=>L(e.target.value),children:[jsx("option",{value:"top",children:"Top"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"bottom",children:"Bottom"})]})]}):jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Offset (px)"}),jsx("input",{type:"number",style:s,value:x,onChange:e=>M(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Relative to"}),jsxs("select",{style:d,value:S,onChange:e=>B(e.target.value),children:[jsx("option",{value:"page",children:"Page"}),jsx("option",{value:"margin",children:"Margin"}),jsx("option",{value:"paragraph",children:"Paragraph"}),jsx("option",{value:"line",children:"Line"})]})]})]}),jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Distance from text (px)"}),jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Top"}),jsx("input",{type:"number",style:s,min:0,value:C,onChange:e=>N(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Bottom"}),jsx("input",{type:"number",style:s,min:0,value:P,onChange:e=>E(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Left"}),jsx("input",{type:"number",style:s,min:0,value:T,onChange:e=>H(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Right"}),jsx("input",{type:"number",style:s,min:0,value:R,onChange:e=>V(Number(e.target.value)||0)})]})]})]})]}),jsxs("div",{style:U,children:[jsx("button",{type:"button",style:K,onClick:r,children:"Cancel"}),jsx("button",{type:"button",style:{...K,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:O,children:"Apply"})]})]})}):null}export{Z as ImagePositionDialog};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';require('./chunk-
|
|
2
|
-
//# sourceMappingURL=ImagePositionDialog-KMK7ROV2.cjs.map
|
|
1
|
+
'use strict';require('./chunk-PCJ5ACUV.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var F={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},G={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},J={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},Q={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},w={display:"flex",flexDirection:"column",gap:8},I={fontSize:13,fontWeight:600,color:"var(--doc-text)"},l={display:"flex",alignItems:"center",gap:8},a={width:75,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},d={...s},U={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},K={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function Z({isOpen:f,onClose:r,onApply:D,currentData:n}){let[v,u]=react.useState("align"),[y,k]=react.useState("center"),[c,z]=react.useState("column"),[b,A]=react.useState(0),[g,m]=react.useState("align"),[h,L]=react.useState("top"),[S,B]=react.useState("paragraph"),[x,M]=react.useState(0),[C,N]=react.useState(0),[P,E]=react.useState(0),[T,H]=react.useState(0),[R,V]=react.useState(0);react.useEffect(()=>{if(!f)return;let e=n?.horizontal,p=n?.vertical;e?.align?(u("align"),k(e.align)):e?.posOffset!=null&&(u("offset"),A(e.posOffset)),e?.relativeTo&&z(e.relativeTo),p?.align?(m("align"),L(p.align)):p?.posOffset!=null&&(m("offset"),M(p.posOffset)),p?.relativeTo&&B(p.relativeTo),N(n?.distTop??0),E(n?.distBottom??0),H(n?.distLeft??0),V(n?.distRight??0);},[f,n]);let O=react.useCallback(()=>{let e={};e.horizontal={relativeTo:c,...v==="align"?{align:y}:{posOffset:b}},e.vertical={relativeTo:S,...g==="align"?{align:h}:{posOffset:x}},e.distTop=C,e.distBottom=P,e.distLeft=T,e.distRight=R,D(e),r();},[v,y,c,b,g,h,S,x,C,P,T,R,D,r]),j=react.useCallback(e=>{e.key==="Escape"&&r(),e.key==="Enter"&&O();},[r,O]);return f?jsxRuntime.jsx("div",{style:F,onClick:r,onKeyDown:j,children:jsxRuntime.jsxs("div",{style:G,onClick:e=>e.stopPropagation(),role:"dialog","aria-label":"Image position",children:[jsxRuntime.jsx("div",{style:J,children:"Image Position"}),jsxRuntime.jsxs("div",{style:Q,children:[jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Horizontal"}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:d,value:v,onChange:e=>u(e.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:"Alignment"}),jsxRuntime.jsx("option",{value:"offset",children:"Offset"})]})]}),v==="align"?jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Align"}),jsxRuntime.jsxs("select",{style:d,value:y,onChange:e=>k(e.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:"Left"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"right",children:"Right"})]})]}):jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Offset (px)"}),jsxRuntime.jsx("input",{type:"number",style:s,value:b,onChange:e=>A(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Relative to"}),jsxRuntime.jsxs("select",{style:d,value:c,onChange:e=>z(e.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:"Page"}),jsxRuntime.jsx("option",{value:"column",children:"Column"}),jsxRuntime.jsx("option",{value:"margin",children:"Margin"}),jsxRuntime.jsx("option",{value:"character",children:"Character"})]})]})]}),jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Vertical"}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:d,value:g,onChange:e=>m(e.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:"Alignment"}),jsxRuntime.jsx("option",{value:"offset",children:"Offset"})]})]}),g==="align"?jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Align"}),jsxRuntime.jsxs("select",{style:d,value:h,onChange:e=>L(e.target.value),children:[jsxRuntime.jsx("option",{value:"top",children:"Top"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"bottom",children:"Bottom"})]})]}):jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Offset (px)"}),jsxRuntime.jsx("input",{type:"number",style:s,value:x,onChange:e=>M(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Relative to"}),jsxRuntime.jsxs("select",{style:d,value:S,onChange:e=>B(e.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:"Page"}),jsxRuntime.jsx("option",{value:"margin",children:"Margin"}),jsxRuntime.jsx("option",{value:"paragraph",children:"Paragraph"}),jsxRuntime.jsx("option",{value:"line",children:"Line"})]})]})]}),jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Distance from text (px)"}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Top"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:C,onChange:e=>N(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Bottom"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:P,onChange:e=>E(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Left"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:T,onChange:e=>H(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Right"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:R,onChange:e=>V(Number(e.target.value)||0)})]})]})]})]}),jsxRuntime.jsxs("div",{style:U,children:[jsxRuntime.jsx("button",{type:"button",style:K,onClick:r,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...K,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:O,children:"Apply"})]})]})}):null}exports.ImagePositionDialog=Z;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import'./chunk-
|
|
2
|
-
//# sourceMappingURL=ImagePropertiesDialog-ERFCUVCW.js.map
|
|
1
|
+
import'./chunk-H5NTJZO4.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var D={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},w={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},h={display:"flex",flexDirection:"column",gap:8},C={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},u={width:60,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},z={...s},A={...s,minHeight:60,resize:"vertical",fontFamily:"inherit"},B={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},P={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function T({isOpen:p,onClose:i,onApply:g,currentData:l}){let[c,S]=useState(""),[r,x]=useState(0),[d,y]=useState("#000000"),[a,f]=useState("solid");useEffect(()=>{p&&(S(l?.alt??""),x(l?.borderWidth??0),y(l?.borderColor??"#000000"),f(l?.borderStyle??"solid"));},[p,l]);let b=useCallback(()=>{g({alt:c||void 0,borderWidth:r>0?r:void 0,borderColor:r>0?d:void 0,borderStyle:r>0?a:void 0}),i();},[c,r,d,a,g,i]),I=useCallback(t=>{t.key==="Escape"&&i(),t.key==="Enter"&&!t.shiftKey&&b();},[i,b]);return p?jsx("div",{style:D,onClick:i,onKeyDown:I,children:jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Image properties",children:[jsx("div",{style:w,children:"Image Properties"}),jsxs("div",{style:R,children:[jsxs("div",{style:h,children:[jsx("div",{style:C,children:"Alt Text"}),jsx("textarea",{style:A,value:c,onChange:t=>S(t.target.value),placeholder:"Describe this image for accessibility..."})]}),jsxs("div",{style:h,children:[jsx("div",{style:C,children:"Border"}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Width"}),jsx("input",{type:"number",style:{...s,maxWidth:80},min:0,max:20,step:.5,value:r,onChange:t=>x(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:"px"})]}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Style"}),jsxs("select",{style:z,value:a,onChange:t=>f(t.target.value),children:[jsx("option",{value:"solid",children:"Solid"}),jsx("option",{value:"dashed",children:"Dashed"}),jsx("option",{value:"dotted",children:"Dotted"}),jsx("option",{value:"double",children:"Double"}),jsx("option",{value:"groove",children:"Groove"}),jsx("option",{value:"ridge",children:"Ridge"}),jsx("option",{value:"inset",children:"Inset"}),jsx("option",{value:"outset",children:"Outset"})]})]}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Color"}),jsx("input",{type:"color",value:d,onChange:t=>y(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsx("input",{type:"text",style:{...s,maxWidth:90},value:d,onChange:t=>y(t.target.value)})]}),r>0&&jsx("div",{style:{marginTop:4,padding:8,border:`${r}px ${a} ${d}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:"Preview"})]})]}),jsxs("div",{style:B,children:[jsx("button",{type:"button",style:P,onClick:i,children:"Cancel"}),jsx("button",{type:"button",style:{...P,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:"Apply"})]})]})}):null}export{T as ImagePropertiesDialog};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';require('./chunk-
|
|
2
|
-
//# sourceMappingURL=ImagePropertiesDialog-USMMRK6X.cjs.map
|
|
1
|
+
'use strict';require('./chunk-PCJ5ACUV.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var D={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},w={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},h={display:"flex",flexDirection:"column",gap:8},C={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},u={width:60,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},z={...s},A={...s,minHeight:60,resize:"vertical",fontFamily:"inherit"},B={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},P={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function T({isOpen:p,onClose:i,onApply:g,currentData:l}){let[c,S]=react.useState(""),[r,x]=react.useState(0),[d,y]=react.useState("#000000"),[a,f]=react.useState("solid");react.useEffect(()=>{p&&(S(l?.alt??""),x(l?.borderWidth??0),y(l?.borderColor??"#000000"),f(l?.borderStyle??"solid"));},[p,l]);let b=react.useCallback(()=>{g({alt:c||void 0,borderWidth:r>0?r:void 0,borderColor:r>0?d:void 0,borderStyle:r>0?a:void 0}),i();},[c,r,d,a,g,i]),I=react.useCallback(t=>{t.key==="Escape"&&i(),t.key==="Enter"&&!t.shiftKey&&b();},[i,b]);return p?jsxRuntime.jsx("div",{style:D,onClick:i,onKeyDown:I,children:jsxRuntime.jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Image properties",children:[jsxRuntime.jsx("div",{style:w,children:"Image Properties"}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsxs("div",{style:h,children:[jsxRuntime.jsx("div",{style:C,children:"Alt Text"}),jsxRuntime.jsx("textarea",{style:A,value:c,onChange:t=>S(t.target.value),placeholder:"Describe this image for accessibility..."})]}),jsxRuntime.jsxs("div",{style:h,children:[jsxRuntime.jsx("div",{style:C,children:"Border"}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Width"}),jsxRuntime.jsx("input",{type:"number",style:{...s,maxWidth:80},min:0,max:20,step:.5,value:r,onChange:t=>x(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:"px"})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Style"}),jsxRuntime.jsxs("select",{style:z,value:a,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"solid",children:"Solid"}),jsxRuntime.jsx("option",{value:"dashed",children:"Dashed"}),jsxRuntime.jsx("option",{value:"dotted",children:"Dotted"}),jsxRuntime.jsx("option",{value:"double",children:"Double"}),jsxRuntime.jsx("option",{value:"groove",children:"Groove"}),jsxRuntime.jsx("option",{value:"ridge",children:"Ridge"}),jsxRuntime.jsx("option",{value:"inset",children:"Inset"}),jsxRuntime.jsx("option",{value:"outset",children:"Outset"})]})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Color"}),jsxRuntime.jsx("input",{type:"color",value:d,onChange:t=>y(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsxRuntime.jsx("input",{type:"text",style:{...s,maxWidth:90},value:d,onChange:t=>y(t.target.value)})]}),r>0&&jsxRuntime.jsx("div",{style:{marginTop:4,padding:8,border:`${r}px ${a} ${d}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:"Preview"})]})]}),jsxRuntime.jsxs("div",{style:B,children:[jsxRuntime.jsx("button",{type:"button",style:P,onClick:i,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...P,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:"Apply"})]})]})}):null}exports.ImagePropertiesDialog=T;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';require('./chunk-
|
|
2
|
-
//# sourceMappingURL=TablePropertiesDialog-72CIUAZT.cjs.map
|
|
1
|
+
'use strict';require('./chunk-PCJ5ACUV.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var C={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},P={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},T={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},k={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},c={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},x={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},S={...x},R={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},h={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function z({isOpen:n,onClose:r,onApply:y,currentProps:i}){let[a,b]=react.useState(i?.width||0),[l,f]=react.useState(i?.widthType||"auto"),[p,g]=react.useState(i?.justification||"left");react.useEffect(()=>{n&&(b(i?.width||0),f(i?.widthType||"auto"),g(i?.justification||"left"));},[n,i]);let d=react.useCallback(()=>{let t={};l==="auto"?(t.width=null,t.widthType="auto"):(t.width=a,t.widthType=l),t.justification=p,y(t),r();},[a,l,p,y,r]),w=react.useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&d();},[r,d]);return n?jsxRuntime.jsx("div",{style:C,onClick:r,onKeyDown:w,children:jsxRuntime.jsxs("div",{style:P,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Table properties",children:[jsxRuntime.jsx("div",{style:T,children:"Table Properties"}),jsxRuntime.jsxs("div",{style:k,children:[jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Width type"}),jsxRuntime.jsxs("select",{style:S,value:l,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"auto",children:"Auto"}),jsxRuntime.jsx("option",{value:"dxa",children:"Fixed (twips)"}),jsxRuntime.jsx("option",{value:"pct",children:"Percentage"})]})]}),l!=="auto"&&jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Width"}),jsxRuntime.jsx("input",{type:"number",style:x,min:0,step:l==="pct"?5:100,value:a,onChange:t=>b(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:l==="pct"?"(50ths of %)":"tw"})]}),jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Alignment"}),jsxRuntime.jsxs("select",{style:S,value:p,onChange:t=>g(t.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:"Left"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"right",children:"Right"})]})]})]}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsx("button",{type:"button",style:h,onClick:r,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...h,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:"Apply"})]})]})}):null}exports.TablePropertiesDialog=z;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import'./chunk-
|
|
2
|
-
//# sourceMappingURL=TablePropertiesDialog-EMUEVYB3.js.map
|
|
1
|
+
import'./chunk-H5NTJZO4.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var C={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},P={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},T={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},k={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},c={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},x={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},S={...x},R={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},h={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function z({isOpen:n,onClose:r,onApply:y,currentProps:i}){let[a,b]=useState(i?.width||0),[l,f]=useState(i?.widthType||"auto"),[p,g]=useState(i?.justification||"left");useEffect(()=>{n&&(b(i?.width||0),f(i?.widthType||"auto"),g(i?.justification||"left"));},[n,i]);let d=useCallback(()=>{let t={};l==="auto"?(t.width=null,t.widthType="auto"):(t.width=a,t.widthType=l),t.justification=p,y(t),r();},[a,l,p,y,r]),w=useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&d();},[r,d]);return n?jsx("div",{style:C,onClick:r,onKeyDown:w,children:jsxs("div",{style:P,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Table properties",children:[jsx("div",{style:T,children:"Table Properties"}),jsxs("div",{style:k,children:[jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Width type"}),jsxs("select",{style:S,value:l,onChange:t=>f(t.target.value),children:[jsx("option",{value:"auto",children:"Auto"}),jsx("option",{value:"dxa",children:"Fixed (twips)"}),jsx("option",{value:"pct",children:"Percentage"})]})]}),l!=="auto"&&jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Width"}),jsx("input",{type:"number",style:x,min:0,step:l==="pct"?5:100,value:a,onChange:t=>b(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:l==="pct"?"(50ths of %)":"tw"})]}),jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Alignment"}),jsxs("select",{style:S,value:p,onChange:t=>g(t.target.value),children:[jsx("option",{value:"left",children:"Left"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"right",children:"Right"})]})]})]}),jsxs("div",{style:R,children:[jsx("button",{type:"button",style:h,onClick:r,children:"Cancel"}),jsx("button",{type:"button",style:{...h,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:"Apply"})]})]})}):null}export{z as TablePropertiesDialog};
|
|
@@ -2224,4 +2224,4 @@ declare const DEFAULT_AI_ACTIONS: AIAction[];
|
|
|
2224
2224
|
*/
|
|
2225
2225
|
declare function createCommand<T extends AgentCommand>(command: Omit<T, 'id'>): T;
|
|
2226
2226
|
|
|
2227
|
-
export { createRange as $, type AgentCommand as A, type BreakContent as B, type SectionProperties as C, type Document as D, type Endnote as E, type Footnote as F, type SelectionContext as G, type Hyperlink as H, type Image as I, type SetVariableCommand as J, type Style as K, type ListLevel as L, type StyleDefinitions as M, type NumberingDefinitions as N, type StyleInfo as O, type Position as P, type SuggestedAction as Q, type Range as R, type SectionInfo as S, type TextFormatting as T, type TableCell as U, type TableRow as V, type TextContent as W, type Theme as X, comparePositions as Y, createCollapsedRange as Z, createCommand as _, type Paragraph as a, getActionDescription as a0, getActionLabel as a1, isPositionInRange as a2, type BookmarkEnd as a3, type BookmarkStart as a4, type Field as a5, type FooterReference as a6, type HeaderFooter as a7, type HeaderReference as a8, type Shape as a9, type TextBox as aa, type ThemeColorScheme as ab, type ThemeFont as ac, type ThemeFontScheme as ad, type ColorValue as ae, type ThemeColorSlot as af, type ParagraphAlignment as ag, type StyleType as ah, type TabStop as ai, type
|
|
2227
|
+
export { createRange as $, type AgentCommand as A, type BreakContent as B, type SectionProperties as C, type Document as D, type Endnote as E, type Footnote as F, type SelectionContext as G, type Hyperlink as H, type Image as I, type SetVariableCommand as J, type Style as K, type ListLevel as L, type StyleDefinitions as M, type NumberingDefinitions as N, type StyleInfo as O, type Position as P, type SuggestedAction as Q, type Range as R, type SectionInfo as S, type TextFormatting as T, type TableCell as U, type TableRow as V, type TextContent as W, type Theme as X, comparePositions as Y, createCollapsedRange as Z, createCommand as _, type Paragraph as a, getActionDescription as a0, getActionLabel as a1, isPositionInRange as a2, type BookmarkEnd as a3, type BookmarkStart as a4, type Field as a5, type FooterReference as a6, type HeaderFooter as a7, type HeaderReference as a8, type Shape as a9, type TextBox as aa, type ThemeColorScheme as ab, type ThemeFont as ac, type ThemeFontScheme as ad, type ColorValue as ae, type ThemeColorSlot as af, type ParagraphAlignment as ag, type StyleType as ah, type TabStop as ai, type Run as b, type RunContent as c, type DocumentBody as d, type Table as e, type AIAction as f, type AIActionRequest as g, type AgentContext as h, type AgentResponse as i, type ApplyStyleCommand as j, type ApplyVariablesCommand as k, type BlockContent as l, DEFAULT_AI_ACTIONS as m, type DeleteTextCommand as n, type DocxPackage as o, type FormatParagraphCommand as p, type FormatTextCommand as q, type InsertHyperlinkCommand as r, type InsertImageCommand as s, type InsertTableCommand as t, type InsertTextCommand as u, type ParagraphContext as v, type ParagraphFormatting as w, type ParagraphOutline as x, type Relationship as y, type ReplaceTextCommand as z };
|
|
@@ -2224,4 +2224,4 @@ declare const DEFAULT_AI_ACTIONS: AIAction[];
|
|
|
2224
2224
|
*/
|
|
2225
2225
|
declare function createCommand<T extends AgentCommand>(command: Omit<T, 'id'>): T;
|
|
2226
2226
|
|
|
2227
|
-
export { createRange as $, type AgentCommand as A, type BreakContent as B, type SectionProperties as C, type Document as D, type Endnote as E, type Footnote as F, type SelectionContext as G, type Hyperlink as H, type Image as I, type SetVariableCommand as J, type Style as K, type ListLevel as L, type StyleDefinitions as M, type NumberingDefinitions as N, type StyleInfo as O, type Position as P, type SuggestedAction as Q, type Range as R, type SectionInfo as S, type TextFormatting as T, type TableCell as U, type TableRow as V, type TextContent as W, type Theme as X, comparePositions as Y, createCollapsedRange as Z, createCommand as _, type Paragraph as a, getActionDescription as a0, getActionLabel as a1, isPositionInRange as a2, type BookmarkEnd as a3, type BookmarkStart as a4, type Field as a5, type FooterReference as a6, type HeaderFooter as a7, type HeaderReference as a8, type Shape as a9, type TextBox as aa, type ThemeColorScheme as ab, type ThemeFont as ac, type ThemeFontScheme as ad, type ColorValue as ae, type ThemeColorSlot as af, type ParagraphAlignment as ag, type StyleType as ah, type TabStop as ai, type
|
|
2227
|
+
export { createRange as $, type AgentCommand as A, type BreakContent as B, type SectionProperties as C, type Document as D, type Endnote as E, type Footnote as F, type SelectionContext as G, type Hyperlink as H, type Image as I, type SetVariableCommand as J, type Style as K, type ListLevel as L, type StyleDefinitions as M, type NumberingDefinitions as N, type StyleInfo as O, type Position as P, type SuggestedAction as Q, type Range as R, type SectionInfo as S, type TextFormatting as T, type TableCell as U, type TableRow as V, type TextContent as W, type Theme as X, comparePositions as Y, createCollapsedRange as Z, createCommand as _, type Paragraph as a, getActionDescription as a0, getActionLabel as a1, isPositionInRange as a2, type BookmarkEnd as a3, type BookmarkStart as a4, type Field as a5, type FooterReference as a6, type HeaderFooter as a7, type HeaderReference as a8, type Shape as a9, type TextBox as aa, type ThemeColorScheme as ab, type ThemeFont as ac, type ThemeFontScheme as ad, type ColorValue as ae, type ThemeColorSlot as af, type ParagraphAlignment as ag, type StyleType as ah, type TabStop as ai, type Run as b, type RunContent as c, type DocumentBody as d, type Table as e, type AIAction as f, type AIActionRequest as g, type AgentContext as h, type AgentResponse as i, type ApplyStyleCommand as j, type ApplyVariablesCommand as k, type BlockContent as l, DEFAULT_AI_ACTIONS as m, type DeleteTextCommand as n, type DocxPackage as o, type FormatParagraphCommand as p, type FormatTextCommand as q, type InsertHyperlinkCommand as r, type InsertImageCommand as s, type InsertTableCommand as t, type InsertTextCommand as u, type ParagraphContext as v, type ParagraphFormatting as w, type ParagraphOutline as x, type Relationship as y, type ReplaceTextCommand as z };
|