@gradio/imageeditor 0.18.2-dev.0 → 0.18.2

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/Index.svelte +122 -159
  3. package/InteractiveImageEditor.svelte +1 -0
  4. package/dist/Example.svelte +7 -4
  5. package/dist/Example.svelte.d.ts +20 -18
  6. package/dist/Index.svelte +152 -136
  7. package/dist/Index.svelte.d.ts +18 -202
  8. package/dist/InteractiveImageEditor.svelte +205 -148
  9. package/dist/InteractiveImageEditor.svelte.d.ts +55 -51
  10. package/dist/shared/Anchor.svelte +210 -136
  11. package/dist/shared/Anchor.svelte.d.ts +18 -16
  12. package/dist/shared/Controls.svelte +55 -36
  13. package/dist/shared/Controls.svelte.d.ts +35 -33
  14. package/dist/shared/IconButton.svelte +19 -17
  15. package/dist/shared/IconButton.svelte.d.ts +34 -32
  16. package/dist/shared/ImageEditor.svelte +673 -466
  17. package/dist/shared/ImageEditor.svelte.d.ts +4 -79
  18. package/dist/shared/Layers.svelte +52 -30
  19. package/dist/shared/Layers.svelte.d.ts +39 -36
  20. package/dist/shared/Resize.svelte +42 -21
  21. package/dist/shared/Resize.svelte.d.ts +29 -27
  22. package/dist/shared/SecondaryToolbar.svelte +17 -5
  23. package/dist/shared/SecondaryToolbar.svelte.d.ts +38 -36
  24. package/dist/shared/Toolbar.svelte +123 -69
  25. package/dist/shared/Toolbar.svelte.d.ts +40 -38
  26. package/dist/shared/brush/BrushOptions.svelte +119 -84
  27. package/dist/shared/brush/BrushOptions.svelte.d.ts +29 -27
  28. package/dist/shared/brush/BrushSize.svelte +12 -7
  29. package/dist/shared/brush/BrushSize.svelte.d.ts +23 -20
  30. package/dist/shared/brush/ColorField.svelte +49 -33
  31. package/dist/shared/brush/ColorField.svelte.d.ts +23 -21
  32. package/dist/shared/brush/ColorPicker.svelte +152 -108
  33. package/dist/shared/brush/ColorPicker.svelte.d.ts +19 -17
  34. package/dist/shared/brush/ColorSwatch.svelte +78 -46
  35. package/dist/shared/brush/ColorSwatch.svelte.d.ts +34 -32
  36. package/dist/types.d.ts +40 -0
  37. package/dist/types.js +25 -0
  38. package/package.json +12 -12
  39. package/shared/ImageEditor.svelte +1 -3
  40. package/shared/brush/BrushOptions.svelte +1 -1
  41. package/shared/brush/ColorPicker.svelte +2 -1
  42. package/types.ts +74 -0
