gradio-pr-bot commited on
Commit
0d3b8bf
·
verified ·
1 Parent(s): b492e63

Upload folder using huggingface_hub

Browse files
6.11.0/utils/package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "@gradio/utils",
3
- "version": "0.12.1",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "main": "./src/index.ts",
 
1
  {
2
  "name": "@gradio/utils",
3
+ "version": "0.12.2",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "main": "./src/index.ts",
6.11.0/utils/src/utils.svelte.ts CHANGED
@@ -361,6 +361,8 @@ export class Gradio<T extends object = {}, U extends object = {}> {
361
  dispatcher!: Function;
362
  last_update: ReturnType<typeof tick> | null = null;
363
  shared_props: (keyof SharedProps)[] = allowed_shared_props;
 
 
364
  register_component!: (
365
  id: number,
366
  set_data: (data: Record<string, any> & SharedProps) => void,
@@ -522,6 +524,23 @@ export class Gradio<T extends object = {}, U extends object = {}> {
522
  this.props[key] = translated;
523
  }
524
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
525
  }
526
 
527
  // function _load_component(
 
361
  dispatcher!: Function;
362
  last_update: ReturnType<typeof tick> | null = null;
363
  shared_props: (keyof SharedProps)[] = allowed_shared_props;
364
+ mounted: boolean = false;
365
+ old_value: any;
366
  register_component!: (
367
  id: number,
368
  set_data: (data: Record<string, any> & SharedProps) => void,
 
524
  this.props[key] = translated;
525
  }
526
  }
527
+
528
+ watch_for_change() {
529
+ $effect(() => {
530
+ if (!this.mounted) {
531
+ // @ts-ignore
532
+ this.old_value = this.props.value;
533
+ this.mounted = true;
534
+ }
535
+ // @ts-ignore
536
+ if (this.old_value != this.props.value) {
537
+ // @ts-ignore
538
+ this.old_value = this.props.value;
539
+ // @ts-ignore
540
+ this.dispatch("change");
541
+ }
542
+ });
543
+ }
544
  }
545
 
546
  // function _load_component(