@seed-ship/mcp-ui-solid 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +50 -1
  2. package/dist/components/AutocompleteDropdown.cjs +201 -0
  3. package/dist/components/AutocompleteDropdown.cjs.map +1 -0
  4. package/dist/components/AutocompleteDropdown.d.ts +71 -0
  5. package/dist/components/AutocompleteDropdown.d.ts.map +1 -0
  6. package/dist/components/AutocompleteDropdown.js +201 -0
  7. package/dist/components/AutocompleteDropdown.js.map +1 -0
  8. package/dist/components/AutocompleteFormField.cjs +289 -0
  9. package/dist/components/AutocompleteFormField.cjs.map +1 -0
  10. package/dist/components/AutocompleteFormField.d.ts +52 -0
  11. package/dist/components/AutocompleteFormField.d.ts.map +1 -0
  12. package/dist/components/AutocompleteFormField.js +289 -0
  13. package/dist/components/AutocompleteFormField.js.map +1 -0
  14. package/dist/components/DraggableGridItem.cjs +133 -0
  15. package/dist/components/DraggableGridItem.cjs.map +1 -0
  16. package/dist/components/DraggableGridItem.d.ts +95 -0
  17. package/dist/components/DraggableGridItem.d.ts.map +1 -0
  18. package/dist/components/DraggableGridItem.js +133 -0
  19. package/dist/components/DraggableGridItem.js.map +1 -0
  20. package/dist/components/EditableUIResourceRenderer.cjs +203 -0
  21. package/dist/components/EditableUIResourceRenderer.cjs.map +1 -0
  22. package/dist/components/EditableUIResourceRenderer.d.ts +43 -0
  23. package/dist/components/EditableUIResourceRenderer.d.ts.map +1 -0
  24. package/dist/components/EditableUIResourceRenderer.js +203 -0
  25. package/dist/components/EditableUIResourceRenderer.js.map +1 -0
  26. package/dist/components/GhostText.cjs +105 -0
  27. package/dist/components/GhostText.cjs.map +1 -0
  28. package/dist/components/GhostText.d.ts +113 -0
  29. package/dist/components/GhostText.d.ts.map +1 -0
  30. package/dist/components/GhostText.js +105 -0
  31. package/dist/components/GhostText.js.map +1 -0
  32. package/dist/components/ResizeHandle.cjs +173 -0
  33. package/dist/components/ResizeHandle.cjs.map +1 -0
  34. package/dist/components/ResizeHandle.d.ts +50 -0
  35. package/dist/components/ResizeHandle.d.ts.map +1 -0
  36. package/dist/components/ResizeHandle.js +173 -0
  37. package/dist/components/ResizeHandle.js.map +1 -0
  38. package/dist/context/AutocompleteContext.cjs +158 -0
  39. package/dist/context/AutocompleteContext.cjs.map +1 -0
  40. package/dist/context/AutocompleteContext.d.ts +77 -0
  41. package/dist/context/AutocompleteContext.d.ts.map +1 -0
  42. package/dist/context/AutocompleteContext.js +158 -0
  43. package/dist/context/AutocompleteContext.js.map +1 -0
  44. package/dist/hooks/index.d.ts +6 -0
  45. package/dist/hooks/index.d.ts.map +1 -1
  46. package/dist/hooks/useAutocomplete.cjs +234 -0
  47. package/dist/hooks/useAutocomplete.cjs.map +1 -0
  48. package/dist/hooks/useAutocomplete.d.ts +119 -0
  49. package/dist/hooks/useAutocomplete.d.ts.map +1 -0
  50. package/dist/hooks/useAutocomplete.js +234 -0
  51. package/dist/hooks/useAutocomplete.js.map +1 -0
  52. package/dist/hooks/useDragDrop.cjs +170 -0
  53. package/dist/hooks/useDragDrop.cjs.map +1 -0
  54. package/dist/hooks/useDragDrop.d.ts +100 -0
  55. package/dist/hooks/useDragDrop.d.ts.map +1 -0
  56. package/dist/hooks/useDragDrop.js +170 -0
  57. package/dist/hooks/useDragDrop.js.map +1 -0
  58. package/dist/hooks/useResize.cjs +209 -0
  59. package/dist/hooks/useResize.cjs.map +1 -0
  60. package/dist/hooks/useResize.d.ts +87 -0
  61. package/dist/hooks/useResize.d.ts.map +1 -0
  62. package/dist/hooks/useResize.js +209 -0
  63. package/dist/hooks/useResize.js.map +1 -0
  64. package/dist/hooks.cjs +6 -0
  65. package/dist/hooks.cjs.map +1 -1
  66. package/dist/hooks.d.cts +6 -0
  67. package/dist/hooks.d.ts +6 -0
  68. package/dist/hooks.js +6 -0
  69. package/dist/hooks.js.map +1 -1
  70. package/dist/index.cjs +29 -0
  71. package/dist/index.cjs.map +1 -1
  72. package/dist/index.d.cts +18 -3
  73. package/dist/index.d.ts +18 -3
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +29 -0
  76. package/dist/index.js.map +1 -1
  77. package/dist/plugins/duckdb.cjs +192 -0
  78. package/dist/plugins/duckdb.cjs.map +1 -0
  79. package/dist/plugins/duckdb.d.ts +20 -0
  80. package/dist/plugins/duckdb.d.ts.map +1 -0
  81. package/dist/plugins/duckdb.js +170 -0
  82. package/dist/plugins/duckdb.js.map +1 -0
  83. package/dist/plugins/groq.cjs +97 -0
  84. package/dist/plugins/groq.cjs.map +1 -0
  85. package/dist/plugins/groq.d.ts +13 -0
  86. package/dist/plugins/groq.d.ts.map +1 -0
  87. package/dist/plugins/groq.js +97 -0
  88. package/dist/plugins/groq.js.map +1 -0
  89. package/dist/plugins/index.d.ts +10 -0
  90. package/dist/plugins/index.d.ts.map +1 -0
  91. package/dist/plugins/rest.cjs +92 -0
  92. package/dist/plugins/rest.cjs.map +1 -0
  93. package/dist/plugins/rest.d.ts +13 -0
  94. package/dist/plugins/rest.d.ts.map +1 -0
  95. package/dist/plugins/rest.js +92 -0
  96. package/dist/plugins/rest.js.map +1 -0
  97. package/dist/plugins/supabase.cjs +79 -0
  98. package/dist/plugins/supabase.cjs.map +1 -0
  99. package/dist/plugins/supabase.d.ts +13 -0
  100. package/dist/plugins/supabase.d.ts.map +1 -0
  101. package/dist/plugins/supabase.js +79 -0
  102. package/dist/plugins/supabase.js.map +1 -0
  103. package/dist/services/validation.cjs +40 -1
  104. package/dist/services/validation.cjs.map +1 -1
  105. package/dist/services/validation.d.ts.map +1 -1
  106. package/dist/services/validation.js +40 -1
  107. package/dist/services/validation.js.map +1 -1
  108. package/dist/types/index.d.ts +430 -0
  109. package/dist/types/index.d.ts.map +1 -1
  110. package/dist/types.d.cts +430 -0
  111. package/dist/types.d.ts +430 -0
  112. package/package.json +16 -1
  113. package/src/components/AutocompleteDropdown.tsx +329 -0
  114. package/src/components/AutocompleteFormField.tsx +288 -0
  115. package/src/components/DraggableGridItem.tsx +274 -0
  116. package/src/components/EditableUIResourceRenderer.tsx +273 -0
  117. package/src/components/GhostText.tsx +262 -0
  118. package/src/components/ResizeHandle.tsx +262 -0
  119. package/src/context/AutocompleteContext.tsx +317 -0
  120. package/src/hooks/index.ts +23 -0
  121. package/src/hooks/useAutocomplete.test.ts +334 -0
  122. package/src/hooks/useAutocomplete.ts +466 -0
  123. package/src/hooks/useDragDrop.test.ts +355 -0
  124. package/src/hooks/useDragDrop.ts +379 -0
  125. package/src/hooks/useResize.test.ts +313 -0
  126. package/src/hooks/useResize.ts +372 -0
  127. package/src/index.ts +71 -0
  128. package/src/plugins/duckdb.ts +269 -0
  129. package/src/plugins/groq.ts +137 -0
  130. package/src/plugins/index.ts +14 -0
  131. package/src/plugins/rest.ts +147 -0
  132. package/src/plugins/supabase.ts +120 -0
  133. package/src/services/validation.ts +46 -0
  134. package/src/styles/autocomplete.css +356 -0
  135. package/src/styles/drag-drop.css +297 -0
  136. package/src/styles/index.css +7 -0
  137. package/src/types/index.ts +529 -0
  138. package/src/vite-env.d.ts +18 -0
  139. package/tsconfig.tsbuildinfo +1 -1
  140. package/vite.config.ts +2 -0
