@openpresentation/opf 0.30.0 → 0.32.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/README.md +1 -1
- package/dist/browser.js +18 -18
- package/dist/{catalog-schemas-CC1d_h8s.d.ts → catalog-schemas-LdqOPebq.d.ts} +2 -2
- package/dist/{chart-data-Ci9s_NDN.d.ts → chart-data-oIZQlFGi.d.ts} +4 -2
- package/dist/{chunk-UKWNHK62.js → chunk-2E6CDYL2.js} +23 -6
- package/dist/{chunk-I6G32TB5.js → chunk-56J345KE.js} +5 -5
- package/dist/{chunk-AFYXG3IB.js → chunk-7U3TJBXE.js} +100 -16
- package/dist/chunk-AQEAZDL2.js +9 -0
- package/dist/{chunk-HRKV43GC.js → chunk-BBVW5ZC2.js} +3 -3
- package/dist/{chunk-7UO6H32I.js → chunk-CLRYHWQN.js} +162 -22
- package/dist/chunk-DGS47ONG.js +1 -0
- package/dist/{chunk-F5QC7E2O.js → chunk-F7DN33UL.js} +28 -8
- package/dist/{chunk-KELC4K62.js → chunk-HKUV7NEN.js} +1 -1
- package/dist/{chunk-XG4JKFZ6.js → chunk-IT7FQKED.js} +6 -6
- package/dist/{chunk-SYCHWS7C.js → chunk-J63CIRIV.js} +4 -4
- package/dist/{chunk-5Q4IYLMW.js → chunk-LEF4X4KI.js} +274 -33
- package/dist/{chunk-5OMZW44K.js → chunk-NEJ32O7X.js} +1 -1
- package/dist/chunk-NVAJASOD.js +14764 -0
- package/dist/{chunk-M7YZU3DX.js → chunk-OXLA4HXQ.js} +615 -58
- package/dist/{chunk-P5E3FNYO.js → chunk-PB7ME64J.js} +1 -1
- package/dist/{chunk-ARFAQNOH.js → chunk-SW676APJ.js} +2 -2
- package/dist/{chunk-W7KPMUJF.js → chunk-XFHXQCXL.js} +58 -5
- package/dist/{chunk-KOCXV7H3.js → chunk-XQO2CT6Q.js} +2 -2
- package/dist/{chunk-WHDOOLIO.js → chunk-YFJIIIOL.js} +3 -3
- package/dist/composition-DRqNGHJV.d.ts +5620 -0
- package/dist/composition.d.ts +2 -2
- package/dist/composition.js +1 -1
- package/dist/{conversion-jdVnvct4.d.ts → conversion-Cadul8Mu.d.ts} +56 -9
- package/dist/conversion-J3YPDS7C.js +24 -0
- package/dist/convert.d.ts +2 -2
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +2 -2
- package/dist/data.js +2 -2
- package/dist/{deck-report-DQMsvyBI.d.ts → deck-report-BA3IPJAV.d.ts} +2 -2
- package/dist/deck.d.ts +5 -5
- package/dist/deck.js +11 -11
- package/dist/diagram-engine-eager.js +6 -0
- package/dist/diagram-engine-lazy.js +2 -0
- package/dist/diff.js +4 -4
- package/dist/docs.js +26 -20
- package/dist/examples.js +4759 -995
- package/dist/format.js +2 -2
- package/dist/ids.js +4 -4
- package/dist/index.d.ts +16 -13
- package/dist/index.js +24 -23
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +8 -8
- package/dist/node-engine.d.ts +8 -10
- package/dist/node-engine.js +22 -22
- package/dist/{pagination-DyAKYpXu.d.ts → pagination-DwEkdJ6s.d.ts} +74 -4
- package/dist/pagination.d.ts +3 -3
- package/dist/pagination.js +4 -4
- package/dist/patch.js +3 -3
- package/dist/precompiled.js +2 -2
- package/dist/{presentation-8jLSTFqL.d.ts → presentation-DnD7mfmf.d.ts} +106 -27
- package/dist/repo-readme.js +1 -1
- package/dist/schema-engine-ajv.js +1 -1
- package/dist/schema-engine-precompiled.js +2 -2
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +3 -3
- package/dist/schemas.d.ts +6 -0
- package/dist/schemas.js +1 -1
- package/dist/source.d.ts +4 -3
- package/dist/source.js +10 -10
- package/dist/spec/schemas/layout.schema.json +58 -8
- package/dist/spec/schemas/narrative.schema.json +2 -1
- package/dist/spec/schemas/opf.schema.json +122 -23
- package/dist/spec/schemas/theme.schema.json +9 -3
- package/dist/types.d.ts +69 -18
- package/dist/{validation-types-mNmfcY9A.d.ts → validation-types-vVah_PEv.d.ts} +1 -1
- package/dist/validator.d.ts +4 -4
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +2 -2
- package/dist/yaml.js +7 -7
- package/package.json +15 -6
- package/dist/chunk-W3SEWSO5.js +0 -8043
- package/dist/chunk-Z7XNHIW7.js +0 -16
- package/dist/chunk-ZROVYWGU.js +0 -1
- package/dist/composition-C-hd_Ci3.d.ts +0 -3207
- package/dist/conversion-FUOYO726.js +0 -24
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NOT_CHECKED } from './chunk-RYZPBJLB.js';
|
|
2
|
-
import { readMarkdown, parseSlideText, escapeInline, serializeRuns } from './chunk-
|
|
3
|
-
import { fenceCode } from './chunk-
|
|
4
|
-
import { OPFMarkdownError, writeYaml, Ctx, readYamlMapping, csvField, scalarText } from './chunk-
|
|
5
|
-
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-
|
|
6
|
-
import { validate } from './chunk-
|
|
7
|
-
import { checkCatalogsOption } from './chunk-
|
|
2
|
+
import { readMarkdown, parseSlideText, escapeInline, serializeRuns } from './chunk-2E6CDYL2.js';
|
|
3
|
+
import { fenceCode } from './chunk-NEJ32O7X.js';
|
|
4
|
+
import { OPFMarkdownError, writeYaml, Ctx, readYamlMapping, csvField, scalarText } from './chunk-BBVW5ZC2.js';
|
|
5
|
+
import { same, isRecord, runText, isPlainRun, FORMATTING } from './chunk-XQO2CT6Q.js';
|
|
6
|
+
import { validate } from './chunk-OXLA4HXQ.js';
|
|
7
|
+
import { checkCatalogsOption } from './chunk-NVAJASOD.js';
|
|
8
8
|
|
|
9
9
|
// src/markdown/canon.ts
|
|
10
10
|
var FORMAT_KEYS = FORMATTING;
|
|
@@ -105,6 +105,14 @@ function canonCode(value) {
|
|
|
105
105
|
if (value.filename !== void 0) out.filename = value.filename;
|
|
106
106
|
return out;
|
|
107
107
|
}
|
|
108
|
+
function canonDiagram(value) {
|
|
109
|
+
const source = typeof value === "string" ? value : isRecord(value) ? value.source : void 0;
|
|
110
|
+
if (typeof source !== "string" || !source.trim() || source.includes("\r") || /^[ \t]*\n|\n[ \t]*$/.test(source)) return void 0;
|
|
111
|
+
if (typeof value === "string") return value;
|
|
112
|
+
if (!isRecord(value) || !only(value, ["source", "syntax", "alt"]) || value.syntax !== void 0 && value.syntax !== "mermaid") return void 0;
|
|
113
|
+
if (value.alt !== void 0 && typeof value.alt !== "string") return void 0;
|
|
114
|
+
return value.alt === void 0 ? source : { source, alt: value.alt };
|
|
115
|
+
}
|
|
108
116
|
function canonMetric(value) {
|
|
109
117
|
if (typeof value === "string" || typeof value === "number") return value;
|
|
110
118
|
if (!isRecord(value) || !only(value, ["value", "label", "description", "unit", "delta", "trend", "sentiment"])) return void 0;
|
|
@@ -211,13 +219,15 @@ function canonContent(key, value) {
|
|
|
211
219
|
return canonChart(value);
|
|
212
220
|
case "timeline":
|
|
213
221
|
return canonTimeline(value);
|
|
222
|
+
case "diagram":
|
|
223
|
+
return canonDiagram(value);
|
|
214
224
|
default:
|
|
215
225
|
return void 0;
|
|
216
226
|
}
|
|
217
227
|
}
|
|
218
228
|
|
|
219
229
|
// src/markdown/emit.ts
|
|
220
|
-
var CONTENT = ["text", "items", "bullets", "image", "video", "chart", "table", "code", "metric", "quote", "timeline"];
|
|
230
|
+
var CONTENT = ["text", "items", "bullets", "image", "video", "chart", "table", "code", "metric", "quote", "timeline", "diagram"];
|
|
221
231
|
var isContent = (key) => CONTENT.includes(key);
|
|
222
232
|
var ROWS = "(?:top|middle|bottom|top\\+middle|middle\\+bottom|top\\+middle\\+bottom)";
|
|
223
233
|
var COLUMNS = "(?:left|center|right|left\\+center|center\\+right|left\\+center\\+right)";
|
|
@@ -325,6 +335,14 @@ function timelineLines(timeline) {
|
|
|
325
335
|
}
|
|
326
336
|
return fenced(info, body);
|
|
327
337
|
}
|
|
338
|
+
function diagramLines(diagram) {
|
|
339
|
+
const value = typeof diagram === "string" ? { source: diagram } : diagram;
|
|
340
|
+
const source = value.source, alt = value.alt;
|
|
341
|
+
if (alt !== void 0 && (alt.includes("`") || /[\r\n]/.test(alt))) return void 0;
|
|
342
|
+
const longest = Math.max(2, ...[...source.matchAll(/`+/g)].map((match) => match[0].length));
|
|
343
|
+
const fence = "`".repeat(longest + 1);
|
|
344
|
+
return [`${fence}mermaid${alt === void 0 ? "" : ` alt=${JSON.stringify(alt)}`}`, ...source.split("\n"), fence];
|
|
345
|
+
}
|
|
328
346
|
function metricLines(metric) {
|
|
329
347
|
const value = typeof metric === "object" ? metric : { value: metric };
|
|
330
348
|
const body = [];
|
|
@@ -377,7 +395,7 @@ function nativeLines(key, canon, marker) {
|
|
|
377
395
|
case "code": {
|
|
378
396
|
const code = typeof canon === "string" ? { source: canon } : canon;
|
|
379
397
|
const language = code.language;
|
|
380
|
-
if (language !== void 0 && (!/^[A-Za-z0-9_+#.-]+$/.test(language) || ["chart", "metric", "timeline", "opf-slide", "opf-block"].includes(language))) return void 0;
|
|
398
|
+
if (language !== void 0 && (!/^[A-Za-z0-9_+#.-]+$/.test(language) || ["chart", "metric", "timeline", "mermaid", "opf-slide", "opf-block"].includes(language))) return void 0;
|
|
381
399
|
return fenceCode(code.source, language, code.filename);
|
|
382
400
|
}
|
|
383
401
|
case "metric":
|
|
@@ -389,6 +407,8 @@ function nativeLines(key, canon, marker) {
|
|
|
389
407
|
return tableLines(canon);
|
|
390
408
|
case "timeline":
|
|
391
409
|
return timelineLines(canon);
|
|
410
|
+
case "diagram":
|
|
411
|
+
return diagramLines(canon);
|
|
392
412
|
default:
|
|
393
413
|
return void 0;
|
|
394
414
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { sortPresentationKeys } from './chunk-
|
|
1
|
+
import { sortPresentationKeys } from './chunk-HKUV7NEN.js';
|
|
2
2
|
import { NOT_CHECKED } from './chunk-RYZPBJLB.js';
|
|
3
|
-
import { Ctx, describeYamlErrors } from './chunk-
|
|
4
|
-
import { same } from './chunk-
|
|
5
|
-
import { validate } from './chunk-
|
|
6
|
-
import { presentation } from './chunk-
|
|
7
|
-
import { checkCatalogsOption } from './chunk-
|
|
3
|
+
import { Ctx, describeYamlErrors } from './chunk-BBVW5ZC2.js';
|
|
4
|
+
import { same } from './chunk-XQO2CT6Q.js';
|
|
5
|
+
import { validate } from './chunk-OXLA4HXQ.js';
|
|
6
|
+
import { presentation } from './chunk-LEF4X4KI.js';
|
|
7
|
+
import { checkCatalogsOption } from './chunk-NVAJASOD.js';
|
|
8
8
|
import { Parser, parseDocument, isMap, isSeq, Document, visit, isScalar, isAlias } from 'yaml';
|
|
9
9
|
|
|
10
10
|
var MAX_ALIAS_COUNT = 100;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fromMarkdown, toMarkdown } from './chunk-
|
|
2
|
-
import { fromYaml, toYaml } from './chunk-
|
|
1
|
+
import { fromMarkdown, toMarkdown } from './chunk-F7DN33UL.js';
|
|
2
|
+
import { fromYaml, toYaml } from './chunk-IT7FQKED.js';
|
|
3
3
|
import { NOT_CHECKED } from './chunk-RYZPBJLB.js';
|
|
4
|
-
import { parseSource, validate, OPFValidationError } from './chunk-
|
|
5
|
-
import { checkCatalogsOption } from './chunk-
|
|
4
|
+
import { parseSource, validate, OPFValidationError } from './chunk-OXLA4HXQ.js';
|
|
5
|
+
import { checkCatalogsOption } from './chunk-NVAJASOD.js';
|
|
6
6
|
|
|
7
7
|
// src/deck-report.ts
|
|
8
8
|
var DECK_FORMATS = ["json", "yaml", "markdown"];
|