@slopmachine/svelte 0.1.21 → 0.1.24

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/README.md CHANGED
@@ -14,7 +14,7 @@ pnpm add @slopmachine/svelte
14
14
 
15
15
  ## Demo
16
16
 
17
- https://slopmachine-dev.github.io/slopmachine-sdk/demo-svelte/
17
+ https://docs.slopmachine.dev/demo-svelte/
18
18
 
19
19
  ## Usage
20
20
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@slopmachine/svelte",
3
- "version": "0.1.21",
4
- "llms": "https://slopmachine-dev.github.io/slopmachine-sdk/llms.txt",
5
- "llmsFull": "https://slopmachine-dev.github.io/slopmachine-sdk/llms-full.txt",
3
+ "version": "0.1.24",
4
+ "llms": "https://docs.slopmachine.dev/llms.txt",
5
+ "llmsFull": "https://docs.slopmachine.dev/llms-full.txt",
6
6
  "description": "The official Svelte SDK for Slop Machine",
7
7
  "type": "module",
8
8
  "main": "src/index.ts",
@@ -19,7 +19,7 @@
19
19
  "url": "git+https://github.com/slopmachine-dev/slopmachine-sdk.git"
20
20
  },
21
21
  "dependencies": {
22
- "@slopmachine/core": "^0.1.20",
22
+ "@slopmachine/core": "^0.1.24",
23
23
  "@types/marked": "^5.0.2",
24
24
  "marked": "^17.0.4"
25
25
  },
@@ -15,7 +15,7 @@
15
15
  />
16
16
  ```
17
17
 
18
- @version 0.1.21
18
+ @version 0.1.24
19
19
  -->
20
20
  <script lang="ts">
21
21
  import {
@@ -60,6 +60,7 @@
60
60
  quality = "fast",
61
61
  variables = {},
62
62
  baseUrl = undefined,
63
+ original = false,
63
64
  class: className = "",
64
65
  objectFit = "cover",
65
66
  imageClass = "",
@@ -78,6 +79,7 @@
78
79
  variables,
79
80
  baseUrl,
80
81
  quality,
82
+ original,
81
83
  }),
82
84
  );
83
85
  let src = $state("");
@@ -113,7 +115,8 @@
113
115
  const errRes = await fetch(src, {
114
116
  signal: abortController.signal,
115
117
  });
116
- const errorData = await errRes.json();
118
+ const errorText = await errRes.text();
119
+ const errorData = JSON.parse(errorText);
117
120
  if (errorData.error) {
118
121
  errorMessage = errorData.error;
119
122
  }
@@ -23,7 +23,7 @@
23
23
  * </SlopText>
24
24
  * ```
25
25
  *
26
- * @version 0.1.21
26
+ * @version 0.1.24
27
27
  */
28
28
  interface Props {
29
29
  // SlopTextOptions
@@ -78,7 +78,8 @@
78
78
  if (!response.ok) {
79
79
  let errorMessage = response.statusText;
80
80
  try {
81
- const errorData = await response.json();
81
+ const errorText = await response.text();
82
+ const errorData = JSON.parse(errorText);
82
83
  if (errorData.error) {
83
84
  errorMessage = errorData.error;
84
85
  }
@@ -93,8 +94,10 @@
93
94
  }
94
95
  } catch (err) {
95
96
  if (isMounted) {
96
- error =
97
+ const finalError =
97
98
  err instanceof Error ? err : new Error("Failed to generate text");
99
+ console.error(finalError);
100
+ error = finalError;
98
101
  }
99
102
  } finally {
100
103
  if (isMounted) {
@@ -18,7 +18,7 @@
18
18
  />
19
19
  ```
20
20
 
21
- @version 0.1.21
21
+ @version 0.1.24
22
22
  -->
23
23
  <script lang="ts">
24
24
  import {
@@ -62,6 +62,7 @@
62
62
  variables = {},
63
63
  duration,
64
64
  baseUrl = undefined,
65
+ original = false,
65
66
  class: className = "",
66
67
  loader,
67
68
  autoplay = true,
@@ -83,6 +84,7 @@
83
84
  duration,
84
85
  baseUrl,
85
86
  quality,
87
+ original,
86
88
  }),
87
89
  );
88
90
  let src = $state("");
@@ -117,7 +119,8 @@
117
119
  const errRes = await fetch(src, {
118
120
  signal: abortController.signal,
119
121
  });
120
- const errorData = await errRes.json();
122
+ const errorText = await errRes.text();
123
+ const errorData = JSON.parse(errorText);
121
124
  if (errorData.error) {
122
125
  errorMessage = errorData.error;
123
126
  }