@openpresentation/opf 0.26.2 → 0.26.4
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/README.md +1 -1
- package/dist/browser.js +15 -13
- package/dist/{chunk-5VJCLUUA.js → chunk-6IXSHIAL.js} +6 -6
- package/dist/{chunk-O2ST5ZKL.js → chunk-6NBTZYYD.js} +1 -1
- package/dist/{chunk-NWO6HT4F.js → chunk-EDCRBTJF.js} +4 -4
- package/dist/{chunk-JI3PHXPJ.js → chunk-EQ6S5SEZ.js} +1 -1
- package/dist/{chunk-N6CNJCIF.js → chunk-F4HFDP6I.js} +0 -18
- package/dist/chunk-GWJBZ4LC.js +639 -0
- package/dist/{chunk-LN2ASLMF.js → chunk-H5QC3X3K.js} +1 -1
- package/dist/{chunk-Q6KMKTEH.js → chunk-MN7DRK57.js} +40 -648
- package/dist/{chunk-OFWBICDO.js → chunk-NZLW6FBQ.js} +1 -1
- package/dist/{chunk-CRCOQ4K2.js → chunk-O6BY3AU2.js} +1 -1
- package/dist/{chunk-7YZ72FRP.js → chunk-PIO73BQ6.js} +6 -5
- package/dist/{chunk-6JAFSZVL.js → chunk-QAEBYDKY.js} +2 -4
- package/dist/{chunk-L65YNP4J.js → chunk-QH2W6HIM.js} +1 -1
- package/dist/chunk-RYZPBJLB.js +4 -0
- package/dist/{chunk-LUQYSUXS.js → chunk-XFOOKVRI.js} +57 -4
- package/dist/{chunk-XFK4KPKK.js → chunk-ZSZDVIDV.js} +2 -2
- package/dist/{conversion-CX_I6Vna.d.ts → conversion-DSafOGzh.d.ts} +2 -2
- package/dist/conversion-QIAJM6DQ.js +20 -0
- package/dist/convert.js +6 -6
- package/dist/deck.js +11 -9
- package/dist/diff.js +3 -3
- package/dist/docs.js +3 -3
- package/dist/format.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +19 -17
- package/dist/markdown.js +8 -6
- package/dist/node-engine.d.ts +2 -2
- package/dist/node-engine.js +19 -17
- package/dist/pagination.js +3 -3
- package/dist/patch.js +2 -2
- package/dist/schema.d.ts +18 -4
- package/dist/schema.js +2 -2
- package/dist/schemas.js +1 -1
- package/dist/source.d.ts +102 -4
- package/dist/source.js +389 -10
- package/dist/spec/schemas/opf.schema.json +0 -16
- package/dist/spec/schemas/theme.schema.json +0 -2
- package/dist/validator.js +2 -2
- package/dist/yaml.js +7 -6
- package/package.json +5 -5
- package/dist/conversion-BKCKBECG.js +0 -18
package/dist/format.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OPFFormatError, format, isFormatted, sortPresentationKeys } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { OPFFormatError, format, isFormatted, sortPresentationKeys } from './chunk-EQ6S5SEZ.js';
|
|
2
|
+
import './chunk-F4HFDP6I.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SchemaEntry, SchemaName, audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './schemas.js';
|
|
2
|
-
import { C as ConvertInput, a as ConvertOptions, b as ConvertResult, c as ConvertFormat, O as OpenOptions, S as SaveOptions, d as SaveResult } from './conversion-
|
|
3
|
-
export { e as ConvertedFile, E as ExportFormat, F as FontsHandle, f as OPFApiError, g as OPFExportError, h as OPFImportError, i as SlideSelection, p as parseSlideSelection } from './conversion-
|
|
2
|
+
import { C as ConvertInput, a as ConvertOptions, b as ConvertResult, c as ConvertFormat, O as OpenOptions, S as SaveOptions, d as SaveResult } from './conversion-DSafOGzh.js';
|
|
3
|
+
export { e as ConvertedFile, E as ExportFormat, F as FontsHandle, f as OPFApiError, g as OPFExportError, h as OPFImportError, i as SlideSelection, p as parseSlideSelection } from './conversion-DSafOGzh.js';
|
|
4
4
|
import { validate as validate$1 } from './validator.js';
|
|
5
5
|
export { DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, findValidationRule, validateCatalogRecord, validationRules } from './validator.js';
|
|
6
6
|
import { R as ResolveVariablesOptions, h as VariableDiagnostic } from './validation-types-3ARvTsB0.js';
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { defaultCatalogs } from './chunk-
|
|
2
|
-
import { stats, embed, edit, OPFApiError, asApiError } from './chunk-
|
|
3
|
-
export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, updateFromCatalog } from './chunk-
|
|
1
|
+
import { defaultCatalogs } from './chunk-ZSZDVIDV.js';
|
|
2
|
+
import { stats, embed, edit, OPFApiError, asApiError } from './chunk-NZLW6FBQ.js';
|
|
3
|
+
export { OPFApiError, OPFExportError, OPFImportError, OPFMoveToCustomError, copySlides, fill, fillRecords, localAssetSources, moveToCustom, parseSlideSelection, sameRecord, updateFromCatalog } from './chunk-NZLW6FBQ.js';
|
|
4
4
|
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-UJSAR6GF.js';
|
|
5
5
|
export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-PJSPHHRK.js';
|
|
6
6
|
export { OPFDataImportError, ingest, parseTabularData } from './chunk-TKQ2VFV5.js';
|
|
7
|
-
import { paginate } from './chunk-
|
|
8
|
-
export { OPFPaginationError, paginateSlide } from './chunk-
|
|
9
|
-
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-
|
|
10
|
-
export { fromMarkdown, toMarkdown } from './chunk-
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
13
|
-
|
|
14
|
-
import './chunk-
|
|
15
|
-
export {
|
|
16
|
-
import
|
|
17
|
-
export {
|
|
7
|
+
import { paginate } from './chunk-QH2W6HIM.js';
|
|
8
|
+
export { OPFPaginationError, paginateSlide } from './chunk-QH2W6HIM.js';
|
|
9
|
+
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-EDCRBTJF.js';
|
|
10
|
+
export { fromMarkdown, toMarkdown } from './chunk-GWJBZ4LC.js';
|
|
11
|
+
import './chunk-PIO73BQ6.js';
|
|
12
|
+
import './chunk-RYZPBJLB.js';
|
|
13
|
+
import './chunk-MN7DRK57.js';
|
|
14
|
+
import './chunk-O6BY3AU2.js';
|
|
15
|
+
export { OPFMarkdownError } from './chunk-QAEBYDKY.js';
|
|
16
|
+
import './chunk-6NBTZYYD.js';
|
|
17
|
+
export { diff, merge } from './chunk-H5QC3X3K.js';
|
|
18
|
+
import { validate, OPFValidationError } from './chunk-XFOOKVRI.js';
|
|
19
|
+
export { CATALOG_SCHEMA, DEFAULT_VALIDATION_THRESHOLDS, OPFPatchError, OPFPatchValidationError, OPFValidationError, applyPatch, assertValid, assertValidCatalogRecord, catalogDisplayKinds, catalogSchemaNames, findValidationRule, resolveSlideContext, validateCatalogRecord, validationCategories, validationRules } from './chunk-XFOOKVRI.js';
|
|
18
20
|
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';
|
|
19
|
-
export { OPFFormatError, format } from './chunk-
|
|
20
|
-
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-
|
|
21
|
+
export { OPFFormatError, format } from './chunk-EQ6S5SEZ.js';
|
|
22
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-F4HFDP6I.js';
|
|
21
23
|
|
|
22
24
|
// src/index.ts
|
|
23
25
|
var withDefaultCatalog = (options) => {
|
|
@@ -30,7 +32,7 @@ var stats2 = (presentation2, options) => stats(presentation2, withDefaultCatalog
|
|
|
30
32
|
var paginate2 = (input, options) => paginate(input, withDefaultCatalog(options));
|
|
31
33
|
var embed2 = (document, options) => embed(document, withDefaultCatalog(options));
|
|
32
34
|
var edit2 = (deck, patch, options) => edit(deck, patch, withDefaultCatalog(options));
|
|
33
|
-
var engine = () => import('./conversion-
|
|
35
|
+
var engine = () => import('./conversion-QIAJM6DQ.js');
|
|
34
36
|
var rethrow = (error, fallback) => {
|
|
35
37
|
if (error instanceof OPFValidationError) throw error;
|
|
36
38
|
throw asApiError(OPFApiError, error, fallback);
|
package/dist/markdown.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { fromMarkdown, toMarkdown } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
|
|
4
|
-
import './chunk-
|
|
5
|
-
|
|
1
|
+
export { fromMarkdown, toMarkdown } from './chunk-GWJBZ4LC.js';
|
|
2
|
+
import './chunk-RYZPBJLB.js';
|
|
3
|
+
import './chunk-MN7DRK57.js';
|
|
4
|
+
import './chunk-O6BY3AU2.js';
|
|
5
|
+
export { OPFMarkdownError } from './chunk-QAEBYDKY.js';
|
|
6
|
+
import './chunk-6NBTZYYD.js';
|
|
7
|
+
import './chunk-XFOOKVRI.js';
|
|
6
8
|
import './chunk-XRMV2GMB.js';
|
|
7
|
-
import './chunk-
|
|
9
|
+
import './chunk-F4HFDP6I.js';
|
package/dist/node-engine.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { b as DeckReport, c as DeckReportOptions, r as readDeckReport } from './deck-report-5vwMGcQz.js';
|
|
2
|
-
import { F as FontsHandle, j as EmbeddedFace, R as Renderer, k as Reporter, P as Peer, l as PptxModule, f as OPFApiError } from './conversion-
|
|
3
|
-
export { m as ConversionPlan, D as Diagnostic, n as EXPORT_FORMATS, o as EXPORT_TEXT, q as ExportContext, r as ExportFile, s as ExportFontSummary, E as ExportFormat, t as ExportOptions, u as ExportResult, v as ExportRun, w as ExportText, I as ImportOptions, x as ImportResult, g as OPFExportError, h as OPFImportError, y as PEER_RANGES, z as PPTX_PACKAGE, A as PreparedExport, B as RENDER_EXTRAS, G as RENDER_PACKAGE, H as ReportFinding, J as ResolvedExportOptions, i as SlideSelection, K as Source, V as VERSIONS, L as asApiError, M as assetRoot, N as checkDate, Q as checkOptions, T as checkRenamedOptions, U as checkScale, W as deckFileFormat, X as exportFormatOf, Y as finishReport, Z as importPresentation, _ as loadPptx, $ as loadRenderer, a0 as locatePackage, a1 as missingPeerFrom, p as parseSlideSelection, a2 as planConversion, a3 as prepareExport, a4 as reaches, a5 as readInput, a6 as reportThrown, a7 as resolveExportOptions, a8 as runExport, a9 as runPreparedExport, aa as writePlanned } from './conversion-
|
|
2
|
+
import { F as FontsHandle, j as EmbeddedFace, R as Renderer, k as Reporter, P as Peer, l as PptxModule, f as OPFApiError } from './conversion-DSafOGzh.js';
|
|
3
|
+
export { m as ConversionPlan, D as Diagnostic, n as EXPORT_FORMATS, o as EXPORT_TEXT, q as ExportContext, r as ExportFile, s as ExportFontSummary, E as ExportFormat, t as ExportOptions, u as ExportResult, v as ExportRun, w as ExportText, I as ImportOptions, x as ImportResult, g as OPFExportError, h as OPFImportError, y as PEER_RANGES, z as PPTX_PACKAGE, A as PreparedExport, B as RENDER_EXTRAS, G as RENDER_PACKAGE, H as ReportFinding, J as ResolvedExportOptions, i as SlideSelection, K as Source, V as VERSIONS, L as asApiError, M as assetRoot, N as checkDate, Q as checkOptions, T as checkRenamedOptions, U as checkScale, W as deckFileFormat, X as exportFormatOf, Y as finishReport, Z as importPresentation, _ as loadPptx, $ as loadRenderer, a0 as locatePackage, a1 as missingPeerFrom, p as parseSlideSelection, a2 as planConversion, a3 as prepareExport, a4 as reaches, a5 as readInput, a6 as reportThrown, a7 as resolveExportOptions, a8 as runExport, a9 as runPreparedExport, aa as writePlanned } from './conversion-DSafOGzh.js';
|
|
4
4
|
import { a as Catalog } from './catalog-refs-BSfGELpt.js';
|
|
5
5
|
import { e as PresentationPaginationResult } from './pagination-D_kJe4jH.js';
|
|
6
6
|
import './presentation-Bwo8Ko6D.js';
|
package/dist/node-engine.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { loadRenderer, listFontDirectories, leaseSharedFonts, prepareFonts } from './chunk-
|
|
2
|
-
export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, assetRoot, checkDate, checkDestinations, checkOptions, checkOutputPattern, checkRenamedOptions, checkScale, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, localAssetProblems, locatePackage, missingPeerFrom, padNumber, planConversion, pointerOf, prepareExport, prepareFonts, publishNew, reaches, readInput, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, stemOf, writeFiles, writePlanned } from './chunk-
|
|
3
|
-
import { defaultCatalogs } from './chunk-
|
|
4
|
-
export { defaultCatalogs, galleryMismatch } from './chunk-
|
|
5
|
-
import { OPFApiError } from './chunk-
|
|
6
|
-
export { OPFApiError, OPFExportError, OPFImportError, asApiError, parseSlideSelection } from './chunk-
|
|
1
|
+
import { loadRenderer, listFontDirectories, leaseSharedFonts, prepareFonts } from './chunk-6IXSHIAL.js';
|
|
2
|
+
export { EXPORT_FORMATS, EXPORT_TEXT, PEER_RANGES, PPTX_PACKAGE, RENDER_EXTRAS, RENDER_PACKAGE, Reporter, VERSIONS, assetRoot, checkDate, checkDestinations, checkOptions, checkOutputPattern, checkRenamedOptions, checkScale, createZip, deckFileFormat, deckStem, embeddedFor, exportFormatOf, finishReport, importPresentation, leaseSharedFonts, listFontDirectories, loadPptx, loadRenderer, localAssetProblems, locatePackage, missingPeerFrom, padNumber, planConversion, pointerOf, prepareExport, prepareFonts, publishNew, reaches, readInput, reportThrown, resolveExportOptions, runExport, runImport, runPreparedExport, stemOf, writeFiles, writePlanned } from './chunk-6IXSHIAL.js';
|
|
3
|
+
import { defaultCatalogs } from './chunk-ZSZDVIDV.js';
|
|
4
|
+
export { defaultCatalogs, galleryMismatch } from './chunk-ZSZDVIDV.js';
|
|
5
|
+
import { OPFApiError } from './chunk-NZLW6FBQ.js';
|
|
6
|
+
export { OPFApiError, OPFExportError, OPFImportError, asApiError, parseSlideSelection } from './chunk-NZLW6FBQ.js';
|
|
7
7
|
import './chunk-UJSAR6GF.js';
|
|
8
8
|
import './chunk-PJSPHHRK.js';
|
|
9
9
|
import './chunk-TKQ2VFV5.js';
|
|
10
|
-
import { paginate } from './chunk-
|
|
11
|
-
export { readDeckReport } from './chunk-
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-
|
|
18
|
-
import './chunk-
|
|
10
|
+
import { paginate } from './chunk-QH2W6HIM.js';
|
|
11
|
+
export { readDeckReport } from './chunk-EDCRBTJF.js';
|
|
12
|
+
import './chunk-GWJBZ4LC.js';
|
|
13
|
+
import './chunk-PIO73BQ6.js';
|
|
14
|
+
import './chunk-RYZPBJLB.js';
|
|
15
|
+
import './chunk-MN7DRK57.js';
|
|
16
|
+
import './chunk-O6BY3AU2.js';
|
|
17
|
+
import './chunk-QAEBYDKY.js';
|
|
18
|
+
import './chunk-6NBTZYYD.js';
|
|
19
|
+
import './chunk-H5QC3X3K.js';
|
|
20
|
+
import './chunk-XFOOKVRI.js';
|
|
19
21
|
import './chunk-XRMV2GMB.js';
|
|
20
|
-
import './chunk-
|
|
21
|
-
import './chunk-
|
|
22
|
+
import './chunk-EQ6S5SEZ.js';
|
|
23
|
+
import './chunk-F4HFDP6I.js';
|
|
22
24
|
|
|
23
25
|
// src/node/paginate.ts
|
|
24
26
|
async function paginateDeck(deck, options) {
|
package/dist/pagination.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { OPFPaginationError, paginate, paginateSlide } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { OPFPaginationError, paginate, paginateSlide } from './chunk-QH2W6HIM.js';
|
|
2
|
+
import './chunk-XFOOKVRI.js';
|
|
3
3
|
import './chunk-XRMV2GMB.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-F4HFDP6I.js';
|
package/dist/patch.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { OPFPatchError, OPFPatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-
|
|
1
|
+
export { OPFPatchError, OPFPatchValidationError, applyPatch, applyPatchWithInverse, escapePointerToken, formatPointer, getAtPointer, hasPointer, invertPatch, jsonEqual, normalizePatch, parsePointer, pointerFromPath, readPointer, splitPointer, unescapePointerToken } from './chunk-XFOOKVRI.js';
|
|
2
2
|
import './chunk-XRMV2GMB.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-F4HFDP6I.js';
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { C as CatalogRecordKind } from './catalog-schemas-DoxA2BgY.js';
|
|
2
|
+
import { SchemaName } from './schemas.js';
|
|
2
3
|
import './catalog-refs-BSfGELpt.js';
|
|
3
|
-
import './schemas.js';
|
|
4
4
|
import './json-BFSdESOE.js';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Which catalog a reference field points into, kept beside the schemas rather than in them: the published schemas
|
|
8
|
+
* (spec/schemas, openpresentation.org/schema/...) carry no vendor keyword, so any Ajv in strict mode (the default) compiles
|
|
9
|
+
* them without `addKeyword`. `check:schema-strict` keeps it that way.
|
|
10
|
+
*
|
|
11
|
+
* Keys are `<schema name>#<JSON Pointer of the node in that schema document>` (the schema names of `@openpresentation/opf/schemas`);
|
|
12
|
+
* the node is the one at the pointer as written, a `$ref` and its siblings included. Values are the catalog record kind the
|
|
13
|
+
* field references. The annotation never changes validation: `describeField` and `catalogKindAt` read it, nothing else.
|
|
14
|
+
* A test fails when a pointer leaves its schema or a schema reference field is missing here.
|
|
15
|
+
*/
|
|
16
|
+
type SchemaNodeKey = `${SchemaName}#/${string}`;
|
|
17
|
+
declare const schemaCatalogKinds: Readonly<Record<SchemaNodeKey, CatalogRecordKind>>;
|
|
18
|
+
|
|
6
19
|
/**
|
|
7
20
|
* `@openpresentation/opf/schema`: the field model of an OPF document, read from the JSON Schemas.
|
|
8
21
|
*
|
|
@@ -10,7 +23,8 @@ import './json-BFSdESOE.js';
|
|
|
10
23
|
* `listSchemaFields`, ...) move here from the editor so that the CLI, agents and every editor read the schemas one way. On top of
|
|
11
24
|
* them, `describeField(path, document?)` answers what a source editor needs at any position (the types, enum values,
|
|
12
25
|
* description, required members and ranked children of the node) and `catalogKindAt(path, document?)` names the catalog a
|
|
13
|
-
* reference field points into, from
|
|
26
|
+
* reference field points into, from `schemaCatalogKinds`, core-side metadata kept beside the schemas (the published schemas carry
|
|
27
|
+
* no vendor keyword, so they compile under strict Ajv; the metadata never changes validation).
|
|
14
28
|
*
|
|
15
29
|
* Browser-safe: no `node:` imports. Types are deliberately loose (`JsonSchema`), the schemas being plain JSON.
|
|
16
30
|
*/
|
|
@@ -143,9 +157,9 @@ interface FieldInfo {
|
|
|
143
157
|
declare function describeField(path: OpfPath, document?: unknown): FieldInfo;
|
|
144
158
|
/**
|
|
145
159
|
* The catalog kind a field references (`layouts`, `themes`, `colorSchemes`, `fontSchemes`, `narratives`, `audiences`,
|
|
146
|
-
* `purposes`, `tones`), read from
|
|
160
|
+
* `purposes`, `tones`), read from `schemaCatalogKinds` for the schema node at `path`; undefined for every other field.
|
|
147
161
|
* Languages are an engine vocabulary, not a catalog: `language` is not a reference.
|
|
148
162
|
*/
|
|
149
163
|
declare function catalogKindAt(path: OpfPath, document?: unknown): CatalogRecordKind | undefined;
|
|
150
164
|
|
|
151
|
-
export { COMMON_KEYS, CatalogRecordKind, type EnumValue, type FieldChild, type FieldInfo, type JsonSchema, type OpfPath, type SchemaField, type SchemaRoot, UNRANKED_PRIORITY, type VariantInfo, activeSchema, catalogKindAt, createSchemaValue, describeField, isPromotedRegionKey, listSchemaFields, resolveSchema, schemaAtPath, schemaLabel, schemaType, schemaVariants, splitOpfPath };
|
|
165
|
+
export { COMMON_KEYS, CatalogRecordKind, type EnumValue, type FieldChild, type FieldInfo, type JsonSchema, type OpfPath, type SchemaField, type SchemaNodeKey, type SchemaRoot, UNRANKED_PRIORITY, type VariantInfo, activeSchema, catalogKindAt, createSchemaValue, describeField, isPromotedRegionKey, listSchemaFields, resolveSchema, schemaAtPath, schemaCatalogKinds, schemaLabel, schemaType, schemaVariants, splitOpfPath };
|
package/dist/schema.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { COMMON_KEYS, UNRANKED_PRIORITY, activeSchema, catalogKindAt, createSchemaValue, describeField, isPromotedRegionKey, listSchemaFields, resolveSchema, schemaAtPath, schemaLabel, schemaType, schemaVariants, splitOpfPath } from './chunk-
|
|
1
|
+
export { COMMON_KEYS, UNRANKED_PRIORITY, activeSchema, catalogKindAt, createSchemaValue, describeField, isPromotedRegionKey, listSchemaFields, resolveSchema, schemaAtPath, schemaCatalogKinds, schemaLabel, schemaType, schemaVariants, splitOpfPath } from './chunk-XFOOKVRI.js';
|
|
2
2
|
import './chunk-XRMV2GMB.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-F4HFDP6I.js';
|
package/dist/schemas.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-
|
|
1
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-F4HFDP6I.js';
|
package/dist/source.d.ts
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { b as FindingLocation } from './finding-l9dlQ2NF.js';
|
|
2
2
|
|
|
3
|
+
/** Keys of `<!-- slide: ... -->`. */
|
|
4
|
+
declare const SLIDE_OPTION_KEYS: readonly ["id", "type", "layout", "section", "tag", "hidden", "beat"];
|
|
5
|
+
/** Keys of `<!-- block: ... -->`. */
|
|
6
|
+
declare const BLOCK_OPTION_KEYS: readonly ["id", "type", "as", "region"];
|
|
7
|
+
/** Values of `as=` in a block options comment. */
|
|
8
|
+
declare const BLOCK_AS_VALUES: readonly ["bullets", "video"];
|
|
9
|
+
/** The first word of a fence info string that is not code: `chart`, `metric`, `timeline` and the two YAML escape hatches. */
|
|
10
|
+
declare const FENCE_KINDS: readonly ["chart", "metric", "timeline", "opf-block", "opf-slide"];
|
|
11
|
+
/** Lines of a ```metric fence: `key: value`. */
|
|
12
|
+
declare const METRIC_KEYS: readonly ["value", "label", "description", "unit", "delta", "trend", "sentiment"];
|
|
13
|
+
/** Attributes after the info word: `chart` takes `alt`, `timeline` `name` and `description`, a code fence `title`. */
|
|
14
|
+
declare const FENCE_ATTRIBUTES: {
|
|
15
|
+
readonly chart: readonly ["alt"];
|
|
16
|
+
readonly timeline: readonly ["name", "description"];
|
|
17
|
+
readonly code: readonly ["title"];
|
|
18
|
+
};
|
|
19
|
+
/** Flags of an inline span `[text]{bold italic}` (the converter also reads `strikethrough`, `superscript` and `subscript`). */
|
|
20
|
+
declare const SPAN_FLAGS: readonly ["bold", "italic", "underline", "strike", "sup", "sub"];
|
|
21
|
+
/** Attributes of an inline span that take a value: `[text]{color=#B42318 size=24 font="Open Sans" lang=fr}`. */
|
|
22
|
+
declare const SPAN_VALUES: readonly ["color", "size", "font", "lang"];
|
|
23
|
+
/** Keywords a line of a slide can start with. */
|
|
24
|
+
declare const LINE_KEYWORDS: readonly ["Note:", "Notes:"];
|
|
25
|
+
type FenceKind = (typeof FENCE_KINDS)[number];
|
|
26
|
+
|
|
3
27
|
/**
|
|
4
28
|
* A range of source text in the `Finding.location` convention: UTF-16 offset and length, 1-based line and column (a line break is
|
|
5
29
|
* `\r\n`, `\r` or `\n`). `exact: false` marks a range that is the nearest ancestor of a node the text does not have.
|
|
@@ -85,13 +109,87 @@ interface PathAtResult {
|
|
|
85
109
|
* underlined in the source. Tolerant: it reads text with syntax errors, comments and trailing commas as far as it can be read.
|
|
86
110
|
* When the node does not exist, the range is that of the nearest ancestor that does, with `exact: false`.
|
|
87
111
|
*
|
|
88
|
-
*
|
|
112
|
+
* JSON, YAML and Markdown. YAML is read with the `yaml` library's tolerant parse, so a text with syntax errors is located as far as it
|
|
113
|
+
* can be read. Markdown uses the ranges the converter records for every part it reads (the ones its findings are located by): a
|
|
114
|
+
* slide, its title, a list item, a block, the `layout=` of an options comment, the keys of the front matter and of the YAML in
|
|
115
|
+
* `opf-slide` and `opf-block` fences. A slide field the Markdown writes as a line (`# Title`, `- item`) has `value` = the text after
|
|
116
|
+
* the marker, `key` = the marker and `entry` = the line.
|
|
89
117
|
*/
|
|
90
118
|
declare function locate(text: string, format: SourceFormat, pointer: string | readonly (string | number)[], options?: LocateOptions): TextRange | undefined;
|
|
91
119
|
/**
|
|
92
|
-
* The document path and the kind of position at a character offset (a caret between characters)
|
|
93
|
-
*
|
|
120
|
+
* The document path and the kind of position at a character offset (a caret between characters), in JSON, YAML or Markdown.
|
|
121
|
+
* Tolerant of broken text. In YAML a position on the whitespace of a blank line is `none` after the last node and `between` inside
|
|
122
|
+
* a collection; in Markdown a position outside the front matter and the slides is `none`.
|
|
94
123
|
*/
|
|
95
124
|
declare function pathAt(text: string, format: SourceFormat, offset: number): PathAtResult | undefined;
|
|
96
125
|
|
|
97
|
-
|
|
126
|
+
/** A range of the text: UTF-16 offsets, `from` inclusive and `to` exclusive, and the one-based line `from` is on. */
|
|
127
|
+
interface ScanRange {
|
|
128
|
+
from: number;
|
|
129
|
+
to: number;
|
|
130
|
+
line: number;
|
|
131
|
+
}
|
|
132
|
+
interface MarkdownFrontMatter extends ScanRange {
|
|
133
|
+
/** The YAML between the two `---` lines: from the end of the opening line to the start of the closing line. */
|
|
134
|
+
yamlFrom: number;
|
|
135
|
+
yamlTo: number;
|
|
136
|
+
/** False when the closing `---` (or `...`) line is missing: then the YAML runs to the end of the text. */
|
|
137
|
+
closed: boolean;
|
|
138
|
+
}
|
|
139
|
+
interface MarkdownSlideScan extends ScanRange {
|
|
140
|
+
/** The slide's number in the converted deck (empty segments between `---` lines are not slides). */
|
|
141
|
+
index: number;
|
|
142
|
+
}
|
|
143
|
+
interface MarkdownCommentScan extends ScanRange {
|
|
144
|
+
/** `slide` and `block` are options comments (`<!-- slide: ... -->`), `comment` any other. */
|
|
145
|
+
kind: "slide" | "block" | "comment";
|
|
146
|
+
/** The text between `<!--` and `-->` (for an unclosed comment, to the end of its last line). */
|
|
147
|
+
innerFrom: number;
|
|
148
|
+
innerTo: number;
|
|
149
|
+
closed: boolean;
|
|
150
|
+
/** The slide it is in. */
|
|
151
|
+
slide: number;
|
|
152
|
+
}
|
|
153
|
+
interface MarkdownFenceScan extends ScanRange {
|
|
154
|
+
/** The opening fence characters (```` ``` ````, `~~~~`). */
|
|
155
|
+
marker: string;
|
|
156
|
+
/** The info string after the fence characters, trimmed; `infoFrom` and `infoTo` are its offsets. */
|
|
157
|
+
info: string;
|
|
158
|
+
infoFrom: number;
|
|
159
|
+
infoTo: number;
|
|
160
|
+
/** The first word of the info string. */
|
|
161
|
+
word: string;
|
|
162
|
+
/** `chart`, `metric`, `timeline`, `opf-block`, `opf-slide`, or `code` for any other fence. */
|
|
163
|
+
kind: FenceKind | "code";
|
|
164
|
+
/** The lines between the fences: `bodyFrom` is the start of the first line, `bodyTo` the end of the last (equal when the body is empty). */
|
|
165
|
+
bodyFrom: number;
|
|
166
|
+
bodyTo: number;
|
|
167
|
+
closed: boolean;
|
|
168
|
+
slide: number;
|
|
169
|
+
}
|
|
170
|
+
interface MarkdownNotesScan extends ScanRange {
|
|
171
|
+
slide: number;
|
|
172
|
+
}
|
|
173
|
+
interface MarkdownScan {
|
|
174
|
+
frontMatter?: MarkdownFrontMatter;
|
|
175
|
+
/** The slides, in order; each runs from its first to its last non-blank line. */
|
|
176
|
+
slides: MarkdownSlideScan[];
|
|
177
|
+
/** Offsets of the `---` lines that separate slides. */
|
|
178
|
+
separators: number[];
|
|
179
|
+
comments: MarkdownCommentScan[];
|
|
180
|
+
fences: MarkdownFenceScan[];
|
|
181
|
+
/** Speaker notes: from the `Note:` or `Notes:` line to the end of the slide. */
|
|
182
|
+
notes: MarkdownNotesScan[];
|
|
183
|
+
}
|
|
184
|
+
interface ScanMarkdownOptions {
|
|
185
|
+
/** How the text is cut into slides, as for `fromMarkdown`. */
|
|
186
|
+
split?: "auto" | "rules" | "headings";
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The structure of a Markdown deck, found with the converter's line rules: front matter, slides, option comments, fences and notes, as
|
|
190
|
+
* offset ranges. Tolerant: an unclosed front matter, comment or fence is reported with `closed: false` and runs to the end of its slide.
|
|
191
|
+
* It is the one place an editor learns the dialect's regions from.
|
|
192
|
+
*/
|
|
193
|
+
declare function scanMarkdown(source: string, options?: ScanMarkdownOptions): MarkdownScan;
|
|
194
|
+
|
|
195
|
+
export { type AnalyzeOptions, BLOCK_AS_VALUES, BLOCK_OPTION_KEYS, FENCE_ATTRIBUTES, FENCE_KINDS, LINE_KEYWORDS, type LocateOptions, type LocatePart, METRIC_KEYS, type MarkdownCommentScan, type MarkdownFenceScan, type MarkdownFrontMatter, type MarkdownNotesScan, type MarkdownScan, type MarkdownSlideScan, type PathAtResult, SLIDE_OPTION_KEYS, SPAN_FLAGS, SPAN_VALUES, type ScanMarkdownOptions, type ScanRange, type SourceFormat, type SyntaxFix, type SyntaxProblem, type SyntaxProblemCode, type TextEdit, type TextRange, analyzeJsonSyntax, applyTextEdits, locate, pathAt, scanMarkdown };
|