rapier-html 1.2.46 → 1.2.49
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/BUILD.json +4 -4
- package/README.md +12 -11
- package/dist/ledger/carried.mjs +17 -8
- package/dist/ledger/diff/concerns.mjs +2 -2
- package/dist/ledger/document-fonts.mjs +60 -6
- package/dist/ledger/source.mjs +31 -2
- package/dist/ledger/vendor/SOURCES.json +253 -0
- package/dist/ledger/vendor/entities/decode-codepoint.mjs +27 -0
- package/dist/ledger/vendor/entities.mjs +499 -0
- package/dist/ledger/vendor/linkify-it.mjs +427 -0
- package/dist/ledger/vendor/markdown-it.mjs +4027 -0
- package/dist/ledger/vendor/markdown-plugins.mjs +1328 -11
- package/dist/ledger/vendor/markdown-runtime.mjs +3 -11
- package/dist/ledger/vendor/mdurl/index.mjs +11 -0
- package/dist/ledger/vendor/mdurl/lib/decode.mjs +107 -0
- package/dist/ledger/vendor/mdurl/lib/encode.mjs +77 -0
- package/dist/ledger/vendor/mdurl/lib/format.mjs +20 -0
- package/dist/ledger/vendor/mdurl/lib/parse.mjs +231 -0
- package/dist/ledger/vendor/punycode.mjs +282 -0
- package/dist/ledger/vendor/uc.micro.mjs +49 -0
- package/dist/page.mjs +11 -3
- package/dist/rapier.html +97 -51
- package/dist/wrap.mjs +10 -5
- package/package.json +1 -1
- package/dist/ledger/vendor/BROWSER-ENTITIES.json +0 -36
- package/dist/ledger/vendor/MARKDOWN-RUNTIME.json +0 -136
- package/dist/ledger/vendor/MARKDOWNIT.json +0 -582
- package/dist/ledger/vendor/markdown-plugins.json +0 -46
package/dist/wrap.mjs
CHANGED
|
@@ -112,15 +112,20 @@ export function portableNeeds(text, {base, flowchart} = {}) {
|
|
|
112
112
|
if (typeof source !== 'string') continue;
|
|
113
113
|
let prose = '';
|
|
114
114
|
if (isTemplatePage(source)) needs.add('layout');
|
|
115
|
+
const wantsMath = /\$|(?:`{3,}|~{3,})[ \t]*math\b/i.test(source);
|
|
116
|
+
const wantsMermaid = /mermaid/i.test(source);
|
|
117
|
+
if (!wantsMath && !wantsMermaid) continue;
|
|
115
118
|
const lines = source.split(/\r\n|\r|\n/);
|
|
119
|
+
const content = line => line.replace(/^(?: {0,3}>[ \t]?)+/, '').replace(/^ {0,3}(?:[-+*]|\d{1,9}[.)])[ \t]+/, '');
|
|
116
120
|
for (let at = 0; at < lines.length; at++) {
|
|
117
|
-
const open = /^ {0,3}(`{3,}|~{3,})\s*([^\s`]*)/.exec(lines[at]);
|
|
118
|
-
if (!open) { prose += lines[at] + '\n'; continue; }
|
|
121
|
+
const open = /^ {0,3}(`{3,}|~{3,})\s*([^\s`]*)/.exec(content(lines[at]));
|
|
122
|
+
if (!open) { if (wantsMath) prose += lines[at] + '\n'; continue; }
|
|
119
123
|
const body = [];
|
|
120
|
-
for (at++; at < lines.length && !new RegExp('^ {0,3}' + open[1][0] + '{' + open[1].length + ',}\\s*$').test(lines[at]); at++) body.push(lines[at]);
|
|
121
|
-
if (open[2].toLowerCase() === 'mermaid' && flowchart?.(body.join('\n')) !== true) needs.add('mermaid');
|
|
124
|
+
for (at++; at < lines.length && !new RegExp('^ {0,3}' + open[1][0] + '{' + open[1].length + ',}\\s*$').test(content(lines[at])); at++) body.push(lines[at]);
|
|
125
|
+
if (wantsMermaid && open[2].toLowerCase() === 'mermaid' && flowchart?.(body.join('\n')) !== true) needs.add('mermaid');
|
|
126
|
+
if (wantsMath && open[2].toLowerCase() === 'math' && at < lines.length) needs.add('math');
|
|
122
127
|
}
|
|
123
|
-
if (/\$\$[\s\S]+?\$\$|(?:^|[^\\$])\$(?![\s$])[^$\n]*[^\s\\$]\$(?!\d)/.test(prose.split(/\n[ \t]*\n/).map(paragraph => paragraph.replace(/(`+)[\s\S]*?\1/g, '')).join('\n\n'))) needs.add('math');
|
|
128
|
+
if (wantsMath && /\$\$[\s\S]+?\$\$|(?:^|[^\\$])\$(?![\s$])[^$\n]*[^\s\\$]\$(?!\d)/.test(prose.split(/\n[ \t]*\n/).map(paragraph => paragraph.replace(/(`+)[\s\S]*?\1/g, '')).join('\n\n'))) needs.add('math');
|
|
124
129
|
}
|
|
125
130
|
return CHOICES.filter(id => needs.has(id));
|
|
126
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapier-html",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.49",
|
|
4
4
|
"description": "One command turns a Markdown file into one offline HTML file: the whole Rapier editor with the document inside. Opens in any browser, phone or desktop, with no install or account. Write, draw and paint watercolor, then Send back the edits to your AI agent.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "The page and Node use the same native ES2022 build of unchanged markdown-it 15.0.3 release source (MARKDOWNIT.json). tools/entities-vendor.mjs re-encodes its 2,125 HTML entity names as a compact list with the strict decoder its callers require, then minifies with the pinned options. The normal Rapier core rule in agent/markdown-spec.mjs owns auto-link token expansion; the vendor has no parser rule changes. Each vendor pins upstream and derived bytes; a changed source or derivation requires grammar and entity equivalence before repinning.",
|
|
3
|
-
"vendors": [
|
|
4
|
-
{
|
|
5
|
-
"id": "lib-markdownit",
|
|
6
|
-
"upstream": {
|
|
7
|
-
"name": "markdown-it-15.0.3.es2022.umd.js",
|
|
8
|
-
"bytes": 144327,
|
|
9
|
-
"sha256": "ab352b33693b8a4c88c0c0a977f12b30df9aa42bc163f73e59397939e397182a"
|
|
10
|
-
},
|
|
11
|
-
"entities": {
|
|
12
|
-
"names": 2125,
|
|
13
|
-
"legacy": 106
|
|
14
|
-
},
|
|
15
|
-
"derived": {
|
|
16
|
-
"name": "markdown-it-15.0.3.es2022.umd.rapier.min.js",
|
|
17
|
-
"bytes": 94470,
|
|
18
|
-
"sha256": "09d16498c075e83b0ba986dab07e83f0850f601f6f7551bd4aaf79d3167f7bc4"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"tool": {
|
|
23
|
-
"name": "terser",
|
|
24
|
-
"version": "5.51.2",
|
|
25
|
-
"options": {
|
|
26
|
-
"ecma": 2022,
|
|
27
|
-
"compress": {
|
|
28
|
-
"passes": 2
|
|
29
|
-
},
|
|
30
|
-
"mangle": true,
|
|
31
|
-
"format": {
|
|
32
|
-
"comments": "/^!|@license|copyright/i"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"format": "rapier-markdown-vendor/1",
|
|
3
|
-
"description": "Existing pinned parser and plugins; upstream bytes and license texts unchanged.",
|
|
4
|
-
"runtime": {
|
|
5
|
-
"path": "agent/vendor/markdown-runtime.mjs",
|
|
6
|
-
"prefix": "// MIT; exact embedded Rapier vendor source (tools/entities-vendor.mjs --write). See NOTICE.txt.\n// One lazy constructor serves named browser/worker imports and the default Node facade.\nlet owned = null;\nexport function markdownItConstructor() {\n if (!owned) {\nconst exports = {}; const module = {exports};\n",
|
|
7
|
-
"suffix": "\n owned = module.exports;\n }\n return owned;\n}\n",
|
|
8
|
-
"bodyBytes": 94470,
|
|
9
|
-
"bodySha256": "09d16498c075e83b0ba986dab07e83f0850f601f6f7551bd4aaf79d3167f7bc4"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
{
|
|
13
|
-
"path": "agent/vendor/markdown-runtime.mjs",
|
|
14
|
-
"bytes": 94829,
|
|
15
|
-
"sha256": "147b86b69ee4d0b1237a793b09300342e8c14d149c9e84bb0bea5ed2fa431998"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"path": "agent/vendor/markdown-plugins.mjs",
|
|
19
|
-
"bytes": 24196,
|
|
20
|
-
"sha256": "0081e0e557379cdf908b652124e82e2456e965af365a65464a610b867d350008"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"path": "agent/vendor/MARKDOWNIT.json",
|
|
24
|
-
"bytes": 18685,
|
|
25
|
-
"sha256": "2c42169e3233c6cb2b7e31cdefa83dde78e4ba05ed995805e749070db8c76ff4"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"path": "agent/vendor/BROWSER-ENTITIES.json",
|
|
29
|
-
"bytes": 1344,
|
|
30
|
-
"sha256": "9b2b9db3a8bfc2a90c54a703da8cd08c65eed62de85dc16fc334f59ed95347b8"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"path": "agent/vendor/markdown-plugins.json",
|
|
34
|
-
"bytes": 1585,
|
|
35
|
-
"sha256": "c52a02dd0946e150d4023199ccbd9f1afa93b008797ee5b2c325d9fcd249d4ee"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"path": "agent/vendor/NOTICE.txt",
|
|
39
|
-
"bytes": 2774,
|
|
40
|
-
"sha256": "05a252057f4eed3ba3b4149d404294f3a9bfb059f9bfde14d57128005acbe8ca"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"path": "agent/vendor/markdown-licenses/markdown-it-LICENSE.txt",
|
|
44
|
-
"bytes": 1073,
|
|
45
|
-
"sha256": "792c48c5a849a15fdf9e37e8bcf9e6d1dd13b32b46c642a748a0a46a9919d473"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"path": "agent/vendor/markdown-licenses/entities-LICENSE.txt",
|
|
49
|
-
"bytes": 1260,
|
|
50
|
-
"sha256": "cb992345949ccd6e8394b2cd6c465f7b897c864f845937dbf64e8997f389e164"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"path": "agent/vendor/markdown-licenses/linkify-it-LICENSE.txt",
|
|
54
|
-
"bytes": 1058,
|
|
55
|
-
"sha256": "95e3f7f0e81e9b4940cdfaa1956aaff5e4dfd2fb1565041e7c78eb9a606f23e3"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"path": "agent/vendor/markdown-licenses/mdurl-LICENSE.txt",
|
|
59
|
-
"bytes": 2303,
|
|
60
|
-
"sha256": "6b6a356c4337e2446841f30f3cdf7e7023af8c5260b5e347c0f987b9f6aa2644"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"path": "agent/vendor/markdown-licenses/uc.micro-LICENSE.txt",
|
|
64
|
-
"bytes": 1077,
|
|
65
|
-
"sha256": "483acb265f182907d1caf6cff9c16c96f31325ed23792832cc5d8b12d5f88c8a"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"path": "agent/vendor/markdown-licenses/punycode.js-LICENSE-MIT.txt",
|
|
69
|
-
"bytes": 1077,
|
|
70
|
-
"sha256": "483acb265f182907d1caf6cff9c16c96f31325ed23792832cc5d8b12d5f88c8a"
|
|
71
|
-
}
|
|
72
|
-
],
|
|
73
|
-
"licenses": [
|
|
74
|
-
{
|
|
75
|
-
"path": "agent/vendor/markdown-licenses/markdown-it-LICENSE.txt",
|
|
76
|
-
"source": {
|
|
77
|
-
"scope": "source",
|
|
78
|
-
"path": "LICENSE",
|
|
79
|
-
"bytes": 1073,
|
|
80
|
-
"sha256": "792c48c5a849a15fdf9e37e8bcf9e6d1dd13b32b46c642a748a0a46a9919d473"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"path": "agent/vendor/markdown-licenses/entities-LICENSE.txt",
|
|
85
|
-
"source": {
|
|
86
|
-
"scope": "dependencies",
|
|
87
|
-
"path": "entities/LICENSE",
|
|
88
|
-
"bytes": 1260,
|
|
89
|
-
"sha256": "cb992345949ccd6e8394b2cd6c465f7b897c864f845937dbf64e8997f389e164"
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"path": "agent/vendor/markdown-licenses/linkify-it-LICENSE.txt",
|
|
94
|
-
"source": {
|
|
95
|
-
"scope": "dependencies",
|
|
96
|
-
"path": "linkify-it/LICENSE",
|
|
97
|
-
"bytes": 1058,
|
|
98
|
-
"sha256": "95e3f7f0e81e9b4940cdfaa1956aaff5e4dfd2fb1565041e7c78eb9a606f23e3"
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"path": "agent/vendor/markdown-licenses/mdurl-LICENSE.txt",
|
|
103
|
-
"source": {
|
|
104
|
-
"scope": "dependencies",
|
|
105
|
-
"path": "mdurl/LICENSE",
|
|
106
|
-
"bytes": 2303,
|
|
107
|
-
"sha256": "6b6a356c4337e2446841f30f3cdf7e7023af8c5260b5e347c0f987b9f6aa2644"
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"path": "agent/vendor/markdown-licenses/uc.micro-LICENSE.txt",
|
|
112
|
-
"source": {
|
|
113
|
-
"scope": "dependencies",
|
|
114
|
-
"path": "uc.micro/LICENSE.txt",
|
|
115
|
-
"bytes": 1077,
|
|
116
|
-
"sha256": "483acb265f182907d1caf6cff9c16c96f31325ed23792832cc5d8b12d5f88c8a"
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"path": "agent/vendor/markdown-licenses/punycode.js-LICENSE-MIT.txt",
|
|
121
|
-
"source": {
|
|
122
|
-
"scope": "dependencies",
|
|
123
|
-
"path": "punycode.js/LICENSE-MIT.txt",
|
|
124
|
-
"bytes": 1077,
|
|
125
|
-
"sha256": "483acb265f182907d1caf6cff9c16c96f31325ed23792832cc5d8b12d5f88c8a"
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
"plugins": {
|
|
130
|
-
"path": "agent/vendor/markdown-plugins.mjs",
|
|
131
|
-
"prefix": "// Exact pinned plugin bodies; the caller supplies their runtime context. See NOTICE.txt and markdown-plugins.json.\nexport function createMarkdownPlugins(Math) {\nif (!Math || typeof Math.ceil !== 'function' || typeof Math.random !== 'function') throw new TypeError('Markdown plugins need a Math context.');\nconst root = {};\n{\nconst globalThis = root, window = root, global = root, self = root;\nconst exports = undefined, module = undefined, define = undefined;\n",
|
|
132
|
-
"suffix": "\n}\nreturn Object.freeze(root);\n}\n",
|
|
133
|
-
"bodyBytes": 23702,
|
|
134
|
-
"bodySha256": "78e105dbba1e97275141f92253b776a8261c18e20b78f3bf40a6d22873f6b100"
|
|
135
|
-
}
|
|
136
|
-
}
|