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
+2
View File
@@ -0,0 +1,2 @@
import { Element } from 'xml-js';
export declare const appendContentType: (element: Element, contentType: string, extension: string) => void;
+1
View File
@@ -0,0 +1 @@
export {};
+32
View File
@@ -0,0 +1,32 @@
import { default as JSZip } from 'jszip';
import { FileChild } from '../file/file-child';
import { ParagraphChild } from '../file/paragraph';
import { OutputByType, OutputType } from '../util/output-type';
export type InputDataType = Buffer | string | number[] | Uint8Array | ArrayBuffer | Blob | NodeJS.ReadableStream | JSZip;
export declare const PatchType: {
readonly DOCUMENT: "file";
readonly PARAGRAPH: "paragraph";
};
type ParagraphPatch = {
readonly type: typeof PatchType.PARAGRAPH;
readonly children: readonly ParagraphChild[];
};
type FilePatch = {
readonly type: typeof PatchType.DOCUMENT;
readonly children: readonly FileChild[];
};
export type IPatch = ParagraphPatch | FilePatch;
export type PatchDocumentOutputType = OutputType;
export type PatchDocumentOptions<T extends PatchDocumentOutputType = PatchDocumentOutputType> = {
readonly outputType: T;
readonly data: InputDataType;
readonly patches: Readonly<Record<string, IPatch>>;
readonly keepOriginalStyles?: boolean;
readonly placeholderDelimiters?: Readonly<{
readonly start: string;
readonly end: string;
}>;
readonly recursive?: boolean;
};
export declare const patchDocument: <T extends PatchDocumentOutputType = PatchDocumentOutputType>({ outputType, data, patches, keepOriginalStyles, placeholderDelimiters, recursive, }: PatchDocumentOptions<T>) => Promise<OutputByType[T]>;
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+2
View File
@@ -0,0 +1,2 @@
export * from './from-docx';
export * from './patch-detector';
+9
View File
@@ -0,0 +1,9 @@
import { Element } from 'xml-js';
export declare class TokenNotFoundError extends Error {
constructor(token: string);
}
export declare const findRunElementIndexWithToken: (paragraphElement: Element, token: string) => number;
export declare const splitRunElement: (runElement: Element, token: string) => {
readonly left: Element;
readonly right: Element;
};
+1
View File
@@ -0,0 +1 @@
export {};
+8
View File
@@ -0,0 +1,8 @@
import { Element } from 'xml-js';
import { IRenderedParagraphNode } from './run-renderer';
export declare const replaceTokenInParagraphElement: ({ paragraphElement, renderedParagraph, originalText, replacementText, }: {
readonly paragraphElement: Element;
readonly renderedParagraph: IRenderedParagraphNode;
readonly originalText: string;
readonly replacementText: string;
}) => Element;
+1
View File
@@ -0,0 +1 @@
export {};
+6
View File
@@ -0,0 +1,6 @@
import { InputDataType } from './from-docx';
type PatchDetectorOptions = {
readonly data: InputDataType;
};
export declare const patchDetector: ({ data }: PatchDetectorOptions) => Promise<readonly string[]>;
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+4
View File
@@ -0,0 +1,4 @@
import { Element } from 'xml-js';
import { RelationshipType, TargetModeType } from '../file/relationships/relationship/relationship';
export declare const getNextRelationshipIndex: (relationships: Element) => number;
export declare const appendRelationship: (relationships: Element, id: number | string, type: RelationshipType, target: string, targetMode?: (typeof TargetModeType)[keyof typeof TargetModeType]) => readonly Element[];
+1
View File
@@ -0,0 +1 @@
export {};
+15
View File
@@ -0,0 +1,15 @@
import { Element } from 'xml-js';
import { IContext } from '../file/xml-components';
import { IPatch } from './from-docx';
type IReplacerResult = {
readonly element: Element;
readonly didFindOccurrence: boolean;
};
export declare const replacer: ({ json, patch, patchText, context, keepOriginalStyles, }: {
readonly json: Element;
readonly patch: IPatch;
readonly patchText: string;
readonly context: IContext;
readonly keepOriginalStyles?: boolean;
}) => IReplacerResult;
export {};
+84
View File
@@ -0,0 +1,84 @@
export declare const MOCK_JSON: {
elements: {
type: string;
name: string;
elements: ({
type: string;
name: string;
attributes: {
"w14:paraId": string;
"w14:textId": string;
"w:rsidR": string;
"w:rsidRDefault": string;
};
elements: ({
type: string;
name: string;
elements: {
type: string;
name: string;
attributes: {
"w:val": string;
};
}[];
attributes?: undefined;
} | {
type: string;
name: string;
elements: {
type: string;
name: string;
elements: {
type: string;
text: string;
}[];
}[];
attributes?: undefined;
} | {
type: string;
name: string;
attributes: {
"w:rsidR": string;
};
elements: {
type: string;
name: string;
elements: {
type: string;
text: string;
}[];
}[];
})[];
} | {
type: string;
name: string;
elements: {
type: string;
name: string;
elements: ({
type: string;
name: string;
elements: {
type: string;
name: string;
attributes: {
"w:val": string;
};
}[];
} | {
type: string;
name: string;
elements: {
type: string;
text: string;
}[];
} | {
type: string;
name: string;
elements?: undefined;
})[];
}[];
attributes?: undefined;
})[];
}[];
};
+22
View File
@@ -0,0 +1,22 @@
import { ElementWrapper } from './traverser';
export type IRenderedParagraphNode = {
readonly text: string;
readonly runs: readonly IRenderedRunNode[];
readonly index: number;
readonly pathToParagraph: readonly number[];
};
type StartAndEnd = {
readonly start: number;
readonly end: number;
};
type IParts = {
readonly text: string;
readonly index: number;
} & StartAndEnd;
export type IRenderedRunNode = {
readonly text: string;
readonly parts: readonly IParts[];
readonly index: number;
} & StartAndEnd;
export declare const renderParagraphNode: (node: ElementWrapper) => IRenderedParagraphNode;
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+9
View File
@@ -0,0 +1,9 @@
import { Element } from 'xml-js';
import { IRenderedParagraphNode } from './run-renderer';
export type ElementWrapper = {
readonly element: Element;
readonly index: number;
readonly parent: ElementWrapper | undefined;
};
export declare const traverse: (node: Element) => readonly IRenderedParagraphNode[];
export declare const findLocationOfText: (node: Element, text: string) => readonly IRenderedParagraphNode[];
+1
View File
@@ -0,0 +1 @@
export {};
+5
View File
@@ -0,0 +1,5 @@
import { Element } from 'xml-js';
export declare const toJson: (xmlData: string) => Element;
export declare const createTextElementContents: (text: string) => Element[];
export declare const patchSpaceAttribute: (element: Element) => Element;
export declare const getFirstLevelElements: (relationships: Element, id: string) => Element[];
+1
View File
@@ -0,0 +1 @@
export {};