@cloud411716/fancy-webnovel 0.1.60 → 0.1.61
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/infra.js +5 -1
- package/package.json +1 -1
- package/plugins/fancy-scan/index.js +3 -2
package/infra.js
CHANGED
|
@@ -14,10 +14,14 @@
|
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
15
15
|
|
|
16
16
|
export function notify(session, text) {
|
|
17
|
+
const isHtml = String(text).startsWith('<');
|
|
17
18
|
queueMicrotask(() => {
|
|
18
19
|
session.append(
|
|
19
20
|
'user/message',
|
|
20
|
-
{
|
|
21
|
+
{
|
|
22
|
+
content: [{ type: isHtml ? 'html' : 'text', text: String(text) }],
|
|
23
|
+
source: { kind: 'user' }
|
|
24
|
+
},
|
|
21
25
|
{ surfaceOp: 'append' }
|
|
22
26
|
);
|
|
23
27
|
});
|
package/package.json
CHANGED
|
@@ -97,9 +97,10 @@ export async function apply(ctx) {
|
|
|
97
97
|
const FRAMES = '⠋⠙⠹⠸⠴⠦⠧⠇⠏';
|
|
98
98
|
let frame = 0;
|
|
99
99
|
const ticker = setInterval(() => {
|
|
100
|
-
|
|
100
|
+
const f = FRAMES[frame % FRAMES.length];
|
|
101
|
+
notify(session, `<span class="spin">${f}</span> 采集中...`);
|
|
101
102
|
frame++;
|
|
102
|
-
},
|
|
103
|
+
}, 80);
|
|
103
104
|
|
|
104
105
|
const proc = spawn('node', [join(SCAN_SCRIPTS_DIR, 'run-scan.js'),
|
|
105
106
|
'--project-root', projectRoot, '--platform', platform, '--length', length], {
|