@marimo-team/islands 0.23.17-dev3 → 0.23.17-dev30
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/{ConnectedDataExplorerComponent-f9vLjQiF.js → ConnectedDataExplorerComponent-BEb8RZam.js} +13 -13
- package/dist/{ErrorBoundary-DhLqwSWA.js → ErrorBoundary-8ZHte0h9.js} +3 -3
- package/dist/{ImageComparisonComponent-C3y7L3eJ.js → ImageComparisonComponent-fdY0LUuf.js} +38 -27
- package/dist/{any-language-editor-DifE-fl7.js → any-language-editor-CioNaP-T.js} +5 -5
- package/dist/{button-BSm8IXRU.js → button-8aS1QcHr.js} +4 -2
- package/dist/{capabilities-C6OQ5YBO.js → capabilities-D23lgbH_.js} +1 -1
- package/dist/{chat-ui-DsZJj75A.js → chat-ui-CnjFz0bt.js} +16 -16
- package/dist/{check-DP7U0H0G.js → check-CCvJTB2E.js} +1 -1
- package/dist/{common-D747zlkP.js → common-BxnkCaMd.js} +21 -21
- package/dist/{copy-DNq8q3zw.js → copy-D45ZUY3j.js} +2 -2
- package/dist/{dist-DIlxLFXG.js → dist-DgzzIPS4.js} +2 -2
- package/dist/{error-banner-B_GQfxxD.js → error-banner-DHfPl1w3.js} +2 -2
- package/dist/{esm-DzZVaNH4.js → esm-DJsE6wi-.js} +1 -1
- package/dist/{extends-w2_S44bV.js → extends-xQ_2Cylt.js} +4 -4
- package/dist/{formats-Dwq1THhr.js → formats-D10vOEsT.js} +3 -3
- package/dist/{glide-data-editor-B9K6-MJe.js → glide-data-editor-FiwJJzrV.js} +9 -9
- package/dist/{html-to-image-CZ1kLKkq.js → html-to-image-B8KJvlou.js} +2111 -2105
- package/dist/{input-C5K4VBvB.js → input-DtTqU0xh.js} +6 -6
- package/dist/{label-DjoYwqmj.js → label-5IC840tS.js} +2 -2
- package/dist/{loader-DX-IDS7n.js → loader-DP2JkPth.js} +1 -1
- package/dist/main.js +47 -44
- package/dist/{mermaid-hv6IckVw.js → mermaid-BNhC-PrB.js} +5 -5
- package/dist/{process-output-bVfbcx5_.js → process-output-CjS9wS4l.js} +3 -3
- package/dist/{reveal-component-CcSMtt1K.js → reveal-component-D8ttQmaR.js} +11 -11
- package/dist/{spec-CQKL_D3i.js → spec-C7rMyZ_8.js} +4 -4
- package/dist/{strings-DIy9NAmg.js → strings-CITcoFNY.js} +4 -4
- package/dist/style.css +1 -1
- package/dist/{swiper-component-CEdAYjb7.js → swiper-component-dl1H9WIW.js} +2 -2
- package/dist/{toDate-CqhBWjvO.js → toDate-kxcuDOWd.js} +3 -3
- package/dist/{tooltip-f-qR0iUx.js → tooltip-BkSv4x8S.js} +3 -3
- package/dist/{types-DicH9Oi0.js → types-kNUyqkDD.js} +1 -1
- package/dist/{useAsyncData-CYOQb1EW.js → useAsyncData-Uo4VFafD.js} +1 -1
- package/dist/{useDateFormatter-Bt2qr_XS.js → useDateFormatter-ZCfHadYP.js} +2 -2
- package/dist/{useDeepCompareMemoize-CSHQeQEI.js → useDeepCompareMemoize-s3ZvmdK3.js} +1 -1
- package/dist/{useIframeCapabilities-kA09ykNq.js → useIframeCapabilities-pLC-ceDP.js} +1 -1
- package/dist/{useLifecycle-CMJGqBaY.js → useLifecycle-CLPBATCv.js} +3 -3
- package/dist/{useTheme-DYfby65G.js → useTheme-CEMsu1Js.js} +2 -2
- package/dist/{vega-component-C7nO5zcf.js → vega-component-DGkcoXu3.js} +10 -10
- package/dist/{zod-BUcyXSdR.js → zod-DdNi9290.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +5 -0
- package/src/components/databases/icons/huggingface.svg +8 -0
- package/src/components/editor/actions/export-dialog/__tests__/export-dialog.test.tsx +35 -0
- package/src/components/editor/actions/export-dialog/__tests__/state.test.ts +61 -0
- package/src/components/editor/actions/export-dialog/export-dialog.tsx +27 -23
- package/src/components/editor/actions/export-dialog/format-notice.tsx +28 -0
- package/src/components/editor/actions/export-dialog/state.ts +23 -5
- package/src/components/editor/actions/export-dialog/use-export-dialog.ts +7 -15
- package/src/components/editor/chrome/panels/outline/__tests__/useActiveOutline.test.ts +26 -0
- package/src/components/editor/code/__tests__/readonly-python-code.test.tsx +114 -2
- package/src/components/editor/connections/storage/__tests__/__snapshots__/as-code.test.ts.snap +14 -0
- package/src/components/editor/connections/storage/__tests__/as-code.test.ts +20 -0
- package/src/components/editor/connections/storage/add-storage-form.tsx +10 -0
- package/src/components/editor/connections/storage/as-code.ts +19 -1
- package/src/components/editor/connections/storage/schemas.ts +19 -0
- package/src/components/storage/__tests__/storage-snippets.test.ts +88 -0
- package/src/components/storage/components.tsx +2 -0
- package/src/components/storage/storage-snippets.ts +58 -0
- package/src/core/__tests__/mode.test.ts +85 -0
- package/src/core/codemirror/code-lens/__tests__/extension.test.ts +2 -7
- package/src/core/codemirror/code-lens/extension.ts +0 -4
- package/src/core/codemirror/find-replace/search-highlight.ts +8 -3
- package/src/core/codemirror/theme/__tests__/light.test.ts +59 -123
- package/src/core/codemirror/theme/dark.ts +6 -5
- package/src/core/codemirror/theme/light.ts +6 -4
- package/src/core/config/feature-flag.tsx +0 -2
- package/src/core/dom/outline.ts +25 -2
- package/src/core/hotkeys/hotkeys.ts +2 -0
- package/src/core/mode.ts +11 -9
- package/src/core/network/__tests__/requests-lazy.test.ts +1 -0
- package/src/core/storage/types.ts +1 -0
- package/src/css/app/codemirror.css +11 -7
- package/src/css/globals.css +8 -0
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +20 -1
- package/src/plugins/impl/image-comparison/__tests__/ImageComparisonComponent.test.tsx +58 -0
- package/src/stories/theme.stories.tsx +71 -1
|
@@ -4,11 +4,14 @@ import { python } from "@codemirror/lang-python";
|
|
|
4
4
|
import { EditorState, type Extension } from "@codemirror/state";
|
|
5
5
|
import { EditorView } from "@codemirror/view";
|
|
6
6
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
7
|
-
import React, { useEffect, useRef } from "react";
|
|
7
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
8
|
+
import { ReadonlyCode } from "../components/editor/code/readonly-python-code";
|
|
8
9
|
import { basicBundle, type CodeMirrorSetupOpts } from "../core/codemirror/cm";
|
|
10
|
+
import { userConfigAtom } from "../core/config/config";
|
|
9
11
|
import { darkTheme } from "../core/codemirror/theme/dark";
|
|
10
12
|
import { lightTheme } from "../core/codemirror/theme/light";
|
|
11
13
|
import { OverridingHotkeyProvider } from "../core/hotkeys/hotkeys";
|
|
14
|
+
import { store } from "../core/state/jotai";
|
|
12
15
|
|
|
13
16
|
// Partial config for storybook demo
|
|
14
17
|
const demoConfig: Partial<CodeMirrorSetupOpts> = {
|
|
@@ -52,6 +55,11 @@ result = example.get_value()
|
|
|
52
55
|
size = example.data_size
|
|
53
56
|
`.trim();
|
|
54
57
|
|
|
58
|
+
const READONLY_CONTENT = Array.from(
|
|
59
|
+
{ length: 80 },
|
|
60
|
+
(_, index) => `value_${index + 1} = ${index + 1}`,
|
|
61
|
+
).join("\n");
|
|
62
|
+
|
|
55
63
|
const Editor = (opts: { extensions?: Extension[] }): React.ReactNode => {
|
|
56
64
|
const ref = useRef<HTMLDivElement>(null);
|
|
57
65
|
useEffect(() => {
|
|
@@ -110,3 +118,65 @@ export const ThemeComparison: Story = {
|
|
|
110
118
|
</div>
|
|
111
119
|
),
|
|
112
120
|
};
|
|
121
|
+
|
|
122
|
+
const ReadonlyCodeThemeFixture = (): React.ReactNode => {
|
|
123
|
+
const [theme, setTheme] = useState<"light" | "dark">("light");
|
|
124
|
+
const [initialTheme] = useState(
|
|
125
|
+
() => store.get(userConfigAtom).display.theme,
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
store.set(userConfigAtom, (config) => ({
|
|
130
|
+
...config,
|
|
131
|
+
display: { ...config.display, theme },
|
|
132
|
+
}));
|
|
133
|
+
}, [theme]);
|
|
134
|
+
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
// Leave Storybook's theme in the state it had before this fixture mounted.
|
|
137
|
+
return () => {
|
|
138
|
+
store.set(userConfigAtom, (config) => ({
|
|
139
|
+
...config,
|
|
140
|
+
display: { ...config.display, theme: initialTheme },
|
|
141
|
+
}));
|
|
142
|
+
};
|
|
143
|
+
}, [initialTheme]);
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<div className="max-w-3xl space-y-3" style={{ colorScheme: theme }}>
|
|
147
|
+
<div className="flex items-center justify-between gap-4">
|
|
148
|
+
<div>
|
|
149
|
+
<h3 className="text-lg font-semibold">ReadonlyCode fixture</h3>
|
|
150
|
+
<p className="text-sm text-muted-foreground">
|
|
151
|
+
Select text, scroll, then switch themes to check that both remain.
|
|
152
|
+
</p>
|
|
153
|
+
</div>
|
|
154
|
+
<div className="flex gap-2" role="group" aria-label="Theme">
|
|
155
|
+
{(["light", "dark"] as const).map((nextTheme) => (
|
|
156
|
+
<button
|
|
157
|
+
aria-pressed={theme === nextTheme}
|
|
158
|
+
className="rounded border px-3 py-1 text-sm"
|
|
159
|
+
key={nextTheme}
|
|
160
|
+
onClick={() => setTheme(nextTheme)}
|
|
161
|
+
type="button"
|
|
162
|
+
>
|
|
163
|
+
{nextTheme}
|
|
164
|
+
</button>
|
|
165
|
+
))}
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
<div className="h-64 overflow-hidden rounded border">
|
|
169
|
+
<ReadonlyCode
|
|
170
|
+
className="h-full [&_.cm-editor]:h-full [&_.cm-scroller]:h-full [&_.cm-theme-none]:h-full"
|
|
171
|
+
code={READONLY_CONTENT}
|
|
172
|
+
showCopyCode={false}
|
|
173
|
+
showHideCode={false}
|
|
174
|
+
/>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export const ReadonlyCodeThemeReconfiguration: Story = {
|
|
181
|
+
render: () => <ReadonlyCodeThemeFixture />,
|
|
182
|
+
};
|