@marimo-team/frontend 0.25.3-dev2 → 0.25.3-dev21
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/assets/{CellStatus-BP2mavAq.js → CellStatus-O0rU3_5j.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-t8fH_TNc.js → ConnectedDataExplorerComponent-TprnxZeJ.js} +1 -1
- package/dist/assets/{ErrorBoundary-Gl5nCA8C.js → ErrorBoundary-BkSCfv3B.js} +2 -2
- package/dist/assets/JsonOutput-Dq6MGIMV.js +11 -0
- package/dist/assets/{LazyAnyLanguageCodeMirror-CKcCbG2G.js → LazyAnyLanguageCodeMirror-B4fCknq1.js} +2 -2
- package/dist/assets/MarimoErrorOutput-BLtCVffa.js +10 -0
- package/dist/assets/{RenderHTML-BbOqmHy3.js → RenderHTML-PtQ99V0D.js} +1 -1
- package/dist/assets/{RunButton-CK3LhnP5.js → RunButton-B8KRdPZ-.js} +1 -1
- package/dist/assets/{add-cell-with-ai-8UBC0xwR.js → add-cell-with-ai-BOBZjUxI.js} +13 -13
- package/dist/assets/{add-connection-dialog-DXQnd6eB.js → add-connection-dialog-DP62zXw2.js} +2 -2
- package/dist/assets/{agent-panel-D7kMZLG-.js → agent-panel-BFul7UiF.js} +5 -5
- package/dist/assets/ai-model-dropdown-sTKkdrbX.js +13 -0
- package/dist/assets/{any-language-editor-BLCAD3yx.js → any-language-editor-BdTWdMCI.js} +1 -1
- package/dist/assets/{app-config-button-BKEG4x9u.js → app-config-button-Bp44UZdD.js} +1 -1
- package/dist/assets/{blob-D5nfNHOo.js → blob-ykpU69Lk.js} +1 -1
- package/dist/assets/{cell-editor-ADVfycpN.js → cell-editor-B7YlotyH.js} +9 -9
- package/dist/assets/{cell-link-LSth_8hT.js → cell-link-CmO9D2a2.js} +1 -1
- package/dist/assets/{cells-BRkCaSsh.js → cells-BMs-CYDt.js} +31 -31
- package/dist/assets/{chat-display-Dnagy4Nv.js → chat-display-Dw8HQAAY.js} +1 -1
- package/dist/assets/{chat-panel-DQ6HkWEF.js → chat-panel-DPDZrfoJ.js} +2 -2
- package/dist/assets/{chat-ui-Df8Vcj6n.js → chat-ui-BxnFw9Za.js} +1 -1
- package/dist/assets/code-visibility-CGVmpSdE.js +1 -0
- package/dist/assets/coerce-DWjFeXOY.js +1 -0
- package/dist/assets/{column-preview-Cm2D6vyX.js → column-preview-BQ4k86Lv.js} +1 -1
- package/dist/assets/{command-palette-DTSQ7gOC.js → command-palette-BfxYnBUD.js} +1 -1
- package/dist/assets/{common-Cu6CDbuw.js → common-CzWTWhcY.js} +1 -1
- package/dist/assets/{components-CGw16R_N.js → components-C-p2nJ78.js} +1 -1
- package/dist/assets/{components-CP_UoFtT.js → components-CskjK6xZ.js} +1 -1
- package/dist/assets/{components-CXfO-F47.js → components-YBmtV0p6.js} +1 -1
- package/dist/assets/config-BtRLgrlt.js +104 -0
- package/dist/assets/{config-VPSq73n8.js → config-CA1V-wjh.js} +1 -1
- package/dist/assets/config-CMUeR8Wr.js +1 -0
- package/dist/assets/{datasource-Cq6x_5ML.js → datasource-CEDUN47W.js} +1 -1
- package/dist/assets/{dates-BbFQ2oE4.js → dates-CfmdTL6B.js} +1 -1
- package/dist/assets/{dependency-graph-panel--Kgtktcw.js → dependency-graph-panel-KWuUrABU.js} +1 -1
- package/dist/assets/{documentation-panel-BHmbeznw.js → documentation-panel-T1wYs9YS.js} +1 -1
- package/dist/assets/{download-DCJXy66H.js → download-Bt4rM2gS.js} +1 -1
- package/dist/assets/edit-page-DIxL37jf.js +9 -0
- package/dist/assets/{error-banner-Cd69vvyX.js → error-banner-COZ7SfYV.js} +1 -1
- package/dist/assets/{error-entries-Dk3VZ-OK.js → error-entries-CQTemuon.js} +1 -1
- package/dist/assets/{error-panel-BPRYmC5J.js → error-panel-BmlN965r.js} +1 -1
- package/dist/assets/{errors-DCrsa1nH.js → errors-CNsgAw6m.js} +1 -1
- package/dist/assets/{feedback-button-Bik2-e33.js → feedback-button-CO89l9HJ.js} +2 -2
- package/dist/assets/feedback-button-QWfd9e1X.js +1 -0
- package/dist/assets/{file-explorer-panel-BEEK5lcl.js → file-explorer-panel-Bs25Xwng.js} +1 -1
- package/dist/assets/{file-name-input-Cdc-TVqO.js → file-name-input-DgR3ynbz.js} +1 -1
- package/dist/assets/{floating-outline-XD9FAV-f.js → floating-outline-kOJ_XOxZ.js} +1 -1
- package/dist/assets/{gallery-page-Dm6mGwBi.js → gallery-page--AiS7R2S.js} +1 -1
- package/dist/assets/{glide-data-editor-J9CAb70d.js → glide-data-editor-FopeFe04.js} +1 -1
- package/dist/assets/{home-page-DMHnsRxm.js → home-page-DEUEDKZQ.js} +1 -1
- package/dist/assets/hooks-CsCHI0xl.js +1 -0
- package/dist/assets/index-6b4mf8Ai.css +2 -0
- package/dist/assets/index-BXheV3uz.js +30 -0
- package/dist/assets/{layout-DmcNEu3P.js → layout-CcQIAduN.js} +5 -5
- package/dist/assets/{logs-panel-ABM16htT.js → logs-panel-Cj-mRfbP.js} +1 -1
- package/dist/assets/{markdown-renderer-BG3sp2rs.js → markdown-renderer-Dg2Tj8xg.js} +1 -1
- package/dist/assets/{mermaid-a3xYymTy.js → mermaid-C4EiVqcd.js} +1 -1
- package/dist/assets/{name-cell-input-BgEBmqyL.js → name-cell-input-DhWcLBL9.js} +1 -1
- package/dist/assets/{outline-panel-DCXQ3_F6.js → outline-panel-DCCN7CCz.js} +1 -1
- package/dist/assets/{packages-panel-BMGOmZkR.js → packages-panel-cI3VRnI0.js} +1 -1
- package/dist/assets/{panel-accordion-state-C1sdPp0m.js → panel-accordion-state-CrUAB8rV.js} +1 -1
- package/dist/assets/panels-DeK2CjCU.js +4 -0
- package/dist/assets/{process-output-D0KGq04R.js → process-output-C0AVlTcL.js} +1 -1
- package/dist/assets/{readonly-code-display-Do50PHI8.js → readonly-code-display-CEGKPKlf.js} +1 -1
- package/dist/assets/{readonly-python-code-DCSMIsTX.js → readonly-python-code-kOLuuvuL.js} +1 -1
- package/dist/assets/{renderShortcut-BkVJQ_Zh.js → renderShortcut-C1JwYcqW.js} +1 -1
- package/dist/assets/{reveal-component-ltaepAqw.js → reveal-component-m_Q_Dhsa.js} +3 -3
- package/dist/assets/{run-page-DF3c5cDk.js → run-page-ZPnT0tT8.js} +1 -1
- package/dist/assets/{runtime-details-state-CSPobEdR.js → runtime-details-state-DRpKx1d7.js} +1 -1
- package/dist/assets/{schemas-Dv42wLFq.js → schemas-ChRqMOTL.js} +1 -1
- package/dist/assets/{scratchpad-panel-Dwd6W5PE.js → scratchpad-panel-4r5I7_4T.js} +1 -1
- package/dist/assets/{secrets-panel-Bctbtkrp.js → secrets-panel-D7KN4tVs.js} +1 -1
- package/dist/assets/session-panel-B-fUHivk.js +1 -0
- package/dist/assets/{snippets-panel-Bh1oTw4m.js → snippets-panel-QqliOy2l.js} +1 -1
- package/dist/assets/state-BAKG3nB6.js +3 -0
- package/dist/assets/{state-XsPO8hNi.js → state-BiuybHTd.js} +1 -1
- package/dist/assets/{terminal-Ck_vK-34.js → terminal-CP30at9D.js} +3 -3
- package/dist/assets/{tracing-Di6pUmX8.js → tracing-Cg6nJ9oa.js} +1 -1
- package/dist/assets/{tracing-panel-PeRXHD8_.js → tracing-panel-_OkwL3ST.js} +2 -2
- package/dist/assets/{tree-actions-GM5E_bUs.js → tree-actions-D5U7Yym8.js} +1 -1
- package/dist/assets/{useAddCell-GR7eEQrT.js → useAddCell-C3jdhSc9.js} +1 -1
- package/dist/assets/{useBoolean-BDD6_xQQ.js → useBoolean-BHCcNH_F.js} +1 -1
- package/dist/assets/{useCellActionButton-B-9eG5z_.js → useCellActionButton-Db-2kvJ0.js} +1 -1
- package/dist/assets/{useDeleteCell-2_bMClHd.js → useDeleteCell-D0dwhgwH.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-k3C3M18S.js → useDependencyPanelTab-BjQVPzm0.js} +1 -1
- package/dist/assets/{useInstallPackage-iX1eufdl.js → useInstallPackage-B-krIeGp.js} +1 -1
- package/dist/assets/useNotebookActions-CY_gTNzg.js +1 -0
- package/dist/assets/{useRunCells-B2vUhREg.js → useRunCells-Dyf_vzJl.js} +1 -1
- package/dist/assets/{useSplitCell-DEb03htp.js → useSplitCell-DA8ujlOv.js} +1 -1
- package/dist/assets/{useTheme-COhSHkCj.js → useTheme-n8Dj1zH7.js} +1 -1
- package/dist/assets/{vega-component-CnadTgoE.js → vega-component-CaZvZfgt.js} +1 -1
- package/dist/index.html +40 -41
- package/package.json +1 -1
- package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
- package/src/__tests__/mount.test.ts +28 -8
- package/src/components/data-table/__tests__/context-menu.test.ts +176 -0
- package/src/components/data-table/__tests__/date-filter-inputs.test.tsx +24 -1
- package/src/components/data-table/__tests__/export-actions.test.tsx +329 -6
- package/src/components/data-table/context-menu.tsx +125 -26
- package/src/components/data-table/date-filter-inputs.tsx +15 -42
- package/src/components/data-table/export-actions.tsx +192 -116
- package/src/components/data-table/schemas.ts +14 -36
- package/src/components/data-table/utils.ts +18 -0
- package/src/components/editor/Output.tsx +9 -2
- package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
- package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +186 -34
- package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
- package/src/components/editor/actions/pair-with-agent-modal.tsx +96 -36
- package/src/components/editor/chrome/panels/error-panel.tsx +1 -0
- package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +366 -0
- package/src/components/editor/chrome/wrapper/footer-item.tsx +32 -24
- package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +237 -0
- package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +537 -0
- package/src/components/editor/errors/send-error-report-button.tsx +69 -0
- package/src/components/editor/output/MarimoErrorOutput.tsx +21 -5
- package/src/components/editor/output/MarimoTracebackOutput.tsx +35 -20
- package/src/components/editor/output/__tests__/ansi-reduce.test.ts +18 -0
- package/src/components/editor/output/ansi-reduce.ts +6 -0
- package/src/core/attachments/__tests__/toast.test.tsx +58 -0
- package/src/core/attachments/state.ts +18 -0
- package/src/core/attachments/toast.ts +15 -0
- package/src/core/cells/__tests__/cells.test.ts +52 -0
- package/src/core/cells/__tests__/error-report.test.ts +139 -0
- package/src/core/cells/__tests__/session.test.ts +50 -1
- package/src/core/cells/error-report.ts +63 -0
- package/src/core/cells/session.ts +28 -1
- package/src/core/config/pair.ts +5 -3
- package/src/core/edit-app.tsx +2 -2
- package/src/core/host/AGENTS.md +5 -0
- package/src/core/host/__tests__/attachments.test.ts +57 -0
- package/src/core/host/__tests__/document.test.ts +124 -0
- package/src/core/host/__tests__/events.test.ts +46 -0
- package/src/core/host/__tests__/fixtures.ts +39 -0
- package/src/core/host/__tests__/notebook-client.test.ts +433 -0
- package/src/core/host/__tests__/stream.test.ts +211 -0
- package/src/core/host/connection.ts +81 -0
- package/src/core/host/events.ts +61 -0
- package/src/core/host/notebook-client.ts +290 -0
- package/src/core/host/resources/attachments.ts +19 -0
- package/src/core/host/resources/document.ts +101 -0
- package/src/core/host/resources/resource.ts +59 -0
- package/src/core/host/stream.ts +213 -0
- package/src/core/network/connection.ts +4 -2
- package/src/core/run-app.tsx +2 -2
- package/src/core/runtime/__tests__/runtime.test.ts +55 -11
- package/src/core/runtime/runtime.ts +15 -1
- package/src/core/runtime/types.ts +2 -0
- package/src/core/websocket/__tests__/{useMarimoKernelConnection.test.ts → connection-state.test.ts} +15 -17
- package/src/core/websocket/__tests__/{useWebSocket.test.ts → createConnectionTransport.test.ts} +1 -1
- package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +170 -0
- package/src/core/websocket/__tests__/{useMarimoKernelConnection.hook.test.tsx → useNotebookSession.hook.test.tsx} +181 -65
- package/src/core/websocket/connection-state.ts +70 -0
- package/src/core/websocket/state.ts +7 -0
- package/src/core/websocket/transports/__tests__/sse.test.ts +1 -4
- package/src/core/websocket/transports/create.ts +31 -0
- package/src/core/websocket/transports/transport.ts +12 -23
- package/src/core/websocket/types.ts +9 -39
- package/src/core/websocket/useNotebookClient.ts +88 -0
- package/src/core/websocket/{useMarimoKernelConnection.tsx → useNotebookSession.tsx} +59 -225
- package/src/mount.tsx +7 -3
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +84 -0
- package/src/utils/__tests__/dates.test.ts +116 -0
- package/src/utils/dates.ts +94 -0
- package/dist/assets/JsonOutput-D6HIIsCb.js +0 -11
- package/dist/assets/MarimoErrorOutput-D60XkCny.js +0 -6
- package/dist/assets/ai-model-dropdown-B0z6-zhp.js +0 -5
- package/dist/assets/api-BeC_VSGv.js +0 -1
- package/dist/assets/code-visibility-B-_GvwR5.js +0 -1
- package/dist/assets/coerce-CpE6kUdX.js +0 -1
- package/dist/assets/config-BOKzA3tF.js +0 -1
- package/dist/assets/config-DX8Y2WbJ.js +0 -1
- package/dist/assets/edit-page-ChcSgpke.js +0 -9
- package/dist/assets/feedback-button-B2gKC5cn.js +0 -1
- package/dist/assets/hooks-93IwHd2u.js +0 -1
- package/dist/assets/index-Bcdzex-3.css +0 -2
- package/dist/assets/index-s-M1OXjs.js +0 -29
- package/dist/assets/pair-CaQyK6En.js +0 -1
- package/dist/assets/panels-CxVG8-v2.js +0 -4
- package/dist/assets/session-panel-VdDhEBa-.js +0 -1
- package/dist/assets/state-_Qai_QyX.js +0 -3
- package/dist/assets/useNotebookActions-NHN6A-cN.js +0 -1
- package/src/core/websocket/useWebSocket.tsx +0 -88
package/src/utils/dates.ts
CHANGED
|
@@ -165,6 +165,44 @@ export function dateToLocalISOTime(d: Date): string {
|
|
|
165
165
|
return `${pad2(d.getHours())}:${pad2(d.getMinutes())}:${pad2(d.getSeconds())}`;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Parse a time string into a Date anchored at the Unix epoch day. Supports
|
|
170
|
+
* the backend's wire format (`HH:MM:SS`, as produced by `dateToLocalISOTime`)
|
|
171
|
+
* as well as looser pasted text: optional seconds, optional milliseconds,
|
|
172
|
+
* and an optional `am`/`pm` suffix (e.g. `"14:30"`, `"2:30 PM"`,
|
|
173
|
+
* `"14:30:00.123"`).
|
|
174
|
+
*/
|
|
175
|
+
export function parseTimeToDate(value: string): Date | undefined {
|
|
176
|
+
const match = /^(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\.(\d+))?\s*(am|pm)?$/i.exec(
|
|
177
|
+
value.trim(),
|
|
178
|
+
);
|
|
179
|
+
if (!match) {
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
const [, hStr, mStr, sStr, msStr, ampm] = match;
|
|
183
|
+
let hour = Number.parseInt(hStr, 10);
|
|
184
|
+
const minute = Number.parseInt(mStr, 10);
|
|
185
|
+
const second = sStr ? Number.parseInt(sStr, 10) : 0;
|
|
186
|
+
const ms = msStr ? Number.parseInt(msStr.padEnd(3, "0").slice(0, 3), 10) : 0;
|
|
187
|
+
if (minute > 59 || second > 59) {
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
if (ampm) {
|
|
191
|
+
if (hour < 1 || hour > 12) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
const isPm = ampm.toLowerCase() === "pm";
|
|
195
|
+
if (hour === 12) {
|
|
196
|
+
hour = isPm ? 12 : 0;
|
|
197
|
+
} else if (isPm) {
|
|
198
|
+
hour += 12;
|
|
199
|
+
}
|
|
200
|
+
} else if (hour > 23) {
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
return new Date(1970, 0, 1, hour, minute, second, ms);
|
|
204
|
+
}
|
|
205
|
+
|
|
168
206
|
/**
|
|
169
207
|
* Format a Date as `YYYY-MM-DDTHH:MM:SS` (no timezone suffix) using local
|
|
170
208
|
* fields. See `dateToLocalISODate` for the rationale on local vs UTC.
|
|
@@ -173,6 +211,62 @@ export function dateToLocalISODateTime(d: Date): string {
|
|
|
173
211
|
return `${dateToLocalISODate(d)}T${dateToLocalISOTime(d)}`;
|
|
174
212
|
}
|
|
175
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Parse a `YYYY-MM-DD` string into a Date anchored at local midnight.
|
|
216
|
+
*
|
|
217
|
+
* Unlike `new Date("YYYY-MM-DD")`, which the spec parses as UTC midnight,
|
|
218
|
+
* this treats the string as a calendar date in the viewer's own timezone.
|
|
219
|
+
* Returns undefined if the string doesn't match, or encodes a calendar
|
|
220
|
+
* date that doesn't exist (e.g. month 13, Feb 30), since `Date` would
|
|
221
|
+
* otherwise silently roll those over into a different date.
|
|
222
|
+
*/
|
|
223
|
+
export function parseLocalISODate(value: string): Date | undefined {
|
|
224
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value.trim());
|
|
225
|
+
if (!match) {
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
const [, yStr, mStr, dStr] = match;
|
|
229
|
+
const year = Number.parseInt(yStr, 10);
|
|
230
|
+
const month = Number.parseInt(mStr, 10);
|
|
231
|
+
const day = Number.parseInt(dStr, 10);
|
|
232
|
+
const date = new Date(year, month - 1, day);
|
|
233
|
+
if (
|
|
234
|
+
date.getFullYear() !== year ||
|
|
235
|
+
date.getMonth() !== month - 1 ||
|
|
236
|
+
date.getDate() !== day
|
|
237
|
+
) {
|
|
238
|
+
return undefined;
|
|
239
|
+
}
|
|
240
|
+
return date;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Parse an ISO-ish `YYYY-MM-DD[T ]HH:MM[:SS[.sss]][Z|+HH:MM]` datetime string
|
|
245
|
+
* as wall-clock local time, ignoring any trailing `Z` or UTC offset.
|
|
246
|
+
*
|
|
247
|
+
* This keeps pasted datetimes consistent with the date/time pickers' local-
|
|
248
|
+
* time basis: pasting `2024-01-15T08:30:00Z` displays `08:30` instead of
|
|
249
|
+
* being shifted by the viewer's timezone.
|
|
250
|
+
*/
|
|
251
|
+
export function parseLocalISODateTime(value: string): Date | undefined {
|
|
252
|
+
const match =
|
|
253
|
+
/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/.exec(
|
|
254
|
+
value.trim(),
|
|
255
|
+
);
|
|
256
|
+
if (!match) {
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
const [, yStr, moStr, dStr, hStr, miStr, sStr] = match;
|
|
260
|
+
return new Date(
|
|
261
|
+
Number.parseInt(yStr, 10),
|
|
262
|
+
Number.parseInt(moStr, 10) - 1,
|
|
263
|
+
Number.parseInt(dStr, 10),
|
|
264
|
+
Number.parseInt(hStr, 10),
|
|
265
|
+
Number.parseInt(miStr, 10),
|
|
266
|
+
sStr ? Number.parseInt(sStr, 10) : 0,
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
176
270
|
export const supportedDateFormats = ["yyyy", "yyyy-MM", "yyyy-MM-dd"] as const;
|
|
177
271
|
export type DateFormat = (typeof supportedDateFormats)[number];
|
|
178
272
|
|