@marimo-team/islands 0.22.5-dev16 → 0.22.5-dev19

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.
@@ -80,7 +80,7 @@ function useAsyncData(e, s) {
80
80
  }, c[13] = f, c[14] = v, c[15] = y, c[16] = b) : b = c[16], b;
81
81
  }
82
82
  function _temp(e) {
83
- return e.status === "success" ? Result.loading(e.data) : Result.pending();
83
+ return e.status === "success" || e.status === "loading" ? Result.loading(e.data) : Result.pending();
84
84
  }
85
85
  export {
86
86
  useAsyncData as t
@@ -14,7 +14,7 @@ import { s as uniq } from "./arrays-beUWo8RF.js";
14
14
  import { a as AlertTitle, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-BvvMxigY.js";
15
15
  import { n as formats } from "./vega-loader.browser-DqEcFOPD.js";
16
16
  import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-Bd1kgLn7.js";
17
- import { t as useAsyncData } from "./useAsyncData-C9ez7Ilo.js";
17
+ import { t as useAsyncData } from "./useAsyncData-BG3ULuDU.js";
18
18
  import { t as j } from "./react-vega-CzRAIHrv.js";
19
19
  import "./defaultLocale-qS7DaAmi.js";
20
20
  import "./defaultLocale-Bxoo2-30.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.22.5-dev16",
3
+ "version": "0.22.5-dev19",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -25,6 +25,7 @@ import type { NotebookDocumentTransactionRequest } from "../network/types";
25
25
  import { store } from "../state/jotai";
26
26
  import type { CellActions, NotebookState } from "./cells";
27
27
  import type { CellId } from "./ids";
28
+ import { SCRATCH_CELL_ID } from "./ids";
28
29
  import type { CellData } from "./types";
29
30
 
30
31
  export type DocumentChange =
@@ -572,10 +573,21 @@ const flushChanges = debounce(() => {
572
573
  void getRequestClient().sendDocumentTransaction({ changes });
573
574
  }, 400);
574
575
 
576
+ function isScratchChange(change: DocumentChange): boolean {
577
+ if ("cellId" in change && change.cellId === SCRATCH_CELL_ID) {
578
+ return true;
579
+ }
580
+ return false;
581
+ }
582
+
575
583
  function enqueue(change: DocumentChange) {
576
584
  if (store.get(kioskModeAtom)) {
577
585
  return;
578
586
  }
587
+ // The scratchpad cell is local-only — don't sync it to the document.
588
+ if (isScratchChange(change)) {
589
+ return;
590
+ }
579
591
  pendingChanges.push(change);
580
592
  flushChanges();
581
593
  }
@@ -341,7 +341,7 @@ export function useAsyncData<T>(
341
341
  };
342
342
  setResult((prevResult) => {
343
343
  // If we have previous data, show reloading state
344
- if (prevResult.status === "success") {
344
+ if (prevResult.status === "success" || prevResult.status === "loading") {
345
345
  return Result.loading(prevResult.data);
346
346
  }
347
347
  // Otherwise, show initial loading state
@@ -704,7 +704,7 @@ export const LoadingDataTableComponent = memo(
704
704
  <LoadingTable
705
705
  pageSize={
706
706
  props.totalRows !== TOO_MANY_ROWS && props.totalRows > 0
707
- ? props.totalRows
707
+ ? Math.min(props.totalRows, props.pageSize)
708
708
  : props.pageSize
709
709
  }
710
710
  />