finch-markdown-editor 0.1.3 → 0.1.7
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 +2 -2
- package/dist/bmmd/LICENSE +165 -0
- package/dist/bmmd/bin/bmmd.mjs +73 -0
- package/dist/bmmd/bin/decode-named-character-reference-o_gI0v-h.mjs +2 -0
- package/dist/bmmd/bin/dist-B0xJMeoM.mjs +134 -0
- package/dist/bmmd/bin/html-CCefjxd3.mjs +1406 -0
- package/dist/bmmd/bin/html-CSUv3zEC.mjs +21 -0
- package/dist/bmmd/bin/lib-BKH2iTnt.mjs +7 -0
- package/dist/bmmd/bin/lib-BRN_Fj5A.mjs +3 -0
- package/dist/bmmd/bin/lib-D_kP5PWU.mjs +13 -0
- package/dist/bmmd/bin/markdown-KovTQZtX.mjs +16 -0
- package/dist/bmmd/bin/markdownit-DkVD15-k.mjs +1 -0
- package/dist/bmmd/bin/rolldown-runtime-8V8biNmG.mjs +1 -0
- package/dist/bmmd/bin/syntax-BgWf_lVQ.mjs +1 -0
- package/dist/bmmd/bin/syntax-Dy8vTFtl.mjs +1 -0
- package/dist/bmmd/bin/text-3YfHIFOO.mjs +7 -0
- package/dist/codemirror.js +27 -27
- package/dist/index.js +10 -46
- package/dist/panel.html +54 -20
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { mkdir, readFile, realpath, rm, stat, writeFile } from "node:fs/promises
|
|
|
4
4
|
import { watch } from "node:fs";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
7
8
|
import os from "node:os";
|
|
8
9
|
var PASTE_IMAGE_EXT = {
|
|
9
10
|
"image/png": "png",
|
|
@@ -291,46 +292,9 @@ async function restoreDocument(ctx, panel) {
|
|
|
291
292
|
return false;
|
|
292
293
|
}
|
|
293
294
|
}
|
|
294
|
-
var
|
|
295
|
-
async function
|
|
296
|
-
|
|
297
|
-
bmmdBinPromise = (async () => {
|
|
298
|
-
const installDir = path.join(ctx.storagePath, "bmmd");
|
|
299
|
-
const binPath = path.join(installDir, "node_modules", "bmmd", "bin", "bmmd.mjs");
|
|
300
|
-
try {
|
|
301
|
-
await stat(binPath);
|
|
302
|
-
return binPath;
|
|
303
|
-
} catch {
|
|
304
|
-
}
|
|
305
|
-
onInstalling?.();
|
|
306
|
-
await mkdir(installDir, { recursive: true });
|
|
307
|
-
await new Promise((resolve, reject) => {
|
|
308
|
-
const child = spawn("npm", [
|
|
309
|
-
"install",
|
|
310
|
-
"--no-save",
|
|
311
|
-
"--no-audit",
|
|
312
|
-
"--no-fund",
|
|
313
|
-
"--silent",
|
|
314
|
-
"--prefix",
|
|
315
|
-
installDir,
|
|
316
|
-
"bmmd@latest"
|
|
317
|
-
], { stdio: "ignore" });
|
|
318
|
-
child.on("error", reject);
|
|
319
|
-
child.on("close", (code) => code === 0 ? resolve() : reject(new Error(`npm install bmmd exited with code ${code}`)));
|
|
320
|
-
});
|
|
321
|
-
await stat(binPath);
|
|
322
|
-
return binPath;
|
|
323
|
-
})();
|
|
324
|
-
}
|
|
325
|
-
try {
|
|
326
|
-
return await bmmdBinPromise;
|
|
327
|
-
} catch (error) {
|
|
328
|
-
bmmdBinPromise = void 0;
|
|
329
|
-
throw error;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
async function runBmmd(ctx, args, input, onInstalling) {
|
|
333
|
-
const binPath = await ensureBmmdBin(ctx, onInstalling);
|
|
295
|
+
var BMMD_BIN_PATH = fileURLToPath(new URL("./bmmd/bin/bmmd.mjs", import.meta.url));
|
|
296
|
+
async function runBmmd(args, input) {
|
|
297
|
+
const binPath = BMMD_BIN_PATH;
|
|
334
298
|
return new Promise((resolve, reject) => {
|
|
335
299
|
const child = spawn(process.execPath, [binPath, ...args], { stdio: ["pipe", "pipe", "pipe"] });
|
|
336
300
|
let output = "";
|
|
@@ -363,11 +327,11 @@ function substituteFinchFileImagesForBm(markdown) {
|
|
|
363
327
|
});
|
|
364
328
|
return { markdown: substituted, urls };
|
|
365
329
|
}
|
|
366
|
-
async function renderWithBm(
|
|
330
|
+
async function renderWithBm(markdown, markdownStyle, customCss) {
|
|
367
331
|
const args = ["render", "--platform", "wechat", "--markdown-style", markdownStyle || "kami"];
|
|
368
332
|
if (customCss && customCss.trim()) args.push("--custom-css", customCss);
|
|
369
333
|
const prepared = substituteFinchFileImagesForBm(markdown);
|
|
370
|
-
let html = await runBmmd(
|
|
334
|
+
let html = await runBmmd(args, prepared.markdown);
|
|
371
335
|
for (const [placeholder, originalUrl] of prepared.urls) html = html.split(placeholder).join(originalUrl);
|
|
372
336
|
return html;
|
|
373
337
|
}
|
|
@@ -603,10 +567,7 @@ async function handleMessage(ctx, panel, raw) {
|
|
|
603
567
|
}
|
|
604
568
|
case "renderBm": {
|
|
605
569
|
try {
|
|
606
|
-
const html = await renderWithBm(
|
|
607
|
-
panel.postMessage({ type: "status", message: "\u9996\u6B21\u6E32\u67D3\uFF1A\u6B63\u5728\u672C\u673A\u5B89\u88C5 bmmd \u6E32\u67D3\u5F15\u64CE\uFF08\u7EA6\u51E0\u79D2\uFF0C\u4EC5\u4E00\u6B21\uFF09\u2026" }).catch(() => {
|
|
608
|
-
});
|
|
609
|
-
});
|
|
570
|
+
const html = await renderWithBm(String(message.markdown ?? ""), String(message.markdownStyle ?? "kami"), message.customCss);
|
|
610
571
|
await panel.postMessage({ type: "bmRendered", html, requestId: message.requestId });
|
|
611
572
|
} catch (error) {
|
|
612
573
|
await panel.postMessage({ type: "error", message: `bm.md rendering failed: ${error instanceof Error ? error.message : String(error)}` });
|
|
@@ -742,6 +703,9 @@ function activate(ctx) {
|
|
|
742
703
|
},
|
|
743
704
|
feather: {
|
|
744
705
|
svg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.086 18.412A2 2 0 0 1 12.67 19H5v-7.672a2 2 0 0 1 .586-1.414L11.75 3.75a6 6 0 1 1 8.49 8.49z"/><path d="M16 8 2 22"/><path d="M17.488 15H9"/></svg>'
|
|
706
|
+
},
|
|
707
|
+
"swatch-book": {
|
|
708
|
+
svg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z"/><path d="M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7"/><path d="M 7 17h.01"/><path d="m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8"/></svg>'
|
|
745
709
|
}
|
|
746
710
|
}));
|
|
747
711
|
ctx.subscriptions.push(ctx.ui.onDidOpenPanel((panel) => {
|
package/dist/panel.html
CHANGED
|
@@ -77,6 +77,7 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
77
77
|
.home-hint{margin:0;padding:22px 0;text-align:center;font-size:12.5px;color:var(--muted)}
|
|
78
78
|
.home-hint[hidden],.home-recent[hidden]{display:none}
|
|
79
79
|
.status{font-size:12px;color:var(--muted);padding:5px 10px;text-align:center;border-top:1px solid var(--border);background:var(--bg)}
|
|
80
|
+
.status a{color:var(--accent);text-decoration:underline;text-underline-offset:2px;cursor:pointer}
|
|
80
81
|
.status.error{color:#c54232}
|
|
81
82
|
.status:empty{padding:0;border-top:0}
|
|
82
83
|
.popup{position:fixed;z-index:20;display:flex;align-items:center;gap:6px;background:var(--card);border:1px solid var(--border);border-radius:9px;box-shadow:0 8px 22px rgba(0,0,0,.22);padding:5px;transform-origin:center bottom;animation:popup-in .18s cubic-bezier(.2,.8,.2,1)}
|
|
@@ -115,14 +116,14 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
115
116
|
.actions[hidden]{display:none}
|
|
116
117
|
.actions button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--text);font:inherit;cursor:pointer;white-space:nowrap}
|
|
117
118
|
.actions button:hover:not(:disabled){background:var(--bg)}
|
|
118
|
-
.actions button[
|
|
119
|
-
.actions button[
|
|
119
|
+
.actions button[data-tooltip]::after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 8px);z-index:20;padding:6px 8px;border:1px solid var(--border);border-radius:7px;background:linear-gradient(135deg,color-mix(in srgb,var(--card) 96%,#fff),var(--bg));box-shadow:0 5px 16px rgba(0,0,0,.2);color:var(--text);font-size:12px;line-height:1;white-space:nowrap;pointer-events:none;opacity:0;transform:translate(-50%,3px);transition:opacity .16s ease,transform .16s ease}
|
|
120
|
+
.actions button[data-tooltip]:hover::after{opacity:1;transform:translate(-50%,0)}
|
|
120
121
|
/* Center tooltips over ordinary buttons; at either end of the floating bar,
|
|
121
122
|
grow them inward instead of letting a long label escape the panel. */
|
|
122
|
-
.actions button:first-child[
|
|
123
|
-
.actions button:first-child[
|
|
124
|
-
.actions button:last-child[
|
|
125
|
-
.actions button:last-child[
|
|
123
|
+
.actions button:first-child[data-tooltip]::after{left:0;transform:translateY(3px)}
|
|
124
|
+
.actions button:first-child[data-tooltip]:hover::after{transform:translateY(0)}
|
|
125
|
+
.actions button:last-child[data-tooltip]::after{left:auto;right:0;transform:translateY(3px)}
|
|
126
|
+
.actions button:last-child[data-tooltip]:hover::after{transform:translateY(0)}
|
|
126
127
|
.actions button:disabled{opacity:.45;cursor:default}
|
|
127
128
|
.actions .sep{width:1px;height:18px;background:var(--border);margin:0 3px}
|
|
128
129
|
.actions svg{width:16px;height:16px;flex:none}
|
|
@@ -175,24 +176,24 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
175
176
|
<div class="preview-shell">
|
|
176
177
|
<iframe id="article" sandbox="allow-same-origin" data-i18n-title="meta.title" title="Article Preview"></iframe>
|
|
177
178
|
<div id="actions" class="actions" hidden>
|
|
178
|
-
<button id="actCopyWx" type="button" data-i18n-
|
|
179
|
+
<button id="actCopyWx" type="button" data-i18n-tooltip="actions.copyToWx" aria-label="Copy for WeChat">
|
|
179
180
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"><path stroke-linecap="round" d="M7 7h.009m5.982 0H13m4.991 7.5H18m-4 0h.009"/><path d="M10 16c0 2.761 2.686 5 6 5c.907 0 1.767-.168 2.538-.468c.189-.073.393-.1.592-.063L22 21l-.652-2.03a1.13 1.13 0 0 1 .11-.89A4.3 4.3 0 0 0 22 16c0-2.761-2.686-5-6-5s-6 2.239-6 5Z"/><path d="M17.873 11.249Q18 10.639 18 10c0-3.866-3.582-7-8-7s-8 3.134-8 7c0 1.112.297 2.164.824 3.098c.147.26.196.567.108.853L2 17l3.914-.76c.208-.041.422-.013.617.07a9 9 0 0 0 3.589.69"/></svg>
|
|
180
181
|
</button>
|
|
181
182
|
<span class="sep" data-collapsible></span>
|
|
182
|
-
<button id="actCopyImg" type="button" data-i18n-
|
|
183
|
+
<button id="actCopyImg" type="button" data-i18n-tooltip="actions.copyImg" aria-label="Copy image" data-collapsible>
|
|
183
184
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>
|
|
184
185
|
</button>
|
|
185
|
-
<button id="actSaveImg" type="button" data-i18n-
|
|
186
|
+
<button id="actSaveImg" type="button" data-i18n-tooltip="actions.exportImg" aria-label="Export image (download)" data-collapsible>
|
|
186
187
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6.3"/><path d="m2 16 5-5c.928-.893 2.072-.893 3 0l3 3"/><path d="m14 14 1-1c.928-.893 2.072-.893 3 0"/><path d="M19 16v6"/><path d="m22 19-3 3-3-3"/><circle cx="9" cy="9" r="2"/></svg>
|
|
187
188
|
</button>
|
|
188
|
-
<button id="actSavePdf" type="button" data-i18n-
|
|
189
|
+
<button id="actSavePdf" type="button" data-i18n-tooltip="actions.exportPdf" aria-label="Export PDF" data-collapsible>
|
|
189
190
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M12 18v-6"/><path d="m9 15 3 3 3-3"/></svg>
|
|
190
191
|
</button>
|
|
191
192
|
<span class="sep" data-collapsible></span>
|
|
192
|
-
<button id="actAiStyle" type="button" data-i18n-
|
|
193
|
+
<button id="actAiStyle" type="button" data-i18n-tooltip="actions.aiStyle" aria-label="Ask AI to design layout" data-collapsible>
|
|
193
194
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"/><path d="m14 7 3 3"/><path d="M5 6v4"/><path d="M19 14v4"/><path d="M10 2v2"/><path d="M7 8H3"/><path d="M21 16h-4"/><path d="M11 3H9"/></svg>
|
|
194
195
|
</button>
|
|
195
|
-
<button id="actToggle" type="button" class="act-toggle" data-i18n-
|
|
196
|
+
<button id="actToggle" type="button" class="act-toggle" data-i18n-tooltip="actions.toggle" aria-label="Expand/collapse">
|
|
196
197
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>
|
|
197
198
|
</button>
|
|
198
199
|
</div>
|
|
@@ -358,7 +359,8 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
358
359
|
'status.focusOn': '专注已开启:非当前行半透明。',
|
|
359
360
|
'status.focusOff': '专注已关闭。',
|
|
360
361
|
'status.saveFailedNoReturn': '保存失败,未返回首页。',
|
|
361
|
-
'status.
|
|
362
|
+
'status.rendererAboutPrefix': '渲染器:本机 bmmd CLI(',
|
|
363
|
+
'status.rendererAboutSuffix': ',LGPL-3.0)。',
|
|
362
364
|
'status.appliedStyleSlot': '已应用「{label}」。',
|
|
363
365
|
'status.needCustomStyleFirst': '请先应用一个自定义/AI 设计的风格,再保存到槽位。',
|
|
364
366
|
'status.savedToSlot': '已保存到槽位 {slot}:{label}',
|
|
@@ -496,7 +498,8 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
496
498
|
'status.focusOn': 'Focus mode is on — inactive lines are dimmed.',
|
|
497
499
|
'status.focusOff': 'Focus mode is off.',
|
|
498
500
|
'status.saveFailedNoReturn': 'Save failed — staying on this document.',
|
|
499
|
-
'status.
|
|
501
|
+
'status.rendererAboutPrefix': 'Renderer: local bmmd CLI (',
|
|
502
|
+
'status.rendererAboutSuffix': ', LGPL-3.0).',
|
|
500
503
|
'status.appliedStyleSlot': 'Applied \u201c{label}\u201d.',
|
|
501
504
|
'status.needCustomStyleFirst': 'Apply a custom/AI-designed style first before saving it to a slot.',
|
|
502
505
|
'status.savedToSlot': 'Saved to slot {slot}: {label}',
|
|
@@ -530,6 +533,17 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
530
533
|
Array.prototype.forEach.call(scope.querySelectorAll('[data-i18n-title]'), function (el) {
|
|
531
534
|
el.title = t(el.getAttribute('data-i18n-title'));
|
|
532
535
|
});
|
|
536
|
+
// The floating preview action bar (WeChat copy/export buttons) renders
|
|
537
|
+
// its own styled tooltip bubble in CSS from `data-tooltip` (see
|
|
538
|
+
// `.actions button[data-tooltip]::after`). Those buttons must NOT also
|
|
539
|
+
// carry a native `title` attribute, or hovering shows both the custom
|
|
540
|
+
// bubble and the browser's plain OS tooltip at once. `aria-label` keeps
|
|
541
|
+
// them accessible without reintroducing a `title`.
|
|
542
|
+
Array.prototype.forEach.call(scope.querySelectorAll('[data-i18n-tooltip]'), function (el) {
|
|
543
|
+
var text = t(el.getAttribute('data-i18n-tooltip'));
|
|
544
|
+
el.setAttribute('data-tooltip', text);
|
|
545
|
+
el.setAttribute('aria-label', text);
|
|
546
|
+
});
|
|
533
547
|
Array.prototype.forEach.call(scope.querySelectorAll('[data-i18n-aria]'), function (el) {
|
|
534
548
|
el.setAttribute('aria-label', t(el.getAttribute('data-i18n-aria')));
|
|
535
549
|
});
|
|
@@ -638,6 +652,26 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
638
652
|
}, 5000);
|
|
639
653
|
}
|
|
640
654
|
|
|
655
|
+
function showRendererAbout() {
|
|
656
|
+
if (statusHideTimer) { clearTimeout(statusHideTimer); statusHideTimer = 0; }
|
|
657
|
+
statusEl.replaceChildren(document.createTextNode(t('status.rendererAboutPrefix')));
|
|
658
|
+
var link = document.createElement('a');
|
|
659
|
+
link.href = 'https://bm.md/';
|
|
660
|
+
link.textContent = 'bm.md';
|
|
661
|
+
link.title = 'https://bm.md/';
|
|
662
|
+
link.addEventListener('click', function (event) {
|
|
663
|
+
event.preventDefault();
|
|
664
|
+
if (api && api.postMessage) api.postMessage({ type: 'openLink', url: 'https://bm.md/' });
|
|
665
|
+
});
|
|
666
|
+
statusEl.append(link, document.createTextNode(t('status.rendererAboutSuffix')));
|
|
667
|
+
statusEl.className = 'status';
|
|
668
|
+
statusHideTimer = setTimeout(function () {
|
|
669
|
+
statusHideTimer = 0;
|
|
670
|
+
statusEl.textContent = '';
|
|
671
|
+
statusEl.className = 'status';
|
|
672
|
+
}, 5000);
|
|
673
|
+
}
|
|
674
|
+
|
|
641
675
|
function hasDocument() { return !!markdown || !!sourcePath; }
|
|
642
676
|
|
|
643
677
|
if (emptyNew) emptyNew.addEventListener('click', async function () {
|
|
@@ -907,11 +941,11 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
907
941
|
checked: annotationsEnabled, disabled: !hasDoc,
|
|
908
942
|
},
|
|
909
943
|
{
|
|
910
|
-
// Label stays "预览" no matter which mode is active — the
|
|
911
|
-
//
|
|
912
|
-
//
|
|
913
|
-
//
|
|
914
|
-
id: 'mode', icon:
|
|
944
|
+
// Label stays "预览" no matter which mode is active — the swatch
|
|
945
|
+
// icon plus `checked` already communicate on/off; flipping the word
|
|
946
|
+
// itself between "预览"/"编辑" read as ambiguous ("is this the mode
|
|
947
|
+
// I'm in, or the one I'm switching to?").
|
|
948
|
+
id: 'mode', icon: 'ext:markdown-editor-icons/swatch-book',
|
|
915
949
|
label: t('toolbar.mode.label'), tooltip: hasDoc ? (mode === 'edit' ? t('toolbar.mode.tooltipToPreview') : t('toolbar.mode.tooltipToEdit')) : t('toolbar.needDoc'),
|
|
916
950
|
checked: mode === 'preview', disabled: !hasDoc,
|
|
917
951
|
},
|
|
@@ -2329,7 +2363,7 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px var(--finch-font-
|
|
|
2329
2363
|
if (itemId === 'comfort:read') { setComfortWriting(false); return; }
|
|
2330
2364
|
if (itemId === 'comfort:write') { setComfortWriting(true); return; }
|
|
2331
2365
|
if (itemId === 'focus') { toggleFocusMode(); return; }
|
|
2332
|
-
if (itemId === 'about') {
|
|
2366
|
+
if (itemId === 'about') { showRendererAbout(); return; }
|
|
2333
2367
|
// These two must be checked before the generic 'style:' fallback below,
|
|
2334
2368
|
// since both also start with the literal prefix "style:".
|
|
2335
2369
|
if (itemId && itemId.indexOf('style:slot-use:') === 0) { applyStyleSlot(+itemId.slice('style:slot-use:'.length)); return; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "finch-markdown-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "A Markdown editor and WeChat Official Account style preview, with selection-based AI edits and AI-generated custom styles.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "PuterJam",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"annotation"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js && esbuild src/codemirror.ts --bundle --platform=browser --format=iife --target=chrome120 --minify --outfile=dist/codemirror.js &&
|
|
30
|
+
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js && esbuild src/codemirror.ts --bundle --platform=browser --format=iife --target=chrome120 --minify --outfile=dist/codemirror.js && node -e \"const fs=require('node:fs');fs.copyFileSync('src/panel.html','dist/panel.html');fs.rmSync('dist/bmmd',{recursive:true,force:true});fs.mkdirSync('dist/bmmd',{recursive:true});fs.cpSync('node_modules/bmmd/bin','dist/bmmd/bin',{recursive:true});fs.copyFileSync('node_modules/bmmd/LICENSE','dist/bmmd/LICENSE')\"",
|
|
31
31
|
"typecheck": "tsc --noEmit",
|
|
32
32
|
"prepublishOnly": "npm run typecheck && npm run build && npx @finchtoys/minitools doctor ."
|
|
33
33
|
},
|
|
@@ -176,13 +176,14 @@
|
|
|
176
176
|
},
|
|
177
177
|
"permissions": {
|
|
178
178
|
"filesystem": "readwrite",
|
|
179
|
-
"network":
|
|
179
|
+
"network": true,
|
|
180
180
|
"shell": true
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
"devDependencies": {
|
|
184
184
|
"@finchtoys/minitool-api": "^0.3.5",
|
|
185
185
|
"@types/node": "^26.1.0",
|
|
186
|
+
"bmmd": "0.3.0",
|
|
186
187
|
"esbuild": "^0.28.1",
|
|
187
188
|
"typescript": "^6.0.3"
|
|
188
189
|
},
|