@gradio/core 0.17.0 → 0.18.0
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/CHANGELOG.md +7 -0
- package/dist/src/Blocks.svelte +69 -2
- package/dist/src/api_docs/Settings.svelte +74 -1
- package/dist/src/api_docs/Settings.svelte.d.ts +3 -0
- package/dist/src/api_docs/img/record-stop.svg +1 -0
- package/dist/src/api_docs/img/record.svg +1 -0
- package/dist/src/init.js +7 -3
- package/dist/src/lang/en.json +4 -0
- package/dist/src/screen_recorder.d.ts +16 -0
- package/dist/src/screen_recorder.js +255 -0
- package/package.json +23 -23
- package/src/Blocks.svelte +79 -3
- package/src/api_docs/Settings.svelte +77 -1
- package/src/api_docs/img/record-stop.svg +1 -0
- package/src/api_docs/img/record.svg +1 -0
- package/src/init.ts +7 -6
- package/src/lang/en.json +4 -0
- package/src/screen_recorder.ts +361 -0
package/package.json
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@gradio/accordion": "^0.5.15",
|
|
7
7
|
"@gradio/annotatedimage": "^0.9.19",
|
|
8
|
+
"@gradio/box": "^0.2.19",
|
|
8
9
|
"@gradio/atoms": "^0.16.1",
|
|
9
10
|
"@gradio/audio": "^0.17.14",
|
|
10
|
-
"@gradio/box": "^0.2.19",
|
|
11
|
-
"@gradio/chatbot": "^0.26.7",
|
|
12
11
|
"@gradio/button": "^0.5.0",
|
|
13
|
-
"@gradio/checkboxgroup": "^0.6.21",
|
|
14
|
-
"@gradio/client": "^1.15.0",
|
|
15
12
|
"@gradio/checkbox": "^0.4.21",
|
|
13
|
+
"@gradio/checkboxgroup": "^0.6.21",
|
|
14
|
+
"@gradio/chatbot": "^0.26.8",
|
|
16
15
|
"@gradio/code": "^0.14.4",
|
|
16
|
+
"@gradio/client": "^1.15.0",
|
|
17
17
|
"@gradio/colorpicker": "^0.4.21",
|
|
18
18
|
"@gradio/column": "^0.2.0",
|
|
19
19
|
"@gradio/dataframe": "^0.17.12",
|
|
20
20
|
"@gradio/dataset": "^0.4.19",
|
|
21
|
-
"@gradio/datetime": "^0.3.13",
|
|
22
21
|
"@gradio/downloadbutton": "^0.4.0",
|
|
22
|
+
"@gradio/datetime": "^0.3.13",
|
|
23
23
|
"@gradio/dropdown": "^0.9.21",
|
|
24
|
-
"@gradio/file": "^0.12.18",
|
|
25
|
-
"@gradio/form": "^0.2.19",
|
|
26
24
|
"@gradio/fallback": "^0.4.21",
|
|
25
|
+
"@gradio/file": "^0.12.18",
|
|
27
26
|
"@gradio/fileexplorer": "^0.5.29",
|
|
28
|
-
"@gradio/
|
|
27
|
+
"@gradio/form": "^0.2.19",
|
|
29
28
|
"@gradio/gallery": "^0.15.19",
|
|
30
|
-
"@gradio/html": "^0.6.13",
|
|
31
29
|
"@gradio/group": "^0.2.0",
|
|
30
|
+
"@gradio/html": "^0.6.13",
|
|
31
|
+
"@gradio/highlightedtext": "^0.9.4",
|
|
32
32
|
"@gradio/icons": "^0.12.0",
|
|
33
33
|
"@gradio/image": "^0.22.6",
|
|
34
|
-
"@gradio/imageeditor": "^0.15.0",
|
|
35
34
|
"@gradio/imageslider": "^0.2.2",
|
|
36
35
|
"@gradio/label": "^0.5.13",
|
|
37
|
-
"@gradio/
|
|
36
|
+
"@gradio/imageeditor": "^0.15.0",
|
|
38
37
|
"@gradio/browserstate": "^0.3.2",
|
|
39
|
-
"@gradio/
|
|
38
|
+
"@gradio/json": "^0.5.23",
|
|
39
|
+
"@gradio/model3d": "^0.14.14",
|
|
40
40
|
"@gradio/multimodaltextbox": "^0.10.6",
|
|
41
|
-
"@gradio/
|
|
42
|
-
"@gradio/paramviewer": "^0.7.9",
|
|
41
|
+
"@gradio/markdown": "^0.13.13",
|
|
43
42
|
"@gradio/number": "^0.5.21",
|
|
44
|
-
"@gradio/
|
|
43
|
+
"@gradio/nativeplot": "^0.5.16",
|
|
45
44
|
"@gradio/plot": "^0.9.16",
|
|
45
|
+
"@gradio/paramviewer": "^0.7.9",
|
|
46
46
|
"@gradio/radio": "^0.7.4",
|
|
47
|
-
"@gradio/row": "^0.2.1",
|
|
48
47
|
"@gradio/sidebar": "^0.1.13",
|
|
48
|
+
"@gradio/row": "^0.2.1",
|
|
49
49
|
"@gradio/simpledropdown": "^0.3.21",
|
|
50
|
-
"@gradio/sketchbox": "^0.6.8",
|
|
51
50
|
"@gradio/simpletextbox": "^0.3.21",
|
|
52
51
|
"@gradio/simpleimage": "^0.8.29",
|
|
53
|
-
"@gradio/slider": "^0.6.
|
|
54
|
-
"@gradio/statustracker": "^0.10.11",
|
|
52
|
+
"@gradio/slider": "^0.6.10",
|
|
55
53
|
"@gradio/state": "^0.1.2",
|
|
54
|
+
"@gradio/sketchbox": "^0.6.8",
|
|
55
|
+
"@gradio/statustracker": "^0.10.11",
|
|
56
56
|
"@gradio/tabitem": "^0.4.4",
|
|
57
57
|
"@gradio/tabs": "^0.4.4",
|
|
58
58
|
"@gradio/textbox": "^0.10.11",
|
|
59
|
-
"@gradio/theme": "^0.4.0",
|
|
60
59
|
"@gradio/timer": "^0.4.5",
|
|
60
|
+
"@gradio/theme": "^0.4.0",
|
|
61
61
|
"@gradio/upload": "^0.16.5",
|
|
62
62
|
"@gradio/uploadbutton": "^0.9.0",
|
|
63
|
+
"@gradio/video": "^0.14.14",
|
|
63
64
|
"@gradio/utils": "^0.10.2",
|
|
64
|
-
"@gradio/wasm": "^0.18.1"
|
|
65
|
-
"@gradio/video": "^0.14.14"
|
|
65
|
+
"@gradio/wasm": "^0.18.1"
|
|
66
66
|
},
|
|
67
67
|
"msw": {
|
|
68
68
|
"workerDirectory": "public"
|
package/src/Blocks.svelte
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { tick, onMount } from "svelte";
|
|
3
3
|
import { _ } from "svelte-i18n";
|
|
4
4
|
import { Client } from "@gradio/client";
|
|
5
|
+
import { writable } from "svelte/store";
|
|
5
6
|
|
|
6
7
|
import type { LoadingStatus, LoadingStatusCollection } from "./stores";
|
|
7
8
|
|
|
@@ -19,12 +20,14 @@
|
|
|
19
20
|
import logo from "./images/logo.svg";
|
|
20
21
|
import api_logo from "./api_docs/img/api-logo.svg";
|
|
21
22
|
import settings_logo from "./api_docs/img/settings-logo.svg";
|
|
23
|
+
import record_stop from "./api_docs/img/record-stop.svg";
|
|
22
24
|
import { create_components, AsyncFunction } from "./init";
|
|
23
25
|
import type {
|
|
24
26
|
LogMessage,
|
|
25
27
|
RenderMessage,
|
|
26
28
|
StatusMessage
|
|
27
29
|
} from "@gradio/client";
|
|
30
|
+
import * as screen_recorder from "./screen_recorder";
|
|
28
31
|
|
|
29
32
|
export let root: string;
|
|
30
33
|
export let components: ComponentMeta[];
|
|
@@ -97,6 +100,8 @@
|
|
|
97
100
|
let settings_visible = search_params.get("view") === "settings";
|
|
98
101
|
let api_recorder_visible =
|
|
99
102
|
search_params.get("view") === "api-recorder" && show_api;
|
|
103
|
+
let allow_zoom = true;
|
|
104
|
+
let allow_video_trim = true;
|
|
100
105
|
|
|
101
106
|
function set_api_docs_visible(visible: boolean): void {
|
|
102
107
|
api_recorder_visible = false;
|
|
@@ -126,11 +131,28 @@
|
|
|
126
131
|
export let render_complete = false;
|
|
127
132
|
async function handle_update(data: any, fn_index: number): Promise<void> {
|
|
128
133
|
const dep = dependencies.find((dep) => dep.id === fn_index);
|
|
134
|
+
const input_type = components.find(
|
|
135
|
+
(comp) => comp.id === dep?.inputs[0]
|
|
136
|
+
)?.type;
|
|
137
|
+
if (allow_zoom && dep && input_type !== "dataset") {
|
|
138
|
+
if (dep && dep.inputs && dep.inputs.length > 0 && $is_screen_recording) {
|
|
139
|
+
screen_recorder.zoom(true, dep.inputs, 1.0);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (
|
|
143
|
+
dep &&
|
|
144
|
+
dep.outputs &&
|
|
145
|
+
dep.outputs.length > 0 &&
|
|
146
|
+
$is_screen_recording
|
|
147
|
+
) {
|
|
148
|
+
screen_recorder.zoom(false, dep.outputs, 2.0);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
129
152
|
if (!dep) {
|
|
130
153
|
return;
|
|
131
154
|
}
|
|
132
155
|
const outputs = dep.outputs;
|
|
133
|
-
|
|
134
156
|
const meta_updates = data?.map((value: any, i: number) => {
|
|
135
157
|
return {
|
|
136
158
|
id: outputs[i],
|
|
@@ -372,6 +394,9 @@
|
|
|
372
394
|
payload: Payload,
|
|
373
395
|
streaming = false
|
|
374
396
|
): Promise<void> {
|
|
397
|
+
if (allow_video_trim) {
|
|
398
|
+
screen_recorder.markRemoveSegmentStart();
|
|
399
|
+
}
|
|
375
400
|
if (api_recorder_visible) {
|
|
376
401
|
api_calls = [...api_calls, JSON.parse(JSON.stringify(payload))];
|
|
377
402
|
}
|
|
@@ -601,6 +626,9 @@
|
|
|
601
626
|
});
|
|
602
627
|
}
|
|
603
628
|
}
|
|
629
|
+
if (allow_video_trim) {
|
|
630
|
+
screen_recorder.markRemoveSegmentEnd();
|
|
631
|
+
}
|
|
604
632
|
}
|
|
605
633
|
}
|
|
606
634
|
/* eslint-enable complexity */
|
|
@@ -773,6 +801,8 @@
|
|
|
773
801
|
return "detail" in event;
|
|
774
802
|
}
|
|
775
803
|
|
|
804
|
+
let is_screen_recording = writable(false);
|
|
805
|
+
|
|
776
806
|
onMount(() => {
|
|
777
807
|
document.addEventListener("visibilitychange", function () {
|
|
778
808
|
if (document.visibilityState === "hidden") {
|
|
@@ -784,7 +814,25 @@
|
|
|
784
814
|
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
785
815
|
navigator.userAgent
|
|
786
816
|
);
|
|
817
|
+
|
|
818
|
+
screen_recorder.initialize(
|
|
819
|
+
root,
|
|
820
|
+
(title, message, type) => {
|
|
821
|
+
add_new_message(title, message, type);
|
|
822
|
+
},
|
|
823
|
+
(isRecording) => {
|
|
824
|
+
$is_screen_recording = isRecording;
|
|
825
|
+
}
|
|
826
|
+
);
|
|
787
827
|
});
|
|
828
|
+
|
|
829
|
+
function screen_recording(): void {
|
|
830
|
+
if ($is_screen_recording) {
|
|
831
|
+
screen_recorder.stopRecording();
|
|
832
|
+
} else {
|
|
833
|
+
screen_recorder.startRecording();
|
|
834
|
+
}
|
|
835
|
+
}
|
|
788
836
|
</script>
|
|
789
837
|
|
|
790
838
|
<svelte:head>
|
|
@@ -840,6 +888,17 @@
|
|
|
840
888
|
{$_("common.built_with_gradio")}
|
|
841
889
|
<img src={logo} alt={$_("common.logo")} />
|
|
842
890
|
</a>
|
|
891
|
+
<div class="divider" class:hidden={!$is_screen_recording}>·</div>
|
|
892
|
+
<button
|
|
893
|
+
class:hidden={!$is_screen_recording}
|
|
894
|
+
on:click={() => {
|
|
895
|
+
screen_recording();
|
|
896
|
+
}}
|
|
897
|
+
class="record"
|
|
898
|
+
>
|
|
899
|
+
{$_("common.stop_recording")}
|
|
900
|
+
<img src={record_stop} alt={$_("common.stop_recording")} />
|
|
901
|
+
</button>
|
|
843
902
|
<div class="divider">·</div>
|
|
844
903
|
<button
|
|
845
904
|
on:click={() => {
|
|
@@ -912,9 +971,14 @@
|
|
|
912
971
|
/>
|
|
913
972
|
<div class="api-docs-wrap">
|
|
914
973
|
<Settings
|
|
974
|
+
bind:allow_zoom
|
|
975
|
+
bind:allow_video_trim
|
|
915
976
|
on:close={(event) => {
|
|
916
977
|
set_settings_visible(false);
|
|
917
978
|
}}
|
|
979
|
+
on:start_recording={(event) => {
|
|
980
|
+
screen_recording();
|
|
981
|
+
}}
|
|
918
982
|
pwa_enabled={app.config.pwa}
|
|
919
983
|
{root}
|
|
920
984
|
{space_id}
|
|
@@ -954,7 +1018,8 @@
|
|
|
954
1018
|
}
|
|
955
1019
|
|
|
956
1020
|
.show-api,
|
|
957
|
-
.settings
|
|
1021
|
+
.settings,
|
|
1022
|
+
.record {
|
|
958
1023
|
display: flex;
|
|
959
1024
|
align-items: center;
|
|
960
1025
|
}
|
|
@@ -974,13 +1039,20 @@
|
|
|
974
1039
|
width: var(--size-4);
|
|
975
1040
|
}
|
|
976
1041
|
|
|
1042
|
+
.record img {
|
|
1043
|
+
margin-right: var(--size-1);
|
|
1044
|
+
margin-left: var(--size-1);
|
|
1045
|
+
width: var(--size-3);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
977
1048
|
.built-with {
|
|
978
1049
|
display: flex;
|
|
979
1050
|
align-items: center;
|
|
980
1051
|
}
|
|
981
1052
|
|
|
982
1053
|
.built-with:hover,
|
|
983
|
-
.settings:hover
|
|
1054
|
+
.settings:hover,
|
|
1055
|
+
.record:hover {
|
|
984
1056
|
color: var(--body-text-color);
|
|
985
1057
|
}
|
|
986
1058
|
|
|
@@ -1051,4 +1123,8 @@
|
|
|
1051
1123
|
.show-api:hover {
|
|
1052
1124
|
color: var(--body-text-color);
|
|
1053
1125
|
}
|
|
1126
|
+
|
|
1127
|
+
.hidden {
|
|
1128
|
+
display: none;
|
|
1129
|
+
}
|
|
1054
1130
|
</style>
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
export let space_id: string | null;
|
|
7
7
|
export let pwa_enabled: boolean | undefined;
|
|
8
8
|
import { BaseDropdown as Dropdown } from "@gradio/dropdown";
|
|
9
|
+
import { BaseCheckbox as Checkbox } from "@gradio/checkbox";
|
|
9
10
|
import { language_choices, changeLocale } from "../i18n";
|
|
10
11
|
import { locale, _ } from "svelte-i18n";
|
|
11
12
|
import { setupi18n } from "../i18n";
|
|
13
|
+
import record from "./img/record.svg";
|
|
14
|
+
import { createEventDispatcher } from "svelte";
|
|
12
15
|
|
|
16
|
+
const dispatch = createEventDispatcher();
|
|
13
17
|
if (root === "") {
|
|
14
18
|
root = location.protocol + "//" + location.host + location.pathname;
|
|
15
19
|
}
|
|
@@ -44,6 +48,8 @@
|
|
|
44
48
|
|
|
45
49
|
let current_locale: string;
|
|
46
50
|
let current_theme: "light" | "dark" | "system" = "system";
|
|
51
|
+
export let allow_zoom = true;
|
|
52
|
+
export let allow_video_trim = true;
|
|
47
53
|
|
|
48
54
|
locale.subscribe((value) => {
|
|
49
55
|
if (value) {
|
|
@@ -55,6 +61,15 @@
|
|
|
55
61
|
const new_locale = e.detail;
|
|
56
62
|
changeLocale(new_locale);
|
|
57
63
|
}
|
|
64
|
+
|
|
65
|
+
function handleZoomChange(e: CustomEvent): void {
|
|
66
|
+
allow_zoom = e.detail;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function handleVideoTrimChange(e: CustomEvent): void {
|
|
70
|
+
allow_video_trim = e.detail;
|
|
71
|
+
}
|
|
72
|
+
|
|
58
73
|
setupi18n();
|
|
59
74
|
</script>
|
|
60
75
|
|
|
@@ -120,6 +135,44 @@
|
|
|
120
135
|
{/if}
|
|
121
136
|
</p>
|
|
122
137
|
</div>
|
|
138
|
+
<div class="banner-wrap">
|
|
139
|
+
<h2>{$_("common.screen_studio")} <span class="beta-tag">beta</span></h2>
|
|
140
|
+
<p class="padded">
|
|
141
|
+
Screen Studio allows you to record your screen and generates a video of your
|
|
142
|
+
app with automatically adding zoom in and zoom out effects as well as
|
|
143
|
+
trimming the video to remove the prediction time.
|
|
144
|
+
<br /><br />
|
|
145
|
+
Start recording by clicking the <i>Start Recording</i> button below and then
|
|
146
|
+
sharing the current browser tab of your Gradio demo. Use your app as you
|
|
147
|
+
would normally to generate a prediction.
|
|
148
|
+
<br />
|
|
149
|
+
Stop recording by clicking the <i>Stop Recording</i> button in the footer of
|
|
150
|
+
the demo.
|
|
151
|
+
<br /><br />
|
|
152
|
+
<Checkbox
|
|
153
|
+
label="Include automatic zoom in/out"
|
|
154
|
+
interactive={true}
|
|
155
|
+
value={allow_zoom}
|
|
156
|
+
on:change={handleZoomChange}
|
|
157
|
+
/>
|
|
158
|
+
<Checkbox
|
|
159
|
+
label="Include automatic video trimming"
|
|
160
|
+
interactive={true}
|
|
161
|
+
value={allow_video_trim}
|
|
162
|
+
on:change={handleVideoTrimChange}
|
|
163
|
+
/>
|
|
164
|
+
</p>
|
|
165
|
+
<button
|
|
166
|
+
class="record-button"
|
|
167
|
+
on:click={() => {
|
|
168
|
+
dispatch("close");
|
|
169
|
+
dispatch("start_recording");
|
|
170
|
+
}}
|
|
171
|
+
>
|
|
172
|
+
<img src={record} alt="Start Recording" />
|
|
173
|
+
Start Recording
|
|
174
|
+
</button>
|
|
175
|
+
</div>
|
|
123
176
|
|
|
124
177
|
<style>
|
|
125
178
|
.banner-wrap {
|
|
@@ -150,7 +203,8 @@
|
|
|
150
203
|
margin-left: var(--size-2);
|
|
151
204
|
}
|
|
152
205
|
|
|
153
|
-
.theme-button
|
|
206
|
+
.theme-button,
|
|
207
|
+
.record-button {
|
|
154
208
|
display: flex;
|
|
155
209
|
align-items: center;
|
|
156
210
|
border: 1px solid var(--border-color-primary);
|
|
@@ -162,6 +216,15 @@
|
|
|
162
216
|
cursor: pointer;
|
|
163
217
|
}
|
|
164
218
|
|
|
219
|
+
.record-button img {
|
|
220
|
+
margin-right: var(--size-1);
|
|
221
|
+
margin-left: var(--size-1);
|
|
222
|
+
width: var(--size-3);
|
|
223
|
+
}
|
|
224
|
+
.record-button:hover {
|
|
225
|
+
border-color: red;
|
|
226
|
+
}
|
|
227
|
+
|
|
165
228
|
.current-theme {
|
|
166
229
|
border: 1px solid var(--body-text-color-subdued);
|
|
167
230
|
color: var(--body-text-color);
|
|
@@ -181,4 +244,17 @@
|
|
|
181
244
|
all: unset;
|
|
182
245
|
cursor: pointer;
|
|
183
246
|
}
|
|
247
|
+
|
|
248
|
+
.beta-tag {
|
|
249
|
+
position: relative;
|
|
250
|
+
top: -5px;
|
|
251
|
+
font-size: var(--text-xs);
|
|
252
|
+
background-color: var(--color-accent);
|
|
253
|
+
color: white;
|
|
254
|
+
padding: 2px 6px;
|
|
255
|
+
border-radius: 10px;
|
|
256
|
+
margin-left: 5px;
|
|
257
|
+
font-weight: normal;
|
|
258
|
+
text-transform: uppercase;
|
|
259
|
+
}
|
|
184
260
|
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <title>record [#982]</title> <desc>Created with Sketch.</desc> <defs> </defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="Dribbble-Light-Preview" transform="translate(-380.000000, -3839.000000)" fill="#FF0000"> <g id="icons" transform="translate(56.000000, 160.000000)"> <path d="M338,3689 C338,3691.209 336.209,3693 334,3693 C331.791,3693 330,3691.209 330,3689 C330,3686.791 331.791,3685 334,3685 C336.209,3685 338,3686.791 338,3689 M334,3697 C329.589,3697 326,3693.411 326,3689 C326,3684.589 329.589,3681 334,3681 C338.411,3681 342,3684.589 342,3689 C342,3693.411 338.411,3697 334,3697 M334,3679 C328.477,3679 324,3683.477 324,3689 C324,3694.523 328.477,3699 334,3699 C339.523,3699 344,3694.523 344,3689 C344,3683.477 339.523,3679 334,3679" id="record-[#982]"> </path> </g> </g> </g> </g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <title>record [#982]</title> <desc>Created with Sketch.</desc> <defs> </defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="Dribbble-Light-Preview" transform="translate(-380.000000, -3839.000000)" fill="#808080"> <g id="icons" transform="translate(56.000000, 160.000000)"> <path d="M338,3689 C338,3691.209 336.209,3693 334,3693 C331.791,3693 330,3691.209 330,3689 C330,3686.791 331.791,3685 334,3685 C336.209,3685 338,3686.791 338,3689 M334,3697 C329.589,3697 326,3693.411 326,3689 C326,3684.589 329.589,3681 334,3681 C338.411,3681 342,3684.589 342,3689 C342,3693.411 338.411,3697 334,3697 M334,3679 C328.477,3679 324,3683.477 324,3689 C324,3694.523 328.477,3699 334,3699 C339.523,3699 344,3694.523 344,3689 C344,3683.477 339.523,3679 334,3679" id="record-[#982]"> </path> </g> </g> </g> </g></svg>
|
package/src/init.ts
CHANGED
|
@@ -179,13 +179,15 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
|
|
|
179
179
|
root: string;
|
|
180
180
|
dependencies: Dependency[];
|
|
181
181
|
}): void {
|
|
182
|
+
components.forEach((c) => {
|
|
183
|
+
for (const prop in c.props) {
|
|
184
|
+
if (c.props[prop] === null) {
|
|
185
|
+
c.props[prop] = undefined;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
182
189
|
let replacement_components: ComponentMeta[] = [];
|
|
183
190
|
let new_components: ComponentMeta[] = [];
|
|
184
|
-
console.log("old_keys", keys_per_render_id[render_id]);
|
|
185
|
-
console.log(
|
|
186
|
-
"new_keys",
|
|
187
|
-
components.map((c) => c.key)
|
|
188
|
-
);
|
|
189
191
|
components.forEach((c) => {
|
|
190
192
|
if (c.key == null || !keys_per_render_id[render_id]?.includes(c.key)) {
|
|
191
193
|
new_components.push(c);
|
|
@@ -193,7 +195,6 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
|
|
|
193
195
|
replacement_components.push(c);
|
|
194
196
|
}
|
|
195
197
|
});
|
|
196
|
-
console.log(new_components.length, replacement_components.length);
|
|
197
198
|
let _constructor_map = preload_all_components(new_components, root);
|
|
198
199
|
_constructor_map.forEach((v, k) => {
|
|
199
200
|
constructor_map.set(k, v);
|
package/src/lang/en.json
CHANGED
|
@@ -69,6 +69,10 @@
|
|
|
69
69
|
"language": "Language",
|
|
70
70
|
"display_theme": "Display Theme",
|
|
71
71
|
"pwa": "Progressive Web App",
|
|
72
|
+
"record": "Record",
|
|
73
|
+
"stop_recording": "Stop Recording",
|
|
74
|
+
"screen_studio": "Screen Studio",
|
|
75
|
+
"share_gradio_tab": "[Sharing] Gradio Tab",
|
|
72
76
|
"run": "Run"
|
|
73
77
|
},
|
|
74
78
|
"dataframe": {
|