@@ -1,139 +1,213 @@
1
- <script>import { spring } from "svelte/motion";
2
- import { Image } from "@gradio/icons";
3
- import { onMount, createEventDispatcher } from "svelte";
4
- const positions = [
5
- "top-left",
6
- "top",
7
- "top-right",
8
- "left",
9
- "center",
10
- "right",
11
- "bottom-left",
12
- "bottom",
13
- "bottom-right"
14
- ];
15
- const dispatch = createEventDispatcher();
16
- const spring_opt = {
17
- stiffness: 0.1,
18
- precision: 0.5
19
- };
20
- const pos = spring([5, 5], spring_opt);
21
- const init = [(120 - 10) / 3, (120 - 10) / 3];
22
- const dimensions = spring(init, spring_opt);
23
- const arrow_spring = spring([], spring_opt);
24
- let last_i = 0;
25
- let expanded = true;
26
- const box_size = (120 - 5 * 2) / 3;
27
- async function handle_box_hover(i) {
28
- expanded = false;
29
- last_i = i;
30
- const y = Math.floor(i / 3);
31
- const x = i % 3;
32
- pos.set([x * box_size + 5 * x + 5, y * box_size + 5 * y + 5]);
33
- dimensions.set(init);
34
- }
35
- let last_pos = 0;
36
- async function handle_box_click(i, stagger = false) {
37
- if (expanded && stagger) return;
38
- const y = Math.floor(i / 3);
39
- const x = i % 3;
40
- const [initial_arrows, eventual_arrows] = get_valid_offsets({
41
- x,
42
- y
43
- });
44
- if (stagger && last_i !== i) {
45
- await Promise.all([
46
- pos.set([x * box_size + 5 * x + 5, y * box_size + 5 * y + 5]),
47
- arrow_spring.set(initial_arrows, { hard: true }),
48
- dimensions.set(init)
49
- ]);
50
- } else {
51
- await arrow_spring.set(initial_arrows, { hard: true });
52
- }
53
- last_pos = i;
54
- expanded = true;
55
- pos.set([0, 0]);
56
- dimensions.set([120 + 10, 120 + 10]);
57
- arrow_spring.set(eventual_arrows);
58
- dispatch("position", positions[i]);
59
- }
60
- function get_valid_offsets(anchorPoint) {
61
- const destination_points = [
62
- { x: 0, y: 0 },
63
- { x: 1, y: 0 },
64
- { x: 2, y: 0 },
65
- { x: 0, y: 1 },
66
- { x: 1, y: 1 },
67
- { x: 2, y: 1 },
68
- { x: 0, y: 2 },
69
- { x: 1, y: 2 },
70
- { x: 2, y: 2 }
71
- ];
72
- const offsets = destination_points.map((dest) => ({
73
- x: dest.x - anchorPoint.x,
74
- y: dest.y - anchorPoint.y,
75
- dest
76
- })).filter((offset) => !(offset.x === 0 && offset.y === 0));
77
- const normalized_offsets = offsets.map((offset) => {
78
- if (offset.x === 0 || offset.y === 0) {
79
- const magnitude = Math.max(Math.abs(offset.x), Math.abs(offset.y));
80
- return {
81
- magnitude,
82
- x: offset.x / magnitude,
83
- y: offset.y / magnitude,
84
- dest: offset.dest,
85
- original: offset,
86
- type: "cardinal"
87
- };
88
- }
89
- if (Math.abs(offset.x) === Math.abs(offset.y)) {
90
- const magnitude = Math.abs(offset.x);
91
- return {
92
- magnitude,
93
- x: offset.x / magnitude,
94
- y: offset.y / magnitude,
95
- dest: offset.dest,
96
- original: offset,
97
- type: "ordinal"
98
- };
99
- }
100
- return null;
101
- }).filter((offset) => offset !== null);
102
- const directions = /* @__PURE__ */ new Map();
103
- normalized_offsets.forEach((offset) => {
104
- if (directions.has(`${offset.x}-${offset.y}`)) {
105
- directions.get(`${offset.x}-${offset.y}`)?.push(offset);
106
- } else {
107
- directions.set(`${offset.x}-${offset.y}`, [offset]);
108
- }
109
- });
110
- const unique_directions = Array.from(directions.values()).map(
111
- (direction) => {
112
- return direction.sort((a, b) => b.magnitude - a.magnitude)[0];
113
- }
114
- );
115
- const eventual_arrows = unique_directions.map((arrow) => ({
116
- x: arrow.dest.x * box_size + 14 * arrow.dest.x + 14 + 10 + (arrow.type === "ordinal" ? 0 : 12 * arrow.x),
117
- y: arrow.dest.y * box_size + 14 * arrow.dest.y + 14 + 10 + (arrow.type === "ordinal" ? 0 : 12 * arrow.y),
118
- x_dir: arrow.x,
119
- y_dir: arrow.y,
120
- rotation: Math.atan2(arrow.original.y, arrow.original.x) * (180 / Math.PI) + 180,
121
- type: arrow.type === "ordinal" ? 1 : 2
122
- }));
123
- const initial_arrows = eventual_arrows.map((arrow) => ({
124
- ...arrow,
125
- x: anchorPoint.x * box_size + 14 * anchorPoint.x + // gaps
126
- 14 + // padding
127
- 10 + // arrow head
128
- arrow.x_dir * box_size / 2 + arrow.x_dir * (arrow.type === 1 ? 0 : 10),
129
- // offset based on direction
130
- y: anchorPoint.y * box_size + 14 * anchorPoint.y + 14 + 10 + arrow.y_dir * box_size / 2 + arrow.y_dir * (arrow.type === 1 ? 0 : 10)
131
- }));
132
- return [initial_arrows, eventual_arrows];
133
- }
134
- onMount(() => {
135
- handle_box_click(0);
136
- });
1
+ <script lang="ts">
2
+ import { spring } from "svelte/motion";
3
+ import { Image } from "@gradio/icons";
4
+ import { onMount, createEventDispatcher } from "svelte";
5
+
6
+ const positions = [
7
+ "top-left",
8
+ "top",
9
+ "top-right",
10
+ "left",
11
+ "center",
12
+ "right",
13
+ "bottom-left",
14
+ "bottom",
15
+ "bottom-right"
16
+ ] as const;
17
+ const dispatch = createEventDispatcher<{
18
+ position: (typeof positions)[number];
19
+ }>();
20
+
21
+ const spring_opt = {
22
+ stiffness: 0.1,
23
+ precision: 0.5
24
+ };
25
+ const pos = spring([5, 5], spring_opt);
26
+ const init = [(120 - 10) / 3, (120 - 10) / 3];
27
+ const dimensions = spring(init, spring_opt);
28
+ type Arrow = {
29
+ x: number;
30
+ y: number;
31
+ x_dir: number;
32
+ y_dir: number;
33
+ rotation: number;
34
+ type: number;
35
+ };
36
+ const arrow_spring = spring<Arrow[]>([], spring_opt);
37
+
38
+ let last_i = 0;
39
+ let expanded = true;
40
+ const box_size = (120 - 5 * 2) / 3;
41
+
42
+ async function handle_box_hover(i: number): Promise<void> {
43
+ expanded = false;
44
+ last_i = i;
45
+ const y = Math.floor(i / 3);
46
+ const x = i % 3;
47
+ pos.set([x * box_size + 5 * x + 5, y * box_size + 5 * y + 5]);
48
+
49
+ dimensions.set(init);
50
+ }
51
+
52
+ let last_pos = 0;
53
+ async function handle_box_click(i: number, stagger = false): Promise<void> {
54
+ if (expanded && stagger) return;
55
+
56
+ const y = Math.floor(i / 3);
57
+ const x = i % 3;
58
+
59
+ const [initial_arrows, eventual_arrows] = get_valid_offsets({
60
+ x: x,
61
+ y: y
62
+ });
63
+
64
+ if (stagger && last_i !== i) {
65
+ await Promise.all([
66
+ pos.set([x * box_size + 5 * x + 5, y * box_size + 5 * y + 5]),
67
+ arrow_spring.set(initial_arrows, { hard: true }),
68
+ dimensions.set(init)
69
+ ]);
70
+ } else {
71
+ await arrow_spring.set(initial_arrows, { hard: true });
72
+ }
73
+ last_pos = i;
74
+ expanded = true;
75
+
76
+ pos.set([0, 0]);
77
+ dimensions.set([120 + 10, 120 + 10]);
78
+ arrow_spring.set(eventual_arrows);
79
+
80
+ dispatch("position", positions[i]);
81
+ }
82
+
83
+ function get_valid_offsets(anchorPoint: {
84
+ x: number;
85
+ y: number;
86
+ }): [Arrow[], Arrow[]] {
87
+ const destination_points: { x: number; y: number }[] = [
88
+ { x: 0, y: 0 },
89
+ { x: 1, y: 0 },
90
+ { x: 2, y: 0 },
91
+ { x: 0, y: 1 },
92
+ { x: 1, y: 1 },
93
+ { x: 2, y: 1 },
94
+ { x: 0, y: 2 },
95
+ { x: 1, y: 2 },
96
+ { x: 2, y: 2 }
97
+ ];
98
+
99
+ const offsets = destination_points
100
+ .map((dest) => ({
101
+ x: dest.x - anchorPoint.x,
102
+ y: dest.y - anchorPoint.y,
103
+ dest
104
+ }))
105
+ .filter((offset) => !(offset.x === 0 && offset.y === 0));
106
+
107
+ const normalized_offsets = offsets
108
+ .map((offset) => {
109
+ // cardinal
110
+ if (offset.x === 0 || offset.y === 0) {
111
+ const magnitude = Math.max(Math.abs(offset.x), Math.abs(offset.y));
112
+ return {
113
+ magnitude,
114
+ x: offset.x / magnitude,
115
+ y: offset.y / magnitude,
116
+ dest: offset.dest,
117
+ original: offset,
118
+ type: "cardinal" as const
119
+ };
120
+ }
121
+
122
+ // ordinal
123
+ if (Math.abs(offset.x) === Math.abs(offset.y)) {
124
+ const magnitude = Math.abs(offset.x);
125
+ return {
126
+ magnitude,
127
+ x: offset.x / magnitude,
128
+ y: offset.y / magnitude,
129
+ dest: offset.dest,
130
+ original: offset,
131
+ type: "ordinal" as const
132
+ };
133
+ }
134
+
135
+ // skip the rest
136
+ return null;
137
+ })
138
+ .filter((offset) => offset !== null);
139
+
140
+ const directions = new Map<
141
+ string,
142
+ {
143
+ x: number;
144
+ y: number;
145
+ dest: { x: number; y: number };
146
+ original: { x: number; y: number };
147
+ magnitude: number;
148
+ type: "cardinal" | "ordinal";
149
+ }[]
150
+ >();
151
+
152
+ normalized_offsets.forEach((offset) => {
153
+ if (directions.has(`${offset.x}-${offset.y}`)) {
154
+ directions.get(`${offset.x}-${offset.y}`)?.push(offset);
155
+ } else {
156
+ directions.set(`${offset.x}-${offset.y}`, [offset]);
157
+ }
158
+ });
159
+
160
+ const unique_directions = Array.from(directions.values()).map(
161
+ (direction) => {
162
+ return direction.sort((a, b) => b.magnitude - a.magnitude)[0];
163
+ }
164
+ );
165
+
166
+ const eventual_arrows = unique_directions.map((arrow) => ({
167
+ x:
168
+ arrow.dest.x * box_size +
169
+ 14 * arrow.dest.x +
170
+ 14 +
171
+ 10 +
172
+ (arrow.type === "ordinal" ? 0 : 12 * arrow.x),
173
+ y:
174
+ arrow.dest.y * box_size +
175
+ 14 * arrow.dest.y +
176
+ 14 +
177
+ 10 +
178
+ (arrow.type === "ordinal" ? 0 : 12 * arrow.y),
179
+ x_dir: arrow.x,
180
+ y_dir: arrow.y,
181
+ rotation:
182
+ Math.atan2(arrow.original.y, arrow.original.x) * (180 / Math.PI) + 180,
183
+ type: arrow.type === "ordinal" ? 1 : 2
184
+ }));
185
+
186
+ const initial_arrows = eventual_arrows.map((arrow) => ({
187
+ ...arrow,
188
+ x:
189
+ anchorPoint.x * box_size +
190
+ 14 * anchorPoint.x + // gaps
191
+ 14 + // padding
192
+ 10 + // arrow head
193
+ (arrow.x_dir * box_size) / 2 +
194
+ arrow.x_dir * (arrow.type === 1 ? 0 : 10), // offset based on direction
195
+
196
+ y:
197
+ anchorPoint.y * box_size +
198
+ 14 * anchorPoint.y +
199
+ 14 +
200
+ 10 +
201
+ (arrow.y_dir * box_size) / 2 +
202
+ arrow.y_dir * (arrow.type === 1 ? 0 : 10)
203
+ }));
204
+
205
+ return [initial_arrows, eventual_arrows];
206
+ }
207
+
208
+ onMount(() => {
209
+ handle_box_click(0);
210
+ });
137
211
  </script>
