@marimo-team/islands 0.22.1-dev32 → 0.22.1-dev34

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.
Files changed (42) hide show
  1. package/dist/{chat-ui-eH46RYWT.js → chat-ui-CJCTr1kq.js} +2 -2
  2. package/dist/{glide-data-editor-VgPtWvhu.js → glide-data-editor-BQPLhydy.js} +1 -1
  3. package/dist/main.js +13 -17
  4. package/dist/{process-output-BbUNe4iH.js → process-output-D0SEeV3t.js} +4 -4
  5. package/dist/{toDate-BzYZtEK7.js → toDate-CUqpEbBS.js} +1 -1
  6. package/dist/{useDeepCompareMemoize-iM1YNTEF.js → useDeepCompareMemoize-Ch-7Rk2x.js} +1 -1
  7. package/dist/{vega-component-CkpTXaRx.js → vega-component-CPhNLfZZ.js} +4 -4
  8. package/package.json +1 -1
  9. package/src/components/chat/acp/state.ts +1 -1
  10. package/src/components/chat/chat-history-popover.tsx +1 -1
  11. package/src/components/data-table/pagination.tsx +1 -1
  12. package/src/components/editor/cell/code/cell-editor.tsx +1 -1
  13. package/src/components/editor/chrome/panels/snippets-panel.tsx +1 -1
  14. package/src/components/editor/chrome/panels/write-secret-modal.tsx +1 -1
  15. package/src/components/editor/chrome/wrapper/storage.ts +2 -2
  16. package/src/components/editor/connections/database/as-code.ts +1 -1
  17. package/src/components/editor/connections/form-renderers.tsx +1 -1
  18. package/src/components/editor/connections/storage/as-code.ts +1 -1
  19. package/src/components/editor/links/cell-link-list.tsx +1 -1
  20. package/src/components/editor/navigation/clipboard.ts +1 -1
  21. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +2 -2
  22. package/src/components/editor/navigation/navigation.ts +2 -2
  23. package/src/components/editor/output/JsonOutput.tsx +2 -2
  24. package/src/components/editor/output/console/ConsoleOutput.tsx +1 -1
  25. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -1
  26. package/src/components/pages/gallery-page.tsx +1 -1
  27. package/src/components/variables/variables-table.tsx +1 -1
  28. package/src/core/cells/cells.ts +1 -1
  29. package/src/core/codemirror/cells/traceback-decorations.ts +1 -1
  30. package/src/core/codemirror/copilot/getCodes.ts +1 -1
  31. package/src/core/codemirror/copilot/transport.ts +1 -0
  32. package/src/core/datasets/state.ts +1 -1
  33. package/src/core/network/CachingRequestRegistry.ts +1 -1
  34. package/src/core/runtime/runtime.ts +1 -0
  35. package/src/hooks/__tests__/useDuplicateShortcuts.test.ts +1 -1
  36. package/src/plugins/impl/anywidget/__tests__/model.test.ts +2 -2
  37. package/src/plugins/impl/data-editor/glide-data-editor.tsx +1 -1
  38. package/src/plugins/impl/vega/make-selectable.ts +2 -2
  39. package/src/utils/__tests__/multi-map.test.ts +3 -3
  40. package/src/utils/__tests__/versions.test.ts +5 -5
  41. package/src/utils/arrays.ts +1 -1
  42. package/src/utils/mime-types.ts +1 -1
@@ -5,12 +5,12 @@ import { s as __toESM, t as __commonJSMin } from "./chunk-BNovOVIE.js";
5
5
  import { t as require_react } from "./react-Bs6Z0kvn.js";
6
6
  import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
7
7
  import { r as toast } from "./copy-B7781WJ3.js";
8
- import { A as MarimoIncomingMessageEvent, At as moveToEndOfEditor, Bn as CircleX, C as contextToXml, D as AccordionContent, Dn as Wrench, Dt as createVariableInfoElement, E as Accordion, Fn as File$1, Gt as dataSourceConnectionsAtom, I as ChatBubbleIcon, Jt as getRequestClient, Kt as getTableType, Lt as jotaiJsonStorage, Mn as LoaderCircle, O as AccordionItem, On as Trash2, Pn as Info, Q as cellErrorsAtom, Qt as singleFacet, Rt as variablesAtom, S as Sections, T as AIContextRegistry, U as deserializeBlob, W as base64ToDataURL, Wt as allTablesAtom, Z as renderHTML, a as toPng, bt as displayCellName, cn as CellOutputId, d as Spinner, f as Popover, g as isOutputEmpty, h as PopoverTrigger, k as AccordionTrigger, m as PopoverContent, n as blobToString, nt as notebookAtom, o as MarkdownRenderer, rn as ZodLocalStorage, t as processOutput, w as AIContextProvider, x as Boosts, xn as Anchor2, y as DatasourceContextProvider, yn as atomWithStorage, zt as PluralWord } from "./process-output-BbUNe4iH.js";
8
+ import { A as MarimoIncomingMessageEvent, At as moveToEndOfEditor, Bn as CircleX, C as contextToXml, D as AccordionContent, Dn as Wrench, Dt as createVariableInfoElement, E as Accordion, Fn as File$1, Gt as dataSourceConnectionsAtom, I as ChatBubbleIcon, Jt as getRequestClient, Kt as getTableType, Lt as jotaiJsonStorage, Mn as LoaderCircle, O as AccordionItem, On as Trash2, Pn as Info, Q as cellErrorsAtom, Qt as singleFacet, Rt as variablesAtom, S as Sections, T as AIContextRegistry, U as deserializeBlob, W as base64ToDataURL, Wt as allTablesAtom, Z as renderHTML, a as toPng, bt as displayCellName, cn as CellOutputId, d as Spinner, f as Popover, g as isOutputEmpty, h as PopoverTrigger, k as AccordionTrigger, m as PopoverContent, n as blobToString, nt as notebookAtom, o as MarkdownRenderer, rn as ZodLocalStorage, t as processOutput, w as AIContextProvider, x as Boosts, xn as Anchor2, y as DatasourceContextProvider, yn as atomWithStorage, zt as PluralWord } from "./process-output-D0SEeV3t.js";
9
9
  import "./chunk-5FQGJX7Z-C428iZBW.js";
10
10
  import { l as createLucideIcon } from "./dist-D_UjpfOY.js";
11
11
  import { C as logNever, I as X, n as Strings, t as Label } from "./label-DbZGAoCH.js";
12
12
  import { a as NumberField, b as DropdownMenuTrigger, d as DropdownMenuContent, p as DropdownMenuItem, r as Input, u as DropdownMenu } from "./input-CFY9gApZ.js";
13
- import { g as CircleQuestionMark } from "./toDate-BzYZtEK7.js";
13
+ import { g as CircleQuestionMark } from "./toDate-CUqpEbBS.js";
14
14
  import { c as Objects, g as Logger, l as useEventListener, t as Button, y as cn } from "./button-DNlNlZY_.js";
15
15
  import "./react-dom-BSUuJjCR.js";
16
16
  import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
