@cs-object/react 0.1.0 → 1.0.0
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/dist/index.cjs +2858 -399
- package/dist/index.d.cts +53 -2
- package/dist/index.d.ts +53 -2
- package/dist/index.js +2832 -366
- package/dist/style.css +1 -1
- package/package.json +10 -8
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefAttributes, DOMAttributes, CSSProperties, ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { SheetDocument, PreparedDocument, Diagnostic, ExecutionPayload, ResolvedAsset, HistoricalReview, CalculationSourceObject, LegacyAssetManifest } from '@cs-object/core';
|
|
2
|
+
import { SheetDocument, PreparedDocument, Diagnostic, ExecutionPayload, ResolvedAsset, HistoricalReview, VerificationReport, CalculationSourceObject, LegacyAssetManifest } from '@cs-object/core';
|
|
3
3
|
|
|
4
4
|
type MathMLAttributeMathDisplay = 'block' | 'inline';
|
|
5
5
|
interface MathMLGlobalAttributes extends RefAttributes<MathMLElement>, DOMAttributes<MathMLElement> {
|
|
@@ -81,6 +81,55 @@ interface FormulaSheetPrintOptions {
|
|
|
81
81
|
}
|
|
82
82
|
declare const printFormulaSheet: (options?: FormulaSheetPrintOptions) => boolean;
|
|
83
83
|
|
|
84
|
+
type ComparisonMeasurement = {
|
|
85
|
+
comparisonId: string;
|
|
86
|
+
sourcePlacementId: string;
|
|
87
|
+
labelWidth: number;
|
|
88
|
+
columnWidths: number[];
|
|
89
|
+
availableWidth: number;
|
|
90
|
+
cap?: number;
|
|
91
|
+
};
|
|
92
|
+
type ComparisonPartPlan = ComparisonMeasurement & {
|
|
93
|
+
groups: number[][];
|
|
94
|
+
unfit?: {
|
|
95
|
+
column: number;
|
|
96
|
+
required: number;
|
|
97
|
+
available: number;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
type ComparisonLayoutDiagnostic = {
|
|
101
|
+
code: 'DOCUMENT_LAYOUT_OVERFLOW';
|
|
102
|
+
message: string;
|
|
103
|
+
stage: 'rendering';
|
|
104
|
+
check: 'rendering';
|
|
105
|
+
layout: {
|
|
106
|
+
media: 'print';
|
|
107
|
+
sourcePlacementId?: string;
|
|
108
|
+
selector: string;
|
|
109
|
+
left: number;
|
|
110
|
+
right: number;
|
|
111
|
+
containerLeft: number;
|
|
112
|
+
containerRight: number;
|
|
113
|
+
overflowPx: number;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
type RowSliceInput = {
|
|
117
|
+
height: number;
|
|
118
|
+
/** Group label repeated on every later slice that continues its rows. */
|
|
119
|
+
repeat?: boolean;
|
|
120
|
+
};
|
|
121
|
+
declare function partitionRowAxis(rows: readonly RowSliceInput[], chromeHeight: number, availableHeight: number, firstAvailable?: number): {
|
|
122
|
+
groups: number[][];
|
|
123
|
+
unfit?: {
|
|
124
|
+
row: number;
|
|
125
|
+
required: number;
|
|
126
|
+
available: number;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
declare function planComparisonParts(measurements: readonly ComparisonMeasurement[]): ComparisonPartPlan[];
|
|
130
|
+
declare function measureComparisons(root?: ParentNode | void): ComparisonMeasurement[];
|
|
131
|
+
declare function renderComparisonParts(plans: readonly ComparisonPartPlan[], root?: ParentNode, rowPartitioner?: typeof partitionRowAxis): ComparisonLayoutDiagnostic[];
|
|
132
|
+
|
|
84
133
|
interface AsciiMathViewProps extends MathMathMLAttributes {
|
|
85
134
|
readonly expression: string;
|
|
86
135
|
readonly identifierMathVariant?: 'normal';
|
|
@@ -102,6 +151,7 @@ interface PrepareExecutionDocumentOptions {
|
|
|
102
151
|
readonly execution: ExecutionPayload;
|
|
103
152
|
readonly assets: readonly ResolvedAsset[];
|
|
104
153
|
readonly historicalReviews?: readonly HistoricalReview[];
|
|
154
|
+
readonly verificationReport?: VerificationReport;
|
|
105
155
|
}
|
|
106
156
|
/** Pure preparation. The caller captures and validates media bytes before this call. */
|
|
107
157
|
declare const prepareExecutionDocument: (options: PrepareExecutionDocumentOptions) => PreparedDocument;
|
|
@@ -115,4 +165,5 @@ interface PrepareLegacyDocumentOptions {
|
|
|
115
165
|
}
|
|
116
166
|
declare const prepareLegacyDocument: (options: PrepareLegacyDocumentOptions) => PreparedDocument;
|
|
117
167
|
|
|
118
|
-
export { AsciiMathView, DocumentPreparationError, FormulaSheet,
|
|
168
|
+
export { AsciiMathView, DocumentPreparationError, FormulaSheet, PreparedFormulaSheet, measureComparisons, partitionRowAxis, planComparisonParts, prepareExecutionDocument, prepareLegacyDocument, printFormulaSheet, renderComparisonParts };
|
|
169
|
+
export type { FormulaSheetPrintOptions, FormulaSheetProps, PrepareExecutionDocumentOptions, PrepareLegacyDocumentOptions, PreparedFormulaSheetProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefAttributes, DOMAttributes, CSSProperties, ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { SheetDocument, PreparedDocument, Diagnostic, ExecutionPayload, ResolvedAsset, HistoricalReview, CalculationSourceObject, LegacyAssetManifest } from '@cs-object/core';
|
|
2
|
+
import { SheetDocument, PreparedDocument, Diagnostic, ExecutionPayload, ResolvedAsset, HistoricalReview, VerificationReport, CalculationSourceObject, LegacyAssetManifest } from '@cs-object/core';
|
|
3
3
|
|
|
4
4
|
type MathMLAttributeMathDisplay = 'block' | 'inline';
|
|
5
5
|
interface MathMLGlobalAttributes extends RefAttributes<MathMLElement>, DOMAttributes<MathMLElement> {
|
|
@@ -81,6 +81,55 @@ interface FormulaSheetPrintOptions {
|
|
|
81
81
|
}
|
|
82
82
|
declare const printFormulaSheet: (options?: FormulaSheetPrintOptions) => boolean;
|
|
83
83
|
|
|
84
|
+
type ComparisonMeasurement = {
|
|
85
|
+
comparisonId: string;
|
|
86
|
+
sourcePlacementId: string;
|
|
87
|
+
labelWidth: number;
|
|
88
|
+
columnWidths: number[];
|
|
89
|
+
availableWidth: number;
|
|
90
|
+
cap?: number;
|
|
91
|
+
};
|
|
92
|
+
type ComparisonPartPlan = ComparisonMeasurement & {
|
|
93
|
+
groups: number[][];
|
|
94
|
+
unfit?: {
|
|
95
|
+
column: number;
|
|
96
|
+
required: number;
|
|
97
|
+
available: number;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
type ComparisonLayoutDiagnostic = {
|
|
101
|
+
code: 'DOCUMENT_LAYOUT_OVERFLOW';
|
|
102
|
+
message: string;
|
|
103
|
+
stage: 'rendering';
|
|
104
|
+
check: 'rendering';
|
|
105
|
+
layout: {
|
|
106
|
+
media: 'print';
|
|
107
|
+
sourcePlacementId?: string;
|
|
108
|
+
selector: string;
|
|
109
|
+
left: number;
|
|
110
|
+
right: number;
|
|
111
|
+
containerLeft: number;
|
|
112
|
+
containerRight: number;
|
|
113
|
+
overflowPx: number;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
type RowSliceInput = {
|
|
117
|
+
height: number;
|
|
118
|
+
/** Group label repeated on every later slice that continues its rows. */
|
|
119
|
+
repeat?: boolean;
|
|
120
|
+
};
|
|
121
|
+
declare function partitionRowAxis(rows: readonly RowSliceInput[], chromeHeight: number, availableHeight: number, firstAvailable?: number): {
|
|
122
|
+
groups: number[][];
|
|
123
|
+
unfit?: {
|
|
124
|
+
row: number;
|
|
125
|
+
required: number;
|
|
126
|
+
available: number;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
declare function planComparisonParts(measurements: readonly ComparisonMeasurement[]): ComparisonPartPlan[];
|
|
130
|
+
declare function measureComparisons(root?: ParentNode | void): ComparisonMeasurement[];
|
|
131
|
+
declare function renderComparisonParts(plans: readonly ComparisonPartPlan[], root?: ParentNode, rowPartitioner?: typeof partitionRowAxis): ComparisonLayoutDiagnostic[];
|
|
132
|
+
|
|
84
133
|
interface AsciiMathViewProps extends MathMathMLAttributes {
|
|
85
134
|
readonly expression: string;
|
|
86
135
|
readonly identifierMathVariant?: 'normal';
|
|
@@ -102,6 +151,7 @@ interface PrepareExecutionDocumentOptions {
|
|
|
102
151
|
readonly execution: ExecutionPayload;
|
|
103
152
|
readonly assets: readonly ResolvedAsset[];
|
|
104
153
|
readonly historicalReviews?: readonly HistoricalReview[];
|
|
154
|
+
readonly verificationReport?: VerificationReport;
|
|
105
155
|
}
|
|
106
156
|
/** Pure preparation. The caller captures and validates media bytes before this call. */
|
|
107
157
|
declare const prepareExecutionDocument: (options: PrepareExecutionDocumentOptions) => PreparedDocument;
|
|
@@ -115,4 +165,5 @@ interface PrepareLegacyDocumentOptions {
|
|
|
115
165
|
}
|
|
116
166
|
declare const prepareLegacyDocument: (options: PrepareLegacyDocumentOptions) => PreparedDocument;
|
|
117
167
|
|
|
118
|
-
export { AsciiMathView, DocumentPreparationError, FormulaSheet,
|
|
168
|
+
export { AsciiMathView, DocumentPreparationError, FormulaSheet, PreparedFormulaSheet, measureComparisons, partitionRowAxis, planComparisonParts, prepareExecutionDocument, prepareLegacyDocument, printFormulaSheet, renderComparisonParts };
|
|
169
|
+
export type { FormulaSheetPrintOptions, FormulaSheetProps, PrepareExecutionDocumentOptions, PrepareLegacyDocumentOptions, PreparedFormulaSheetProps };
|