@openpresentation/opf 0.26.3 → 0.26.5
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 +3 -1
- package/dist/browser.js +14 -11
- package/dist/{chunk-NJWI6MPT.js → chunk-CIWC7DRZ.js} +1985 -366
- package/dist/{chunk-7RY7QWWJ.js → chunk-DXTPLVAK.js} +1 -1
- package/dist/{chunk-54OV2WQC.js → chunk-EFMR32A5.js} +1 -1
- package/dist/{chunk-PXOXTJTN.js → chunk-HPEZCAYC.js} +1 -1
- package/dist/{chunk-2ZQBMZTZ.js → chunk-K5Q3LLYK.js} +2 -2
- package/dist/chunk-KPALXWX3.js +712 -0
- package/dist/{chunk-34LIUOT7.js → chunk-L7YEVQHP.js} +6 -6
- package/dist/chunk-MD3CJ5YJ.js +452 -0
- package/dist/{chunk-WASENX2R.js → chunk-MLH5LIGF.js} +29 -647
- package/dist/chunk-RYZPBJLB.js +4 -0
- package/dist/{chunk-FXNUM2PN.js → chunk-STIYINEL.js} +4 -4
- package/dist/{chunk-YVNFACTC.js → chunk-TAV5S2JG.js} +1 -1
- package/dist/{chunk-GLLR3AQ5.js → chunk-UFEWQDQI.js} +1 -1
- package/dist/chunk-UY6SQVR2.js +639 -0
- package/dist/{chunk-PB5X2VSV.js → chunk-WAZDP2WS.js} +12 -20
- package/dist/{conversion-BjsKgxBZ.d.ts → conversion-C7o2EpDb.d.ts} +2 -2
- package/dist/conversion-PMJWLHDV.js +21 -0
- package/dist/convert.js +5 -5
- package/dist/deck.js +9 -7
- package/dist/diff.js +2 -2
- package/dist/docs.js +3 -3
- package/dist/explain-JSuESV-Y.d.ts +71 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +18 -15
- package/dist/markdown.js +7 -5
- package/dist/node-engine.d.ts +2 -2
- package/dist/node-engine.js +18 -15
- package/dist/pagination.js +2 -2
- package/dist/patch.js +1 -1
- package/dist/schema.js +1 -1
- package/dist/source.d.ts +184 -5
- package/dist/source.js +391 -11
- package/dist/validator.js +1 -1
- package/dist/yaml.js +5 -4
- package/package.json +5 -5
- package/dist/chunk-DEI2M2H6.js +0 -194
- package/dist/conversion-F4UCOGR7.js +0 -18
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { NOT_CHECKED
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { NOT_CHECKED } from './chunk-RYZPBJLB.js';
|
|
2
|
+
import { Ctx, describeYamlErrors } from './chunk-KPALXWX3.js';
|
|
3
|
+
import { same } from './chunk-HPEZCAYC.js';
|
|
4
|
+
import { validate } from './chunk-CIWC7DRZ.js';
|
|
4
5
|
import { checkCatalogsOption } from './chunk-XRMV2GMB.js';
|
|
5
6
|
import { sortPresentationKeys } from './chunk-EQ6S5SEZ.js';
|
|
6
7
|
import { presentation } from './chunk-F4HFDP6I.js';
|
|
7
|
-
import { Parser, parseDocument, isMap, Document, visit, isScalar, isAlias
|
|
8
|
+
import { Parser, parseDocument, isMap, isSeq, Document, visit, isScalar, isAlias } from 'yaml';
|
|
8
9
|
|
|
9
10
|
var MAX_ALIAS_COUNT = 100;
|
|
10
11
|
var CORE_TAGS = new Set(["map", "seq", "str", "int", "float", "bool", "null"].map((name) => `tag:yaml.org,2002:${name}`));
|
|
@@ -58,16 +59,6 @@ function describeError(error) {
|
|
|
58
59
|
return { rule: "syntax", message: `YAML: ${text}`, help: "Fix the YAML syntax at this position. An OPF file holds JSON-compatible YAML 1.2: mappings, sequences and scalars." };
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
function keyRangeAt(doc, start) {
|
|
62
|
-
let found;
|
|
63
|
-
visit(doc, {
|
|
64
|
-
Pair(_key, pair) {
|
|
65
|
-
const key = pair.key;
|
|
66
|
-
if (!found && key?.range && key.range[0] === start) found = { start, end: key.range[1] };
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return found;
|
|
70
|
-
}
|
|
71
62
|
function readYamlDocument(source, aliases, rootKind = "mapping") {
|
|
72
63
|
const bom = source.startsWith("\uFEFF") ? 1 : 0;
|
|
73
64
|
const text = source.slice(bom);
|
|
@@ -90,20 +81,21 @@ function readYamlDocument(source, aliases, rootKind = "mapping") {
|
|
|
90
81
|
findings,
|
|
91
82
|
errors: findings.length
|
|
92
83
|
});
|
|
93
|
-
for (const
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
84
|
+
for (const problem of describeYamlErrors(text, doc, doc.errors)) add(problem.rule, problem.message, problem.help, { start: problem.start, end: problem.end });
|
|
85
|
+
for (const warning of doc.warnings.filter((entry) => entry.code === "TAG_RESOLVE_FAILED")) {
|
|
86
|
+
const described = describeError(warning);
|
|
87
|
+
const [start, end] = warning.pos;
|
|
88
|
+
add(described.rule, described.message, described.help, { start, end: Math.max(start, end) });
|
|
97
89
|
}
|
|
98
90
|
if (findings.length) return finish({});
|
|
99
91
|
const root = doc.contents;
|
|
100
92
|
if (root === null || !root.range) {
|
|
101
|
-
add("empty", "The
|
|
93
|
+
add("empty", "The document is empty (or everything in it is a comment).", "Write `slides:` and at least one `- title:` line.", { start: 0, end: Math.min(1, text.length) });
|
|
102
94
|
return finish({});
|
|
103
95
|
}
|
|
104
96
|
const rootRange = { start: root.range[0], end: root.range[1] };
|
|
105
97
|
if (rootKind === "mapping" && !isMap(root)) {
|
|
106
|
-
add("not-mapping",
|
|
98
|
+
add("not-mapping", `The top level must be \`key: value\` lines, but this is ${isSeq(root) ? "a list" : "plain text"}.`, isSeq(root) ? "Put the list under `slides:`." : "Start with `name:` and `slides:` lines.", rootRange);
|
|
107
99
|
return finish({});
|
|
108
100
|
}
|
|
109
101
|
checkTree({ doc, text, aliases, add }, root, [], []);
|
|
@@ -43,8 +43,8 @@ declare const RENDER_PACKAGE = "@openpresentation/opf-render";
|
|
|
43
43
|
declare const PPTX_PACKAGE = "@openpresentation/opf-pptx";
|
|
44
44
|
/** Peer ranges. The CLI checks the features it calls rather than the version, so a newer release in range keeps working. */
|
|
45
45
|
declare const PEER_RANGES: {
|
|
46
|
-
readonly "@openpresentation/opf-render": "^0.26.
|
|
47
|
-
readonly "@openpresentation/opf-pptx": "^0.26.
|
|
46
|
+
readonly "@openpresentation/opf-render": "^0.26.5";
|
|
47
|
+
readonly "@openpresentation/opf-pptx": "^0.26.5";
|
|
48
48
|
};
|
|
49
49
|
interface Diagnostic {
|
|
50
50
|
code: string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { convertFiles, deckFileFormat, exportFormatOf, openDeck, planConversion, readInput, saveDeck, writePlanned } from './chunk-L7YEVQHP.js';
|
|
2
|
+
import './chunk-K5Q3LLYK.js';
|
|
3
|
+
import './chunk-UFEWQDQI.js';
|
|
4
|
+
import './chunk-UJSAR6GF.js';
|
|
5
|
+
import './chunk-PJSPHHRK.js';
|
|
6
|
+
import './chunk-TKQ2VFV5.js';
|
|
7
|
+
import './chunk-EFMR32A5.js';
|
|
8
|
+
import './chunk-STIYINEL.js';
|
|
9
|
+
import './chunk-UY6SQVR2.js';
|
|
10
|
+
import './chunk-WAZDP2WS.js';
|
|
11
|
+
import './chunk-RYZPBJLB.js';
|
|
12
|
+
import './chunk-MD3CJ5YJ.js';
|
|
13
|
+
import './chunk-MLH5LIGF.js';
|
|
14
|
+
import './chunk-DXTPLVAK.js';
|
|
15
|
+
import './chunk-KPALXWX3.js';
|
|
16
|
+
import './chunk-HPEZCAYC.js';
|
|
17
|
+
import './chunk-TAV5S2JG.js';
|
|
18
|
+
import './chunk-CIWC7DRZ.js';
|
|
19
|
+
import './chunk-XRMV2GMB.js';
|
|
20
|
+
import './chunk-EQ6S5SEZ.js';
|
|
21
|
+
import './chunk-F4HFDP6I.js';
|
package/dist/convert.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { paginate, OPFPaginationError } from './chunk-
|
|
2
|
-
import { parseQuoteLines, parseCodeFence, splitWhen, parseListLine, levelsFromIndents, fenceCode } from './chunk-
|
|
3
|
-
import { CONTENT_KEYS, isRecord, contentKeysOf, refuse, clone, Loss, isSlideLike, assertValidOwner, report, OPFConversionError, plainOf, assertValidOutput, same, splitRuns, runsOf, lineIsPlain, linePlain, concatText, lineValue, joinLines, hasFormatting } from './chunk-
|
|
4
|
-
export { OPFConversionError } from './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
import { paginate, OPFPaginationError } from './chunk-EFMR32A5.js';
|
|
2
|
+
import { parseQuoteLines, parseCodeFence, splitWhen, parseListLine, levelsFromIndents, fenceCode } from './chunk-DXTPLVAK.js';
|
|
3
|
+
import { CONTENT_KEYS, isRecord, contentKeysOf, refuse, clone, Loss, isSlideLike, assertValidOwner, report, OPFConversionError, plainOf, assertValidOutput, same, splitRuns, runsOf, lineIsPlain, linePlain, concatText, lineValue, joinLines, hasFormatting } from './chunk-HPEZCAYC.js';
|
|
4
|
+
export { OPFConversionError } from './chunk-HPEZCAYC.js';
|
|
5
|
+
import './chunk-CIWC7DRZ.js';
|
|
6
6
|
import { promotedRegionKeys, isDatasetRef, inlineTableData, visitContentPayloads, chartNumber } from './chunk-XRMV2GMB.js';
|
|
7
7
|
import './chunk-F4HFDP6I.js';
|
|
8
8
|
|
package/dist/deck.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
1
|
+
export { DECK_FORMATS, deckFormatOf, parse, stringify } from './chunk-STIYINEL.js';
|
|
2
|
+
import './chunk-UY6SQVR2.js';
|
|
3
|
+
import './chunk-WAZDP2WS.js';
|
|
4
|
+
import './chunk-RYZPBJLB.js';
|
|
5
|
+
import './chunk-MLH5LIGF.js';
|
|
6
|
+
import './chunk-DXTPLVAK.js';
|
|
7
|
+
import './chunk-KPALXWX3.js';
|
|
8
|
+
import './chunk-HPEZCAYC.js';
|
|
9
|
+
import './chunk-CIWC7DRZ.js';
|
|
8
10
|
import './chunk-XRMV2GMB.js';
|
|
9
11
|
import './chunk-EQ6S5SEZ.js';
|
|
10
12
|
import './chunk-F4HFDP6I.js';
|
package/dist/diff.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { categoryOf, describeValue, diff, formatDiffReport, matchArrays, merge, similarity } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { categoryOf, describeValue, diff, formatDiffReport, matchArrays, merge, similarity } from './chunk-TAV5S2JG.js';
|
|
2
|
+
import './chunk-CIWC7DRZ.js';
|
|
3
3
|
import './chunk-XRMV2GMB.js';
|
|
4
4
|
import './chunk-F4HFDP6I.js';
|