@marimo-team/frontend 0.19.3-dev21 → 0.19.3-dev22
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/edit-page-B_1t5Bc7.js +12 -0
- package/dist/assets/{index-DXLkhAK3.js → index-BAs_XOh8.js} +2 -2
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +150 -96
- package/dist/assets/edit-page-CgVMZsLj.js +0 -12
package/dist/index.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
67
67
|
<!-- /TODO -->
|
|
68
68
|
<title>{{ title }}</title>
|
|
69
|
-
<script type="module" crossorigin src="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-BAs_XOh8.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-BW0IMuFq.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/hotkeys-uKX61F1_.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/defaultLocale-BLUna9fQ.js">
|
package/package.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ChevronDownIcon,
|
|
5
|
+
ExternalLinkIcon,
|
|
6
|
+
InfoIcon,
|
|
5
7
|
PowerOffIcon,
|
|
6
8
|
ZapIcon,
|
|
7
9
|
ZapOffIcon,
|
|
@@ -15,7 +17,9 @@ import {
|
|
|
15
17
|
DropdownMenuSeparator,
|
|
16
18
|
DropdownMenuTrigger,
|
|
17
19
|
} from "@/components/ui/dropdown-menu";
|
|
20
|
+
import { ExternalLink } from "@/components/ui/links";
|
|
18
21
|
import { Switch } from "@/components/ui/switch";
|
|
22
|
+
import { Tooltip, TooltipProvider } from "@/components/ui/tooltip";
|
|
19
23
|
import { useResolvedMarimoConfig } from "@/core/config/config";
|
|
20
24
|
import { useRequestClient } from "@/core/network/requests";
|
|
21
25
|
import { isWasm } from "@/core/wasm/utils";
|
|
@@ -99,117 +103,167 @@ export const RuntimeSettings: React.FC<RuntimeSettingsProps> = ({
|
|
|
99
103
|
</FooterItem>
|
|
100
104
|
</DropdownMenuTrigger>
|
|
101
105
|
<DropdownMenuContent align="start" className="w-64">
|
|
102
|
-
<DropdownMenuLabel>
|
|
106
|
+
<DropdownMenuLabel>
|
|
107
|
+
<div className="flex items-center justify-between w-full">
|
|
108
|
+
<span>Runtime reactivity</span>
|
|
109
|
+
<ExternalLink href="https://links.marimo.app/runtime-configuration">
|
|
110
|
+
<span className="text-xs font-normal flex items-center gap-1">
|
|
111
|
+
Docs
|
|
112
|
+
<ExternalLinkIcon className="w-3 h-3" />
|
|
113
|
+
</span>
|
|
114
|
+
</ExternalLink>
|
|
115
|
+
</div>
|
|
116
|
+
</DropdownMenuLabel>
|
|
103
117
|
<DropdownMenuSeparator />
|
|
104
118
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
<
|
|
108
|
-
<div className="flex items-center
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
<div
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
<TooltipProvider>
|
|
120
|
+
{/* On startup toggle */}
|
|
121
|
+
<DisableIfOverridden name="runtime.auto_instantiate">
|
|
122
|
+
<div className="flex items-center justify-between px-2 py-2">
|
|
123
|
+
<div className="flex items-center space-x-2">
|
|
124
|
+
{config.runtime.auto_instantiate ? (
|
|
125
|
+
<ZapIcon size={14} className="text-amber-500" />
|
|
126
|
+
) : (
|
|
127
|
+
<ZapOffIcon size={14} className="text-muted-foreground" />
|
|
128
|
+
)}
|
|
129
|
+
<div>
|
|
130
|
+
<div className="text-sm font-medium flex items-center gap-1">
|
|
131
|
+
On startup
|
|
132
|
+
<Tooltip
|
|
133
|
+
content={
|
|
134
|
+
<div className="max-w-[200px]">
|
|
135
|
+
Whether to automatically run the notebook on startup
|
|
136
|
+
</div>
|
|
137
|
+
}
|
|
138
|
+
>
|
|
139
|
+
<InfoIcon className="w-3 h-3" />
|
|
140
|
+
</Tooltip>
|
|
141
|
+
</div>
|
|
142
|
+
<div className="text-xs text-muted-foreground">
|
|
143
|
+
{config.runtime.auto_instantiate ? "autorun" : "lazy"}
|
|
144
|
+
</div>
|
|
118
145
|
</div>
|
|
119
146
|
</div>
|
|
147
|
+
<Switch
|
|
148
|
+
checked={config.runtime.auto_instantiate}
|
|
149
|
+
onCheckedChange={handleStartupToggle}
|
|
150
|
+
size="sm"
|
|
151
|
+
/>
|
|
120
152
|
</div>
|
|
121
|
-
|
|
122
|
-
checked={config.runtime.auto_instantiate}
|
|
123
|
-
onCheckedChange={handleStartupToggle}
|
|
124
|
-
size="sm"
|
|
125
|
-
/>
|
|
126
|
-
</div>
|
|
127
|
-
</DisableIfOverridden>
|
|
153
|
+
</DisableIfOverridden>
|
|
128
154
|
|
|
129
|
-
|
|
155
|
+
<DropdownMenuSeparator />
|
|
130
156
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
157
|
+
{/* On cell change toggle */}
|
|
158
|
+
<DisableIfOverridden name="runtime.on_cell_change">
|
|
159
|
+
<div className="flex items-center justify-between px-2 py-2">
|
|
160
|
+
<div className="flex items-center space-x-2">
|
|
161
|
+
{config.runtime.on_cell_change === "autorun" ? (
|
|
162
|
+
<ZapIcon size={14} className="text-amber-500" />
|
|
163
|
+
) : (
|
|
164
|
+
<ZapOffIcon size={14} className="text-muted-foreground" />
|
|
165
|
+
)}
|
|
166
|
+
<div>
|
|
167
|
+
<div className="text-sm font-medium flex items-center gap-1">
|
|
168
|
+
On cell change
|
|
169
|
+
<Tooltip
|
|
170
|
+
content={
|
|
171
|
+
<div className="max-w-[300px]">
|
|
172
|
+
Whether to automatically run dependent cells after
|
|
173
|
+
running a cell
|
|
174
|
+
</div>
|
|
175
|
+
}
|
|
176
|
+
>
|
|
177
|
+
<InfoIcon className="w-3 h-3" />
|
|
178
|
+
</Tooltip>
|
|
179
|
+
</div>
|
|
180
|
+
<div className="text-xs text-muted-foreground">
|
|
181
|
+
{config.runtime.on_cell_change}
|
|
182
|
+
</div>
|
|
144
183
|
</div>
|
|
145
184
|
</div>
|
|
185
|
+
<Switch
|
|
186
|
+
checked={config.runtime.on_cell_change === "autorun"}
|
|
187
|
+
onCheckedChange={handleCellChangeToggle}
|
|
188
|
+
size="sm"
|
|
189
|
+
/>
|
|
146
190
|
</div>
|
|
147
|
-
|
|
148
|
-
checked={config.runtime.on_cell_change === "autorun"}
|
|
149
|
-
onCheckedChange={handleCellChangeToggle}
|
|
150
|
-
size="sm"
|
|
151
|
-
/>
|
|
152
|
-
</div>
|
|
153
|
-
</DisableIfOverridden>
|
|
191
|
+
</DisableIfOverridden>
|
|
154
192
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
193
|
+
{!isWasm() && (
|
|
194
|
+
<>
|
|
195
|
+
<DropdownMenuSeparator />
|
|
158
196
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
197
|
+
{/* On module change dropdown */}
|
|
198
|
+
<DisableIfOverridden name="runtime.auto_reload">
|
|
199
|
+
<div className="px-2 py-1">
|
|
200
|
+
<div className="flex items-center space-x-2 mb-2">
|
|
201
|
+
{config.runtime.auto_reload === "off" && (
|
|
202
|
+
<PowerOffIcon
|
|
203
|
+
size={14}
|
|
204
|
+
className="text-muted-foreground"
|
|
205
|
+
/>
|
|
206
|
+
)}
|
|
207
|
+
{config.runtime.auto_reload === "lazy" && (
|
|
208
|
+
<ZapOffIcon size={14} className="text-muted-foreground" />
|
|
209
|
+
)}
|
|
210
|
+
{config.runtime.auto_reload === "autorun" && (
|
|
211
|
+
<ZapIcon size={14} className="text-amber-500" />
|
|
212
|
+
)}
|
|
213
|
+
<div>
|
|
214
|
+
<div className="text-sm font-medium flex items-center gap-1">
|
|
215
|
+
On module change
|
|
216
|
+
<Tooltip
|
|
217
|
+
content={
|
|
218
|
+
<div className="max-w-[300px]">
|
|
219
|
+
Whether to run affected cells, mark them as stale,
|
|
220
|
+
or do nothing when an external module is updated
|
|
221
|
+
</div>
|
|
222
|
+
}
|
|
223
|
+
>
|
|
224
|
+
<InfoIcon className="w-3 h-3" />
|
|
225
|
+
</Tooltip>
|
|
226
|
+
</div>
|
|
227
|
+
<div className="text-xs text-muted-foreground">
|
|
228
|
+
{config.runtime.auto_reload}
|
|
229
|
+
</div>
|
|
176
230
|
</div>
|
|
177
231
|
</div>
|
|
232
|
+
<div className="space-y-1">
|
|
233
|
+
{["off", "lazy", "autorun"].map((option) => (
|
|
234
|
+
<button
|
|
235
|
+
key={option}
|
|
236
|
+
onClick={() =>
|
|
237
|
+
handleModuleReloadChange(
|
|
238
|
+
option as "off" | "lazy" | "autorun",
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
className={cn(
|
|
242
|
+
"w-full flex items-center px-2 py-1 text-sm rounded hover:bg-accent",
|
|
243
|
+
option === config.runtime.auto_reload && "bg-accent",
|
|
244
|
+
)}
|
|
245
|
+
>
|
|
246
|
+
{option === "off" && (
|
|
247
|
+
<PowerOffIcon size={12} className="mr-2" />
|
|
248
|
+
)}
|
|
249
|
+
{option === "lazy" && (
|
|
250
|
+
<ZapOffIcon size={12} className="mr-2" />
|
|
251
|
+
)}
|
|
252
|
+
{option === "autorun" && (
|
|
253
|
+
<ZapIcon size={12} className="mr-2" />
|
|
254
|
+
)}
|
|
255
|
+
<span className="capitalize">{option}</span>
|
|
256
|
+
{option === config.runtime.auto_reload && (
|
|
257
|
+
<span className="ml-auto">✓</span>
|
|
258
|
+
)}
|
|
259
|
+
</button>
|
|
260
|
+
))}
|
|
261
|
+
</div>
|
|
178
262
|
</div>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
onClick={() =>
|
|
184
|
-
handleModuleReloadChange(
|
|
185
|
-
option as "off" | "lazy" | "autorun",
|
|
186
|
-
)
|
|
187
|
-
}
|
|
188
|
-
className={cn(
|
|
189
|
-
"w-full flex items-center px-2 py-1 text-sm rounded hover:bg-accent",
|
|
190
|
-
option === config.runtime.auto_reload && "bg-accent",
|
|
191
|
-
)}
|
|
192
|
-
>
|
|
193
|
-
{option === "off" && (
|
|
194
|
-
<PowerOffIcon size={12} className="mr-2" />
|
|
195
|
-
)}
|
|
196
|
-
{option === "lazy" && (
|
|
197
|
-
<ZapOffIcon size={12} className="mr-2" />
|
|
198
|
-
)}
|
|
199
|
-
{option === "autorun" && (
|
|
200
|
-
<ZapIcon size={12} className="mr-2" />
|
|
201
|
-
)}
|
|
202
|
-
<span className="capitalize">{option}</span>
|
|
203
|
-
{option === config.runtime.auto_reload && (
|
|
204
|
-
<span className="ml-auto">✓</span>
|
|
205
|
-
)}
|
|
206
|
-
</button>
|
|
207
|
-
))}
|
|
208
|
-
</div>
|
|
209
|
-
</div>
|
|
210
|
-
</DisableIfOverridden>
|
|
211
|
-
</>
|
|
212
|
-
)}
|
|
263
|
+
</DisableIfOverridden>
|
|
264
|
+
</>
|
|
265
|
+
)}
|
|
266
|
+
</TooltipProvider>
|
|
213
267
|
</DropdownMenuContent>
|
|
214
268
|
</DropdownMenu>
|
|
215
269
|
);
|