@slopmachine/svelte 0.1.26 → 0.2.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # @slopmachine/svelte
2
+
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 15b923d: Switch pipeline execution parameters to use pipelineId (with optional siloId) instead of pipelineKey.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [15b923d]
12
+ - @slopmachine/core@0.2.0
package/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # @slopmachine/svelte
2
2
 
3
- The official Svelte wrapper for Slop Machine. Easily integrate Slop Machine image generation into your Svelte 5 applications.
3
+ The official Svelte SDK for Slop Machine. Easily integrate Slop Machine image, video, and text generation into your Svelte 5 applications.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @slopmachine/svelte
8
+ npm install @slopmachine/svelte @slopmachine/core
9
9
  # or
10
- yarn add @slopmachine/svelte
10
+ yarn add @slopmachine/svelte @slopmachine/core
11
11
  # or
12
- pnpm add @slopmachine/svelte
12
+ pnpm add @slopmachine/svelte @slopmachine/core
13
13
  ```
14
14
 
15
15
  ## Demo
@@ -18,33 +18,66 @@ https://docs.slopmachine.dev/demo-svelte/
18
18
 
19
19
  ## Usage
20
20
 
21
+ ### 1. Using Pre-Templated Buckets
22
+
21
23
  ```svelte
22
24
  <script lang="ts">
23
- import { SlopImage } from "@slopmachine/svelte";
25
+ import { SlopImage, SlopVideo, SlopText } from "@slopmachine/svelte";
24
26
  </script>
25
27
 
26
- <div style="width: 400px; height: 400px;">
28
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
27
29
  <SlopImage
28
- prompt={"A cute dog wearing a hat in a {style} style"}
30
+ bucketId="my-bucket-id"
29
31
  aspectRatio="1:1"
30
- variables={{ style: "realistic" }}
32
+ variables={{ style: "realistic", character: "owl" }}
33
+ class="rounded-lg shadow"
34
+ />
35
+
36
+ <SlopVideo
37
+ bucketId="my-video-bucket"
38
+ aspectRatio="16:9"
39
+ duration={4}
40
+ autoplay
41
+ loop
42
+ muted
43
+ />
44
+
45
+ <SlopText
46
+ bucketId="my-text-bucket"
47
+ variables={{ item: "magical sword" }}
31
48
  />
32
49
  </div>
33
50
  ```
34
51
 
35
- ## API / Props
52
+ ### 2. Using Dynamic Multi-Step Pipelines
53
+
54
+ Pipelines give developers runtime prompt flexibility and multi-step AI chaining:
55
+
56
+ ```svelte
57
+ <script lang="ts">
58
+ import { SlopImage, SlopVideo, SlopText } from "@slopmachine/svelte";
59
+ </script>
36
60
 
37
- ### `SlopImage`
61
+ <div>
62
+ <SlopImage
63
+ pipelineId="pipe_live_abc123"
64
+ prompt="A futuristic neon marketplace in Tokyo at dusk"
65
+ aspectRatio="16:9"
66
+ metadata={{ source: "user-generated-content" }}
67
+ />
38
68
 
39
- The `SlopImage` component inherits standard HTML `<img>` attributes and accepts the following additional props:
69
+ <SlopVideo
70
+ pipelineId="pipe_live_def456"
71
+ prompt="Hyperlapse sunset over Martian red sand dunes"
72
+ aspectRatio="9:16"
73
+ />
40
74
 
