@unfoldingword/door43-preview-renderers 1.5.0 → 1.5.2

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/index.esm.js CHANGED
@@ -92125,6 +92125,11 @@ function decorateBibleBookHtml(html, bookId) {
92125
92125
  content = content.replace(/<p /i, "<p id=\"nav-".concat(bookId, "\" "));
92126
92126
  content = content.replaceAll(/<span id="chapter-(\d+)-verse-(\d+)"([^>]*)>(\d+)<\/span>/g, "<span id=\"nav-".concat(bookId, "-$1-$2\"$3><a href=\"#nav-").concat(bookId, "-$1-$2\" class=\"header-link\">$4</a></span>"));
92127
92127
  content = content.replaceAll(/<span id="chapter-(\d+)"([^>]+)>([\d]+)<\/span>/gi, "<span id=\"nav-".concat(bookId, "-$1\"").concat(showChapters ? " data-toc-title=\"".concat(escapeHtml$5(titleText), " $1\"") : '', "$2><a href=\"#nav-").concat(bookId, "-$1-1\" class=\"header-link\">$3</a></span>"));
92128
+
92129
+ // Anchor the descriptive title (\d — e.g. a Psalm superscription) as a "front"
92130
+ // verse so it is navigable at <abbr>-<book>-<chapter>-front. The \d paragraph
92131
+ // follows \c, so it carries the chapter label span; take the chapter from it.
92132
+ content = content.replace(new RegExp("<p class=\"paras_usfm_d\">(\\s*<span id=\"nav-".concat(bookId, "-(\\d+)\")"), 'g'), "<p class=\"paras_usfm_d\" id=\"nav-".concat(bookId, "-$2-front\">$1"));
92128
92133
  content = content.replace(/<span([^>]+style="[^">]+#CCC[^">]+")/gi, '<span$1 class="footnote"');
92129
92134
  content = content.replace(/[\u00A0\u202F\u2009 ]+/g, ' ');
92130
92135
  content = content.replace(/(\d{1,3})(?:\s*,\s*\d{3})+\b/g, function (match) {
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "@unfoldingword/door43-preview-renderers",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "type": "module",
5
5
  "description": "JavaScript library for gathering content from various repositories and rendering HTML snippets for web previews and PDFs",
6
- "main": "dist/index.js",
6
+ "main": "dist/index.esm.js",
7
7
  "module": "dist/index.esm.js",
8
+ "exports": {
9
+ ".": "./dist/index.esm.js"
10
+ },
8
11
  "bin": {
9
- "door43-renderers": "./src/cli.js"
12
+ "door43-renderers": "src/cli.js"
10
13
  },
11
14
  "publishConfig": {
12
15
  "access": "public"
13
16
  },
14
17
  "files": [
15
- "dist/index.js",
16
18
  "dist/index.esm.js",
17
19
  "src/cli.js"
18
20
  ],
package/src/cli.js CHANGED
@@ -10,11 +10,16 @@
10
10
 
11
11
  import fs from 'fs';
12
12
  import path from 'path';
13
- import { getAllCatalogEntries } from './getAllCatalogEntries.js';
14
- import { getResourceData } from './getResourceData.js';
15
- import { renderHtmlData } from './renderHtmlData.js';
16
- import { renderHTML } from './renderHTML.js';
17
- import { renderPdf } from './pdf/renderPdf.js';
13
+ // Import from the built package entry, not src siblings: only dist/index.esm.js
14
+ // and this file are published, so the installed `door43-renderers` bin must
15
+ // resolve against dist. (Running from source therefore requires `pnpm build`.)
16
+ import {
17
+ getAllCatalogEntries,
18
+ getResourceData,
19
+ renderHtmlData,
20
+ renderHTML,
21
+ renderPdf,
22
+ } from '../dist/index.esm.js';
18
23
 
19
24
  // Map the CLI's short page-size keys to PAGE_SIZES keys understood by renderHTML/renderPdf.
20
25
  function resolveCliPageSize(shortKey) {