@d34dman/flowdrop 0.0.30 → 0.0.32

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 (53) hide show
  1. package/dist/components/App.svelte +54 -6
  2. package/dist/components/NodeSidebar.svelte +1 -1
  3. package/dist/components/SchemaForm.svelte +14 -14
  4. package/dist/components/SchemaForm.svelte.d.ts +1 -1
  5. package/dist/components/form/FormFieldLight.svelte +66 -66
  6. package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
  7. package/dist/components/form/types.d.ts +1 -1
  8. package/dist/components/playground/ChatPanel.svelte +523 -0
  9. package/dist/components/playground/ChatPanel.svelte.d.ts +20 -0
  10. package/dist/components/playground/ExecutionLogs.svelte +486 -0
  11. package/dist/components/playground/ExecutionLogs.svelte.d.ts +14 -0
  12. package/dist/components/playground/InputCollector.svelte +444 -0
  13. package/dist/components/playground/InputCollector.svelte.d.ts +16 -0
  14. package/dist/components/playground/MessageBubble.svelte +398 -0
  15. package/dist/components/playground/MessageBubble.svelte.d.ts +15 -0
  16. package/dist/components/playground/Playground.svelte +861 -0
  17. package/dist/components/playground/Playground.svelte.d.ts +25 -0
  18. package/dist/components/playground/PlaygroundModal.svelte +220 -0
  19. package/dist/components/playground/PlaygroundModal.svelte.d.ts +25 -0
  20. package/dist/components/playground/SessionManager.svelte +537 -0
  21. package/dist/components/playground/SessionManager.svelte.d.ts +20 -0
  22. package/dist/config/endpoints.d.ts +16 -0
  23. package/dist/config/endpoints.js +9 -0
  24. package/dist/core/index.d.ts +25 -23
  25. package/dist/core/index.js +13 -12
  26. package/dist/display/index.d.ts +2 -2
  27. package/dist/display/index.js +2 -2
  28. package/dist/editor/index.d.ts +58 -49
  29. package/dist/editor/index.js +53 -42
  30. package/dist/form/code.d.ts +4 -4
  31. package/dist/form/code.js +11 -11
  32. package/dist/form/fieldRegistry.d.ts +2 -2
  33. package/dist/form/fieldRegistry.js +8 -10
  34. package/dist/form/full.d.ts +5 -5
  35. package/dist/form/full.js +7 -7
  36. package/dist/form/index.d.ts +16 -16
  37. package/dist/form/index.js +14 -14
  38. package/dist/form/markdown.d.ts +3 -3
  39. package/dist/form/markdown.js +6 -6
  40. package/dist/index.d.ts +6 -4
  41. package/dist/index.js +9 -4
  42. package/dist/playground/index.d.ts +125 -0
  43. package/dist/playground/index.js +147 -0
  44. package/dist/playground/mount.d.ts +184 -0
  45. package/dist/playground/mount.js +209 -0
  46. package/dist/services/playgroundService.d.ts +129 -0
  47. package/dist/services/playgroundService.js +317 -0
  48. package/dist/stores/playgroundStore.d.ts +199 -0
  49. package/dist/stores/playgroundStore.js +350 -0
  50. package/dist/types/playground.d.ts +230 -0
  51. package/dist/types/playground.js +28 -0
  52. package/dist/utils/colors.js +4 -4
  53. package/package.json +6 -1
