Fix App.jsx two-page workflow JSX render and update study app layout

This commit is contained in:
nmemmert
2026-05-26 17:14:30 -04:00
commit f47a41ce6f
4459 changed files with 1059845 additions and 0 deletions
Generated Vendored
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Dolan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+124
View File
@@ -0,0 +1,124 @@
<p align="center">
<img src="./logo/logo-animate.svg" width="100%" height="300" alt="clippy the assistant">
</p>
<p align="center">
Easily generate and modify .docx files with JS/TS. Works for Node and on the Browser.
</p>
---
[![NPM version][npm-image]][npm-url]
[![Downloads per month][downloads-image]][downloads-url]
[![GitHub Action Workflow Status][github-actions-workflow-image]][github-actions-workflow-url]
[![Known Vulnerabilities][snky-image]][snky-url]
[![PRs Welcome][pr-image]][pr-url]
[![codecov][codecov-image]][codecov-url]
[![Docx.js Editor][docxjs-editor-image]][docxjs-editor-url]
<p align="center">
<img src="https://i.imgur.com/QeL1HuU.png" alt="drawing"/>
</p>
# Demo
## Browser
Here are examples of `docx` being used with basic `HTML/JS` in a browser environment:
- https://codepen.io/dolanmiu/pen/RwNeObg
- https://jsfiddle.net/dolanmiu/onadx1gu/
Here are examples of `docx` working in `Angular`:
- https://stackblitz.com/edit/angular-docx
- https://stackblitz.com/edit/angular-wmd6k3
Here are examples of `docx` working in `React`:
- https://stackblitz.com/edit/react-docx
- https://stackblitz.com/edit/react-docx-images (adding images to Word Document)
Here is an example of `docx` working in `Vue.js`:
- https://stackblitz.com/edit/vuejs-docx
## Node
Press `endpoint` on the `RunKit` website:
![RunKit Instructions](https://user-images.githubusercontent.com/2917613/38582539-f84311b6-3d07-11e8-90db-5885ae02c3c4.png)
- https://runkit.com/dolanmiu/docx-demo1 - Simple paragraph and text
- https://runkit.com/dolanmiu/docx-demo2 - Advanced Paragraphs and text
- https://runkit.com/dolanmiu/docx-demo3 - Bullet points
- https://runkit.com/dolanmiu/docx-demo4 - Simple table
- https://runkit.com/dolanmiu/docx-demo5 - Images
- https://runkit.com/dolanmiu/docx-demo6 - Margins
- https://runkit.com/dolanmiu/docx-demo7 - Landscape
- https://runkit.com/dolanmiu/docx-demo8 - Header and Footer
- https://runkit.com/dolanmiu/docx-demo10 - **My CV generated with docx**
More [here](https://github.com/dolanmiu/docx/tree/master/demo)
# How to use & Documentation
Please refer to the [documentation at https://docx.js.org/](https://docx.js.org/) for details on how to use this library, examples and much more!
# Playground
Experience `docx` in action through [Docx.js Editor][docxjs-editor-url], an interactive playground where you can code and preview the results in real-time.
# Examples
Check the [demo folder](https://github.com/dolanmiu/docx/tree/master/demo) for examples.
# Contributing
Read the contribution guidelines [here](https://docx.js.org/#/contribution-guidelines).
# Used by
[<img src="https://i.imgur.com/zy5qWmI.png" alt="drawing" height="50"/>](https://hfour.com/)
[<img src="https://i.imgur.com/OYP5tgS.png" alt="drawing" height="50"/>](https://fuzzproductions.com/)
[<img src="https://i.imgur.com/zUDMfZ3.png" alt="drawing" height="50"/>](https://www.mettzer.com/)
[<img src="https://i.imgur.com/wtNB1uq.png" alt="drawing" height="50"/>](https://www.wisedoc.net/)
[<img src="https://i.imgur.com/suiH2zc.png" alt="drawing" height="50"/>](https://www.dabblewriter.com/)
[<img src="https://i.imgur.com/1LjuK2M.png" alt="drawing" height="50"/>](https://turbopatent.com/)
[<img src="https://i.imgur.com/dHMg0wF.gif" alt="drawing" height="50"/>](http://www.madisoncres.com/)
[<img src="https://i.imgur.com/QEZXU5b.png" alt="drawing" height="50"/>](https://www.beekast.com/)
[<img src="https://i.imgur.com/XVU6aoi.png" alt="drawing" height="50"/>](https://herraizsoto.com/)
[<img src="https://i.imgur.com/fn1xccG.png" alt="drawing" height="50"/>](http://www.ativer.com.br/)
[<img src="https://i.imgur.com/cmykN7c.png" alt="drawing"/>](https://www.arity.co/)
[<img src="https://i.imgur.com/PXo25um.png" alt="drawing" height="50"/>](https://www.circadianrisk.com/)
[<img src="https://i.imgur.com/AKGhtlh.png" alt="drawing"/>](https://lexense.com/)
[<img src="https://i.imgur.com/9tqJaHw.png" alt="drawing" height="50"/>](https://novelpad.co/)
[<img src="https://i.imgur.com/5bLKFeP.png" alt="drawing" height="50"/>](https://proton.me/)
...and many more!
---
[![patreon][patreon-image]][patreon-url]
[![browserstack][browserstack-image]][browserstack-url]
Made with 💖
[npm-image]: https://badge.fury.io/js/docx.svg
[npm-url]: https://npmjs.org/package/docx
[downloads-image]: https://img.shields.io/npm/dm/docx.svg
[downloads-url]: https://npmjs.org/package/docx
[github-actions-workflow-image]: https://github.com/dolanmiu/docx/workflows/Default/badge.svg?branch=master
[github-actions-workflow-url]: https://github.com/dolanmiu/docx/actions
[snky-image]: https://snyk.io/test/github/dolanmiu/docx/badge.svg
[snky-url]: https://snyk.io/test/github/dolanmiu/docx
[pr-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[pr-url]: http://makeapullrequest.com
[codecov-image]: https://codecov.io/gh/dolanmiu/docx/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/dolanmiu/docx
[patreon-image]: https://user-images.githubusercontent.com/2917613/51251459-4e880480-1991-11e9-92bf-38b96675a9e2.png
[patreon-url]: https://www.patreon.com/dolanmiu
[browserstack-image]: https://user-images.githubusercontent.com/2917613/54233552-128e9d00-4505-11e9-88fb-025a4e04007c.png
[browserstack-url]: https://www.browserstack.com
[docxjs-editor-image]: https://img.shields.io/badge/Docx.js%20Editor-2b579a.svg?style=flat&amp;logo=javascript&amp;logoColor=white
[docxjs-editor-url]: https://docxjs-editor.vercel.app/
+4
View File
@@ -0,0 +1,4 @@
import { BaseXmlComponent, IContext, IXmlableObject } from '../file/xml-components';
export declare class Formatter {
format(input: BaseXmlComponent, context?: IContext): IXmlableObject;
}
+1
View File
@@ -0,0 +1 @@
export {};
+1
View File
@@ -0,0 +1 @@
export * from './packer/packer';
+5
View File
@@ -0,0 +1,5 @@
import { IMediaData, Media } from '../../file/media';
export declare class ImageReplacer {
replace(xmlData: string, mediaData: readonly IMediaData[], offset: number): string;
getMediaData(xmlData: string, media: Media): readonly IMediaData[];
}
+1
View File
@@ -0,0 +1 @@
export {};
+15
View File
@@ -0,0 +1,15 @@
import { default as JSZip } from 'jszip';
import { File } from '../../file/file';
import { PrettifyType } from './packer';
export type IXmlifyedFile = {
readonly data: string;
readonly path: string;
};
export declare class Compiler {
private readonly formatter;
private readonly imageReplacer;
private readonly numberingReplacer;
constructor();
compile(file: File, prettifyXml?: (typeof PrettifyType)[keyof typeof PrettifyType], overrides?: readonly IXmlifyedFile[]): JSZip;
private xmlifyFile;
}
+1
View File
@@ -0,0 +1 @@
export {};
+4
View File
@@ -0,0 +1,4 @@
import { ConcreteNumbering } from '../../file/numbering';
export declare class NumberingReplacer {
replace(xmlData: string, concreteNumberings: readonly ConcreteNumbering[]): string;
}
+20
View File
@@ -0,0 +1,20 @@
import { Stream } from 'stream';
import { File } from '../../file/file';
import { OutputByType, OutputType } from '../../util/output-type';
import { IXmlifyedFile } from './next-compiler';
export declare const PrettifyType: {
readonly NONE: "";
readonly WITH_2_BLANKS: " ";
readonly WITH_4_BLANKS: " ";
readonly WITH_TAB: "\t";
};
export declare class Packer {
static pack<T extends OutputType>(file: File, type: T, prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType], overrides?: readonly IXmlifyedFile[]): Promise<OutputByType[T]>;
static toString(file: File, prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType], overrides?: readonly IXmlifyedFile[]): Promise<string>;
static toBuffer(file: File, prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType], overrides?: readonly IXmlifyedFile[]): Promise<Buffer>;
static toBase64String(file: File, prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType], overrides?: readonly IXmlifyedFile[]): Promise<string>;
static toBlob(file: File, prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType], overrides?: readonly IXmlifyedFile[]): Promise<Blob>;
static toArrayBuffer(file: File, prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType], overrides?: readonly IXmlifyedFile[]): Promise<ArrayBuffer>;
static toStream(file: File, prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType], overrides?: readonly IXmlifyedFile[]): Stream;
private static readonly compiler;
}
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,10 @@
import { XmlAttributeComponent } from '../xml-components';
export declare class AppPropertiesAttributes extends XmlAttributeComponent<{
readonly xmlns: string;
readonly vt: string;
}> {
protected readonly xmlKeys: {
xmlns: string;
vt: string;
};
}
+4
View File
@@ -0,0 +1,4 @@
import { XmlComponent } from '../xml-components';
export declare class AppProperties extends XmlComponent {
constructor();
}
+37
View File
@@ -0,0 +1,37 @@
import { XmlComponent } from '../xml-components';
export type IBorderOptions = {
readonly style: (typeof BorderStyle)[keyof typeof BorderStyle];
readonly color?: string;
readonly size?: number;
readonly space?: number;
};
export declare const createBorderElement: (elementName: string, { color, size, space, style }: IBorderOptions) => XmlComponent;
export declare const BorderStyle: {
readonly SINGLE: "single";
readonly DASH_DOT_STROKED: "dashDotStroked";
readonly DASHED: "dashed";
readonly DASH_SMALL_GAP: "dashSmallGap";
readonly DOT_DASH: "dotDash";
readonly DOT_DOT_DASH: "dotDotDash";
readonly DOTTED: "dotted";
readonly DOUBLE: "double";
readonly DOUBLE_WAVE: "doubleWave";
readonly INSET: "inset";
readonly NIL: "nil";
readonly NONE: "none";
readonly OUTSET: "outset";
readonly THICK: "thick";
readonly THICK_THIN_LARGE_GAP: "thickThinLargeGap";
readonly THICK_THIN_MEDIUM_GAP: "thickThinMediumGap";
readonly THICK_THIN_SMALL_GAP: "thickThinSmallGap";
readonly THIN_THICK_LARGE_GAP: "thinThickLargeGap";
readonly THIN_THICK_MEDIUM_GAP: "thinThickMediumGap";
readonly THIN_THICK_SMALL_GAP: "thinThickSmallGap";
readonly THIN_THICK_THIN_LARGE_GAP: "thinThickThinLargeGap";
readonly THIN_THICK_THIN_MEDIUM_GAP: "thinThickThinMediumGap";
readonly THIN_THICK_THIN_SMALL_GAP: "thinThickThinSmallGap";
readonly THREE_D_EMBOSS: "threeDEmboss";
readonly THREE_D_ENGRAVE: "threeDEngrave";
readonly TRIPLE: "triple";
readonly WAVE: "wave";
};
+1
View File
@@ -0,0 +1 @@
export {};
+1
View File
@@ -0,0 +1 @@
export * from './border';
+4
View File
@@ -0,0 +1,4 @@
import { XmlComponent } from '../xml-components';
export declare class CheckBoxSymbolElement extends XmlComponent {
constructor(name: string, val: string, font?: string);
}
+17
View File
@@ -0,0 +1,17 @@
import { XmlComponent } from '../xml-components';
export type ICheckboxSymbolProperties = {
readonly value?: string;
readonly font?: string;
};
export type ICheckboxSymbolOptions = {
readonly alias?: string;
readonly checked?: boolean;
readonly checkedState?: ICheckboxSymbolProperties;
readonly uncheckedState?: ICheckboxSymbolProperties;
};
export declare class CheckBoxUtil extends XmlComponent {
private readonly DEFAULT_UNCHECKED_SYMBOL;
private readonly DEFAULT_CHECKED_SYMBOL;
private readonly DEFAULT_FONT;
constructor(options?: ICheckboxSymbolOptions);
}
+1
View File
@@ -0,0 +1 @@
export {};
+8
View File
@@ -0,0 +1,8 @@
import { XmlComponent } from '../xml-components';
import { ICheckboxSymbolOptions } from './checkbox-util';
export declare class CheckBox extends XmlComponent {
private readonly DEFAULT_UNCHECKED_SYMBOL;
private readonly DEFAULT_CHECKED_SYMBOL;
private readonly DEFAULT_FONT;
constructor(options?: ICheckboxSymbolOptions);
}
+1
View File
@@ -0,0 +1 @@
export {};
+3
View File
@@ -0,0 +1,3 @@
export * from './checkbox-util';
export * from './checkbox-symbol';
export * from './checkbox';
@@ -0,0 +1,8 @@
import { XmlAttributeComponent } from '../xml-components';
export declare class ContentTypeAttributes extends XmlAttributeComponent<{
readonly xmlns?: string;
}> {
protected readonly xmlKeys: {
xmlns: string;
};
}
+7
View File
@@ -0,0 +1,7 @@
import { XmlComponent } from '../xml-components';
export declare class ContentTypes extends XmlComponent {
constructor();
addCommentsExtended(): void;
addFooter(index: number): void;
addHeader(index: number): void;
}
+1
View File
@@ -0,0 +1 @@
export {};
+2
View File
@@ -0,0 +1,2 @@
import { XmlComponent } from '../../xml-components';
export declare const createDefault: (contentType: string, extension?: string) => XmlComponent;
+2
View File
@@ -0,0 +1,2 @@
import { XmlComponent } from '../../xml-components';
export declare const createOverride: (contentType: string, partName?: string) => XmlComponent;
+1
View File
@@ -0,0 +1 @@
export * from './properties';
+46
View File
@@ -0,0 +1,46 @@
import { FontOptions } from '../fonts/font-table';
import { ICommentsOptions } from '../paragraph/run/comment-run';
import { IHyphenationOptions } from '../settings';
import { ICompatibilityOptions } from '../settings/compatibility';
import { XmlComponent } from '../xml-components';
import { ICustomPropertyOptions } from '../custom-properties';
import { IDocumentBackgroundOptions } from '../document';
import { ISectionOptions } from '../file';
import { INumberingOptions } from '../numbering';
import { Paragraph } from '../paragraph';
import { IStylesOptions } from '../styles';
export type IPropertiesOptions = {
readonly sections: readonly ISectionOptions[];
readonly title?: string;
readonly subject?: string;
readonly creator?: string;
readonly keywords?: string;
readonly description?: string;
readonly lastModifiedBy?: string;
readonly revision?: number;
readonly externalStyles?: string;
readonly styles?: IStylesOptions;
readonly numbering?: INumberingOptions;
readonly comments?: ICommentsOptions;
readonly footnotes?: Readonly<Record<string, {
readonly children: readonly Paragraph[];
}>>;
readonly endnotes?: Readonly<Record<string, {
readonly children: readonly Paragraph[];
}>>;
readonly background?: IDocumentBackgroundOptions;
readonly features?: {
readonly trackRevisions?: boolean;
readonly updateFields?: boolean;
};
readonly compatabilityModeVersion?: number;
readonly compatibility?: ICompatibilityOptions;
readonly customProperties?: readonly ICustomPropertyOptions[];
readonly evenAndOddHeaderAndFooters?: boolean;
readonly defaultTabStop?: number;
readonly fonts?: readonly FontOptions[];
readonly hyphenation?: IHyphenationOptions;
};
export declare class CoreProperties extends XmlComponent {
constructor(options: Omit<IPropertiesOptions, "sections">);
}
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,10 @@
import { XmlAttributeComponent } from '../xml-components';
export declare class CustomPropertiesAttributes extends XmlAttributeComponent<{
readonly xmlns: string;
readonly vt: string;
}> {
protected readonly xmlKeys: {
xmlns: string;
vt: string;
};
}
+9
View File
@@ -0,0 +1,9 @@
import { IContext, IXmlableObject, XmlComponent } from '../xml-components';
import { ICustomPropertyOptions } from './custom-property';
export declare class CustomProperties extends XmlComponent {
private nextId;
private readonly properties;
constructor(properties: readonly ICustomPropertyOptions[]);
prepForXml(context: IContext): IXmlableObject | undefined;
addCustomProperty(property: ICustomPropertyOptions): void;
}
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,12 @@
import { XmlAttributeComponent } from '../xml-components';
export declare class CustomPropertyAttributes extends XmlAttributeComponent<{
readonly formatId: string;
readonly pid: string;
readonly name: string;
}> {
protected readonly xmlKeys: {
formatId: string;
pid: string;
name: string;
};
}
+11
View File
@@ -0,0 +1,11 @@
import { XmlComponent } from '../xml-components';
export type ICustomPropertyOptions = {
readonly name: string;
readonly value: string;
};
export declare class CustomProperty extends XmlComponent {
constructor(id: number, properties: ICustomPropertyOptions);
}
export declare class CustomPropertyValue extends XmlComponent {
constructor(value: string);
}
+2
View File
@@ -0,0 +1,2 @@
export * from './custom-properties';
export * from './custom-property';
+18
View File
@@ -0,0 +1,18 @@
import { Document, IDocumentOptions } from './document';
import { Endnotes } from './endnotes';
import { Footer } from './footer/footer';
import { FootNotes } from './footnotes';
import { Header } from './header/header';
import { Relationships } from './relationships';
import { XmlComponent } from './xml-components';
export type IViewWrapper = {
readonly View: Document | Footer | Header | FootNotes | Endnotes | XmlComponent;
readonly Relationships: Relationships;
};
export declare class DocumentWrapper implements IViewWrapper {
private readonly document;
private readonly relationships;
constructor(options: IDocumentOptions);
get View(): Document;
get Relationships(): Relationships;
}
+1
View File
@@ -0,0 +1 @@
export {};
+10
View File
@@ -0,0 +1,10 @@
import { IContext, IXmlableObject, XmlComponent } from '../../xml-components';
import { ISectionPropertiesOptions } from './section-properties/section-properties';
export declare class Body extends XmlComponent {
private readonly sections;
constructor();
addSection(options: ISectionPropertiesOptions): void;
prepForXml(context: IContext): IXmlableObject | undefined;
push(component: XmlComponent): void;
private createSectionParagraph;
}
+1
View File
@@ -0,0 +1 @@
export {};
+2
View File
@@ -0,0 +1,2 @@
export * from './body';
export * from './section-properties';
@@ -0,0 +1,2 @@
export * from './section-properties';
export * from './properties';
@@ -0,0 +1,9 @@
import { XmlComponent } from '../../../../xml-components';
import { PositiveUniversalMeasure } from '../../../../../util/values';
export type IColumnAttributes = {
readonly width: number | PositiveUniversalMeasure;
readonly space?: number | PositiveUniversalMeasure;
};
export declare class Column extends XmlComponent {
constructor(options: IColumnAttributes);
}
@@ -0,0 +1,11 @@
import { XmlComponent } from '../../../../xml-components';
import { PositiveUniversalMeasure } from '../../../../../util/values';
import { Column } from './column';
export type IColumnsAttributes = {
readonly space?: number | PositiveUniversalMeasure;
readonly count?: number;
readonly separate?: boolean;
readonly equalWidth?: boolean;
readonly children?: readonly Column[];
};
export declare const createColumns: ({ space, count, separate, equalWidth, children }: IColumnsAttributes) => XmlComponent;
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,13 @@
import { XmlComponent } from '../../../../xml-components';
export declare const DocumentGridType: {
readonly DEFAULT: "default";
readonly LINES: "lines";
readonly LINES_AND_CHARS: "linesAndChars";
readonly SNAP_TO_CHARS: "snapToChars";
};
export type IDocGridAttributesProperties = {
readonly type?: (typeof DocumentGridType)[keyof typeof DocumentGridType];
readonly linePitch: number;
readonly charSpace?: number;
};
export declare const createDocumentGrid: ({ type, linePitch, charSpace }: IDocGridAttributesProperties) => XmlComponent;
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,15 @@
import { XmlComponent } from '../../../../xml-components';
export declare const HeaderFooterReferenceType: {
readonly DEFAULT: "default";
readonly FIRST: "first";
readonly EVEN: "even";
};
export type IHeaderFooterOptions = {
readonly type?: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];
readonly id?: number;
};
export declare const HeaderFooterType: {
readonly HEADER: "w:headerReference";
readonly FOOTER: "w:footerReference";
};
export declare const createHeaderFooterReference: (type: (typeof HeaderFooterType)[keyof typeof HeaderFooterType], options: IHeaderFooterOptions) => XmlComponent;
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,12 @@
export * from './column';
export * from './columns';
export * from './doc-grid';
export * from './page-size';
export * from './page-number';
export * from './page-borders';
export * from './page-margin';
export * from './page-borders';
export * from './page-text-direction';
export * from './line-number';
export * from './section-type';
export * from './header-footer-reference';
@@ -0,0 +1,14 @@
import { XmlComponent } from '../../../../xml-components';
import { PositiveUniversalMeasure } from '../../../../../util/values';
export declare const LineNumberRestartFormat: {
readonly NEW_PAGE: "newPage";
readonly NEW_SECTION: "newSection";
readonly CONTINUOUS: "continuous";
};
export type ILineNumberAttributes = {
readonly countBy?: number;
readonly start?: number;
readonly restart?: (typeof LineNumberRestartFormat)[keyof typeof LineNumberRestartFormat];
readonly distance?: number | PositiveUniversalMeasure;
};
export declare const createLineNumberType: ({ countBy, start, restart, distance }: ILineNumberAttributes) => XmlComponent;
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,30 @@
import { IBorderOptions } from '../../../../border';
import { IgnoreIfEmptyXmlComponent } from '../../../../xml-components';
export declare const PageBorderDisplay: {
readonly ALL_PAGES: "allPages";
readonly FIRST_PAGE: "firstPage";
readonly NOT_FIRST_PAGE: "notFirstPage";
};
export declare const PageBorderOffsetFrom: {
readonly PAGE: "page";
readonly TEXT: "text";
};
export declare const PageBorderZOrder: {
readonly BACK: "back";
readonly FRONT: "front";
};
export type IPageBorderAttributes = {
readonly display?: (typeof PageBorderDisplay)[keyof typeof PageBorderDisplay];
readonly offsetFrom?: (typeof PageBorderOffsetFrom)[keyof typeof PageBorderOffsetFrom];
readonly zOrder?: (typeof PageBorderZOrder)[keyof typeof PageBorderZOrder];
};
export type IPageBordersOptions = {
readonly pageBorders?: IPageBorderAttributes;
readonly pageBorderTop?: IBorderOptions;
readonly pageBorderRight?: IBorderOptions;
readonly pageBorderBottom?: IBorderOptions;
readonly pageBorderLeft?: IBorderOptions;
};
export declare class PageBorders extends IgnoreIfEmptyXmlComponent {
constructor(options?: IPageBordersOptions);
}
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,12 @@
import { XmlComponent } from '../../../../xml-components';
import { PositiveUniversalMeasure, UniversalMeasure } from '../../../../../util/values';
export type IPageMarginAttributes = {
readonly top?: number | UniversalMeasure;
readonly right?: number | PositiveUniversalMeasure;
readonly bottom?: number | UniversalMeasure;
readonly left?: number | PositiveUniversalMeasure;
readonly header?: number | PositiveUniversalMeasure;
readonly footer?: number | PositiveUniversalMeasure;
readonly gutter?: number | PositiveUniversalMeasure;
};
export declare const createPageMargin: (top: number | UniversalMeasure, right: number | PositiveUniversalMeasure, bottom: number | UniversalMeasure, left: number | PositiveUniversalMeasure, header: number | PositiveUniversalMeasure, footer: number | PositiveUniversalMeasure, gutter: number | PositiveUniversalMeasure) => XmlComponent;
@@ -0,0 +1,15 @@
import { NumberFormat } from '../../../../shared/number-format';
import { XmlComponent } from '../../../../xml-components';
export declare const PageNumberSeparator: {
readonly HYPHEN: "hyphen";
readonly PERIOD: "period";
readonly COLON: "colon";
readonly EM_DASH: "emDash";
readonly EN_DASH: "endash";
};
export type IPageNumberTypeAttributes = {
readonly start?: number;
readonly formatType?: (typeof NumberFormat)[keyof typeof NumberFormat];
readonly separator?: (typeof PageNumberSeparator)[keyof typeof PageNumberSeparator];
};
export declare const createPageNumberType: ({ start, formatType, separator }: IPageNumberTypeAttributes) => XmlComponent;
@@ -0,0 +1,13 @@
import { XmlComponent } from '../../../../xml-components';
import { PositiveUniversalMeasure } from '../../../../../util/values';
export declare const PageOrientation: {
readonly PORTRAIT: "portrait";
readonly LANDSCAPE: "landscape";
};
export type IPageSizeAttributes = {
readonly width: number | PositiveUniversalMeasure;
readonly height: number | PositiveUniversalMeasure;
readonly orientation?: (typeof PageOrientation)[keyof typeof PageOrientation];
readonly code?: number;
};
export declare const createPageSize: ({ width, height, orientation, code }: IPageSizeAttributes) => XmlComponent;
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,8 @@
import { XmlComponent } from '../../../../xml-components';
export declare const PageTextDirectionType: {
readonly LEFT_TO_RIGHT_TOP_TO_BOTTOM: "lrTb";
readonly TOP_TO_BOTTOM_RIGHT_TO_LEFT: "tbRl";
};
export declare class PageTextDirection extends XmlComponent {
constructor(value: (typeof PageTextDirectionType)[keyof typeof PageTextDirectionType]);
}
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,9 @@
import { XmlComponent } from '../../../../xml-components';
export declare const SectionType: {
readonly NEXT_PAGE: "nextPage";
readonly NEXT_COLUMN: "nextColumn";
readonly CONTINUOUS: "continuous";
readonly EVEN_PAGE: "evenPage";
readonly ODD_PAGE: "oddPage";
};
export declare const createSectionType: (value: (typeof SectionType)[keyof typeof SectionType]) => XmlComponent;
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,61 @@
import { FooterWrapper } from '../../../footer-wrapper';
import { HeaderWrapper } from '../../../header-wrapper';
import { IChangedAttributesProperties } from '../../../track-revision/track-revision';
import { SectionVerticalAlign } from '../../../vertical-align';
import { XmlComponent } from '../../../xml-components';
import { IColumnsAttributes } from './properties/columns';
import { IDocGridAttributesProperties } from './properties/doc-grid';
import { ILineNumberAttributes } from './properties/line-number';
import { IPageBordersOptions } from './properties/page-borders';
import { IPageMarginAttributes } from './properties/page-margin';
import { IPageNumberTypeAttributes } from './properties/page-number';
import { IPageSizeAttributes } from './properties/page-size';
import { PageTextDirectionType } from './properties/page-text-direction';
import { SectionType } from './properties/section-type';
export type IHeaderFooterGroup<T> = {
readonly default?: T;
readonly first?: T;
readonly even?: T;
};
export type ISectionPropertiesOptionsBase = {
readonly page?: {
readonly size?: Partial<IPageSizeAttributes>;
readonly margin?: IPageMarginAttributes;
readonly pageNumbers?: IPageNumberTypeAttributes;
readonly borders?: IPageBordersOptions;
readonly textDirection?: (typeof PageTextDirectionType)[keyof typeof PageTextDirectionType];
};
readonly grid?: Partial<IDocGridAttributesProperties>;
readonly headerWrapperGroup?: IHeaderFooterGroup<HeaderWrapper>;
readonly footerWrapperGroup?: IHeaderFooterGroup<FooterWrapper>;
readonly lineNumbers?: ILineNumberAttributes;
readonly titlePage?: boolean;
readonly verticalAlign?: SectionVerticalAlign;
readonly column?: IColumnsAttributes;
readonly type?: (typeof SectionType)[keyof typeof SectionType];
};
export type ISectionPropertiesChangeOptions = IChangedAttributesProperties & ISectionPropertiesOptionsBase;
export type ISectionPropertiesOptions = {
readonly revision?: ISectionPropertiesChangeOptions;
} & ISectionPropertiesOptionsBase;
export declare const sectionMarginDefaults: {
TOP: number;
RIGHT: number;
BOTTOM: number;
LEFT: number;
HEADER: number;
FOOTER: number;
GUTTER: number;
};
export declare const sectionPageSizeDefaults: {
WIDTH: number;
HEIGHT: number;
ORIENTATION: "portrait";
};
export declare class SectionProperties extends XmlComponent {
constructor({ page: { size: { width, height, orientation, code, }, margin: { top, right, bottom, left, header, footer, gutter, }, pageNumbers, borders, textDirection, }, grid: { linePitch, charSpace, type: gridType }, headerWrapperGroup, footerWrapperGroup, lineNumbers, titlePage, verticalAlign, column, type, revision, }?: ISectionPropertiesOptions);
private addHeaderFooterGroup;
}
export declare class SectionPropertiesChange extends XmlComponent {
constructor(options: ISectionPropertiesChangeOptions);
}
@@ -0,0 +1 @@
export {};
+48
View File
@@ -0,0 +1,48 @@
import { AttributeMap, XmlAttributeComponent } from '../xml-components';
export declare const DocumentAttributeNamespaces: {
wpc: string;
mc: string;
o: string;
r: string;
m: string;
v: string;
wp14: string;
wp: string;
w10: string;
w: string;
w14: string;
w15: string;
wpg: string;
wpi: string;
wne: string;
wps: string;
cp: string;
dc: string;
dcterms: string;
dcmitype: string;
xsi: string;
cx: string;
cx1: string;
cx2: string;
cx3: string;
cx4: string;
cx5: string;
cx6: string;
cx7: string;
cx8: string;
aink: string;
am3d: string;
w16cex: string;
w16cid: string;
w16: string;
w16sdtdh: string;
w16se: string;
};
export type DocumentAttributeNamespace = keyof typeof DocumentAttributeNamespaces;
export type IDocumentAttributesProperties = Partial<Record<DocumentAttributeNamespace, string>> & {
readonly Ignorable?: string;
};
export declare class DocumentAttributes extends XmlAttributeComponent<IDocumentAttributesProperties> {
protected readonly xmlKeys: AttributeMap<IDocumentAttributesProperties>;
constructor(ns: readonly DocumentAttributeNamespace[], Ignorable?: string);
}
@@ -0,0 +1,23 @@
import { XmlAttributeComponent, XmlComponent } from '../../xml-components';
export declare class DocumentBackgroundAttributes extends XmlAttributeComponent<{
readonly color?: string;
readonly themeColor?: string;
readonly themeShade?: string;
readonly themeTint?: string;
}> {
protected readonly xmlKeys: {
color: string;
themeColor: string;
themeShade: string;
themeTint: string;
};
}
export type IDocumentBackgroundOptions = {
readonly color?: string;
readonly themeColor?: string;
readonly themeShade?: string;
readonly themeTint?: string;
};
export declare class DocumentBackground extends XmlComponent {
constructor(options: IDocumentBackgroundOptions);
}
@@ -0,0 +1 @@
export {};
+1
View File
@@ -0,0 +1 @@
export * from './document-background';
+15
View File
@@ -0,0 +1,15 @@
import { XmlComponent } from '../xml-components';
import { ConcreteHyperlink, Paragraph } from '../paragraph';
import { Table } from '../table';
import { TableOfContents } from '../table-of-contents';
import { Body } from './body';
import { IDocumentBackgroundOptions } from './document-background';
export type IDocumentOptions = {
readonly background?: IDocumentBackgroundOptions;
};
export declare class Document extends XmlComponent {
private readonly body;
constructor(options: IDocumentOptions);
add(item: Paragraph | Table | TableOfContents | ConcreteHyperlink): Document;
get Body(): Body;
}
+1
View File
@@ -0,0 +1 @@
export {};
+4
View File
@@ -0,0 +1,4 @@
export * from './document';
export * from './document-attributes';
export * from './body';
export * from './document-background';
+24
View File
@@ -0,0 +1,24 @@
import { XmlAttributeComponent } from '../../xml-components';
import { IDistance } from '../drawing';
export type IAnchorAttributes = {
readonly allowOverlap?: "0" | "1";
readonly behindDoc?: "0" | "1";
readonly layoutInCell?: "0" | "1";
readonly locked?: "0" | "1";
readonly relativeHeight?: number;
readonly simplePos?: "0" | "1";
} & IDistance;
export declare class AnchorAttributes extends XmlAttributeComponent<IAnchorAttributes> {
protected readonly xmlKeys: {
distT: string;
distB: string;
distL: string;
distR: string;
allowOverlap: string;
behindDoc: string;
layoutInCell: string;
locked: string;
relativeHeight: string;
simplePos: string;
};
}
+10
View File
@@ -0,0 +1,10 @@
import { IExtendedMediaData, IMediaDataTransformation } from '../../media';
import { XmlComponent } from '../../xml-components';
import { IDrawingOptions } from '../drawing';
export declare class Anchor extends XmlComponent {
constructor({ mediaData, transform, drawingOptions, }: {
readonly mediaData: IExtendedMediaData;
readonly transform: IMediaDataTransformation;
readonly drawingOptions: IDrawingOptions;
});
}
+1
View File
@@ -0,0 +1 @@
export {};
+2
View File
@@ -0,0 +1,2 @@
export * from './anchor';
export * from './anchor-attributes';
@@ -0,0 +1,3 @@
import { XmlComponent } from '../../xml-components';
export declare const createHyperlinkClick: (linkId: string, hasXmlNs: boolean) => XmlComponent;
export declare const createHyperlinkHover: (linkId: string, hasXmlNs: boolean) => XmlComponent;
@@ -0,0 +1 @@
export {};
+12
View File
@@ -0,0 +1,12 @@
import { IContext, IXmlableObject, XmlComponent } from '../../xml-components';
export type DocPropertiesOptions = {
readonly name: string;
readonly description?: string;
readonly title?: string;
readonly id?: string;
};
export declare class DocProperties extends XmlComponent {
private readonly docPropertiesUniqueNumericId;
constructor({ name, description, title, id }?: DocPropertiesOptions);
prepForXml(context: IContext): IXmlableObject | undefined;
}
@@ -0,0 +1 @@
export {};
+21
View File
@@ -0,0 +1,21 @@
import { IExtendedMediaData } from '../media';
import { XmlComponent } from '../xml-components';
import { DocPropertiesOptions } from './doc-properties/doc-properties';
import { IFloating } from './floating';
import { OutlineOptions } from './inline/graphic/graphic-data/pic/shape-properties/outline/outline';
import { SolidFillOptions } from './inline/graphic/graphic-data/pic/shape-properties/outline/solid-fill';
export type IDistance = {
readonly distT?: number;
readonly distB?: number;
readonly distL?: number;
readonly distR?: number;
};
export type IDrawingOptions = {
readonly floating?: IFloating;
readonly docProperties?: DocPropertiesOptions;
readonly outline?: OutlineOptions;
readonly solidFill?: SolidFillOptions;
};
export declare class Drawing extends XmlComponent {
constructor(imageData: IExtendedMediaData, drawingOptions?: IDrawingOptions);
}
+1
View File
@@ -0,0 +1 @@
export {};
+8
View File
@@ -0,0 +1,8 @@
import { XmlComponent } from '../../xml-components';
export type EffectExtentAttributes = {
readonly top: number;
readonly right: number;
readonly bottom: number;
readonly left: number;
};
export declare const createEffectExtent: ({ top, right, bottom, left }: EffectExtentAttributes) => XmlComponent;
+7
View File
@@ -0,0 +1,7 @@
import { XmlComponent } from '../../xml-components';
type ExtentAttributes = {
readonly x?: number;
readonly y?: number;
};
export declare const createExtent: ({ x, y }: ExtentAttributes) => XmlComponent;
export {};
+3
View File
@@ -0,0 +1,3 @@
import { HorizontalPositionAlign, VerticalPositionAlign } from '../../shared/alignment';
import { XmlComponent } from '../../xml-components';
export declare const createAlign: (value: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign] | (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign]) => XmlComponent;
+1
View File
@@ -0,0 +1 @@
export {};
+49
View File
@@ -0,0 +1,49 @@
import { HorizontalPositionAlign, VerticalPositionAlign } from '../../shared/alignment';
import { ITextWrapping } from '../text-wrap';
export declare const HorizontalPositionRelativeFrom: {
readonly CHARACTER: "character";
readonly COLUMN: "column";
readonly INSIDE_MARGIN: "insideMargin";
readonly LEFT_MARGIN: "leftMargin";
readonly MARGIN: "margin";
readonly OUTSIDE_MARGIN: "outsideMargin";
readonly PAGE: "page";
readonly RIGHT_MARGIN: "rightMargin";
};
export declare const VerticalPositionRelativeFrom: {
readonly BOTTOM_MARGIN: "bottomMargin";
readonly INSIDE_MARGIN: "insideMargin";
readonly LINE: "line";
readonly MARGIN: "margin";
readonly OUTSIDE_MARGIN: "outsideMargin";
readonly PAGE: "page";
readonly PARAGRAPH: "paragraph";
readonly TOP_MARGIN: "topMargin";
};
export type IHorizontalPositionOptions = {
readonly relative?: (typeof HorizontalPositionRelativeFrom)[keyof typeof HorizontalPositionRelativeFrom];
readonly align?: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];
readonly offset?: number;
};
export type IVerticalPositionOptions = {
readonly relative?: (typeof VerticalPositionRelativeFrom)[keyof typeof VerticalPositionRelativeFrom];
readonly align?: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];
readonly offset?: number;
};
export type IMargins = {
readonly left?: number;
readonly bottom?: number;
readonly top?: number;
readonly right?: number;
};
export type IFloating = {
readonly horizontalPosition: IHorizontalPositionOptions;
readonly verticalPosition: IVerticalPositionOptions;
readonly allowOverlap?: boolean;
readonly lockAnchor?: boolean;
readonly behindDocument?: boolean;
readonly layoutInCell?: boolean;
readonly margins?: IMargins;
readonly wrap?: ITextWrapping;
readonly zIndex?: number;
};
@@ -0,0 +1,3 @@
import { XmlComponent } from '../../xml-components';
import { IHorizontalPositionOptions } from './floating-position';
export declare const createHorizontalPosition: ({ relative, align, offset }: IHorizontalPositionOptions) => XmlComponent;
@@ -0,0 +1 @@
export {};
+4
View File
@@ -0,0 +1,4 @@
export * from './floating-position';
export * from './simple-pos';
export * from './horizontal-position';
export * from './vertical-position';
+2
View File
@@ -0,0 +1,2 @@
import { XmlComponent } from '../../xml-components';
export declare const createPositionOffset: (offsetValue: number) => XmlComponent;
@@ -0,0 +1 @@
export {};
+2
View File
@@ -0,0 +1,2 @@
import { XmlComponent } from '../../xml-components';
export declare const createSimplePos: () => XmlComponent;
+1
View File
@@ -0,0 +1 @@
export {};
+3
View File
@@ -0,0 +1,3 @@
import { XmlComponent } from '../../xml-components';
import { IVerticalPositionOptions } from './floating-position';
export declare const createVerticalPosition: ({ relative, align, offset }: IVerticalPositionOptions) => XmlComponent;
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,10 @@
import { XmlAttributeComponent } from '../../../xml-components';
export declare class GraphicFrameLockAttributes extends XmlAttributeComponent<{
readonly xmlns?: string;
readonly noChangeAspect?: number;
}> {
protected readonly xmlKeys: {
xmlns: string;
noChangeAspect: string;
};
}
@@ -0,0 +1,4 @@
import { XmlComponent } from '../../../xml-components';
export declare class GraphicFrameLocks extends XmlComponent {
constructor();
}
@@ -0,0 +1,2 @@
import { XmlComponent } from '../../xml-components';
export declare const createGraphicFrameProperties: () => XmlComponent;
+3
View File
@@ -0,0 +1,3 @@
export * from './drawing';
export * from './text-wrap';
export * from './floating';

Some files were not shown because too many files have changed in this diff Show More