@d34dman/flowdrop 0.0.28 → 0.0.30
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/dist/components/NodeSidebar.svelte +18 -10
- package/dist/components/WorkflowEditor.svelte +4 -0
- package/dist/components/form/FormFieldLight.svelte +422 -0
- package/dist/components/form/FormFieldLight.svelte.d.ts +18 -0
- package/dist/components/nodes/ToolNode.svelte +23 -8
- package/dist/core/index.d.ts +39 -0
- package/dist/core/index.js +50 -0
- package/dist/display/index.d.ts +29 -0
- package/dist/display/index.js +36 -0
- package/dist/editor/index.d.ts +78 -0
- package/dist/editor/index.js +117 -0
- package/dist/form/code.d.ts +100 -0
- package/dist/form/code.js +153 -0
- package/dist/form/fieldRegistry.d.ts +163 -0
- package/dist/form/fieldRegistry.js +175 -0
- package/dist/form/full.d.ts +53 -0
- package/dist/form/full.js +75 -0
- package/dist/form/index.d.ts +57 -0
- package/dist/form/index.js +68 -0
- package/dist/form/markdown.d.ts +68 -0
- package/dist/form/markdown.js +93 -0
- package/dist/index.d.ts +31 -66
- package/dist/index.js +49 -80
- package/dist/styles/base.css +5 -0
- package/dist/utils/colors.d.ts +42 -0
- package/dist/utils/colors.js +77 -0
- package/package.json +46 -3
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlowDrop Form Markdown Editor Module
|
|
3
|
+
*
|
|
4
|
+
* Adds EasyMDE-based markdown editor support to SchemaForm.
|
|
5
|
+
* This module bundles EasyMDE dependencies (~200KB).
|
|
6
|
+
*
|
|
7
|
+
* @module form/markdown
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { SchemaForm } from "@d34dman/flowdrop/form";
|
|
12
|
+
* import { registerMarkdownEditorField } from "@d34dman/flowdrop/form/markdown";
|
|
13
|
+
*
|
|
14
|
+
* // Register markdown editor support (call once at app startup)
|
|
15
|
+
* registerMarkdownEditorField();
|
|
16
|
+
*
|
|
17
|
+
* // Now SchemaForm will render markdown editors for format: "markdown"
|
|
18
|
+
* const schema = {
|
|
19
|
+
* type: "object",
|
|
20
|
+
* properties: {
|
|
21
|
+
* content: { type: "string", format: "markdown", title: "Content" }
|
|
22
|
+
* }
|
|
23
|
+
* };
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
import { registerFieldComponent } from "./fieldRegistry.js";
|
|
27
|
+
// Re-export the component for direct usage if needed
|
|
28
|
+
export { default as FormMarkdownEditor } from "../components/form/FormMarkdownEditor.svelte";
|
|
29
|
+
/**
|
|
30
|
+
* Matcher for markdown editor fields
|
|
31
|
+
* Matches: format "markdown"
|
|
32
|
+
*/
|
|
33
|
+
export function markdownEditorFieldMatcher(schema) {
|
|
34
|
+
return schema.format === "markdown";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Track if markdown editor is registered
|
|
38
|
+
*/
|
|
39
|
+
let markdownEditorRegistered = false;
|
|
40
|
+
/**
|
|
41
|
+
* Register the markdown editor field component
|
|
42
|
+
*
|
|
43
|
+
* Call this function once at application startup to enable
|
|
44
|
+
* markdown editor fields in SchemaForm. This loads EasyMDE dependencies.
|
|
45
|
+
*
|
|
46
|
+
* @param priority - Priority for field matching (default: 100)
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // In your app's entry point:
|
|
51
|
+
* import { registerMarkdownEditorField } from "@d34dman/flowdrop/form/markdown";
|
|
52
|
+
*
|
|
53
|
+
* registerMarkdownEditorField();
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export function registerMarkdownEditorField(priority = 100) {
|
|
57
|
+
if (markdownEditorRegistered) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// Dynamic import to ensure proper code splitting
|
|
61
|
+
import("../components/form/FormMarkdownEditor.svelte").then((module) => {
|
|
62
|
+
registerFieldComponent("markdown-editor", module.default, markdownEditorFieldMatcher, priority);
|
|
63
|
+
markdownEditorRegistered = true;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Synchronously register markdown editor field using the imported component
|
|
68
|
+
*
|
|
69
|
+
* Use this when you've already imported the component and want immediate registration.
|
|
70
|
+
*
|
|
71
|
+
* @param priority - Priority for field matching (default: 100)
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* import { registerMarkdownEditorFieldWithComponent, FormMarkdownEditor } from "@d34dman/flowdrop/form/markdown";
|
|
76
|
+
* registerMarkdownEditorFieldWithComponent(FormMarkdownEditor);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export function registerMarkdownEditorFieldWithComponent(
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
|
+
component, priority = 100) {
|
|
82
|
+
if (markdownEditorRegistered) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
registerFieldComponent("markdown-editor", component, markdownEditorFieldMatcher, priority);
|
|
86
|
+
markdownEditorRegistered = true;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Check if markdown editor field is registered
|
|
90
|
+
*/
|
|
91
|
+
export function isMarkdownEditorRegistered() {
|
|
92
|
+
return markdownEditorRegistered;
|
|
93
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,69 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FlowDrop - Visual Workflow Editor Library
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* A Svelte 5 component library built on @xyflow/svelte for creating node-based workflow editors.
|
|
5
|
+
*
|
|
6
|
+
* ## Module Structure (Tree-Shakable)
|
|
7
|
+
*
|
|
8
|
+
* For optimal bundle size, import from specific sub-modules:
|
|
9
|
+
*
|
|
10
|
+
* - `@d34dman/flowdrop/core` - Types and utilities only (no heavy deps)
|
|
11
|
+
* - `@d34dman/flowdrop/editor` - WorkflowEditor with @xyflow/svelte
|
|
12
|
+
* - `@d34dman/flowdrop/form` - SchemaForm with basic fields
|
|
13
|
+
* - `@d34dman/flowdrop/form/code` - Code editor support (adds CodeMirror)
|
|
14
|
+
* - `@d34dman/flowdrop/form/markdown` - Markdown editor support (adds EasyMDE)
|
|
15
|
+
* - `@d34dman/flowdrop/display` - MarkdownDisplay (adds marked)
|
|
16
|
+
* - `@d34dman/flowdrop/styles` - CSS styles
|
|
17
|
+
*
|
|
18
|
+
* ## Legacy Import (Full Bundle)
|
|
19
|
+
*
|
|
20
|
+
* Importing from the main entry point includes everything:
|
|
21
|
+
*
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { WorkflowEditor, SchemaForm } from "@d34dman/flowdrop";
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* **Note**: This will bundle ALL dependencies including @xyflow/svelte,
|
|
27
|
+
* CodeMirror, EasyMDE, and marked. For smaller bundles, use sub-modules.
|
|
28
|
+
*
|
|
29
|
+
* @module flowdrop
|
|
4
30
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from './types/auth.js';
|
|
10
|
-
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from './types/auth.js';
|
|
11
|
-
export type { WorkflowChangeType, FlowDropEventHandlers, FlowDropFeatures } from './types/events.js';
|
|
12
|
-
export { DEFAULT_FEATURES, mergeFeatures } from './types/events.js';
|
|
13
|
-
export { FlowDropApiClient } from './api/client.js';
|
|
14
|
-
export { EnhancedFlowDropApiClient } from './api/enhanced-client.js';
|
|
15
|
-
export { default as WorkflowEditor } from './components/WorkflowEditor.svelte';
|
|
16
|
-
export { default as NodeSidebar } from './components/NodeSidebar.svelte';
|
|
17
|
-
export { default as WorkflowNodeComponent } from './components/nodes/WorkflowNode.svelte';
|
|
18
|
-
export { default as SimpleNodeComponent } from './components/nodes/SimpleNode.svelte';
|
|
19
|
-
export { default as ToolNodeComponent } from './components/nodes/ToolNode.svelte';
|
|
20
|
-
export { default as NotesNodeComponent } from './components/nodes/NotesNode.svelte';
|
|
21
|
-
export { default as CanvasBanner } from './components/CanvasBanner.svelte';
|
|
22
|
-
export { default as UniversalNode } from './components/UniversalNode.svelte';
|
|
23
|
-
export { default as GatewayNode } from './components/nodes/GatewayNode.svelte';
|
|
24
|
-
export { default as SquareNode } from './components/nodes/SquareNode.svelte';
|
|
25
|
-
export { default as LoadingSpinner } from './components/LoadingSpinner.svelte';
|
|
26
|
-
export { default as StatusIcon } from './components/StatusIcon.svelte';
|
|
27
|
-
export { default as StatusLabel } from './components/StatusLabel.svelte';
|
|
28
|
-
export { default as NodeStatusOverlay } from './components/NodeStatusOverlay.svelte';
|
|
29
|
-
export { default as MarkdownDisplay } from './components/MarkdownDisplay.svelte';
|
|
30
|
-
export { default as ConfigForm } from './components/ConfigForm.svelte';
|
|
31
|
-
export { default as ConfigModal } from './components/ConfigModal.svelte';
|
|
32
|
-
export { default as ConfigPanel } from './components/ConfigPanel.svelte';
|
|
33
|
-
export { default as SchemaForm } from './components/SchemaForm.svelte';
|
|
34
|
-
export type { SchemaFormProps, FieldSchema, FieldType, FieldFormat, FieldOption } from './components/form/types.js';
|
|
35
|
-
export { default as ReadOnlyDetails } from './components/ReadOnlyDetails.svelte';
|
|
36
|
-
export { default as ConnectionLine } from './components/ConnectionLine.svelte';
|
|
37
|
-
export { default as LogsSidebar } from './components/LogsSidebar.svelte';
|
|
38
|
-
export { default as PipelineStatus } from './components/PipelineStatus.svelte';
|
|
39
|
-
export { default as Navbar } from './components/Navbar.svelte';
|
|
40
|
-
export { default as Logo } from './components/Logo.svelte';
|
|
41
|
-
export * from './utils/icons.js';
|
|
42
|
-
export * from './utils/colors.js';
|
|
43
|
-
export * from './utils/connections.js';
|
|
44
|
-
export * from './utils/config.js';
|
|
45
|
-
export * from './utils/nodeTypes.js';
|
|
46
|
-
export { getStatusColor, getStatusIcon, getStatusLabel, getStatusBackgroundColor, getStatusTextColor, createDefaultExecutionInfo, updateExecutionStart, updateExecutionComplete, updateExecutionFailed, resetExecutionInfo, formatExecutionDuration, formatLastExecuted } from './utils/nodeStatus.js';
|
|
47
|
-
export { createNodeWrapperConfig, shouldShowNodeStatus, getOptimalStatusPosition, getOptimalStatusSize, DEFAULT_NODE_STATUS_CONFIG } from './utils/nodeWrapper.js';
|
|
48
|
-
export type { NodeStatusConfig } from './utils/nodeWrapper.js';
|
|
49
|
-
export { nodeComponentRegistry, createNamespacedType, parseNamespacedType, BUILTIN_NODE_COMPONENTS, BUILTIN_NODE_TYPES, FLOWDROP_SOURCE, registerBuiltinNodes, areBuiltinsRegistered, isBuiltinType, getBuiltinTypes, resolveBuiltinAlias, registerFlowDropPlugin, unregisterFlowDropPlugin, registerCustomNode, createPlugin, isValidNamespace, getRegisteredPlugins, getPluginNodeCount } from './registry/index.js';
|
|
50
|
-
export type { NodeComponentProps, NodeComponentRegistration, NodeComponentCategory, StatusPosition, StatusSize, NodeRegistrationFilter, FlowDropPluginConfig, PluginNodeDefinition, PluginRegistrationResult } from './registry/index.js';
|
|
51
|
-
export * from './services/api.js';
|
|
52
|
-
export { showSuccess, showError, showWarning, showInfo, showLoading, dismissToast, dismissAllToasts, showPromise, showConfirmation, apiToasts, workflowToasts, pipelineToasts } from './services/toastService.js';
|
|
53
|
-
export type { ToastType, ToastOptions } from './services/toastService.js';
|
|
54
|
-
export { NodeExecutionService, nodeExecutionService } from './services/nodeExecutionService.js';
|
|
55
|
-
export { saveWorkflow, updateWorkflow, getWorkflow, getWorkflows, deleteWorkflow, getWorkflowCount, initializeSampleWorkflows } from './services/workflowStorage.js';
|
|
56
|
-
export { globalSaveWorkflow, globalExportWorkflow, initializeGlobalSave } from './services/globalSave.js';
|
|
57
|
-
export { fetchPortConfig, validatePortConfig } from './services/portConfigApi.js';
|
|
58
|
-
export { fetchDynamicSchema, resolveExternalEditUrl, getEffectiveConfigEditOptions, clearSchemaCache, invalidateSchemaCache, hasConfigEditOptions, shouldShowExternalEdit, shouldUseDynamicSchema } from './services/dynamicSchemaService.js';
|
|
59
|
-
export type { DynamicSchemaResult } from './services/dynamicSchemaService.js';
|
|
60
|
-
export { getDraftStorageKey, saveDraft, loadDraft, deleteDraft, hasDraft, getDraftMetadata, DraftAutoSaveManager } from './services/draftStorage.js';
|
|
61
|
-
export { EdgeStylingHelper, NodeOperationsHelper, WorkflowOperationsHelper, ConfigurationHelper } from './helpers/workflowEditorHelper.js';
|
|
62
|
-
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged, connectedHandles, isDirtyStore, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.js';
|
|
63
|
-
export * from './config/endpoints.js';
|
|
64
|
-
export { DEFAULT_PORT_CONFIG } from './config/defaultPortConfig.js';
|
|
65
|
-
export * from './config/runtimeConfig.js';
|
|
66
|
-
export * from './adapters/WorkflowAdapter.js';
|
|
67
|
-
export { mountWorkflowEditor, mountFlowDropApp, unmountFlowDropApp } from './svelte-app.js';
|
|
68
|
-
export type { FlowDropMountOptions, MountedFlowDropApp, NavbarAction } from './svelte-app.js';
|
|
69
|
-
export { ApiError } from './api/enhanced-client.js';
|
|
31
|
+
export * from "./core/index.js";
|
|
32
|
+
export * from "./form/index.js";
|
|
33
|
+
export * from "./display/index.js";
|
|
34
|
+
export * from "./editor/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,83 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FlowDrop - Visual Workflow Editor Library
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* A Svelte 5 component library built on @xyflow/svelte for creating node-based workflow editors.
|
|
5
|
+
*
|
|
6
|
+
* ## Module Structure (Tree-Shakable)
|
|
7
|
+
*
|
|
8
|
+
* For optimal bundle size, import from specific sub-modules:
|
|
9
|
+
*
|
|
10
|
+
* - `@d34dman/flowdrop/core` - Types and utilities only (no heavy deps)
|
|
11
|
+
* - `@d34dman/flowdrop/editor` - WorkflowEditor with @xyflow/svelte
|
|
12
|
+
* - `@d34dman/flowdrop/form` - SchemaForm with basic fields
|
|
13
|
+
* - `@d34dman/flowdrop/form/code` - Code editor support (adds CodeMirror)
|
|
14
|
+
* - `@d34dman/flowdrop/form/markdown` - Markdown editor support (adds EasyMDE)
|
|
15
|
+
* - `@d34dman/flowdrop/display` - MarkdownDisplay (adds marked)
|
|
16
|
+
* - `@d34dman/flowdrop/styles` - CSS styles
|
|
17
|
+
*
|
|
18
|
+
* ## Legacy Import (Full Bundle)
|
|
19
|
+
*
|
|
20
|
+
* Importing from the main entry point includes everything:
|
|
21
|
+
*
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { WorkflowEditor, SchemaForm } from "@d34dman/flowdrop";
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* **Note**: This will bundle ALL dependencies including @xyflow/svelte,
|
|
27
|
+
* CodeMirror, EasyMDE, and marked. For smaller bundles, use sub-modules.
|
|
28
|
+
*
|
|
29
|
+
* @module flowdrop
|
|
4
30
|
*/
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export
|
|
27
|
-
export { default as StatusIcon } from './components/StatusIcon.svelte';
|
|
28
|
-
export { default as StatusLabel } from './components/StatusLabel.svelte';
|
|
29
|
-
export { default as NodeStatusOverlay } from './components/NodeStatusOverlay.svelte';
|
|
30
|
-
export { default as MarkdownDisplay } from './components/MarkdownDisplay.svelte';
|
|
31
|
-
export { default as ConfigForm } from './components/ConfigForm.svelte';
|
|
32
|
-
export { default as ConfigModal } from './components/ConfigModal.svelte';
|
|
33
|
-
export { default as ConfigPanel } from './components/ConfigPanel.svelte';
|
|
34
|
-
export { default as SchemaForm } from './components/SchemaForm.svelte';
|
|
35
|
-
export { default as ReadOnlyDetails } from './components/ReadOnlyDetails.svelte';
|
|
36
|
-
export { default as ConnectionLine } from './components/ConnectionLine.svelte';
|
|
37
|
-
export { default as LogsSidebar } from './components/LogsSidebar.svelte';
|
|
38
|
-
export { default as PipelineStatus } from './components/PipelineStatus.svelte';
|
|
39
|
-
export { default as Navbar } from './components/Navbar.svelte';
|
|
40
|
-
export { default as Logo } from './components/Logo.svelte';
|
|
41
|
-
// Export utilities
|
|
42
|
-
export * from './utils/icons.js';
|
|
43
|
-
export * from './utils/colors.js';
|
|
44
|
-
export * from './utils/connections.js';
|
|
45
|
-
export * from './utils/config.js';
|
|
46
|
-
export * from './utils/nodeTypes.js';
|
|
47
|
-
export { getStatusColor, getStatusIcon, getStatusLabel, getStatusBackgroundColor, getStatusTextColor, createDefaultExecutionInfo, updateExecutionStart, updateExecutionComplete, updateExecutionFailed, resetExecutionInfo, formatExecutionDuration, formatLastExecuted } from './utils/nodeStatus.js';
|
|
48
|
-
export { createNodeWrapperConfig, shouldShowNodeStatus, getOptimalStatusPosition, getOptimalStatusSize, DEFAULT_NODE_STATUS_CONFIG } from './utils/nodeWrapper.js';
|
|
49
|
-
// Export node component registry
|
|
50
|
-
export {
|
|
51
|
-
// Core registry
|
|
52
|
-
nodeComponentRegistry, createNamespacedType, parseNamespacedType,
|
|
53
|
-
// Built-in nodes
|
|
54
|
-
BUILTIN_NODE_COMPONENTS, BUILTIN_NODE_TYPES, FLOWDROP_SOURCE, registerBuiltinNodes, areBuiltinsRegistered, isBuiltinType, getBuiltinTypes, resolveBuiltinAlias,
|
|
55
|
-
// Plugin system
|
|
56
|
-
registerFlowDropPlugin, unregisterFlowDropPlugin, registerCustomNode, createPlugin, isValidNamespace, getRegisteredPlugins, getPluginNodeCount } from './registry/index.js';
|
|
57
|
-
// Export services
|
|
58
|
-
export * from './services/api.js';
|
|
59
|
-
export { showSuccess, showError, showWarning, showInfo, showLoading, dismissToast, dismissAllToasts, showPromise, showConfirmation, apiToasts, workflowToasts, pipelineToasts } from './services/toastService.js';
|
|
60
|
-
export { NodeExecutionService, nodeExecutionService } from './services/nodeExecutionService.js';
|
|
61
|
-
export { saveWorkflow, updateWorkflow, getWorkflow, getWorkflows, deleteWorkflow, getWorkflowCount, initializeSampleWorkflows } from './services/workflowStorage.js';
|
|
62
|
-
export { globalSaveWorkflow, globalExportWorkflow, initializeGlobalSave } from './services/globalSave.js';
|
|
63
|
-
export { fetchPortConfig, validatePortConfig } from './services/portConfigApi.js';
|
|
64
|
-
// Export dynamic schema service for config edit functionality
|
|
65
|
-
export { fetchDynamicSchema, resolveExternalEditUrl, getEffectiveConfigEditOptions, clearSchemaCache, invalidateSchemaCache, hasConfigEditOptions, shouldShowExternalEdit, shouldUseDynamicSchema } from './services/dynamicSchemaService.js';
|
|
66
|
-
// Export draft storage service
|
|
67
|
-
export { getDraftStorageKey, saveDraft, loadDraft, deleteDraft, hasDraft, getDraftMetadata, DraftAutoSaveManager } from './services/draftStorage.js';
|
|
68
|
-
// Export helpers
|
|
69
|
-
export { EdgeStylingHelper, NodeOperationsHelper, WorkflowOperationsHelper, ConfigurationHelper } from './helpers/workflowEditorHelper.js';
|
|
70
|
-
// Export stores
|
|
71
|
-
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged, connectedHandles,
|
|
72
|
-
// Dirty state tracking
|
|
73
|
-
isDirtyStore, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.js';
|
|
74
|
-
// Export endpoint configuration
|
|
75
|
-
export * from './config/endpoints.js';
|
|
76
|
-
export { DEFAULT_PORT_CONFIG } from './config/defaultPortConfig.js';
|
|
77
|
-
export * from './config/runtimeConfig.js';
|
|
78
|
-
// Export adapters
|
|
79
|
-
export * from './adapters/WorkflowAdapter.js';
|
|
80
|
-
// Export Svelte app wrapper for framework integration
|
|
81
|
-
export { mountWorkflowEditor, mountFlowDropApp, unmountFlowDropApp } from './svelte-app.js';
|
|
82
|
-
// Export API error class
|
|
83
|
-
export { ApiError } from './api/enhanced-client.js';
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// IMPORTANT: This module re-exports from sub-modules for backward compatibility.
|
|
33
|
+
// New code should import directly from sub-modules for better tree-shaking.
|
|
34
|
+
// ============================================================================
|
|
35
|
+
// ============================================================================
|
|
36
|
+
// Core Exports (Types & Utilities - No Heavy Dependencies)
|
|
37
|
+
// ============================================================================
|
|
38
|
+
export * from "./core/index.js";
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Form Exports
|
|
41
|
+
// ============================================================================
|
|
42
|
+
export * from "./form/index.js";
|
|
43
|
+
// Note: Heavy form fields (code, markdown) are NOT auto-registered.
|
|
44
|
+
// Users must import from form/code or form/markdown and register explicitly.
|
|
45
|
+
// ============================================================================
|
|
46
|
+
// Display Exports
|
|
47
|
+
// ============================================================================
|
|
48
|
+
export * from "./display/index.js";
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Editor Exports (includes @xyflow/svelte and auto-registers builtin nodes)
|
|
51
|
+
// ============================================================================
|
|
52
|
+
export * from "./editor/index.js";
|
package/dist/styles/base.css
CHANGED
|
@@ -1157,6 +1157,11 @@
|
|
|
1157
1157
|
--flowdrop-edge-data-color-hover: var(--color-ref-gray-500);
|
|
1158
1158
|
--flowdrop-edge-data-color-selected: var(--color-ref-violet-600);
|
|
1159
1159
|
|
|
1160
|
+
/* Tool node theming tokens */
|
|
1161
|
+
--flowdrop-tool-node-color: var(--color-ref-amber-500);
|
|
1162
|
+
--flowdrop-tool-node-color-light: var(--color-ref-amber-50);
|
|
1163
|
+
--flowdrop-tool-node-color-border: var(--color-ref-amber-300);
|
|
1164
|
+
|
|
1160
1165
|
/* Semantic text color tokens */
|
|
1161
1166
|
--flowdrop-text-color-error: var(--color-ref-red-600);
|
|
1162
1167
|
--flowdrop-text-color-success: var(--color-ref-green-600);
|
package/dist/utils/colors.d.ts
CHANGED
|
@@ -148,3 +148,45 @@ export declare function isArrayDataType(dataType: string): boolean;
|
|
|
148
148
|
* @returns The element type (e.g., "string") or null if not an array
|
|
149
149
|
*/
|
|
150
150
|
export declare function getArrayElementType(arrayDataType: string): string | null;
|
|
151
|
+
/**
|
|
152
|
+
* Parse a hex color string to RGB components
|
|
153
|
+
* @param hex - Hex color string (e.g., "#f59e0b" or "f59e0b")
|
|
154
|
+
* @returns Object with r, g, b values (0-255) or null if invalid
|
|
155
|
+
*/
|
|
156
|
+
export declare function hexToRgb(hex: string): {
|
|
157
|
+
r: number;
|
|
158
|
+
g: number;
|
|
159
|
+
b: number;
|
|
160
|
+
} | null;
|
|
161
|
+
/**
|
|
162
|
+
* Convert RGB components to hex color string
|
|
163
|
+
* @param r - Red component (0-255)
|
|
164
|
+
* @param g - Green component (0-255)
|
|
165
|
+
* @param b - Blue component (0-255)
|
|
166
|
+
* @returns Hex color string with # prefix
|
|
167
|
+
*/
|
|
168
|
+
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
169
|
+
/**
|
|
170
|
+
* Generate a light tint of a color (similar to Tailwind's -50 shade)
|
|
171
|
+
* Creates a very light background-friendly version of the color
|
|
172
|
+
* @param hex - Base hex color string
|
|
173
|
+
* @returns Light tint hex color string
|
|
174
|
+
*/
|
|
175
|
+
export declare function getLightTint(hex: string): string;
|
|
176
|
+
/**
|
|
177
|
+
* Generate a border tint of a color (similar to Tailwind's -300 shade)
|
|
178
|
+
* Creates a medium-light version suitable for borders
|
|
179
|
+
* @param hex - Base hex color string
|
|
180
|
+
* @returns Border tint hex color string
|
|
181
|
+
*/
|
|
182
|
+
export declare function getBorderTint(hex: string): string;
|
|
183
|
+
/**
|
|
184
|
+
* Generate color variants for theming a component
|
|
185
|
+
* @param baseColor - Base hex color string
|
|
186
|
+
* @returns Object with base, light, and border color variants
|
|
187
|
+
*/
|
|
188
|
+
export declare function getColorVariants(baseColor: string): {
|
|
189
|
+
base: string;
|
|
190
|
+
light: string;
|
|
191
|
+
border: string;
|
|
192
|
+
};
|
package/dist/utils/colors.js
CHANGED
|
@@ -302,3 +302,80 @@ export function getArrayElementType(arrayDataType) {
|
|
|
302
302
|
}
|
|
303
303
|
return null;
|
|
304
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Parse a hex color string to RGB components
|
|
307
|
+
* @param hex - Hex color string (e.g., "#f59e0b" or "f59e0b")
|
|
308
|
+
* @returns Object with r, g, b values (0-255) or null if invalid
|
|
309
|
+
*/
|
|
310
|
+
export function hexToRgb(hex) {
|
|
311
|
+
const cleanHex = hex.replace(/^#/, "");
|
|
312
|
+
if (!/^[0-9A-Fa-f]{6}$/.test(cleanHex)) {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
const r = parseInt(cleanHex.substring(0, 2), 16);
|
|
316
|
+
const g = parseInt(cleanHex.substring(2, 4), 16);
|
|
317
|
+
const b = parseInt(cleanHex.substring(4, 6), 16);
|
|
318
|
+
return { r, g, b };
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Convert RGB components to hex color string
|
|
322
|
+
* @param r - Red component (0-255)
|
|
323
|
+
* @param g - Green component (0-255)
|
|
324
|
+
* @param b - Blue component (0-255)
|
|
325
|
+
* @returns Hex color string with # prefix
|
|
326
|
+
*/
|
|
327
|
+
export function rgbToHex(r, g, b) {
|
|
328
|
+
const toHex = (value) => {
|
|
329
|
+
const clamped = Math.max(0, Math.min(255, Math.round(value)));
|
|
330
|
+
return clamped.toString(16).padStart(2, "0");
|
|
331
|
+
};
|
|
332
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Generate a light tint of a color (similar to Tailwind's -50 shade)
|
|
336
|
+
* Creates a very light background-friendly version of the color
|
|
337
|
+
* @param hex - Base hex color string
|
|
338
|
+
* @returns Light tint hex color string
|
|
339
|
+
*/
|
|
340
|
+
export function getLightTint(hex) {
|
|
341
|
+
const rgb = hexToRgb(hex);
|
|
342
|
+
if (!rgb) {
|
|
343
|
+
return "#fffbeb"; // Fallback to amber-50
|
|
344
|
+
}
|
|
345
|
+
// Mix with white at 95% to create a very light tint
|
|
346
|
+
const mixRatio = 0.95;
|
|
347
|
+
const r = rgb.r + (255 - rgb.r) * mixRatio;
|
|
348
|
+
const g = rgb.g + (255 - rgb.g) * mixRatio;
|
|
349
|
+
const b = rgb.b + (255 - rgb.b) * mixRatio;
|
|
350
|
+
return rgbToHex(r, g, b);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Generate a border tint of a color (similar to Tailwind's -300 shade)
|
|
354
|
+
* Creates a medium-light version suitable for borders
|
|
355
|
+
* @param hex - Base hex color string
|
|
356
|
+
* @returns Border tint hex color string
|
|
357
|
+
*/
|
|
358
|
+
export function getBorderTint(hex) {
|
|
359
|
+
const rgb = hexToRgb(hex);
|
|
360
|
+
if (!rgb) {
|
|
361
|
+
return "#fcd34d"; // Fallback to amber-300
|
|
362
|
+
}
|
|
363
|
+
// Mix with white at 60% to create a medium-light tint
|
|
364
|
+
const mixRatio = 0.6;
|
|
365
|
+
const r = rgb.r + (255 - rgb.r) * mixRatio;
|
|
366
|
+
const g = rgb.g + (255 - rgb.g) * mixRatio;
|
|
367
|
+
const b = rgb.b + (255 - rgb.b) * mixRatio;
|
|
368
|
+
return rgbToHex(r, g, b);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Generate color variants for theming a component
|
|
372
|
+
* @param baseColor - Base hex color string
|
|
373
|
+
* @returns Object with base, light, and border color variants
|
|
374
|
+
*/
|
|
375
|
+
export function getColorVariants(baseColor) {
|
|
376
|
+
return {
|
|
377
|
+
base: baseColor,
|
|
378
|
+
light: getLightTint(baseColor),
|
|
379
|
+
border: getBorderTint(baseColor)
|
|
380
|
+
};
|
|
381
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@d34dman/flowdrop",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.30",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite dev",
|
|
8
8
|
"build": "vite build && npm run prepack",
|
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
],
|
|
72
72
|
"sideEffects": [
|
|
73
73
|
"**/*.css",
|
|
74
|
-
"./dist/styles/base.css"
|
|
74
|
+
"./dist/styles/base.css",
|
|
75
|
+
"./dist/editor/index.js"
|
|
75
76
|
],
|
|
76
77
|
"svelte": "./dist/index.js",
|
|
77
78
|
"types": "./dist/index.d.ts",
|
|
@@ -82,12 +83,54 @@
|
|
|
82
83
|
"svelte": "./dist/index.js",
|
|
83
84
|
"default": "./dist/index.js"
|
|
84
85
|
},
|
|
85
|
-
"./
|
|
86
|
+
"./core": {
|
|
87
|
+
"types": "./dist/core/index.d.ts",
|
|
88
|
+
"svelte": "./dist/core/index.js",
|
|
89
|
+
"default": "./dist/core/index.js"
|
|
90
|
+
},
|
|
91
|
+
"./editor": {
|
|
92
|
+
"types": "./dist/editor/index.d.ts",
|
|
93
|
+
"svelte": "./dist/editor/index.js",
|
|
94
|
+
"default": "./dist/editor/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./form": {
|
|
97
|
+
"types": "./dist/form/index.d.ts",
|
|
98
|
+
"svelte": "./dist/form/index.js",
|
|
99
|
+
"default": "./dist/form/index.js"
|
|
100
|
+
},
|
|
101
|
+
"./form/code": {
|
|
102
|
+
"types": "./dist/form/code.d.ts",
|
|
103
|
+
"svelte": "./dist/form/code.js",
|
|
104
|
+
"default": "./dist/form/code.js"
|
|
105
|
+
},
|
|
106
|
+
"./form/markdown": {
|
|
107
|
+
"types": "./dist/form/markdown.d.ts",
|
|
108
|
+
"svelte": "./dist/form/markdown.js",
|
|
109
|
+
"default": "./dist/form/markdown.js"
|
|
110
|
+
},
|
|
111
|
+
"./form/full": {
|
|
112
|
+
"types": "./dist/form/full.d.ts",
|
|
113
|
+
"svelte": "./dist/form/full.js",
|
|
114
|
+
"default": "./dist/form/full.js"
|
|
115
|
+
},
|
|
116
|
+
"./display": {
|
|
117
|
+
"types": "./dist/display/index.d.ts",
|
|
118
|
+
"svelte": "./dist/display/index.js",
|
|
119
|
+
"default": "./dist/display/index.js"
|
|
120
|
+
},
|
|
121
|
+
"./styles": "./dist/styles/base.css",
|
|
122
|
+
"./styles/*": "./dist/styles/*"
|
|
86
123
|
},
|
|
87
124
|
"peerDependencies": {
|
|
125
|
+
"@iconify/svelte": "^5.0.0",
|
|
88
126
|
"@sveltejs/kit": "^2.0.0",
|
|
89
127
|
"svelte": "^5.0.0"
|
|
90
128
|
},
|
|
129
|
+
"peerDependenciesMeta": {
|
|
130
|
+
"@iconify/svelte": {
|
|
131
|
+
"optional": false
|
|
132
|
+
}
|
|
133
|
+
},
|
|
91
134
|
"repository": {
|
|
92
135
|
"type": "git",
|
|
93
136
|
"url": "git+https://github.com/d34dman/flowdrop.git"
|