@marimo-team/islands 0.22.1-dev32 → 0.22.1-dev37
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/{chat-ui-eH46RYWT.js → chat-ui-CJCTr1kq.js} +2 -2
- package/dist/{glide-data-editor-VgPtWvhu.js → glide-data-editor-BQPLhydy.js} +1 -1
- package/dist/main.js +291 -207
- package/dist/{process-output-BbUNe4iH.js → process-output-D0SEeV3t.js} +4 -4
- package/dist/{toDate-BzYZtEK7.js → toDate-CUqpEbBS.js} +1 -1
- package/dist/{useDeepCompareMemoize-iM1YNTEF.js → useDeepCompareMemoize-Ch-7Rk2x.js} +1 -1
- package/dist/{vega-component-CkpTXaRx.js → vega-component-CPhNLfZZ.js} +4 -4
- package/package.json +1 -1
- package/src/components/chat/acp/state.ts +1 -1
- package/src/components/chat/chat-history-popover.tsx +1 -1
- package/src/components/data-table/data-table.tsx +12 -12
- package/src/components/data-table/pagination.tsx +1 -1
- package/src/components/editor/cell/code/cell-editor.tsx +1 -1
- package/src/components/editor/chrome/panels/snippets-panel.tsx +1 -1
- package/src/components/editor/chrome/panels/write-secret-modal.tsx +1 -1
- package/src/components/editor/chrome/wrapper/storage.ts +2 -2
- package/src/components/editor/connections/database/as-code.ts +1 -1
- package/src/components/editor/connections/form-renderers.tsx +1 -1
- package/src/components/editor/connections/storage/as-code.ts +1 -1
- package/src/components/editor/links/cell-link-list.tsx +1 -1
- package/src/components/editor/navigation/clipboard.ts +1 -1
- package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +2 -2
- package/src/components/editor/navigation/navigation.ts +2 -2
- package/src/components/editor/output/JsonOutput.tsx +2 -2
- package/src/components/editor/output/console/ConsoleOutput.tsx +1 -1
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -1
- package/src/components/pages/gallery-page.tsx +1 -1
- package/src/components/variables/variables-table.tsx +1 -1
- package/src/core/cells/cells.ts +1 -1
- package/src/core/codemirror/cells/traceback-decorations.ts +1 -1
- package/src/core/codemirror/copilot/getCodes.ts +1 -1
- package/src/core/codemirror/copilot/transport.ts +1 -0
- package/src/core/datasets/state.ts +1 -1
- package/src/core/network/CachingRequestRegistry.ts +1 -1
- package/src/core/runtime/runtime.ts +1 -0
- package/src/hooks/__tests__/useDuplicateShortcuts.test.ts +1 -1
- package/src/plugins/impl/anywidget/__tests__/model.test.ts +2 -2
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +1 -1
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +62 -44
- package/src/plugins/impl/plotly/__tests__/PlotlyPlugin.test.tsx +114 -0
- package/src/plugins/impl/plotly/__tests__/selection.test.ts +158 -196
- package/src/plugins/impl/plotly/selection.ts +274 -56
- package/src/plugins/impl/vega/make-selectable.ts +2 -2
- package/src/utils/__tests__/multi-map.test.ts +3 -3
- package/src/utils/__tests__/versions.test.ts +5 -5
- package/src/utils/arrays.ts +1 -1
- package/src/utils/mime-types.ts +1 -1
|
@@ -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-
|
|
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
|
-
}).
|
|
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).
|
|
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.
|
|
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-
|
|
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-
|
|
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-
|
|
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].
|
|
258
|
-
fields: "fields" in C && C.fields ? [...C.fields].
|
|
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
|
@@ -226,7 +226,7 @@ export function getSessionsByAgent(
|
|
|
226
226
|
): AgentSession[] {
|
|
227
227
|
return sessions
|
|
228
228
|
.filter((session) => session.agentId === agentId)
|
|
229
|
-
.
|
|
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()].
|
|
36
|
+
return [...chatState.chats.values()].toSorted(
|
|
37
37
|
(a, b) => b.updatedAt - a.updatedAt,
|
|
38
38
|
);
|
|
39
39
|
}, [chatState.chats]);
|
|
@@ -314,19 +314,19 @@ const DataTableInternal = <TData,>({
|
|
|
314
314
|
virtualize={virtualize}
|
|
315
315
|
/>
|
|
316
316
|
</Table>
|
|
317
|
+
<TableBottomBar
|
|
318
|
+
part="table-footer"
|
|
319
|
+
className="pt-1.5 pb-0.5 border-t border-border"
|
|
320
|
+
totalColumns={totalColumns}
|
|
321
|
+
pagination={pagination}
|
|
322
|
+
selection={selection}
|
|
323
|
+
onRowSelectionChange={onRowSelectionChange}
|
|
324
|
+
table={table}
|
|
325
|
+
getRowIds={getRowIds}
|
|
326
|
+
showPageSizeSelector={showPageSizeSelector}
|
|
327
|
+
tableLoading={reloading}
|
|
328
|
+
/>
|
|
317
329
|
</div>
|
|
318
|
-
<TableBottomBar
|
|
319
|
-
part="table-footer"
|
|
320
|
-
className="border-t border-border pt-1.5 pb-0.5"
|
|
321
|
-
totalColumns={totalColumns}
|
|
322
|
-
pagination={pagination}
|
|
323
|
-
selection={selection}
|
|
324
|
-
onRowSelectionChange={onRowSelectionChange}
|
|
325
|
-
table={table}
|
|
326
|
-
getRowIds={getRowIds}
|
|
327
|
-
showPageSizeSelector={showPageSizeSelector}
|
|
328
|
-
tableLoading={reloading}
|
|
329
|
-
/>
|
|
330
330
|
</CellSelectionProvider>
|
|
331
331
|
</div>
|
|
332
332
|
);
|
|
@@ -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].
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
45
|
+
return value.toReversed();
|
|
46
46
|
}),
|
|
47
47
|
);
|
|
48
48
|
} catch {
|
|
@@ -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).
|
|
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].
|
|
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 =
|
|
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.
|
|
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 :
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
].
|
|
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
|
-
].
|
|
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 =
|
|
170
|
+
const reversedOutputs = consoleOutputs.toReversed();
|
|
171
171
|
const isPdb = reversedOutputs.some(
|
|
172
172
|
(output) =>
|
|
173
173
|
typeof output.data === "string" && output.data.includes("(Pdb)"),
|
|
@@ -83,7 +83,7 @@ const GalleryPage: React.FC = () => {
|
|
|
83
83
|
thumbnailUrl,
|
|
84
84
|
};
|
|
85
85
|
})
|
|
86
|
-
.
|
|
86
|
+
.toSorted((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
87
87
|
}, [workspace?.files, workspace?.root]);
|
|
88
88
|
|
|
89
89
|
const filteredFiles = useMemo(() => {
|
package/src/core/cells/cells.ts
CHANGED
|
@@ -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
|
-
.
|
|
35
|
+
.toSorted((a, b) => a.lineNumber - b.lineNumber);
|
|
36
36
|
|
|
37
37
|
for (const error of relevantErrors) {
|
|
38
38
|
try {
|
|
@@ -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
|
|
|
@@ -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).
|
|
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).
|
|
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
|
-
.
|
|
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
|
-
.
|
|
221
|
+
.toSorted(([a], [b]) => a - b)
|
|
222
222
|
.map(([, row]) => row);
|
|
223
223
|
|
|
224
224
|
if (sortedNewRows.length > 0) {
|