@marimo-team/islands 0.19.5-dev4 → 0.19.5-dev7
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/dist/main.js +13 -11
- package/package.json +1 -1
- package/src/css/app/Cell.css +0 -2
- package/src/plugins/layout/TexPlugin.tsx +7 -5
package/dist/main.js
CHANGED
|
@@ -96521,7 +96521,8 @@ Defaulting to \`null\`.`;
|
|
|
96521
96521
|
});
|
|
96522
96522
|
}
|
|
96523
96523
|
var TexComponent = (e) => {
|
|
96524
|
-
|
|
96524
|
+
var _a2;
|
|
96525
|
+
let r = (0, import_compiler_runtime$12.c)(8), { host: c, tex: d } = e, f = (0, import_react.useRef)(null), [h, _] = (0, import_react.useState)(d), v, y;
|
|
96525
96526
|
r[0] === c ? (v = r[1], y = r[2]) : (v = () => {
|
|
96526
96527
|
let e2 = new MutationObserver(() => {
|
|
96527
96528
|
_(c.textContent || c.innerHTML);
|
|
@@ -96536,16 +96537,17 @@ Defaulting to \`null\`.`;
|
|
|
96536
96537
|
}, y = [
|
|
96537
96538
|
c
|
|
96538
96539
|
], r[0] = c, r[1] = v, r[2] = y), (0, import_react.useLayoutEffect)(v, y);
|
|
96539
|
-
let S, w;
|
|
96540
|
-
r[3]
|
|
96541
|
-
f.current && renderLatex(f.current, h);
|
|
96542
|
-
},
|
|
96543
|
-
h
|
|
96544
|
-
|
|
96545
|
-
|
|
96546
|
-
|
|
96540
|
+
let S = ((_a2 = c.parentElement) == null ? void 0 : _a2.tagName.toLowerCase()) === "marimo-tex", w, E;
|
|
96541
|
+
r[3] !== h || r[4] !== S ? (w = () => {
|
|
96542
|
+
f.current && !S && renderLatex(f.current, h);
|
|
96543
|
+
}, E = [
|
|
96544
|
+
h,
|
|
96545
|
+
S
|
|
96546
|
+
], r[3] = h, r[4] = S, r[5] = w, r[6] = E) : (w = r[5], E = r[6]), (0, import_react.useLayoutEffect)(w, E);
|
|
96547
|
+
let O;
|
|
96548
|
+
return r[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = (0, import_jsx_runtime.jsx)("span", {
|
|
96547
96549
|
ref: f
|
|
96548
|
-
}), r[
|
|
96550
|
+
}), r[7] = O) : O = r[7], O;
|
|
96549
96551
|
};
|
|
96550
96552
|
const UI_PLUGINS = [
|
|
96551
96553
|
new ButtonPlugin(),
|
|
@@ -101061,7 +101063,7 @@ Defaulting to \`null\`.`;
|
|
|
101061
101063
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
101062
101064
|
}
|
|
101063
101065
|
}
|
|
101064
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.5-
|
|
101066
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.5-dev7"), showCodeInRunModeAtom = atom(true);
|
|
101065
101067
|
atom(null);
|
|
101066
101068
|
var VIRTUAL_FILE_REGEX = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, VirtualFileTracker = class e {
|
|
101067
101069
|
constructor() {
|
package/package.json
CHANGED
package/src/css/app/Cell.css
CHANGED
|
@@ -249,7 +249,6 @@
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
/* Borderless styles for Cell */
|
|
252
|
-
|
|
253
252
|
&.borderless {
|
|
254
253
|
border-color: transparent;
|
|
255
254
|
|
|
@@ -258,7 +257,6 @@
|
|
|
258
257
|
}
|
|
259
258
|
|
|
260
259
|
/* Apply the original styles */
|
|
261
|
-
&:hover,
|
|
262
260
|
&:focus {
|
|
263
261
|
border: 1px solid var(--gray-4);
|
|
264
262
|
}
|
|
@@ -115,16 +115,18 @@ const TexComponent = ({
|
|
|
115
115
|
// isn't a simple way to do that in Python without bringing in a new
|
|
116
116
|
// dependency.
|
|
117
117
|
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
118
|
+
// When nested, the inner marimo-tex should not render because the outer
|
|
119
|
+
// marimo-tex's textContent includes the nested delimiters (||(||(x||)||))
|
|
120
|
+
// and will render correctly with displayMode: true. We detect this by
|
|
121
|
+
// checking if the parent element is also a marimo-tex.
|
|
122
|
+
const isNested = host.parentElement?.tagName.toLowerCase() === "marimo-tex";
|
|
121
123
|
|
|
122
124
|
// Re-render when the text content changes.
|
|
123
125
|
useLayoutEffect(() => {
|
|
124
|
-
if (ref.current) {
|
|
126
|
+
if (ref.current && !isNested) {
|
|
125
127
|
renderLatex(ref.current, currentTex);
|
|
126
128
|
}
|
|
127
|
-
}, [currentTex]);
|
|
129
|
+
}, [currentTex, isNested]);
|
|
128
130
|
|
|
129
131
|
return <span ref={ref} />;
|
|
130
132
|
};
|