41
- | Prop | Type | Default | Description |
42
- | :------------ | :----------------------- | :----------- | :------------------------------------------------------ |
43
- | `prompt` | `string` | **Required** | The prompt to use for image generation. |
44
- | `aspectRatio` | `string` | `"1:1"` | The aspect ratio of the image (e.g. `"16:9"`, `"1:1"`). |
45
- | `variables` | `Record<string, string>` | `{}` | Variables to interpolate into the prompt. |
46
- | `model` | `string` | `undefined` | The AI model to use for generation. |
47
- | `baseUrl` | `string` | `undefined` | Custom base URL for the Slop Machine API. |
75
+ <SlopText
76
+ pipelineId="pipe_live_ghi789"
77
+ prompt="Write an intro paragraph for a sci-fi novel about sentient houseplants"
78
+ />
79
+ </div>
80
+ ```
48
81
 
49
82
  ## License
50
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slopmachine/svelte",
3
- "version": "0.1.26",
3
+ "version": "0.2.0",
4
4
  "llms": "https://docs.slopmachine.dev/llms.txt",
5
5
  "llmsFull": "https://docs.slopmachine.dev/llms-full.txt",
6
6
  "description": "The official Svelte SDK for Slop Machine",
@@ -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.25",
22
+ "@slopmachine/core": "^0.2.0",
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.26
18
+ @version 0.2.0
19
19
  -->
20
20
  <script lang="ts">
21
21
  import {
@@ -54,10 +54,14 @@
54
54
  }
55
55
 
56
56
  let {
57
- bucketId,
57
+ bucketId = undefined,
58
+ pipelineId = undefined,
59
+ siloId = undefined,
60
+ prompt = undefined,
61
+ metadata = undefined,
58
62
  aspectRatio = "1:1",
59
- version,
60
- resultId,
63
+ version = undefined,
64
+ resultId = undefined,
61
65
  quality = "fast",
62
66
  variables = {},
63
67
  baseUrl = undefined,
@@ -77,6 +81,10 @@
77
81
  let computedSrc = $derived(
78
82
  buildImageUrl({
79
83
  bucketId,
84
+ pipelineId,
85
+ siloId,
86
+ prompt,
87
+ metadata,
80
88
  aspectRatio,
81
89
  version,
82
90
  resultId,
@@ -23,11 +23,15 @@
23
23
  * </SlopText>
24
24
  * ```
25
25
  *
26
- * @version 0.1.26
26
+ * @version 0.2.0
27
27
  */
28
28
  interface Props {
29
29
  // SlopTextOptions
30
- bucketId: string;
30
+ bucketId?: string | undefined;
31
+ pipelineId?: string | undefined;
32
+ siloId?: string | undefined;
33
+ prompt?: string | undefined;
34
+ metadata?: Record<string, any> | undefined;
31
35
  version?: number | undefined;
32
36
  resultId?: string | undefined;
33
37
  model?: string | undefined;
@@ -42,7 +46,11 @@
42
46
  }
43
47
 
44
48
  let {
45
- bucketId,
49
+ bucketId = undefined,
50
+ pipelineId = undefined,
51
+ siloId = undefined,
52
+ prompt = undefined,
53
+ metadata = undefined,
46
54
  version = undefined,
47
55
  resultId = undefined,
48
56
  model = undefined,
@@ -70,6 +78,10 @@
70
78
 
71
79
  const url = buildTextUrl({
72
80
  bucketId,
81
+ pipelineId,
82
+ siloId,
83
+ prompt,
84
+ metadata,
73
85
  version,
74
86
  resultId,
75
87
  variables,
@@ -18,7 +18,7 @@
18
18
  />
19
19
  ```
20
20
 
21
- @version 0.1.26
21
+ @version 0.2.0
22
22
  -->
23
23
  <script lang="ts">
24
24
  import {
@@ -53,10 +53,14 @@
53
53
  }
54
54
 
55
55
  let {
56
- bucketId,
56
+ bucketId = undefined,
57
+ pipelineId = undefined,
58
+ siloId = undefined,
59
+ prompt = undefined,
60
+ metadata = undefined,
57
61
  aspectRatio = "16:9",
58
- version,
59
- resultId,
62
+ version = undefined,
63
+ resultId = undefined,
60
64
  model,
61
65
  quality = "fast",
62
66
  variables = {},
@@ -80,6 +84,10 @@
80
84
  let computedSrc = $derived(
81
85
  buildVideoUrl({
82
86
  bucketId,
87
+ pipelineId,
88
+ siloId,
89
+ prompt,
90
+ metadata,
83
91
  aspectRatio,
84
92
  version,
85
93
  resultId,
File without changes