@cyber-dash-tech/revela 0.17.13 → 0.17.14
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/lib/refine/server.ts +12 -6
- package/package.json +1 -1
- package/plugins/revela/.mcp.json +1 -1
package/lib/refine/server.ts
CHANGED
|
@@ -493,11 +493,7 @@ function handleDeck(session: EditSession): Response {
|
|
|
493
493
|
session.assets.clear()
|
|
494
494
|
session.assetKeys.clear()
|
|
495
495
|
session.nextAssetId = 1
|
|
496
|
-
const
|
|
497
|
-
const version = readDeckVersion(session).version
|
|
498
|
-
const annotated = annotateVisualEditTargets(sourceHtml)
|
|
499
|
-
session.visualTargets = annotated.targets
|
|
500
|
-
session.visualTargetDeckVersion = version
|
|
496
|
+
const annotated = refreshVisualTargets(session)
|
|
501
497
|
return htmlResponse(rewriteLocalAssetRefs(annotated.html, {
|
|
502
498
|
session,
|
|
503
499
|
sourceFile: session.absoluteFile,
|
|
@@ -505,6 +501,15 @@ function handleDeck(session: EditSession): Response {
|
|
|
505
501
|
}))
|
|
506
502
|
}
|
|
507
503
|
|
|
504
|
+
function refreshVisualTargets(session: EditSession): { html: string; version: string } {
|
|
505
|
+
const sourceHtml = readFileSync(session.absoluteFile, "utf-8")
|
|
506
|
+
const version = readDeckVersion(session).version
|
|
507
|
+
const annotated = annotateVisualEditTargets(sourceHtml)
|
|
508
|
+
session.visualTargets = annotated.targets
|
|
509
|
+
session.visualTargetDeckVersion = version
|
|
510
|
+
return { html: annotated.html, version }
|
|
511
|
+
}
|
|
512
|
+
|
|
508
513
|
function handleAsset(session: EditSession, id: string | null, method: string): Response {
|
|
509
514
|
if (!id) return textResponse("Missing asset id", 400)
|
|
510
515
|
const asset = session.assets.get(id)
|
|
@@ -726,9 +731,10 @@ async function handleVisualChanges(req: Request, session: EditSession): Promise<
|
|
|
726
731
|
targets: session.visualTargets,
|
|
727
732
|
changes,
|
|
728
733
|
})
|
|
734
|
+
const refreshed = refreshVisualTargets(session)
|
|
729
735
|
session.lastActiveAt = Date.now()
|
|
730
736
|
scheduleIdleStop()
|
|
731
|
-
return jsonResponse({ ok: true, deckVersion:
|
|
737
|
+
return jsonResponse({ ok: true, deckVersion: refreshed.version, changeCount: result.changeCount })
|
|
732
738
|
} catch (error) {
|
|
733
739
|
const message = error instanceof Error ? error.message : String(error)
|
|
734
740
|
return jsonResponse({ ok: false, error: message }, 400)
|
package/package.json
CHANGED