@storyteller-platform/align 0.1.7 → 0.1.9
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/align/align.cjs
CHANGED
|
@@ -481,7 +481,7 @@ function createMediaOverlay(chapter, sentenceRanges) {
|
|
|
481
481
|
import_epub.Epub.createXmlElement(
|
|
482
482
|
"smil",
|
|
483
483
|
{
|
|
484
|
-
xmlns: "
|
|
484
|
+
xmlns: "http://www.w3.org/ns/SMIL",
|
|
485
485
|
"xmlns:epub": "http://www.idpf.org/2007/ops",
|
|
486
486
|
version: "3.0"
|
|
487
487
|
},
|
package/dist/align/align.js
CHANGED
|
@@ -415,7 +415,7 @@ function createMediaOverlay(chapter, sentenceRanges) {
|
|
|
415
415
|
Epub.createXmlElement(
|
|
416
416
|
"smil",
|
|
417
417
|
{
|
|
418
|
-
xmlns: "
|
|
418
|
+
xmlns: "http://www.w3.org/ns/SMIL",
|
|
419
419
|
"xmlns:epub": "http://www.idpf.org/2007/ops",
|
|
420
420
|
version: "3.0"
|
|
421
421
|
},
|
package/dist/align/slugify.cjs
CHANGED
|
@@ -66,6 +66,7 @@ function createReplacers(locale) {
|
|
|
66
66
|
if (!numeralMatch) return match[0];
|
|
67
67
|
const normalizedNumeral = numeralMatch.replaceAll(new RegExp(`\\${currencySymbols.group}`, "g"), "").replace(new RegExp(`\\${currencySymbols.decimal}`), ".");
|
|
68
68
|
const number = parseFloat(normalizedNumeral);
|
|
69
|
+
if (Number.isNaN(number)) return match[0];
|
|
69
70
|
return (0, import_to_words.toWords)(number, {
|
|
70
71
|
localeCode: `${maximizedLocale.language}-${maximizedLocale.region}`,
|
|
71
72
|
currency: true,
|
|
@@ -101,6 +102,7 @@ function createReplacers(locale) {
|
|
|
101
102
|
if (!numeralMatch) return match[0];
|
|
102
103
|
const normalizedNumeral = numeralMatch.replaceAll(new RegExp(`\\${numberSymbols.group}`, "g"), "").replace(new RegExp(`\\${numberSymbols.decimal}`), ".");
|
|
103
104
|
const number = parseFloat(normalizedNumeral);
|
|
105
|
+
if (Number.isNaN(number)) return match[0];
|
|
104
106
|
return (0, import_to_words.toWords)(number, {
|
|
105
107
|
localeCode: `${maximizedLocale.language}-${maximizedLocale.region}`
|
|
106
108
|
});
|
package/dist/align/slugify.js
CHANGED
|
@@ -44,6 +44,7 @@ function createReplacers(locale) {
|
|
|
44
44
|
if (!numeralMatch) return match[0];
|
|
45
45
|
const normalizedNumeral = numeralMatch.replaceAll(new RegExp(`\\${currencySymbols.group}`, "g"), "").replace(new RegExp(`\\${currencySymbols.decimal}`), ".");
|
|
46
46
|
const number = parseFloat(normalizedNumeral);
|
|
47
|
+
if (Number.isNaN(number)) return match[0];
|
|
47
48
|
return toWords(number, {
|
|
48
49
|
localeCode: `${maximizedLocale.language}-${maximizedLocale.region}`,
|
|
49
50
|
currency: true,
|
|
@@ -79,6 +80,7 @@ function createReplacers(locale) {
|
|
|
79
80
|
if (!numeralMatch) return match[0];
|
|
80
81
|
const normalizedNumeral = numeralMatch.replaceAll(new RegExp(`\\${numberSymbols.group}`, "g"), "").replace(new RegExp(`\\${numberSymbols.decimal}`), ".");
|
|
81
82
|
const number = parseFloat(normalizedNumeral);
|
|
83
|
+
if (Number.isNaN(number)) return match[0];
|
|
82
84
|
return toWords(number, {
|
|
83
85
|
localeCode: `${maximizedLocale.language}-${maximizedLocale.region}`
|
|
84
86
|
});
|
package/dist/markup/markup.cjs
CHANGED
|
@@ -75,7 +75,7 @@ var import_ghost_story = require("@storyteller-platform/ghost-story");
|
|
|
75
75
|
var import_segmentation = require("./segmentation.cjs");
|
|
76
76
|
var import_semantics = require("./semantics.cjs");
|
|
77
77
|
async function markup(input, output, options) {
|
|
78
|
-
var _a, _b;
|
|
78
|
+
var _a, _b, _c, _d;
|
|
79
79
|
var _stack = [];
|
|
80
80
|
try {
|
|
81
81
|
const timing = (0, import_ghost_story.createAggregator)();
|
|
@@ -84,6 +84,7 @@ async function markup(input, output, options) {
|
|
|
84
84
|
const epub = __using(_stack, await import_epub.Epub.from(output));
|
|
85
85
|
const primaryLocale = options.primaryLocale ?? await epub.getLanguage();
|
|
86
86
|
const spine = await epub.getSpineItems();
|
|
87
|
+
const manifest = await epub.getManifest();
|
|
87
88
|
for (let index = 0; index < spine.length; index++) {
|
|
88
89
|
(_a = options.onProgress) == null ? void 0 : _a.call(options, index / spine.length);
|
|
89
90
|
const spineItem = spine[index];
|
|
@@ -91,6 +92,9 @@ async function markup(input, output, options) {
|
|
|
91
92
|
`Marking up epub item #${index}: ${(0, import_posix.basename)(spineItem.href)}`
|
|
92
93
|
);
|
|
93
94
|
const chapterId = spineItem.id;
|
|
95
|
+
if ((_d = (_c = manifest[chapterId]) == null ? void 0 : _c.properties) == null ? void 0 : _d.includes("nav")) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
94
98
|
const chapterXml = await epub.readXhtmlItemContents(chapterId);
|
|
95
99
|
const segmentation = await (0, import_segmentation.getXhtmlSegmentation)(
|
|
96
100
|
import_epub.Epub.getXhtmlBody(chapterXml),
|
package/dist/markup/markup.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { getXhtmlSegmentation } from "./segmentation.js";
|
|
15
15
|
import { BLOCKS } from "./semantics.js";
|
|
16
16
|
async function markup(input, output, options) {
|
|
17
|
-
var _a, _b;
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
18
|
var _stack = [];
|
|
19
19
|
try {
|
|
20
20
|
const timing = createAggregator();
|
|
@@ -23,6 +23,7 @@ async function markup(input, output, options) {
|
|
|
23
23
|
const epub = __using(_stack, await Epub.from(output));
|
|
24
24
|
const primaryLocale = options.primaryLocale ?? await epub.getLanguage();
|
|
25
25
|
const spine = await epub.getSpineItems();
|
|
26
|
+
const manifest = await epub.getManifest();
|
|
26
27
|
for (let index = 0; index < spine.length; index++) {
|
|
27
28
|
(_a = options.onProgress) == null ? void 0 : _a.call(options, index / spine.length);
|
|
28
29
|
const spineItem = spine[index];
|
|
@@ -30,6 +31,9 @@ async function markup(input, output, options) {
|
|
|
30
31
|
`Marking up epub item #${index}: ${basename(spineItem.href)}`
|
|
31
32
|
);
|
|
32
33
|
const chapterId = spineItem.id;
|
|
34
|
+
if ((_d = (_c = manifest[chapterId]) == null ? void 0 : _c.properties) == null ? void 0 : _d.includes("nav")) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
33
37
|
const chapterXml = await epub.readXhtmlItemContents(chapterId);
|
|
34
38
|
const segmentation = await getXhtmlSegmentation(
|
|
35
39
|
Epub.getXhtmlBody(chapterXml),
|
package/package.json
CHANGED