@marimo-team/frontend 0.23.16-dev76 → 0.23.16-dev9
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-BalYv0pK.js → CellStatus-BwCqFeIT.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-DI7mV-Gw.js → ConnectedDataExplorerComponent-CMaZapRd.js} +1 -1
- package/dist/assets/{ErrorBoundary-C7_5jjWi.js → ErrorBoundary-DzTD8LVq.js} +1 -1
- package/dist/assets/{ImperativeModal-BIavOiUv.js → ImperativeModal-fY-ZfT0b.js} +1 -1
- package/dist/assets/JsonOutput-B0aYK7up.js +53 -0
- package/dist/assets/{LazyAnyLanguageCodeMirror-sVm_hz8A.js → LazyAnyLanguageCodeMirror-B2JvSXP-.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-DO2k2fA5.js → MarimoErrorOutput-2CXbNUBb.js} +1 -1
- package/dist/assets/{RSPContexts-CgC81f0I.js → RSPContexts-WiCgGm__.js} +1 -1
- package/dist/assets/{RenderHTML-BCvU9dYz.js → RenderHTML-uBc4LkCP.js} +1 -1
- package/dist/assets/{RunButton-BKRupqr7.js → RunButton-DLoWn_Jd.js} +1 -1
- package/dist/assets/{add-cell-with-ai-CEZtaZCK.js → add-cell-with-ai-C1L7x0xr.js} +1 -1
- package/dist/assets/{add-connection-dialog-CEp3SJR2.js → add-connection-dialog-BgQ7HuWu.js} +1 -1
- package/dist/assets/{agent-panel-By4A-Cqr.js → agent-panel-D3_CUvz_.js} +1 -1
- package/dist/assets/ai-model-dropdown-C7iiWBqP.js +5 -0
- package/dist/assets/{alert-dialog-BXegNC0I.js → alert-dialog-Bb8Lz8ko.js} +1 -1
- package/dist/assets/{any-language-editor-DCpZRrpx.js → any-language-editor--tRHs8C_.js} +1 -1
- package/dist/assets/{app-config-button-NrM9ywXA.js → app-config-button-DhmeKMjL.js} +1 -1
- package/dist/assets/{button-eIihcbUw.js → button-DDGiD1NW.js} +1 -1
- package/dist/assets/{cache-panel-wllSTlbM.js → cache-panel-DcQUeUpg.js} +1 -1
- package/dist/assets/{capabilities-B09j1Eor.js → capabilities-DoEg0XwL.js} +1 -1
- package/dist/assets/{cell-editor-DdofA9oQ.js → cell-editor-DD0zaU_N.js} +10 -10
- package/dist/assets/{cell-link-DqBkyAFe.js → cell-link-C0hhYyNu.js} +1 -1
- package/dist/assets/{cells-Cf7bHHq3.js → cells-aqfX084m.js} +6 -6
- package/dist/assets/{chat-display-BG08ltQ3.js → chat-display-DomMe89U.js} +1 -1
- package/dist/assets/{chat-panel-P2CzCtXJ.js → chat-panel-DzLbxcWT.js} +1 -1
- package/dist/assets/{chat-ui-fAJZAoTD.js → chat-ui-BpWZ6JeY.js} +1 -1
- package/dist/assets/{column-preview-BgZLUEOj.js → column-preview-D5Btj8aG.js} +1 -1
- package/dist/assets/{command-CAJLPEBq.js → command-Dqxie4gq.js} +1 -1
- package/dist/assets/{command-palette-DrI24FoL.js → command-palette-CNp7T2c5.js} +1 -1
- package/dist/assets/{common-CD6Mj8n6.js → common-BrPgvCtD.js} +1 -1
- package/dist/assets/{components-BH6gDVv6.js → components-1i9OlkxM.js} +1 -1
- package/dist/assets/{config-COUOIPEq.js → config-BJVx3eBW.js} +1 -1
- package/dist/assets/{config-BbOTTCYY.js → config-CR3KxW53.js} +1 -1
- package/dist/assets/{copy-BtTOqPTS.js → copy-Bxb1_Gtw.js} +1 -1
- package/dist/assets/{copy-icon-C2pG0ZNK.js → copy-icon-neDQUo4Q.js} +1 -1
- package/dist/assets/{createReducer-C7kZ8zEe.js → createReducer-DGx5Af-C.js} +1 -1
- package/dist/assets/{datasource-ySAiC9gr.js → datasource-wn1PTlXA.js} +1 -1
- package/dist/assets/{dates-D-kIKDYA.js → dates-C2LWzsCZ.js} +1 -1
- package/dist/assets/{dependency-graph-panel-BF23EwcD.js → dependency-graph-panel-B8Q8RQNh.js} +1 -1
- package/dist/assets/{dialog-D1DEsRZ2.js → dialog-BCVepWLJ.js} +1 -1
- package/dist/assets/{dist-ByVeMWkr.js → dist-BLN8PNJV.js} +1 -1
- package/dist/assets/dist-CiVShZKM.js +2 -0
- package/dist/assets/{documentation-panel-e9Fi9R7e.js → documentation-panel-hFyikugH.js} +1 -1
- package/dist/assets/{download-BomYt3nl.js → download-CkMUlfM3.js} +1 -1
- package/dist/assets/{dropdown-menu-BFZLnWeO.js → dropdown-menu-dHmZR8bI.js} +1 -1
- package/dist/assets/{edit-page-C37w54dQ.js → edit-page-jUsez4HZ.js} +5 -5
- package/dist/assets/{error-banner-B6eIlxzg.js → error-banner-BSxEOIn2.js} +1 -1
- package/dist/assets/{error-entries-Birw-8VX.js → error-entries-NXVkubuN.js} +1 -1
- package/dist/assets/{error-panel-DdsUL6b7.js → error-panel-DAseRhAS.js} +1 -1
- package/dist/assets/{es-1D83cgiu.js → es-gYgfF8y5.js} +1 -1
- package/dist/assets/{esm-BL7jQmzn.js → esm-B30N1GS0.js} +1 -1
- package/dist/assets/{field-BeZbVzXA.js → field-BsxD35VE.js} +1 -1
- package/dist/assets/file-explorer-panel-D7VHUIPp.js +26 -0
- package/dist/assets/{file-icons-Cb54mIL8.js → file-icons-Chripuk-.js} +1 -1
- package/dist/assets/{file-name-input-BWFcK1ey.js → file-name-input-B1NJd3KY.js} +1 -1
- package/dist/assets/{floating-outline-wz-WSRgP.js → floating-outline-BOqWJRw_.js} +1 -1
- package/dist/assets/{focus-DiEyfiAG.js → focus-tOmGbv38.js} +1 -1
- package/dist/assets/{form-CgWNb44_.js → form-CIXAzTfC.js} +1 -1
- package/dist/assets/{formats-ClEFGPy-.js → formats-DzmLpc9A.js} +1 -1
- package/dist/assets/{formatting-B_41gSF5.js → formatting-CDf6w1Kt.js} +1 -1
- package/dist/assets/{fullscreen-dUjPYOmm.js → fullscreen-CTDqNQr6.js} +1 -1
- package/dist/assets/{gallery-page-CWQQAYpa.js → gallery-page-CJ3ms1Hn.js} +1 -1
- package/dist/assets/{glide-data-editor-lMARFWHS.js → glide-data-editor-j2igs9Y_.js} +1 -1
- package/dist/assets/{home-page-DJ4jJsZj.js → home-page-DO_MqQAB.js} +1 -1
- package/dist/assets/{html-to-image-CwmX28T9.js → html-to-image-B-nAUvDC.js} +1 -1
- package/dist/assets/index-wLUfvfaV.js +38 -0
- package/dist/assets/{index-BjlEpvLC.css → index-xs-zSSrX.css} +1 -1
- package/dist/assets/{input-CqrUjynb.js → input-JxFwu-3G.js} +1 -1
- package/dist/assets/{kiosk-mode-ABm3oYgq.js → kiosk-mode-QsYGYiC8.js} +1 -1
- package/dist/assets/{label-BElwWzf0.js → label-CqjrpwRC.js} +1 -1
- package/dist/assets/{layout-BOwE7yok.js → layout-1Z2AhO6k.js} +3 -3
- package/dist/assets/{links-CToBjIIj.js → links-CZr5bjvo.js} +1 -1
- package/dist/assets/{logs-panel-iFV4ZJ9b.js → logs-panel-B6AfYQb6.js} +1 -1
- package/dist/assets/{markdown-renderer-QvXG0CRk.js → markdown-renderer-Cs1sISb9.js} +1 -1
- package/dist/assets/{menu-items-DbSLBfXR.js → menu-items-CCi6aOPm.js} +1 -1
- package/dist/assets/{mermaid-Bh0flEIb.js → mermaid-CYN0wOyG.js} +1 -1
- package/dist/assets/{name-cell-input-C6cukQ9k.js → name-cell-input-2sM8a_OS.js} +1 -1
- package/dist/assets/{numbers-CeeaFKqu.js → numbers-rmawRqQP.js} +1 -1
- package/dist/assets/{outline-panel-BPlg9_CE.js → outline-panel-BXWCkGu_.js} +1 -1
- package/dist/assets/{packages-panel-BzQF60rG.js → packages-panel-CJfHGfax.js} +1 -1
- package/dist/assets/{pair-with-agent-modal-CKOYwOYw.js → pair-with-agent-modal-C9nKHvCp.js} +1 -1
- package/dist/assets/{panels-CW-PUlv2.js → panels-Ch_sUzTx.js} +1 -1
- package/dist/assets/{popover-DrHQ3KEt.js → popover-Bcz1Zikb.js} +1 -1
- package/dist/assets/process-output-BFSCpqNt.js +1 -0
- package/dist/assets/{radio-group-CLBjGkt5.js → radio-group-PT0_zVHo.js} +1 -1
- package/dist/assets/{readonly-code-display-D63oRtBP.js → readonly-code-display-CFbCSGms.js} +1 -1
- package/dist/assets/{readonly-python-code-CW_G5e4E.js → readonly-python-code-DB23yd7T.js} +1 -1
- package/dist/assets/{renderShortcut-BZLr8D7H.js → renderShortcut-Bl8_FVn8.js} +1 -1
- package/dist/assets/{reveal-component-DqMRxmUr.js → reveal-component-fwTDxf5N.js} +57 -57
- package/dist/assets/{run-page-s6Mf8p78.js → run-page-D9-9chbw.js} +1 -1
- package/dist/assets/{runs-D51Xwrsk.js → runs-DBTXqJHS.js} +1 -1
- package/dist/assets/{scratchpad-panel-CXsxdMB-.js → scratchpad-panel-BLC2oQ_3.js} +1 -1
- package/dist/assets/{scroll-to-bottom-button-Cgr10kaJ.js → scroll-to-bottom-button-C8yfT4wq.js} +1 -1
- package/dist/assets/{secrets-panel-Cc5KDBk6.js → secrets-panel-6J6wcuVR.js} +1 -1
- package/dist/assets/{select-B5TFNjmU.js → select-BP75_5jJ.js} +1 -1
- package/dist/assets/{session-CEFnN9Cq.js → session-BmukRjSi.js} +1 -1
- package/dist/assets/{session-panel-CmHetqAb.js → session-panel-Dz-DQDeV.js} +1 -1
- package/dist/assets/{share-CYpcX4N4.js → share-852X_cqy.js} +1 -1
- package/dist/assets/{skeleton-B_4CZVEm.js → skeleton-xuR254Kw.js} +1 -1
- package/dist/assets/{snippets-panel-CXpGflMO.js → snippets-panel-DwAjNUqR.js} +1 -1
- package/dist/assets/{spec-CzqcmYQk.js → spec-C7opZZRp.js} +1 -1
- package/dist/assets/{state-BXbiRXZk.js → state-BpkJVsmT.js} +1 -1
- package/dist/assets/{state-BvdK8eiw.js → state-D10U2MwA.js} +1 -1
- package/dist/assets/{state-WBgc7MiA.js → state-DDag0B_B.js} +1 -1
- package/dist/assets/{state-DBzEQtWz.js → state-Tc7pRohh.js} +1 -1
- package/dist/assets/{strings-Djnbwmfl.js → strings--BknHX9C.js} +1 -1
- package/dist/assets/{swiper-component-DInvCxhI.js → swiper-component-Che9MNs4.js} +1 -1
- package/dist/assets/{switch-CvweaCXq.js → switch-DLGijIXN.js} +1 -1
- package/dist/assets/{terminal-D3IQBBYo.js → terminal-DaLxAnKx.js} +1 -1
- package/dist/assets/{textarea-CpFfEUet.js → textarea-aocYW9hl.js} +1 -1
- package/dist/assets/{tooltip-CFX4fYHU.js → tooltip-4bZlU7jl.js} +1 -1
- package/dist/assets/{tooltip-HLb6RxVp.js → tooltip-B7U4xkIN.js} +1 -1
- package/dist/assets/{tracing-CKn3gWHw.js → tracing-BmBBYynL.js} +1 -1
- package/dist/assets/{tracing-panel-BU-o_LCd.js → tracing-panel-AReiFUol.js} +2 -2
- package/dist/assets/{tree-actions-CsC2XmGo.js → tree-actions-Bz3fJ7p-.js} +1 -1
- package/dist/assets/{useBoolean-D89u30n-.js → useBoolean-CA7K8rap.js} +1 -1
- package/dist/assets/{useCellActionButton-CRfIEVB5.js → useCellActionButton-BG7n5b0H.js} +1 -1
- package/dist/assets/{useDeleteCell-EPH4kcG7.js → useDeleteCell-DQP-NBq2.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-CZnK7N2L.js → useDependencyPanelTab-BrkWlCTP.js} +1 -1
- package/dist/assets/useEventListener-C0195JsF.js +1 -0
- package/dist/assets/{useHotkey-DIuRH8Wu.js → useHotkey-DLZvrRZT.js} +1 -1
- package/dist/assets/{useIframeCapabilities-Ccb4fvKc.js → useIframeCapabilities-j6fR_dBA.js} +1 -1
- package/dist/assets/{useInstallPackage-BRbUAUFn.js → useInstallPackage-WiYBwhUO.js} +1 -1
- package/dist/assets/{useInterval-CC0vKpWm.js → useInterval-CWBTUy5W.js} +1 -1
- package/dist/assets/{useNotebookActions-DJKDd0gM.js → useNotebookActions-COdGI2fR.js} +1 -1
- package/dist/assets/{useRunCells-CSSF_mJ0.js → useRunCells-BtSwerrU.js} +1 -1
- package/dist/assets/{useSplitCell-9Qz93yPZ.js → useSplitCell-jH70A2Sz.js} +1 -1
- package/dist/assets/{useTheme-KXqAyDPC.js → useTheme-Bxv9B31g.js} +1 -1
- package/dist/assets/{utils-Z80SV4_d.js → utils-BWBBpCkT.js} +1 -1
- package/dist/assets/{vega-component-Cie3ag_T.js → vega-component-DSvWLXIy.js} +1 -1
- package/dist/assets/{write-secret-modal-DEEn7sZV.js → write-secret-modal-3-v-dHVj.js} +1 -1
- package/dist/index.html +67 -67
- package/package.json +1 -1
- package/src/components/data-table/column-formatting/feature.ts +2 -1
- package/src/components/editor/file-tree/__tests__/file-render-mode.test.ts +27 -0
- package/src/components/editor/file-tree/__tests__/file-viewer.test.tsx +150 -0
- package/src/components/editor/file-tree/file-preview-metadata.tsx +51 -0
- package/src/components/editor/file-tree/file-render-mode.ts +32 -0
- package/src/components/editor/file-tree/file-viewer.tsx +76 -50
- package/src/components/editor/output/CalloutOutput.tsx +17 -3
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +198 -0
- package/src/components/slides/reveal-component.tsx +3 -2
- package/src/components/slides/slide-scroll-hint.tsx +161 -0
- package/src/components/ui/input.tsx +1 -1
- package/src/core/codemirror/keymaps/__tests__/keymaps.test.ts +31 -2
- package/src/core/codemirror/keymaps/keymaps.ts +12 -0
- package/src/core/hotkeys/hotkeys.ts +0 -2
- package/src/core/i18n/__tests__/locale-provider.test.tsx +54 -118
- package/src/core/i18n/__tests__/locale.test.ts +113 -0
- package/src/core/i18n/locale-provider.tsx +1 -19
- package/src/core/i18n/locale.ts +71 -0
- package/src/core/network/types.ts +3 -1
- package/src/css/admonition.css +52 -71
- package/src/plugins/impl/FormPlugin.tsx +1 -1
- package/src/plugins/impl/__tests__/FormPlugin.test.tsx +162 -0
- package/src/plugins/layout/CalloutPlugin.tsx +8 -1
- package/src/stories/callout.stories.tsx +12 -0
- package/dist/assets/JsonOutput-DnGSkLeP.js +0 -53
- package/dist/assets/ai-model-dropdown-DXgLphFa.js +0 -5
- package/dist/assets/dist-BCMBu0rO.js +0 -2
- package/dist/assets/file-explorer-panel-DbdoJbbF.js +0 -26
- package/dist/assets/index-D73cl2ti.js +0 -38
- package/dist/assets/process-output-BEhIGfkO.js +0 -1
- package/dist/assets/useEventListener-B_w3A283.js +0 -1
- package/src/components/editor/output/CalloutOutput.styles.ts +0 -22
package/src/css/admonition.css
CHANGED
|
@@ -1,32 +1,53 @@
|
|
|
1
1
|
@reference "../css/globals.css";
|
|
2
2
|
|
|
3
|
+
/*
|
|
4
|
+
* Flat, GitHub-style admonitions.
|
|
5
|
+
*
|
|
6
|
+
* Icons are lucide (https://lucide.dev/icons/) data URIs applied as masks so
|
|
7
|
+
* they render in currentColor.
|
|
8
|
+
*/
|
|
9
|
+
|
|
3
10
|
.admonition {
|
|
4
|
-
--admonition-bg: var(--blue-2);
|
|
5
|
-
--admonition-border: var(--blue-8);
|
|
6
11
|
--admonition-heading-color: var(--blue-11);
|
|
12
|
+
--admonition-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
|
|
7
13
|
|
|
8
14
|
display: flex;
|
|
9
|
-
position: relative;
|
|
10
15
|
flex-direction: column;
|
|
11
|
-
padding: 1rem;
|
|
12
|
-
|
|
13
|
-
border-left: 4px solid;
|
|
16
|
+
padding: 0.5rem 1rem;
|
|
17
|
+
border-left: 0.25rem solid var(--admonition-heading-color);
|
|
14
18
|
margin-bottom: 1rem;
|
|
15
|
-
background-color: var(--admonition-bg);
|
|
16
|
-
border-color: var(--admonition-border);
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/* Tighten the gap between the title and body (md.css gives paragraphs a
|
|
21
|
+
1rem block margin; flex children don't collapse margins). */
|
|
22
|
+
& > .paragraph,
|
|
23
|
+
& > p {
|
|
24
|
+
margin-block: 0.375rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* The paragraph right after the title hugs it, matching callouts, whose
|
|
28
|
+
body is nested in a wrapper and gets the md.css :first-child treatment. */
|
|
29
|
+
& > .admonition-title + .paragraph,
|
|
30
|
+
& > .admonition-title + p {
|
|
31
|
+
margin-block-start: 0;
|
|
22
32
|
}
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
.admonition-title {
|
|
26
|
-
|
|
36
|
+
display: block;
|
|
37
|
+
margin-bottom: 0.25rem;
|
|
38
|
+
font-weight: 600;
|
|
27
39
|
color: var(--admonition-heading-color);
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
&::before {
|
|
42
|
+
content: "";
|
|
43
|
+
display: inline-block;
|
|
44
|
+
width: 1rem;
|
|
45
|
+
height: 1rem;
|
|
46
|
+
margin-right: 0.5rem;
|
|
47
|
+
vertical-align: -0.125rem;
|
|
48
|
+
background-color: currentcolor;
|
|
49
|
+
mask: var(--admonition-icon) no-repeat center / contain;
|
|
50
|
+
}
|
|
30
51
|
|
|
31
52
|
> .paragraph {
|
|
32
53
|
margin: 0;
|
|
@@ -38,90 +59,50 @@
|
|
|
38
59
|
}
|
|
39
60
|
}
|
|
40
61
|
|
|
41
|
-
/* Icons from https://lucide.dev/icons/ */
|
|
42
|
-
|
|
43
62
|
.admonition.info,
|
|
44
63
|
.admonition.note {
|
|
45
|
-
--admonition-bg: var(--blue-2);
|
|
46
|
-
--admonition-border: var(--blue-8);
|
|
47
64
|
--admonition-heading-color: var(--blue-11);
|
|
48
|
-
|
|
49
|
-
&::before {
|
|
50
|
-
content: light-dark(
|
|
51
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="admonition-icon lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>'),
|
|
52
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="admonition-icon lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>')
|
|
53
|
-
);
|
|
54
|
-
}
|
|
65
|
+
--admonition-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
|
|
55
66
|
}
|
|
56
67
|
|
|
57
68
|
.admonition.danger,
|
|
58
69
|
.admonition.caution,
|
|
59
70
|
.admonition.error {
|
|
60
|
-
--admonition-bg: var(--red-2);
|
|
61
|
-
--admonition-border: var(--red-8);
|
|
62
71
|
--admonition-heading-color: var(--red-11);
|
|
63
|
-
|
|
64
|
-
&::before {
|
|
65
|
-
content: light-dark(
|
|
66
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-octagon-alert"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>'),
|
|
67
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-octagon-alert"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>')
|
|
68
|
-
);
|
|
69
|
-
}
|
|
72
|
+
--admonition-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-octagon-alert"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>');
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
.admonition.attention,
|
|
73
76
|
.admonition.warning {
|
|
74
|
-
--admonition-bg: var(--yellow-2);
|
|
75
|
-
--admonition-border: var(--yellow-8);
|
|
76
77
|
--admonition-heading-color: var(--yellow-11);
|
|
77
|
-
|
|
78
|
-
&::before {
|
|
79
|
-
content: light-dark(
|
|
80
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-triangle-alert"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>'),
|
|
81
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-triangle-alert"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>')
|
|
82
|
-
);
|
|
83
|
-
}
|
|
78
|
+
--admonition-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-triangle-alert"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>');
|
|
84
79
|
}
|
|
85
80
|
|
|
86
81
|
.admonition.hint {
|
|
87
|
-
--admonition-bg: var(--gray-2);
|
|
88
|
-
--admonition-border: var(--gray-8);
|
|
89
82
|
--admonition-heading-color: var(--gray-11);
|
|
90
|
-
|
|
91
|
-
.dark & {
|
|
92
|
-
--admonition-bg: var(--gray-3);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&::before {
|
|
96
|
-
content: light-dark(
|
|
97
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>'),
|
|
98
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>')
|
|
99
|
-
);
|
|
100
|
-
}
|
|
83
|
+
--admonition-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
|
|
101
84
|
}
|
|
102
85
|
|
|
103
86
|
.admonition.important {
|
|
104
|
-
--admonition-bg: var(--cyan-2);
|
|
105
|
-
--admonition-border: var(--cyan-8);
|
|
106
87
|
--admonition-heading-color: var(--cyan-11);
|
|
88
|
+
--admonition-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square-warning"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v2"/><path d="M12 13h.01"/></svg>');
|
|
89
|
+
}
|
|
107
90
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square-warning"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v2"/><path d="M12 13h.01"/></svg>')
|
|
112
|
-
);
|
|
113
|
-
}
|
|
91
|
+
.admonition.success {
|
|
92
|
+
--admonition-heading-color: var(--grass-11);
|
|
93
|
+
--admonition-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle-check"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>');
|
|
114
94
|
}
|
|
115
95
|
|
|
116
96
|
.admonition.tip {
|
|
117
|
-
--admonition-bg: var(--grass-2);
|
|
118
|
-
--admonition-border: var(--grass-8);
|
|
119
97
|
--admonition-heading-color: var(--grass-11);
|
|
98
|
+
--admonition-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-lightbulb"><path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/></svg>');
|
|
99
|
+
}
|
|
120
100
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
101
|
+
/* Quiet, icon-less variant used by neutral callouts. */
|
|
102
|
+
.admonition.neutral {
|
|
103
|
+
--admonition-heading-color: var(--gray-11);
|
|
104
|
+
|
|
105
|
+
.admonition-title::before {
|
|
106
|
+
content: none;
|
|
126
107
|
}
|
|
127
108
|
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
4
|
+
import { describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { FormWrapper } from "../FormPlugin";
|
|
6
|
+
|
|
7
|
+
describe("FormPlugin", () => {
|
|
8
|
+
it("submits the form on Ctrl+Enter and calls setValue", async () => {
|
|
9
|
+
const setValue = vi.fn();
|
|
10
|
+
const validate = vi.fn().mockResolvedValue(null);
|
|
11
|
+
|
|
12
|
+
render(
|
|
13
|
+
<FormWrapper
|
|
14
|
+
currentValue="old-val"
|
|
15
|
+
newValue="new-val"
|
|
16
|
+
setValue={setValue}
|
|
17
|
+
validate={validate}
|
|
18
|
+
shouldValidate={false}
|
|
19
|
+
clearOnSubmit={false}
|
|
20
|
+
submitButtonLabel="Submit"
|
|
21
|
+
bordered={true}
|
|
22
|
+
loading={false}
|
|
23
|
+
submitButtonDisabled={false}
|
|
24
|
+
showClearButton={false}
|
|
25
|
+
clearButtonLabel="Clear"
|
|
26
|
+
label={null}
|
|
27
|
+
>
|
|
28
|
+
<input data-testid="input" />
|
|
29
|
+
</FormWrapper>,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const input = screen.getByTestId("input");
|
|
33
|
+
|
|
34
|
+
// Simulate Ctrl+Enter on input
|
|
35
|
+
fireEvent.keyDown(input, { key: "Enter", ctrlKey: true });
|
|
36
|
+
|
|
37
|
+
await waitFor(() => {
|
|
38
|
+
expect(setValue).toHaveBeenCalledWith("new-val");
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("submits the form on Ctrl+Enter and runs validation when shouldValidate is true", async () => {
|
|
43
|
+
const setValue = vi.fn();
|
|
44
|
+
const validate = vi.fn().mockResolvedValue("Validation failed message");
|
|
45
|
+
|
|
46
|
+
render(
|
|
47
|
+
<FormWrapper
|
|
48
|
+
currentValue="old-val"
|
|
49
|
+
newValue="new-val"
|
|
50
|
+
setValue={setValue}
|
|
51
|
+
validate={validate}
|
|
52
|
+
shouldValidate={true}
|
|
53
|
+
clearOnSubmit={false}
|
|
54
|
+
submitButtonLabel="Submit"
|
|
55
|
+
bordered={true}
|
|
56
|
+
loading={false}
|
|
57
|
+
submitButtonDisabled={false}
|
|
58
|
+
showClearButton={false}
|
|
59
|
+
clearButtonLabel="Clear"
|
|
60
|
+
label={null}
|
|
61
|
+
>
|
|
62
|
+
<input data-testid="input" />
|
|
63
|
+
</FormWrapper>,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const input = screen.getByTestId("input");
|
|
67
|
+
|
|
68
|
+
// Simulate Ctrl+Enter on input
|
|
69
|
+
fireEvent.keyDown(input, { key: "Enter", ctrlKey: true });
|
|
70
|
+
|
|
71
|
+
await waitFor(() => {
|
|
72
|
+
expect(validate).toHaveBeenCalledWith({ value: "new-val" });
|
|
73
|
+
// should not submit (setValue not called) due to validation failure
|
|
74
|
+
expect(setValue).not.toHaveBeenCalled();
|
|
75
|
+
// error message displayed
|
|
76
|
+
expect(screen.getByText("Validation failed message")).toBeInTheDocument();
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("clears inputs on submission when clearOnSubmit is true", async () => {
|
|
81
|
+
const setValue = vi.fn();
|
|
82
|
+
const validate = vi.fn().mockResolvedValue(null);
|
|
83
|
+
|
|
84
|
+
let mockUIElement: (HTMLElement & { reset?: () => void }) | null = null;
|
|
85
|
+
const mockReset = vi.fn();
|
|
86
|
+
|
|
87
|
+
render(
|
|
88
|
+
<FormWrapper
|
|
89
|
+
currentValue="old-val"
|
|
90
|
+
newValue="new-val"
|
|
91
|
+
setValue={setValue}
|
|
92
|
+
validate={validate}
|
|
93
|
+
shouldValidate={false}
|
|
94
|
+
clearOnSubmit={true}
|
|
95
|
+
submitButtonLabel="Submit"
|
|
96
|
+
bordered={true}
|
|
97
|
+
loading={false}
|
|
98
|
+
submitButtonDisabled={false}
|
|
99
|
+
showClearButton={false}
|
|
100
|
+
clearButtonLabel="Clear"
|
|
101
|
+
label={null}
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
ref={(el) => {
|
|
105
|
+
if (el && !mockUIElement) {
|
|
106
|
+
mockUIElement = document.createElement("marimo-ui-element");
|
|
107
|
+
mockUIElement.setAttribute("data-testid", "mock-ui-element");
|
|
108
|
+
mockUIElement.reset = mockReset;
|
|
109
|
+
const inputEl = document.createElement("input");
|
|
110
|
+
inputEl.type = "text";
|
|
111
|
+
mockUIElement.appendChild(inputEl);
|
|
112
|
+
el.appendChild(mockUIElement);
|
|
113
|
+
}
|
|
114
|
+
}}
|
|
115
|
+
/>
|
|
116
|
+
</FormWrapper>,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const input = screen.getByRole("textbox");
|
|
120
|
+
|
|
121
|
+
// Simulate Ctrl+Enter on input
|
|
122
|
+
fireEvent.keyDown(input, { key: "Enter", ctrlKey: true });
|
|
123
|
+
|
|
124
|
+
await waitFor(() => {
|
|
125
|
+
expect(setValue).toHaveBeenCalledWith("new-val");
|
|
126
|
+
expect(mockReset).toHaveBeenCalled();
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("does not submit on Shift+Enter", async () => {
|
|
131
|
+
const setValue = vi.fn();
|
|
132
|
+
const validate = vi.fn().mockResolvedValue(null);
|
|
133
|
+
|
|
134
|
+
render(
|
|
135
|
+
<FormWrapper
|
|
136
|
+
currentValue="old-val"
|
|
137
|
+
newValue="new-val"
|
|
138
|
+
setValue={setValue}
|
|
139
|
+
validate={validate}
|
|
140
|
+
shouldValidate={false}
|
|
141
|
+
clearOnSubmit={false}
|
|
142
|
+
submitButtonLabel="Submit"
|
|
143
|
+
bordered={true}
|
|
144
|
+
loading={false}
|
|
145
|
+
submitButtonDisabled={false}
|
|
146
|
+
showClearButton={false}
|
|
147
|
+
clearButtonLabel="Clear"
|
|
148
|
+
label={null}
|
|
149
|
+
>
|
|
150
|
+
<input data-testid="input" />
|
|
151
|
+
</FormWrapper>,
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
const input = screen.getByTestId("input");
|
|
155
|
+
|
|
156
|
+
// Simulate Shift+Enter on input
|
|
157
|
+
fireEvent.keyDown(input, { key: "Enter", shiftKey: true });
|
|
158
|
+
|
|
159
|
+
expect(setValue).not.toHaveBeenCalled();
|
|
160
|
+
expect(validate).not.toHaveBeenCalled();
|
|
161
|
+
});
|
|
162
|
+
});
|
|
@@ -18,6 +18,10 @@ interface Data {
|
|
|
18
18
|
* The kind of callout
|
|
19
19
|
*/
|
|
20
20
|
kind: Intent;
|
|
21
|
+
/**
|
|
22
|
+
* An optional bold title line
|
|
23
|
+
*/
|
|
24
|
+
title?: string;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export class CalloutPlugin implements IStatelessPlugin<Data> {
|
|
@@ -26,9 +30,12 @@ export class CalloutPlugin implements IStatelessPlugin<Data> {
|
|
|
26
30
|
validator = z.object({
|
|
27
31
|
html: z.string(),
|
|
28
32
|
kind: zodIntent,
|
|
33
|
+
title: z.string().optional(),
|
|
29
34
|
});
|
|
30
35
|
|
|
31
36
|
render({ data }: IStatelessPluginProps<Data>): JSX.Element {
|
|
32
|
-
return
|
|
37
|
+
return (
|
|
38
|
+
<CalloutOutput html={data.html} kind={data.kind} title={data.title} />
|
|
39
|
+
);
|
|
33
40
|
}
|
|
34
41
|
}
|
|
@@ -71,3 +71,15 @@ export const Success = {
|
|
|
71
71
|
|
|
72
72
|
name: "success",
|
|
73
73
|
};
|
|
74
|
+
|
|
75
|
+
export const WithTitle = {
|
|
76
|
+
render: () => (
|
|
77
|
+
<CalloutOutput
|
|
78
|
+
html="<p>CalloutOutput with a title and <strong>HTML</strong></p>"
|
|
79
|
+
kind="warn"
|
|
80
|
+
title="Watch out"
|
|
81
|
+
/>
|
|
82
|
+
),
|
|
83
|
+
|
|
84
|
+
name: "with title",
|
|
85
|
+
};
|