138
212
 
139
213
  <div class="wrap" class:expanded>
@@ -1,18 +1,20 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: Record<string, never>;
4
- events: {
5
- position: CustomEvent<"center" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top" | "bottom">;
6
- } & {
7
- [evt: string]: CustomEvent<any>;
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
8
11
  };
9
- slots: {};
10
- exports?: {} | undefined;
11
- bindings?: string | undefined;
12
- };
13
- export type AnchorProps = typeof __propDef.props;
14
- export type AnchorEvents = typeof __propDef.events;
15
- export type AnchorSlots = typeof __propDef.slots;
16
- export default class Anchor extends SvelteComponent<AnchorProps, AnchorEvents, AnchorSlots> {
12
+ z_$$bindings?: Bindings;
17
13
  }
18
- export {};
14
+ declare const Anchor: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ position: CustomEvent<"center" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top" | "bottom">;
16
+ } & {
17
+ [evt: string]: CustomEvent<any>;
18
+ }, {}, {}, string>;
19
+ type Anchor = InstanceType<typeof Anchor>;
20
+ export default Anchor;
@@ -1,39 +1,58 @@
1
- <script>import { createEventDispatcher } from "svelte";
2
- import { IconButton, IconButtonWrapper } from "@gradio/atoms";
3
- import {
4
- Check,
5
- Trash,
6
- ZoomIn,
7
- ZoomOut,
8
- Pan,
9
- Download,
10
- Undo,
11
- Redo
12
- } from "@gradio/icons";
13
- export let can_save = false;
14
- export let changeable = false;
15
- export let current_zoom = 1;
16
- export let tool;
17
- export let min_zoom = true;
18
- export let enable_download = false;
19
- export let can_undo;
20
- export let can_redo;
21
- const dispatch = createEventDispatcher();
22
- let show_zoom_popup = false;
23
- function handle_zoom_click(e) {
24
- e.stopPropagation();
25
- show_zoom_popup = !show_zoom_popup;
26
- }
27
- function handle_zoom_change(zoom) {
28
- dispatch("set_zoom", zoom);
29
- show_zoom_popup = false;
30
- }
31
- function handle_zoom_keydown(e) {
32
- if (e.key === "Enter") {
33
- handle_zoom_change(current_zoom);
34
- }
35
- }
36
- $: formatted_zoom = Math.round(current_zoom * 100);
1
+ <script lang="ts">
2
+ import { createEventDispatcher } from "svelte";
3
+ import { IconButton, IconButtonWrapper } from "@gradio/atoms";
4
+ import {
5
+ Check,
6
+ Trash,
7
+ ZoomIn,
8
+ ZoomOut,
9
+ Pan,
10
+ Download,
11
+ Undo,
12
+ Redo
13
+ } from "@gradio/icons";
14
+ import type { Writable } from "svelte/store";
15
+
16
+ export let can_save = false;
17
+ export let changeable = false;
18
+ export let current_zoom = 1;
19
+ export let tool: string;
20
+ export let min_zoom = true;
21
+ export let enable_download = false;
22
+ export let can_undo: boolean;
23
+ export let can_redo: boolean;
24
+
25
+ const dispatch = createEventDispatcher<{
26
+ remove_image: void;
27
+ undo: void;
28
+ redo: void;
29
+ save: void;
30
+ zoom_in: void;
31
+ zoom_out: void;
32
+ set_zoom: number | "fit";
33
+ pan: void;
34
+ download: void;
35
+ }>();
36
+
37
+ let show_zoom_popup = false;
38
+
39
+ function handle_zoom_click(e: MouseEvent): void {
40
+ e.stopPropagation();
41
+ show_zoom_popup = !show_zoom_popup;
42
+ }
43
+
44
+ function handle_zoom_change(zoom: number | "fit"): void {
45
+ dispatch("set_zoom", zoom);
46
+ show_zoom_popup = false;
47
+ }
48
+
49
+ function handle_zoom_keydown(e: KeyboardEvent): void {
50
+ if (e.key === "Enter") {
51
+ handle_zoom_change(current_zoom);
52
+ }
53
+ }
54
+
55
+ $: formatted_zoom = Math.round(current_zoom * 100);
37
56
  </script>