@@ -0,0 +1,133 @@
1
+ import { getNextElement, template, getNextMarker, spread, mergeProps as mergeProps$1, insert, createComponent, memo, runHydrationEvents } from "solid-js/web";
2
+ import { mergeProps, createMemo, Show } from "solid-js";
3
+ import { ResizeHandle } from "./ResizeHandle.js";
4
+ var _tmpl$ = /* @__PURE__ */ template(`<div class=mcp-drag-handle style="position:absolute;top:4px;left:50%;transform:translateX(-50%);width:40px;height:4px;background-color:rgba(0, 0, 0, 0.2);border-radius:2px;cursor:grab;opacity:0;transition:opacity 150ms ease;z-index:5">`), _tmpl$2 = /* @__PURE__ */ template(`<div class=mcp-drop-indicator style=position:absolute;top:-2px;left:0;right:0;height:4px;background-color:#3b82f6;border-radius:2px;z-index:20>`), _tmpl$3 = /* @__PURE__ */ template(`<div><!$><!/><!$><!/><!$><!/><div class=mcp-grid-item-content style=position:relative;z-index:1>`);
5
+ function getGridStyle(position) {
6
+ return {
7
+ "grid-column": `${position.colStart} / span ${position.colSpan}`,
8
+ "grid-row": position.rowStart ? `${position.rowStart} / span ${position.rowSpan || 1}` : void 0
9
+ };
10
+ }
11
+ const DraggableGridItem = (props) => {
12
+ const merged = mergeProps({
13
+ draggable: false,
14
+ resizable: false,
15
+ isDragging: false,
16
+ isDropTarget: false,
17
+ isResizing: false,
18
+ showGridOverlay: false
19
+ }, props);
20
+ const effectivePosition = createMemo(() => merged.previewPosition || props.position);
21
+ const gridStyle = createMemo(() => getGridStyle(effectivePosition()));
22
+ const combinedStyle = createMemo(() => {
23
+ const base = {
24
+ ...gridStyle(),
25
+ position: "relative",
26
+ transition: merged.isResizing ? "none" : "all 200ms ease-out"
27
+ };
28
+ if (merged.isDragging) {
29
+ base.opacity = "0.5";
30
+ base.transform = "scale(1.02)";
31
+ base["z-index"] = "100";
32
+ }
33
+ if (merged.isDropTarget && !merged.isDragging) {
34
+ base["box-shadow"] = "0 0 0 2px #3b82f6";
35
+ base["border-radius"] = "4px";
36
+ }
37
+ if (merged.isResizing) {
38
+ base["z-index"] = "100";
39
+ }
40
+ if (props.style) {
41
+ Object.assign(base, props.style);
42
+ }
43
+ return base;
44
+ });
45
+ const classNames = createMemo(() => {
46
+ const classes = ["mcp-draggable-grid-item"];
47
+ if (merged.draggable) classes.push("mcp-draggable");
48
+ if (merged.resizable) classes.push("mcp-resizable");
49
+ if (merged.isDragging) classes.push("mcp-dragging");
50
+ if (merged.isDropTarget) classes.push("mcp-drop-target");
51
+ if (merged.isResizing) classes.push("mcp-resizing");
52
+ if (props.class) classes.push(props.class);
53
+ return classes.join(" ");
54
+ });
55
+ const handleResizeStart = (edge) => {
56
+ var _a;
57
+ (_a = props.onResizeStart) == null ? void 0 : _a.call(props, edge);
58
+ };
59
+ return (() => {
60
+ var _el$ = getNextElement(_tmpl$3), _el$5 = _el$.firstChild, [_el$6, _co$] = getNextMarker(_el$5.nextSibling), _el$7 = _el$6.nextSibling, [_el$8, _co$2] = getNextMarker(_el$7.nextSibling), _el$9 = _el$8.nextSibling, [_el$0, _co$3] = getNextMarker(_el$9.nextSibling), _el$4 = _el$0.nextSibling;
61
+ spread(_el$, mergeProps$1({
62
+ get ["class"]() {
63
+ return classNames();
64
+ },
65
+ get style() {
66
+ return combinedStyle();
67
+ },
68
+ get ["data-component-id"]() {
69
+ return props.id;
70
+ }
71
+ }, () => merged.draggable && props.dragProps ? props.dragProps : {}), false, true);
72
+ insert(_el$, createComponent(Show, {
73
+ get when() {
74
+ return memo(() => !!merged.draggable)() && !merged.isResizing;
75
+ },
76
+ get children() {
77
+ return getNextElement(_tmpl$);
78
+ }
79
+ }), _el$6, _co$);
80
+ insert(_el$, createComponent(Show, {
81
+ get when() {
82
+ return memo(() => !!merged.resizable)() && !merged.isDragging;
83
+ },
84
+ get children() {
85
+ return [createComponent(ResizeHandle, {
86
+ edge: "left",
87
+ onResizeStart: handleResizeStart,
88
+ get disabled() {
89
+ var _a;
90
+ return (_a = merged.constraints) == null ? void 0 : _a.lockHorizontal;
91
+ }
92
+ }), createComponent(ResizeHandle, {
93
+ edge: "right",
94
+ onResizeStart: handleResizeStart,
95
+ get disabled() {
96
+ var _a;
97
+ return (_a = merged.constraints) == null ? void 0 : _a.lockHorizontal;
98
+ }
99
+ }), createComponent(ResizeHandle, {
100
+ edge: "top",
101
+ onResizeStart: handleResizeStart,
102
+ get disabled() {
103
+ var _a;
104
+ return (_a = merged.constraints) == null ? void 0 : _a.lockVertical;
105
+ }
106
+ }), createComponent(ResizeHandle, {
107
+ edge: "bottom",
108
+ onResizeStart: handleResizeStart,
109
+ get disabled() {
110
+ var _a;
111
+ return (_a = merged.constraints) == null ? void 0 : _a.lockVertical;
112
+ }
113
+ })];
114
+ }
115
+ }), _el$8, _co$2);
116
+ insert(_el$, createComponent(Show, {
117
+ get when() {
118
+ return memo(() => !!merged.isDropTarget)() && !merged.isDragging;
119
+ },
120
+ get children() {
121
+ return getNextElement(_tmpl$2);
122
+ }
123
+ }), _el$0, _co$3);
124
+ insert(_el$4, () => props.children);
125
+ runHydrationEvents();
126
+ return _el$;
127
+ })();
128
+ };
129
+ export {
130
+ DraggableGridItem,
131
+ DraggableGridItem as default
132
+ };
133
+ //# sourceMappingURL=DraggableGridItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DraggableGridItem.js","sources":["../../src/components/DraggableGridItem.tsx"],"sourcesContent":["/**\n * DraggableGridItem Component\n * Wrapper for grid items that enables drag-and-drop reordering and resizing\n *\n * Sprint Drag-Drop Feature\n */\n\nimport { Component, JSX, Show, createMemo, mergeProps } from 'solid-js'\nimport type { GridPosition, ResizeConstraints } from '../types'\nimport { ResizeHandle } from './ResizeHandle'\n\n/**\n * Props for DraggableGridItem\n */\nexport interface DraggableGridItemProps {\n /**\n * Component ID\n */\n id: string\n\n /**\n * Grid position\n */\n position: GridPosition\n\n /**\n * Whether dragging is enabled\n */\n draggable?: boolean\n\n /**\n * Whether resizing is enabled\n */\n resizable?: boolean\n\n /**\n * Resize constraints\n */\n constraints?: ResizeConstraints\n\n /**\n * Whether this item is currently being dragged\n */\n isDragging?: boolean\n\n /**\n * Whether this item is a drop target\n */\n isDropTarget?: boolean\n\n /**\n * Preview position during resize\n */\n previewPosition?: GridPosition | null\n\n /**\n * Drag props from useDragDrop\n */\n dragProps?: {\n draggable: boolean\n onDragStart: (e: DragEvent) => void\n onDragOver: (e: DragEvent) => void\n onDragEnter: (e: DragEvent) => void\n onDragLeave: (e: DragEvent) => void\n onDrop: (e: DragEvent) => void\n onDragEnd: (e: DragEvent) => void\n }\n\n /**\n * Callback when resize starts\n */\n onResizeStart?: (edge: 'left' | 'right' | 'top' | 'bottom') => void\n\n /**\n * Callback for resize preview\n */\n onResizePreview?: (position: GridPosition) => void\n\n /**\n * Callback when resize completes\n */\n onResize?: (position: GridPosition) => void\n\n /**\n * Whether resize is in progress\n */\n isResizing?: boolean\n\n /**\n * Show grid overlay during drag/resize\n */\n showGridOverlay?: boolean\n\n /**\n * Custom CSS class\n */\n class?: string\n\n /**\n * Custom styles\n */\n style?: JSX.CSSProperties\n\n /**\n * Children to render\n */\n children?: JSX.Element\n}\n\n/**\n * Generate CSS Grid style string from position\n */\nfunction getGridStyle(position: GridPosition): JSX.CSSProperties {\n return {\n 'grid-column': `${position.colStart} / span ${position.colSpan}`,\n 'grid-row': position.rowStart\n ? `${position.rowStart} / span ${position.rowSpan || 1}`\n : undefined\n }\n}\n\n/**\n * DraggableGridItem Component\n */\nexport const DraggableGridItem: Component<DraggableGridItemProps> = (props) => {\n const merged = mergeProps(\n {\n draggable: false,\n resizable: false,\n isDragging: false,\n isDropTarget: false,\n isResizing: false,\n showGridOverlay: false\n },\n props\n )\n\n // Use preview position during resize if available\n const effectivePosition = createMemo(() =>\n merged.previewPosition || props.position\n )\n\n // Compute grid style\n const gridStyle = createMemo(() => getGridStyle(effectivePosition()))\n\n // Compute combined style\n const combinedStyle = createMemo((): JSX.CSSProperties => {\n const base: JSX.CSSProperties = {\n ...gridStyle(),\n position: 'relative',\n transition: merged.isResizing ? 'none' : 'all 200ms ease-out'\n }\n\n // Add drag/drop visual feedback\n if (merged.isDragging) {\n base.opacity = '0.5'\n base.transform = 'scale(1.02)'\n base['z-index'] = '100'\n }\n\n if (merged.isDropTarget && !merged.isDragging) {\n base['box-shadow'] = '0 0 0 2px #3b82f6'\n base['border-radius'] = '4px'\n }\n\n if (merged.isResizing) {\n base['z-index'] = '100'\n }\n\n // Merge with custom styles\n if (props.style) {\n Object.assign(base, props.style)\n }\n\n return base\n })\n\n // Build class names\n const classNames = createMemo(() => {\n const classes = ['mcp-draggable-grid-item']\n\n if (merged.draggable) classes.push('mcp-draggable')\n if (merged.resizable) classes.push('mcp-resizable')\n if (merged.isDragging) classes.push('mcp-dragging')\n if (merged.isDropTarget) classes.push('mcp-drop-target')\n if (merged.isResizing) classes.push('mcp-resizing')\n if (props.class) classes.push(props.class)\n\n return classes.join(' ')\n })\n\n // Handle resize start\n const handleResizeStart = (edge: 'left' | 'right' | 'top' | 'bottom') => {\n props.onResizeStart?.(edge)\n }\n\n return (\n <div\n class={classNames()}\n style={combinedStyle()}\n data-component-id={props.id}\n {...(merged.draggable && props.dragProps ? props.dragProps : {})}\n >\n {/* Drag handle indicator */}\n <Show when={merged.draggable && !merged.isResizing}>\n <div\n class=\"mcp-drag-handle\"\n style={{\n position: 'absolute',\n top: '4px',\n left: '50%',\n transform: 'translateX(-50%)',\n width: '40px',\n height: '4px',\n 'background-color': 'rgba(0, 0, 0, 0.2)',\n 'border-radius': '2px',\n cursor: 'grab',\n opacity: '0',\n transition: 'opacity 150ms ease',\n 'z-index': '5'\n }}\n />\n </Show>\n\n {/* Resize handles */}\n <Show when={merged.resizable && !merged.isDragging}>\n <ResizeHandle\n edge=\"left\"\n onResizeStart={handleResizeStart}\n disabled={merged.constraints?.lockHorizontal}\n />\n <ResizeHandle\n edge=\"right\"\n onResizeStart={handleResizeStart}\n disabled={merged.constraints?.lockHorizontal}\n />\n <ResizeHandle\n edge=\"top\"\n onResizeStart={handleResizeStart}\n disabled={merged.constraints?.lockVertical}\n />\n <ResizeHandle\n edge=\"bottom\"\n onResizeStart={handleResizeStart}\n disabled={merged.constraints?.lockVertical}\n />\n </Show>\n\n {/* Drop indicator line */}\n <Show when={merged.isDropTarget && !merged.isDragging}>\n <div\n class=\"mcp-drop-indicator\"\n style={{\n position: 'absolute',\n top: '-2px',\n left: '0',\n right: '0',\n height: '4px',\n 'background-color': '#3b82f6',\n 'border-radius': '2px',\n 'z-index': '20'\n }}\n />\n </Show>\n\n {/* Content */}\n <div class=\"mcp-grid-item-content\" style={{ position: 'relative', 'z-index': '1' }}>\n {props.children}\n </div>\n </div>\n )\n}\n\nexport default DraggableGridItem\n"],"names":["getGridStyle","position","colStart","colSpan","rowStart","rowSpan","undefined","DraggableGridItem","props","merged","mergeProps","draggable","resizable","isDragging","isDropTarget","isResizing","showGridOverlay","effectivePosition","createMemo","previewPosition","gridStyle","combinedStyle","base","transition","opacity","transform","style","Object","assign","classNames","classes","push","class","join","handleResizeStart","edge","onResizeStart","_el$","_$getNextElement","_tmpl$3","_el$5","firstChild","_el$6","_co$","_$getNextMarker","nextSibling","_el$7","_el$8","_co$2","_el$9","_el$0","_co$3","_el$4","_$spread","_$mergeProps","id","dragProps","_$insert","_$createComponent","Show","when","_$memo","children","_tmpl$","ResizeHandle","disabled","constraints","lockHorizontal","lockVertical","_tmpl$2","_$runHydrationEvents"],"mappings":";;;;AAgHA,SAASA,aAAaC,UAA2C;AAC/D,SAAO;AAAA,IACL,eAAe,GAAGA,SAASC,QAAQ,WAAWD,SAASE,OAAO;AAAA,IAC9D,YAAYF,SAASG,WACjB,GAAGH,SAASG,QAAQ,WAAWH,SAASI,WAAW,CAAC,KACpDC;AAAAA,EAAAA;AAER;AAKO,MAAMC,oBAAwDC,CAAAA,UAAU;AAC7E,QAAMC,SAASC,WACb;AAAA,IACEC,WAAW;AAAA,IACXC,WAAW;AAAA,IACXC,YAAY;AAAA,IACZC,cAAc;AAAA,IACdC,YAAY;AAAA,IACZC,iBAAiB;AAAA,EAAA,GAEnBR,KACF;AAGA,QAAMS,oBAAoBC,WAAW,MACnCT,OAAOU,mBAAmBX,MAAMP,QAClC;AAGA,QAAMmB,YAAYF,WAAW,MAAMlB,aAAaiB,kBAAAA,CAAmB,CAAC;AAGpE,QAAMI,gBAAgBH,WAAW,MAAyB;AACxD,UAAMI,OAA0B;AAAA,MAC9B,GAAGF,UAAAA;AAAAA,MACHnB,UAAU;AAAA,MACVsB,YAAYd,OAAOM,aAAa,SAAS;AAAA,IAAA;AAI3C,QAAIN,OAAOI,YAAY;AACrBS,WAAKE,UAAU;AACfF,WAAKG,YAAY;AACjBH,WAAK,SAAS,IAAI;AAAA,IACpB;AAEA,QAAIb,OAAOK,gBAAgB,CAACL,OAAOI,YAAY;AAC7CS,WAAK,YAAY,IAAI;A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AA,CAAA,GAAArB,OAAAC,KAAA;AAAAS,WAAApB,MAAAqB,gBAK7CC,MAAI;AAAA,MAAA,IAACC,OAAI;AAAA,eAAEC,aAAApD,OAAOK,YAAY,EAAA,KAAI,CAACL,OAAOI;AAAAA,MAAU;AAAA,MAAA,IAAAiD,WAAA;AAAA,eAAAxB,eAAA+B,OAAA;AAAA,MAAA;AAAA,IAAA,CAAA,GAAAnB,OAAAC,KAAA;AAAAM,WAAAL,OAAA,MAkBlD5C,MAAMsD,QAAQ;AAAAQ,uBAAAA;AAAA,WAAAjC;AAAAA,EAAA,GAAA;AAIvB;"}
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const web = require("solid-js/web");
4
+ const solidJs = require("solid-js");
5
+ const useDragDrop = require("../hooks/useDragDrop.cjs");
6
+ const useResize = require("../hooks/useResize.cjs");
7
+ const DraggableGridItem = require("./DraggableGridItem.cjs");
8
+ const UIResourceRenderer = require("./UIResourceRenderer.cjs");
9
+ var _tmpl$ = /* @__PURE__ */ web.template(`<div class=mcp-grid-overlay style=position:absolute;inset:0;display:grid;gap:1rem;padding:0;pointer-events:none;z-index:0>`), _tmpl$2 = /* @__PURE__ */ web.template(`<div class=mcp-grid-overlay-column style="background-color:rgba(59, 130, 246, 0.05);border:1px dashed rgba(59, 130, 246, 0.2);border-radius:4px">`), _tmpl$3 = /* @__PURE__ */ web.template(`<div><div class="grid relative"data-grid-container><!$><!/><!$><!/>`);
10
+ const GridOverlay = (props) => {
11
+ return web.createComponent(solidJs.Show, {
12
+ get when() {
13
+ return props.visible;
14
+ },
15
+ get children() {
16
+ var _el$ = web.getNextElement(_tmpl$);
17
+ web.insert(_el$, web.createComponent(solidJs.For, {
18
+ get each() {
19
+ return Array(props.columns).fill(0);
20
+ },
21
+ children: () => web.getNextElement(_tmpl$2)
22
+ }));
23
+ web.effect((_$p) => web.setStyleProperty(_el$, "grid-template-columns", `repeat(${props.columns}, 1fr)`));
24
+ return _el$;
25
+ }
26
+ });
27
+ };
28
+ const EditableUIResourceRenderer = (props) => {
29
+ var _a;
30
+ const [components, setComponents] = solidJs.createSignal(props.layout.components);
31
+ const [activeResizeId, setActiveResizeId] = solidJs.createSignal(null);
32
+ const [previewPositions, setPreviewPositions] = solidJs.createSignal(/* @__PURE__ */ new Map());
33
+ const [gridContainerRef, setGridContainerRef] = solidJs.createSignal(null);
34
+ solidJs.createEffect(solidJs.on(() => props.layout.components, (newComponents) => {
35
+ setComponents(newComponents);
36
+ }));
37
+ const dragDropConfig = solidJs.createMemo(() => {
38
+ var _a2, _b, _c, _d, _e, _f;
39
+ return {
40
+ enabled: ((_a2 = props.dragDrop) == null ? void 0 : _a2.enabled) ?? false,
41
+ reorder: ((_b = props.dragDrop) == null ? void 0 : _b.reorder) ?? true,
42
+ resize: ((_c = props.dragDrop) == null ? void 0 : _c.resize) ?? true,
43
+ constraints: ((_d = props.dragDrop) == null ? void 0 : _d.constraints) ?? {},
44
+ showGridLines: ((_e = props.dragDrop) == null ? void 0 : _e.showGridLines) ?? true,
45
+ animationDuration: ((_f = props.dragDrop) == null ? void 0 : _f.animationDuration) ?? 200
46
+ };
47
+ });
48
+ const handleReorder = (newComponents) => {
49
+ var _a2, _b, _c, _d, _e;
50
+ setComponents(newComponents);
51
+ const newLayout = {
52
+ ...props.layout,
53
+ components: newComponents
54
+ };
55
+ (_b = (_a2 = props.dragDrop) == null ? void 0 : _a2.onReorder) == null ? void 0 : _b.call(_a2, newComponents);
56
+ (_d = (_c = props.dragDrop) == null ? void 0 : _c.onChange) == null ? void 0 : _d.call(_c, newLayout);
57
+ (_e = props.onLayoutChange) == null ? void 0 : _e.call(props, newLayout);
58
+ };
59
+ const handleResize = (componentId, newPosition) => {
60
+ var _a2, _b, _c, _d, _e;
61
+ const updatedComponents = components().map((c) => c.id === componentId ? {
62
+ ...c,
63
+ position: newPosition
64
+ } : c);
65
+ setComponents(updatedComponents);
66
+ setActiveResizeId(null);
67
+ setPreviewPositions(/* @__PURE__ */ new Map());
68
+ const newLayout = {
69
+ ...props.layout,
70
+ components: updatedComponents
71
+ };
72
+ (_b = (_a2 = props.dragDrop) == null ? void 0 : _a2.onResize) == null ? void 0 : _b.call(_a2, componentId, newPosition);
73
+ (_d = (_c = props.dragDrop) == null ? void 0 : _c.onChange) == null ? void 0 : _d.call(_c, newLayout);
74
+ (_e = props.onLayoutChange) == null ? void 0 : _e.call(props, newLayout);
75
+ };
76
+ const handleResizePreview = (componentId, previewPosition) => {
77
+ setPreviewPositions((prev) => {
78
+ const next = new Map(prev);
79
+ next.set(componentId, previewPosition);
80
+ return next;
81
+ });
82
+ };
83
+ const dragDrop = useDragDrop.useDragDrop({
84
+ components,
85
+ onReorder: handleReorder,
86
+ enabled: dragDropConfig().enabled && dragDropConfig().reorder
87
+ });
88
+ const gridContainerStyle = solidJs.createMemo(() => ({
89
+ display: "grid",
90
+ "grid-template-columns": `repeat(${props.layout.grid.columns}, 1fr)`,
91
+ gap: props.layout.grid.gap,
92
+ position: "relative"
93
+ }));
94
+ const showOverlay = solidJs.createMemo(() => dragDropConfig().showGridLines && (dragDrop.isDragging() || activeResizeId() !== null));
95
+ const getEffectivePosition = (component) => {
96
+ const preview = previewPositions().get(component.id);
97
+ return preview || component.position;
98
+ };
99
+ if (!((_a = props.dragDrop) == null ? void 0 : _a.enabled)) {
100
+ return web.createComponent(UIResourceRenderer.UIResourceRenderer, {
101
+ get content() {
102
+ return props.layout;
103
+ },
104
+ get onError() {
105
+ return props.onError;
106
+ },
107
+ get ["class"]() {
108
+ return props.class;
109
+ }
110
+ });
111
+ }
112
+ return (() => {
113
+ var _el$3 = web.getNextElement(_tmpl$3), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, [_el$6, _co$] = web.getNextMarker(_el$5.nextSibling), _el$7 = _el$6.nextSibling, [_el$8, _co$2] = web.getNextMarker(_el$7.nextSibling);
114
+ web.use(setGridContainerRef, _el$4);
115
+ web.insert(_el$4, web.createComponent(GridOverlay, {
116
+ get columns() {
117
+ return props.layout.grid.columns;
118
+ },
119
+ get visible() {
120
+ return showOverlay();
121
+ }
122
+ }), _el$6, _co$);
123
+ web.insert(_el$4, web.createComponent(solidJs.For, {
124
+ get each() {
125
+ return components();
126
+ },
127
+ children: (component) => {
128
+ const resize = useResize.useResize({
129
+ componentId: component.id,
130
+ currentPosition: () => component.position,
131
+ onResize: (pos) => handleResize(component.id, pos),
132
+ onResizePreview: (pos) => handleResizePreview(component.id, pos),
133
+ constraints: dragDropConfig().constraints,
134
+ gridContainer: gridContainerRef,
135
+ gridColumns: props.layout.grid.columns,
136
+ enabled: dragDropConfig().enabled && dragDropConfig().resize
137
+ });
138
+ const effectivePosition = () => getEffectivePosition(component);
139
+ return web.createComponent(DraggableGridItem.DraggableGridItem, {
140
+ get id() {
141
+ return component.id;
142
+ },
143
+ get position() {
144
+ return effectivePosition();
145
+ },
146
+ get draggable() {
147
+ return web.memo(() => !!dragDropConfig().enabled)() && dragDropConfig().reorder;
148
+ },
149
+ get resizable() {
150
+ return web.memo(() => !!dragDropConfig().enabled)() && dragDropConfig().resize;
151
+ },
152
+ get constraints() {
153
+ return dragDropConfig().constraints;
154
+ },
155
+ get isDragging() {
156
+ return dragDrop.isComponentDragging(component.id);
157
+ },
158
+ get isDropTarget() {
159
+ return dragDrop.isDropTarget(component.id);
160
+ },
161
+ get isResizing() {
162
+ return activeResizeId() === component.id;
163
+ },
164
+ get previewPosition() {
165
+ return previewPositions().get(component.id) || null;
166
+ },
167
+ get dragProps() {
168
+ return dragDrop.getDragProps(component.id);
169
+ },
170
+ onResizeStart: (edge) => {
171
+ setActiveResizeId(component.id);
172
+ const syntheticEvent = new PointerEvent("pointerdown", {
173
+ clientX: 0,
174
+ clientY: 0
175
+ });
176
+ resize.handleResizeStart(syntheticEvent, edge);
177
+ },
178
+ get children() {
179
+ return web.createComponent(UIResourceRenderer.UIResourceRenderer, {
180
+ content: component,
181
+ get onError() {
182
+ return props.onError;
183
+ }
184
+ });
185
+ }
186
+ });
187
+ }
188
+ }), _el$8, _co$2);
189
+ web.effect((_p$) => {
190
+ var _v$ = `w-full editable-ui-renderer ${props.class || ""}`, _v$2 = gridContainerStyle();
191
+ _v$ !== _p$.e && web.className(_el$3, _p$.e = _v$);
192
+ _p$.t = web.style(_el$4, _v$2, _p$.t);
193
+ return _p$;
194
+ }, {
195
+ e: void 0,
196
+ t: void 0
197
+ });
198
+ return _el$3;
199
+ })();
200
+ };
201
+ exports.EditableUIResourceRenderer = EditableUIResourceRenderer;
202
+ exports.default = EditableUIResourceRenderer;
203
+ //# sourceMappingURL=EditableUIResourceRenderer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableUIResourceRenderer.cjs","sources":["../../src/components/EditableUIResourceRenderer.tsx"],"sourcesContent":["/**\n * EditableUIResourceRenderer Component\n * Extends UIResourceRenderer with drag-and-drop reordering and resizing capabilities\n *\n * Sprint Drag-Drop Feature\n */\n\nimport {\n Component,\n For,\n Show,\n createSignal,\n createMemo,\n createEffect,\n on,\n JSX\n} from 'solid-js'\nimport type {\n UIComponent,\n UILayout,\n RendererError,\n GridPosition,\n DragDropConfig\n} from '../types'\nimport { useDragDrop } from '../hooks/useDragDrop'\nimport { useResize, ResizeEdge } from '../hooks/useResize'\nimport { DraggableGridItem } from './DraggableGridItem'\nimport { UIResourceRenderer } from './UIResourceRenderer'\n\n/**\n * Props for EditableUIResourceRenderer\n */\nexport interface EditableUIResourceRendererProps {\n /**\n * Layout to render (must be UILayout, not single component)\n */\n layout: UILayout\n\n /**\n * Drag-drop configuration\n */\n dragDrop?: DragDropConfig\n\n /**\n * Error callback\n */\n onError?: (error: RendererError) => void\n\n /**\n * Callback when layout changes (reorder or resize)\n */\n onLayoutChange?: (layout: UILayout) => void\n\n /**\n * Custom CSS class\n */\n class?: string\n\n /**\n * Show grid overlay during editing\n */\n showGridOverlay?: boolean\n}\n\n/**\n * Grid overlay component for visual feedback\n */\nconst GridOverlay: Component<{ columns: number; visible: boolean }> = (props) => {\n return (\n <Show when={props.visible}>\n <div\n class=\"mcp-grid-overlay\"\n style={{\n position: 'absolute',\n inset: '0',\n display: 'grid',\n 'grid-template-columns': `repeat(${props.columns}, 1fr)`,\n gap: '1rem',\n padding: '0',\n 'pointer-events': 'none',\n 'z-index': '0'\n }}\n >\n <For each={Array(props.columns).fill(0)}>\n {() => (\n <div\n class=\"mcp-grid-overlay-column\"\n style={{\n 'background-color': 'rgba(59, 130, 246, 0.05)',\n border: '1px dashed rgba(59, 130, 246, 0.2)',\n 'border-radius': '4px'\n }}\n />\n )}\n </For>\n </div>\n </Show>\n )\n}\n\n/**\n * EditableUIResourceRenderer Component\n */\nexport const EditableUIResourceRenderer: Component<EditableUIResourceRendererProps> = (props) => {\n // Internal state for components (allows editing)\n const [components, setComponents] = createSignal<UIComponent[]>(props.layout.components)\n const [activeResizeId, setActiveResizeId] = createSignal<string | null>(null)\n const [previewPositions, setPreviewPositions] = createSignal<Map<string, GridPosition>>(new Map())\n const [gridContainerRef, setGridContainerRef] = createSignal<HTMLElement | null>(null)\n\n // Sync with external layout changes\n createEffect(on(() => props.layout.components, (newComponents) => {\n setComponents(newComponents)\n }))\n\n // Drag-drop configuration\n const dragDropConfig = createMemo(() => ({\n enabled: props.dragDrop?.enabled ?? false,\n reorder: props.dragDrop?.reorder ?? true,\n resize: props.dragDrop?.resize ?? true,\n constraints: props.dragDrop?.constraints ?? {},\n showGridLines: props.dragDrop?.showGridLines ?? true,\n animationDuration: props.dragDrop?.animationDuration ?? 200\n }))\n\n // Handle reorder from drag-drop\n const handleReorder = (newComponents: UIComponent[]) => {\n setComponents(newComponents)\n\n const newLayout: UILayout = {\n ...props.layout,\n components: newComponents\n }\n\n props.dragDrop?.onReorder?.(newComponents)\n props.dragDrop?.onChange?.(newLayout)\n props.onLayoutChange?.(newLayout)\n }\n\n // Handle resize completion\n const handleResize = (componentId: string, newPosition: GridPosition) => {\n const updatedComponents = components().map(c =>\n c.id === componentId ? { ...c, position: newPosition } : c\n )\n\n setComponents(updatedComponents)\n setActiveResizeId(null)\n setPreviewPositions(new Map())\n\n const newLayout: UILayout = {\n ...props.layout,\n components: updatedComponents\n }\n\n props.dragDrop?.onResize?.(componentId, newPosition)\n props.dragDrop?.onChange?.(newLayout)\n props.onLayoutChange?.(newLayout)\n }\n\n // Handle resize preview\n const handleResizePreview = (componentId: string, previewPosition: GridPosition) => {\n setPreviewPositions(prev => {\n const next = new Map(prev)\n next.set(componentId, previewPosition)\n return next\n })\n }\n\n // Initialize drag-drop hook\n const dragDrop = useDragDrop({\n components,\n onReorder: handleReorder,\n enabled: dragDropConfig().enabled && dragDropConfig().reorder\n })\n\n // Grid container style\n const gridContainerStyle = createMemo((): JSX.CSSProperties => ({\n display: 'grid',\n 'grid-template-columns': `repeat(${props.layout.grid.columns}, 1fr)`,\n gap: props.layout.grid.gap,\n position: 'relative'\n }))\n\n // Check if we should show grid overlay\n const showOverlay = createMemo(() =>\n dragDropConfig().showGridLines && (dragDrop.isDragging() || activeResizeId() !== null)\n )\n\n // Get effective position for a component (preview if resizing, otherwise actual)\n const getEffectivePosition = (component: UIComponent): GridPosition => {\n const preview = previewPositions().get(component.id)\n return preview || component.position\n }\n\n // If drag-drop is not enabled, just render the standard UIResourceRenderer\n if (!props.dragDrop?.enabled) {\n return (\n <UIResourceRenderer\n content={props.layout}\n onError={props.onError}\n class={props.class}\n />\n )\n }\n\n return (\n <div class={`w-full editable-ui-renderer ${props.class || ''}`}>\n <div\n ref={setGridContainerRef}\n class=\"grid relative\"\n style={gridContainerStyle()}\n data-grid-container\n >\n {/* Grid overlay */}\n <GridOverlay\n columns={props.layout.grid.columns}\n visible={showOverlay()}\n />\n\n {/* Render components with drag-drop wrappers */}\n <For each={components()}>\n {(component) => {\n // Create resize hook for each component\n const resize = useResize({\n componentId: component.id,\n currentPosition: () => component.position,\n onResize: (pos) => handleResize(component.id, pos),\n onResizePreview: (pos) => handleResizePreview(component.id, pos),\n constraints: dragDropConfig().constraints,\n gridContainer: gridContainerRef,\n gridColumns: props.layout.grid.columns,\n enabled: dragDropConfig().enabled && dragDropConfig().resize\n })\n\n const effectivePosition = () => getEffectivePosition(component)\n\n return (\n <DraggableGridItem\n id={component.id}\n position={effectivePosition()}\n draggable={dragDropConfig().enabled && dragDropConfig().reorder}\n resizable={dragDropConfig().enabled && dragDropConfig().resize}\n constraints={dragDropConfig().constraints}\n isDragging={dragDrop.isComponentDragging(component.id)}\n isDropTarget={dragDrop.isDropTarget(component.id)}\n isResizing={activeResizeId() === component.id}\n previewPosition={previewPositions().get(component.id) || null}\n dragProps={dragDrop.getDragProps(component.id)}\n onResizeStart={(edge) => {\n setActiveResizeId(component.id)\n // Trigger resize with a synthetic event\n const syntheticEvent = new PointerEvent('pointerdown', {\n clientX: 0,\n clientY: 0\n })\n resize.handleResizeStart(syntheticEvent, edge as ResizeEdge)\n }}\n >\n {/* Render component using UIResourceRenderer for single component */}\n <UIResourceRenderer\n content={component}\n onError={props.onError}\n />\n </DraggableGridItem>\n )\n }}\n </For>\n </div>\n </div>\n )\n}\n\nexport default EditableUIResourceRenderer\n"],"names":["GridOverlay","props","_$createComponent","Show","when","visible","children","_el$","_$getNextElement","_tmpl$","_$insert","For","each","Array","columns","fill","_tmpl$2","_$effect","_$p","_$setStyleProperty","EditableUIResourceRenderer","components","setComponents","createSignal","layout","activeResizeId","setActiveResizeId","previewPositions","setPreviewPositions","Map","gridContainerRef","setGridContainerRef","createEffect","on","newComponents","dragDropConfig","createMemo","enabled","dragDrop","reorder","resize","constraints","showGridLines","animationDuration","handleReorder","newLayout","onReorder","onChange","onLayoutChange","handleResize","componentId","newPosition","updatedComponents","map","c","id","position","onResize","handleResizePreview","previewPosition","prev","next","set","useDragDrop","gridContainerStyle","display","grid","gap","showOverlay","isDragging","getEffectivePosition","component","preview","get","UIResourceRenderer","content","onError","class","_el$3","_tmpl$3","_el$4","firstChild","_el$5","_el$6","_co$","_$getNextMarker","nextSibling","_el$7","_el$8","_co$2","_$use","useResize","currentPosition","pos","onResizePreview","gridContainer","gridColumns","effectivePosition","DraggableGridItem","draggable","_$memo","resizable","isComponentDragging","isDropTarget","isResizing","dragProps","getDragProps","onResizeStart","edge","syntheticEvent","PointerEvent","clientX","clientY","handleResizeStart","_p$","_v$","_v$2","e","_$className","t","_$style","undefined"],"mappings":";;;;;;;;;AAmEA,MAAMA,cAAiEC,CAAAA,UAAU;AAC/E,SAAAC,IAAAA,gBACGC,QAAAA,MAAI;AAAA,IAAA,IAACC,OAAI;AAAA,aAAEH,MAAMI;AAAAA,IAAO;AAAA,IAAA,IAAAC,WAAA;AAAA,UAAAC,OAAAC,IAAAA,eAAAC,MAAA;AAAAC,iBAAAH,MAAAL,IAAAA,gBAcpBS,aAAG;AAAA,QAAA,IAACC,OAAI;AAAA,iBAAEC,MAAMZ,MAAMa,OAAO,EAAEC,KAAK,CAAC;AAAA,QAAC;AAAA,QAAAT,UACpCA,MAAAE,IAAAA,eAAAQ,OAAA;AAAA,MAAA,CASA,CAAA;AAAAC,UAAAA,OAAAC,CAAAA,QAAAC,IAAAA,iBAAAZ,MAAA,yBAjBwB,UAAUN,MAAMa,OAAO,QAAQ,CAAA;AAAA,aAAAP;AAAAA,IAAA;AAAA,EAAA,CAAA;AAsBlE;AAKO,MAAMa,6BAA0EnB,CAAAA,UAAU;;AAE/F,QAAM,CAACoB,YAAYC,aAAa,IAAIC,QAAAA,aAA4BtB,MAAMuB,OAAOH,UAAU;AACvF,QAAM,CAACI,gBAAgBC,iBAAiB,IAAIH,QAAAA,aAA4B,IAAI;AAC5E,QAAM,CAACI,kBAAkBC,mBAAmB,IAAIL,QAAAA,aAAwC,oBAAIM,KAAK;AACjG,QAAM,CAACC,kBAAkBC,mBAAmB,IAAIR,QAAAA,aAAiC,IAAI;AAGrFS,UAAAA,aAAaC,QAAAA,GAAG,MAAMhC,MAAMuB,OAAOH,YAAaa,CAAAA,kBAAkB;AAChEZ,kBAAcY,aAAa;AAA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2E;AAAAA,cAAO;AAAA,YAAA,CAAA;AAAA,UAAA;AAAA,QAAA,CAAA;AAAA,MAI9B;AAAA,IAAA,CAAC,GAAAY,OAAAC,KAAA;AAAAxE,QAAAA,OAAAiG,CAAAA,QAAA;AAAA,UAAAC,MA3DK,+BAA+BlH,MAAM4E,SAAS,EAAE,IAAEuC,OAInDpD,mBAAAA;AAAoBmD,cAAAD,IAAAG,KAAAC,IAAAA,UAAAxC,OAAAoC,IAAAG,IAAAF,GAAA;AAAAD,UAAAK,IAAAC,IAAAA,MAAAxC,OAAAoC,MAAAF,IAAAK,CAAA;AAAA,aAAAL;AAAAA,IAAA,GAAA;AAAA,MAAAG,GAAAI;AAAAA,MAAAF,GAAAE;AAAAA,IAAAA,CAAA;AAAA,WAAA3C;AAAAA,EAAA,GAAA;AA4DnC;;;"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * EditableUIResourceRenderer Component
3
+ * Extends UIResourceRenderer with drag-and-drop reordering and resizing capabilities
4
+ *
5
+ * Sprint Drag-Drop Feature
6
+ */
7
+ import { Component } from 'solid-js';
8
+ import type { UILayout, RendererError, DragDropConfig } from '../types';
9
+ /**
10
+ * Props for EditableUIResourceRenderer
11
+ */
12
+ export interface EditableUIResourceRendererProps {
13
+ /**
14
+ * Layout to render (must be UILayout, not single component)
15
+ */
16
+ layout: UILayout;
17
+ /**
18
+ * Drag-drop configuration
19
+ */
20
+ dragDrop?: DragDropConfig;
21
+ /**
22
+ * Error callback
23
+ */
24
+ onError?: (error: RendererError) => void;
25
+ /**
26
+ * Callback when layout changes (reorder or resize)
27
+ */
28
+ onLayoutChange?: (layout: UILayout) => void;
29
+ /**
30
+ * Custom CSS class
31
+ */
32
+ class?: string;
33
+ /**
34
+ * Show grid overlay during editing
35
+ */
36
+ showGridOverlay?: boolean;
37
+ }
38
+ /**
39
+ * EditableUIResourceRenderer Component
40
+ */
41
+ export declare const EditableUIResourceRenderer: Component<EditableUIResourceRendererProps>;
42
+ export default EditableUIResourceRenderer;
43
+ //# sourceMappingURL=EditableUIResourceRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableUIResourceRenderer.d.ts","sourceRoot":"","sources":["../../src/components/EditableUIResourceRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EAQV,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAEV,QAAQ,EACR,aAAa,EAEb,cAAc,EACf,MAAM,UAAU,CAAA;AAMjB;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAA;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IAExC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAA;IAE3C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAsCD;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,CAAC,+BAA+B,CAuKjF,CAAA;AAED,eAAe,0BAA0B,CAAA"}
@@ -0,0 +1,203 @@
1
+ import { createComponent, getNextElement, template, getNextMarker, use, insert, memo, effect, className, style, setStyleProperty } from "solid-js/web";
2
+ import { createSignal, createEffect, on, createMemo, For, Show } from "solid-js";
3
+ import { useDragDrop } from "../hooks/useDragDrop.js";
4
+ import { useResize } from "../hooks/useResize.js";
5
+ import { DraggableGridItem } from "./DraggableGridItem.js";
6
+ import { UIResourceRenderer } from "./UIResourceRenderer.js";
7
+ var _tmpl$ = /* @__PURE__ */ template(`<div class=mcp-grid-overlay style=position:absolute;inset:0;display:grid;gap:1rem;padding:0;pointer-events:none;z-index:0>`), _tmpl$2 = /* @__PURE__ */ template(`<div class=mcp-grid-overlay-column style="background-color:rgba(59, 130, 246, 0.05);border:1px dashed rgba(59, 130, 246, 0.2);border-radius:4px">`), _tmpl$3 = /* @__PURE__ */ template(`<div><div class="grid relative"data-grid-container><!$><!/><!$><!/>`);
8
+ const GridOverlay = (props) => {
9
+ return createComponent(Show, {
10
+ get when() {
11
+ return props.visible;
12
+ },
13
+ get children() {
14
+ var _el$ = getNextElement(_tmpl$);
15
+ insert(_el$, createComponent(For, {
16
+ get each() {
17
+ return Array(props.columns).fill(0);
18
+ },
19
+ children: () => getNextElement(_tmpl$2)
20
+ }));
21
+ effect((_$p) => setStyleProperty(_el$, "grid-template-columns", `repeat(${props.columns}, 1fr)`));
22
+ return _el$;
23
+ }
24
+ });
25
+ };
26
+ const EditableUIResourceRenderer = (props) => {
27
+ var _a;
28
+ const [components, setComponents] = createSignal(props.layout.components);
29
+ const [activeResizeId, setActiveResizeId] = createSignal(null);
30
+ const [previewPositions, setPreviewPositions] = createSignal(/* @__PURE__ */ new Map());
31
+ const [gridContainerRef, setGridContainerRef] = createSignal(null);
32
+ createEffect(on(() => props.layout.components, (newComponents) => {
33
+ setComponents(newComponents);
34
+ }));
35
+ const dragDropConfig = createMemo(() => {
36
+ var _a2, _b, _c, _d, _e, _f;
37
+ return {
38
+ enabled: ((_a2 = props.dragDrop) == null ? void 0 : _a2.enabled) ?? false,
39
+ reorder: ((_b = props.dragDrop) == null ? void 0 : _b.reorder) ?? true,
40
+ resize: ((_c = props.dragDrop) == null ? void 0 : _c.resize) ?? true,
41
+ constraints: ((_d = props.dragDrop) == null ? void 0 : _d.constraints) ?? {},
42
+ showGridLines: ((_e = props.dragDrop) == null ? void 0 : _e.showGridLines) ?? true,
43
+ animationDuration: ((_f = props.dragDrop) == null ? void 0 : _f.animationDuration) ?? 200
44
+ };
45
+ });
46
+ const handleReorder = (newComponents) => {
47
+ var _a2, _b, _c, _d, _e;
48
+ setComponents(newComponents);
49
+ const newLayout = {
50
+ ...props.layout,
51
+ components: newComponents
52
+ };
53
+ (_b = (_a2 = props.dragDrop) == null ? void 0 : _a2.onReorder) == null ? void 0 : _b.call(_a2, newComponents);
54
+ (_d = (_c = props.dragDrop) == null ? void 0 : _c.onChange) == null ? void 0 : _d.call(_c, newLayout);
55
+ (_e = props.onLayoutChange) == null ? void 0 : _e.call(props, newLayout);
56
+ };
57
+ const handleResize = (componentId, newPosition) => {
58
+ var _a2, _b, _c, _d, _e;
59
+ const updatedComponents = components().map((c) => c.id === componentId ? {
60
+ ...c,
61
+ position: newPosition
62
+ } : c);
63
+ setComponents(updatedComponents);
64
+ setActiveResizeId(null);
65
+ setPreviewPositions(/* @__PURE__ */ new Map());
66
+ const newLayout = {
67
+ ...props.layout,
68
+ components: updatedComponents
69
+ };
70
+ (_b = (_a2 = props.dragDrop) == null ? void 0 : _a2.onResize) == null ? void 0 : _b.call(_a2, componentId, newPosition);
71
+ (_d = (_c = props.dragDrop) == null ? void 0 : _c.onChange) == null ? void 0 : _d.call(_c, newLayout);
72
+ (_e = props.onLayoutChange) == null ? void 0 : _e.call(props, newLayout);
73
+ };
74
+ const handleResizePreview = (componentId, previewPosition) => {
75
+ setPreviewPositions((prev) => {
76
+ const next = new Map(prev);
77
+ next.set(componentId, previewPosition);
78
+ return next;
79
+ });
80
+ };
81
+ const dragDrop = useDragDrop({
82
+ components,
83
+ onReorder: handleReorder,
84
+ enabled: dragDropConfig().enabled && dragDropConfig().reorder
85
+ });
86
+ const gridContainerStyle = createMemo(() => ({
87
+ display: "grid",
88
+ "grid-template-columns": `repeat(${props.layout.grid.columns}, 1fr)`,
89
+ gap: props.layout.grid.gap,
90
+ position: "relative"
91
+ }));
92
+ const showOverlay = createMemo(() => dragDropConfig().showGridLines && (dragDrop.isDragging() || activeResizeId() !== null));
93
+ const getEffectivePosition = (component) => {
94
+ const preview = previewPositions().get(component.id);
95
+ return preview || component.position;
96
+ };
97
+ if (!((_a = props.dragDrop) == null ? void 0 : _a.enabled)) {
98
+ return createComponent(UIResourceRenderer, {
99
+ get content() {
100
+ return props.layout;
101
+ },
102
+ get onError() {
103
+ return props.onError;
104
+ },
105
+ get ["class"]() {
106
+ return props.class;
107
+ }
108
+ });
109
+ }
110
+ return (() => {
111
+ var _el$3 = getNextElement(_tmpl$3), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, [_el$6, _co$] = getNextMarker(_el$5.nextSibling), _el$7 = _el$6.nextSibling, [_el$8, _co$2] = getNextMarker(_el$7.nextSibling);
112
+ use(setGridContainerRef, _el$4);
113
+ insert(_el$4, createComponent(GridOverlay, {
114
+ get columns() {
115
+ return props.layout.grid.columns;
116
+ },
117
+ get visible() {
118
+ return showOverlay();
119
+ }
120
+ }), _el$6, _co$);
121
+ insert(_el$4, createComponent(For, {
122
+ get each() {
123
+ return components();
124
+ },
125
+ children: (component) => {
126
+ const resize = useResize({
127
+ componentId: component.id,
128
+ currentPosition: () => component.position,
129
+ onResize: (pos) => handleResize(component.id, pos),
130
+ onResizePreview: (pos) => handleResizePreview(component.id, pos),
131
+ constraints: dragDropConfig().constraints,
132
+ gridContainer: gridContainerRef,
133
+ gridColumns: props.layout.grid.columns,
134
+ enabled: dragDropConfig().enabled && dragDropConfig().resize
135
+ });
136
+ const effectivePosition = () => getEffectivePosition(component);
137
+ return createComponent(DraggableGridItem, {
138
+ get id() {
139
+ return component.id;
140
+ },
141
+ get position() {
142
+ return effectivePosition();
143
+ },
144
+ get draggable() {
145
+ return memo(() => !!dragDropConfig().enabled)() && dragDropConfig().reorder;
146
+ },
147
+ get resizable() {
148
+ return memo(() => !!dragDropConfig().enabled)() && dragDropConfig().resize;
149
+ },
150
+ get constraints() {
151
+ return dragDropConfig().constraints;
152
+ },
153
+ get isDragging() {
154
+ return dragDrop.isComponentDragging(component.id);
155
+ },
156
+ get isDropTarget() {
157
+ return dragDrop.isDropTarget(component.id);
158
+ },
159
+ get isResizing() {
160
+ return activeResizeId() === component.id;
161
+ },
162
+ get previewPosition() {
163
+ return previewPositions().get(component.id) || null;
164
+ },
165
+ get dragProps() {
166
+ return dragDrop.getDragProps(component.id);
167
+ },
168
+ onResizeStart: (edge) => {
169
+ setActiveResizeId(component.id);
170
+ const syntheticEvent = new PointerEvent("pointerdown", {
171
+ clientX: 0,
172
+ clientY: 0
173
+ });
174
+ resize.handleResizeStart(syntheticEvent, edge);
175
+ },
176
+ get children() {
177
+ return createComponent(UIResourceRenderer, {
178
+ content: component,
179
+ get onError() {
180
+ return props.onError;
181
+ }
182
+ });
183
+ }
184
+ });
185
+ }
186
+ }), _el$8, _co$2);
187
+ effect((_p$) => {
188
+ var _v$ = `w-full editable-ui-renderer ${props.class || ""}`, _v$2 = gridContainerStyle();
189
+ _v$ !== _p$.e && className(_el$3, _p$.e = _v$);
190
+ _p$.t = style(_el$4, _v$2, _p$.t);
191
+ return _p$;
192
+ }, {
193
+ e: void 0,
194
+ t: void 0
195
+ });
196
+ return _el$3;
197
+ })();
198
+ };
199
+ export {
200
+ EditableUIResourceRenderer,
201
+ EditableUIResourceRenderer as default
202
+ };
203
+ //# sourceMappingURL=EditableUIResourceRenderer.js.map