rapier-html 1.2.7 → 1.2.8
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 +10 -10
- package/README.md +17 -16
- package/dist/cli.mjs +1 -0
- package/dist/page.d.mts +59 -0
- package/dist/page.mjs +10 -0
- package/dist/rapier.html +247 -68
- package/dist/wrap.mjs +4 -3
- package/package.json +6 -2
package/dist/wrap.mjs
CHANGED
|
@@ -60,8 +60,9 @@ export function carry(pageHtml, include = []) {
|
|
|
60
60
|
if (kept.has('drawing')) kept.add('letters');
|
|
61
61
|
let html = pageHtml;
|
|
62
62
|
const cut = id => { const at = element(html, id); if (at) html = html.slice(0, at.start) + html.slice(at.end); };
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
// Parts beyond the base editor (Notes, page layout) never travel, as in the person's HTML editor file; Draw when chosen.
|
|
64
|
+
for (const id of [...new Set([...html.matchAll(/<script type="application\/rapier-runtime" id="(rapier-part-[a-z-]+)">/g)].map(match => match[1]))])
|
|
65
|
+
if (id !== 'rapier-part-drawing' || !kept.has('drawing')) cut(id);
|
|
65
66
|
const start = html.indexOf(INVENTORY);
|
|
66
67
|
if (start < 0) return html;
|
|
67
68
|
const close = html.indexOf(END, start), end = html[close + END.length] === '\n' ? close + END.length + 1 : close + END.length;
|
|
@@ -86,7 +87,7 @@ export function portableNeeds(text, {base, flowchart} = {}) {
|
|
|
86
87
|
for (at++; at < lines.length && !new RegExp('^ {0,3}' + open[1][0] + '{' + open[1].length + ',}\\s*$').test(lines[at]); at++) body.push(lines[at]);
|
|
87
88
|
if (open[2].toLowerCase() === 'mermaid' && flowchart?.(body.join('\n')) !== true) needs.add('mermaid');
|
|
88
89
|
}
|
|
89
|
-
if (/\$\$[\s\S]+?\$\$|(?:^|[^\\$])\$(?![\s$])[^$\n]*[^\s\\$]\$(?!\d)/.test(prose.replace(/(`+)[\s\S]*?\1/g, ''))) needs.add('math');
|
|
90
|
+
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');
|
|
90
91
|
}
|
|
91
92
|
return CHOICES.filter(id => needs.has(id));
|
|
92
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapier-html",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
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",
|
|
@@ -40,8 +40,12 @@
|
|
|
40
40
|
"bin": {
|
|
41
41
|
"rapier-html": "dist/cli.mjs"
|
|
42
42
|
},
|
|
43
|
+
"types": "./dist/page.d.mts",
|
|
43
44
|
"exports": {
|
|
44
|
-
".":
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./dist/page.d.mts",
|
|
47
|
+
"default": "./dist/page.mjs"
|
|
48
|
+
}
|
|
45
49
|
},
|
|
46
50
|
"files": [
|
|
47
51
|
"dist",
|