38
57
 
39
58
  <IconButtonWrapper>
@@ -1,35 +1,37 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- can_save?: boolean;
5
- changeable?: boolean;
6
- current_zoom?: number;
7
- tool: string;
8
- min_zoom?: boolean;
9
- enable_download?: boolean;
10
- can_undo: boolean;
11
- can_redo: boolean;
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
12
11
  };
13
- events: {
14
- remove_image: CustomEvent<void>;
15
- undo: CustomEvent<void>;
16
- redo: CustomEvent<void>;
17
- save: CustomEvent<void>;
18
- zoom_in: CustomEvent<void>;
19
- zoom_out: CustomEvent<void>;
20
- set_zoom: CustomEvent<number | "fit">;
21
- pan: CustomEvent<void>;
22
- download: CustomEvent<void>;
23
- } & {
24
- [evt: string]: CustomEvent<any>;
25
- };
26
- slots: {};
27
- exports?: {} | undefined;
28
- bindings?: string | undefined;
29
- };
30
- export type ControlsProps = typeof __propDef.props;
31
- export type ControlsEvents = typeof __propDef.events;
32
- export type ControlsSlots = typeof __propDef.slots;
33
- export default class Controls extends SvelteComponent<ControlsProps, ControlsEvents, ControlsSlots> {
12
+ z_$$bindings?: Bindings;
34
13
  }
