lithesome 0.23.4 → 0.23.5

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.
@@ -27,13 +27,7 @@
27
27
  let ctx = createDropzoneRootContext({
28
28
  id: stateValue(() => id),
29
29
  ref: stateValue(() => ref!),
30
- files: stateValue(
31
- () => files,
32
- (v) => {
33
- files = v;
34
- onFilesChanged?.(v);
35
- }
36
- ),
30
+ files: stateValue(() => files),
37
31
  disabled: stateValue(
38
32
  () => disabled,
39
33
  (v) => (disabled = v)
@@ -43,7 +37,8 @@
43
37
  accept: stateValue(() => accept),
44
38
  onError,
45
39
  onSuccess,
46
- validate
40
+ validate,
41
+ onFilesChanged
47
42
  });
48
43
  </script>
49
44
 
@@ -10,6 +10,10 @@ class DropzoneRoot {
10
10
  sharedIds = new SvelteMap();
11
11
  constructor(props) {
12
12
  this.$$ = props;
13
+ $effect(() => {
14
+ this.$$.onFilesChanged?.($state.snapshot(this.$$.files.val));
15
+ this.errorsFound = false;
16
+ });
13
17
  }
14
18
  checkFileType = (file) => {
15
19
  const fileExtension = file.name.split('.').pop()?.toLowerCase();
@@ -25,4 +25,4 @@
25
25
  });
26
26
  </script>
27
27
 
28
- <Element bind:ref {children} {custom} {ctx} {...props} />
28
+ <Element bind:ref as="button" {children} {custom} {ctx} {...props} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lithesome",
3
- "version": "0.23.4",
3
+ "version": "0.23.5",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "bun --bun vite build && npm run prepack",