gradio-pr-bot commited on
Commit
e6528cd
·
verified ·
1 Parent(s): 318a7a9

Upload folder using huggingface_hub

Browse files
6.13.0/colorpicker/Index.svelte CHANGED
@@ -52,6 +52,7 @@
52
  show_label={gradio.shared.show_label}
53
  disabled={!gradio.shared.interactive}
54
  on_input={() => gradio.dispatch("input")}
 
55
  on_submit={() => gradio.dispatch("submit")}
56
  on_blur={() => gradio.dispatch("blur")}
57
  on_focus={() => gradio.dispatch("focus")}
 
52
  show_label={gradio.shared.show_label}
53
  disabled={!gradio.shared.interactive}
54
  on_input={() => gradio.dispatch("input")}
55
+ on_release={() => gradio.dispatch("release", gradio.props.value)}
56
  on_submit={() => gradio.dispatch("submit")}
57
  on_blur={() => gradio.dispatch("blur")}
58
  on_focus={() => gradio.dispatch("focus")}
6.13.0/colorpicker/shared/Colorpicker.svelte CHANGED
@@ -13,6 +13,7 @@
13
  disabled,
14
  show_label,
15
  on_input = () => {},
 
16
  on_submit = () => {},
17
  on_blur = () => {},
18
  on_focus = () => {}
@@ -23,6 +24,7 @@
23
  disabled: boolean;
24
  show_label: boolean;
25
  on_input?: () => void;
 
26
  on_submit?: () => void;
27
  on_blur?: () => void;
28
  on_focus?: () => void;
@@ -98,8 +100,12 @@
98
  }
99
 
100
  function handle_end(): void {
 
101
  sl_moving = false;
102
  hue_moving = false;
 
 
 
103
  }
104
 
105
  async function update_mouse_from_color(color: string): Promise<void> {
 
13
  disabled,
14
  show_label,
15
  on_input = () => {},
16
+ on_release = () => {},
17
  on_submit = () => {},
18
  on_blur = () => {},
19
  on_focus = () => {}
 
24
  disabled: boolean;
25
  show_label: boolean;
26
  on_input?: () => void;
27
+ on_release?: () => void;
28
  on_submit?: () => void;
29
  on_blur?: () => void;
30
  on_focus?: () => void;
 
100
  }
101
 
102
  function handle_end(): void {
103
+ const should_dispatch_release = sl_moving || hue_moving;
104
  sl_moving = false;
105
  hue_moving = false;
106
+ if (should_dispatch_release) {
107
+ on_release();
108
+ }
109
  }
110
 
111
  async function update_mouse_from_color(color: string): Promise<void> {
6.13.0/colorpicker/types.ts CHANGED
@@ -6,6 +6,7 @@ export interface ColorPickerProps {
6
  export interface ColorPickerEvents {
7
  change: never;
8
  input: never;
 
9
  submit: never;
10
  focus: never;
11
  blur: never;
 
6
  export interface ColorPickerEvents {
7
  change: never;
8
  input: never;
9
+ release: string;
10
  submit: never;
11
  focus: never;
12
  blur: never;