wordinweb 0.1.9 → 0.1.10
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 +43 -0
- package/dist/index.d.ts +28 -2
- package/dist/index.js +1261 -209
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -198,6 +198,24 @@ Every color the chrome paints — the toolbar, comment cards, selection, caret,
|
|
|
198
198
|
| `--dxw-layout-menu-width` | `304px` | Layout option-menu width |
|
|
199
199
|
| `--dxw-layout-menu-max-height` | `480px` | Layout option-menu scroll limit |
|
|
200
200
|
| `--dxw-layout-preview-bg` | `#fff` | Paper fill in Layout option previews |
|
|
201
|
+
| `--dxw-select-height` | `26px` | Custom select trigger height |
|
|
202
|
+
| `--dxw-select-border` | `transparent` | Custom select trigger border color |
|
|
203
|
+
| `--dxw-select-radius` | `4px` | Custom select trigger corner radius |
|
|
204
|
+
| `--dxw-select-bg` | `transparent` | Custom select trigger fill |
|
|
205
|
+
| `--dxw-select-fg` | toolbar foreground | Custom select trigger text |
|
|
206
|
+
| `--dxw-select-font` | `13px system-ui` | Custom select trigger font |
|
|
207
|
+
| `--dxw-select-padding` | `0 6px` | Custom select trigger padding |
|
|
208
|
+
| `--dxw-select-menu-bg` | popover background | Custom select menu fill |
|
|
209
|
+
| `--dxw-select-menu-border` | toolbar border | Custom select menu border color |
|
|
210
|
+
| `--dxw-select-menu-radius` | `8px` | Custom select menu corner radius |
|
|
211
|
+
| `--dxw-select-menu-shadow` | popover shadow | Custom select menu shadow |
|
|
212
|
+
| `--dxw-select-menu-max-height` | `320px` | Custom select menu scroll limit |
|
|
213
|
+
| `--dxw-color-menu-width` | `236px` | Text and drawing color palette width |
|
|
214
|
+
| `--dxw-dialog-backdrop` | `rgba(32,33,36,.38)` | Editor dialog scrim |
|
|
215
|
+
| `--dxw-dialog-z-index` | `1000` | Editor dialog stacking level |
|
|
216
|
+
| `--dxw-dialog-width` | `420px` | Editor dialog width |
|
|
217
|
+
| `--dxw-dialog-radius` | `10px` | Editor dialog corner radius |
|
|
218
|
+
| `--dxw-dialog-field-bg` | popover background | Editor dialog field fill |
|
|
201
219
|
| `--dxw-canvas-bg` | `#e8eaed` | Scroll area behind the pages |
|
|
202
220
|
| `--dxw-page-bg` | `#ffffff` | Page paper |
|
|
203
221
|
| `--dxw-page-shadow` | `0 1px 3px …, 0 4px 14px …` | Page drop shadow |
|
|
@@ -238,6 +256,31 @@ Or in a stylesheet:
|
|
|
238
256
|
.dxw-dark { --dxw-toolbar-bg: #1f2937; --dxw-toolbar-fg: #e5e7eb; /* … */ }
|
|
239
257
|
```
|
|
240
258
|
|
|
259
|
+
### Custom menus and dialogs
|
|
260
|
+
|
|
261
|
+
All visible toolbar choices use WordInWeb-rendered controls rather than the
|
|
262
|
+
browser's native select, prompt, or color-picker UI. `ToolbarMenuSelect` is
|
|
263
|
+
exported for host-app controls that should match the toolbar:
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
<ToolbarMenuSelect
|
|
267
|
+
value={zoom}
|
|
268
|
+
ariaLabel="Document zoom"
|
|
269
|
+
options={[
|
|
270
|
+
{ value: "0.75", label: "75%" },
|
|
271
|
+
{ value: "1", label: "100%" },
|
|
272
|
+
{ value: "1.25", label: "125%" },
|
|
273
|
+
]}
|
|
274
|
+
onChange={setZoom}
|
|
275
|
+
/>
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
For selector-level styling, the stable hooks are
|
|
279
|
+
`.dxw-menu-select-trigger`, `.dxw-menu-select-menu`,
|
|
280
|
+
`.dxw-menu-select-option`, `.dxw-color-menu`, `.dxw-color-swatch`,
|
|
281
|
+
`.dxw-input-dialog`, `.dxw-input-dialog-field`, and the dialog action button
|
|
282
|
+
classes. Prefer the variables above for theme changes.
|
|
283
|
+
|
|
241
284
|
Layout controls also expose stable `.dxw-layout-ribbon`, `.dxw-layout-menu-trigger`,
|
|
242
285
|
`.dxw-layout-menu`, `.dxw-layout-menu-item`, and `.dxw-layout-preview` classes.
|
|
243
286
|
Their `data-dxw-layout-menu`, `data-dxw-layout-option`, and
|
package/dist/index.d.ts
CHANGED
|
@@ -753,6 +753,8 @@ interface NoteRefContent {
|
|
|
753
753
|
noteType: "footnote" | "endnote";
|
|
754
754
|
id: number;
|
|
755
755
|
self?: boolean;
|
|
756
|
+
/** The document supplies the visible mark in the following run content. */
|
|
757
|
+
customMarkFollows?: boolean;
|
|
756
758
|
}
|
|
757
759
|
/** w:ruby — an East-Asian ruby (furigana) cluster: an annotation run (w:rt)
|
|
758
760
|
* riding above a base run (w:rubyBase). Both sides render as their own runs;
|
|
@@ -1943,7 +1945,7 @@ interface SelectionFormat {
|
|
|
1943
1945
|
verticalAlign?: "superscript" | "subscript";
|
|
1944
1946
|
}
|
|
1945
1947
|
|
|
1946
|
-
type ShapePreset = "rectangle" | "roundedRectangle" | "ellipse" | "diamond" | "textBox";
|
|
1948
|
+
type ShapePreset = "line" | "rectangle" | "roundedRectangle" | "ellipse" | "diamond" | "textBox";
|
|
1947
1949
|
type WordArtPreset = "plain" | "archUp" | "archDown" | "wave" | "chevron";
|
|
1948
1950
|
type DrawingTool = {
|
|
1949
1951
|
kind?: "pen";
|
|
@@ -2027,6 +2029,30 @@ interface MissingFont {
|
|
|
2027
2029
|
sample: string;
|
|
2028
2030
|
}
|
|
2029
2031
|
|
|
2032
|
+
interface ToolbarMenuSelectOption {
|
|
2033
|
+
value: string;
|
|
2034
|
+
label: React.ReactNode;
|
|
2035
|
+
group?: string;
|
|
2036
|
+
disabled?: boolean;
|
|
2037
|
+
fontFamily?: string;
|
|
2038
|
+
}
|
|
2039
|
+
interface ToolbarMenuSelectProps {
|
|
2040
|
+
value: string;
|
|
2041
|
+
options: ToolbarMenuSelectOption[];
|
|
2042
|
+
onChange: (value: string) => void;
|
|
2043
|
+
placeholder?: React.ReactNode;
|
|
2044
|
+
title?: string;
|
|
2045
|
+
ariaLabel?: string;
|
|
2046
|
+
triggerAriaLabel?: string;
|
|
2047
|
+
width?: number | string;
|
|
2048
|
+
menuWidth?: number;
|
|
2049
|
+
className?: string;
|
|
2050
|
+
style?: React.CSSProperties;
|
|
2051
|
+
}
|
|
2052
|
+
/** CSS-overridable replacement for visible native selects. An inert,
|
|
2053
|
+
* transparent select is kept as an event bridge for existing integrations;
|
|
2054
|
+
* every user-facing part is a button/listbox rendered by us. */
|
|
2055
|
+
declare function ToolbarMenuSelect({ value, options, onChange, placeholder, title, ariaLabel, triggerAriaLabel, width, menuWidth, className, style, }: ToolbarMenuSelectProps): react.JSX.Element;
|
|
2030
2056
|
/** Toolbar control groups a host can disable via the `features` prop. */
|
|
2031
2057
|
type ToolbarFeature = "history" | "styles" | "font" | "size" | "format" | "color" | "highlight" | "alignment" | "indent" | "spacing" | "link" | "lists" | "table" | "image" | "icon" | "screenshot" | "model3D" | "media" | "object" | "chart" | "smartArt" | "comment" | "footnote" | "bookmark" | "crossReference" | "dateTime" | "field" | "equation" | "symbol" | "shape" | "textBox" | "wordArt" | "drawing" | "arrange" | "dropCap" | "headerFooter" | "coverPage" | "pageNumber" | "break" | "layout" | "download";
|
|
2032
2058
|
type ToolbarMode = "simple" | "advanced";
|
|
@@ -2250,4 +2276,4 @@ interface DocxViewProps {
|
|
|
2250
2276
|
*/
|
|
2251
2277
|
declare function DocxView({ source, zoom, fitWidth, narrowWidth, editable, className, style, onLoad, onReady, onError, commentAuthor, showComments, revisions, onMissingFonts, }: DocxViewProps): react.JSX.Element;
|
|
2252
2278
|
|
|
2253
|
-
export { type CoverPageContent, DocxDocument, DocxToolbar, type DocxToolbarProps, DocxView, type DocxViewApi, type DocxViewProps, type DrawingTool, type LineNumberingPatch, type PageLayoutPatch, type ParagraphAlignment, type RunFormatPatch, type ScreenshotInsertResult, type SelectionFormat, type ShapePreset, type ToolbarFeature, type ToolbarMode, layoutDocument, printPages, renderToDom };
|
|
2279
|
+
export { type CoverPageContent, DocxDocument, DocxToolbar, type DocxToolbarProps, DocxView, type DocxViewApi, type DocxViewProps, type DrawingTool, type LineNumberingPatch, type PageLayoutPatch, type ParagraphAlignment, type RunFormatPatch, type ScreenshotInsertResult, type SelectionFormat, type ShapePreset, type ToolbarFeature, ToolbarMenuSelect, type ToolbarMenuSelectOption, type ToolbarMenuSelectProps, type ToolbarMode, layoutDocument, printPages, renderToDom };
|