@pptx-studio/model 0.4.0 → 0.5.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/CHANGELOG.md +14 -0
- package/README.md +10 -4
- package/dist/index.d.ts +27 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @pptx-studio/model
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- db00af0: `tableBackground` now returns the table background's two layers, `{ fill, effects }`, each taken
|
|
8
|
+
from `a:tblPr` where it writes one and from the style's `tblBg` otherwise. An empty `a:effectLst` in
|
|
9
|
+
`a:tblPr` removes the style's effect, as PowerPoint draws it, and `themedEffects` follows an
|
|
10
|
+
`effectRef` into the theme. `tableCellDiagonals` gives a cell's diagonals as drawn: the anchor's
|
|
11
|
+
own `a:lnTlToBr` and `a:lnBlToTr` across its whole span, a covered position's never, and swapped in a
|
|
12
|
+
right-to-left table.
|
|
13
|
+
|
|
14
|
+
validate's `V034` also warns on every line a covered cell writes, which PowerPoint keeps on save
|
|
15
|
+
and never draws, and on a border written under a position no `a:tc` reached.
|
|
16
|
+
|
|
3
17
|
## 0.4.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -196,7 +196,7 @@ defaulting nothing the file did not say. A GUID without braces or with padding,
|
|
|
196
196
|
|
|
197
197
|
## The thirteen parts compose in schema order, property by property
|
|
198
198
|
|
|
199
|
-
Which part of a style reaches a cell, and which wins, was measured in C9 on 10,
|
|
199
|
+
Which part of a style reaches a cell, and which wins, was measured in C9 on 10,505 slides of every
|
|
200
200
|
built-in in three themes (`corpus/ground-truth/table-cascade*.json`), against what PowerPoint's
|
|
201
201
|
object model reported for each cell and what it drew at 4 px a point:
|
|
202
202
|
|
|
@@ -207,14 +207,20 @@ object model reported for each cell and what it drew at 4 px a point:
|
|
|
207
207
|
- Every property is found on its own: the highest part that states a fill, a colour, bold or
|
|
208
208
|
italic wins it, whatever that part leaves unsaid.
|
|
209
209
|
- `tableCellFill`: the cell's own `a:tcPr` fill, else the style's. `tableBackground`: `a:tblPr`'s
|
|
210
|
-
fill in place of the style's `tblBg
|
|
210
|
+
fill and effect list, each in place of the style's `tblBg` one, an empty list included, painted
|
|
211
|
+
under the cells over the grid and never the frame as written. `themedEffects` follows an
|
|
212
|
+
`effectRef` into the theme.
|
|
211
213
|
- `tableEdgeLine`: an edge's owner writes the line it draws, replacing the style's whole; a line no
|
|
212
214
|
owner writes is the highest part's claim on that edge. The cell above or left owns a segment where
|
|
213
215
|
its anchor is level with it, in the anchor's column or row; else the cell below or right, where
|
|
214
216
|
its anchor is; else the cell above or left. An unmerged cell is always level. A table that
|
|
215
|
-
resolves to no style draws `DEFAULT_GRID_LINE`, 1 pt black.
|
|
217
|
+
resolves to no style draws `DEFAULT_GRID_LINE`, 1 pt black. A position no `a:tc` reached owns its
|
|
218
|
+
edges as a cell writing nothing does, and a dashed line is drawn dashed.
|
|
216
219
|
- A merged cell takes its anchor's parts and every covered position's end and corner parts; its
|
|
217
|
-
bands are the anchor's. A covered cell's `a:tcPr` is never read
|
|
220
|
+
bands are the anchor's. A covered cell's `a:tcPr` is never read, though PowerPoint keeps it on
|
|
221
|
+
save.
|
|
222
|
+
- `tableCellDiagonals`: the anchor's own `a:lnTlToBr` and `a:lnBlToTr`, across its whole span, as
|
|
223
|
+
drawn: mirrored in an rtl table. No built-in states a diagonal.
|
|
218
224
|
- `tableTextLayer` is what the style gives a cell's text, and the text cascade reads it between the
|
|
219
225
|
cell's own list style and the master's `p:otherStyle`; `p:defaultTextStyle` is never read, and
|
|
220
226
|
under a master with no `p:txStyles` a cell takes the built-in `other` style whatever its frame.
|
package/dist/index.d.ts
CHANGED
|
@@ -620,6 +620,16 @@ interface TableStyle {
|
|
|
620
620
|
readonly parts: Readonly<Partial<Record<TableStylePartName, TableStylePart>>>;
|
|
621
621
|
readonly node: XElement;
|
|
622
622
|
}
|
|
623
|
+
/** What paints under a table's cells, each layer with where it came from. */
|
|
624
|
+
interface TableBackgroundLayers {
|
|
625
|
+
readonly fill: TableSourced<Themeable<Fill>> | null;
|
|
626
|
+
readonly effects: TableSourced<Themeable<readonly Effect[] | undefined>> | null;
|
|
627
|
+
}
|
|
628
|
+
/** A cell's diagonals as drawn: `down` from its visual top left, `up` from its visual bottom left. */
|
|
629
|
+
interface TableDiagonals {
|
|
630
|
+
readonly down: Line | null;
|
|
631
|
+
readonly up: Line | null;
|
|
632
|
+
}
|
|
623
633
|
/** A grid edge: `h` is the top of row `row` at column `col` (`row = rows` is the bottom); `v` the left of column `col`. */
|
|
624
634
|
interface TableEdge {
|
|
625
635
|
readonly axis: 'h' | 'v';
|
|
@@ -1533,8 +1543,17 @@ export declare function tablePartsAt(props: TableProps | undefined, rows: number
|
|
|
1533
1543
|
* is painted alone, never over another part's.
|
|
1534
1544
|
*/
|
|
1535
1545
|
export declare function tableCellFill(table: Table, style: TableStyle | null, grid: TableGrid, row: number, col: number): TableSourced<Themeable<Fill>> | null;
|
|
1536
|
-
/**
|
|
1537
|
-
|
|
1546
|
+
/**
|
|
1547
|
+
* What paints under the cells, over the grid and never the frame as written: `a:tblPr`'s own fill
|
|
1548
|
+
* and effect list, each in place of the style's `tblBg` one, an empty list included (C9).
|
|
1549
|
+
*/
|
|
1550
|
+
export declare function tableBackground(table: Table, style: TableStyle | null): TableBackgroundLayers;
|
|
1551
|
+
/**
|
|
1552
|
+
* The diagonals of the cell at (row, col) as drawn across its whole span: `down` from its visual top
|
|
1553
|
+
* left, `up` from its visual bottom left. Only the anchor's own lines draw, mirrored in an rtl
|
|
1554
|
+
* table; no built-in states a diagonal (C8) and a covered position's own are never read (C9).
|
|
1555
|
+
*/
|
|
1556
|
+
export declare function tableCellDiagonals(table: Table, grid: TableGrid, row: number, col: number): TableDiagonals;
|
|
1538
1557
|
/** PowerPoint's default grid: a 1-pt black line on every edge of a table that names no built-in (C8). */
|
|
1539
1558
|
export declare const DEFAULT_GRID_LINE: Line;
|
|
1540
1559
|
/**
|
|
@@ -1556,6 +1575,11 @@ export declare function themedFill(fill: Themeable<Fill>, theme: Theme, colors:
|
|
|
1556
1575
|
readonly fill: Fill | null;
|
|
1557
1576
|
readonly phClr: Rgba | null;
|
|
1558
1577
|
};
|
|
1578
|
+
/** A style effect list with an `effectRef` followed into the theme, and the colour `phClr` takes. */
|
|
1579
|
+
export declare function themedEffects(effects: Themeable<readonly Effect[] | undefined>, theme: Theme, colors: ColorContext): {
|
|
1580
|
+
readonly effects: readonly Effect[];
|
|
1581
|
+
readonly phClr: Rgba | null;
|
|
1582
|
+
};
|
|
1559
1583
|
/** A style line with an `lnRef` followed into the theme, and the colour `phClr` takes in it. */
|
|
1560
1584
|
export declare function themedLine(line: Themeable<Line>, theme: Theme, colors: ColorContext): {
|
|
1561
1585
|
readonly line: Line | null;
|
|
@@ -1582,5 +1606,5 @@ export declare function resolveTypefaceOf(font: Typeface, scheme: FontScheme): s
|
|
|
1582
1606
|
*/
|
|
1583
1607
|
export declare function requestedTypefaces(fonts: Iterable<Typeface | undefined>, scheme: FontScheme): readonly string[];
|
|
1584
1608
|
//#endregion
|
|
1585
|
-
export { type Background, type BuiltinLevel, type BuiltinTableStyle, type BulletAutoNum, type BulletColor, type BulletFont, type BulletKind, type BulletSize, COLOR_TRANSFORM_OPS, type Caps, type ChainLink, type ColorMapOverride, type Document, type DocumentProblem, type FontAlign, type FontCollection, type FontRef, type FontScheme, type FormatScheme, type GridCell, type ListStyle, type ModelErrorCode, type NormalPlaceholder, type OnOffStyle, type Origin, type ParaProps, type Paragraph, type Placeholder, type PlaceholderSize, type PlaceholderType, type Resolved, type ResolvedAppearance, type ResolvedBackground, type ResolvedInsets, type RunProps, type ScriptSlot, type Shape, type ShapeGeometry, type ShapeKind, type ShapeStyle, type Sheet, type SheetKind, type Spacing, type Strike, type StyleMatrixTarget, type StyleRef, type Table, type TableBackground, type TableCell, type TableCellBorders, type TableCellProps, type TableCellText, type TableColumn, type TableEdge, type TableGrid, type TableProps, type TableRow, type TableSource, type TableSourced, type TableStyle, type TableStyleBorders, type TableStyleCell, type TableStylePart, type TableStylePartName, type TableStyleRef, type TableStyleText, type TextAlign, type TextAnchor, type TextBody, type TextBreak, type TextContent, type TextContext, type TextField, type TextRun, type TextStyleBucket, type TextStyles, type Theme, type ThemeFontRef, type Themeable, type Typeface, type Underline, type VerticalText, type Xfrm };
|
|
1609
|
+
export { type Background, type BuiltinLevel, type BuiltinTableStyle, type BulletAutoNum, type BulletColor, type BulletFont, type BulletKind, type BulletSize, COLOR_TRANSFORM_OPS, type Caps, type ChainLink, type ColorMapOverride, type Document, type DocumentProblem, type FontAlign, type FontCollection, type FontRef, type FontScheme, type FormatScheme, type GridCell, type ListStyle, type ModelErrorCode, type NormalPlaceholder, type OnOffStyle, type Origin, type ParaProps, type Paragraph, type Placeholder, type PlaceholderSize, type PlaceholderType, type Resolved, type ResolvedAppearance, type ResolvedBackground, type ResolvedInsets, type RunProps, type ScriptSlot, type Shape, type ShapeGeometry, type ShapeKind, type ShapeStyle, type Sheet, type SheetKind, type Spacing, type Strike, type StyleMatrixTarget, type StyleRef, type Table, type TableBackground, type TableBackgroundLayers, type TableCell, type TableCellBorders, type TableCellProps, type TableCellText, type TableColumn, type TableDiagonals, type TableEdge, type TableGrid, type TableProps, type TableRow, type TableSource, type TableSourced, type TableStyle, type TableStyleBorders, type TableStyleCell, type TableStylePart, type TableStylePartName, type TableStyleRef, type TableStyleText, type TextAlign, type TextAnchor, type TextBody, type TextBreak, type TextContent, type TextContext, type TextField, type TextRun, type TextStyleBucket, type TextStyles, type Theme, type ThemeFontRef, type Themeable, type Typeface, type Underline, type VerticalText, type Xfrm };
|
|
1586
1610
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/errors.ts","../src/parse/geometry.ts","../src/text.ts","../src/table.ts","../src/types.ts","../src/parse/paint.ts","../src/parse/sheet.ts","../src/resolve/placeholder.ts","../src/resolve/resolve.ts","../src/style.ts","../src/resolve/background.ts","../src/document.ts","../src/parse/text.ts","../src/builtin/text-styles.ts","../src/builtin/table-styles.ts","../src/resolve/text.ts","../src/resolve/body.ts","../src/parse/body.ts","../src/parse/table.ts","../src/resolve/table.ts","../src/resolve/typeface.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;KAkBY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA4DC,mBAAmB;WACZ;WACT,MAAM;;WAEN;;WAEA;EAGP,YAAA,MAAM,gBACN,iBACA,0BACA;;wBASY,aAAa,iBAAiB,SAAS;qBAI1C;;;;;;;;;;;KCrDD;WACG;WAAyB;WAAuB,iBAAiB;;WACjE;WAAyB,UAAU;;;;;;;;;wBAkMlC,cACd,MAAM,sBACN,mBACC;;;;KCrMS;;KAGA;;KAGA;;KAqBA;;KAGA;;;;;;;;;;;;KAaA;WACG;WAA0B;;WAC1B;WAAyB;;;;;;;;;;UAUvB;WACN;;WAEA;;WAEA;;WAEA;;;;;;;;;;KAWC;WACD;WACA;;;wBAMK,aAAa,mBAAmB;;;;;;;;;UAsB/B;;WAEN;WACA;WACA;WACA,GAAG;WACH,QAAQ;WACR,KAAK;;WAEL;;WAEA;;WAEA;WACA;WACA;WACA;WACA,OAAO;WACP,IAAI;WACJ,IAAI;WACJ,KAAK;;WAEL,MAAM;;WAEN,MAAM;WACN,kBAAkB;;WAElB,WAAW;;WAEX,MAAM;;;;;;;;;KAkBL;;KAGA;WACG;WAA2B,OAAO;;;;WAElC;;;KAGH;;;WAEG;WAA0B;;;;WAE1B;WAAyB;;WACzB;;;KAGH;WACC;WAAwB,OAAO;;WAAqB;;;U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N,MAAM;WACN,OAAO;WACP,KAAK;WACL,QAAQ;WACR,QAAQ;WACR,QAAQ;;;UAIF;WACN;WACA;WACA;WACA;WACA,MAAM;WACN,QAAQ;WACR;WACA,cAAc;WACd,SAAS;WACT,MAAM;;WAEN;WACA,MAAM;;UAGA;WACN,OAAO;WACP,kBAAkB;WAClB,eAAe;WACf,MAAM;;;UAQA;WACN;WACA;WACA;WACA;;WAEA,MAAM;;;UAIA;WACN;WACA;;WAEA;;WAEA;WACA,8BAA8B;WAC9B,kBAAkB;;;;;;wBAYb,UAAU,OAAO,QAAQ;;KAoD7B;;KAGA,UAAU,GAAG,MAAM;WAClB;WAAwB,OAAO;;WAAiB;WAAsB,KAAK;;;UAGvE;WACN,GAAG;WACH,GAAG;WACH,MAAM,UAAU,gBAAgB;WAChC,OAAO;;;UAID;WACN,MAAM,UAAU;WAChB,OAAO,UAAU;WACjB,KAAK,UAAU;WACf,QAAQ,UAAU;WAClB,SAAS,UAAU;WACnB,SAAS,UAAU;WACnB,QAAQ,UAAU;WAClB,QAAQ,UAAU;;;UAIZ;WACN,SAAS;WACT,MAAM,UAAU;;WAEhB,QAAQ;;;UAIF;WACN,MAAM;WACN,MAAM;;;UAIA;WACN,MAAM,UAAU;WAChB,QAAQ,mBAAmB;;;KAI1B;;UAgBK;WACN;WACA;WACA,YAAY;WACZ,OAAO,SAAS,QAAQ,OAAO,oBAAoB;WACnD,MAAM;;;UAQA;WACN;WACA;WACA;;;KAIC,cAAc;UAET,aAAa;WACnB,OAAO;WACP,QAAQ;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/errors.ts","../src/parse/geometry.ts","../src/text.ts","../src/table.ts","../src/types.ts","../src/parse/paint.ts","../src/parse/sheet.ts","../src/resolve/placeholder.ts","../src/resolve/resolve.ts","../src/style.ts","../src/resolve/background.ts","../src/document.ts","../src/parse/text.ts","../src/builtin/text-styles.ts","../src/builtin/table-styles.ts","../src/resolve/text.ts","../src/resolve/body.ts","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A,cACC,aAAa,UAAU;;;;;wBAgBV,gBAAgB,OAAO,OAAO,OAAO,oBAAoB;;;;;;wBA2BzD,mBACd,OAAO,OACP,MAAM,WACN,aACA,cACC;;qBAYU,mBAAmB;;;;;;;wBA0BhB,cACd,OAAO,OACP,OAAO,mBACP,MAAM,WACN,MAAM,YACL,aAAa,UAAU;;;;;;;wBAqFV,eACd,OAAO,OACP,OAAO,mBACP,MAAM,WACN,aACA,cACC;;wBA4Ca,WACd,MAAM,UAAU,OAChB,OAAO,OACP,QAAQ;WACI,MAAM;WAAsB,OAAO;;;wBAUjC,cACd,SAAS,mBAAmB,uBAC5B,OAAO,OACP,QAAQ;WACI,kBAAkB;WAAmB,OAAO;;;wBAS1C,WACd,MAAM,UAAU,OAChB,OAAO,OACP,QAAQ;WACI,MAAM;WAAsB,OAAO;;;;;KCzarC;;;;;;;wBAQI,gBAAgB,kBAAkB,QAAQ;;wBAU1C,kBAAkB,MAAM,UAAU,QAAQ;;;;;;;wBAU1C,mBACd,OAAO,SAAS,uBAChB,QAAQ"}
|
package/dist/index.js
CHANGED
|
@@ -3963,20 +3963,49 @@ function tableCellFill(table, style, grid, row, col) {
|
|
|
3963
3963
|
}
|
|
3964
3964
|
return null;
|
|
3965
3965
|
}
|
|
3966
|
-
/**
|
|
3966
|
+
/**
|
|
3967
|
+
* What paints under the cells, over the grid and never the frame as written: `a:tblPr`'s own fill
|
|
3968
|
+
* and effect list, each in place of the style's `tblBg` one, an empty list included (C9).
|
|
3969
|
+
*/
|
|
3967
3970
|
function tableBackground(table, style) {
|
|
3968
|
-
const
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
value:
|
|
3971
|
+
const ownFill = table.props?.fill;
|
|
3972
|
+
const ownEffects = table.props?.effects;
|
|
3973
|
+
return {
|
|
3974
|
+
fill: ownFill === void 0 ? fromBackground(style?.background?.fill) : {
|
|
3975
|
+
value: {
|
|
3976
|
+
kind: "value",
|
|
3977
|
+
value: ownFill
|
|
3978
|
+
},
|
|
3979
|
+
source: "tblPr"
|
|
3973
3980
|
},
|
|
3974
|
-
|
|
3981
|
+
effects: ownEffects === void 0 ? fromBackground(style?.background?.effect) : {
|
|
3982
|
+
value: {
|
|
3983
|
+
kind: "value",
|
|
3984
|
+
value: ownEffects
|
|
3985
|
+
},
|
|
3986
|
+
source: "tblPr"
|
|
3987
|
+
}
|
|
3975
3988
|
};
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3989
|
+
}
|
|
3990
|
+
const fromBackground = (value) => value === void 0 ? null : {
|
|
3991
|
+
value,
|
|
3992
|
+
source: "tblBg"
|
|
3993
|
+
};
|
|
3994
|
+
/**
|
|
3995
|
+
* The diagonals of the cell at (row, col) as drawn across its whole span: `down` from its visual top
|
|
3996
|
+
* left, `up` from its visual bottom left. Only the anchor's own lines draw, mirrored in an rtl
|
|
3997
|
+
* table; no built-in states a diagonal (C8) and a covered position's own are never read (C9).
|
|
3998
|
+
*/
|
|
3999
|
+
function tableCellDiagonals(table, grid, row, col) {
|
|
4000
|
+
const borders = cellOf(grid, row, col).cell?.props?.borders;
|
|
4001
|
+
const tlToBr = borders?.tlToBr ?? null;
|
|
4002
|
+
const blToTr = borders?.blToTr ?? null;
|
|
4003
|
+
return table.props?.rtl === true ? {
|
|
4004
|
+
down: blToTr,
|
|
4005
|
+
up: tlToBr
|
|
4006
|
+
} : {
|
|
4007
|
+
down: tlToBr,
|
|
4008
|
+
up: blToTr
|
|
3980
4009
|
};
|
|
3981
4010
|
}
|
|
3982
4011
|
/** PowerPoint's default grid: a 1-pt black line on every edge of a table that names no built-in (C8). */
|
|
@@ -4154,6 +4183,17 @@ function themedFill(fill, theme, colors) {
|
|
|
4154
4183
|
phClr: fill.ref.color === null ? null : resolveColor(fill.ref.color, colors)
|
|
4155
4184
|
};
|
|
4156
4185
|
}
|
|
4186
|
+
/** A style effect list with an `effectRef` followed into the theme, and the colour `phClr` takes. */
|
|
4187
|
+
function themedEffects(effects, theme, colors) {
|
|
4188
|
+
if (effects.kind === "value") return {
|
|
4189
|
+
effects: effects.value ?? [],
|
|
4190
|
+
phClr: null
|
|
4191
|
+
};
|
|
4192
|
+
return {
|
|
4193
|
+
effects: styleMatrixEffects(effects.ref, theme),
|
|
4194
|
+
phClr: effects.ref.color === null ? null : resolveColor(effects.ref.color, colors)
|
|
4195
|
+
};
|
|
4196
|
+
}
|
|
4157
4197
|
/** A style line with an `lnRef` followed into the theme, and the colour `phClr` takes in it. */
|
|
4158
4198
|
function themedLine(line, theme, colors) {
|
|
4159
4199
|
if (line.kind === "value") return {
|
|
@@ -4166,6 +4206,6 @@ function themedLine(line, theme, colors) {
|
|
|
4166
4206
|
};
|
|
4167
4207
|
}
|
|
4168
4208
|
//#endregion
|
|
4169
|
-
export { BUILTIN_TABLE_STYLES, BUILTIN_TEXT_STYLES, COLOR_TRANSFORM_OPS, DEFAULT_GRID_LINE, DEFAULT_PLACEHOLDER_IDX, DEFAULT_PLACEHOLDER_TYPE, INVENTED_COLUMN_WIDTH, LEVELS, MASTER_PLACEHOLDER_TYPES, MODEL_ERROR_CODES, ModelError, ORPHAN_RECT, PLACEHOLDER_TYPES, STYLE_MATRIX_OFFSET, TABLE_PART_ORDER, TABLE_URI, TEXT_FLOOR, backgroundSheet, bucketOf, builtinTableStyle, colorContextOf, colorMapOf, floorOf, inheritanceChain, isModelError, loadDocument, masterOf, masterPlaceholderType, matchInLayout, matchInMaster, normalizePlaceholder, parseBodyProps, parseBodyPropsChild, parseClrMap, parseColorChild, parseColorElement, parseDefaultTextStyle, parseEffects, parseFill, parseFillElement, parseGeometry, parseLine, parseLineElement, parseListStyle, parseParaProps, parseRunProps, parseSheet, parseTable, parseTableChild, parseTableStyle, parseTextBody, parseTextBodyChild, parseTextStyles, parseTheme, phClrOf, placeholders, requestedTypefaces, resolve, resolveAnchor, resolveAnchorCtr, resolveAppearance, resolveBackground, resolveBackgroundColor, resolveBody, resolveBulletAutoNum, resolveBulletBlip, resolveBulletChar, resolveBulletColor, resolveBulletFont, resolveBulletKind, resolveBulletSize, resolveColumns, resolveIndent, resolveInsets, resolveLatinTypeface, resolveMarginLeft, resolveOnSheet, resolveParagraph, resolveRun, resolveSize, resolveSolidFill, resolveTypeface, resolveTypefaceOf, resolveVertical, resolveWrap, resolveXfrm, schemeOf, sheetChain, styleMatrixEffects, styleMatrixFill, styleMatrixLine, styleMatrixTarget, tableBackground, tableCellFill, tableEdgeLine, tableGrid, tablePartsAt, tableStyleOf, tableTextLayer, textLevels, themeFontRef, themeOf, themedFill, themedLine };
|
|
4209
|
+
export { BUILTIN_TABLE_STYLES, BUILTIN_TEXT_STYLES, COLOR_TRANSFORM_OPS, DEFAULT_GRID_LINE, DEFAULT_PLACEHOLDER_IDX, DEFAULT_PLACEHOLDER_TYPE, INVENTED_COLUMN_WIDTH, LEVELS, MASTER_PLACEHOLDER_TYPES, MODEL_ERROR_CODES, ModelError, ORPHAN_RECT, PLACEHOLDER_TYPES, STYLE_MATRIX_OFFSET, TABLE_PART_ORDER, TABLE_URI, TEXT_FLOOR, backgroundSheet, bucketOf, builtinTableStyle, colorContextOf, colorMapOf, floorOf, inheritanceChain, isModelError, loadDocument, masterOf, masterPlaceholderType, matchInLayout, matchInMaster, normalizePlaceholder, parseBodyProps, parseBodyPropsChild, parseClrMap, parseColorChild, parseColorElement, parseDefaultTextStyle, parseEffects, parseFill, parseFillElement, parseGeometry, parseLine, parseLineElement, parseListStyle, parseParaProps, parseRunProps, parseSheet, parseTable, parseTableChild, parseTableStyle, parseTextBody, parseTextBodyChild, parseTextStyles, parseTheme, phClrOf, placeholders, requestedTypefaces, resolve, resolveAnchor, resolveAnchorCtr, resolveAppearance, resolveBackground, resolveBackgroundColor, resolveBody, resolveBulletAutoNum, resolveBulletBlip, resolveBulletChar, resolveBulletColor, resolveBulletFont, resolveBulletKind, resolveBulletSize, resolveColumns, resolveIndent, resolveInsets, resolveLatinTypeface, resolveMarginLeft, resolveOnSheet, resolveParagraph, resolveRun, resolveSize, resolveSolidFill, resolveTypeface, resolveTypefaceOf, resolveVertical, resolveWrap, resolveXfrm, schemeOf, sheetChain, styleMatrixEffects, styleMatrixFill, styleMatrixLine, styleMatrixTarget, tableBackground, tableCellDiagonals, tableCellFill, tableEdgeLine, tableGrid, tablePartsAt, tableStyleOf, tableTextLayer, textLevels, themeFontRef, themeOf, themedEffects, themedFill, themedLine };
|
|
4170
4210
|
|
|
4171
4211
|
//# sourceMappingURL=index.js.map
|