@flowdrop/flowdrop 1.15.0 → 2.0.0-beta.10
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 +648 -0
- package/MIGRATION-2.0.md +642 -0
- package/README.md +28 -28
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +18 -13
- package/dist/adapters/agentspec/AgentSpecAdapter.js +10 -10
- package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
- package/dist/api/enhanced-client.js +6 -11
- package/dist/chat/batchFeedback.d.ts +39 -0
- package/dist/chat/batchFeedback.js +51 -0
- package/dist/commands/executor.js +66 -27
- package/dist/commands/storeIntegration.svelte.d.ts +4 -1
- package/dist/commands/storeIntegration.svelte.js +36 -21
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/types.js +5 -5
- package/dist/components/App.svelte +696 -565
- package/dist/components/App.svelte.d.ts +63 -16
- package/dist/components/Button.stories.svelte +65 -0
- package/dist/components/Button.stories.svelte.d.ts +19 -0
- package/dist/components/Button.svelte +62 -0
- package/dist/components/Button.svelte.d.ts +24 -0
- package/dist/components/CanvasIconButton.svelte +76 -0
- package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
- package/dist/components/ConfigForm.svelte +181 -552
- package/dist/components/ConfigForm.svelte.d.ts +24 -7
- package/dist/components/ConfigModal.svelte +16 -3
- package/dist/components/ConfigPanel.svelte +234 -15
- package/dist/components/ConfigPanel.svelte.d.ts +6 -0
- package/dist/components/ConnectionLine.svelte +4 -2
- package/dist/components/EditorStatusBar.stories.svelte +44 -0
- package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
- package/dist/components/EditorStatusBar.svelte +99 -0
- package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
- package/dist/components/IconButton.svelte +80 -0
- package/dist/components/IconButton.svelte.d.ts +30 -0
- package/dist/components/Input.svelte +74 -0
- package/dist/components/Input.svelte.d.ts +17 -0
- package/dist/components/LogoWordmark.svelte +113 -0
- package/dist/components/LogoWordmark.svelte.d.ts +26 -0
- package/dist/components/Navbar.svelte +78 -64
- package/dist/components/Navbar.svelte.d.ts +3 -0
- package/dist/components/NodeSidebar.svelte +48 -171
- package/dist/components/NodeStatusOverlay.svelte +94 -6
- package/dist/components/NodeSwapPicker.svelte +22 -38
- package/dist/components/PipelineStatus.svelte +22 -68
- package/dist/components/PipelineStatus.svelte.d.ts +3 -0
- package/dist/components/PortCoordinateTracker.svelte +5 -6
- package/dist/components/PortMappingRow.svelte +0 -2
- package/dist/components/SchemaForm.stories.svelte +1 -3
- package/dist/components/SchemaForm.svelte +22 -39
- package/dist/components/SchemaForm.svelte.d.ts +0 -8
- package/dist/components/Select.svelte +53 -0
- package/dist/components/Select.svelte.d.ts +15 -0
- package/dist/components/SettingsModal.svelte +8 -8
- package/dist/components/SettingsPanel.svelte +44 -10
- package/dist/components/SwapMappingEditor.svelte +67 -49
- package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
- package/dist/components/Textarea.svelte +39 -0
- package/dist/components/Textarea.svelte.d.ts +12 -0
- package/dist/components/ThemeToggle.svelte +15 -94
- package/dist/components/UniversalNode.svelte +45 -11
- package/dist/components/UniversalNode.svelte.d.ts +1 -1
- package/dist/components/WorkflowEditor.svelte +183 -162
- package/dist/components/WorkflowEditor.svelte.d.ts +39 -10
- package/dist/components/chat/AIChatPanel.svelte +99 -90
- package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
- package/dist/components/chat/CommandPreview.svelte +2 -1
- package/dist/components/console/CommandConsole.svelte +7 -5
- package/dist/components/console/ConsoleAutocomplete.svelte +11 -12
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
- package/dist/components/console/ConsoleInput.svelte +18 -9
- package/dist/components/console/ConsoleOutput.svelte +4 -3
- package/dist/components/form/FormArray.svelte +42 -182
- package/dist/components/form/FormArray.svelte.d.ts +2 -1
- package/dist/components/form/FormAutocomplete.svelte +26 -21
- package/dist/components/form/FormCheckboxGroup.svelte +1 -5
- package/dist/components/form/FormCodeEditor.svelte +9 -7
- package/dist/components/form/FormField.svelte +22 -44
- package/dist/components/form/FormFieldLight.svelte +56 -50
- package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
- package/dist/components/form/FormFieldset.svelte +45 -11
- package/dist/components/form/FormMarkdownEditor.svelte +17 -9
- package/dist/components/form/FormNumberField.svelte +4 -36
- package/dist/components/form/FormPorts.svelte +262 -0
- package/dist/components/form/FormPorts.svelte.d.ts +13 -0
- package/dist/components/form/FormRangeField.svelte +62 -30
- package/dist/components/form/FormSelect.svelte +13 -75
- package/dist/components/form/FormTemplateEditor.svelte +17 -7
- package/dist/components/form/FormTextField.svelte +3 -35
- package/dist/components/form/FormTextarea.svelte +4 -39
- package/dist/components/form/FormToggle.svelte +5 -16
- package/dist/components/form/FormToggle.svelte.d.ts +4 -2
- package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
- package/dist/components/form/resolveFieldType.d.ts +24 -0
- package/dist/components/form/resolveFieldType.js +55 -0
- package/dist/components/form/templateAutocomplete.js +1 -5
- package/dist/components/form/types.d.ts +1 -14
- package/dist/components/icons/CloseIcon.svelte +6 -0
- package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
- package/dist/components/icons/CommandLineIcon.svelte +15 -0
- package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuIcon.svelte +4 -0
- package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuOpenIcon.svelte +6 -0
- package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
- package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
- package/dist/components/interrupt/FormPrompt.svelte +3 -2
- package/dist/components/interrupt/InterruptBubble.svelte +25 -27
- package/dist/components/interrupt/ReviewPrompt.svelte +10 -23
- package/dist/components/interrupt/TextInputPrompt.svelte +2 -7
- package/dist/components/layouts/MainLayout.svelte +24 -18
- package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
- package/dist/components/nodes/AtomNode.svelte +70 -72
- package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.svelte +134 -172
- package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
- package/dist/components/nodes/IdeaNode.svelte +79 -98
- package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
- package/dist/components/nodes/NodeConfigButton.svelte +86 -0
- package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
- package/dist/components/nodes/NotesNode.svelte +76 -85
- package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
- package/dist/components/nodes/SimpleNode.svelte +68 -137
- package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
- package/dist/components/nodes/SquareNode.svelte +122 -169
- package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
- package/dist/components/nodes/TerminalNode.svelte +70 -127
- package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
- package/dist/components/nodes/ToolNode.svelte +99 -104
- package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
- package/dist/components/nodes/WorkflowNode.svelte +145 -195
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
- package/dist/components/playground/ChatInput.svelte +11 -15
- package/dist/components/playground/ChatPanel.svelte +6 -49
- package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
- package/dist/components/playground/ControlPanel.svelte +134 -123
- package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
- package/dist/components/playground/ExecutionLogs.svelte +11 -9
- package/dist/components/playground/InputCollector.svelte +22 -57
- package/dist/components/playground/MessageStream.svelte +17 -23
- package/dist/components/playground/PipelineKanbanView.svelte +69 -8
- package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
- package/dist/components/playground/PipelinePanel.svelte +31 -8
- package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
- package/dist/components/playground/PipelineTableView.svelte +188 -44
- package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
- package/dist/components/playground/Playground.svelte +154 -105
- package/dist/components/playground/Playground.svelte.d.ts +5 -0
- package/dist/components/playground/PlaygroundApp.svelte +12 -2
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +6 -0
- package/dist/components/playground/PlaygroundModal.svelte +18 -3
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +6 -0
- package/dist/components/playground/PlaygroundStudio.svelte +40 -37
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +6 -0
- package/dist/components/playground/SessionManager.svelte +9 -12
- package/dist/components/playground/pipelineViewUtils.svelte.d.ts +30 -1
- package/dist/components/playground/pipelineViewUtils.svelte.js +40 -3
- package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
- package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
- package/dist/components/surfaces/TabbedSurface.svelte +133 -0
- package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
- package/dist/config/endpoints.d.ts +23 -7
- package/dist/config/endpoints.js +30 -10
- package/dist/core/index.d.ts +6 -7
- package/dist/core/index.js +8 -12
- package/dist/display/index.d.ts +6 -3
- package/dist/display/index.js +7 -5
- package/dist/editor/index.d.ts +20 -21
- package/dist/editor/index.js +26 -36
- package/dist/form/code.d.ts +25 -15
- package/dist/form/code.js +44 -41
- package/dist/form/fieldRegistry.d.ts +17 -13
- package/dist/form/fieldRegistry.js +32 -12
- package/dist/form/full.d.ts +19 -14
- package/dist/form/full.js +26 -28
- package/dist/form/index.d.ts +3 -4
- package/dist/form/index.js +6 -5
- package/dist/form/markdown.d.ts +13 -8
- package/dist/form/markdown.js +22 -23
- package/dist/helpers/proximityConnect.d.ts +3 -2
- package/dist/helpers/proximityConnect.js +2 -5
- package/dist/helpers/workflowEditorHelper.d.ts +14 -5
- package/dist/helpers/workflowEditorHelper.js +32 -30
- package/dist/index.d.ts +28 -24
- package/dist/index.js +27 -50
- package/dist/messages/defaults.d.ts +2 -5
- package/dist/messages/defaults.js +3 -6
- package/dist/messages/index.d.ts +1 -2
- package/dist/messages/index.js +1 -2
- package/dist/mocks/app-forms.d.ts +6 -2
- package/dist/mocks/app-forms.js +11 -4
- package/dist/openapi/v1/openapi.yaml +38 -26
- package/dist/playground/index.d.ts +4 -5
- package/dist/playground/index.js +4 -32
- package/dist/playground/mount.d.ts +34 -5
- package/dist/playground/mount.js +58 -24
- package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
- package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
- package/dist/registry/builtinFormats.d.ts +9 -18
- package/dist/registry/builtinFormats.js +9 -39
- package/dist/registry/builtinNodeTypes.d.ts +53 -0
- package/dist/registry/builtinNodeTypes.js +67 -0
- package/dist/registry/builtinNodes.d.ts +2 -64
- package/dist/registry/builtinNodes.js +7 -103
- package/dist/registry/index.d.ts +3 -4
- package/dist/registry/index.js +4 -6
- package/dist/registry/nodeComponentRegistry.d.ts +184 -16
- package/dist/registry/nodeComponentRegistry.js +235 -17
- package/dist/registry/workflowFormatRegistry.d.ts +14 -9
- package/dist/registry/workflowFormatRegistry.js +24 -8
- package/dist/{schema → schemas}/index.d.ts +2 -2
- package/dist/{schema → schemas}/index.js +2 -2
- package/dist/schemas/v1/workflow.schema.json +19 -17
- package/dist/services/agentSpecExecutionService.d.ts +0 -2
- package/dist/services/agentSpecExecutionService.js +0 -3
- package/dist/services/apiVariableService.d.ts +2 -1
- package/dist/services/apiVariableService.js +16 -47
- package/dist/services/autoSaveService.d.ts +7 -0
- package/dist/services/autoSaveService.js +6 -4
- package/dist/services/categoriesApi.js +3 -6
- package/dist/services/chatService.d.ts +9 -4
- package/dist/services/chatService.js +23 -28
- package/dist/services/draftStorage.d.ts +129 -13
- package/dist/services/draftStorage.js +185 -37
- package/dist/services/dynamicSchemaService.d.ts +33 -5
- package/dist/services/dynamicSchemaService.js +67 -55
- package/dist/services/globalSave.d.ts +13 -12
- package/dist/services/globalSave.js +29 -51
- package/dist/services/historyService.d.ts +39 -11
- package/dist/services/historyService.js +60 -18
- package/dist/services/interruptService.d.ts +15 -9
- package/dist/services/interruptService.js +35 -37
- package/dist/services/nodeExecutionService.d.ts +18 -3
- package/dist/services/nodeExecutionService.js +71 -45
- package/dist/services/playgroundService.d.ts +16 -10
- package/dist/services/playgroundService.js +42 -43
- package/dist/services/portConfigApi.js +3 -6
- package/dist/services/settingsService.d.ts +9 -4
- package/dist/services/settingsService.js +23 -12
- package/dist/services/variableService.d.ts +2 -1
- package/dist/services/variableService.js +2 -2
- package/dist/services/workflowStorage.js +6 -6
- package/dist/skins/drafter.d.ts +30 -0
- package/dist/skins/drafter.js +198 -0
- package/dist/skins/index.d.ts +2 -1
- package/dist/skins/index.js +4 -2
- package/dist/stores/apiContext.d.ts +56 -0
- package/dist/stores/apiContext.js +80 -0
- package/dist/stores/categoriesStore.svelte.d.ts +28 -23
- package/dist/stores/categoriesStore.svelte.js +69 -64
- package/dist/stores/getInstance.svelte.d.ts +39 -0
- package/dist/stores/getInstance.svelte.js +65 -0
- package/dist/stores/historyStore.svelte.d.ts +89 -91
- package/dist/stores/historyStore.svelte.js +159 -158
- package/dist/stores/instanceContainer.svelte.d.ts +111 -0
- package/dist/stores/instanceContainer.svelte.js +119 -0
- package/dist/stores/interruptStore.svelte.d.ts +112 -82
- package/dist/stores/interruptStore.svelte.js +253 -226
- package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
- package/dist/stores/pipelinePanelStore.svelte.js +61 -14
- package/dist/stores/playgroundStore.svelte.d.ts +169 -222
- package/dist/stores/playgroundStore.svelte.js +513 -580
- package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
- package/dist/stores/portCoordinateStore.svelte.js +109 -98
- package/dist/stores/settingsStore.svelte.d.ts +17 -1
- package/dist/stores/settingsStore.svelte.js +79 -12
- package/dist/stores/workflowStore.svelte.d.ts +212 -210
- package/dist/stores/workflowStore.svelte.js +527 -502
- package/dist/stories/EdgeDecorator.svelte +5 -2
- package/dist/stories/NodeDecorator.svelte +5 -3
- package/dist/styles/base.css +285 -14
- package/dist/styles/tokens.css +60 -2
- package/dist/svelte-app.d.ts +78 -11
- package/dist/svelte-app.js +210 -141
- package/dist/themes/drafter.d.ts +2 -0
- package/dist/themes/drafter.js +15 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +8 -2
- package/dist/types/auth.d.ts +9 -51
- package/dist/types/auth.js +4 -54
- package/dist/types/events.d.ts +24 -3
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +117 -32
- package/dist/types/index.js +0 -1
- package/dist/types/navbar.d.ts +7 -0
- package/dist/types/playground.d.ts +18 -3
- package/dist/types/settings.d.ts +30 -1
- package/dist/types/settings.js +5 -2
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +16 -2
- package/dist/types/uischema.d.ts +5 -0
- package/dist/utils/colors.d.ts +74 -21
- package/dist/utils/colors.js +92 -68
- package/dist/utils/connections.d.ts +9 -15
- package/dist/utils/connections.js +33 -88
- package/dist/utils/duration.d.ts +13 -0
- package/dist/utils/duration.js +45 -0
- package/dist/utils/edgeStyling.js +9 -5
- package/dist/utils/fetchWithAuth.d.ts +36 -15
- package/dist/utils/fetchWithAuth.js +53 -23
- package/dist/utils/icons.d.ts +5 -2
- package/dist/utils/icons.js +6 -5
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeSwap.d.ts +6 -2
- package/dist/utils/nodeSwap.js +62 -129
- package/dist/utils/nodeTypes.d.ts +17 -8
- package/dist/utils/nodeTypes.js +27 -20
- package/dist/utils/performanceUtils.js +7 -0
- package/dist/utils/portUtils.d.ts +47 -11
- package/dist/utils/portUtils.js +67 -14
- package/dist/utils/portal.d.ts +18 -0
- package/dist/utils/portal.js +34 -0
- package/dist/utils/schemaMerge.d.ts +25 -0
- package/dist/utils/schemaMerge.js +61 -0
- package/package.json +7 -5
- package/dist/messages/deprecation.d.ts +0 -20
- package/dist/messages/deprecation.js +0 -33
- package/dist/registry/plugin.d.ts +0 -215
- package/dist/registry/plugin.js +0 -249
- package/dist/services/api.d.ts +0 -129
- package/dist/services/api.js +0 -217
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
IconButton — typed wrapper over the `.flowdrop-btn--icon` system (base.css).
|
|
3
|
+
|
|
4
|
+
The icon-only sibling of Button.svelte: a square button that holds a single
|
|
5
|
+
glyph (Icon, inline SVG, or character). All geometry, variants, sizes and the
|
|
6
|
+
centralized focus ring live in base.css; this component is the ergonomic,
|
|
7
|
+
type-safe entry point so callers pick `variant`/`size` instead of hand-writing
|
|
8
|
+
class strings and re-declaring widths/tints in scoped styles.
|
|
9
|
+
|
|
10
|
+
Internal for now (not exported from any public entry) so the API isn't frozen
|
|
11
|
+
before GA. Existing hand-rolled square buttons migrate onto it incrementally.
|
|
12
|
+
Canvas-overlay buttons keep their bespoke components (CanvasIconButton,
|
|
13
|
+
NodeConfigButton) — those add absolute positioning, shadows and backdrop blur
|
|
14
|
+
this primitive deliberately stays out of.
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import type { Snippet } from 'svelte';
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
/**
|
|
22
|
+
* Visual style. `ghost` (default) is transparent until hover; `default` is a
|
|
23
|
+
* flat surface with a resting border; `primary`/`danger`/`success` are quiet
|
|
24
|
+
* semantic tints (muted fill + coloured border) that go solid on press.
|
|
25
|
+
*/
|
|
26
|
+
variant?: 'ghost' | 'default' | 'primary' | 'danger' | 'success';
|
|
27
|
+
/** Square size — `md` (32px) is the base; `sm` (28px) / `lg` (36px) add a modifier */
|
|
28
|
+
size?: 'sm' | 'md' | 'lg';
|
|
29
|
+
/** Native button type */
|
|
30
|
+
type?: 'button' | 'submit' | 'reset';
|
|
31
|
+
/** Tooltip text */
|
|
32
|
+
title?: string;
|
|
33
|
+
/** Accessible label — required, since the button is icon-only */
|
|
34
|
+
ariaLabel: string;
|
|
35
|
+
/** Toggle/pressed state — applies the active tint and sets `aria-pressed` */
|
|
36
|
+
active?: boolean;
|
|
37
|
+
/** Disabled state */
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/** Extra classes appended to the root button */
|
|
40
|
+
class?: string;
|
|
41
|
+
/** Click handler */
|
|
42
|
+
onclick?: (event: MouseEvent) => void;
|
|
43
|
+
/** The glyph (icon, svg, or character) */
|
|
44
|
+
children: Snippet;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let {
|
|
48
|
+
variant = 'ghost',
|
|
49
|
+
size = 'md',
|
|
50
|
+
type = 'button',
|
|
51
|
+
title,
|
|
52
|
+
ariaLabel,
|
|
53
|
+
active = false,
|
|
54
|
+
disabled = false,
|
|
55
|
+
class: className = '',
|
|
56
|
+
onclick,
|
|
57
|
+
children
|
|
58
|
+
}: Props = $props();
|
|
59
|
+
|
|
60
|
+
// `ghost` reuses the shared `.flowdrop-btn--ghost`; the other variants have
|
|
61
|
+
// icon-specific tint classes so they don't collide with the solid text buttons.
|
|
62
|
+
const variantClass = $derived(
|
|
63
|
+
variant === 'ghost' ? 'flowdrop-btn--ghost' : `flowdrop-btn--icon-${variant}`
|
|
64
|
+
);
|
|
65
|
+
// 'md' is the unmodified base size; only 'sm'/'lg' need a size modifier.
|
|
66
|
+
const sizeClass = $derived(size === 'md' ? '' : `flowdrop-btn--${size}`);
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<button
|
|
70
|
+
class="flowdrop-btn flowdrop-btn--icon {variantClass} {sizeClass} {className}"
|
|
71
|
+
class:is-active={active}
|
|
72
|
+
{type}
|
|
73
|
+
{title}
|
|
74
|
+
{disabled}
|
|
75
|
+
aria-label={ariaLabel}
|
|
76
|
+
aria-pressed={active ? true : undefined}
|
|
77
|
+
{onclick}
|
|
78
|
+
>
|
|
79
|
+
{@render children()}
|
|
80
|
+
</button>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Visual style. `ghost` (default) is transparent until hover; `default` is a
|
|
5
|
+
* flat surface with a resting border; `primary`/`danger`/`success` are quiet
|
|
6
|
+
* semantic tints (muted fill + coloured border) that go solid on press.
|
|
7
|
+
*/
|
|
8
|
+
variant?: 'ghost' | 'default' | 'primary' | 'danger' | 'success';
|
|
9
|
+
/** Square size — `md` (32px) is the base; `sm` (28px) / `lg` (36px) add a modifier */
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
/** Native button type */
|
|
12
|
+
type?: 'button' | 'submit' | 'reset';
|
|
13
|
+
/** Tooltip text */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Accessible label — required, since the button is icon-only */
|
|
16
|
+
ariaLabel: string;
|
|
17
|
+
/** Toggle/pressed state — applies the active tint and sets `aria-pressed` */
|
|
18
|
+
active?: boolean;
|
|
19
|
+
/** Disabled state */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Extra classes appended to the root button */
|
|
22
|
+
class?: string;
|
|
23
|
+
/** Click handler */
|
|
24
|
+
onclick?: (event: MouseEvent) => void;
|
|
25
|
+
/** The glyph (icon, svg, or character) */
|
|
26
|
+
children: Snippet;
|
|
27
|
+
}
|
|
28
|
+
declare const IconButton: import("svelte").Component<Props, {}, "">;
|
|
29
|
+
type IconButton = ReturnType<typeof IconButton>;
|
|
30
|
+
export default IconButton;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Input — typed wrapper over the shared `.flowdrop-input` system (base.css).
|
|
3
|
+
|
|
4
|
+
All control styling (surface, border, radius, sizes, focus ring, disabled =
|
|
5
|
+
the only muted state) lives in base.css. This component is the ergonomic,
|
|
6
|
+
type-safe entry point so callers pick `size`/`invalid`/`leading`/`trailing`
|
|
7
|
+
instead of hand-writing class strings — the single place text-like fields
|
|
8
|
+
should route through. Mirrors Button.svelte.
|
|
9
|
+
|
|
10
|
+
Native attributes (type, value, placeholder, disabled, id, aria-*, oninput…)
|
|
11
|
+
are forwarded verbatim to the underlying <input>.
|
|
12
|
+
|
|
13
|
+
Internal for now (not exported from any public entry) so the API isn't frozen
|
|
14
|
+
before GA. Existing hand-rolled inputs migrate onto it incrementally.
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import type { Snippet } from 'svelte';
|
|
19
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
20
|
+
|
|
21
|
+
// Omit native numeric `size` so our design-token size (matching Button) wins.
|
|
22
|
+
interface Props extends Omit<HTMLInputAttributes, 'size'> {
|
|
23
|
+
/** Size — `md` is the base `.flowdrop-input`; `sm`/`lg` add a modifier */
|
|
24
|
+
size?: 'sm' | 'md' | 'lg';
|
|
25
|
+
/** Renders the error-border state */
|
|
26
|
+
invalid?: boolean;
|
|
27
|
+
/** Extra classes appended to the input */
|
|
28
|
+
class?: string;
|
|
29
|
+
/** Optional leading affordance (e.g. a search icon) */
|
|
30
|
+
leading?: Snippet;
|
|
31
|
+
/** Optional trailing affordance */
|
|
32
|
+
trailing?: Snippet;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let {
|
|
36
|
+
size = 'md',
|
|
37
|
+
invalid = false,
|
|
38
|
+
class: className = '',
|
|
39
|
+
leading,
|
|
40
|
+
trailing,
|
|
41
|
+
...rest
|
|
42
|
+
}: Props = $props();
|
|
43
|
+
|
|
44
|
+
const inputClass = $derived(
|
|
45
|
+
[
|
|
46
|
+
'flowdrop-input',
|
|
47
|
+
size === 'md' ? '' : `flowdrop-input--${size}`,
|
|
48
|
+
invalid ? 'flowdrop-input--invalid' : '',
|
|
49
|
+
leading ? 'flowdrop-input--has-leading' : '',
|
|
50
|
+
trailing ? 'flowdrop-input--has-trailing' : '',
|
|
51
|
+
className
|
|
52
|
+
]
|
|
53
|
+
.filter(Boolean)
|
|
54
|
+
.join(' ')
|
|
55
|
+
);
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
{#if leading || trailing}
|
|
59
|
+
<div class="flowdrop-input-wrap">
|
|
60
|
+
{#if leading}
|
|
61
|
+
<span class="flowdrop-input-wrap__icon flowdrop-input-wrap__icon--leading">
|
|
62
|
+
{@render leading()}
|
|
63
|
+
</span>
|
|
64
|
+
{/if}
|
|
65
|
+
<input class={inputClass} {...rest} />
|
|
66
|
+
{#if trailing}
|
|
67
|
+
<span class="flowdrop-input-wrap__icon flowdrop-input-wrap__icon--trailing">
|
|
68
|
+
{@render trailing()}
|
|
69
|
+
</span>
|
|
70
|
+
{/if}
|
|
71
|
+
</div>
|
|
72
|
+
{:else}
|
|
73
|
+
<input class={inputClass} {...rest} />
|
|
74
|
+
{/if}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
+
interface Props extends Omit<HTMLInputAttributes, 'size'> {
|
|
4
|
+
/** Size — `md` is the base `.flowdrop-input`; `sm`/`lg` add a modifier */
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
/** Renders the error-border state */
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
/** Extra classes appended to the input */
|
|
9
|
+
class?: string;
|
|
10
|
+
/** Optional leading affordance (e.g. a search icon) */
|
|
11
|
+
leading?: Snippet;
|
|
12
|
+
/** Optional trailing affordance */
|
|
13
|
+
trailing?: Snippet;
|
|
14
|
+
}
|
|
15
|
+
declare const Input: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type Input = ReturnType<typeof Input>;
|
|
17
|
+
export default Input;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FlowDrop horizontal lockup: rocket mark + "FlowDrop" wordmark.
|
|
3
|
+
Theme-aware via the same --fd-logo-* variables as Logo.svelte, plus
|
|
4
|
+
--fd-logo-text for the wordmark glyphs.
|
|
5
|
+
-->
|
|
6
|
+
<div class="flowdrop-logo-wordmark">
|
|
7
|
+
<svg viewBox="0 0 2500 499.99999" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
8
|
+
<g transform="translate(472.2413,571.30469)">
|
|
9
|
+
<g transform="matrix(1.2053353,0,0,1.2053353,-1246.7763,-599.46548)">
|
|
10
|
+
<path
|
|
11
|
+
style="fill:var(--logo-line-fill);stroke-width:10;stroke-dasharray:none"
|
|
12
|
+
d="M 850,120 V 310 Z"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
style="fill:var(--logo-line-fill);stroke:var(--logo-stroke);stroke-width:16.59289328;stroke-dasharray:none;stroke-opacity:1"
|
|
16
|
+
d="M 850,110 V 310"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
style="fill:none;stroke:var(--logo-stroke);stroke-width:14.98546028;stroke-dasharray:none;stroke-opacity:1"
|
|
20
|
+
d="m 850,158.973 v 36.70355 8.15635 c 0,0 1.19184,39.5038 -36.01255,65.25076 -29.46481,20.39086 -52.3819,16.31269 -55.65576,65.25076 v 44.8599"
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
style="fill:none;stroke:var(--logo-stroke);stroke-width:15.05060005;stroke-dasharray:none;stroke-opacity:1"
|
|
24
|
+
d="m 850,158.973 v 37.02335 8.22741 c 0,0 -1.19184,39.84799 36.01255,65.81929 29.46481,20.56853 52.3819,16.45482 55.65576,65.81929 v 45.25076"
|
|
25
|
+
/>
|
|
26
|
+
<path
|
|
27
|
+
d="m 849.41763,64.456369 25.36824,31.087262 c 6.23336,6.364119 10.06921,15.063569 10.06921,24.656839 0,19.50109 -15.85132,35.30988 -35.42373,35.30988 -19.57241,0 -35.43242,-15.80879 -35.43242,-35.30988 0,-9.49405 3.75813,-18.11351 9.87536,-24.458879 z"
|
|
28
|
+
style="fill:var(--logo-drop);stroke:var(--logo-stroke);stroke-width:16.59289932;stroke-dasharray:none;paint-order:fill"
|
|
29
|
+
/>
|
|
30
|
+
<circle
|
|
31
|
+
style="fill:var(--logo-circle);stroke:var(--logo-stroke);stroke-width:16.59289932;stroke-dasharray:none"
|
|
32
|
+
cx="849.427"
|
|
33
|
+
cy="326.5929"
|
|
34
|
+
r="30"
|
|
35
|
+
/>
|
|
36
|
+
<ellipse
|
|
37
|
+
style="fill:var(--logo-left);stroke:var(--logo-stroke);stroke-width:16.59289932;stroke-dasharray:none"
|
|
38
|
+
cx="759.99994"
|
|
39
|
+
cy="369.44669"
|
|
40
|
+
rx="29.999952"
|
|
41
|
+
ry="30.000004"
|
|
42
|
+
/>
|
|
43
|
+
<ellipse
|
|
44
|
+
style="fill:var(--logo-right);stroke:var(--logo-stroke);stroke-width:16.59289932;stroke-dasharray:none"
|
|
45
|
+
cx="939.99963"
|
|
46
|
+
cy="369.44669"
|
|
47
|
+
rx="29.999952"
|
|
48
|
+
ry="30.000004"
|
|
49
|
+
/>
|
|
50
|
+
</g>
|
|
51
|
+
</g>
|
|
52
|
+
<g aria-label="FlowDrop" style="font-size:400.327px;fill:var(--logo-text);stroke-width:10.4252">
|
|
53
|
+
<path
|
|
54
|
+
d="M 710.85926,99.779646 V 116.59025 H 584.38877 v 92.65381 h 91.48097 v 16.81061 H 584.38877 V 358.97574 H 540.79848 V 99.779646 Z"
|
|
55
|
+
style="fill:var(--logo-text)"
|
|
56
|
+
/>
|
|
57
|
+
<path
|
|
58
|
+
d="M 788.07077,358.97574 H 748.19445 V 68.113156 L 776.53791,56.77577 h 11.53286 z"
|
|
59
|
+
style="fill:var(--logo-text)"
|
|
60
|
+
/>
|
|
61
|
+
<path
|
|
62
|
+
d="m 950.50815,363.27613 q -23.06571,0 -42.41746,-8.01436 -19.35174,-8.01436 -33.42574,-21.69741 -14.07399,-13.87853 -22.08835,-32.25291 -7.81889,-18.56986 -7.81889,-39.68085 0,-22.08835 7.81889,-41.4401 8.01436,-19.54722 22.08835,-34.01216 14.074,-14.46494 33.42574,-22.67477 19.35175,-8.4053 42.41746,-8.4053 22.87025,0 42.02652,7.62341 19.35173,7.62342 33.42573,20.91553 14.074,13.2921 21.8929,31.27554 8.0144,17.78797 8.0144,38.31255 0,22.67477 -8.0144,42.8084 -7.8189,19.93816 -21.8929,34.98952 -14.074,14.85588 -33.42573,23.65213 -19.15627,8.60078 -42.02652,8.60078 z m 7.62342,-14.66042 q 11.72833,0 21.50194,-6.05963 9.77361,-6.05964 16.8106,-16.22419 7.03699,-10.36003 10.94649,-23.84761 3.9094,-13.48758 3.9094,-28.53893 0,-21.69741 -3.714,-40.65821 -3.7139,-18.9608 -12.11925,-33.0348 -8.4053,-14.074 -21.89288,-22.08835 -13.48758,-8.20984 -32.83932,-8.20984 -9.96908,0 -19.35175,5.86417 -9.38266,5.66869 -16.61513,15.63777 -7.037,9.96908 -11.33739,23.45666 -4.30039,13.29211 -4.30039,28.34347 0,21.89288 4.49586,41.04915 4.69134,19.15627 13.48758,33.42574 8.99172,14.26947 21.69741,22.67477 12.90117,8.20983 29.32083,8.20983 z"
|
|
63
|
+
style="fill:var(--logo-text)"
|
|
64
|
+
/>
|
|
65
|
+
<path
|
|
66
|
+
d="m 1122.7191,158.81224 63.333,146.21318 62.7465,-146.21318 63.1375,146.21318 55.9051,-146.21318 h 19.1563 l -81.7074,202.31369 h -13.4876 l -55.905,-130.77088 -56.1005,130.77088 h -12.3148 l -87.5715,-202.31369 z"
|
|
67
|
+
style="fill:var(--logo-text)"
|
|
68
|
+
/>
|
|
69
|
+
<path
|
|
70
|
+
d="m 1424.9191,99.779646 h 86.3987 q 39.8763,0 68.6107,7.427944 28.7345,7.42794 47.8907,23.8476 21.8929,18.76533 32.8394,43.00388 11.1419,24.23855 11.1419,52.97296 0,27.3661 -9.9691,51.40918 -9.7736,24.04307 -28.9299,42.02651 -18.9608,17.78797 -47.1088,28.14799 -27.9525,10.36003 -64.1149,10.36003 h -96.7587 z m 43.5903,240.235294 h 46.3269 q 21.8929,0 41.2446,-7.23247 19.3518,-7.23247 33.6213,-21.50194 14.4649,-14.26947 22.6747,-34.98952 8.4053,-20.91552 8.4053,-48.28162 0,-24.04308 -7.8189,-43.98124 -7.8188,-20.13363 -21.8928,-34.59857 -14.074,-14.46494 -33.6213,-22.4793 -19.3517,-8.01436 -42.4174,-8.01436 h -46.5224 z"
|
|
71
|
+
style="fill:var(--logo-text)"
|
|
72
|
+
/>
|
|
73
|
+
<path
|
|
74
|
+
d="m 1758.7855,155.09827 h 6.0597 l 5.2777,40.85368 q 4.6914,-8.99172 11.7283,-16.41966 7.037,-7.42794 15.4424,-12.90116 8.6007,-5.47322 17.9834,-8.40531 9.5781,-3.12755 19.3517,-3.12755 8.7963,0 17.2016,2.34567 8.6008,2.34566 16.0287,7.42794 l -12.5102,33.42574 q -3.9095,-4.30039 -8.2098,-6.84153 -4.3004,-2.73661 -8.7963,-4.10491 -4.4959,-1.56378 -9.1872,-1.95472 -4.6913,-0.39095 -9.3827,-0.39095 -7.4279,0 -14.6604,2.15019 -7.037,2.1502 -13.4875,6.45059 -6.4506,4.10491 -11.9238,10.75097 -5.4733,6.45058 -9.5782,15.24682 v 139.37166 h -39.6808 V 166.04471 Z"
|
|
75
|
+
style="fill:var(--logo-text)"
|
|
76
|
+
/>
|
|
77
|
+
<path
|
|
78
|
+
d="m 1995.6979,363.27613 q -23.0658,0 -42.4175,-8.01436 -19.3518,-8.01436 -33.4257,-21.69741 -14.074,-13.87853 -22.0884,-32.25291 -7.8189,-18.56986 -7.8189,-39.68085 0,-22.08835 7.8189,-41.4401 8.0144,-19.54722 22.0884,-34.01216 14.0739,-14.46494 33.4257,-22.67477 19.3517,-8.4053 42.4175,-8.4053 22.8702,0 42.0265,7.62341 19.3517,7.62342 33.4257,20.91553 14.074,13.2921 21.8929,31.27554 8.0143,17.78797 8.0143,38.31255 0,22.67477 -8.0143,42.8084 -7.8189,19.93816 -21.8929,34.98952 -14.074,14.85588 -33.4257,23.65213 -19.1563,8.60078 -42.0265,8.60078 z m 7.6234,-14.66042 q 11.7283,0 21.5019,-6.05963 9.7736,-6.05964 16.8106,-16.22419 7.037,-10.36003 10.9465,-23.84761 3.9094,-13.48758 3.9094,-28.53893 0,-21.69741 -3.714,-40.65821 -3.7139,-18.9608 -12.1192,-33.0348 -8.4054,-14.074 -21.8929,-22.08835 -13.4876,-8.20984 -32.8394,-8.20984 -9.969,0 -19.3517,5.86417 -9.3827,5.66869 -16.6151,15.63777 -7.037,9.96908 -11.3374,23.45666 -4.3004,13.29211 -4.3004,28.34347 0,21.89288 4.4959,41.04915 4.6913,19.15627 13.4875,33.42574 8.9918,14.26947 21.6974,22.67477 12.9012,8.20983 29.3209,8.20983 z"
|
|
79
|
+
style="fill:var(--logo-text)"
|
|
80
|
+
/>
|
|
81
|
+
<path
|
|
82
|
+
d="m 2186.0877,155.09827 h 11.3374 v 44.9586 q 6.0596,-7.62342 13.2921,-15.63778 7.4279,-8.01435 16.2242,-14.46494 8.9917,-6.64605 19.7427,-10.75097 10.7509,-4.10491 23.4566,-4.10491 17.788,0 32.2529,7.42794 14.465,7.42794 24.6295,20.13363 10.3601,12.7057 15.8333,29.90725 5.6687,17.00607 5.6687,36.35782 0,24.82496 -6.8416,45.93596 -6.8415,20.91552 -19.5472,36.16235 -12.7057,15.24683 -30.8846,23.8476 -18.1789,8.40531 -40.6582,8.40531 -8.2098,0 -15.4423,-0.97736 -7.037,-0.78189 -13.4876,-2.54114 -6.2551,-1.75925 -12.3147,-4.49586 -5.8642,-2.73661 -11.9238,-6.64606 v 94.60853 h -39.8763 V 166.24018 Z m 11.3374,149.92715 q 0,8.99172 3.9094,17.00608 3.9095,7.81889 10.9465,13.87852 7.037,5.86417 16.8106,9.38267 9.7736,3.32302 21.5019,3.32302 11.1419,0 20.9155,-5.66869 9.9691,-5.66869 17.2016,-16.02872 7.4279,-10.55549 11.5328,-25.02043 4.3004,-14.46494 4.3004,-32.05744 0,-22.08835 -3.9094,-38.50802 -3.9095,-16.61513 -10.9465,-27.56157 -6.8415,-10.94644 -16.4196,-16.41966 -9.3827,-5.47322 -20.7201,-5.47322 -8.6007,0 -16.6151,2.73661 -7.8189,2.54113 -14.8559,7.03699 -7.037,4.49586 -13.0966,10.36003 -5.8642,5.86416 -10.5555,12.31475 z"
|
|
83
|
+
style="fill:var(--logo-text)"
|
|
84
|
+
/>
|
|
85
|
+
</g>
|
|
86
|
+
</svg>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<style>
|
|
90
|
+
.flowdrop-logo-wordmark {
|
|
91
|
+
--logo-stroke: var(--fd-logo-stroke, #000000);
|
|
92
|
+
--logo-text: var(--fd-logo-text, #000000);
|
|
93
|
+
--logo-line-fill: var(--fd-logo-line-fill, #000000);
|
|
94
|
+
--logo-drop: var(--fd-logo-drop, #009cde);
|
|
95
|
+
--logo-circle: var(--fd-logo-circle, #f46351);
|
|
96
|
+
--logo-left: var(--fd-logo-left, #ccbaf4);
|
|
97
|
+
--logo-right: var(--fd-logo-right, #ffc423);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:global([data-theme='dark']) .flowdrop-logo-wordmark {
|
|
101
|
+
/* Stroke, wordmark, and the center line go white in dark; the brand-color
|
|
102
|
+
dots (drop/circle/left/right) keep their fills, same as light mode. */
|
|
103
|
+
--logo-stroke: var(--fd-logo-stroke, #ffffff);
|
|
104
|
+
--logo-text: var(--fd-logo-text, #ffffff);
|
|
105
|
+
--logo-line-fill: var(--fd-logo-line-fill, #ffffff);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.flowdrop-logo-wordmark :global(svg) {
|
|
109
|
+
display: block;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default LogoWordmark;
|
|
2
|
+
type LogoWordmark = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const LogoWordmark: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
<script lang="ts">
|
|
10
|
+
import type { Snippet } from 'svelte';
|
|
10
11
|
import Icon from '@iconify/svelte';
|
|
11
|
-
import
|
|
12
|
+
import LogoWordmark from './LogoWordmark.svelte';
|
|
12
13
|
import SettingsModal from './SettingsModal.svelte';
|
|
13
14
|
import type { SettingsCategory } from '../types/settings.js';
|
|
14
15
|
import type { NavbarAction } from '../types/navbar.js';
|
|
@@ -37,6 +38,8 @@
|
|
|
37
38
|
showSettingsSyncButton?: boolean;
|
|
38
39
|
/** Show the reset buttons in the settings modal */
|
|
39
40
|
showSettingsResetButton?: boolean;
|
|
41
|
+
/** Custom content rendered in the trailing (right) region, before the settings gear */
|
|
42
|
+
end?: Snippet;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
let {
|
|
@@ -47,7 +50,8 @@
|
|
|
47
50
|
showSettings = true,
|
|
48
51
|
settingsCategories,
|
|
49
52
|
showSettingsSyncButton,
|
|
50
|
-
showSettingsResetButton
|
|
53
|
+
showSettingsResetButton,
|
|
54
|
+
end
|
|
51
55
|
}: Props = $props();
|
|
52
56
|
|
|
53
57
|
// Dropdown state
|
|
@@ -59,6 +63,25 @@
|
|
|
59
63
|
// Hoist the navigation branch — six reads in the template.
|
|
60
64
|
const nav = $derived(m().navigation);
|
|
61
65
|
|
|
66
|
+
// Flyout structure: actions after the first split into ungrouped (rendered
|
|
67
|
+
// flat at the top) and groups (rendered as labeled sections). Group order
|
|
68
|
+
// follows first occurrence in the source array.
|
|
69
|
+
const dropdownActions = $derived(primaryActions.slice(1));
|
|
70
|
+
const ungroupedActions = $derived(dropdownActions.filter((a) => !a.group));
|
|
71
|
+
const groupedActions = $derived.by(() => {
|
|
72
|
+
const groups = new Map<string, NavbarAction[]>();
|
|
73
|
+
for (const action of dropdownActions) {
|
|
74
|
+
if (!action.group) continue;
|
|
75
|
+
let bucket = groups.get(action.group);
|
|
76
|
+
if (!bucket) {
|
|
77
|
+
bucket = [];
|
|
78
|
+
groups.set(action.group, bucket);
|
|
79
|
+
}
|
|
80
|
+
bucket.push(action);
|
|
81
|
+
}
|
|
82
|
+
return Array.from(groups, ([label, items]) => ({ label, items }));
|
|
83
|
+
});
|
|
84
|
+
|
|
62
85
|
// Close dropdown when clicking outside
|
|
63
86
|
function handleClickOutside(event: MouseEvent) {
|
|
64
87
|
const target = event.target as HTMLElement;
|
|
@@ -78,16 +101,10 @@
|
|
|
78
101
|
|
|
79
102
|
<div class="flowdrop-navbar">
|
|
80
103
|
<div class="flowdrop-navbar__start">
|
|
81
|
-
<!-- Logo
|
|
104
|
+
<!-- Logo (rocket + FlowDrop wordmark) -->
|
|
82
105
|
<div class="flowdrop-logo--container">
|
|
83
|
-
<div class="flowdrop-
|
|
84
|
-
<
|
|
85
|
-
<Logo />
|
|
86
|
-
</div>
|
|
87
|
-
<div>
|
|
88
|
-
<h1 class="flowdrop-text--logo flowdrop-font--bold">{nav.appName}</h1>
|
|
89
|
-
<p class="flowdrop-text--tagline flowdrop-text--gray">{nav.tagline}</p>
|
|
90
|
-
</div>
|
|
106
|
+
<div class="flowdrop-logo--header">
|
|
107
|
+
<LogoWordmark />
|
|
91
108
|
</div>
|
|
92
109
|
</div>
|
|
93
110
|
</div>
|
|
@@ -203,7 +220,7 @@
|
|
|
203
220
|
|
|
204
221
|
{#if isDropdownOpen}
|
|
205
222
|
<div class="flowdrop-navbar__dropdown-menu">
|
|
206
|
-
{#each
|
|
223
|
+
{#each ungroupedActions as action (action.label)}
|
|
207
224
|
<a
|
|
208
225
|
href={action.href}
|
|
209
226
|
class="flowdrop-navbar__dropdown-item"
|
|
@@ -223,6 +240,32 @@
|
|
|
223
240
|
{/if}
|
|
224
241
|
</a>
|
|
225
242
|
{/each}
|
|
243
|
+
{#each groupedActions as group, groupIndex (group.label)}
|
|
244
|
+
{#if groupIndex > 0 || ungroupedActions.length > 0}
|
|
245
|
+
<div class="flowdrop-navbar__dropdown-divider" role="separator"></div>
|
|
246
|
+
{/if}
|
|
247
|
+
<div class="flowdrop-navbar__dropdown-group-header">{group.label}</div>
|
|
248
|
+
{#each group.items as action (action.label)}
|
|
249
|
+
<a
|
|
250
|
+
href={action.href}
|
|
251
|
+
class="flowdrop-navbar__dropdown-item"
|
|
252
|
+
onclick={(e) => {
|
|
253
|
+
action.onclick?.(e);
|
|
254
|
+
isDropdownOpen = false;
|
|
255
|
+
}}
|
|
256
|
+
target={action.external ? '_blank' : undefined}
|
|
257
|
+
rel={action.external ? 'noopener noreferrer' : undefined}
|
|
258
|
+
>
|
|
259
|
+
{#if action.icon}
|
|
260
|
+
<Icon icon={action.icon} class="w-4 h-4" />
|
|
261
|
+
{/if}
|
|
262
|
+
<span>{action.label}</span>
|
|
263
|
+
{#if action.external}
|
|
264
|
+
<Icon icon="mdi:open-in-new" class="w-3 h-3" />
|
|
265
|
+
{/if}
|
|
266
|
+
</a>
|
|
267
|
+
{/each}
|
|
268
|
+
{/each}
|
|
226
269
|
</div>
|
|
227
270
|
{/if}
|
|
228
271
|
</div>
|
|
@@ -232,6 +275,7 @@
|
|
|
232
275
|
</div>
|
|
233
276
|
|
|
234
277
|
<div class="flowdrop-navbar__end">
|
|
278
|
+
{@render end?.()}
|
|
235
279
|
{#if showSettings}
|
|
236
280
|
<button
|
|
237
281
|
class="flowdrop-navbar__settings-btn"
|
|
@@ -286,10 +330,10 @@
|
|
|
286
330
|
}
|
|
287
331
|
|
|
288
332
|
.flowdrop-logo--header {
|
|
289
|
-
|
|
290
|
-
height:
|
|
291
|
-
|
|
292
|
-
padding: 2px;
|
|
333
|
+
/* Wordmark lockup is 5:1; keep it within the start column. */
|
|
334
|
+
height: 32px;
|
|
335
|
+
width: 160px;
|
|
336
|
+
padding: 2px 0;
|
|
293
337
|
}
|
|
294
338
|
|
|
295
339
|
.flowdrop-navbar__center {
|
|
@@ -480,7 +524,7 @@
|
|
|
480
524
|
transition: all var(--fd-transition-normal);
|
|
481
525
|
font-weight: 500;
|
|
482
526
|
font-size: var(--fd-text-sm);
|
|
483
|
-
height:
|
|
527
|
+
height: var(--fd-size-btn-min);
|
|
484
528
|
box-sizing: border-box;
|
|
485
529
|
background-color: var(--fd-background);
|
|
486
530
|
color: var(--fd-foreground);
|
|
@@ -496,7 +540,7 @@
|
|
|
496
540
|
position: relative;
|
|
497
541
|
display: flex;
|
|
498
542
|
align-items: center;
|
|
499
|
-
height:
|
|
543
|
+
height: var(--fd-size-btn-min);
|
|
500
544
|
}
|
|
501
545
|
|
|
502
546
|
.flowdrop-navbar__dropdown-trigger {
|
|
@@ -504,7 +548,7 @@
|
|
|
504
548
|
align-items: center;
|
|
505
549
|
justify-content: center;
|
|
506
550
|
width: 2rem;
|
|
507
|
-
height:
|
|
551
|
+
height: var(--fd-size-btn-min);
|
|
508
552
|
border: 1px solid var(--fd-border-strong);
|
|
509
553
|
border-left: none;
|
|
510
554
|
border-radius: 0 var(--fd-radius-md) var(--fd-radius-md) 0;
|
|
@@ -568,6 +612,21 @@
|
|
|
568
612
|
border-bottom: none;
|
|
569
613
|
}
|
|
570
614
|
|
|
615
|
+
.flowdrop-navbar__dropdown-divider {
|
|
616
|
+
height: 1px;
|
|
617
|
+
background-color: var(--fd-border);
|
|
618
|
+
margin: 0.25rem 0;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.flowdrop-navbar__dropdown-group-header {
|
|
622
|
+
padding: 0.5rem 1rem 0.25rem;
|
|
623
|
+
font-size: var(--fd-text-xs);
|
|
624
|
+
font-weight: 600;
|
|
625
|
+
text-transform: uppercase;
|
|
626
|
+
letter-spacing: 0.04em;
|
|
627
|
+
color: var(--fd-muted-foreground);
|
|
628
|
+
}
|
|
629
|
+
|
|
571
630
|
.flowdrop-navbar__action {
|
|
572
631
|
display: flex;
|
|
573
632
|
align-items: center;
|
|
@@ -664,11 +723,6 @@
|
|
|
664
723
|
border-color: var(--fd-border-strong);
|
|
665
724
|
}
|
|
666
725
|
|
|
667
|
-
.flowdrop-navbar__settings-btn:focus {
|
|
668
|
-
outline: none;
|
|
669
|
-
box-shadow: 0 0 0 2px var(--fd-ring);
|
|
670
|
-
}
|
|
671
|
-
|
|
672
726
|
.flowdrop-navbar__settings-btn:active {
|
|
673
727
|
transform: scale(0.95);
|
|
674
728
|
}
|
|
@@ -693,38 +747,6 @@
|
|
|
693
747
|
background-color: var(--fd-success);
|
|
694
748
|
}
|
|
695
749
|
|
|
696
|
-
/* Utility classes */
|
|
697
|
-
.flowdrop-flex {
|
|
698
|
-
display: flex;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
.flowdrop-gap--3 {
|
|
702
|
-
gap: 0.75rem;
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
.flowdrop-text--logo {
|
|
706
|
-
font-size: 1.125rem;
|
|
707
|
-
line-height: 0;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
.flowdrop-text--tagline {
|
|
711
|
-
font-size: var(--fd-text-xs);
|
|
712
|
-
line-height: 0.5rem;
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
.flowdrop-text--xs {
|
|
716
|
-
font-size: var(--fd-text-xs);
|
|
717
|
-
line-height: 1rem;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
.flowdrop-text--gray {
|
|
721
|
-
color: var(--fd-muted-foreground);
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
.flowdrop-font--bold {
|
|
725
|
-
font-weight: 700;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
750
|
/* Responsive design */
|
|
729
751
|
@media (max-width: 768px) {
|
|
730
752
|
.flowdrop-navbar {
|
|
@@ -774,14 +796,6 @@
|
|
|
774
796
|
border-radius: var(--fd-radius-md) 0 0 var(--fd-radius-md);
|
|
775
797
|
}
|
|
776
798
|
|
|
777
|
-
.flowdrop-text--logo {
|
|
778
|
-
display: none;
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
.flowdrop-text--tagline {
|
|
782
|
-
display: none;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
799
|
.flowdrop-navbar__title-text {
|
|
786
800
|
font-size: 0.875rem;
|
|
787
801
|
max-width: 300px;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
import type { SettingsCategory } from '../types/settings.js';
|
|
2
3
|
import type { NavbarAction } from '../types/navbar.js';
|
|
3
4
|
interface BreadcrumbItem {
|
|
@@ -22,6 +23,8 @@ interface Props {
|
|
|
22
23
|
showSettingsSyncButton?: boolean;
|
|
23
24
|
/** Show the reset buttons in the settings modal */
|
|
24
25
|
showSettingsResetButton?: boolean;
|
|
26
|
+
/** Custom content rendered in the trailing (right) region, before the settings gear */
|
|
27
|
+
end?: Snippet;
|
|
25
28
|
}
|
|
26
29
|
declare const Navbar: import("svelte").Component<Props, {}, "">;
|
|
27
30
|
type Navbar = ReturnType<typeof Navbar>;
|