@seed-ship/mcp-ui-solid 2.0.1 → 2.1.1
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/AutocompleteDropdown.cjs +201 -0
- package/dist/components/AutocompleteDropdown.cjs.map +1 -0
- package/dist/components/AutocompleteDropdown.d.ts +71 -0
- package/dist/components/AutocompleteDropdown.d.ts.map +1 -0
- package/dist/components/AutocompleteDropdown.js +201 -0
- package/dist/components/AutocompleteDropdown.js.map +1 -0
- package/dist/components/AutocompleteFormField.cjs +289 -0
- package/dist/components/AutocompleteFormField.cjs.map +1 -0
- package/dist/components/AutocompleteFormField.d.ts +52 -0
- package/dist/components/AutocompleteFormField.d.ts.map +1 -0
- package/dist/components/AutocompleteFormField.js +289 -0
- package/dist/components/AutocompleteFormField.js.map +1 -0
- package/dist/components/DraggableGridItem.cjs +133 -0
- package/dist/components/DraggableGridItem.cjs.map +1 -0
- package/dist/components/DraggableGridItem.d.ts +95 -0
- package/dist/components/DraggableGridItem.d.ts.map +1 -0
- package/dist/components/DraggableGridItem.js +133 -0
- package/dist/components/DraggableGridItem.js.map +1 -0
- package/dist/components/EditableUIResourceRenderer.cjs +199 -0
- package/dist/components/EditableUIResourceRenderer.cjs.map +1 -0
- package/dist/components/EditableUIResourceRenderer.d.ts +43 -0
- package/dist/components/EditableUIResourceRenderer.d.ts.map +1 -0
- package/dist/components/EditableUIResourceRenderer.js +199 -0
- package/dist/components/EditableUIResourceRenderer.js.map +1 -0
- package/dist/components/GhostText.cjs +105 -0
- package/dist/components/GhostText.cjs.map +1 -0
- package/dist/components/GhostText.d.ts +113 -0
- package/dist/components/GhostText.d.ts.map +1 -0
- package/dist/components/GhostText.js +105 -0
- package/dist/components/GhostText.js.map +1 -0
- package/dist/components/ResizeHandle.cjs +177 -0
- package/dist/components/ResizeHandle.cjs.map +1 -0
- package/dist/components/ResizeHandle.d.ts +50 -0
- package/dist/components/ResizeHandle.d.ts.map +1 -0
- package/dist/components/ResizeHandle.js +177 -0
- package/dist/components/ResizeHandle.js.map +1 -0
- package/dist/context/AutocompleteContext.cjs +158 -0
- package/dist/context/AutocompleteContext.cjs.map +1 -0
- package/dist/context/AutocompleteContext.d.ts +77 -0
- package/dist/context/AutocompleteContext.d.ts.map +1 -0
- package/dist/context/AutocompleteContext.js +158 -0
- package/dist/context/AutocompleteContext.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useAutocomplete.cjs +242 -0
- package/dist/hooks/useAutocomplete.cjs.map +1 -0
- package/dist/hooks/useAutocomplete.d.ts +119 -0
- package/dist/hooks/useAutocomplete.d.ts.map +1 -0
- package/dist/hooks/useAutocomplete.js +242 -0
- package/dist/hooks/useAutocomplete.js.map +1 -0
- package/dist/hooks/useDragDrop.cjs +170 -0
- package/dist/hooks/useDragDrop.cjs.map +1 -0
- package/dist/hooks/useDragDrop.d.ts +100 -0
- package/dist/hooks/useDragDrop.d.ts.map +1 -0
- package/dist/hooks/useDragDrop.js +170 -0
- package/dist/hooks/useDragDrop.js.map +1 -0
- package/dist/hooks/useResize.cjs +209 -0
- package/dist/hooks/useResize.cjs.map +1 -0
- package/dist/hooks/useResize.d.ts +87 -0
- package/dist/hooks/useResize.d.ts.map +1 -0
- package/dist/hooks/useResize.js +209 -0
- package/dist/hooks/useResize.js.map +1 -0
- package/dist/hooks.cjs +6 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +6 -0
- package/dist/hooks.d.ts +6 -0
- package/dist/hooks.js +6 -0
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/plugins/duckdb.cjs +192 -0
- package/dist/plugins/duckdb.cjs.map +1 -0
- package/dist/plugins/duckdb.d.ts +20 -0
- package/dist/plugins/duckdb.d.ts.map +1 -0
- package/dist/plugins/duckdb.js +170 -0
- package/dist/plugins/duckdb.js.map +1 -0
- package/dist/plugins/groq.cjs +97 -0
- package/dist/plugins/groq.cjs.map +1 -0
- package/dist/plugins/groq.d.ts +13 -0
- package/dist/plugins/groq.d.ts.map +1 -0
- package/dist/plugins/groq.js +97 -0
- package/dist/plugins/groq.js.map +1 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/rest.cjs +92 -0
- package/dist/plugins/rest.cjs.map +1 -0
- package/dist/plugins/rest.d.ts +13 -0
- package/dist/plugins/rest.d.ts.map +1 -0
- package/dist/plugins/rest.js +92 -0
- package/dist/plugins/rest.js.map +1 -0
- package/dist/plugins/supabase.cjs +79 -0
- package/dist/plugins/supabase.cjs.map +1 -0
- package/dist/plugins/supabase.d.ts +13 -0
- package/dist/plugins/supabase.d.ts.map +1 -0
- package/dist/plugins/supabase.js +79 -0
- package/dist/plugins/supabase.js.map +1 -0
- package/dist/types/index.d.ts +430 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.d.cts +430 -0
- package/dist/types.d.ts +430 -0
- package/esbuild-why-Full bundle (with deps).html +51 -0
- package/esbuild-why-Hooks only.html +51 -0
- package/esbuild-why-Streaming renderer.html +51 -0
- package/package.json +16 -1
- package/src/components/AutocompleteDropdown.tsx +329 -0
- package/src/components/AutocompleteFormField.tsx +288 -0
- package/src/components/DraggableGridItem.tsx +274 -0
- package/src/components/EditableUIResourceRenderer.tsx +268 -0
- package/src/components/GhostText.tsx +262 -0
- package/src/components/ResizeHandle.tsx +267 -0
- package/src/context/AutocompleteContext.tsx +317 -0
- package/src/hooks/index.ts +23 -0
- package/src/hooks/useAutocomplete.test.ts +334 -0
- package/src/hooks/useAutocomplete.ts +482 -0
- package/src/hooks/useDragDrop.test.ts +355 -0
- package/src/hooks/useDragDrop.ts +379 -0
- package/src/hooks/useResize.test.ts +313 -0
- package/src/hooks/useResize.ts +372 -0
- package/src/index.ts +71 -0
- package/src/plugins/duckdb.ts +269 -0
- package/src/plugins/groq.ts +137 -0
- package/src/plugins/index.ts +14 -0
- package/src/plugins/rest.ts +147 -0
- package/src/plugins/supabase.ts +120 -0
- package/src/styles/autocomplete.css +356 -0
- package/src/styles/drag-drop.css +297 -0
- package/src/styles/index.css +7 -0
- package/src/types/index.ts +529 -0
- package/src/vite-env.d.ts +18 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +2 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { createSignal, onCleanup } from "solid-js";
|
|
2
|
+
import { isServer } from "solid-js/web";
|
|
3
|
+
function applyConstraints(position, constraints, gridColumns) {
|
|
4
|
+
let { colStart, colSpan, rowStart, rowSpan } = position;
|
|
5
|
+
const minColSpan = constraints.minColSpan ?? 1;
|
|
6
|
+
const maxColSpan = constraints.maxColSpan ?? gridColumns;
|
|
7
|
+
colSpan = Math.max(minColSpan, Math.min(maxColSpan, colSpan));
|
|
8
|
+
if (colStart + colSpan - 1 > gridColumns) {
|
|
9
|
+
colStart = gridColumns - colSpan + 1;
|
|
10
|
+
}
|
|
11
|
+
colStart = Math.max(1, colStart);
|
|
12
|
+
if (rowSpan !== void 0) {
|
|
13
|
+
const minRowSpan = constraints.minRowSpan ?? 1;
|
|
14
|
+
const maxRowSpan = constraints.maxRowSpan ?? 99;
|
|
15
|
+
rowSpan = Math.max(minRowSpan, Math.min(maxRowSpan, rowSpan));
|
|
16
|
+
}
|
|
17
|
+
if (rowStart !== void 0) {
|
|
18
|
+
rowStart = Math.max(1, rowStart);
|
|
19
|
+
}
|
|
20
|
+
return { colStart, colSpan, rowStart, rowSpan };
|
|
21
|
+
}
|
|
22
|
+
function useResize(options) {
|
|
23
|
+
const {
|
|
24
|
+
currentPosition,
|
|
25
|
+
onResize,
|
|
26
|
+
onResizePreview,
|
|
27
|
+
constraints = {},
|
|
28
|
+
gridContainer,
|
|
29
|
+
gridColumns = 12,
|
|
30
|
+
enabled = true
|
|
31
|
+
} = options;
|
|
32
|
+
const [isResizing, setIsResizing] = createSignal(false);
|
|
33
|
+
const [resizeEdge, setResizeEdge] = createSignal(null);
|
|
34
|
+
const [previewPosition, setPreviewPosition] = createSignal(null);
|
|
35
|
+
const [startPosition, setStartPosition] = createSignal(null);
|
|
36
|
+
const [startPointer, setStartPointer] = createSignal(null);
|
|
37
|
+
if (isServer) {
|
|
38
|
+
return {
|
|
39
|
+
isResizing: () => false,
|
|
40
|
+
resizeEdge: () => null,
|
|
41
|
+
previewPosition: () => null,
|
|
42
|
+
handleResizeStart: () => {
|
|
43
|
+
},
|
|
44
|
+
getResizeHandleProps: () => ({
|
|
45
|
+
onPointerDown: () => {
|
|
46
|
+
},
|
|
47
|
+
style: {},
|
|
48
|
+
"data-resize-edge": "right"
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const handlePointerMove = (e) => {
|
|
53
|
+
if (!isResizing() || !startPosition() || !startPointer()) return;
|
|
54
|
+
const edge = resizeEdge();
|
|
55
|
+
if (!edge) return;
|
|
56
|
+
const container = (gridContainer == null ? void 0 : gridContainer()) || document.querySelector("[data-grid-container]");
|
|
57
|
+
if (!container) return;
|
|
58
|
+
const containerRect = container.getBoundingClientRect();
|
|
59
|
+
const currentPos = startPosition();
|
|
60
|
+
const start = startPointer();
|
|
61
|
+
let newPosition = { ...currentPos };
|
|
62
|
+
const deltaX = e.clientX - start.x;
|
|
63
|
+
const columnWidth = containerRect.width / gridColumns;
|
|
64
|
+
const columnDelta = Math.round(deltaX / columnWidth);
|
|
65
|
+
if (constraints.lockHorizontal && (edge === "left" || edge === "right")) ;
|
|
66
|
+
else {
|
|
67
|
+
switch (edge) {
|
|
68
|
+
case "right": {
|
|
69
|
+
const newColSpan = currentPos.colSpan + columnDelta;
|
|
70
|
+
newPosition.colSpan = Math.max(1, Math.min(gridColumns - currentPos.colStart + 1, newColSpan));
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case "left": {
|
|
74
|
+
const newColStart = currentPos.colStart + columnDelta;
|
|
75
|
+
const newColSpan = currentPos.colSpan - columnDelta;
|
|
76
|
+
if (newColStart >= 1 && newColSpan >= 1) {
|
|
77
|
+
newPosition.colStart = newColStart;
|
|
78
|
+
newPosition.colSpan = newColSpan;
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case "top":
|
|
83
|
+
case "bottom": {
|
|
84
|
+
if (!constraints.lockVertical) {
|
|
85
|
+
const rowHeight = 100;
|
|
86
|
+
const deltaY = e.clientY - start.y;
|
|
87
|
+
const rowDelta = Math.round(deltaY / rowHeight);
|
|
88
|
+
if (edge === "bottom") {
|
|
89
|
+
const currentRowSpan = currentPos.rowSpan || 1;
|
|
90
|
+
const newRowSpan = currentRowSpan + rowDelta;
|
|
91
|
+
newPosition.rowSpan = Math.max(1, newRowSpan);
|
|
92
|
+
} else if (edge === "top") {
|
|
93
|
+
const currentRowStart = currentPos.rowStart || 1;
|
|
94
|
+
const currentRowSpan = currentPos.rowSpan || 1;
|
|
95
|
+
const newRowStart = currentRowStart + rowDelta;
|
|
96
|
+
const newRowSpan = currentRowSpan - rowDelta;
|
|
97
|
+
if (newRowStart >= 1 && newRowSpan >= 1) {
|
|
98
|
+
newPosition.rowStart = newRowStart;
|
|
99
|
+
newPosition.rowSpan = newRowSpan;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
newPosition = applyConstraints(newPosition, constraints, gridColumns);
|
|
108
|
+
setPreviewPosition(newPosition);
|
|
109
|
+
onResizePreview == null ? void 0 : onResizePreview(newPosition);
|
|
110
|
+
};
|
|
111
|
+
const handlePointerUp = (_e) => {
|
|
112
|
+
if (!isResizing()) return;
|
|
113
|
+
const preview = previewPosition();
|
|
114
|
+
if (preview) {
|
|
115
|
+
onResize(preview);
|
|
116
|
+
}
|
|
117
|
+
setIsResizing(false);
|
|
118
|
+
setResizeEdge(null);
|
|
119
|
+
setPreviewPosition(null);
|
|
120
|
+
setStartPosition(null);
|
|
121
|
+
setStartPointer(null);
|
|
122
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
123
|
+
document.removeEventListener("pointerup", handlePointerUp);
|
|
124
|
+
document.body.style.cursor = "";
|
|
125
|
+
document.body.style.userSelect = "";
|
|
126
|
+
};
|
|
127
|
+
const handleResizeStart = (e, edge) => {
|
|
128
|
+
if (!enabled) return;
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
e.stopPropagation();
|
|
131
|
+
setIsResizing(true);
|
|
132
|
+
setResizeEdge(edge);
|
|
133
|
+
setStartPosition(currentPosition());
|
|
134
|
+
setStartPointer({ x: e.clientX, y: e.clientY });
|
|
135
|
+
setPreviewPosition(currentPosition());
|
|
136
|
+
const cursors = {
|
|
137
|
+
left: "ew-resize",
|
|
138
|
+
right: "ew-resize",
|
|
139
|
+
top: "ns-resize",
|
|
140
|
+
bottom: "ns-resize"
|
|
141
|
+
};
|
|
142
|
+
document.body.style.cursor = cursors[edge];
|
|
143
|
+
document.body.style.userSelect = "none";
|
|
144
|
+
document.addEventListener("pointermove", handlePointerMove);
|
|
145
|
+
document.addEventListener("pointerup", handlePointerUp);
|
|
146
|
+
};
|
|
147
|
+
const getResizeHandleProps = (edge) => {
|
|
148
|
+
const baseStyle = {
|
|
149
|
+
position: "absolute",
|
|
150
|
+
zIndex: "10"
|
|
151
|
+
};
|
|
152
|
+
const edgeStyles = {
|
|
153
|
+
left: {
|
|
154
|
+
...baseStyle,
|
|
155
|
+
left: "-4px",
|
|
156
|
+
top: "0",
|
|
157
|
+
width: "8px",
|
|
158
|
+
height: "100%",
|
|
159
|
+
cursor: "ew-resize"
|
|
160
|
+
},
|
|
161
|
+
right: {
|
|
162
|
+
...baseStyle,
|
|
163
|
+
right: "-4px",
|
|
164
|
+
top: "0",
|
|
165
|
+
width: "8px",
|
|
166
|
+
height: "100%",
|
|
167
|
+
cursor: "ew-resize"
|
|
168
|
+
},
|
|
169
|
+
top: {
|
|
170
|
+
...baseStyle,
|
|
171
|
+
top: "-4px",
|
|
172
|
+
left: "0",
|
|
173
|
+
width: "100%",
|
|
174
|
+
height: "8px",
|
|
175
|
+
cursor: "ns-resize"
|
|
176
|
+
},
|
|
177
|
+
bottom: {
|
|
178
|
+
...baseStyle,
|
|
179
|
+
bottom: "-4px",
|
|
180
|
+
left: "0",
|
|
181
|
+
width: "100%",
|
|
182
|
+
height: "8px",
|
|
183
|
+
cursor: "ns-resize"
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
return {
|
|
187
|
+
onPointerDown: (e) => handleResizeStart(e, edge),
|
|
188
|
+
style: edgeStyles[edge],
|
|
189
|
+
"data-resize-edge": edge
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
onCleanup(() => {
|
|
193
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
194
|
+
document.removeEventListener("pointerup", handlePointerUp);
|
|
195
|
+
document.body.style.cursor = "";
|
|
196
|
+
document.body.style.userSelect = "";
|
|
197
|
+
});
|
|
198
|
+
return {
|
|
199
|
+
isResizing,
|
|
200
|
+
resizeEdge,
|
|
201
|
+
previewPosition,
|
|
202
|
+
handleResizeStart,
|
|
203
|
+
getResizeHandleProps
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
export {
|
|
207
|
+
useResize
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=useResize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResize.js","sources":["../../src/hooks/useResize.ts"],"sourcesContent":["/**\n * useResize Hook\n * Handles resizing of grid components by dragging edges\n *\n * Sprint Drag-Drop Feature\n */\n\nimport { createSignal, Accessor, onCleanup } from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport type { GridPosition, ResizeConstraints } from '../types'\n\n/**\n * Resize edge types\n */\nexport type ResizeEdge = 'left' | 'right' | 'top' | 'bottom'\n\n/**\n * Options for the useResize hook\n */\nexport interface UseResizeOptions {\n /**\n * Component ID being resized\n */\n componentId: string\n\n /**\n * Current grid position accessor\n */\n currentPosition: Accessor<GridPosition>\n\n /**\n * Callback when resize is complete\n */\n onResize: (newPosition: GridPosition) => void\n\n /**\n * Callback during resize (for preview)\n */\n onResizePreview?: (previewPosition: GridPosition) => void\n\n /**\n * Resize constraints\n */\n constraints?: ResizeConstraints\n\n /**\n * Grid container element for calculating column widths\n */\n gridContainer?: Accessor<HTMLElement | null>\n\n /**\n * Number of columns in the grid (default: 12)\n */\n gridColumns?: number\n\n /**\n * Whether resize is enabled\n */\n enabled?: boolean\n}\n\n/**\n * Return type for the useResize hook\n */\nexport interface UseResizeReturn {\n /**\n * Whether a resize is in progress\n */\n isResizing: Accessor<boolean>\n\n /**\n * Current resize edge\n */\n resizeEdge: Accessor<ResizeEdge | null>\n\n /**\n * Preview position during resize\n */\n previewPosition: Accessor<GridPosition | null>\n\n /**\n * Start resize operation\n */\n handleResizeStart: (e: PointerEvent, edge: ResizeEdge) => void\n\n /**\n * Get resize handle props for an edge\n */\n getResizeHandleProps: (edge: ResizeEdge) => ResizeHandleProps\n}\n\n/**\n * Props for resize handles\n */\nexport interface ResizeHandleProps {\n onPointerDown: (e: PointerEvent) => void\n style: Record<string, string>\n 'data-resize-edge': ResizeEdge\n}\n\n/**\n * Apply constraints to a position\n */\nfunction applyConstraints(\n position: GridPosition,\n constraints: ResizeConstraints,\n gridColumns: number\n): GridPosition {\n let { colStart, colSpan, rowStart, rowSpan } = position\n\n // Apply column constraints\n const minColSpan = constraints.minColSpan ?? 1\n const maxColSpan = constraints.maxColSpan ?? gridColumns\n\n colSpan = Math.max(minColSpan, Math.min(maxColSpan, colSpan))\n\n // Ensure colStart + colSpan doesn't exceed grid\n if (colStart + colSpan - 1 > gridColumns) {\n colStart = gridColumns - colSpan + 1\n }\n colStart = Math.max(1, colStart)\n\n // Apply row constraints\n if (rowSpan !== undefined) {\n const minRowSpan = constraints.minRowSpan ?? 1\n const maxRowSpan = constraints.maxRowSpan ?? 99\n rowSpan = Math.max(minRowSpan, Math.min(maxRowSpan, rowSpan))\n }\n\n if (rowStart !== undefined) {\n rowStart = Math.max(1, rowStart)\n }\n\n return { colStart, colSpan, rowStart, rowSpan }\n}\n\n/**\n * Hook for handling resize of grid components\n */\nexport function useResize(options: UseResizeOptions): UseResizeReturn {\n const {\n currentPosition,\n onResize,\n onResizePreview,\n constraints = {},\n gridContainer,\n gridColumns = 12,\n enabled = true\n } = options\n\n const [isResizing, setIsResizing] = createSignal(false)\n const [resizeEdge, setResizeEdge] = createSignal<ResizeEdge | null>(null)\n const [previewPosition, setPreviewPosition] = createSignal<GridPosition | null>(null)\n const [startPosition, setStartPosition] = createSignal<GridPosition | null>(null)\n const [startPointer, setStartPointer] = createSignal<{ x: number; y: number } | null>(null)\n\n // Skip on server\n if (isServer) {\n return {\n isResizing: () => false,\n resizeEdge: () => null,\n previewPosition: () => null,\n handleResizeStart: () => {},\n getResizeHandleProps: () => ({\n onPointerDown: () => {},\n style: {},\n 'data-resize-edge': 'right' as ResizeEdge\n })\n }\n }\n\n /**\n * Handle pointer move during resize\n */\n const handlePointerMove = (e: PointerEvent) => {\n if (!isResizing() || !startPosition() || !startPointer()) return\n\n const edge = resizeEdge()\n if (!edge) return\n\n // Get container for measurements\n const container = gridContainer?.() || document.querySelector('[data-grid-container]')\n if (!container) return\n\n const containerRect = container.getBoundingClientRect()\n const currentPos = startPosition()!\n const start = startPointer()!\n\n let newPosition: GridPosition = { ...currentPos }\n\n // Calculate delta in columns\n const deltaX = e.clientX - start.x\n const columnWidth = containerRect.width / gridColumns\n const columnDelta = Math.round(deltaX / columnWidth)\n\n if (constraints.lockHorizontal && (edge === 'left' || edge === 'right')) {\n // Horizontal resize is locked\n } else {\n switch (edge) {\n case 'right': {\n // Increase/decrease colSpan from the right\n const newColSpan = currentPos.colSpan + columnDelta\n newPosition.colSpan = Math.max(1, Math.min(gridColumns - currentPos.colStart + 1, newColSpan))\n break\n }\n case 'left': {\n // Increase/decrease from left (changes both colStart and colSpan)\n const newColStart = currentPos.colStart + columnDelta\n const newColSpan = currentPos.colSpan - columnDelta\n if (newColStart >= 1 && newColSpan >= 1) {\n newPosition.colStart = newColStart\n newPosition.colSpan = newColSpan\n }\n break\n }\n case 'top':\n case 'bottom': {\n // Row resizing - calculate based on Y movement\n if (!constraints.lockVertical) {\n const rowHeight = 100 // Approximate row height\n const deltaY = e.clientY - start.y\n const rowDelta = Math.round(deltaY / rowHeight)\n\n if (edge === 'bottom') {\n const currentRowSpan = currentPos.rowSpan || 1\n const newRowSpan = currentRowSpan + rowDelta\n newPosition.rowSpan = Math.max(1, newRowSpan)\n } else if (edge === 'top') {\n const currentRowStart = currentPos.rowStart || 1\n const currentRowSpan = currentPos.rowSpan || 1\n const newRowStart = currentRowStart + rowDelta\n const newRowSpan = currentRowSpan - rowDelta\n if (newRowStart >= 1 && newRowSpan >= 1) {\n newPosition.rowStart = newRowStart\n newPosition.rowSpan = newRowSpan\n }\n }\n }\n break\n }\n }\n }\n\n // Apply constraints\n newPosition = applyConstraints(newPosition, constraints, gridColumns)\n\n setPreviewPosition(newPosition)\n onResizePreview?.(newPosition)\n }\n\n /**\n * Handle pointer up to finish resize\n */\n const handlePointerUp = (_e: PointerEvent) => {\n if (!isResizing()) return\n\n const preview = previewPosition()\n if (preview) {\n onResize(preview)\n }\n\n // Cleanup\n setIsResizing(false)\n setResizeEdge(null)\n setPreviewPosition(null)\n setStartPosition(null)\n setStartPointer(null)\n\n // Remove listeners\n document.removeEventListener('pointermove', handlePointerMove)\n document.removeEventListener('pointerup', handlePointerUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n\n /**\n * Start resize operation\n */\n const handleResizeStart = (e: PointerEvent, edge: ResizeEdge) => {\n if (!enabled) return\n\n e.preventDefault()\n e.stopPropagation()\n\n setIsResizing(true)\n setResizeEdge(edge)\n setStartPosition(currentPosition())\n setStartPointer({ x: e.clientX, y: e.clientY })\n setPreviewPosition(currentPosition())\n\n // Set cursor\n const cursors: Record<ResizeEdge, string> = {\n left: 'ew-resize',\n right: 'ew-resize',\n top: 'ns-resize',\n bottom: 'ns-resize'\n }\n document.body.style.cursor = cursors[edge]\n document.body.style.userSelect = 'none'\n\n // Add document listeners\n document.addEventListener('pointermove', handlePointerMove)\n document.addEventListener('pointerup', handlePointerUp)\n }\n\n /**\n * Get resize handle props for an edge\n */\n const getResizeHandleProps = (edge: ResizeEdge): ResizeHandleProps => {\n const baseStyle: Record<string, string> = {\n position: 'absolute',\n zIndex: '10'\n }\n\n const edgeStyles: Record<ResizeEdge, Record<string, string>> = {\n left: {\n ...baseStyle,\n left: '-4px',\n top: '0',\n width: '8px',\n height: '100%',\n cursor: 'ew-resize'\n },\n right: {\n ...baseStyle,\n right: '-4px',\n top: '0',\n width: '8px',\n height: '100%',\n cursor: 'ew-resize'\n },\n top: {\n ...baseStyle,\n top: '-4px',\n left: '0',\n width: '100%',\n height: '8px',\n cursor: 'ns-resize'\n },\n bottom: {\n ...baseStyle,\n bottom: '-4px',\n left: '0',\n width: '100%',\n height: '8px',\n cursor: 'ns-resize'\n }\n }\n\n return {\n onPointerDown: (e) => handleResizeStart(e, edge),\n style: edgeStyles[edge],\n 'data-resize-edge': edge\n }\n }\n\n // Cleanup on unmount\n onCleanup(() => {\n document.removeEventListener('pointermove', handlePointerMove)\n document.removeEventListener('pointerup', handlePointerUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n })\n\n return {\n isResizing,\n resizeEdge,\n previewPosition,\n handleResizeStart,\n getResizeHandleProps\n }\n}\n"],"names":[],"mappings":";;AAuGA,SAAS,iBACP,UACA,aACA,aACc;AACd,MAAI,EAAE,UAAU,SAAS,UAAU,YAAY;AAG/C,QAAM,aAAa,YAAY,cAAc;AAC7C,QAAM,aAAa,YAAY,cAAc;AAE7C,YAAU,KAAK,IAAI,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;AAAA,MAC7D,MAAM;AAAA,QACJ,GAAG;AAAA,QACH,MAAM;AAAA,QACN,KAAK;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,QAAQ;AAAA,MAAA;AAAA,MAEV,OAAO;AAAA,QACL,GAAG;AAAA,QACH,OAAO;AAAA,QACP,KAAK;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,QAAQ;AAAA,MAAA;AAAA,MAEV,KAAK;AAAA,QACH,GAAG;AAAA,QACH,KAAK;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,QAAQ;AAAA,MAAA;AAAA,MAEV,QAAQ;AAAA,QACN,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,QAAQ;AAAA,MAAA;AAAA,IACV;AAGF,WAAO;AAAA,MACL,eAAe,CAAC,MAAM,kBAAkB,GAAG,IAAI;AAAA,MAC/C,OAAO,WAAW,IAAI;AAAA,MACtB,oBAAoB;AAAA,IAAA;AAAA,EAExB;AAGA,YAAU,MAAM;AACd,aAAS,oBAAoB,eAAe,iBAAiB;AAC7D,aAAS,oBAAoB,aAAa,eAAe;AACzD,aAAS,KAAK,MAAM,SAAS;AAC7B,aAAS,KAAK,MAAM,aAAa;AAAA,EACnC,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
package/dist/hooks.cjs
CHANGED
|
@@ -5,6 +5,9 @@ const useAction = require("./hooks/useAction.cjs");
|
|
|
5
5
|
const useConditionalField = require("./hooks/useConditionalField.cjs");
|
|
6
6
|
const useModal = require("./hooks/useModal.cjs");
|
|
7
7
|
const useFormPersistence = require("./hooks/useFormPersistence.cjs");
|
|
8
|
+
const useDragDrop = require("./hooks/useDragDrop.cjs");
|
|
9
|
+
const useResize = require("./hooks/useResize.cjs");
|
|
10
|
+
const useAutocomplete = require("./hooks/useAutocomplete.cjs");
|
|
8
11
|
exports.useStreamingUI = useStreamingUI.useStreamingUI;
|
|
9
12
|
exports.useAction = useAction.useAction;
|
|
10
13
|
exports.useToolAction = useAction.useToolAction;
|
|
@@ -13,4 +16,7 @@ exports.useConditionalField = useConditionalField.useConditionalField;
|
|
|
13
16
|
exports.useConfirmModal = useModal.useConfirmModal;
|
|
14
17
|
exports.useModal = useModal.useModal;
|
|
15
18
|
exports.useFormPersistence = useFormPersistence.useFormPersistence;
|
|
19
|
+
exports.useDragDrop = useDragDrop.useDragDrop;
|
|
20
|
+
exports.useResize = useResize.useResize;
|
|
21
|
+
exports.useAutocomplete = useAutocomplete.useAutocomplete;
|
|
16
22
|
//# sourceMappingURL=hooks.cjs.map
|
package/dist/hooks.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/hooks.d.cts
CHANGED
|
@@ -13,4 +13,10 @@ export { useModal, useConfirmModal } from './useModal';
|
|
|
13
13
|
export type { UseModalReturn, UseConfirmModalReturn } from './useModal';
|
|
14
14
|
export { useFormPersistence } from './useFormPersistence';
|
|
15
15
|
export type { UseFormPersistenceOptions, UseFormPersistenceReturn } from './useFormPersistence';
|
|
16
|
+
export { useDragDrop } from './useDragDrop';
|
|
17
|
+
export type { UseDragDropOptions, UseDragDropReturn, DragProps, } from './useDragDrop';
|
|
18
|
+
export { useResize } from './useResize';
|
|
19
|
+
export type { UseResizeOptions, UseResizeReturn, ResizeEdge, ResizeHandleProps, } from './useResize';
|
|
20
|
+
export { useAutocomplete } from './useAutocomplete';
|
|
21
|
+
export type { UseAutocompleteOptions, UseAutocompleteReturn, } from './useAutocomplete';
|
|
16
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/hooks.d.ts
CHANGED
|
@@ -13,4 +13,10 @@ export { useModal, useConfirmModal } from './useModal';
|
|
|
13
13
|
export type { UseModalReturn, UseConfirmModalReturn } from './useModal';
|
|
14
14
|
export { useFormPersistence } from './useFormPersistence';
|
|
15
15
|
export type { UseFormPersistenceOptions, UseFormPersistenceReturn } from './useFormPersistence';
|
|
16
|
+
export { useDragDrop } from './useDragDrop';
|
|
17
|
+
export type { UseDragDropOptions, UseDragDropReturn, DragProps, } from './useDragDrop';
|
|
18
|
+
export { useResize } from './useResize';
|
|
19
|
+
export type { UseResizeOptions, UseResizeReturn, ResizeEdge, ResizeHandleProps, } from './useResize';
|
|
20
|
+
export { useAutocomplete } from './useAutocomplete';
|
|
21
|
+
export type { UseAutocompleteOptions, UseAutocompleteReturn, } from './useAutocomplete';
|
|
16
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/hooks.js
CHANGED
|
@@ -3,13 +3,19 @@ import { useAction, useToolAction } from "./hooks/useAction.js";
|
|
|
3
3
|
import { evaluateCondition, useConditionalField } from "./hooks/useConditionalField.js";
|
|
4
4
|
import { useConfirmModal, useModal } from "./hooks/useModal.js";
|
|
5
5
|
import { useFormPersistence } from "./hooks/useFormPersistence.js";
|
|
6
|
+
import { useDragDrop } from "./hooks/useDragDrop.js";
|
|
7
|
+
import { useResize } from "./hooks/useResize.js";
|
|
8
|
+
import { useAutocomplete } from "./hooks/useAutocomplete.js";
|
|
6
9
|
export {
|
|
7
10
|
evaluateCondition,
|
|
8
11
|
useAction,
|
|
12
|
+
useAutocomplete,
|
|
9
13
|
useConditionalField,
|
|
10
14
|
useConfirmModal,
|
|
15
|
+
useDragDrop,
|
|
11
16
|
useFormPersistence,
|
|
12
17
|
useModal,
|
|
18
|
+
useResize,
|
|
13
19
|
useStreamingUI,
|
|
14
20
|
useToolAction
|
|
15
21
|
};
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/index.cjs
CHANGED
|
@@ -15,17 +15,37 @@ require("./components/ActionGroupRenderer.cjs");
|
|
|
15
15
|
require("./components/LightboxOverlay.cjs");
|
|
16
16
|
require("./components/ImageGalleryRenderer.cjs");
|
|
17
17
|
require("./components/CodeBlockRenderer.cjs");
|
|
18
|
+
const DraggableGridItem = require("./components/DraggableGridItem.cjs");
|
|
19
|
+
const ResizeHandle = require("./components/ResizeHandle.cjs");
|
|
20
|
+
const EditableUIResourceRenderer = require("./components/EditableUIResourceRenderer.cjs");
|
|
21
|
+
const GhostText = require("./components/GhostText.cjs");
|
|
22
|
+
const AutocompleteDropdown = require("./components/AutocompleteDropdown.cjs");
|
|
23
|
+
const AutocompleteFormField = require("./components/AutocompleteFormField.cjs");
|
|
18
24
|
const useStreamingUI = require("./hooks/useStreamingUI.cjs");
|
|
19
25
|
const useAction = require("./hooks/useAction.cjs");
|
|
20
26
|
const useConditionalField = require("./hooks/useConditionalField.cjs");
|
|
21
27
|
const useModal = require("./hooks/useModal.cjs");
|
|
22
28
|
const useFormPersistence = require("./hooks/useFormPersistence.cjs");
|
|
29
|
+
const useDragDrop = require("./hooks/useDragDrop.cjs");
|
|
30
|
+
const useResize = require("./hooks/useResize.cjs");
|
|
31
|
+
const useAutocomplete = require("./hooks/useAutocomplete.cjs");
|
|
23
32
|
const MCPActionContext = require("./context/MCPActionContext.cjs");
|
|
33
|
+
const AutocompleteContext = require("./context/AutocompleteContext.cjs");
|
|
34
|
+
const groq = require("./plugins/groq.cjs");
|
|
35
|
+
const supabase = require("./plugins/supabase.cjs");
|
|
36
|
+
const rest = require("./plugins/rest.cjs");
|
|
24
37
|
const validation = require("./services/validation.cjs");
|
|
25
38
|
const componentRegistry = require("./services/component-registry.cjs");
|
|
26
39
|
exports.UIResourceRenderer = UIResourceRenderer.UIResourceRenderer;
|
|
27
40
|
exports.StreamingUIRenderer = StreamingUIRenderer.StreamingUIRenderer;
|
|
28
41
|
exports.GenerativeUIErrorBoundary = GenerativeUIErrorBoundary.GenerativeUIErrorBoundary;
|
|
42
|
+
exports.DraggableGridItem = DraggableGridItem.DraggableGridItem;
|
|
43
|
+
exports.ResizeHandle = ResizeHandle.ResizeHandle;
|
|
44
|
+
exports.EditableUIResourceRenderer = EditableUIResourceRenderer.EditableUIResourceRenderer;
|
|
45
|
+
exports.GhostText = GhostText.GhostText;
|
|
46
|
+
exports.GhostTextInput = GhostText.GhostTextInput;
|
|
47
|
+
exports.AutocompleteDropdown = AutocompleteDropdown.AutocompleteDropdown;
|
|
48
|
+
exports.AutocompleteFormField = AutocompleteFormField.AutocompleteFormField;
|
|
29
49
|
exports.useStreamingUI = useStreamingUI.useStreamingUI;
|
|
30
50
|
exports.useAction = useAction.useAction;
|
|
31
51
|
exports.useToolAction = useAction.useToolAction;
|
|
@@ -34,10 +54,19 @@ exports.useConditionalField = useConditionalField.useConditionalField;
|
|
|
34
54
|
exports.useConfirmModal = useModal.useConfirmModal;
|
|
35
55
|
exports.useModal = useModal.useModal;
|
|
36
56
|
exports.useFormPersistence = useFormPersistence.useFormPersistence;
|
|
57
|
+
exports.useDragDrop = useDragDrop.useDragDrop;
|
|
58
|
+
exports.useResize = useResize.useResize;
|
|
59
|
+
exports.useAutocomplete = useAutocomplete.useAutocomplete;
|
|
37
60
|
exports.MCPActionContext = MCPActionContext.MCPActionContext;
|
|
38
61
|
exports.MCPActionProvider = MCPActionContext.MCPActionProvider;
|
|
39
62
|
exports.useMCPAction = MCPActionContext.useMCPAction;
|
|
40
63
|
exports.useMCPActionSafe = MCPActionContext.useMCPActionSafe;
|
|
64
|
+
exports.AutocompleteProvider = AutocompleteContext.AutocompleteProvider;
|
|
65
|
+
exports.useAutocompleteContext = AutocompleteContext.useAutocompleteContext;
|
|
66
|
+
exports.useAutocompleteContextSafe = AutocompleteContext.useAutocompleteContextSafe;
|
|
67
|
+
exports.createGroqPlugin = groq.createGroqPlugin;
|
|
68
|
+
exports.createSupabasePlugin = supabase.createSupabasePlugin;
|
|
69
|
+
exports.createRestPlugin = rest.createRestPlugin;
|
|
41
70
|
exports.DEFAULT_IFRAME_DOMAINS = validation.DEFAULT_IFRAME_DOMAINS;
|
|
42
71
|
exports.DEFAULT_RESOURCE_LIMITS = validation.DEFAULT_RESOURCE_LIMITS;
|
|
43
72
|
exports.validateComponent = validation.validateComponent;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.cts
CHANGED
|
@@ -28,11 +28,26 @@
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
export { UIResourceRenderer, StreamingUIRenderer, GenerativeUIErrorBoundary } from './components';
|
|
31
|
+
export { DraggableGridItem } from './components/DraggableGridItem';
|
|
32
|
+
export { ResizeHandle } from './components/ResizeHandle';
|
|
33
|
+
export { EditableUIResourceRenderer } from './components/EditableUIResourceRenderer';
|
|
34
|
+
export { GhostText, GhostTextInput } from './components/GhostText';
|
|
35
|
+
export { AutocompleteDropdown } from './components/AutocompleteDropdown';
|
|
36
|
+
export { AutocompleteFormField } from './components/AutocompleteFormField';
|
|
31
37
|
export type { UIResourceRendererProps, StreamingUIRendererProps, GenerativeUIErrorBoundaryProps, } from './components';
|
|
32
|
-
export {
|
|
33
|
-
export type {
|
|
38
|
+
export type { DraggableGridItemProps } from './components/DraggableGridItem';
|
|
39
|
+
export type { ResizeHandleProps as ResizeHandleComponentProps } from './components/ResizeHandle';
|
|
40
|
+
export type { EditableUIResourceRendererProps } from './components/EditableUIResourceRenderer';
|
|
41
|
+
export type { GhostTextProps, GhostTextInputProps } from './components/GhostText';
|
|
42
|
+
export type { AutocompleteDropdownProps } from './components/AutocompleteDropdown';
|
|
43
|
+
export type { AutocompleteFormFieldProps, AutocompleteFormFieldParams } from './components/AutocompleteFormField';
|
|
44
|
+
export { useStreamingUI, useAction, useToolAction, useConditionalField, evaluateCondition, useModal, useConfirmModal, useFormPersistence, useDragDrop, useResize, useAutocomplete, } from './hooks';
|
|
45
|
+
export type { UseStreamingUIOptions, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, UseActionReturn, UseActionOptions, UseToolActionReturn, UseConditionalFieldOptions, UseModalReturn, UseConfirmModalReturn, UseFormPersistenceOptions, UseFormPersistenceReturn, UseDragDropOptions, UseDragDropReturn, DragProps, UseResizeOptions, UseResizeReturn, ResizeEdge, UseAutocompleteOptions, UseAutocompleteReturn, } from './hooks';
|
|
34
46
|
export { MCPActionProvider, MCPActionContext, useMCPAction, useMCPActionSafe } from './context';
|
|
47
|
+
export { AutocompleteProvider, useAutocompleteContext, useAutocompleteContextSafe, } from './context/AutocompleteContext';
|
|
35
48
|
export type { MCPActionContextValue, MCPActionProviderProps, ActionRequest, ActionResult, } from './context';
|
|
36
|
-
export type {
|
|
49
|
+
export type { AutocompleteContextValue, AutocompleteProviderProps, } from './context/AutocompleteContext';
|
|
50
|
+
export { createGroqPlugin, createSupabasePlugin, createRestPlugin, } from './plugins';
|
|
51
|
+
export type { UIComponent, UILayout, GridPosition, ComponentType, RendererError, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ActionComponentParams, GridComponentParams, FormFieldOption, FormFieldType, FormFieldParams, FormComponentParams, ShowWhenOperator, ShowWhenCondition, ActionRequestBase, ActionResultBase, ActionLifecycleCallbacks, ModalSize, ModalComponentParams, ActionGroupLayout, ActionGroupGap, ActionGroupParams, GalleryImage, ImageGalleryParams, VideoComponentParams, CodeComponentParams, MapMarker, MapComponentParams, IframePolicy, ValidationOptions, ResizeConstraints, DragDropConfig, DragEventData, DraggableGridItemProps as DraggableGridItemPropsType, AutocompleteResultType, AutocompleteOption, AutocompleteResult, AutocompleteContext, AutocompletePlugin, GroqPluginConfig, SupabasePluginConfig, DuckDBPluginConfig, RestPluginConfig, FieldAutocompleteConfig, AutocompleteProviderConfig, } from './types';
|
|
37
52
|
export { validateComponent, validateLayout, validateIframeDomain, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, ComponentRegistry, } from './services';
|
|
38
53
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -28,11 +28,26 @@
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
export { UIResourceRenderer, StreamingUIRenderer, GenerativeUIErrorBoundary } from './components';
|
|
31
|
+
export { DraggableGridItem } from './components/DraggableGridItem';
|
|
32
|
+
export { ResizeHandle } from './components/ResizeHandle';
|
|
33
|
+
export { EditableUIResourceRenderer } from './components/EditableUIResourceRenderer';
|
|
34
|
+
export { GhostText, GhostTextInput } from './components/GhostText';
|
|
35
|
+
export { AutocompleteDropdown } from './components/AutocompleteDropdown';
|
|
36
|
+
export { AutocompleteFormField } from './components/AutocompleteFormField';
|
|
31
37
|
export type { UIResourceRendererProps, StreamingUIRendererProps, GenerativeUIErrorBoundaryProps, } from './components';
|
|
32
|
-
export {
|
|
33
|
-
export type {
|
|
38
|
+
export type { DraggableGridItemProps } from './components/DraggableGridItem';
|
|
39
|
+
export type { ResizeHandleProps as ResizeHandleComponentProps } from './components/ResizeHandle';
|
|
40
|
+
export type { EditableUIResourceRendererProps } from './components/EditableUIResourceRenderer';
|
|
41
|
+
export type { GhostTextProps, GhostTextInputProps } from './components/GhostText';
|
|
42
|
+
export type { AutocompleteDropdownProps } from './components/AutocompleteDropdown';
|
|
43
|
+
export type { AutocompleteFormFieldProps, AutocompleteFormFieldParams } from './components/AutocompleteFormField';
|
|
44
|
+
export { useStreamingUI, useAction, useToolAction, useConditionalField, evaluateCondition, useModal, useConfirmModal, useFormPersistence, useDragDrop, useResize, useAutocomplete, } from './hooks';
|
|
45
|
+
export type { UseStreamingUIOptions, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, UseActionReturn, UseActionOptions, UseToolActionReturn, UseConditionalFieldOptions, UseModalReturn, UseConfirmModalReturn, UseFormPersistenceOptions, UseFormPersistenceReturn, UseDragDropOptions, UseDragDropReturn, DragProps, UseResizeOptions, UseResizeReturn, ResizeEdge, UseAutocompleteOptions, UseAutocompleteReturn, } from './hooks';
|
|
34
46
|
export { MCPActionProvider, MCPActionContext, useMCPAction, useMCPActionSafe } from './context';
|
|
47
|
+
export { AutocompleteProvider, useAutocompleteContext, useAutocompleteContextSafe, } from './context/AutocompleteContext';
|
|
35
48
|
export type { MCPActionContextValue, MCPActionProviderProps, ActionRequest, ActionResult, } from './context';
|
|
36
|
-
export type {
|
|
49
|
+
export type { AutocompleteContextValue, AutocompleteProviderProps, } from './context/AutocompleteContext';
|
|
50
|
+
export { createGroqPlugin, createSupabasePlugin, createRestPlugin, } from './plugins';
|
|
51
|
+
export type { UIComponent, UILayout, GridPosition, ComponentType, RendererError, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ActionComponentParams, GridComponentParams, FormFieldOption, FormFieldType, FormFieldParams, FormComponentParams, ShowWhenOperator, ShowWhenCondition, ActionRequestBase, ActionResultBase, ActionLifecycleCallbacks, ModalSize, ModalComponentParams, ActionGroupLayout, ActionGroupGap, ActionGroupParams, GalleryImage, ImageGalleryParams, VideoComponentParams, CodeComponentParams, MapMarker, MapComponentParams, IframePolicy, ValidationOptions, ResizeConstraints, DragDropConfig, DragEventData, DraggableGridItemProps as DraggableGridItemPropsType, AutocompleteResultType, AutocompleteOption, AutocompleteResult, AutocompleteContext, AutocompletePlugin, GroqPluginConfig, SupabasePluginConfig, DuckDBPluginConfig, RestPluginConfig, FieldAutocompleteConfig, AutocompleteProviderConfig, } from './types';
|
|
37
52
|
export { validateComponent, validateLayout, validateIframeDomain, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, ComponentRegistry, } from './services';
|
|
38
53
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAGjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AAGpF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAE1E,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,cAAc,CAAA;AAErB,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAC5E,YAAY,EAAE,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAChG,YAAY,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAA;AAC9F,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjF,YAAY,EAAE,yBAAyB,EAAE,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jB,gBAAgB,EAChB,wBAAwB,EAExB,SAAS,EACT,oBAAoB,EAEpB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EAEjB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EAEpB,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAElB,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,sBAAsB,IAAI,0BAA0B,EAEpD,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -13,31 +13,60 @@ import "./components/ActionGroupRenderer.js";
|
|
|
13
13
|
import "./components/LightboxOverlay.js";
|
|
14
14
|
import "./components/ImageGalleryRenderer.js";
|
|
15
15
|
import "./components/CodeBlockRenderer.js";
|
|
16
|
+
import { DraggableGridItem } from "./components/DraggableGridItem.js";
|
|
17
|
+
import { ResizeHandle } from "./components/ResizeHandle.js";
|
|
18
|
+
import { EditableUIResourceRenderer } from "./components/EditableUIResourceRenderer.js";
|
|
19
|
+
import { GhostText, GhostTextInput } from "./components/GhostText.js";
|
|
20
|
+
import { AutocompleteDropdown } from "./components/AutocompleteDropdown.js";
|
|
21
|
+
import { AutocompleteFormField } from "./components/AutocompleteFormField.js";
|
|
16
22
|
import { useStreamingUI } from "./hooks/useStreamingUI.js";
|
|
17
23
|
import { useAction, useToolAction } from "./hooks/useAction.js";
|
|
18
24
|
import { evaluateCondition, useConditionalField } from "./hooks/useConditionalField.js";
|
|
19
25
|
import { useConfirmModal, useModal } from "./hooks/useModal.js";
|
|
20
26
|
import { useFormPersistence } from "./hooks/useFormPersistence.js";
|
|
27
|
+
import { useDragDrop } from "./hooks/useDragDrop.js";
|
|
28
|
+
import { useResize } from "./hooks/useResize.js";
|
|
29
|
+
import { useAutocomplete } from "./hooks/useAutocomplete.js";
|
|
21
30
|
import { MCPActionContext, MCPActionProvider, useMCPAction, useMCPActionSafe } from "./context/MCPActionContext.js";
|
|
31
|
+
import { AutocompleteProvider, useAutocompleteContext, useAutocompleteContextSafe } from "./context/AutocompleteContext.js";
|
|
32
|
+
import { createGroqPlugin } from "./plugins/groq.js";
|
|
33
|
+
import { createSupabasePlugin } from "./plugins/supabase.js";
|
|
34
|
+
import { createRestPlugin } from "./plugins/rest.js";
|
|
22
35
|
import { DEFAULT_IFRAME_DOMAINS, DEFAULT_RESOURCE_LIMITS, validateComponent, validateIframeDomain, validateLayout } from "./services/validation.js";
|
|
23
36
|
import { ComponentRegistry } from "./services/component-registry.js";
|
|
24
37
|
export {
|
|
38
|
+
AutocompleteDropdown,
|
|
39
|
+
AutocompleteFormField,
|
|
40
|
+
AutocompleteProvider,
|
|
25
41
|
ComponentRegistry,
|
|
26
42
|
DEFAULT_IFRAME_DOMAINS,
|
|
27
43
|
DEFAULT_RESOURCE_LIMITS,
|
|
44
|
+
DraggableGridItem,
|
|
45
|
+
EditableUIResourceRenderer,
|
|
28
46
|
GenerativeUIErrorBoundary,
|
|
47
|
+
GhostText,
|
|
48
|
+
GhostTextInput,
|
|
29
49
|
MCPActionContext,
|
|
30
50
|
MCPActionProvider,
|
|
51
|
+
ResizeHandle,
|
|
31
52
|
StreamingUIRenderer,
|
|
32
53
|
UIResourceRenderer,
|
|
54
|
+
createGroqPlugin,
|
|
55
|
+
createRestPlugin,
|
|
56
|
+
createSupabasePlugin,
|
|
33
57
|
evaluateCondition,
|
|
34
58
|
useAction,
|
|
59
|
+
useAutocomplete,
|
|
60
|
+
useAutocompleteContext,
|
|
61
|
+
useAutocompleteContextSafe,
|
|
35
62
|
useConditionalField,
|
|
36
63
|
useConfirmModal,
|
|
64
|
+
useDragDrop,
|
|
37
65
|
useFormPersistence,
|
|
38
66
|
useMCPAction,
|
|
39
67
|
useMCPActionSafe,
|
|
40
68
|
useModal,
|
|
69
|
+
useResize,
|
|
41
70
|
useStreamingUI,
|
|
42
71
|
useToolAction,
|
|
43
72
|
validateComponent,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|