@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 CHANGED
@@ -96521,7 +96521,8 @@ Defaulting to \`null\`.`;
96521
96521
  });
96522
96522
  }
96523
96523
  var TexComponent = (e) => {
96524
- let r = (0, import_compiler_runtime$12.c)(7), { host: c, tex: d } = e, f = (0, import_react.useRef)(null), [h, _] = (0, import_react.useState)(d), v, y;
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] === h ? (S = r[4], w = r[5]) : (S = () => {
96541
- f.current && renderLatex(f.current, h);
96542
- }, w = [
96543
- h
96544
- ], r[3] = h, r[4] = S, r[5] = w), (0, import_react.useLayoutEffect)(S, w);
96545
- let E;
96546
- return r[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = (0, import_jsx_runtime.jsx)("span", {
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[6] = E) : E = r[6], E;
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-dev4"), showCodeInRunModeAtom = atom(true);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.19.5-dev4",
3
+ "version": "0.19.5-dev7",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -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
- // The number of children is always 1 (the LaTeX) or 3 redundant ||(, ||)
119
- // delimiters as the first and third child, another marimo-tex tag as the
120
- // second. Only try to render latex in the former case.
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
  };