@openpresentation/opf 0.22.2 → 0.24.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/browser.js +16 -16
- package/dist/{chunk-X3PQMMAY.js → chunk-33OBLTKZ.js} +1 -1
- package/dist/{chunk-SPCONMIY.js → chunk-4I3XPRAO.js} +1 -1
- package/dist/{chunk-3T7MNRBY.js → chunk-5PHLSH4E.js} +1 -1
- package/dist/{chunk-MAJHCGOW.js → chunk-6WDLGY25.js} +4 -4
- package/dist/{chunk-3UAVON3O.js → chunk-BN3A5TVI.js} +194 -4
- package/dist/{chunk-23MOKE4B.js → chunk-F6CDJTSE.js} +43 -9
- package/dist/{chunk-BULGAKBY.js → chunk-H5GFPQAS.js} +2 -2
- package/dist/{chunk-SBWIZSPB.js → chunk-H77YYHPL.js} +5 -5
- package/dist/{chunk-MLMTXXM4.js → chunk-JHSTEBPC.js} +5 -5
- package/dist/{chunk-VKNFZEMG.js → chunk-N3ZPLGK5.js} +137 -16
- package/dist/{chunk-KUNXFN7B.js → chunk-RE4F2USA.js} +1 -1
- package/dist/{chunk-MG34DCDB.js → chunk-RP2KIC7W.js} +2 -2
- package/dist/{chunk-YSJRBRHB.js → chunk-RQACV2FR.js} +1 -1
- package/dist/{chunk-2SENTA2R.js → chunk-RXKXY75X.js} +1 -1
- package/dist/{chunk-YUIEWE5B.js → chunk-UIKXX5EX.js} +2 -2
- package/dist/{chunk-AHKRJSCF.js → chunk-VKPFDUR5.js} +6 -6
- package/dist/{chunk-7XNAMCGT.js → chunk-ZFNKRZZQ.js} +6 -6
- package/dist/{composition-CkHn6JrM.d.ts → composition-qX-igJe5.d.ts} +147 -15
- package/dist/composition.d.ts +1 -1
- package/dist/composition.js +1 -1
- package/dist/{conversion-C_MOkYGH.d.ts → conversion-O0XSW0ZV.d.ts} +5 -5
- package/dist/conversion-XITF66VJ.js +19 -0
- package/dist/convert.d.ts +2 -2
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +1 -1
- package/dist/data.js +2 -2
- package/dist/{deck-report-vnWmXBjq.d.ts → deck-report-CJ6gd_6-.d.ts} +2 -2
- package/dist/deck.d.ts +5 -5
- package/dist/deck.js +10 -10
- package/dist/diff.js +5 -5
- package/dist/docs.js +9 -9
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +5277 -839
- package/dist/format.js +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +20 -20
- package/dist/markdown.d.ts +3 -3
- package/dist/markdown.js +7 -7
- package/dist/node-engine.d.ts +7 -7
- package/dist/node-engine.js +20 -20
- package/dist/{pagination-C4jzAtFy.d.ts → pagination-LiWxhbsz.d.ts} +3 -1
- package/dist/pagination.d.ts +2 -2
- package/dist/pagination.js +4 -4
- package/dist/patch.js +4 -4
- package/dist/{presentation-fN6tORPZ.d.ts → presentation-Dn-fm0iY.d.ts} +35 -0
- package/dist/schemas.d.ts +4 -0
- package/dist/schemas.js +1 -1
- package/dist/spec/schemas/opf.schema.json +41 -1
- package/dist/spec/schemas/theme.schema.json +42 -3
- package/dist/types.d.ts +41 -1
- package/dist/{validation-types-B21fZfb2.d.ts → validation-types-CzPKoKWo.d.ts} +1 -1
- package/dist/{validator-Cflv4F9e.d.ts → validator-BuAV_HUo.d.ts} +2 -2
- package/dist/validator.d.ts +4 -4
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +3 -3
- package/dist/yaml.js +7 -7
- package/package.json +6 -6
- package/dist/conversion-LBQMY7LX.js +0 -19
package/dist/browser.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { OPFApiError } from './chunk-
|
|
2
|
-
export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-
|
|
1
|
+
import { OPFApiError } from './chunk-6WDLGY25.js';
|
|
2
|
+
export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-6WDLGY25.js';
|
|
3
3
|
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-UJSAR6GF.js';
|
|
4
|
-
export { OPFDataImportError, ingest, parseTabularData } from './chunk-
|
|
5
|
-
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-
|
|
6
|
-
export { fromMarkdown, toMarkdown } from './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
export { OPFMarkdownError } from './chunk-
|
|
9
|
-
export { diff, merge } from './chunk-
|
|
10
|
-
export { OPFPatchError, OPFPatchValidationError, applyPatch } from './chunk-
|
|
11
|
-
export { OPFFormatError, format } from './chunk-
|
|
12
|
-
export { OPFPaginationError, paginate, paginateSlide } from './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-
|
|
16
|
-
export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, LOGO_SHAPES, OPFCatalogsOptionError, OPFUnresolvedReferenceError, OPFVariableError, SLIDE_SCOPED_BUILTINS, SOCIAL_PLATFORMS, VARIABLE_KINDS, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isTemplate, isXYChartType, listBuiltinVariables, listVariables, normalizeLanguageFamily, numberFormatError, parseReference, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-
|
|
17
|
-
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-
|
|
4
|
+
export { OPFDataImportError, ingest, parseTabularData } from './chunk-4I3XPRAO.js';
|
|
5
|
+
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-JHSTEBPC.js';
|
|
6
|
+
export { fromMarkdown, toMarkdown } from './chunk-H77YYHPL.js';
|
|
7
|
+
import './chunk-ZFNKRZZQ.js';
|
|
8
|
+
export { OPFMarkdownError } from './chunk-5PHLSH4E.js';
|
|
9
|
+
export { diff, merge } from './chunk-H5GFPQAS.js';
|
|
10
|
+
export { OPFPatchError, OPFPatchValidationError, applyPatch } from './chunk-RQACV2FR.js';
|
|
11
|
+
export { OPFFormatError, format } from './chunk-33OBLTKZ.js';
|
|
12
|
+
export { OPFPaginationError, paginate, paginateSlide } from './chunk-UIKXX5EX.js';
|
|
13
|
+
import './chunk-RE4F2USA.js';
|
|
14
|
+
import './chunk-RXKXY75X.js';
|
|
15
|
+
export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-F6CDJTSE.js';
|
|
16
|
+
export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, LOGO_SHAPES, OPFCatalogsOptionError, OPFUnresolvedReferenceError, OPFVariableError, SLIDE_SCOPED_BUILTINS, SOCIAL_PLATFORMS, VARIABLE_KINDS, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isTemplate, isXYChartType, listBuiltinVariables, listVariables, normalizeLanguageFamily, numberFormatError, parseReference, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveReference, resolveSlideVariables, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unresolvedReference, unusedDatasets, variableDeclarations } from './chunk-N3ZPLGK5.js';
|
|
17
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-BN3A5TVI.js';
|
|
18
18
|
export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-F7PLNWHQ.js';
|
|
19
19
|
|
|
20
20
|
// src/browser.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OPFDataImportError, parseTabularData } from './chunk-
|
|
2
|
-
import { applyPatchWithInverse } from './chunk-
|
|
3
|
-
import { validate, OPFValidationError } from './chunk-
|
|
4
|
-
import { embeddedCopy, checkCatalogsOption, catalogReferenceSites, parseReference, catalogGroupDeclared, resolveReference, dottedPath, unresolvedReference, recordReferenceSites, catalogGroupSource, registeredCatalog, catalogKinds, CATALOG_GROUP_PATTERN, isRecord, visitContentPayloads, annotationText, listVariables, resolveVariables, LOGO_SHAPES, resolveDesignRecords, resolveFontFamilies, resolveCanvasDimensions, imageBackground } from './chunk-
|
|
1
|
+
import { OPFDataImportError, parseTabularData } from './chunk-4I3XPRAO.js';
|
|
2
|
+
import { applyPatchWithInverse } from './chunk-RQACV2FR.js';
|
|
3
|
+
import { validate, OPFValidationError } from './chunk-F6CDJTSE.js';
|
|
4
|
+
import { embeddedCopy, checkCatalogsOption, catalogReferenceSites, parseReference, catalogGroupDeclared, resolveReference, dottedPath, unresolvedReference, recordReferenceSites, catalogGroupSource, registeredCatalog, catalogKinds, CATALOG_GROUP_PATTERN, isRecord, visitContentPayloads, annotationText, listVariables, resolveVariables, LOGO_SHAPES, resolveDesignRecords, resolveFontFamilies, resolveCanvasDimensions, imageBackground } from './chunk-N3ZPLGK5.js';
|
|
5
5
|
|
|
6
6
|
// src/api-errors.ts
|
|
7
7
|
var OPFApiError = class extends Error {
|
|
@@ -1019,7 +1019,6 @@ var presentation = {
|
|
|
1019
1019
|
"examples": [
|
|
1020
1020
|
"minimal",
|
|
1021
1021
|
"classic",
|
|
1022
|
-
"dark",
|
|
1023
1022
|
"bold",
|
|
1024
1023
|
"acme:brand"
|
|
1025
1024
|
]
|
|
@@ -1100,6 +1099,31 @@ var presentation = {
|
|
|
1100
1099
|
}
|
|
1101
1100
|
]
|
|
1102
1101
|
},
|
|
1102
|
+
"variant": {
|
|
1103
|
+
"oneOf": [
|
|
1104
|
+
{
|
|
1105
|
+
"$ref": "#/$defs/ThemeBackgroundSlot"
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
"$ref": "#/$defs/ColorVariant"
|
|
1109
|
+
}
|
|
1110
|
+
],
|
|
1111
|
+
"description": "Optional color variant, as a background slot ('light1', 'light2', 'dark1', 'dark2'; the same as { background: slot }) or the object form, which is needed only for an accent order: which slot of the color scheme is the slide background (and so which are the text and the alternate surface), and optionally the order of the accents. A variant is a mapping over the same twelve-slot scheme, as PowerPoint's color map is, never a second scheme. Without it the background decides: a theme-slot background ('dark1', { type: 'theme', slot }) is the variant of that slot, a picture or gradient takes its 'tone', and any other background picks light or dark by its luminance. A slide's variant replaces the deck's whole, including its accent order.",
|
|
1112
|
+
"examples": [
|
|
1113
|
+
"dark1",
|
|
1114
|
+
{
|
|
1115
|
+
"background": "light1",
|
|
1116
|
+
"accents": [
|
|
1117
|
+
"accent2",
|
|
1118
|
+
"accent1",
|
|
1119
|
+
"accent3",
|
|
1120
|
+
"accent4",
|
|
1121
|
+
"accent5",
|
|
1122
|
+
"accent6"
|
|
1123
|
+
]
|
|
1124
|
+
}
|
|
1125
|
+
]
|
|
1126
|
+
},
|
|
1103
1127
|
"logo": {
|
|
1104
1128
|
"oneOf": [
|
|
1105
1129
|
{
|
|
@@ -2102,6 +2126,64 @@ var presentation = {
|
|
|
2102
2126
|
"./images/harbour.jpg"
|
|
2103
2127
|
]
|
|
2104
2128
|
},
|
|
2129
|
+
"ColorVariant": {
|
|
2130
|
+
"type": "object",
|
|
2131
|
+
"additionalProperties": false,
|
|
2132
|
+
"required": [
|
|
2133
|
+
"background"
|
|
2134
|
+
],
|
|
2135
|
+
"description": "A variant of the deck's single color scheme, as a mapping over its twelve slots (PowerPoint's clrMap): 'background' is the slot the slide background and the role bg1 take, and with it the other roles: light1 maps bg1 = light1, tx1 = dark1, bg2 = light2, tx2 = dark2; dark1 maps bg1 = dark1, tx1 = light1, bg2 = dark2, tx2 = light2; light2 and dark2 make that slot both the background and the alternate surface (light2: bg1 = bg2 = light2, tx1 = dark1, tx2 = dark2; dark2: bg1 = bg2 = dark2, tx1 = light1, tx2 = light2), which is how a slide with that theme background has always been drawn. Text, secondary text, the card surface and every neutral (borders, gridlines, chart axis, code panel) follow the map. The PowerPoint export writes it as the master's clrMap, or a slide's clrMapOvr.",
|
|
2136
|
+
"properties": {
|
|
2137
|
+
"background": {
|
|
2138
|
+
"$ref": "#/$defs/ThemeBackgroundSlot",
|
|
2139
|
+
"description": "The scheme slot that is the background (bg1) of the variant."
|
|
2140
|
+
},
|
|
2141
|
+
"accents": {
|
|
2142
|
+
"type": "array",
|
|
2143
|
+
"minItems": 6,
|
|
2144
|
+
"maxItems": 6,
|
|
2145
|
+
"uniqueItems": true,
|
|
2146
|
+
"items": {
|
|
2147
|
+
"type": "string",
|
|
2148
|
+
"enum": [
|
|
2149
|
+
"accent1",
|
|
2150
|
+
"accent2",
|
|
2151
|
+
"accent3",
|
|
2152
|
+
"accent4",
|
|
2153
|
+
"accent5",
|
|
2154
|
+
"accent6"
|
|
2155
|
+
]
|
|
2156
|
+
},
|
|
2157
|
+
"description": "Optional accent order: a permutation of accent1 to accent6. Entry i is the scheme slot drawn as accent i + 1, so primary, secondary and accent (the first three) and the chart series colors follow it. Default: the scheme's own order.",
|
|
2158
|
+
"examples": [
|
|
2159
|
+
[
|
|
2160
|
+
"accent2",
|
|
2161
|
+
"accent1",
|
|
2162
|
+
"accent3",
|
|
2163
|
+
"accent4",
|
|
2164
|
+
"accent5",
|
|
2165
|
+
"accent6"
|
|
2166
|
+
]
|
|
2167
|
+
]
|
|
2168
|
+
}
|
|
2169
|
+
},
|
|
2170
|
+
"examples": [
|
|
2171
|
+
{
|
|
2172
|
+
"background": "dark1"
|
|
2173
|
+
},
|
|
2174
|
+
{
|
|
2175
|
+
"background": "light2",
|
|
2176
|
+
"accents": [
|
|
2177
|
+
"accent2",
|
|
2178
|
+
"accent1",
|
|
2179
|
+
"accent3",
|
|
2180
|
+
"accent4",
|
|
2181
|
+
"accent5",
|
|
2182
|
+
"accent6"
|
|
2183
|
+
]
|
|
2184
|
+
}
|
|
2185
|
+
]
|
|
2186
|
+
},
|
|
2105
2187
|
"Background": {
|
|
2106
2188
|
"description": "Background fill applied to slides. Theme backgrounds preserve PowerPoint's color-scheme background choice; other variants represent fixed background fills.",
|
|
2107
2189
|
"oneOf": [
|
|
@@ -2178,6 +2260,14 @@ var presentation = {
|
|
|
2178
2260
|
"gradient"
|
|
2179
2261
|
],
|
|
2180
2262
|
"properties": {
|
|
2263
|
+
"tone": {
|
|
2264
|
+
"type": "string",
|
|
2265
|
+
"enum": [
|
|
2266
|
+
"dark",
|
|
2267
|
+
"light"
|
|
2268
|
+
],
|
|
2269
|
+
"description": "Whether the background is dark or light, which picks the color map (dark1 or light1) so text, lines and neutrals read on it. Without a tone a picture or gradient takes the deck's variant, else counts as light."
|
|
2270
|
+
},
|
|
2181
2271
|
"type": {
|
|
2182
2272
|
"type": "string",
|
|
2183
2273
|
"const": "gradient",
|
|
@@ -2239,6 +2329,14 @@ var presentation = {
|
|
|
2239
2329
|
"src"
|
|
2240
2330
|
],
|
|
2241
2331
|
"properties": {
|
|
2332
|
+
"tone": {
|
|
2333
|
+
"type": "string",
|
|
2334
|
+
"enum": [
|
|
2335
|
+
"dark",
|
|
2336
|
+
"light"
|
|
2337
|
+
],
|
|
2338
|
+
"description": "Whether the background is dark or light, which picks the color map (dark1 or light1) so text, lines and neutrals read on it. Without a tone a picture or gradient takes the deck's variant, else counts as light."
|
|
2339
|
+
},
|
|
2242
2340
|
"type": {
|
|
2243
2341
|
"type": "string",
|
|
2244
2342
|
"const": "image",
|
|
@@ -6328,7 +6426,6 @@ var theme = {
|
|
|
6328
6426
|
"examples": [
|
|
6329
6427
|
"minimal",
|
|
6330
6428
|
"classic",
|
|
6331
|
-
"dark",
|
|
6332
6429
|
"bold"
|
|
6333
6430
|
]
|
|
6334
6431
|
},
|
|
@@ -6338,7 +6435,6 @@ var theme = {
|
|
|
6338
6435
|
"examples": [
|
|
6339
6436
|
"Minimal",
|
|
6340
6437
|
"Classic",
|
|
6341
|
-
"Dark",
|
|
6342
6438
|
"Bold"
|
|
6343
6439
|
]
|
|
6344
6440
|
},
|
|
@@ -6347,7 +6443,7 @@ var theme = {
|
|
|
6347
6443
|
"description": "One-sentence positioning of the theme \u2014 when to reach for it.",
|
|
6348
6444
|
"examples": [
|
|
6349
6445
|
"A clean, minimalist theme for professional, straightforward presentations.",
|
|
6350
|
-
"A
|
|
6446
|
+
"A vibrant, high-energy theme with bold colors for presentations that need to stand out."
|
|
6351
6447
|
]
|
|
6352
6448
|
},
|
|
6353
6449
|
"description": {
|
|
@@ -6381,6 +6477,42 @@ var theme = {
|
|
|
6381
6477
|
"background": {
|
|
6382
6478
|
"$ref": "#/$defs/ThemeBackground"
|
|
6383
6479
|
},
|
|
6480
|
+
"variants": {
|
|
6481
|
+
"type": "array",
|
|
6482
|
+
"items": {
|
|
6483
|
+
"$ref": "#/$defs/ThemeVariant"
|
|
6484
|
+
},
|
|
6485
|
+
"description": "The color variants the theme offers (OPF 0.23), for example light, light-alt, dark and dark-alt: named values of design.variant over the theme's one color scheme, so a dark deck is a variant of a theme and not a theme of its own. A picker lists them by name; choosing one sets design.variant (or a slide's design.variant) to the entry's 'variant'. A document stores that value and never the id, so a variant needs no record and the theme does not change when its variants do. The entry ids are unique within a theme.",
|
|
6486
|
+
"examples": [
|
|
6487
|
+
[
|
|
6488
|
+
{
|
|
6489
|
+
"id": "light",
|
|
6490
|
+
"name": "Light",
|
|
6491
|
+
"variant": "light1"
|
|
6492
|
+
},
|
|
6493
|
+
{
|
|
6494
|
+
"id": "dark",
|
|
6495
|
+
"name": "Dark",
|
|
6496
|
+
"variant": "dark1"
|
|
6497
|
+
},
|
|
6498
|
+
{
|
|
6499
|
+
"id": "dark-alt",
|
|
6500
|
+
"name": "Dark alt",
|
|
6501
|
+
"variant": {
|
|
6502
|
+
"background": "dark1",
|
|
6503
|
+
"accents": [
|
|
6504
|
+
"accent2",
|
|
6505
|
+
"accent1",
|
|
6506
|
+
"accent3",
|
|
6507
|
+
"accent4",
|
|
6508
|
+
"accent5",
|
|
6509
|
+
"accent6"
|
|
6510
|
+
]
|
|
6511
|
+
}
|
|
6512
|
+
}
|
|
6513
|
+
]
|
|
6514
|
+
]
|
|
6515
|
+
},
|
|
6384
6516
|
"dimensions": {
|
|
6385
6517
|
"type": "string",
|
|
6386
6518
|
"enum": [
|
|
@@ -6518,6 +6650,64 @@ var theme = {
|
|
|
6518
6650
|
}
|
|
6519
6651
|
},
|
|
6520
6652
|
"$defs": {
|
|
6653
|
+
"ThemeVariant": {
|
|
6654
|
+
"type": "object",
|
|
6655
|
+
"additionalProperties": false,
|
|
6656
|
+
"required": [
|
|
6657
|
+
"id",
|
|
6658
|
+
"name",
|
|
6659
|
+
"variant"
|
|
6660
|
+
],
|
|
6661
|
+
"description": "One named color variant of a theme.",
|
|
6662
|
+
"properties": {
|
|
6663
|
+
"id": {
|
|
6664
|
+
"type": "string",
|
|
6665
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
6666
|
+
"description": "The variant's id within the theme, lowercase kebab-case.",
|
|
6667
|
+
"examples": [
|
|
6668
|
+
"light",
|
|
6669
|
+
"light-alt",
|
|
6670
|
+
"dark",
|
|
6671
|
+
"dark-alt"
|
|
6672
|
+
]
|
|
6673
|
+
},
|
|
6674
|
+
"name": {
|
|
6675
|
+
"type": "string",
|
|
6676
|
+
"description": "Human-readable variant name shown in pickers.",
|
|
6677
|
+
"examples": [
|
|
6678
|
+
"Light",
|
|
6679
|
+
"Light alt",
|
|
6680
|
+
"Dark",
|
|
6681
|
+
"Dark alt"
|
|
6682
|
+
]
|
|
6683
|
+
},
|
|
6684
|
+
"variant": {
|
|
6685
|
+
"description": "The value design.variant takes when the variant is chosen: a background slot ('light1', 'light2', 'dark1', 'dark2'; the same as { background: slot }) or the ColorVariant object of opf.schema.json, which adds an accent order.",
|
|
6686
|
+
"oneOf": [
|
|
6687
|
+
{
|
|
6688
|
+
"$ref": "#/$defs/ThemeBackgroundSlot"
|
|
6689
|
+
},
|
|
6690
|
+
{
|
|
6691
|
+
"$ref": "https://openpresentation.org/schema/opf/v1#/$defs/ColorVariant"
|
|
6692
|
+
}
|
|
6693
|
+
],
|
|
6694
|
+
"examples": [
|
|
6695
|
+
"dark1",
|
|
6696
|
+
{
|
|
6697
|
+
"background": "light1",
|
|
6698
|
+
"accents": [
|
|
6699
|
+
"accent6",
|
|
6700
|
+
"accent5",
|
|
6701
|
+
"accent4",
|
|
6702
|
+
"accent1",
|
|
6703
|
+
"accent3",
|
|
6704
|
+
"accent2"
|
|
6705
|
+
]
|
|
6706
|
+
}
|
|
6707
|
+
]
|
|
6708
|
+
}
|
|
6709
|
+
}
|
|
6710
|
+
},
|
|
6521
6711
|
"ThemeBackgroundSlot": {
|
|
6522
6712
|
"type": "string",
|
|
6523
6713
|
"description": "PowerPoint theme-controlled slide background slot from the active color scheme. These are slots, not assumptions about actual colors: light1 is usually white and dark1 is usually black by convention, but the color scheme controls the real values.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { promotedRegionKeys, VARIABLE_KINDS, resolveChartData, chartPaletteForFill, chartSeriesPalette, normalizeHexColor, resolveChartColors, colorContrast, imageBackground, tableGrid, timelineTextColor, LOGO_SHAPES, visitContentPayloads, readingRows, visualReadingOrder, intrinsicImageSize, resolveReference, textWidthMeasurer, resolveColorRef, resolveDesignRecords, resolveFontFamilies, checkCatalogsOption, provenanceOf, unresolvedReference, OPFUnresolvedReferenceError, resolveColorRoles, resolveCanvasDimensions, resolveSlideVariables,
|
|
2
|
-
import { schemas, schemaEntries } from './chunk-
|
|
1
|
+
import { promotedRegionKeys, VARIABLE_KINDS, resolveChartData, chartPaletteForFill, chartSeriesPalette, normalizeHexColor, resolveChartColors, colorContrast, imageBackground, tableGrid, timelineTextColor, LOGO_SHAPES, visitContentPayloads, readingRows, visualReadingOrder, intrinsicImageSize, resolveReference, textWidthMeasurer, resolveColorRef, resolveDesignRecords, resolveFontFamilies, checkCatalogsOption, provenanceOf, unresolvedReference, OPFUnresolvedReferenceError, resolveColorRoles, resolveCanvasDimensions, resolveSlideVariables, normalizeColorVariant, isRecord, hasContentVariables, isTemplate, instantiateForValidation, layoutTemplateIssues, resolveScriptFonts, defaultSlideBackground, catalogReferenceSites, parseReference, catalogGroupDeclared, pointerPath, unusedDatasets, MAX_COMPOSITION_DEPTH, datasetDiagnostics, pathFor, catalogRecords, collectCitations, numberingFindings, walkCitationRuns, resolveTableData, resolveChartOptions, chartOptionTarget, codeHighlightLines, chartNumberFixesByCell, catalogKinds, catalogGroupSource, registeredCatalog, OPFCompositionError, composeSlide } from './chunk-N3ZPLGK5.js';
|
|
2
|
+
import { schemas, schemaEntries } from './chunk-BN3A5TVI.js';
|
|
3
3
|
import Ajv2020 from 'ajv/dist/2020.js';
|
|
4
4
|
import addFormats from 'ajv-formats';
|
|
5
5
|
import { parseTree, printParseErrorCode, getNodePath } from 'jsonc-parser';
|
|
@@ -1230,9 +1230,9 @@ function simulateVision(hex, model) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
var PAGE = "#FFFFFF";
|
|
1232
1232
|
var colorFrom = (scheme, slot, fallback) => typeof slot === "string" ? slot.startsWith("#") ? normalizeHexColor(slot) ?? fallback : normalizeHexColor(scheme[slot]) ?? fallback : fallback;
|
|
1233
|
-
function backdropOf(definition, scheme, text, variables) {
|
|
1233
|
+
function backdropOf(definition, scheme, text, variables, canvasColor) {
|
|
1234
1234
|
const resolve2 = (value, fallback) => backgroundColorRef(value, scheme, variables, fallback);
|
|
1235
|
-
const canvas = defaultSlideBackground(scheme);
|
|
1235
|
+
const canvas = canvasColor ?? defaultSlideBackground(scheme);
|
|
1236
1236
|
if (!definition) return { kind: "solid", color: canvas };
|
|
1237
1237
|
if (imageBackground(definition)) return { kind: "image", opacity: imageBackground(definition)?.opacity ?? 1, base: PAGE };
|
|
1238
1238
|
if (typeof definition === "string") return { kind: "solid", color: colorFrom(scheme, definition, canvas) };
|
|
@@ -1299,6 +1299,34 @@ function decisionColor(definition, scheme, variables = {}) {
|
|
|
1299
1299
|
return void 0;
|
|
1300
1300
|
}
|
|
1301
1301
|
}
|
|
1302
|
+
var THEME_SLOTS = /* @__PURE__ */ new Set(["light1", "light2", "dark1", "dark2"]);
|
|
1303
|
+
function colorChoice(levels, scheme, variables = {}) {
|
|
1304
|
+
let variantOnly = false;
|
|
1305
|
+
let picture;
|
|
1306
|
+
for (const level of levels) {
|
|
1307
|
+
const definition = level.background;
|
|
1308
|
+
const slot = typeof definition === "string" ? definition : rec(definition).type === "theme" ? rec(definition).slot : void 0;
|
|
1309
|
+
const themeSlot = THEME_SLOTS.has(slot) ? slot : void 0;
|
|
1310
|
+
const isPicture = imageBackground(definition) !== void 0 || rec(definition).type === "gradient";
|
|
1311
|
+
const variant = normalizeColorVariant(level.variant);
|
|
1312
|
+
if (variant) {
|
|
1313
|
+
const fill = definition !== void 0 && !variantOnly && !themeSlot && !isPicture ? decisionColor(definition, scheme, variables) : void 0;
|
|
1314
|
+
const own2 = definition !== void 0 && !variantOnly && !themeSlot;
|
|
1315
|
+
return { variant, ...fill ? { background: fill } : {}, drawn: variantOnly ? picture : { definition: own2 ? definition : void 0 } };
|
|
1316
|
+
}
|
|
1317
|
+
if (variantOnly || definition === void 0 || definition === null || definition === false) continue;
|
|
1318
|
+
if (themeSlot) return { variant: { background: themeSlot } };
|
|
1319
|
+
if (isPicture) {
|
|
1320
|
+
const tone = rec(definition).tone;
|
|
1321
|
+
if (tone === "dark" || tone === "light") return { variant: { background: tone === "dark" ? "dark1" : "light1" } };
|
|
1322
|
+
variantOnly = true;
|
|
1323
|
+
picture = { definition };
|
|
1324
|
+
continue;
|
|
1325
|
+
}
|
|
1326
|
+
return { background: decisionColor(definition, scheme, variables) };
|
|
1327
|
+
}
|
|
1328
|
+
return {};
|
|
1329
|
+
}
|
|
1302
1330
|
function resolveDesign(document, index, context) {
|
|
1303
1331
|
const deck = rec(document.design), own2 = rec(rec(rec(document.slides)[index]).design);
|
|
1304
1332
|
const { options, diagnostics, resolved } = context;
|
|
@@ -1307,11 +1335,12 @@ function resolveDesign(document, index, context) {
|
|
|
1307
1335
|
const fontDiagnostic = diagnostics.find((diagnostic) => diagnostic.kind === "fontSchemes");
|
|
1308
1336
|
const dimensions = { width: options.width, height: options.height };
|
|
1309
1337
|
const variables = rec(document.variables);
|
|
1310
|
-
const
|
|
1338
|
+
const choice = colorChoice([own2, deck, theme], colorScheme, variables);
|
|
1339
|
+
const roles = resolveColorRoles(colorScheme, { background: choice.background, variant: choice.variant });
|
|
1311
1340
|
const dark = roles.dark;
|
|
1312
1341
|
const text = roles.text;
|
|
1313
|
-
const backdrop = backdropOf(own2.background ?? deck.background ?? theme.background, colorScheme, text, variables);
|
|
1314
|
-
const picture = imageBackground(own2.background ?? deck.background ?? theme.background);
|
|
1342
|
+
const backdrop = backdropOf(choice.drawn ? choice.drawn.definition : own2.background ?? deck.background ?? theme.background, colorScheme, text, variables, roles.map.bg1 === "light1" ? void 0 : roles.background);
|
|
1343
|
+
const picture = imageBackground(choice.drawn ? choice.drawn.definition : own2.background ?? deck.background ?? theme.background);
|
|
1315
1344
|
const backgroundImage = picture && own2.background !== void 0 ? { source: picture.src, fit: picture.fit, path: `/slides/${index}/design/background` } : picture && deck.background !== void 0 ? { source: picture.src, fit: picture.fit, path: "/design/background" } : void 0;
|
|
1316
1345
|
return {
|
|
1317
1346
|
theme,
|
|
@@ -1321,6 +1350,10 @@ function resolveDesign(document, index, context) {
|
|
|
1321
1350
|
dimensions,
|
|
1322
1351
|
backdrop,
|
|
1323
1352
|
dark,
|
|
1353
|
+
variant: roles.variant,
|
|
1354
|
+
map: roles.map,
|
|
1355
|
+
accents: roles.accents,
|
|
1356
|
+
neutrals: roles.neutrals,
|
|
1324
1357
|
colors: {
|
|
1325
1358
|
background: roles.background,
|
|
1326
1359
|
surface: roles.surface,
|
|
@@ -3629,6 +3662,7 @@ function resolveSlideContext(presentation, index, options = {}) {
|
|
|
3629
3662
|
} else diagnostics.push(unresolvedReference(presentation, "layouts", slide.layout, `slides.${index}.layout`, catalogs));
|
|
3630
3663
|
}
|
|
3631
3664
|
if (options.strictReferences && diagnostics.length) throw new OPFUnresolvedReferenceError(diagnostics);
|
|
3665
|
+
const roles = resolveColorRoles(colorScheme, colorChoice([rec2(slide.design), rec2(deck.design), theme], colorScheme, rec2(deck.variables)));
|
|
3632
3666
|
const composeOptions = {
|
|
3633
3667
|
...resolveCanvasDimensions(design.dimensions ?? theme.dimensions),
|
|
3634
3668
|
...layout ? { layout } : {},
|
|
@@ -3637,7 +3671,7 @@ function resolveSlideContext(presentation, index, options = {}) {
|
|
|
3637
3671
|
slideNumber: options.slideNumber ?? index + 1,
|
|
3638
3672
|
slideCount: options.slideCount ?? slides.length,
|
|
3639
3673
|
fontFamilies: resolveFontFamilies(fontScheme),
|
|
3640
|
-
darkBackground:
|
|
3674
|
+
darkBackground: roles.dark,
|
|
3641
3675
|
...theme.background !== void 0 ? { themeBackground: theme.background } : {},
|
|
3642
3676
|
// OPF 0.19: a theme may carry the shared design keys (between the deck's design and the layout record's).
|
|
3643
3677
|
...theme.design !== void 0 && rec2(theme.design) === theme.design ? { themeDesign: theme.design } : {},
|
|
@@ -3645,7 +3679,7 @@ function resolveSlideContext(presentation, index, options = {}) {
|
|
|
3645
3679
|
...options.date !== void 0 ? { date: options.date } : {}
|
|
3646
3680
|
};
|
|
3647
3681
|
const resolvedSlide = resolveSlideVariables(slide, { slideNumber: composeOptions.slideNumber, slideCount: composeOptions.slideCount, presentation, darkBackground: composeOptions.darkBackground === true });
|
|
3648
|
-
return { slide: resolvedSlide, options: composeOptions, diagnostics, resolved: { theme, colorScheme, fontScheme, fontSchemePath: records.fontSchemePath, ...layout ? { layout } : {}, provenance: { ...layoutProvenance ? { layout: layoutProvenance } : {}, ...records.provenance } } };
|
|
3682
|
+
return { slide: resolvedSlide, options: composeOptions, diagnostics, resolved: { theme, colorScheme, roles, fontScheme, fontSchemePath: records.fontSchemePath, ...layout ? { layout } : {}, provenance: { ...layoutProvenance ? { layout: layoutProvenance } : {}, ...records.provenance } } };
|
|
3649
3683
|
}
|
|
3650
3684
|
|
|
3651
3685
|
// src/rule-slides.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsonEqual, formatPointer } from './chunk-
|
|
2
|
-
import { annotationText } from './chunk-
|
|
1
|
+
import { jsonEqual, formatPointer } from './chunk-RQACV2FR.js';
|
|
2
|
+
import { annotationText } from './chunk-N3ZPLGK5.js';
|
|
3
3
|
|
|
4
4
|
// src/diff-match.ts
|
|
5
5
|
var DEFAULT_MATCH_THRESHOLD = 0.5;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Ctx, splitLines, lineRange, readYamlMapping, NOT_CHECKED, OPFMarkdownError, writeYaml, readCsv, DECIMAL, csvField, scalarText } from './chunk-
|
|
2
|
-
import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen, fenceCode } from './chunk-
|
|
3
|
-
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-
|
|
4
|
-
import { validate } from './chunk-
|
|
5
|
-
import { checkCatalogsOption, PROMOTED_REGION_KEY } from './chunk-
|
|
1
|
+
import { Ctx, splitLines, lineRange, readYamlMapping, NOT_CHECKED, OPFMarkdownError, writeYaml, readCsv, DECIMAL, csvField, scalarText } from './chunk-5PHLSH4E.js';
|
|
2
|
+
import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen, fenceCode } from './chunk-RE4F2USA.js';
|
|
3
|
+
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-RXKXY75X.js';
|
|
4
|
+
import { validate } from './chunk-F6CDJTSE.js';
|
|
5
|
+
import { checkCatalogsOption, PROMOTED_REGION_KEY } from './chunk-N3ZPLGK5.js';
|
|
6
6
|
|
|
7
7
|
// src/markdown/canon.ts
|
|
8
8
|
var FORMAT_KEYS = FORMATTING;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fromMarkdown, toMarkdown } from './chunk-
|
|
2
|
-
import { fromYaml, toYaml } from './chunk-
|
|
3
|
-
import { NOT_CHECKED } from './chunk-
|
|
4
|
-
import { parseSource, validate, OPFValidationError } from './chunk-
|
|
5
|
-
import { checkCatalogsOption } from './chunk-
|
|
1
|
+
import { fromMarkdown, toMarkdown } from './chunk-H77YYHPL.js';
|
|
2
|
+
import { fromYaml, toYaml } from './chunk-ZFNKRZZQ.js';
|
|
3
|
+
import { NOT_CHECKED } from './chunk-5PHLSH4E.js';
|
|
4
|
+
import { parseSource, validate, OPFValidationError } from './chunk-F6CDJTSE.js';
|
|
5
|
+
import { checkCatalogsOption } from './chunk-N3ZPLGK5.js';
|
|
6
6
|
|
|
7
7
|
// src/deck-report.ts
|
|
8
8
|
var DECK_FORMATS = ["json", "yaml", "markdown"];
|