@openpresentation/opf 0.26.4 → 0.26.6
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 +2 -0
- package/dist/browser.js +13 -12
- package/dist/{chunk-GWJBZ4LC.js → chunk-3S2XVDPN.js} +5 -5
- package/dist/{chunk-6IXSHIAL.js → chunk-4K4G3JXR.js} +6 -6
- package/dist/{chunk-QH2W6HIM.js → chunk-77KL2PMM.js} +1 -1
- package/dist/{chunk-H5QC3X3K.js → chunk-A54NGT2K.js} +1 -1
- package/dist/{chunk-NZLW6FBQ.js → chunk-D25BNPTW.js} +1 -1
- package/dist/chunk-G5WJMJV3.js +452 -0
- package/dist/{chunk-EDCRBTJF.js → chunk-GIWNHRTX.js} +3 -3
- package/dist/{chunk-MN7DRK57.js → chunk-H7XMO36O.js} +11 -21
- package/dist/{chunk-XFOOKVRI.js → chunk-IVPA6NG6.js} +5145 -3508
- package/dist/{chunk-ZSZDVIDV.js → chunk-NVT2YDVC.js} +2 -2
- package/dist/{chunk-O6BY3AU2.js → chunk-PHP45MO7.js} +1 -1
- package/dist/{chunk-PIO73BQ6.js → chunk-VZBFQLCA.js} +11 -20
- package/dist/{chunk-6NBTZYYD.js → chunk-Y25DYRME.js} +1 -1
- package/dist/chunk-Y4TZCE7R.js +712 -0
- package/dist/{conversion-DSafOGzh.d.ts → conversion-16M7eOGP.d.ts} +2 -2
- package/dist/conversion-F3T2FUP3.js +21 -0
- package/dist/convert.js +5 -5
- package/dist/deck.js +8 -8
- 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 +17 -16
- package/dist/markdown.js +6 -6
- package/dist/node-engine.d.ts +2 -2
- package/dist/node-engine.js +17 -16
- package/dist/pagination.js +2 -2
- package/dist/patch.js +1 -1
- package/dist/schema.js +1 -1
- package/dist/source.d.ts +83 -2
- package/dist/source.js +10 -9
- package/dist/validator.d.ts +8 -3
- package/dist/validator.js +1 -1
- package/dist/yaml.js +4 -4
- package/package.json +5 -5
- package/dist/chunk-QAEBYDKY.js +0 -192
- package/dist/conversion-QIAJM6DQ.js +0 -20
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen } from './chunk-
|
|
2
|
-
import { Ctx, splitLines, lineRange, readYamlMapping, readCsv, DECIMAL } from './chunk-
|
|
3
|
-
import { runText, isRecord, FORMATTING } from './chunk-
|
|
1
|
+
import { parseQuoteLines, levelsFromIndents, parseCodeFence, splitWhen } from './chunk-PHP45MO7.js';
|
|
2
|
+
import { Ctx, splitLines, lineRange, readYamlMapping, readCsv, DECIMAL } from './chunk-Y4TZCE7R.js';
|
|
3
|
+
import { runText, isRecord, FORMATTING } from './chunk-Y25DYRME.js';
|
|
4
|
+
import { METRIC_KEYS, nearest, BLOCK_AS_VALUES, SLIDE_OPTION_KEYS, BLOCK_OPTION_KEYS } from './chunk-IVPA6NG6.js';
|
|
4
5
|
import { PROMOTED_REGION_KEY } from './chunk-XRMV2GMB.js';
|
|
5
6
|
|
|
6
|
-
// src/markdown/dialect.ts
|
|
7
|
-
var SLIDE_OPTION_KEYS = ["id", "type", "layout", "section", "tag", "hidden", "beat"];
|
|
8
|
-
var BLOCK_OPTION_KEYS = ["id", "type", "as", "region"];
|
|
9
|
-
var BLOCK_AS_VALUES = ["bullets", "video"];
|
|
10
|
-
var FENCE_KINDS = ["chart", "metric", "timeline", "opf-block", "opf-slide"];
|
|
11
|
-
var METRIC_KEYS = ["value", "label", "description", "unit", "delta", "trend", "sentiment"];
|
|
12
|
-
var FENCE_ATTRIBUTES = { chart: ["alt"], timeline: ["name", "description"], code: ["title"] };
|
|
13
|
-
var SPAN_FLAGS = ["bold", "italic", "underline", "strike", "sup", "sub"];
|
|
14
|
-
var SPAN_VALUES = ["color", "size", "font", "lang"];
|
|
15
|
-
var LINE_KEYWORDS = ["Note:", "Notes:"];
|
|
16
|
-
|
|
17
7
|
// src/markdown/inline.ts
|
|
18
8
|
var PUNCT = /[\p{P}\p{S}]/u;
|
|
19
9
|
var WS = /\s/u;
|
|
@@ -22,7 +12,7 @@ var ASCII_PUNCT = /^[!-/:-@[-`{-~]$/;
|
|
|
22
12
|
var MAX_DEPTH = 16;
|
|
23
13
|
var MAX_TARGET = 2e3;
|
|
24
14
|
var MAX_SPAN = 300;
|
|
25
|
-
var
|
|
15
|
+
var SPAN_FLAGS = {
|
|
26
16
|
bold: "bold",
|
|
27
17
|
italic: "italic",
|
|
28
18
|
underline: "underline",
|
|
@@ -33,7 +23,7 @@ var SPAN_FLAGS2 = {
|
|
|
33
23
|
sub: "subscript",
|
|
34
24
|
subscript: "subscript"
|
|
35
25
|
};
|
|
36
|
-
var
|
|
26
|
+
var SPAN_VALUES = { color: "color", size: "fontSize", fontsize: "fontSize", font: "fontFamily", fontfamily: "fontFamily", lang: "lang" };
|
|
37
27
|
function parseAttributes(source) {
|
|
38
28
|
const pairs = [];
|
|
39
29
|
let i = 0;
|
|
@@ -73,8 +63,8 @@ function spanStyle(source, issue) {
|
|
|
73
63
|
if (error) issue("markdown/span-attributes", `${error} A span reads {bold italic color=#ff0000 size=24 font="Open Sans"}.`);
|
|
74
64
|
for (const [rawKey, value] of pairs) {
|
|
75
65
|
const key = rawKey.toLowerCase();
|
|
76
|
-
const flag =
|
|
77
|
-
const field =
|
|
66
|
+
const flag = SPAN_FLAGS[key];
|
|
67
|
+
const field = SPAN_VALUES[key];
|
|
78
68
|
if (flag) {
|
|
79
69
|
if (value === true || value === "true") style[flag] = true;
|
|
80
70
|
else if (value !== "false") issue("markdown/span-attributes", `Span flag ${rawKey} takes no value (or =true/false).`);
|
|
@@ -639,7 +629,7 @@ function parseOptions(text, keys, kind, ctx, range) {
|
|
|
639
629
|
let ok = true;
|
|
640
630
|
for (const [key, value] of pairs) {
|
|
641
631
|
if (!keys.includes(key)) {
|
|
642
|
-
ctx.error("options-unknown-key", `Unknown ${kind} option ${JSON.stringify(key)}.`, `${help} Anything else goes in a fenced opf-${kind} block.`, range);
|
|
632
|
+
ctx.error("options-unknown-key", `Unknown ${kind} option ${JSON.stringify(key)}.`, `${help} Anything else goes in a fenced opf-${kind} block.`, range, "", nearest(key, keys, 3).close);
|
|
643
633
|
ok = false;
|
|
644
634
|
} else if (key === "hidden") {
|
|
645
635
|
if (value === true || value === "true") out.hidden = true;
|
|
@@ -984,7 +974,7 @@ var SlideParser = class {
|
|
|
984
974
|
const { ctx } = this;
|
|
985
975
|
const type = /^[^\s]+/.exec(rest)?.[0];
|
|
986
976
|
if (!type) {
|
|
987
|
-
ctx.error("chart-type", "A chart block names its type after `chart`.", "Write ```chart column (or line, pie, bar, ...), then the data.", range, this.path);
|
|
977
|
+
ctx.error("chart-type", "A chart block names its type after `chart`.", "Write ```chart column (or line, pie, bar, ...), then the data.", range, this.path, ["column", "bar", "line", "pie"]);
|
|
988
978
|
return;
|
|
989
979
|
}
|
|
990
980
|
const { pairs, error } = parseAttributes(rest.slice(type.length));
|
|
@@ -1266,4 +1256,4 @@ function readMarkdown(source, options = {}) {
|
|
|
1266
1256
|
return { ctx, document, ...frontRange ? { front: frontRange } : {}, segments: kept };
|
|
1267
1257
|
}
|
|
1268
1258
|
|
|
1269
|
-
export {
|
|
1259
|
+
export { COMMENT, NOTES, escapeInline, fenceClose, fenceStart, frontMatter, isOutline, parseSlideText, readMarkdown, serializeRuns, splitSegments };
|