@openpresentation/opf 0.24.2 → 0.25.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-JHSTEBPC.js → chunk-3OE6PZIC.js} +5 -5
- package/dist/{chunk-33OBLTKZ.js → chunk-EQ6S5SEZ.js} +1 -1
- package/dist/{chunk-BN3A5TVI.js → chunk-F4HFDP6I.js} +206 -123
- package/dist/{chunk-ZFNKRZZQ.js → chunk-F5ABHDUX.js} +6 -6
- package/dist/{chunk-UIKXX5EX.js → chunk-FITOGMR3.js} +2 -2
- package/dist/{chunk-5PHLSH4E.js → chunk-GS37EBPQ.js} +1 -1
- package/dist/{chunk-RP2KIC7W.js → chunk-IC6OPLMU.js} +2 -2
- package/dist/{chunk-RE4F2USA.js → chunk-IWFXFWGD.js} +1 -1
- package/dist/{chunk-RQACV2FR.js → chunk-IY5SCRTV.js} +1 -1
- package/dist/{chunk-RXKXY75X.js → chunk-LU6XM5JQ.js} +1 -1
- package/dist/{chunk-H77YYHPL.js → chunk-MJ57RSYO.js} +5 -5
- package/dist/{chunk-F6CDJTSE.js → chunk-P7S3ORB4.js} +9 -9
- package/dist/{chunk-4I3XPRAO.js → chunk-TKQ2VFV5.js} +1 -1
- package/dist/{chunk-6WDLGY25.js → chunk-WW62PPYV.js} +4 -4
- package/dist/{chunk-H5GFPQAS.js → chunk-X7RANZWP.js} +2 -2
- package/dist/{chunk-N3ZPLGK5.js → chunk-XRMV2GMB.js} +365 -266
- package/dist/{chunk-DRCN5PFH.js → chunk-YJNFNRZS.js} +6 -6
- package/dist/{composition-qX-igJe5.d.ts → composition-Daqvi-GV.d.ts} +47 -28
- package/dist/composition.d.ts +1 -1
- package/dist/composition.js +1 -1
- package/dist/{conversion-O0XSW0ZV.d.ts → conversion-BOQWy6ex.d.ts} +5 -5
- package/dist/conversion-I67NMZEW.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-CJ6gd_6-.d.ts → deck-report-DHaboWbM.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 +20 -14
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +9555 -15758
- 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-LiWxhbsz.d.ts → pagination-R8YFwVj7.d.ts} +1 -1
- package/dist/pagination.d.ts +2 -2
- package/dist/pagination.js +4 -4
- package/dist/patch.js +4 -4
- package/dist/{presentation-Dn-fm0iY.d.ts → presentation-Bwo8Ko6D.d.ts} +1 -1
- package/dist/repo-readme.js +1 -1
- package/dist/schemas.d.ts +8 -0
- package/dist/schemas.js +1 -1
- package/dist/spec/README.md +1 -1
- package/dist/spec/schemas/layout.schema.json +175 -88
- package/dist/spec/schemas/opf.schema.json +4 -4
- package/dist/types.d.ts +72 -24
- package/dist/{validation-types-CzPKoKWo.d.ts → validation-types-JW8e06ee.d.ts} +1 -1
- package/dist/{validator-BuAV_HUo.d.ts → validator-Dym2zYVK.d.ts} +3 -3
- 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-MTGISXNM.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-WW62PPYV.js';
|
|
2
|
+
export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, edit, embed, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, stats, updateFromCatalog } from './chunk-WW62PPYV.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-TKQ2VFV5.js';
|
|
5
|
+
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-3OE6PZIC.js';
|
|
6
|
+
export { fromMarkdown, toMarkdown } from './chunk-MJ57RSYO.js';
|
|
7
|
+
import './chunk-F5ABHDUX.js';
|
|
8
|
+
export { OPFMarkdownError } from './chunk-GS37EBPQ.js';
|
|
9
|
+
export { diff, merge } from './chunk-X7RANZWP.js';
|
|
10
|
+
export { OPFPatchError, OPFPatchValidationError, applyPatch } from './chunk-IY5SCRTV.js';
|
|
11
|
+
export { OPFFormatError, format } from './chunk-EQ6S5SEZ.js';
|
|
12
|
+
export { OPFPaginationError, paginate, paginateSlide } from './chunk-FITOGMR3.js';
|
|
13
|
+
import './chunk-IWFXFWGD.js';
|
|
14
|
+
import './chunk-LU6XM5JQ.js';
|
|
15
|
+
export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-P7S3ORB4.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-XRMV2GMB.js';
|
|
17
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-F4HFDP6I.js';
|
|
18
18
|
export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-F7PLNWHQ.js';
|
|
19
19
|
|
|
20
20
|
// src/browser.ts
|
|
@@ -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-MJ57RSYO.js';
|
|
2
|
+
import { fromYaml, toYaml } from './chunk-F5ABHDUX.js';
|
|
3
|
+
import { NOT_CHECKED } from './chunk-GS37EBPQ.js';
|
|
4
|
+
import { parseSource, validate, OPFValidationError } from './chunk-P7S3ORB4.js';
|
|
5
|
+
import { checkCatalogsOption } from './chunk-XRMV2GMB.js';
|
|
6
6
|
|
|
7
7
|
// src/deck-report.ts
|
|
8
8
|
var DECK_FORMATS = ["json", "yaml", "markdown"];
|
|
@@ -5687,28 +5687,28 @@ var presentation = {
|
|
|
5687
5687
|
"layouts": {
|
|
5688
5688
|
"two-column": {
|
|
5689
5689
|
"name": "Two column",
|
|
5690
|
-
"
|
|
5691
|
-
|
|
5692
|
-
"title"
|
|
5693
|
-
"title"
|
|
5694
|
-
],
|
|
5695
|
-
[
|
|
5696
|
-
"primary",
|
|
5697
|
-
"secondary"
|
|
5698
|
-
]
|
|
5699
|
-
],
|
|
5700
|
-
"regions": {
|
|
5701
|
-
"primary": {
|
|
5702
|
-
"accepts": [
|
|
5703
|
-
"text"
|
|
5704
|
-
]
|
|
5690
|
+
"regions": [
|
|
5691
|
+
{
|
|
5692
|
+
"name": "title"
|
|
5705
5693
|
},
|
|
5706
|
-
|
|
5707
|
-
"
|
|
5708
|
-
|
|
5694
|
+
{
|
|
5695
|
+
"direction": "row",
|
|
5696
|
+
"regions": [
|
|
5697
|
+
{
|
|
5698
|
+
"name": "primary",
|
|
5699
|
+
"accepts": [
|
|
5700
|
+
"text"
|
|
5701
|
+
]
|
|
5702
|
+
},
|
|
5703
|
+
{
|
|
5704
|
+
"name": "secondary",
|
|
5705
|
+
"accepts": [
|
|
5706
|
+
"text"
|
|
5707
|
+
]
|
|
5708
|
+
}
|
|
5709
5709
|
]
|
|
5710
5710
|
}
|
|
5711
|
-
|
|
5711
|
+
]
|
|
5712
5712
|
}
|
|
5713
5713
|
}
|
|
5714
5714
|
},
|
|
@@ -5765,10 +5765,10 @@ var presentation = {
|
|
|
5765
5765
|
"layouts": {
|
|
5766
5766
|
"hero": {
|
|
5767
5767
|
"name": "Hero",
|
|
5768
|
-
"
|
|
5769
|
-
|
|
5770
|
-
"title"
|
|
5771
|
-
|
|
5768
|
+
"regions": [
|
|
5769
|
+
{
|
|
5770
|
+
"name": "title"
|
|
5771
|
+
}
|
|
5772
5772
|
]
|
|
5773
5773
|
}
|
|
5774
5774
|
}
|
|
@@ -5777,22 +5777,18 @@ var presentation = {
|
|
|
5777
5777
|
"layouts": {
|
|
5778
5778
|
"q4-special": {
|
|
5779
5779
|
"name": "Q4 special",
|
|
5780
|
-
"
|
|
5781
|
-
|
|
5782
|
-
"title"
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
"chart"
|
|
5786
|
-
]
|
|
5787
|
-
],
|
|
5788
|
-
"regions": {
|
|
5789
|
-
"chart": {
|
|
5780
|
+
"regions": [
|
|
5781
|
+
{
|
|
5782
|
+
"name": "title"
|
|
5783
|
+
},
|
|
5784
|
+
{
|
|
5785
|
+
"name": "chart",
|
|
5790
5786
|
"accepts": [
|
|
5791
5787
|
"chart"
|
|
5792
5788
|
],
|
|
5793
5789
|
"flow": "none"
|
|
5794
5790
|
}
|
|
5795
|
-
|
|
5791
|
+
]
|
|
5796
5792
|
}
|
|
5797
5793
|
}
|
|
5798
5794
|
}
|
|
@@ -5901,7 +5897,7 @@ var presentation = {
|
|
|
5901
5897
|
"Composition": {
|
|
5902
5898
|
"type": "object",
|
|
5903
5899
|
"additionalProperties": false,
|
|
5904
|
-
"description": "Automatic slide and content-group arrangement. Nested content groups arrange their children independently, inheriting only minFontSize and overflow. Explicit promoted regions retain their positions. A
|
|
5900
|
+
"description": "Automatic slide and content-group arrangement. Nested content groups arrange their children independently, inheriting only minFontSize and overflow. Explicit promoted regions retain their positions. A layout defines its grid as one ordered list of regions; its composition supports gap, padding, minFontSize and overflow rather than mode, columns or weights.",
|
|
5905
5901
|
"properties": {
|
|
5906
5902
|
"mode": {
|
|
5907
5903
|
"type": "string",
|
|
@@ -6742,13 +6738,13 @@ var layout = {
|
|
|
6742
6738
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
6743
6739
|
"$id": "https://openpresentation.org/schema/opf-layout/v2",
|
|
6744
6740
|
"title": "Slide Layout",
|
|
6745
|
-
"description": "Schema for slide-layout records
|
|
6741
|
+
"description": "Schema for slide-layout records. A layout is one ordered list of regions, declared once, in reading order: 'direction' says whether the record's 'regions' sit side by side (row) or are stacked (column), and each region says which content kinds it takes and how several blocks share it. A split is an entry that nests a second list the other way, which is how a layout gets two dimensions. 'title' and 'subtitle' are reserved heading regions. Engines compile the list into a grid of tracks (the guillotine partition it describes). Slide content stays flat: engines bind a slide's blocks to the regions by reading order, role and kind (bindRegions in @openpresentation/opf), a block may pin itself to a region with 'region', and an empty region collapses into a neighbour. Built-in and custom layouts are records of this one schema; a custom layout is embedded under catalogs.custom.layouts or shipped in a catalog. Documents reference a layout from Slide.layout; a slide without a layout, with layout 'auto', or whose layout resolves nowhere composes automatically.\n\nA document references a record as a bare id or 'name:id' and resolves it in its own catalogs groups first, then in the catalog the host registered for the group's source; engines never fetch a catalog. A published record file carries '$schema' and 'id'; the copy a document embeds under catalogs.<group>.<kind>.<id> carries neither (the key is the id) and no 'x-*' display metadata.",
|
|
6746
6742
|
"type": "object",
|
|
6747
6743
|
"required": [
|
|
6748
6744
|
"$schema",
|
|
6749
6745
|
"id",
|
|
6750
6746
|
"name",
|
|
6751
|
-
"
|
|
6747
|
+
"regions"
|
|
6752
6748
|
],
|
|
6753
6749
|
"properties": {
|
|
6754
6750
|
"$schema": {
|
|
@@ -6798,105 +6794,76 @@ var layout = {
|
|
|
6798
6794
|
"$ref": "#/$defs/DesignHints",
|
|
6799
6795
|
"description": "The layout's design defaults, with the same keys and values as the deck's design and a slide's design (a slide overrides exactly what its layout sets, by the same name). An absent key means the layout has no opinion. Per key the slide's design wins, then the deck's design, then the resolved theme's design, then this record's design, then the engine default. Composition, the renderer and the PPTX exporter all read the one result."
|
|
6800
6796
|
},
|
|
6801
|
-
"
|
|
6802
|
-
"type": "
|
|
6803
|
-
"
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
"maxItems": 12,
|
|
6809
|
-
"items": {
|
|
6810
|
-
"type": "string",
|
|
6811
|
-
"pattern": "^(?:[a-z][a-z0-9-]*|\\.)$"
|
|
6812
|
-
}
|
|
6813
|
-
},
|
|
6814
|
-
"description": "The grid as nested arrays: each inner array is a row, each string is one cell, and a name repeated over adjacent cells spans them; '.' is an empty cell. Cells are lowercase names ([a-z][a-z0-9-]*) or '.', and every row has the same number of cells (at most 12 rows and 12 columns). A name's cells must form one filled rectangle. 'title' and 'subtitle' are heading areas: 'title' holds the slide's heading group (tag, title and subtitle, stacked) and a 'subtitle' area takes the subtitle out of it; they have no regions entry, and a 'subtitle' area needs a 'title' area. A layout with no 'title' area gets an implicit auto row on top for a slide that has headings. Every other name is a body region and needs an entry in 'regions'. The grid rules a schema cannot express are the validate finding opf/layout-template.",
|
|
6797
|
+
"direction": {
|
|
6798
|
+
"type": "string",
|
|
6799
|
+
"enum": [
|
|
6800
|
+
"row",
|
|
6801
|
+
"column"
|
|
6802
|
+
],
|
|
6803
|
+
"description": "How the record's 'regions' are laid out: 'row' places them side by side, left to right in reading order; 'column' stacks them top to bottom. Default 'column'.",
|
|
6815
6804
|
"examples": [
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
"title"
|
|
6819
|
-
],
|
|
6820
|
-
[
|
|
6821
|
-
"body"
|
|
6822
|
-
]
|
|
6823
|
-
],
|
|
6824
|
-
[
|
|
6825
|
-
[
|
|
6826
|
-
"title",
|
|
6827
|
-
"title"
|
|
6828
|
-
],
|
|
6829
|
-
[
|
|
6830
|
-
"timeline",
|
|
6831
|
-
"notes"
|
|
6832
|
-
],
|
|
6833
|
-
[
|
|
6834
|
-
"timeline",
|
|
6835
|
-
"metrics"
|
|
6836
|
-
]
|
|
6837
|
-
]
|
|
6805
|
+
"row",
|
|
6806
|
+
"column"
|
|
6838
6807
|
]
|
|
6839
6808
|
},
|
|
6840
|
-
"
|
|
6809
|
+
"anchor": {
|
|
6810
|
+
"type": "string",
|
|
6811
|
+
"enum": [
|
|
6812
|
+
"top",
|
|
6813
|
+
"middle",
|
|
6814
|
+
"bottom"
|
|
6815
|
+
],
|
|
6816
|
+
"description": "Vertical position of the content of every body region when it is shorter than the region. A split's 'anchor' replaces it for the regions under that split, and a region's own 'anchor' replaces both. Only 'anchor' is inherited, and only by body regions: the heading regions 'title' and 'subtitle' never take it, and the other region rules stay per region. Default 'top'."
|
|
6817
|
+
},
|
|
6818
|
+
"regions": {
|
|
6841
6819
|
"type": "array",
|
|
6842
6820
|
"minItems": 1,
|
|
6843
6821
|
"maxItems": 12,
|
|
6844
6822
|
"items": {
|
|
6845
|
-
"
|
|
6846
|
-
"exclusiveMinimum": 0,
|
|
6847
|
-
"maximum": 100
|
|
6823
|
+
"$ref": "#/$defs/RegionEntry"
|
|
6848
6824
|
},
|
|
6849
|
-
"description": "
|
|
6825
|
+
"description": "The record's regions in reading order: 1 to 12 entries, each a region ({ name, size?, ...rules }) or a split ({ direction, regions, size?, anchor? }). Every region is declared once, here, with its content rules; a block can target a body region with 'region': '<name>'. Names are unique across the whole record. 'size' is a number above 0 and up to 100 (default 1) that siblings share in proportion, separated by the gap; 'auto' is the height the content needs, allowed only in a column. 'title' and 'subtitle' are heading regions that take only a size (default auto in a column, 1 in a row): 'title' holds the slide's heading group (tag, title and subtitle, stacked) and a 'subtitle' region takes the subtitle out of it, and a 'subtitle' needs a 'title'. A record with no 'title' region gets an implicit auto row on top for a slide that has headings. Splits nest at most three levels (the record's own list is level 1). Rules the schema cannot express (a reserved or repeated name, a 'subtitle' without a 'title', 'auto' outside a column, nesting too deep, more than 12 rows or columns once compiled) are the validate findings opf/layout-template and opf/layout-region.",
|
|
6850
6826
|
"examples": [
|
|
6851
6827
|
[
|
|
6852
|
-
1,
|
|
6853
|
-
1
|
|
6854
|
-
],
|
|
6855
|
-
[
|
|
6856
|
-
3,
|
|
6857
|
-
2
|
|
6858
|
-
]
|
|
6859
|
-
]
|
|
6860
|
-
},
|
|
6861
|
-
"rows": {
|
|
6862
|
-
"type": "array",
|
|
6863
|
-
"minItems": 1,
|
|
6864
|
-
"maxItems": 12,
|
|
6865
|
-
"items": {
|
|
6866
|
-
"oneOf": [
|
|
6867
6828
|
{
|
|
6868
|
-
"
|
|
6869
|
-
"
|
|
6870
|
-
"
|
|
6829
|
+
"name": "main",
|
|
6830
|
+
"size": 2,
|
|
6831
|
+
"accepts": [
|
|
6832
|
+
"text"
|
|
6833
|
+
]
|
|
6871
6834
|
},
|
|
6872
6835
|
{
|
|
6873
|
-
"
|
|
6836
|
+
"name": "aside",
|
|
6837
|
+
"size": 1,
|
|
6838
|
+
"accepts": [
|
|
6839
|
+
"metric"
|
|
6840
|
+
]
|
|
6874
6841
|
}
|
|
6875
|
-
]
|
|
6876
|
-
},
|
|
6877
|
-
"description": "Relative row heights, one per string of 'areas'. 'auto' is the height the row's content needs at the starting text size (at most half the content box; areas that span several rows do not size it); the numeric rows share the rest in proportion. An auto row whose areas are all empty has no height. Omitted: all 1.",
|
|
6878
|
-
"examples": [
|
|
6879
|
-
[
|
|
6880
|
-
"auto",
|
|
6881
|
-
1
|
|
6882
6842
|
],
|
|
6883
6843
|
[
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6844
|
+
{
|
|
6845
|
+
"name": "title"
|
|
6846
|
+
},
|
|
6847
|
+
{
|
|
6848
|
+
"direction": "row",
|
|
6849
|
+
"regions": [
|
|
6850
|
+
{
|
|
6851
|
+
"name": "first",
|
|
6852
|
+
"accepts": [
|
|
6853
|
+
"text"
|
|
6854
|
+
]
|
|
6855
|
+
},
|
|
6856
|
+
{
|
|
6857
|
+
"name": "second",
|
|
6858
|
+
"accepts": [
|
|
6859
|
+
"text"
|
|
6860
|
+
]
|
|
6861
|
+
}
|
|
6862
|
+
]
|
|
6863
|
+
}
|
|
6887
6864
|
]
|
|
6888
6865
|
]
|
|
6889
6866
|
},
|
|
6890
|
-
"regions": {
|
|
6891
|
-
"type": "object",
|
|
6892
|
-
"propertyNames": {
|
|
6893
|
-
"pattern": "^[a-z][a-z0-9-]*$"
|
|
6894
|
-
},
|
|
6895
|
-
"additionalProperties": {
|
|
6896
|
-
"$ref": "#/$defs/Region"
|
|
6897
|
-
},
|
|
6898
|
-
"description": "One entry per body area, keyed by the area's name. Region names may not be 'title', 'subtitle', 'tag', 'auto' or one of the promoted-region words ('left', 'center', 'right', 'top', 'middle', 'bottom'), so a Markdown block's region= option stays unambiguous. Region rules the schema cannot express (an area without a region, a region without an area, a reserved name) are the validate finding opf/layout-region."
|
|
6899
|
-
},
|
|
6900
6867
|
"overflowRegion": {
|
|
6901
6868
|
"type": "string",
|
|
6902
6869
|
"pattern": "^[a-z][a-z0-9-]*$",
|
|
@@ -6959,15 +6926,128 @@ var layout = {
|
|
|
6959
6926
|
"$ref": "#/$defs/Composition"
|
|
6960
6927
|
}
|
|
6961
6928
|
},
|
|
6929
|
+
"patternProperties": {
|
|
6930
|
+
"^x-": {}
|
|
6931
|
+
},
|
|
6932
|
+
"additionalProperties": false,
|
|
6962
6933
|
"$defs": {
|
|
6963
|
-
"
|
|
6934
|
+
"RegionEntry": {
|
|
6935
|
+
"description": "One entry of a regions list: a heading region, a body region or a split.",
|
|
6936
|
+
"oneOf": [
|
|
6937
|
+
{
|
|
6938
|
+
"$ref": "#/$defs/HeadingRegion"
|
|
6939
|
+
},
|
|
6940
|
+
{
|
|
6941
|
+
"$ref": "#/$defs/Region"
|
|
6942
|
+
},
|
|
6943
|
+
{
|
|
6944
|
+
"$ref": "#/$defs/Split"
|
|
6945
|
+
}
|
|
6946
|
+
]
|
|
6947
|
+
},
|
|
6948
|
+
"RegionSize": {
|
|
6949
|
+
"oneOf": [
|
|
6950
|
+
{
|
|
6951
|
+
"type": "number",
|
|
6952
|
+
"exclusiveMinimum": 0,
|
|
6953
|
+
"maximum": 100
|
|
6954
|
+
},
|
|
6955
|
+
{
|
|
6956
|
+
"const": "auto"
|
|
6957
|
+
}
|
|
6958
|
+
],
|
|
6959
|
+
"description": "The region's or split's share along its parent's direction: a number above 0 and up to 100 that siblings share in proportion (the gap is taken out first), default 1; or 'auto', the length the content needs at the starting text size (at most half the content box; a split sized auto is as tall as its tallest content, and every row of a column split sized auto is auto too; auto regions with no content take no space). 'auto' is allowed only on an entry of a column; in a row it is the validate finding opf/layout-template. The default for a heading region is 'auto' in a column and 1 in a row.",
|
|
6960
|
+
"examples": [
|
|
6961
|
+
1,
|
|
6962
|
+
2,
|
|
6963
|
+
"auto"
|
|
6964
|
+
]
|
|
6965
|
+
},
|
|
6966
|
+
"HeadingRegion": {
|
|
6967
|
+
"type": "object",
|
|
6968
|
+
"additionalProperties": false,
|
|
6969
|
+
"required": [
|
|
6970
|
+
"name"
|
|
6971
|
+
],
|
|
6972
|
+
"description": "A reserved heading region: 'title' holds the slide's heading group (tag, title and subtitle, stacked) and 'subtitle' takes the subtitle out of it. A heading region takes only a size. At most one of each; a 'subtitle' needs a 'title'.",
|
|
6973
|
+
"properties": {
|
|
6974
|
+
"name": {
|
|
6975
|
+
"type": "string",
|
|
6976
|
+
"enum": [
|
|
6977
|
+
"title",
|
|
6978
|
+
"subtitle"
|
|
6979
|
+
],
|
|
6980
|
+
"description": "'title' or 'subtitle'."
|
|
6981
|
+
},
|
|
6982
|
+
"size": {
|
|
6983
|
+
"$ref": "#/$defs/RegionSize"
|
|
6984
|
+
}
|
|
6985
|
+
}
|
|
6986
|
+
},
|
|
6987
|
+
"Split": {
|
|
6964
6988
|
"type": "object",
|
|
6965
6989
|
"additionalProperties": false,
|
|
6966
6990
|
"required": [
|
|
6967
|
-
"
|
|
6991
|
+
"direction",
|
|
6992
|
+
"regions"
|
|
6968
6993
|
],
|
|
6969
|
-
"description": "
|
|
6994
|
+
"description": "A split nests a list of regions the other way inside one cell of its parent: a row of regions inside a column, or a column inside a row. It has no name; its regions are declared in reading order like the record's own. Splits nest at most three levels (the record's own list is level 1).",
|
|
6970
6995
|
"properties": {
|
|
6996
|
+
"direction": {
|
|
6997
|
+
"type": "string",
|
|
6998
|
+
"enum": [
|
|
6999
|
+
"row",
|
|
7000
|
+
"column"
|
|
7001
|
+
],
|
|
7002
|
+
"description": "How the split's 'regions' are laid out: 'row' side by side, 'column' stacked."
|
|
7003
|
+
},
|
|
7004
|
+
"regions": {
|
|
7005
|
+
"type": "array",
|
|
7006
|
+
"minItems": 1,
|
|
7007
|
+
"maxItems": 12,
|
|
7008
|
+
"items": {
|
|
7009
|
+
"$ref": "#/$defs/RegionEntry"
|
|
7010
|
+
},
|
|
7011
|
+
"description": "The split's regions in reading order: 1 to 12 regions and splits."
|
|
7012
|
+
},
|
|
7013
|
+
"size": {
|
|
7014
|
+
"$ref": "#/$defs/RegionSize"
|
|
7015
|
+
},
|
|
7016
|
+
"anchor": {
|
|
7017
|
+
"type": "string",
|
|
7018
|
+
"enum": [
|
|
7019
|
+
"top",
|
|
7020
|
+
"middle",
|
|
7021
|
+
"bottom"
|
|
7022
|
+
],
|
|
7023
|
+
"description": "Vertical position of the content of every body region under this split, unless the region sets its own. The heading regions 'title' and 'subtitle' never inherit it."
|
|
7024
|
+
}
|
|
7025
|
+
}
|
|
7026
|
+
},
|
|
7027
|
+
"Region": {
|
|
7028
|
+
"type": "object",
|
|
7029
|
+
"additionalProperties": false,
|
|
7030
|
+
"description": "One body region of a layout: its name, its share of the space and the rules for which content it takes and how several blocks share it.",
|
|
7031
|
+
"properties": {
|
|
7032
|
+
"name": {
|
|
7033
|
+
"type": "string",
|
|
7034
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
7035
|
+
"not": {
|
|
7036
|
+
"enum": [
|
|
7037
|
+
"title",
|
|
7038
|
+
"subtitle"
|
|
7039
|
+
]
|
|
7040
|
+
},
|
|
7041
|
+
"description": "The region's name, lowercase kebab-case, unique across the whole record. A block targets it with 'region': '<name>'. It may not be 'title' (those are heading regions), 'tag', 'auto' or one of the promoted-region words ('left', 'center', 'right', 'top', 'middle', 'bottom'), so a Markdown block's region= option stays unambiguous: the validate finding opf/layout-region.",
|
|
7042
|
+
"examples": [
|
|
7043
|
+
"main",
|
|
7044
|
+
"aside",
|
|
7045
|
+
"chart"
|
|
7046
|
+
]
|
|
7047
|
+
},
|
|
7048
|
+
"size": {
|
|
7049
|
+
"$ref": "#/$defs/RegionSize"
|
|
7050
|
+
},
|
|
6971
7051
|
"accepts": {
|
|
6972
7052
|
"type": "array",
|
|
6973
7053
|
"minItems": 1,
|
|
@@ -6988,7 +7068,7 @@ var layout = {
|
|
|
6988
7068
|
"group"
|
|
6989
7069
|
]
|
|
6990
7070
|
},
|
|
6991
|
-
"description": "Content kinds the region takes: the body content kinds, and 'group' for a content group of any content. A group is also accepted where every one of its leaf kinds is.",
|
|
7071
|
+
"description": "Content kinds the region takes: the body content kinds, and 'group' for a content group of any content. A group is also accepted where every one of its leaf kinds is. Omitted: every body content kind and 'group'.",
|
|
6992
7072
|
"examples": [
|
|
6993
7073
|
[
|
|
6994
7074
|
"text",
|
|
@@ -7048,7 +7128,7 @@ var layout = {
|
|
|
7048
7128
|
"middle",
|
|
7049
7129
|
"bottom"
|
|
7050
7130
|
],
|
|
7051
|
-
"description": "Vertical position of the region's content when it is shorter than the region. Default 'top'."
|
|
7131
|
+
"description": "Vertical position of the region's content when it is shorter than the region. Replaces the 'anchor' of the record and of the splits around it. Default: the nearest of those that sets one, else 'top'."
|
|
7052
7132
|
},
|
|
7053
7133
|
"empty": {
|
|
7054
7134
|
"type": "string",
|
|
@@ -7058,7 +7138,10 @@ var layout = {
|
|
|
7058
7138
|
],
|
|
7059
7139
|
"description": "What the region does on a slide that gives it no content: 'collapse' (default) joins its cells to a neighbouring area that shares the full length of one of its edges and is not itself empty; 'keep' leaves the space."
|
|
7060
7140
|
}
|
|
7061
|
-
}
|
|
7141
|
+
},
|
|
7142
|
+
"required": [
|
|
7143
|
+
"name"
|
|
7144
|
+
]
|
|
7062
7145
|
},
|
|
7063
7146
|
"DesignHints": {
|
|
7064
7147
|
"type": "object",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { NOT_CHECKED, Ctx } from './chunk-
|
|
2
|
-
import { sortPresentationKeys } from './chunk-
|
|
3
|
-
import { same } from './chunk-
|
|
4
|
-
import { validate } from './chunk-
|
|
5
|
-
import { checkCatalogsOption } from './chunk-
|
|
6
|
-
import { presentation } from './chunk-
|
|
1
|
+
import { NOT_CHECKED, Ctx } from './chunk-GS37EBPQ.js';
|
|
2
|
+
import { sortPresentationKeys } from './chunk-EQ6S5SEZ.js';
|
|
3
|
+
import { same } from './chunk-LU6XM5JQ.js';
|
|
4
|
+
import { validate } from './chunk-P7S3ORB4.js';
|
|
5
|
+
import { checkCatalogsOption } from './chunk-XRMV2GMB.js';
|
|
6
|
+
import { presentation } from './chunk-F4HFDP6I.js';
|
|
7
7
|
import { Parser, parseDocument, isMap, Document, visit, isScalar, isAlias, isSeq } from 'yaml';
|
|
8
8
|
|
|
9
9
|
var MAX_ALIAS_COUNT = 100;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assertValid, resolveSlideScriptMeasurement, resolveSlideContext } from './chunk-
|
|
2
|
-
import { resolveSlideVariables, checkCatalogsOption, usesSlideBuiltin, composeSlide, codeHighlightSlice, tableRowBoundaries, visitContentPayloads, regionAccepts, slideTokenSpans, sliceNumberedItems } from './chunk-
|
|
1
|
+
import { assertValid, resolveSlideScriptMeasurement, resolveSlideContext } from './chunk-P7S3ORB4.js';
|
|
2
|
+
import { resolveSlideVariables, checkCatalogsOption, usesSlideBuiltin, composeSlide, codeHighlightSlice, tableRowBoundaries, visitContentPayloads, regionAccepts, slideTokenSpans, sliceNumberedItems } from './chunk-XRMV2GMB.js';
|
|
3
3
|
|
|
4
4
|
// src/pagination.ts
|
|
5
5
|
var OPFPaginationError = class extends Error {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OPFApiError } from './chunk-
|
|
2
|
-
import { CATALOG_SCHEMA } from './chunk-
|
|
1
|
+
import { OPFApiError } from './chunk-WW62PPYV.js';
|
|
2
|
+
import { CATALOG_SCHEMA } from './chunk-P7S3ORB4.js';
|
|
3
3
|
import { CATALOG_SCHEMA as CATALOG_SCHEMA$1, gallery } from '@openpresentation/gallery';
|
|
4
4
|
|
|
5
5
|
function galleryMismatch(declared, reads = CATALOG_SCHEMA) {
|
|
@@ -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-GS37EBPQ.js';
|
|
2
|
+
import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen, fenceCode } from './chunk-IWFXFWGD.js';
|
|
3
|
+
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-LU6XM5JQ.js';
|
|
4
|
+
import { validate } from './chunk-P7S3ORB4.js';
|
|
5
|
+
import { checkCatalogsOption, PROMOTED_REGION_KEY } from './chunk-XRMV2GMB.js';
|
|
6
6
|
|
|
7
7
|
// src/markdown/canon.ts
|
|
8
8
|
var FORMAT_KEYS = FORMATTING;
|
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
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-XRMV2GMB.js';
|
|
2
|
+
import { schemas, schemaEntries } from './chunk-F4HFDP6I.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';
|
|
6
6
|
|
|
7
7
|
// src/catalog-schemas.ts
|
|
8
|
-
var CATALOG_SCHEMA =
|
|
8
|
+
var CATALOG_SCHEMA = 4;
|
|
9
9
|
var catalogDisplayKinds = ["chartTypes", "languages", "socialPlatforms"];
|
|
10
10
|
var catalogSchemaNames = {
|
|
11
11
|
layouts: "layout",
|
|
@@ -2775,17 +2775,17 @@ var referenceRules = [
|
|
|
2775
2775
|
"layout-template",
|
|
2776
2776
|
"references",
|
|
2777
2777
|
"error",
|
|
2778
|
-
"A layout template's
|
|
2779
|
-
|
|
2780
|
-
{ standard: "spec/schemas/layout.schema.json and the
|
|
2778
|
+
"A layout template's region list is malformed.",
|
|
2779
|
+
`A layout is one ordered list of regions, nested through splits for two dimensions. Engines cannot compose a list that is not 1 to 12 entries, an entry that is neither a region nor a split, a direction or size that is not valid, an "auto" size anywhere but in a column, splits nested more than three levels deep (the record's own list is level 1), or regions that compile to a grid larger than 12 x 12. composeSlide refuses such a record, so a slide that names it composes automatically.`,
|
|
2780
|
+
{ standard: "spec/schemas/layout.schema.json and the region list rules (docs/layout-templates.md)", approximations: "Checked on every layout record the document embeds and every registered record it uses, once the record passes its schema." }
|
|
2781
2781
|
),
|
|
2782
2782
|
rule(
|
|
2783
2783
|
"layout-region",
|
|
2784
2784
|
"references",
|
|
2785
2785
|
"error",
|
|
2786
|
-
"A layout template's regions
|
|
2787
|
-
"
|
|
2788
|
-
{ standard: "spec/schemas/layout.schema.json and the region rules
|
|
2786
|
+
"A layout template's regions are not valid.",
|
|
2787
|
+
"Region names are unique across the whole record and may not be tag, auto or a promoted-region word (left, center, right, top, middle, bottom), so a Markdown block's region= stays unambiguous; title and subtitle name the heading regions, which take only a size; a subtitle region needs a title region; a region accepts at least one content kind; a region with flow 'none' holds one block; overflowRegion must name a body region. composeSlide refuses such a record.",
|
|
2788
|
+
{ standard: "spec/schemas/layout.schema.json and the region rules (docs/layout-templates.md)" }
|
|
2789
2789
|
),
|
|
2790
2790
|
rule(
|
|
2791
2791
|
"unresolved-reference",
|