@@ -0,0 +1,25 @@
1
+ import type { Workflow } from '../../types/index.js';
2
+ import type { EndpointConfig } from '../../config/endpoints.js';
3
+ import type { PlaygroundMode, PlaygroundConfig } from '../../types/playground.js';
4
+ /**
5
+ * Component props
6
+ */
7
+ interface Props {
8
+ /** Target workflow ID */
9
+ workflowId: string;
10
+ /** Pre-loaded workflow (optional, will be fetched if not provided) */
11
+ workflow?: Workflow;
12
+ /** Display mode: embedded (panel) or standalone (page) */
13
+ mode?: PlaygroundMode;
14
+ /** Resume a specific session */
15
+ initialSessionId?: string;
16
+ /** API endpoint configuration */
17
+ endpointConfig?: EndpointConfig;
18
+ /** Playground configuration options */
19
+ config?: PlaygroundConfig;
20
+ /** Callback when playground is closed (for embedded mode) */
21
+ onClose?: () => void;
22
+ }
23
+ declare const Playground: import("svelte").Component<Props, {}, "">;
24
+ type Playground = ReturnType<typeof Playground>;
25
+ export default Playground;
@@ -0,0 +1,220 @@
1
+ <!--
2
+ PlaygroundModal Component
3
+
4
+ Modal wrapper for the Playground component.
5
+ Provides a centered modal dialog with backdrop, similar to Langflow's implementation.
6
+ Supports closing via backdrop click, Escape key, or close button.
7
+ -->
8
+
9
+ <script lang="ts">
10
+ import Icon from "@iconify/svelte";
11
+ import Playground from "./Playground.svelte";
12
+ import type { Workflow } from "../../types/index.js";
13
+ import type { EndpointConfig } from "../../config/endpoints.js";
14
+ import type { PlaygroundConfig } from "../../types/playground.js";
15
+
16
+ /**
17
+ * Component props
18
+ */
19
+ interface Props {
20
+ /** Whether the modal is open */
21
+ isOpen: boolean;
22
+ /** Target workflow ID */
23
+ workflowId: string;
24
+ /** Pre-loaded workflow (optional, will be fetched if not provided) */
25
+ workflow?: Workflow;
26
+ /** Resume a specific session */
27
+ initialSessionId?: string;
28
+ /** API endpoint configuration */
29
+ endpointConfig?: EndpointConfig;
30
+ /** Playground configuration options */
31
+ config?: PlaygroundConfig;
32
+ /** Callback when modal is closed */
33
+ onClose: () => void;
34
+ }
35
+
36
+ let {
37
+ isOpen,
38
+ workflowId,
39
+ workflow,
40
+ initialSessionId,
41
+ endpointConfig,
42
+ config = {},
43
+ onClose
44
+ }: Props = $props();
45
+
46
+ /**
47
+ * Close modal on Escape key
48
+ */
49
+ function handleKeydown(event: KeyboardEvent): void {
50
+ if (event.key === "Escape") {
51
+ onClose();
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Close modal when clicking outside (on backdrop)
57
+ */
58
+ function handleBackdropClick(event: MouseEvent): void {
59
+ if (event.target === event.currentTarget) {
60
+ onClose();
61
+ }
62
+ }
63
+ </script>
64
+
65
+ {#if isOpen}
66
+ <!-- Modal Backdrop -->
67
+ <div
68
+ class="playground-modal-backdrop"
69
+ onclick={handleBackdropClick}
70
+ onkeydown={handleKeydown}
71
+ role="dialog"
72
+ aria-modal="true"
73
+ aria-labelledby="playground-modal-title"
74
+ tabindex="-1"
75
+ >
76
+ <!-- Modal Container -->
77
+ <div class="playground-modal" onclick={(e) => e.stopPropagation()}>
78
+ <!-- Modal Header -->
79
+ <div class="playground-modal__header">
80
+ <div class="playground-modal__title" id="playground-modal-title">
81
+ <Icon icon="mdi:play-circle-outline" />
82
+ <span>Playground</span>
83
+ </div>
84
+ <button
85
+ type="button"
86
+ class="playground-modal__close-btn"
87
+ onclick={onClose}
88
+ aria-label="Close playground modal"
89
+ >
90
+ <Icon icon="mdi:close" />
91
+ </button>
92
+ </div>
93
+
94
+ <!-- Modal Content -->
95
+ <div class="playground-modal__content">
96
+ <Playground
97
+ {workflowId}
98
+ {workflow}
99
+ mode="modal"
100
+ {initialSessionId}
101
+ {endpointConfig}
102
+ {config}
103
+ {onClose}
104
+ />
105
+ </div>
106
+ </div>
107
+ </div>
108
+ {/if}
109
+
110
+ <style>
111
+ .playground-modal-backdrop {
112
+ position: fixed;
113
+ top: 0;
114
+ left: 0;
115
+ right: 0;
116
+ bottom: 0;
117
+ background-color: rgba(0, 0, 0, 0.5);
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: center;
121
+ z-index: 1100;
122
+ padding: 1rem;
123
+ }
124
+
125
+ .playground-modal {
126
+ background: white;
127
+ border-radius: 0.75rem;
128
+ box-shadow:
129
+ 0 20px 25px -5px rgba(0, 0, 0, 0.1),
130
+ 0 10px 10px -5px rgba(0, 0, 0, 0.04);
131
+ width: 100%;
132
+ max-width: 90vw;
133
+ min-width: 800px;
134
+ max-height: 90vh;
135
+ display: flex;
136
+ flex-direction: column;
137
+ overflow: hidden;
138
+ }
139
+
140
+ .playground-modal__header {
141
+ display: flex;
142
+ align-items: center;
143
+ justify-content: space-between;
144
+ padding: 1rem 1.25rem;
145
+ border-bottom: 1px solid #e5e7eb;
146
+ background-color: #fafbfc;
147
+ flex-shrink: 0;
148
+ }
149
+
150
+ .playground-modal__title {
151
+ display: flex;
152
+ align-items: center;
153
+ gap: 0.5rem;
154
+ font-size: 1rem;
155
+ font-weight: 600;
156
+ color: #1f2937;
157
+ margin: 0;
158
+ }
159
+
160
+ .playground-modal__close-btn {
161
+ display: flex;
162
+ align-items: center;
163
+ justify-content: center;
164
+ width: 2rem;
165
+ height: 2rem;
166
+ border: none;
167
+ background: transparent;
168
+ border-radius: 0.375rem;
169
+ color: #6b7280;
170
+ cursor: pointer;
171
+ transition: all 0.2s;
172
+ }
173
+
174
+ .playground-modal__close-btn:hover {
175
+ background-color: #f3f4f6;
176
+ color: #374151;
177
+ }
178
+
179
+ .playground-modal__content {
180
+ flex: 1;
181
+ min-height: 0;
182
+ display: flex;
183
+ flex-direction: column;
184
+ overflow: hidden;
185
+ padding: 0;
186
+ }
187
+
188
+ /* Responsive adjustments */
189
+ @media (max-width: 1024px) {
190
+ .playground-modal {
191
+ max-width: 95vw;
192
+ min-width: 600px;
193
+ }
194
+ }
195
+
196
+ @media (max-width: 768px) {
197
+ .playground-modal {
198
+ max-width: 100%;
199
+ min-width: auto;
200
+ max-height: 100vh;
201
+ border-radius: 0;
202
+ margin: 0;
203
+ }
204
+
205
+ .playground-modal-backdrop {
206
+ padding: 0;
207
+ }
208
+
209
+ .playground-modal__header {
210
+ padding: 0.875rem 1rem;
211
+ }
212
+ }
213
+
214
+ @media (max-width: 640px) {
215
+ .playground-modal {
216
+ max-width: 100%;
217
+ max-height: 100vh;
218
+ }
219
+ }
220
+ </style>
@@ -0,0 +1,25 @@
1
+ import type { Workflow } from "../../types/index.js";
2
+ import type { EndpointConfig } from "../../config/endpoints.js";
3
+ import type { PlaygroundConfig } from "../../types/playground.js";
4
+ /**
5
+ * Component props
6
+ */
7
+ interface Props {
8
+ /** Whether the modal is open */
9
+ isOpen: boolean;
10
+ /** Target workflow ID */
11
+ workflowId: string;
12
+ /** Pre-loaded workflow (optional, will be fetched if not provided) */
13
+ workflow?: Workflow;
14
+ /** Resume a specific session */
15
+ initialSessionId?: string;
16
+ /** API endpoint configuration */
17
+ endpointConfig?: EndpointConfig;
18
+ /** Playground configuration options */
19
+ config?: PlaygroundConfig;
20
+ /** Callback when modal is closed */
21
+ onClose: () => void;
22
+ }
23
+ declare const PlaygroundModal: import("svelte").Component<Props, {}, "">;
24
+ type PlaygroundModal = ReturnType<typeof PlaygroundModal>;
25
+ export default PlaygroundModal;