35
- export {};
14
+ declare const Controls: $$__sveltets_2_IsomorphicComponent<{
15
+ can_save?: boolean;
16
+ changeable?: boolean;
17
+ current_zoom?: number;
18
+ tool: string;
19
+ min_zoom?: boolean;
20
+ enable_download?: boolean;
21
+ can_undo: boolean;
22
+ can_redo: boolean;
23
+ }, {
24
+ remove_image: CustomEvent<void>;
25
+ undo: CustomEvent<void>;
26
+ redo: CustomEvent<void>;
27
+ save: CustomEvent<void>;
28
+ zoom_in: CustomEvent<void>;
29
+ zoom_out: CustomEvent<void>;
30
+ set_zoom: CustomEvent<number | "fit">;
31
+ pan: CustomEvent<void>;
32
+ download: CustomEvent<void>;
33
+ } & {
34
+ [evt: string]: CustomEvent<any>;
35
+ }, {}, {}, string>;
36
+ type Controls = InstanceType<typeof Controls>;
37
+ export default Controls;
@@ -1,20 +1,22 @@
1
- <script>import {} from "svelte";
2
- export let Icon;
3
- export let label = "";
4
- export let show_label = false;
5
- export let pending = false;
6
- export let size = "small";
7
- export let padded = true;
8
- export let highlight = false;
9
- export let disabled = false;
10
- export let hasPopup = false;
11
- export let color = "var(--block-label-text-color)";
12
- export let transparent = false;
13
- export let background = "var(--background-fill-primary)";
14
- export let offset = 0;
15
- export let label_position = "left";
16
- export let roundedness = "quite";
17
- $: _color = highlight ? "var(--color-accent)" : color.toString();
1
+ <script lang="ts">
2
+ import { type ComponentType } from "svelte";
3
+ import type { ColorInput } from "tinycolor2";
4
+ export let Icon: ComponentType;
5
+ export let label = "";
6
+ export let show_label = false;
7
+ export let pending = false;
8
+ export let size: "small" | "large" | "medium" = "small";
9
+ export let padded = true;
10
+ export let highlight = false;
11
+ export let disabled = false;
12
+ export let hasPopup = false;
13
+ export let color: string | ColorInput = "var(--block-label-text-color)";
14
+ export let transparent = false;
15
+ export let background = "var(--background-fill-primary)";
16
+ export let offset = 0;
17
+ export let label_position: "left" | "right" = "left";
18
+ export let roundedness: "quite" | "very" = "quite";
19
+ $: _color = highlight ? "var(--color-accent)" : color.toString();
18
20
  </script>
19
21
 
20
22
  <button