@signal9/era-ui 2.2.0 → 2.4.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.
Files changed (189) hide show
  1. package/dist/ai/actions/action.svelte +41 -0
  2. package/dist/ai/actions/action.svelte.d.ts +12 -0
  3. package/dist/ai/actions/actions.svelte +15 -0
  4. package/dist/ai/actions/actions.svelte.d.ts +8 -0
  5. package/dist/ai/actions/index.d.ts +2 -0
  6. package/dist/ai/actions/index.js +2 -0
  7. package/dist/ai/artifact/artifact-actions.svelte +7 -0
  8. package/dist/ai/artifact/artifact-actions.svelte.d.ts +8 -0
  9. package/dist/ai/artifact/artifact-close.svelte +9 -0
  10. package/dist/ai/artifact/artifact-close.svelte.d.ts +6 -0
  11. package/dist/ai/artifact/artifact-content.svelte +7 -0
  12. package/dist/ai/artifact/artifact-content.svelte.d.ts +8 -0
  13. package/dist/ai/artifact/artifact-description.svelte +7 -0
  14. package/dist/ai/artifact/artifact-description.svelte.d.ts +8 -0
  15. package/dist/ai/artifact/artifact-header.svelte +16 -0
  16. package/dist/ai/artifact/artifact-header.svelte.d.ts +8 -0
  17. package/dist/ai/artifact/artifact-title.svelte +7 -0
  18. package/dist/ai/artifact/artifact-title.svelte.d.ts +8 -0
  19. package/dist/ai/artifact/artifact.svelte +16 -0
  20. package/dist/ai/artifact/artifact.svelte.d.ts +8 -0
  21. package/dist/ai/artifact/index.d.ts +8 -0
  22. package/dist/ai/artifact/index.js +8 -0
  23. package/dist/ai/chain-of-thought/chain-of-thought-step.svelte +39 -0
  24. package/dist/ai/chain-of-thought/chain-of-thought-step.svelte.d.ts +11 -0
  25. package/dist/ai/chain-of-thought/chain-of-thought.svelte +30 -0
  26. package/dist/ai/chain-of-thought/chain-of-thought.svelte.d.ts +11 -0
  27. package/dist/ai/chain-of-thought/index.d.ts +3 -0
  28. package/dist/ai/chain-of-thought/index.js +3 -0
  29. package/dist/ai/checkpoint.svelte +27 -0
  30. package/dist/ai/checkpoint.svelte.d.ts +10 -0
  31. package/dist/ai/confirmation/confirmation-actions.svelte +9 -0
  32. package/dist/ai/confirmation/confirmation-actions.svelte.d.ts +8 -0
  33. package/dist/ai/confirmation/confirmation.svelte +36 -0
  34. package/dist/ai/confirmation/confirmation.svelte.d.ts +11 -0
  35. package/dist/ai/confirmation/index.d.ts +2 -0
  36. package/dist/ai/confirmation/index.js +2 -0
  37. package/dist/ai/context/context.svelte +49 -0
  38. package/dist/ai/context/context.svelte.d.ts +9 -0
  39. package/dist/ai/context/index.d.ts +1 -0
  40. package/dist/ai/context/index.js +1 -0
  41. package/dist/ai/conversation/context.d.ts +3 -0
  42. package/dist/ai/conversation/context.js +12 -0
  43. package/dist/ai/conversation/conversation-content.svelte +32 -0
  44. package/dist/ai/conversation/conversation-content.svelte.d.ts +8 -0
  45. package/dist/ai/conversation/conversation-empty-state.svelte +32 -0
  46. package/dist/ai/conversation/conversation-empty-state.svelte.d.ts +11 -0
  47. package/dist/ai/conversation/conversation-scroll-button.svelte +27 -0
  48. package/dist/ai/conversation/conversation-scroll-button.svelte.d.ts +6 -0
  49. package/dist/ai/conversation/conversation.svelte +21 -0
  50. package/dist/ai/conversation/conversation.svelte.d.ts +8 -0
  51. package/dist/ai/conversation/index.d.ts +5 -0
  52. package/dist/ai/conversation/index.js +5 -0
  53. package/dist/ai/copy-button.svelte +42 -0
  54. package/dist/ai/copy-button.svelte.d.ts +8 -0
  55. package/dist/ai/image.svelte +19 -0
  56. package/dist/ai/image.svelte.d.ts +8 -0
  57. package/dist/ai/index.d.ts +29 -0
  58. package/dist/ai/index.js +31 -0
  59. package/dist/ai/inline-citation/index.d.ts +1 -0
  60. package/dist/ai/inline-citation/index.js +1 -0
  61. package/dist/ai/inline-citation/inline-citation.svelte +66 -0
  62. package/dist/ai/inline-citation/inline-citation.svelte.d.ts +11 -0
  63. package/dist/ai/loader.svelte +8 -0
  64. package/dist/ai/loader.svelte.d.ts +6 -0
  65. package/dist/ai/message/branch.svelte.d.ts +10 -0
  66. package/dist/ai/message/branch.svelte.js +28 -0
  67. package/dist/ai/message/context.d.ts +6 -0
  68. package/dist/ai/message/context.js +1 -0
  69. package/dist/ai/message/index.d.ts +8 -0
  70. package/dist/ai/message/index.js +7 -0
  71. package/dist/ai/message/message-branch-content.svelte +24 -0
  72. package/dist/ai/message/message-branch-content.svelte.d.ts +10 -0
  73. package/dist/ai/message/message-branch-selector.svelte +25 -0
  74. package/dist/ai/message/message-branch-selector.svelte.d.ts +6 -0
  75. package/dist/ai/message/message-branch.svelte +25 -0
  76. package/dist/ai/message/message-branch.svelte.d.ts +9 -0
  77. package/dist/ai/message/message-content.svelte +24 -0
  78. package/dist/ai/message/message-content.svelte.d.ts +8 -0
  79. package/dist/ai/message/message-toolbar.svelte +23 -0
  80. package/dist/ai/message/message-toolbar.svelte.d.ts +8 -0
  81. package/dist/ai/message/message.svelte +27 -0
  82. package/dist/ai/message/message.svelte.d.ts +10 -0
  83. package/dist/ai/model-selector/index.d.ts +1 -0
  84. package/dist/ai/model-selector/index.js +1 -0
  85. package/dist/ai/model-selector/model-selector.svelte +61 -0
  86. package/dist/ai/model-selector/model-selector.svelte.d.ts +15 -0
  87. package/dist/ai/open-in-chat/index.d.ts +1 -0
  88. package/dist/ai/open-in-chat/index.js +1 -0
  89. package/dist/ai/open-in-chat/open-in-chat.svelte +41 -0
  90. package/dist/ai/open-in-chat/open-in-chat.svelte.d.ts +32 -0
  91. package/dist/ai/plan/index.d.ts +3 -0
  92. package/dist/ai/plan/index.js +3 -0
  93. package/dist/ai/plan/plan-content.svelte +13 -0
  94. package/dist/ai/plan/plan-content.svelte.d.ts +8 -0
  95. package/dist/ai/plan/plan-header.svelte +22 -0
  96. package/dist/ai/plan/plan-header.svelte.d.ts +9 -0
  97. package/dist/ai/plan/plan.svelte +23 -0
  98. package/dist/ai/plan/plan.svelte.d.ts +10 -0
  99. package/dist/ai/prompt-input/attachments.svelte.d.ts +27 -0
  100. package/dist/ai/prompt-input/attachments.svelte.js +60 -0
  101. package/dist/ai/prompt-input/index.d.ts +7 -0
  102. package/dist/ai/prompt-input/index.js +7 -0
  103. package/dist/ai/prompt-input/prompt-input-add-attachments.svelte +12 -0
  104. package/dist/ai/prompt-input/prompt-input-add-attachments.svelte.d.ts +6 -0
  105. package/dist/ai/prompt-input/prompt-input-attachments.svelte +40 -0
  106. package/dist/ai/prompt-input/prompt-input-attachments.svelte.d.ts +18 -0
  107. package/dist/ai/prompt-input/prompt-input-submit.svelte +49 -0
  108. package/dist/ai/prompt-input/prompt-input-submit.svelte.d.ts +10 -0
  109. package/dist/ai/prompt-input/prompt-input-textarea.svelte +57 -0
  110. package/dist/ai/prompt-input/prompt-input-textarea.svelte.d.ts +7 -0
  111. package/dist/ai/prompt-input/prompt-input-toolbar.svelte +15 -0
  112. package/dist/ai/prompt-input/prompt-input-toolbar.svelte.d.ts +8 -0
  113. package/dist/ai/prompt-input/prompt-input.svelte +98 -0
  114. package/dist/ai/prompt-input/prompt-input.svelte.d.ts +17 -0
  115. package/dist/ai/queue/index.d.ts +2 -0
  116. package/dist/ai/queue/index.js +2 -0
  117. package/dist/ai/queue/queue-item.svelte +26 -0
  118. package/dist/ai/queue/queue-item.svelte.d.ts +9 -0
  119. package/dist/ai/queue/queue.svelte +14 -0
  120. package/dist/ai/queue/queue.svelte.d.ts +8 -0
  121. package/dist/ai/reasoning/index.d.ts +3 -0
  122. package/dist/ai/reasoning/index.js +3 -0
  123. package/dist/ai/reasoning/reasoning-trigger.svelte +22 -0
  124. package/dist/ai/reasoning/reasoning-trigger.svelte.d.ts +9 -0
  125. package/dist/ai/reasoning/reasoning.svelte +52 -0
  126. package/dist/ai/reasoning/reasoning.svelte.d.ts +13 -0
  127. package/dist/ai/response/index.d.ts +2 -0
  128. package/dist/ai/response/index.js +2 -0
  129. package/dist/ai/response/repair.d.ts +7 -0
  130. package/dist/ai/response/repair.js +26 -0
  131. package/dist/ai/response/response.svelte +112 -0
  132. package/dist/ai/response/response.svelte.d.ts +10 -0
  133. package/dist/ai/shimmer.svelte +15 -0
  134. package/dist/ai/shimmer.svelte.d.ts +9 -0
  135. package/dist/ai/sources/index.d.ts +4 -0
  136. package/dist/ai/sources/index.js +4 -0
  137. package/dist/ai/sources/source.svelte +16 -0
  138. package/dist/ai/sources/source.svelte.d.ts +7 -0
  139. package/dist/ai/sources/sources-trigger.svelte +12 -0
  140. package/dist/ai/sources/sources-trigger.svelte.d.ts +8 -0
  141. package/dist/ai/sources/sources.svelte +15 -0
  142. package/dist/ai/sources/sources.svelte.d.ts +9 -0
  143. package/dist/ai/suggestion/index.d.ts +2 -0
  144. package/dist/ai/suggestion/index.js +2 -0
  145. package/dist/ai/suggestion/suggestion.svelte +25 -0
  146. package/dist/ai/suggestion/suggestion.svelte.d.ts +10 -0
  147. package/dist/ai/suggestion/suggestions.svelte +18 -0
  148. package/dist/ai/suggestion/suggestions.svelte.d.ts +8 -0
  149. package/dist/ai/task/index.d.ts +5 -0
  150. package/dist/ai/task/index.js +5 -0
  151. package/dist/ai/task/task-content.svelte +14 -0
  152. package/dist/ai/task/task-content.svelte.d.ts +8 -0
  153. package/dist/ai/task/task-item-file.svelte +8 -0
  154. package/dist/ai/task/task-item-file.svelte.d.ts +7 -0
  155. package/dist/ai/task/task-item.svelte +8 -0
  156. package/dist/ai/task/task-item.svelte.d.ts +8 -0
  157. package/dist/ai/task/task-trigger.svelte +12 -0
  158. package/dist/ai/task/task-trigger.svelte.d.ts +8 -0
  159. package/dist/ai/task/task.svelte +17 -0
  160. package/dist/ai/task/task.svelte.d.ts +11 -0
  161. package/dist/ai/tool/index.d.ts +5 -0
  162. package/dist/ai/tool/index.js +5 -0
  163. package/dist/ai/tool/tool-header.svelte +20 -0
  164. package/dist/ai/tool/tool-header.svelte.d.ts +9 -0
  165. package/dist/ai/tool/tool-input.svelte +10 -0
  166. package/dist/ai/tool/tool-input.svelte.d.ts +6 -0
  167. package/dist/ai/tool/tool-output.svelte +20 -0
  168. package/dist/ai/tool/tool-output.svelte.d.ts +7 -0
  169. package/dist/ai/tool/tool.svelte +41 -0
  170. package/dist/ai/tool/tool.svelte.d.ts +12 -0
  171. package/dist/ai/web-preview/index.d.ts +1 -0
  172. package/dist/ai/web-preview/index.js +1 -0
  173. package/dist/ai/web-preview/web-preview.svelte +48 -0
  174. package/dist/ai/web-preview/web-preview.svelte.d.ts +8 -0
  175. package/dist/ai/workflow/canvas.svelte +19 -0
  176. package/dist/ai/workflow/canvas.svelte.d.ts +11 -0
  177. package/dist/ai/workflow/index.d.ts +2 -0
  178. package/dist/ai/workflow/index.js +2 -0
  179. package/dist/ai/workflow/node.svelte +27 -0
  180. package/dist/ai/workflow/node.svelte.d.ts +9 -0
  181. package/dist/era-ui.css +1 -1
  182. package/dist/generated-docs/llm-shell.md +3 -0
  183. package/dist/generated-docs/llms-full.txt +8 -0
  184. package/dist/generated-docs/llms.txt +1 -1
  185. package/dist/generated-docs/manifest.json +8 -0
  186. package/dist/index.d.ts +1 -0
  187. package/dist/index.js +1 -0
  188. package/dist/ui/step/step-content.svelte +3 -3
  189. package/package.json +14 -1
