reasonix 0.17.0 → 0.17.1
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/dashboard/app.css +11 -5
- package/dashboard/app.js +23 -23
- package/package.json +1 -1
package/dashboard/app.css
CHANGED
|
@@ -2313,19 +2313,25 @@ textarea:focus {
|
|
|
2313
2313
|
}
|
|
2314
2314
|
|
|
2315
2315
|
/* Split view — left half source (CodeMirror), right half preview. */
|
|
2316
|
-
.editor-
|
|
2316
|
+
.editor-stage {
|
|
2317
2317
|
flex: 1;
|
|
2318
2318
|
display: flex;
|
|
2319
2319
|
min-height: 0;
|
|
2320
2320
|
overflow: hidden;
|
|
2321
2321
|
}
|
|
2322
|
-
.editor-
|
|
2322
|
+
.editor-stage > .editor-host,
|
|
2323
|
+
.editor-stage > .editor-md-preview {
|
|
2323
2324
|
flex: 1;
|
|
2324
2325
|
min-width: 0;
|
|
2325
|
-
|
|
2326
|
-
|
|
2326
|
+
min-height: 0;
|
|
2327
|
+
}
|
|
2328
|
+
.editor-stage[data-mode="edit"] > .editor-md-preview {
|
|
2329
|
+
display: none;
|
|
2330
|
+
}
|
|
2331
|
+
.editor-stage[data-mode="preview"] > .editor-host {
|
|
2332
|
+
display: none;
|
|
2327
2333
|
}
|
|
2328
|
-
.editor-split .editor-
|
|
2334
|
+
.editor-stage[data-mode="split"] > .editor-host + .editor-md-preview {
|
|
2329
2335
|
border-left: 1px solid #181a1f;
|
|
2330
2336
|
}
|
|
2331
2337
|
|
package/dashboard/app.js
CHANGED
|
@@ -3979,7 +3979,13 @@ function EditorPanel({ onClose } = {}) {
|
|
|
3979
3979
|
viewRef.current = null;
|
|
3980
3980
|
}
|
|
3981
3981
|
};
|
|
3982
|
-
}, [cmReady, activeIdx, tabs[activeIdx]?.path
|
|
3982
|
+
}, [cmReady, activeIdx, tabs[activeIdx]?.path]);
|
|
3983
|
+
|
|
3984
|
+
// Becoming visible after display:none — CM6 measures lazily, force it.
|
|
3985
|
+
useEffect(() => {
|
|
3986
|
+
if (viewMode === "preview") return;
|
|
3987
|
+
viewRef.current?.requestMeasure?.();
|
|
3988
|
+
}, [viewMode]);
|
|
3983
3989
|
|
|
3984
3990
|
const closeTab = useCallback((idx) => {
|
|
3985
3991
|
const tab = tabsRef.current[idx];
|
|
@@ -4220,28 +4226,22 @@ function EditorPanel({ onClose } = {}) {
|
|
|
4220
4226
|
${(() => {
|
|
4221
4227
|
const isMd = langFromPath(tab.path) === "markdown";
|
|
4222
4228
|
const mode = isMd ? viewMode : "edit";
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
}}
|
|
4240
|
-
></div>
|
|
4241
|
-
</div>
|
|
4242
|
-
`;
|
|
4243
|
-
}
|
|
4244
|
-
return html`<div ref=${editorContainerRef} class="editor-host"></div>`;
|
|
4229
|
+
// Stable DOM across mode toggles — CM-managed children + Preact reconciliation don't mix when the host moves.
|
|
4230
|
+
return html`
|
|
4231
|
+
<div class="editor-stage" data-mode=${mode}>
|
|
4232
|
+
<div ref=${editorContainerRef} class="editor-host"></div>
|
|
4233
|
+
${
|
|
4234
|
+
isMd
|
|
4235
|
+
? html`<div
|
|
4236
|
+
class="editor-md-preview md"
|
|
4237
|
+
dangerouslySetInnerHTML=${{
|
|
4238
|
+
__html: previewMarked.parse(tab.content ?? ""),
|
|
4239
|
+
}}
|
|
4240
|
+
></div>`
|
|
4241
|
+
: null
|
|
4242
|
+
}
|
|
4243
|
+
</div>
|
|
4244
|
+
`;
|
|
4245
4245
|
})()}
|
|
4246
4246
|
`
|
|
4247
4247
|
: html`
|