@@ -10700,7 +10700,7 @@ let __tla = (async () => {
10700
10700
  }
10701
10701
  let i = [
10702
10702
  ...n2.entries()
10703
- ].sort(([e2], [t2]) => e2 - t2).map(([, e2]) => e2);
10703
+ ].toSorted(([e2], [t2]) => e2 - t2).map(([, e2]) => e2);
10704
10704
  i.length > 0 && t((e2) => [
10705
10705
  ...e2,
10706
10706
  ...i
package/dist/main.js CHANGED
@@ -21,7 +21,7 @@ import { a as __toCommonJS, n as __esmMin, r as __export, s as __toESM, t as __c
21
21
  import { t as require_react } from "./react-Bs6Z0kvn.js";
22
22
  import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
23
23
  import { n as Copy, r as toast, t as copyToClipboard } from "./copy-B7781WJ3.js";
24
- import { $ as createActions, $t as elementContainsMarimoCellFile, A as MarimoIncomingMessageEvent, An as PaintRoller, B as DotFilledIcon, Bn as CircleX, Bt as PluralWords, Cn as Content2$1, Ct as normalizeName, D as AccordionContent, Dn as Wrench, E as Accordion, En as Trigger2, Et as MarkdownLanguageAdapter, F as BorderAllIcon, Fn as File, Ft as repl, G as base64ToDataView, H as PinRightIcon, Hn as Braces, Ht as getDataTypeColor, In as FileText, It as adaptForLocalStorage, J as extractBase64FromDataURL, Jt as getRequestClient, K as base64ToUint8Array, L as CheckIcon, Ln as Eye, Lt as jotaiJsonStorage, M as MarimoValueReadyEvent, Mn as LoaderCircle, Mt as DeferredRequestRegistry, N as MarimoValueUpdateEvent, Nn as Layers, Nt as generateUUID, O as AccordionItem, On as Trash2, Ot as PathBuilder, P as createInputEvent, Pn as Info, Pt as useChromeActions, R as ChevronDownIcon, Rn as Database, Sn as Close$1, St as isInternalCellName, Tn as Root2$4, Tt as customPythonLanguageSupport, U as deserializeBlob, Un as esm_default$1, Ut as require_client, V as PinLeftIcon, Vn as CircleAlert, Vt as DATA_TYPE_ICON, Wn as import_lib, X as safeExtractSetUIElementMessageBuffers, Xt as useRequestClient, Y as isDataURLString, Yt as requestClientAtom, Z as renderHTML, Zt as isUninstantiated, _ as useExpandedConsoleOutput, _n as jsonToTSV, _t as headingToIdentifier, a as toPng, an as parseAttrValue, at as useCellActions, b as getDatasourceContext, bn as selectAtom, bt as displayCellName, c as useCellFocusActions, cn as CellOutputId, ct as createCell, d as Spinner, dn as UIElementId, dt as initialModeAtom, en as extractAllTracebackInfo, et as getCellEditorView, f as Popover$1, fn as findCellId, ft as kioskModeAtom, g as isOutputEmpty, gn as jsonToMarkdown, gt as isErrorMime, h as PopoverTrigger, hn as jsonParseWithSpecialChar, ht as outputIsStale, i as PythonIcon, in as filenameAtom, it as reducer, j as MarimoValueInputEvent, jn as NotebookPen, jt as goToCellLine, k as AccordionTrigger, kn as Table2, kt as Paths, l as useLastFocusedCellId, ln as HTMLCellId, lt as AnsiUp, m as PopoverContent, mn as RANDOM_ID_ATTR, mt as outputIsLoading, n as blobToString, nn as NotebookScopedLocalStorage, nt as notebookAtom, o as MarkdownRenderer, on as parseDataset, ot as useCellIds, p as PopoverClose$1, pn as OBJECT_ID_ATTR, pt as viewStateAtom, q as dataViewToBase64, qt as convertStatsName, r as filesToBase64, rt as notebookOutline, s as LazyAnyLanguageCodeMirror, sn as parseInitialValue, st as useCellNames, t as processOutput, tn as getTracebackInfo, tt as getCellNames, u as maybeAddAltairImport, un as SCRATCH_CELL_ID, ut as getInitialAppMode, v as useExpandedOutput, vn as atomWithReducer, vt as DATA_CELL_ID, wn as Item$1, wt as Checkbox, xt as getValidName, yn as atomWithStorage, yt as getCellDomProps, z as ChevronRightIcon, zn as Columns2, zt as PluralWord, __tla as __tla_0 } from "./process-output-BbUNe4iH.js";
24
+ import { $ as createActions, $t as elementContainsMarimoCellFile, A as MarimoIncomingMessageEvent, An as PaintRoller, B as DotFilledIcon, Bn as CircleX, Bt as PluralWords, Cn as Content2$1, Ct as normalizeName, D as AccordionContent, Dn as Wrench, E as Accordion, En as Trigger2, Et as MarkdownLanguageAdapter, F as BorderAllIcon, Fn as File, Ft as repl, G as base64ToDataView, H as PinRightIcon, Hn as Braces, Ht as getDataTypeColor, In as FileText, It as adaptForLocalStorage, J as extractBase64FromDataURL, Jt as getRequestClient, K as base64ToUint8Array, L as CheckIcon, Ln as Eye, Lt as jotaiJsonStorage, M as MarimoValueReadyEvent, Mn as LoaderCircle, Mt as DeferredRequestRegistry, N as MarimoValueUpdateEvent, Nn as Layers, Nt as generateUUID, O as AccordionItem, On as Trash2, Ot as PathBuilder, P as createInputEvent, Pn as Info, Pt as useChromeActions, R as ChevronDownIcon, Rn as Database, Sn as Close$1, St as isInternalCellName, Tn as Root2$4, Tt as customPythonLanguageSupport, U as deserializeBlob, Un as esm_default$1, Ut as require_client, V as PinLeftIcon, Vn as CircleAlert, Vt as DATA_TYPE_ICON, Wn as import_lib, X as safeExtractSetUIElementMessageBuffers, Xt as useRequestClient, Y as isDataURLString, Yt as requestClientAtom, Z as renderHTML, Zt as isUninstantiated, _ as useExpandedConsoleOutput, _n as jsonToTSV, _t as headingToIdentifier, a as toPng, an as parseAttrValue, at as useCellActions, b as getDatasourceContext, bn as selectAtom, bt as displayCellName, c as useCellFocusActions, cn as CellOutputId, ct as createCell, d as Spinner, dn as UIElementId, dt as initialModeAtom, en as extractAllTracebackInfo, et as getCellEditorView, f as Popover$1, fn as findCellId, ft as kioskModeAtom, g as isOutputEmpty, gn as jsonToMarkdown, gt as isErrorMime, h as PopoverTrigger, hn as jsonParseWithSpecialChar, ht as outputIsStale, i as PythonIcon, in as filenameAtom, it as reducer, j as MarimoValueInputEvent, jn as NotebookPen, jt as goToCellLine, k as AccordionTrigger, kn as Table2, kt as Paths, l as useLastFocusedCellId, ln as HTMLCellId, lt as AnsiUp, m as PopoverContent, mn as RANDOM_ID_ATTR, mt as outputIsLoading, n as blobToString, nn as NotebookScopedLocalStorage, nt as notebookAtom, o as MarkdownRenderer, on as parseDataset, ot as useCellIds, p as PopoverClose$1, pn as OBJECT_ID_ATTR, pt as viewStateAtom, q as dataViewToBase64, qt as convertStatsName, r as filesToBase64, rt as notebookOutline, s as LazyAnyLanguageCodeMirror, sn as parseInitialValue, st as useCellNames, t as processOutput, tn as getTracebackInfo, tt as getCellNames, u as maybeAddAltairImport, un as SCRATCH_CELL_ID, ut as getInitialAppMode, v as useExpandedOutput, vn as atomWithReducer, vt as DATA_CELL_ID, wn as Item$1, wt as Checkbox, xt as getValidName, yn as atomWithStorage, yt as getCellDomProps, z as ChevronRightIcon, zn as Columns2, zt as PluralWord, __tla as __tla_0 } from "./process-output-D0SEeV3t.js";
25
25
  import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-C428iZBW.js";
26
26
  import { l as createLucideIcon, o as useSize, s as Root$4 } from "./dist-D_UjpfOY.js";
27
27
  import { A as $896ba0a80a8f4d36$export$85fd5fdf27bacc79, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, F as ListFilter, I as ChartPie, L as ChartColumn, M as $5a387cc49350e6db$export$722debc0e56fea39, N as Table$1, O as TIME_UNIT_DESCRIPTIONS, P as SquareFunction, S as DEFAULT_AGGREGATION, T as DEFAULT_TIME_UNIT, _ as AGGREGATION_TYPE_DESCRIPTIONS, a as AGGREGATION_FNS$1, b as COLOR_SCHEMES, c as COLOR_BY_FIELDS, d as NONE_VALUE, f as SELECTABLE_DATA_TYPES, g as TIME_UNITS, h as STRING_AGGREGATION_FNS, i as convertDataTypeToSelectable, j as $fb18d541ea1ad717$export$ad991b66133851cf, k as escapeFieldName, l as COMBINED_TIME_UNITS, m as SORT_TYPES, n as createSpecWithoutData, o as BIN_AGGREGATION, p as SINGLE_TIME_UNITS, r as isFieldSet, s as CHART_TYPES, t as augmentSpecWithData, u as ChartType, v as AGGREGATION_TYPE_ICON, w as DEFAULT_MAX_BINS_FACET, x as COUNT_FIELD, y as CHART_TYPE_ICON } from "./spec-CiHus5Bb.js";
@@ -29,7 +29,7 @@ import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as Togg
29
29
  import { t as Check } from "./check-CWUkiHmb.js";
30
30
  import { A as Icon, C as logNever, D as $18f2051aff69b9bf$export$a54013f0d02a8f82, E as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, F as createCollection, I as X, M as clamp$3, N as usePrevious$1, O as $b5e257d569688ac6$export$535bd6ca7f90a273, P as useDirection, R as ChevronDown, S as assertNever, T as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5, _ as menuControlVariants, a as SelectContent, b as menuSeparatorVariants, c as SelectLabel, d as SelectValue, f as NativeSelect, g as menuControlCheckVariants, h as menuContentCommon, i as Select, j as Trigger$3, l as SelectSeparator, m as MENU_ITEM_DISABLED, n as Strings, o as SelectGroup, p as selectStyles, r as capitalize, s as SelectItem, t as Label, u as SelectTrigger, v as menuItemVariants, w as $a916eb452884faea$export$b7a616150fdb9f44, x as menuSubTriggerVariants, y as menuLabelVariants } from "./label-DbZGAoCH.js";
31
31
  import { $ as $e5be200c675c3b3a$export$aca958c65c314e6c, $t as Portal, A as $d2b4bc8c273e7be6$export$24d547caef80ccd1, At as $c87311424ea30a05$export$fedb369cb70207f1, B as $64fa3d84918910a7$export$c62b8e45d58ddad9, Bt as $431fbd86ca7dc216$export$f21a1ffae260145a, C as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, Ct as $8ae05eaa5c114e9c$export$7f54fc3180508a52, D as $ee014567cb39d3f0$export$ff05c3ac10437e03, Dt as $c87311424ea30a05$export$78551043582a6a98, E as $ee014567cb39d3f0$export$f551688fc98f2e09, Et as $c87311424ea30a05$export$6446a186d09e379e, F as $64fa3d84918910a7$export$2881499e37b75b9a, Ft as $d4ee10de306f2510$export$b4f377a2b6254582, G as marked, Gt as Anchor2, H as $64fa3d84918910a7$export$ef03459518577ad4, Ht as $bdb11010cef70236$export$b4cc09c592e8fdb8, I as $64fa3d84918910a7$export$29f1550f4b0d4415, It as $d4ee10de306f2510$export$cd4e5573fbe2b576, J as $d2e8511e6f209edf$export$e908e06f4b8e3402, Jt as Content2$2, K as useDebounceControlledState, Kt as Arrow2, L as $64fa3d84918910a7$export$4d86445c2cf5e3, Lt as $d4ee10de306f2510$export$e58f029f0fbfdb29, M as $01b77f81d0f07f68$export$75b6ee27786ba447, Mt as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, N as $01b77f81d0f07f68$export$b04be29aa201d4f5, Nt as $3ef42575df84b30b$export$9d1611c77c2fe928, O as $514c0188e459b4c0$export$5f1af8db9871e1d6, Ot as $c87311424ea30a05$export$9ac100e40613ea10, P as $f39a9eba43920ace$export$b5d7cc18bb8d2b59, Pt as $d4ee10de306f2510$export$4282f70798064fe0, Q as $e5be200c675c3b3a$export$a763b9476acd3eb, Qt as Label$2, R as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, Rt as $f4e2df6bd15f8569$export$98658e8c59125e6a, S as $3985021b0ad6602f$export$f5b8910cec6cf069, St as $e9faafb641e167db$export$90fc3a17d93f704c, T as $d3e0e05bdfcf66bd$export$c24727297075ec6a, Tt as $313b98861ee5dd6c$export$d6875122194c7b44, U as $64fa3d84918910a7$export$fabf2dc03a41866e, Ut as $bdb11010cef70236$export$f680877a34711e37, V as $64fa3d84918910a7$export$df3a06d6289f983e, Vt as $ff5963eb1fccf552$export$e08e3b67e392101e, Wt as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, X as $e93e671b31057976$export$b8473d3665f3a75a, Xt as Item2$2, Y as $2baaea4c71418dea$export$294aa081a6c6f55d, Yt as Group$1, Z as $e5be200c675c3b3a$export$75ee7c75d68f5b0e, Zt as ItemIndicator, _ as DropdownMenuSub, _t as $9446cca9a3875146$export$7d15b64cf5a3a4c4, a as NumberField, an as SubContent, at as $6c7bd7858deea686$export$cd11ab140839f11d, b as DropdownMenuTrigger, bt as $b4b717babfbb907b$export$bebd5a1431fec25d, c as prettyNumber, cn as Item$2, ct as $6db58dc88e78b024$export$2f817fcdc4b89ae0, d as DropdownMenuContent, dn as Search, dt as $9ab94262bd0047c7$export$420e68273165f4ec, en as RadioGroup$2, et as $e5be200c675c3b3a$export$dad6ae84456c676a, f as DropdownMenuGroup, fn as Circle, ft as $3ad3f6e1647bc98d$export$80f3e147d781571c, g as DropdownMenuSeparator, gt as $ae1eeba8b9eafd08$export$5165eccb35aaadb5, h as DropdownMenuPortal, ht as _class_private_field_init, i as OnBlurredInput, in as Sub, it as $701a24aa0da5b062$export$ea18c227d4417cc3, j as $d2b4bc8c273e7be6$export$353f5b6fc5456de1, jt as $7215afc6de606d6b$export$de79e2c695e052f3, k as $514c0188e459b4c0$export$9afb8bc826b033ea, kt as $c87311424ea30a05$export$a11b0059900ceec8, l as prettyScientificNumber, ln as Root$5, lt as $5b160d28a433310d$export$c17fa47878dc55b6, m as DropdownMenuLabel, mt as $f6c31cce2adf654f$export$45712eceda6fad21, n as DebouncedNumberInput, nn as Root3, nt as $319e236875307eab$export$a9b970dcc4ae71a9, o as maxFractionalDigits, on as SubTrigger, ot as $fca6afa0e843324b$export$87b761675e8eaa10, p as DropdownMenuItem, pn as ChevronRight, pt as $507fabe10e71c6fb$export$630ff653c5ada6a9, q as useDebouncedCallback, qt as CheckboxItem, r as Input, rn as Separator, rt as $f7dceffc5ad7768b$export$4e328f61c538687f, s as prettyEngineeringNumber, sn as createMenuScope, st as $fca6afa0e843324b$export$f12b703ca79dfbb1, t as DebouncedInput, tn as RadioItem, tt as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, u as DropdownMenu, un as createRovingFocusGroupScope, ut as $6179b936705e76d3$export$ae780daf29e6d456, v as DropdownMenuSubContent, vt as $458b0a5536c1a7cf$export$40bfa8c7b0832715, w as $a049562f99e7db0e$export$f9c6924e160136d1, wt as $df56164dff5785e2$export$4338b53315abf666, x as $3985021b0ad6602f$export$37fb8590cf2c088c, xt as $99facab73266f662$export$5add1d006293d136, y as DropdownMenuSubTrigger, yt as $b4b717babfbb907b$export$4c063cf1350e6fed, z as $64fa3d84918910a7$export$c245e6201fed2f75, zt as $431fbd86ca7dc216$export$b204af158042fbac } from "./input-CFY9gApZ.js";
32
- import { a as millisecondsInMinute, c as asRemoteURL, d as isUrl, f as require_cuid2, g as CircleQuestionMark, h as isWasm, i as millisecondsInHour, m as Deferred, n as constructFrom, o as millisecondsInSecond, r as millisecondsInDay, s as millisecondsInWeek, t as toDate, u as appendQueryParams } from "./toDate-BzYZtEK7.js";
32
+ import { a as millisecondsInMinute, c as asRemoteURL, d as isUrl, f as require_cuid2, g as CircleQuestionMark, h as isWasm, i as millisecondsInHour, m as Deferred, n as constructFrom, o as millisecondsInSecond, r as millisecondsInDay, s as millisecondsInWeek, t as toDate, u as appendQueryParams } from "./toDate-CUqpEbBS.js";
33
33
  import { a as Plus, i as Trash, n as ErrorBoundary, o as Pencil, r as require_prop_types, t as BulkEdit } from "./types-D_ntCXg0.js";
34
34
  import { n as clsx_default } from "./clsx-yW_RAw0K.js";
35
35
  import { _ as Functions, c as Objects, g as Logger, h as Events, i as NOT_SET, l as useEventListener, m as useComposedRefs, n as buttonVariants, o as isPlatformMac, p as composeRefs, r as cva, t as Button, u as Slot$1, v as throwNotImplemented, y as cn } from "./button-DNlNlZY_.js";
@@ -56,7 +56,7 @@ import "./dist-Ci0CXEFt.js";
56
56
  import "./dist-DJ9F1eHs.js";
57
57
  import { a as parser, r as python } from "./dist-DAfcmt-d.js";
58
58
  import "./purify.es-hTCfRGdl.js";
59
- import { a as AlertTitle, i as AlertDescription, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-iM1YNTEF.js";
59
+ import { a as AlertTitle, i as AlertDescription, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-Ch-7Rk2x.js";
60
60
  import { n as memoize$1, t as isPropValid } from "./emotion-is-prop-valid.esm-CJVjyntJ.js";
61
61
  import { n as formats } from "./vega-loader.browser-DqEcFOPD.js";
62
62
  import { a as getContainerWidth, n as vegaLoadData, o as getVegaFieldTypes, r as createBatchedLoader, s as tooltipHandler, t as parseCsvData } from "./loader-Bd1kgLn7.js";
@@ -24521,9 +24521,7 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
24521
24521
  }
24522
24522
  function sortByPrecedence(e, r) {
24523
24523
  let c = r.size;
24524
- return [
24525
- ...e
24526
- ].sort((e2, d) => (r.get(e2[0]) ?? c) - (r.get(d[0]) ?? c));
24524
+ return e.toSorted((e2, d) => (r.get(e2[0]) ?? c) - (r.get(d[0]) ?? c));
24527
24525
  }
24528
24526
  function processMimeBundle(e, r = getDefaultMimeConfig()) {
24529
24527
  if (e.length === 0) return {
@@ -34003,7 +34001,7 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
34003
34001
  100,
34004
34002
  _
34005
34003
  ])
34006
- ].sort((e2, r2) => e2 - r2);
34004
+ ].toSorted((e2, r2) => e2 - r2);
34007
34005
  return (0, import_jsx_runtime.jsxs)("div", {
34008
34006
  className: "flex flex-col lg:flex-row items-center gap-0.5 lg:gap-1 px-2",
34009
34007
  children: [
@@ -35997,14 +35995,14 @@ ${E}`,
35997
35995
  URL_TYPE,
35998
35996
  OBJECT_TYPE,
35999
35997
  FALLBACK_RENDERER
36000
- ].reverse(), JSON_VALUE_TYPES = [
35998
+ ].toReversed(), JSON_VALUE_TYPES = [
36001
35999
  INTEGER_TYPE,
36002
36000
  FLOAT_TYPE,
36003
36001
  JSON_BOOLEAN_TYPE,
36004
36002
  JSON_NONE_TYPE,
36005
36003
  JSON_OBJECT_TYPE,
36006
36004
  JSON_FALLBACK_RENDERER
36007
- ].reverse();
36005
+ ].toReversed();
36008
36006
  function leafData(e) {
36009
36007
  return leafDataAndMimeType(e)[0];
36010
36008
  }
@@ -37052,7 +37050,7 @@ ${E}`,
37052
37050
  };
37053
37051
  }
37054
37052
  };
37055
- var LazyChatbot = import_react.lazy(() => import("./chat-ui-eH46RYWT.js").then((e) => ({
37053
+ var LazyChatbot = import_react.lazy(() => import("./chat-ui-CJCTr1kq.js").then((e) => ({
37056
37054
  default: e.Chatbot
37057
37055
  }))), messageSchema = array(object({
37058
37056
  id: string(),
@@ -37198,7 +37196,7 @@ ${E}`,
37198
37196
  "time",
37199
37197
  "unknown"
37200
37198
  ];
37201
- var import_compiler_runtime$84 = require_compiler_runtime(), TooltipProvider$2 = Provider$2, LazyDataEditor = import_react.lazy(() => import("./glide-data-editor-VgPtWvhu.js").then(async (m2) => {
37199
+ var import_compiler_runtime$84 = require_compiler_runtime(), TooltipProvider$2 = Provider$2, LazyDataEditor = import_react.lazy(() => import("./glide-data-editor-BQPLhydy.js").then(async (m2) => {
37202
37200
  await m2.__tla;
37203
37201
  return m2;
37204
37202
  }));
@@ -58442,7 +58440,7 @@ ${c}
58442
58440
  return true;
58443
58441
  }
58444
58442
  }
58445
- var LazyVegaComponent = import_react.lazy(() => import("./vega-component-CkpTXaRx.js")), VegaPlugin = class {
58443
+ var LazyVegaComponent = import_react.lazy(() => import("./vega-component-CPhNLfZZ.js")), VegaPlugin = class {
58446
58444
  constructor() {
58447
58445
  __publicField(this, "tagName", "marimo-vega");
58448
58446
  __publicField(this, "validator", object({
@@ -65224,9 +65222,7 @@ ${c}
65224
65222
  }, r[2] = n9) : n9 = r[2], (0, import_react.useLayoutEffect)(n9), !$7 && isInternalCellName(M)) return null;
65225
65223
  let r9, i9, a9, o9, s9, c9, l9, u9, d9, f9;
65226
65224
  if (r[3] !== I || r[4] !== Z7 || r[5] !== Q7 || r[6] !== $7 || r[7] !== w || r[8] !== h || r[9] !== t9 || r[10] !== G || r[11] !== q || r[12] !== z || r[13] !== e9 || r[14] !== _ || r[15] !== f || r[16] !== O || r[17] !== v || r[18] !== d) {
65227
- let e2 = [
65228
- ...Q7
65229
- ].reverse(), S2 = e2.some(_temp$2), E2 = e2.findIndex(_temp2$2), M2;
65225
+ let e2 = Q7.toReversed(), S2 = e2.some(_temp$2), E2 = e2.findIndex(_temp2$2), M2;
65230
65226
  r[29] === Q7 ? M2 = r[30] : (M2 = () => Q7.filter(_temp3$1).map(_temp4$1).join("\n"), r[29] = Q7, r[30] = M2);
65231
65227
  let n92 = M2;
65232
65228
  r9 = "relative group", r[31] !== n92 || r[32] !== $7 || r[33] !== h || r[34] !== t9 || r[35] !== _ || r[36] !== f || r[37] !== d ? (i9 = $7 && (0, import_jsx_runtime.jsxs)("div", {
@@ -65423,7 +65419,7 @@ ${c}
65423
65419
  return Logger.warn("Failed to get version from mount config"), null;
65424
65420
  }
65425
65421
  }
65426
- const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.22.1-dev32"), showCodeInRunModeAtom = atom(true);
65422
+ const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.22.1-dev34"), showCodeInRunModeAtom = atom(true);
65427
65423
  atom(null);
65428
65424
  var VIRTUAL_FILE_REGEX = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, VirtualFileTracker = class e {
65429
65425
  constructor() {
@@ -65836,7 +65832,7 @@ ${c}
65836
65832
  c = d, r.has(d) || r.set(d, []), (_a3 = r.get(d)) == null ? void 0 : _a3.push(e2);
65837
65833
  }), [
65838
65834
  ...r.entries()
65839
- ].sort(([e2], [r2]) => e2 - r2);
65835
+ ].toSorted(([e2], [r2]) => e2 - r2);
65840
65836
  }
65841
65837
  function shouldHideCode(e, r) {
65842
65838
  let c = new MarkdownLanguageAdapter().isSupported(e), d = r !== null && !isOutputEmpty(r);
@@ -11,7 +11,7 @@ import { a as Type, c as Calendar, i as createReducerAndAtoms, o as ToggleLeft,
11
11
  import { t as Check } from "./check-CWUkiHmb.js";
12
12
  import { C as logNever, F as createCollection, N as usePrevious, P as useDirection, R as ChevronDown, S as assertNever, a as SelectContent, c as SelectLabel, d as SelectValue, i as Select, l as SelectSeparator, n as Strings, o as SelectGroup, s as SelectItem, u as SelectTrigger } from "./label-DbZGAoCH.js";
13
13
  import { G as marked, W as useNonce, mt as $f6c31cce2adf654f$export$45712eceda6fad21, q as useDebouncedCallback } from "./input-CFY9gApZ.js";
14
- import { g as CircleQuestionMark, h as isWasm, l as getRuntimeManager, m as Deferred, p as waitForConnectionOpen, t as toDate } from "./toDate-BzYZtEK7.js";
14
+ import { g as CircleQuestionMark, h as isWasm, l as getRuntimeManager, m as Deferred, p as waitForConnectionOpen, t as toDate } from "./toDate-CUqpEbBS.js";
15
15
  import { c as Objects, d as createSlot, g as Logger, m as useComposedRefs, o as isPlatformMac, r as cva, t as Button, y as cn } from "./button-DNlNlZY_.js";
16
16
  import { t as require_react_dom } from "./react-dom-BSUuJjCR.js";
17
17
  import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
@@ -7293,7 +7293,7 @@ ${r.join("\n")}`;
7293
7293
  ], a = /* @__PURE__ */ new Set(), o = i.filter((e2) => {
7294
7294
  let t2 = `${e2.name}:${e2.source}`;
7295
7295
  return a.has(t2) ? false : (a.add(t2), true);
7296
- }).sort((e2, t2) => e2.name.localeCompare(t2.name));
7296
+ }).toSorted((e2, t2) => e2.name.localeCompare(t2.name));
7297
7297
  return {
7298
7298
  ...e,
7299
7299
  tables: o
@@ -22790,7 +22790,7 @@ ${n.sqlString}
22790
22790
  }
22791
22791
  var CachingRequestRegistry = class e {
22792
22792
  static jsonStringifySortKeys() {
22793
- return (e2) => typeof e2 != "object" || !e2 ? String(e2) : JSON.stringify(e2, Object.keys(e2).sort(), 2);
22793
+ return (e2) => typeof e2 != "object" || !e2 ? String(e2) : JSON.stringify(e2, Object.keys(e2).toSorted(), 2);
22794
22794
  }
22795
22795
  constructor(t, n = {}) {
22796
22796
  this.delegate = t, this.toKey = n.toKey ?? e.jsonStringifySortKeys(), this.cache = new LRUCache(n.maxSize ?? 128);
@@ -25858,7 +25858,7 @@ ${n.sqlString}
25858
25858
  } else a.push(null);
25859
25859
  o--;
25860
25860
  }
25861
- let s = a.reverse();
25861
+ let s = a.toReversed();
25862
25862
  return t.collapseAll(s);
25863
25863
  })
25864
25864
  }),
@@ -477,7 +477,7 @@ var RuntimeManager = class {
477
477
  try {
478
478
  new URL(this.config.url);
479
479
  } catch (e2) {
480
- throw Error(`Invalid runtime URL: ${this.config.url}. ${e2 instanceof Error ? e2.message : "Unknown error"}`);
480
+ throw Error(`Invalid runtime URL: ${this.config.url}. ${e2 instanceof Error ? e2.message : "Unknown error"}`, { cause: e2 });
481
481
  }
482
482
  this.lazy || this.init();
483
483
  }
@@ -1,7 +1,7 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { t as require_react } from "./react-Bs6Z0kvn.js";
3
3
  import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { t as toDate } from "./toDate-BzYZtEK7.js";
4
+ import { t as toDate } from "./toDate-CUqpEbBS.js";
5
5
  import { r as cva, y as cn } from "./button-DNlNlZY_.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
7
7
  import { C as dequal } from "./useTheme-MWfxn4oz.js";
@@ -1,7 +1,7 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { t as require_react } from "./react-Bs6Z0kvn.js";
3
3
  import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { c as asRemoteURL, g as CircleQuestionMark } from "./toDate-BzYZtEK7.js";
4
+ import { c as asRemoteURL, g as CircleQuestionMark } from "./toDate-CUqpEbBS.js";
5
5
  import { c as Objects, g as Logger, h as Events, y as cn } from "./button-DNlNlZY_.js";
6
6
  import "./react-dom-BSUuJjCR.js";
7
7
  import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
@@ -11,7 +11,7 @@ import { t as Tooltip } from "./tooltip-BXEpXV3R.js";
11
11
  import { i as debounce_default } from "./constants-CvyfaCvs.js";
12
12
  import { n as useTheme, w as useEvent_default } from "./useTheme-MWfxn4oz.js";
13
13
  import { s as uniq } from "./arrays-beUWo8RF.js";
14
- import { a as AlertTitle, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-iM1YNTEF.js";
14
+ import { a as AlertTitle, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-Ch-7Rk2x.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
17
  import { t as useAsyncData } from "./useAsyncData-rN1nzPaS.js";
@@ -254,8 +254,8 @@ function getParamSignature(e) {
254
254
  });
255
255
  let w = {
256
256
  type: C.type,
257
- encodings: "encodings" in C && C.encodings ? [...C.encodings].sort() : void 0,
258
- fields: "fields" in C && C.fields ? [...C.fields].sort() : void 0,
257
+ encodings: "encodings" in C && C.encodings ? [...C.encodings].toSorted() : void 0,
258
+ fields: "fields" in C && C.fields ? [...C.fields].toSorted() : void 0,
259
259
  bind: e.bind
260
260
  };
261
261
  return JSON.stringify(w);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.22.1-dev32",
3
+ "version": "0.22.1-dev34",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -226,7 +226,7 @@ export function getSessionsByAgent(
226
226
  ): AgentSession[] {
227
227
  return sessions
228
228
  .filter((session) => session.agentId === agentId)
229
- .sort((a, b) => b.lastUsedAt - a.lastUsedAt);
229
+ .toSorted((a, b) => b.lastUsedAt - a.lastUsedAt);
230
230
  }
231
231
 
232
232
  export function getAllAgentIds(): ExternalAgentId[] {
@@ -33,7 +33,7 @@ export const ChatHistoryPopover: React.FC<ChatHistoryPopoverProps> = ({
33
33
  const [searchQuery, setSearchQuery] = useState("");
34
34
 
35
35
  const chats = useMemo(() => {
36
- return [...chatState.chats.values()].sort(
36
+ return [...chatState.chats.values()].toSorted(
37
37
  (a, b) => b.updatedAt - a.updatedAt,
38
38
  );
39
39
  }, [chatState.chats]);
@@ -71,7 +71,7 @@ export const DataTablePagination = <TData,>({
71
71
 
72
72
  // Ensure unique page sizes
73
73
  const pageSizeSet = new Set([5, 10, 25, 50, 100, pageSize]);
74
- const pageSizes = [...pageSizeSet].sort((a, b) => a - b);
74
+ const pageSizes = [...pageSizeSet].toSorted((a, b) => a - b);
75
75
 
76
76
  const renderPageSizeSelector = () => {
77
77
  return (
@@ -186,7 +186,7 @@ const CellEditorInternal = ({
186
186
  deleteCell: handleDelete,
187
187
  saveNotebook: saveOrNameNotebook,
188
188
  createManyBelow: (cells) => {
189
- for (const code of [...cells].reverse()) {
189
+ for (const code of cells.toReversed()) {
190
190
  cellActions.createNewCell({
191
191
  code,
192
192
  before: false,
@@ -125,7 +125,7 @@ const SnippetViewer: React.FC<{ snippet: Snippet; onClose: () => void }> = ({
125
125
 
126
126
  const handleInsertSnippet = () => {
127
127
  // Add below last focused cell in reverse order
128
- for (const section of [...snippet.sections].reverse()) {
128
+ for (const section of snippet.sections.toReversed()) {
129
129
  if (section.code) {
130
130
  createNewCell({
131
131
  code: section.code,
@@ -25,7 +25,7 @@ import type { ListSecretKeysResponse } from "@/core/network/types";
25
25
 
26
26
  // dotenv providers should be at the top
27
27
  export function sortProviders(providers: ListSecretKeysResponse["keys"]) {
28
- return providers.sort((a, b) => {
28
+ return providers.toSorted((a, b) => {
29
29
  if (a.provider === "env") {
30
30
  return 1;
31
31
  }
@@ -28,7 +28,7 @@ export function createStorage(location: "left" | "bottom"): PanelGroupStorage {
28
28
  const parsed = schema.parse(JSON.parse(storedValue));
29
29
  return JSON.stringify(
30
30
  Objects.mapValues(parsed, (value) => {
31
- return value.reverse();
31
+ return value.toReversed();
32
32
  }),
33
33
  );
34
34
  } catch {
@@ -42,7 +42,7 @@ export function createStorage(location: "left" | "bottom"): PanelGroupStorage {
42
42
  const parsed = schema.parse(JSON.parse(value));
43
43
  value = JSON.stringify(
44
44
  Objects.mapValues(parsed, (value) => {
45
- return value.reverse();
45
+ return value.toReversed();
46
46
  }),
47
47
  );
48
48
  } catch {
@@ -964,7 +964,7 @@ export function generateDatabaseCode(
964
964
  ...generator.imports,
965
965
  ]);
966
966
 
967
- const lines = [...imports].sort();
967
+ const lines = [...imports].toSorted();
968
968
  lines.push("");
969
969
  const secrets = secretsContainer.formatSecrets();
970
970
  if (secrets) {
@@ -72,7 +72,7 @@ export const SecretsProvider = ({ children }: SecretsProviderProps) => {
72
72
  .map((provider) => provider.name);
73
73
 
74
74
  return {
75
- secretKeys: result.secrets.flatMap((secret) => secret.keys).sort(),
75
+ secretKeys: result.secrets.flatMap((secret) => secret.keys).toSorted(),
76
76
  providerNames: providerNames,
77
77
  };
78
78
  }, []);
@@ -214,7 +214,7 @@ export function generateStorageCode(
214
214
  }
215
215
 
216
216
  const allImports = new Set([...secrets.imports, ...result.imports]);
217
- const lines = [...allImports].sort();
217
+ const lines = [...allImports].toSorted();
218
218
  lines.push("");
219
219
  const secretsStr = secrets.formatSecrets();
220
220
  if (secretsStr) {
@@ -24,7 +24,7 @@ export const CellLinkList: React.FC<Props> = ({
24
24
  skipScroll,
25
25
  }) => {
26
26
  const cellIndex = useCellIds();
27
- const sortedCellIds = [...cellIds].sort((a, b) => {
27
+ const sortedCellIds = cellIds.toSorted((a, b) => {
28
28
  return cellIndex.inOrderIds.indexOf(a) - cellIndex.inOrderIds.indexOf(b);
29
29
  });
30
30
 
@@ -106,7 +106,7 @@ export function useCellClipboard() {
106
106
 
107
107
  // Create new cells with the copied data before/after the current cell
108
108
  const currentCellId = cellId;
109
- const reversedCells = clipboardData.cells.reverse();
109
+ const reversedCells = clipboardData.cells.toReversed();
110
110
  for (const cell of reversedCells) {
111
111
  actions.createNewCell({
112
112
  cellId: currentCellId,
@@ -167,7 +167,7 @@ export function useMultiCellActionButtons(cellIds: CellId[]) {
167
167
  }
168
168
 
169
169
  // Move cells in the appropriate order to maintain relative positions
170
- const sortedCells = direction === "up" ? cellIds : [...cellIds].reverse();
170
+ const sortedCells = direction === "up" ? cellIds : cellIds.toReversed();
171
171
  sortedCells.forEach((cellId) => {
172
172
  moveCell({ cellId, before: direction === "up" });
173
173
  });
@@ -176,7 +176,7 @@ export function useMultiCellActionButtons(cellIds: CellId[]) {
176
176
 
177
177
  const sendSelectedCellsToTop = useEvent((cellIds: CellId[]) => {
178
178
  // Send in reverse order to maintain relative positions
179
- [...cellIds].reverse().forEach((cellId) => {
179
+ cellIds.toReversed().forEach((cellId) => {
180
180
  sendToTop({ cellId });
181
181
  });
182
182
  });
@@ -401,7 +401,7 @@ export function useCellNavigationProps(
401
401
  }
402
402
 
403
403
  // Move cells in the appropriate order to maintain relative positions
404
- [...cellIds].reverse().forEach((cellId) => {
404
+ cellIds.toReversed().forEach((cellId) => {
405
405
  actions.moveCell({ cellId, before: false });
406
406
  });
407
407
  return true;
@@ -480,7 +480,7 @@ export function useCellNavigationProps(
480
480
  }),
481
481
  "cell.sendToTop": addSingleHandler((cellIds) => {
482
482
  // Send in reverse order to maintain relative positions
483
- [...cellIds].reverse().forEach((cellId) => {
483
+ cellIds.toReversed().forEach((cellId) => {
484
484
  actions.sendToTop({ cellId });
485
485
  });
486
486
  return true;
@@ -329,7 +329,7 @@ const PYTHON_VALUE_TYPES = [
329
329
  URL_TYPE,
330
330
  OBJECT_TYPE,
331
331
  FALLBACK_RENDERER,
332
- ].reverse();
332
+ ].toReversed();
333
333
  // Last one wins, so we reverse the array.
334
334
 
335
335
  const JSON_VALUE_TYPES = [
@@ -339,7 +339,7 @@ const JSON_VALUE_TYPES = [
339
339
  JSON_NONE_TYPE,
340
340
  JSON_OBJECT_TYPE,
341
341
  JSON_FALLBACK_RENDERER,
342
- ].reverse();
342
+ ].toReversed();
343
343
 
344
344
  function leafData(leaf: string): string {
345
345
  return leafDataAndMimeType(leaf)[0];
@@ -167,7 +167,7 @@ const ConsoleOutputInternal = (props: Props): React.ReactNode => {
167
167
  return null;
168
168
  }
169
169
 
170
- const reversedOutputs = [...consoleOutputs].reverse();
170
+ const reversedOutputs = consoleOutputs.toReversed();
171
171
  const isPdb = reversedOutputs.some(
172
172
  (output) =>
173
173
  typeof output.data === "string" && output.data.includes("(Pdb)"),
@@ -482,7 +482,7 @@ export function groupCellsByColumn(
482
482
  });
483
483
 
484
484
  // Sort columns by index
485
- return [...cellsByColumn.entries()].sort(([a], [b]) => a - b);
485
+ return [...cellsByColumn.entries()].toSorted(([a], [b]) => a - b);
486
486
  }
487
487
 
488
488
  /**
@@ -83,7 +83,7 @@ const GalleryPage: React.FC = () => {
83
83
  thumbnailUrl,
84
84
  };
85
85
  })
86
- .sort((a, b) => a.relativePath.localeCompare(b.relativePath));
86
+ .toSorted((a, b) => a.relativePath.localeCompare(b.relativePath));
87
87
  }, [workspace?.files, workspace?.root]);
88
88
 
89
89
  const filteredFiles = useMemo(() => {
@@ -226,7 +226,7 @@ function sortData({
226
226
  break;
227
227
  }
228
228
 
229
- return sort.desc ? sortedVariables.reverse() : sortedVariables;
229
+ return sort.desc ? sortedVariables.toReversed() : sortedVariables;
230
230
  }
231
231
 
232
232
  export const VariableTable: React.FC<Props> = memo(
@@ -1226,7 +1226,7 @@ const {
1226
1226
  i--;
1227
1227
  }
1228
1228
 
1229
- const collapseRanges = reversedCollapseRanges.reverse();
1229
+ const collapseRanges = reversedCollapseRanges.toReversed();
1230
1230
  return column.collapseAll(collapseRanges);
1231
1231
  }),
1232
1232
  };
@@ -32,7 +32,7 @@ function createErrorDecorations(state: EditorState, errors: TracebackInfos) {
32
32
  // Filter and sort errors by line number to ensure they're added in order
33
33
  const relevantErrors = errors
34
34
  .filter((error) => error.kind === "cell" && error.cellId === cellId)
35
- .sort((a, b) => a.lineNumber - b.lineNumber);
35
+ .toSorted((a, b) => a.lineNumber - b.lineNumber);
36
36
 
37
37
  for (const error of relevantErrors) {
38
38
  try {
@@ -27,7 +27,7 @@ export function getOtherCellsCode(otherCode: string) {
27
27
  return code;
28
28
  })
29
29
  .filter(Boolean)
30
- .sort((a, b) => {
30
+ .toSorted((a, b) => {
31
31
  if (a.startsWith("import") && !b.startsWith("import")) {
32
32
  return -1;
33
33
  }
@@ -209,6 +209,7 @@ export class LazyWebsocketTransport extends Transport {
209
209
  Logger.error("Copilot#sendData: Failed to reconnect transport", error);
210
210
  throw new Error(
211
211
  "Unable to connect to GitHub Copilot. Please check your settings and try again.",
212
+ { cause: error },
212
213
  );
213
214
  }
214
215
 
@@ -66,7 +66,7 @@ const {
66
66
  return true;
67
67
  });
68
68
 
69
- const sortedTables = dedupedTables.sort((a, b) => {
69
+ const sortedTables = dedupedTables.toSorted((a, b) => {
70
70
  return a.name.localeCompare(b.name);
71
71
  });
72
72
 
@@ -27,7 +27,7 @@ export class CachingRequestRegistry<REQ, RES> {
27
27
  if (typeof o !== "object" || o === null) {
28
28
  return String(o);
29
29
  }
30
- return JSON.stringify(o, Object.keys(o).sort(), 2);
30
+ return JSON.stringify(o, Object.keys(o).toSorted(), 2);
31
31
  };
32
32
  }
33
33
 
@@ -22,6 +22,7 @@ export class RuntimeManager {
22
22
  } catch (error) {
23
23
  throw new Error(
24
24
  `Invalid runtime URL: ${this.config.url}. ${error instanceof Error ? error.message : "Unknown error"}`,
25
+ { cause: error },
25
26
  );
26
27
  }
27
28
 
@@ -145,7 +145,7 @@ describe("findDuplicateShortcuts", () => {
145
145
  expect(result.duplicates).toHaveLength(2);
146
146
 
147
147
  // Check that both duplicate groups are detected
148
- const duplicateKeys = result.duplicates.map((d) => d.key).sort();
148
+ const duplicateKeys = result.duplicates.map((d) => d.key).toSorted();
149
149
  expect(duplicateKeys).toEqual(["cmd-b", "cmd-enter"]);
150
150
 
151
151
  expect(result.hasDuplicate("cell.format")).toBe(true);
@@ -58,13 +58,13 @@ describe("Model", () => {
58
58
  describe("public API", () => {
59
59
  it("should only expose AFM-compliant interface", () => {
60
60
  // Get all enumerable own properties
61
- const ownProperties = Object.keys(model).sort();
61
+ const ownProperties = Object.keys(model).toSorted();
62
62
  // Get prototype methods (excluding constructor)
63
63
  const prototypeMethods = Object.getOwnPropertyNames(
64
64
  Object.getPrototypeOf(model),
65
65
  )
66
66
  .filter((name) => name !== "constructor")
67
- .sort();
67
+ .toSorted();
68
68
 
69
69
  // Snapshot the public API to catch accidental leaks of internal methods
70
70
  expect({ ownProperties, prototypeMethods }).toMatchInlineSnapshot(`
@@ -218,7 +218,7 @@ export const GlideDataEditor = <T,>({
218
218
 
219
219
  // Add new rows in order
220
220
  const sortedNewRows = [...newRows.entries()]
221
- .sort(([a], [b]) => a - b)
221
+ .toSorted(([a], [b]) => a - b)
222
222
  .map(([, row]) => row);
223
223
 
224
224
  if (sortedNewRows.length > 0) {
@@ -40,11 +40,11 @@ function getParamSignature(param: TParams): string {
40
40
  type: select.type,
41
41
  encodings:
42
42
  "encodings" in select && select.encodings
43
- ? [...select.encodings].sort()
43
+ ? [...select.encodings].toSorted()
44
44
  : undefined,
45
45
  fields:
46
46
  "fields" in select && select.fields
47
- ? [...select.fields].sort()
47
+ ? [...select.fields].toSorted()
48
48
  : undefined,
49
49
  bind: param.bind,
50
50
  };
@@ -132,7 +132,7 @@ describe("MultiMap", () => {
132
132
  multiMap.add("key2", 2);
133
133
  multiMap.add("key3", 3);
134
134
  const keys = [...multiMap.keys()];
135
- expect(keys.sort()).toEqual(["key1", "key2", "key3"]);
135
+ expect(keys.toSorted()).toEqual(["key1", "key2", "key3"]);
136
136
  });
137
137
  });
138
138
 
@@ -204,7 +204,7 @@ describe("MultiMap", () => {
204
204
  multiMap.add("key3", 5);
205
205
 
206
206
  const flattened = multiMap.flatValues();
207
- expect(flattened.sort()).toEqual([1, 2, 3, 4, 5]);
207
+ expect(flattened.toSorted()).toEqual([1, 2, 3, 4, 5]);
208
208
  });
209
209
 
210
210
  it("should handle empty arrays in values", () => {
@@ -213,7 +213,7 @@ describe("MultiMap", () => {
213
213
  multiMap.add("key2", 2);
214
214
 
215
215
  const flattened = multiMap.flatValues();
216
- expect(flattened.sort()).toEqual([1, 2]);
216
+ expect(flattened.toSorted()).toEqual([1, 2]);
217
217
  });
218
218
  });
219
219
 
@@ -9,13 +9,13 @@ import {
9
9
  describe("semverSort", () => {
10
10
  it("should sort versions correctly", () => {
11
11
  const versions = ["1.0.0", "1.0.1", "1.0.10", "1.0.2"];
12
- const sortedVersions = versions.sort(semverSort);
12
+ const sortedVersions = versions.toSorted(semverSort);
13
13
  expect(sortedVersions).toEqual(["1.0.0", "1.0.1", "1.0.2", "1.0.10"]);
14
14
  });
15
15
 
16
16
  it("should handle pre-release versions correctly", () => {
17
17
  const versions = ["1.0.0-alpha", "1.0.0", "1.0.0-beta", "1.0.0-rc.1"];
18
- const sortedVersions = versions.sort(semverSort);
18
+ const sortedVersions = versions.toSorted(semverSort);
19
19
  expect(sortedVersions).toEqual([
20
20
  "1.0.0-alpha",
21
21
  "1.0.0-beta",
@@ -26,7 +26,7 @@ describe("semverSort", () => {
26
26
 
27
27
  it("should handle versions with different number of segments", () => {
28
28
  const versions = ["1.0", "1.0.0", "1.0.1", "1.0.10"];
29
- const sortedVersions = versions.sort(semverSort);
29
+ const sortedVersions = versions.toSorted(semverSort);
30
30
  expect(sortedVersions).toEqual(["1.0", "1.0.0", "1.0.1", "1.0.10"]);
31
31
  });
32
32
 
@@ -36,7 +36,7 @@ describe("semverSort", () => {
36
36
  "1.0.0+20130313144700",
37
37
  "1.0.0+exp.sha.5114f85",
38
38
  ];
39
- const sortedVersions = versions.sort(semverSort);
39
+ const sortedVersions = versions.toSorted(semverSort);
40
40
  expect(sortedVersions).toEqual([
41
41
  "1.0.0+001",
42
42
  "1.0.0+20130313144700",
@@ -46,7 +46,7 @@ describe("semverSort", () => {
46
46
 
47
47
  it("reverseSemverSort", () => {
48
48
  const versions = ["1.0.0", "1.0.1", "1.0.10", "1.0.2"];
49
- const sortedVersions = versions.sort(reverseSemverSort);
49
+ const sortedVersions = versions.toSorted(reverseSemverSort);
50
50
  expect(sortedVersions).toEqual(["1.0.10", "1.0.2", "1.0.1", "1.0.0"]);
51
51
  });
52
52
  });
@@ -85,7 +85,7 @@ export function sortBy<T>(
85
85
  // Decorate/sort/undecorate to compute keys once per element
86
86
  return arr
87
87
  .map((item) => [key(item), item] as const)
88
- .sort(([ka], [kb]) => {
88
+ .toSorted(([ka], [kb]) => {
89
89
  // Nullish values sort last
90
90
  if (ka == null && kb == null) {
91
91
  return 0;
@@ -151,7 +151,7 @@ export function sortByPrecedence<T>(
151
151
  ): [MimeType, T][] {
152
152
  const unknownPrecedence = precedence.size;
153
153
 
154
- return [...entries].sort((a, b) => {
154
+ return entries.toSorted((a, b) => {
155
155
  const indexA = precedence.get(a[0]) ?? unknownPrecedence;
156
156
  const indexB = precedence.get(b[0]) ?? unknownPrecedence;
157
157
  return indexA - indexB;