@@ -0,0 +1,5 @@
1
+ export { default as Root } from './task.svelte';
2
+ export { default as Trigger } from './task-trigger.svelte';
3
+ export { default as Content } from './task-content.svelte';
4
+ export { default as Item } from './task-item.svelte';
5
+ export { default as ItemFile } from './task-item-file.svelte';
@@ -0,0 +1,5 @@
1
+ export { default as Root } from './task.svelte';
2
+ export { default as Trigger } from './task-trigger.svelte';
3
+ export { default as Content } from './task-content.svelte';
4
+ export { default as Item } from './task-item.svelte';
5
+ export { default as ItemFile } from './task-item-file.svelte';
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import * as Step from '../../ui/step/index.js';
4
+ import { cn } from '../../utils/index.js';
5
+
6
+ let { children, class: className }: { children?: Snippet; class?: string } = $props();
7
+ </script>
8
+
9
+ <!-- The task log rail: items hang off a left border, terminal-trace style. -->
10
+ <Step.Content
11
+ class={cn('border-s-2 border-divider-faded bg-transparent p-0 ps-(--era-pad-sm) shadow-none', className)}
12
+ >
13
+ {@render children?.()}
14
+ </Step.Content>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ class?: string;
5
+ };
6
+ declare const TaskContent: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type TaskContent = ReturnType<typeof TaskContent>;
8
+ export default TaskContent;
@@ -0,0 +1,8 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { Chip } from '../../ui/chip/index.js';
4
+
5
+ let { children }: { children?: Snippet } = $props();
6
+ </script>
7
+
8
+ <Chip>{@render children?.()}</Chip>
@@ -0,0 +1,7 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ };
5
+ declare const TaskItemFile: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type TaskItemFile = ReturnType<typeof TaskItemFile>;
7
+ export default TaskItemFile;
@@ -0,0 +1,8 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { cn } from '../../utils/index.js';
4
+
5
+ let { children, class: className }: { children?: Snippet; class?: string } = $props();
6
+ </script>
7
+
8
+ <div class={cn('min-w-0 text-body text-muted', className)}>{@render children?.()}</div>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ class?: string;
5
+ };
6
+ declare const TaskItem: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type TaskItem = ReturnType<typeof TaskItem>;
8
+ export default TaskItem;
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import Search from '@lucide/svelte/icons/search';
4
+ import * as Step from '../../ui/step/index.js';
5
+
6
+ let { title, children }: { title?: string; children?: Snippet } = $props();
7
+ </script>
8
+
9
+ <Step.Summary>
10
+ <Search class="size-(--era-h-xs) shrink-0" aria-hidden="true" />
11
+ {#if children}{@render children()}{:else}{title}{/if}
12
+ </Step.Summary>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ title?: string;
4
+ children?: Snippet;
5
+ };
6
+ declare const TaskTrigger: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type TaskTrigger = ReturnType<typeof TaskTrigger>;
8
+ export default TaskTrigger;
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { StepStatus } from '../../ui/step/index.js';
4
+ import * as Step from '../../ui/step/index.js';
5
+ import { cn } from '../../utils/index.js';
6
+
7
+ let {
8
+ open = $bindable(true),
9
+ status = 'done',
10
+ children,
11
+ class: className
12
+ }: { open?: boolean; status?: StepStatus; children?: Snippet; class?: string } = $props();
13
+ </script>
14
+
15
+ <Step.Root {status} bind:open class={cn(className)}>
16
+ {@render children?.()}
17
+ </Step.Root>
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { StepStatus } from '../../ui/step/index.js';
3
+ type $$ComponentProps = {
4
+ open?: boolean;
5
+ status?: StepStatus;
6
+ children?: Snippet;
7
+ class?: string;
8
+ };
9
+ declare const Task: import("svelte").Component<$$ComponentProps, {}, "open">;
10
+ type Task = ReturnType<typeof Task>;
11
+ export default Task;
@@ -0,0 +1,5 @@
1
+ export { default as Root, type ToolState } from './tool.svelte';
2
+ export { default as Header } from './tool-header.svelte';
3
+ export { default as Input } from './tool-input.svelte';
4
+ export { default as Output } from './tool-output.svelte';
5
+ export { Content } from '../../ui/step/index.js';
@@ -0,0 +1,5 @@
1
+ export { default as Root } from './tool.svelte';
2
+ export { default as Header } from './tool-header.svelte';
3
+ export { default as Input } from './tool-input.svelte';
4
+ export { default as Output } from './tool-output.svelte';
5
+ export { Content } from '../../ui/step/index.js';
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import Wrench from '@lucide/svelte/icons/wrench';
4
+ import * as Step from '../../ui/step/index.js';
5
+
6
+ let {
7
+ type,
8
+ children
9
+ }: {
10
+ /** The tool name, e.g. `search_flights`. */
11
+ type: string;
12
+ children?: Snippet;
13
+ } = $props();
14
+ </script>
15
+
16
+ <Step.Summary>
17
+ <Wrench class="size-(--era-h-xs) shrink-0" aria-hidden="true" />
18
+ <span class="truncate text-fg">{type}</span>
19
+ {@render children?.()}
20
+ </Step.Summary>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ /** The tool name, e.g. `search_flights`. */
4
+ type: string;
5
+ children?: Snippet;
6
+ };
7
+ declare const ToolHeader: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ToolHeader = ReturnType<typeof ToolHeader>;
9
+ export default ToolHeader;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import * as Step from '../../ui/step/index.js';
3
+ import { CodeBlock } from '../../ui/code-block/index.js';
4
+
5
+ let { input }: { input: unknown } = $props();
6
+ </script>
7
+
8
+ <Step.Section label="input">
9
+ <CodeBlock code={JSON.stringify(input, null, 2)} />
10
+ </Step.Section>
@@ -0,0 +1,6 @@
1
+ type $$ComponentProps = {
2
+ input: unknown;
3
+ };
4
+ declare const ToolInput: import("svelte").Component<$$ComponentProps, {}, "">;
5
+ type ToolInput = ReturnType<typeof ToolInput>;
6
+ export default ToolInput;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import * as Step from '../../ui/step/index.js';
3
+ import { CodeBlock } from '../../ui/code-block/index.js';
4
+
5
+ let { output, errorText }: { output?: unknown; errorText?: string } = $props();
6
+ </script>
7
+
8
+ {#if errorText}
9
+ <Step.Section label="error">
10
+ <p class="text-body text-destructive">{errorText}</p>
11
+ </Step.Section>
12
+ {:else if output !== undefined}
13
+ <Step.Section label="output">
14
+ {#if typeof output === 'string'}
15
+ <p class="text-body whitespace-pre-wrap text-muted">{output}</p>
16
+ {:else}
17
+ <CodeBlock code={JSON.stringify(output, null, 2)} />
18
+ {/if}
19
+ </Step.Section>
20
+ {/if}
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ output?: unknown;
3
+ errorText?: string;
4
+ };
5
+ declare const ToolOutput: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type ToolOutput = ReturnType<typeof ToolOutput>;
7
+ export default ToolOutput;
@@ -0,0 +1,41 @@
1
+ <script lang="ts" module>
2
+ /** AI-SDK tool part lifecycle. */
3
+ export type ToolState =
4
+ | 'input-streaming'
5
+ | 'input-available'
6
+ | 'output-available'
7
+ | 'output-error';
8
+ </script>
9
+
10
+ <script lang="ts">
11
+ import type { Snippet } from 'svelte';
12
+ import * as Step from '../../ui/step/index.js';
13
+ import { cn } from '../../utils/index.js';
14
+
15
+ let {
16
+ state: toolState = 'input-streaming',
17
+ open = $bindable(false),
18
+ children,
19
+ class: className
20
+ }: {
21
+ state?: ToolState;
22
+ open?: boolean;
23
+ children?: Snippet;
24
+ class?: string;
25
+ } = $props();
26
+
27
+ const status = $derived(
28
+ (
29
+ {
30
+ 'input-streaming': 'pending',
31
+ 'input-available': 'running',
32
+ 'output-available': 'done',
33
+ 'output-error': 'error'
34
+ } as const
35
+ )[toolState]
36
+ );
37
+ </script>
38
+
39
+ <Step.Root {status} bind:open class={cn(className)}>
40
+ {@render children?.()}
41
+ </Step.Root>
@@ -0,0 +1,12 @@
1
+ /** AI-SDK tool part lifecycle. */
2
+ export type ToolState = 'input-streaming' | 'input-available' | 'output-available' | 'output-error';
3
+ import type { Snippet } from 'svelte';
4
+ type $$ComponentProps = {
5
+ state?: ToolState;
6
+ open?: boolean;
7
+ children?: Snippet;
8
+ class?: string;
9
+ };
10
+ declare const Tool: import("svelte").Component<$$ComponentProps, {}, "open">;
11
+ type Tool = ReturnType<typeof Tool>;
12
+ export default Tool;
@@ -0,0 +1 @@
1
+ export { default as Root } from './web-preview.svelte';
@@ -0,0 +1 @@
1
+ export { default as Root } from './web-preview.svelte';
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import RotateCw from '@lucide/svelte/icons/rotate-cw';
3
+ import { Bar } from '../../ui/bar/index.js';
4
+ import { Button } from '../../ui/button/index.js';
5
+ import { Input } from '../../ui/input/index.js';
6
+ import { cn } from '../../utils/index.js';
7
+
8
+ let {
9
+ url = $bindable(''),
10
+ onUrlChange,
11
+ class: className
12
+ }: { url?: string; onUrlChange?: (url: string) => void; class?: string } = $props();
13
+
14
+ let draft = $derived(url);
15
+ let nonce = $state(0);
16
+ </script>
17
+
18
+ <div
19
+ class={cn(
20
+ 'flex min-h-0 flex-col overflow-hidden rounded-(--era-rd-lg) bg-(--era-surface-bg) shadow-(--era-shadow-lg)',
21
+ className
22
+ )}
23
+ >
24
+ <Bar size="md" class="shrink-0 rounded-none gap-(--era-gap)">
25
+ <Button icon size="sm" aria-label="Reload" onclick={() => (nonce += 1)}>
26
+ <RotateCw class="size-(--era-h-xs)" />
27
+ </Button>
28
+ <Input
29
+ bind:value={draft}
30
+ class="h-(--era-h-sm) flex-1"
31
+ placeholder="https://…"
32
+ onkeydown={(e: KeyboardEvent) => {
33
+ if (e.key === 'Enter') {
34
+ url = draft;
35
+ onUrlChange?.(url);
36
+ }
37
+ }}
38
+ />
39
+ </Bar>
40
+ {#key nonce}
41
+ <iframe
42
+ src={url}
43
+ title="Web preview"
44
+ sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
45
+ class="min-h-0 w-full flex-1 border-0 bg-white"
46
+ ></iframe>
47
+ {/key}
48
+ </div>
@@ -0,0 +1,8 @@
1
+ type $$ComponentProps = {
2
+ url?: string;
3
+ onUrlChange?: (url: string) => void;
4
+ class?: string;
5
+ };
6
+ declare const WebPreview: import("svelte").Component<$$ComponentProps, {}, "url">;
7
+ type WebPreview = ReturnType<typeof WebPreview>;
8
+ export default WebPreview;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { SvelteFlow, Background, Controls, type Node, type Edge } from '@xyflow/svelte';
4
+ import '@xyflow/svelte/dist/style.css';
5
+
6
+ let {
7
+ nodes = $bindable([]),
8
+ edges = $bindable([]),
9
+ children
10
+ }: { nodes?: Node[]; edges?: Edge[]; children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <!-- Thin era skin over Svelte Flow — the graph engine is xyflow's. This file
14
+ lives on its own subpath so the dependency stays opt-in. -->
15
+ <SvelteFlow bind:nodes bind:edges fitView class="rounded-(--era-rd-lg) shadow-(--era-shadow)">
16
+ <Background bgColor="var(--color-1)" />
17
+ <Controls />
18
+ {@render children?.()}
19
+ </SvelteFlow>
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ import { type Node, type Edge } from '@xyflow/svelte';
3
+ import '@xyflow/svelte/dist/style.css';
4
+ type $$ComponentProps = {
5
+ nodes?: Node[];
6
+ edges?: Edge[];
7
+ children?: Snippet;
8
+ };
9
+ declare const Canvas: import("svelte").Component<$$ComponentProps, {}, "nodes" | "edges">;
10
+ type Canvas = ReturnType<typeof Canvas>;
11
+ export default Canvas;
@@ -0,0 +1,2 @@
1
+ export { default as Canvas } from './canvas.svelte';
2
+ export { default as Node } from './node.svelte';
@@ -0,0 +1,2 @@
1
+ export { default as Canvas } from './canvas.svelte';
2
+ export { default as Node } from './node.svelte';
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { Handle, Position } from '@xyflow/svelte';
4
+ import { cn } from '../../utils/index.js';
5
+
6
+ let {
7
+ title,
8
+ children,
9
+ class: className
10
+ }: { title?: string; children?: Snippet; class?: string } = $props();
11
+ </script>
12
+
13
+ <div
14
+ class={cn(
15
+ 'flex w-56 flex-col overflow-hidden rounded-(--era-rd-md) bg-(--era-surface-bg-elevated) text-body shadow-(--era-shadow-lg)',
16
+ className
17
+ )}
18
+ >
19
+ <Handle type="target" position={Position.Left} />
20
+ {#if title}
21
+ <div class="flex h-(--era-h-md) items-center border-b border-divider-faded px-(--era-inset-md) font-medium text-bright">
22
+ {title}
23
+ </div>
24
+ {/if}
25
+ <div class="p-(--era-inset-md) text-fg">{@render children?.()}</div>
26
+ <Handle type="source" position={Position.Right} />
27
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ title?: string;
4
+ children?: Snippet;
5
+ class?: string;
6
+ };
7
+ declare const Node: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type Node = ReturnType<typeof Node>;
9
+ export default Node;