blixify-ui-web-mcp 0.1.19 → 0.1.21
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/lib/components/action/iconButton/iconButton.stories.tsx +11 -2
- package/lib/components/auth/signUp/signUp.stories.tsx +39 -1
- package/lib/components/chart/statsCard/README.md +24 -0
- package/lib/components/chart/statsCard/statsCard.stories.tsx +68 -0
- package/lib/components/chat/chatBase/chatBase.stories.tsx +1 -1
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +5 -5
- package/lib/components/data/dataTemplate/README.md +204 -85
- package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +307 -295
- package/lib/components/data/dataTemplate/drive.stories.tsx +197 -0
- package/lib/components/data/dataWrapper/README.md +109 -22
- package/lib/components/data/dataWrapper/dataWrapper.bareHooks.stories.tsx +951 -0
- package/lib/components/data/dataWrapper/dataWrapper.edit.stories.tsx +356 -5
- package/lib/components/data/dataWrapper/dataWrapper.view.stories.tsx +79 -5
- package/lib/components/display/calendar/calendar.stories.tsx +1 -1
- package/lib/components/display/detailList/README.md +11 -10
- package/lib/components/display/detailList/detailList.stories.tsx +16 -3
- package/lib/components/display/feeds/README.md +3 -3
- package/lib/components/display/feeds/feeds.stories.tsx +3 -3
- package/lib/components/display/filePreview/filePreview.stories.tsx +111 -0
- package/lib/components/display/modal/README.md +3 -0
- package/lib/components/display/modal/modal.stories.tsx +50 -1
- package/lib/components/display/newCalendar/README.md +0 -6
- package/lib/components/display/newCalendar/newCalendar.stories.tsx +1 -1
- package/lib/components/display/newFeeds/README.md +1 -5
- package/lib/components/display/newFeeds/newFeeds.stories.tsx +3 -3
- package/lib/components/display/newKanban/README.md +0 -7
- package/lib/components/display/newList/README.md +1 -4
- package/lib/components/display/newTable/README.md +29 -9
- package/lib/components/display/newTable/newTable.stories.tsx +120 -9
- package/lib/components/display/tag/README.md +1 -1
- package/lib/components/display/tag/tag.stories.tsx +7 -0
- package/lib/components/input/markdown/markdown.stories.tsx +3 -1
- package/lib/components/input/uploadInput/uploadInput.stories.tsx +41 -0
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +175 -0
- package/lib/components/navigation/tabs/tabs.stories.tsx +23 -0
- package/lib/components/template/calendarView/calendarView.stories.tsx +4 -4
- package/lib/components/template/chatDashboard/chatDashboard.stories.tsx +2 -2
- package/lib/mcp/tools/getBackendComponent.d.ts.map +1 -1
- package/lib/mcp/tools/getBackendComponent.js +7 -3
- package/lib/mcp/tools/getBackendComponent.js.map +1 -1
- package/lib/mcp/tools/suggestTemplate.js +3 -3
- package/lib/mcp/tools/suggestTemplate.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/data/dataTemplate/dataModule.stories.tsx +0 -191
- package/lib/components/data/dataWrapper/dataWrapper.consumer.stories.tsx +0 -2125
- package/lib/components/data/dataWrapper/dataWrapper.utils.stories.tsx +0 -576
- package/lib/components/data/flexFilter/flexFilter.stories.tsx +0 -171
|
@@ -55,6 +55,28 @@ const groupedNavigation = [
|
|
|
55
55
|
},
|
|
56
56
|
];
|
|
57
57
|
|
|
58
|
+
|
|
59
|
+
const manyNavigation = [
|
|
60
|
+
{ id: "home", name: "Home", href: "/home", icon: HomeIcon, description: "Dashboard overview and recent activity" },
|
|
61
|
+
{ id: "journals", name: "Journals", href: "/journals", icon: FolderIcon, description: "Peer reviewed medical journal volumes" },
|
|
62
|
+
{ id: "vol2", name: "Journal Volume 2", href: "/j/2", icon: FolderIcon, parentId: "journals" },
|
|
63
|
+
{ id: "vol3", name: "Journal Volume 3", href: "/j/3", icon: FolderIcon, parentId: "journals" },
|
|
64
|
+
{ id: "charts", name: "Charts", href: "/charts", icon: FolderIcon, description: "Analytics and research dashboards" },
|
|
65
|
+
{ id: "archive", name: "Archive", href: "/archive", icon: FolderIcon, description: "Institutional records and strategic memory" },
|
|
66
|
+
{ id: "governance", name: "Governance", href: "/gov", icon: FolderIcon, description: "Policies, SOPs and quality documentation" },
|
|
67
|
+
{ id: "theses", name: "Theses", href: "/theses", icon: FolderIcon, description: "Postgraduate and capstone scholarship" },
|
|
68
|
+
{ id: "policies", name: "Policies", href: "/policies", icon: FolderIcon, description: "Reimbursement claims and expense rules" },
|
|
69
|
+
{ id: "settings", name: "Settings", href: "/settings", icon: UsersIcon, description: "Workspace preferences and member access" },
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
const twoGroupNavigation = [
|
|
73
|
+
{ id: "home", name: "Home", href: "/home", icon: HomeIcon },
|
|
74
|
+
{ id: "eng", name: "Engineering", href: "/t/eng", icon: UsersIcon, groupId: "People" },
|
|
75
|
+
{ id: "hr", name: "Human Resources", href: "/t/hr", icon: UsersIcon, groupId: "People" },
|
|
76
|
+
{ id: "vol2", name: "Volume 2", href: "/j/2", icon: FolderIcon, groupId: "Journals" },
|
|
77
|
+
{ id: "vol3", name: "Volume 3", href: "/j/3", icon: FolderIcon, groupId: "Journals" },
|
|
78
|
+
];
|
|
79
|
+
|
|
58
80
|
const renderLogo = (collapse?: boolean) => (
|
|
59
81
|
<div className="flex items-center flex-shrink-0 px-6 cursor-pointer">
|
|
60
82
|
<img
|
|
@@ -82,6 +104,10 @@ export const LeftNav = () => {
|
|
|
82
104
|
const [collapse, setCollapse] = useState(false);
|
|
83
105
|
const [groupedNav, setGroupedNav] = useState(groupedNavigation);
|
|
84
106
|
const [darkMobile, setDarkMobile] = useState(false);
|
|
107
|
+
const [dragGroupNav, setDragGroupNav] = useState(twoGroupNavigation);
|
|
108
|
+
// INFO: starts on an item inside a group, so the story shows the group already
|
|
109
|
+
// open on mount — the case a route change reproduces in a real app
|
|
110
|
+
const [groupedSelectedId, setGroupedSelectedId] = useState("engineering");
|
|
85
111
|
|
|
86
112
|
return (
|
|
87
113
|
<>
|
|
@@ -124,6 +150,31 @@ export const LeftNav = () => {
|
|
|
124
150
|
</div>
|
|
125
151
|
</StorySection>
|
|
126
152
|
|
|
153
|
+
<StorySection
|
|
154
|
+
title="Grouped — Active Item Inside a Group"
|
|
155
|
+
description="A group containing selectedId mounts open, so the active page stays visible. In a real app a route change remounts the nav, and without this the group would close on the very page just opened. Groups with no selected child still start collapsed — Site data below."
|
|
156
|
+
>
|
|
157
|
+
<div className="w-full h-96 relative overflow-hidden border rounded-lg">
|
|
158
|
+
<LeftNavImpl
|
|
159
|
+
selectedId={groupedSelectedId}
|
|
160
|
+
navigation={[
|
|
161
|
+
{ id: "dashboard", name: "Dashboard", href: "/dashboard", icon: HomeIcon },
|
|
162
|
+
{ id: "teams", name: "Teams", href: "/teams", icon: UsersIcon, groupId: "People" },
|
|
163
|
+
{ id: "engineering", name: "Engineering", href: "/teams/engineering", icon: UsersIcon, groupId: "People" },
|
|
164
|
+
{ id: "hr", name: "Human Resources", href: "/teams/hr", icon: UsersIcon, groupId: "People" },
|
|
165
|
+
{ id: "reports", name: "Reports", href: "/reports", icon: FolderIcon, groupId: "Site data" },
|
|
166
|
+
{ id: "exports", name: "Exports", href: "/exports", icon: FolderIcon, groupId: "Site data" },
|
|
167
|
+
]}
|
|
168
|
+
leftNavMobileMenu={false}
|
|
169
|
+
handleBarsOnClick={(id) => setGroupedSelectedId(id)}
|
|
170
|
+
handleToggleLeftNavMobileMenu={() => {}}
|
|
171
|
+
renderDashboardLogo={() => renderLogo()}
|
|
172
|
+
renderDashboardContent={renderContent}
|
|
173
|
+
renderDashboardHeaderContent={renderHeader}
|
|
174
|
+
/>
|
|
175
|
+
</div>
|
|
176
|
+
</StorySection>
|
|
177
|
+
|
|
127
178
|
<StorySection
|
|
128
179
|
title="Collapsible Sidebar"
|
|
129
180
|
description="Pass transition.collapse to toggle the sidebar between full and icon-only width. handleToggleCollapse fires when the collapse arrow is clicked. transition.headerVisible=false hides the top header bar on desktop."
|
|
@@ -188,6 +239,130 @@ export const LeftNav = () => {
|
|
|
188
239
|
/>
|
|
189
240
|
</div>
|
|
190
241
|
</StorySection>
|
|
242
|
+
|
|
243
|
+
<StorySection
|
|
244
|
+
title="Compact Mode"
|
|
245
|
+
description="compactMode tightens row height, padding, icon size and indentation while keeping every label. Use it when the sidebar has enough items that collapse — which hides labels entirely — costs more than it saves. Compare against the Default story above: the same list, more of it on screen."
|
|
246
|
+
>
|
|
247
|
+
<div className="flex flex-row gap-4">
|
|
248
|
+
<div className="w-1/2 h-96 relative overflow-hidden border rounded-lg">
|
|
249
|
+
<LeftNavImpl
|
|
250
|
+
selectedId={selectedId}
|
|
251
|
+
navigation={manyNavigation}
|
|
252
|
+
leftNavMobileMenu={false}
|
|
253
|
+
handleBarsOnClick={(id) => setSelectedId(id)}
|
|
254
|
+
handleToggleLeftNavMobileMenu={() => {}}
|
|
255
|
+
renderDashboardLogo={() => renderLogo()}
|
|
256
|
+
renderDashboardContent={() => (
|
|
257
|
+
<div className="p-6 text-gray-500 text-sm">Default density</div>
|
|
258
|
+
)}
|
|
259
|
+
renderDashboardHeaderContent={renderHeader}
|
|
260
|
+
/>
|
|
261
|
+
</div>
|
|
262
|
+
<div className="w-1/2 h-96 relative overflow-hidden border rounded-lg">
|
|
263
|
+
<LeftNavImpl
|
|
264
|
+
selectedId={selectedId}
|
|
265
|
+
navigation={manyNavigation}
|
|
266
|
+
leftNavMobileMenu={false}
|
|
267
|
+
compactMode={true}
|
|
268
|
+
handleBarsOnClick={(id) => setSelectedId(id)}
|
|
269
|
+
handleToggleLeftNavMobileMenu={() => {}}
|
|
270
|
+
renderDashboardLogo={() => renderLogo()}
|
|
271
|
+
renderDashboardContent={() => (
|
|
272
|
+
<div className="p-6 text-gray-500 text-sm">compactMode</div>
|
|
273
|
+
)}
|
|
274
|
+
renderDashboardHeaderContent={renderHeader}
|
|
275
|
+
/>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</StorySection>
|
|
279
|
+
|
|
280
|
+
<StorySection
|
|
281
|
+
title="Searchable"
|
|
282
|
+
description="searchable renders a filter box above the nav. Matches are shown flat — they drop their group and parent — so a hit is never hidden inside a folder the user would have to open. Type 'vol' to see the two nested volumes surface to the top level. The filter also matches each item's optional description, which is never rendered: type 'reimbursement' and Policies appears, even though its label does not contain the word. Clearing the box restores the tree. The box is hidden while the sidebar is collapsed, where there is no room for it."
|
|
283
|
+
>
|
|
284
|
+
<div className="w-full h-96 relative overflow-hidden border rounded-lg">
|
|
285
|
+
<LeftNavImpl
|
|
286
|
+
selectedId={selectedId}
|
|
287
|
+
navigation={manyNavigation}
|
|
288
|
+
leftNavMobileMenu={false}
|
|
289
|
+
searchable={true}
|
|
290
|
+
compactMode={true}
|
|
291
|
+
searchPlaceholder="Filter pages"
|
|
292
|
+
handleBarsOnClick={(id) => setSelectedId(id)}
|
|
293
|
+
handleToggleLeftNavMobileMenu={() => {}}
|
|
294
|
+
renderDashboardLogo={() => renderLogo()}
|
|
295
|
+
renderDashboardContent={renderContent}
|
|
296
|
+
renderDashboardHeaderContent={renderHeader}
|
|
297
|
+
/>
|
|
298
|
+
</div>
|
|
299
|
+
</StorySection>
|
|
300
|
+
|
|
301
|
+
<StorySection
|
|
302
|
+
title="Persistent Expand State"
|
|
303
|
+
description="persistKey names a localStorage entry that remembers which groups and pages are open. Expand a group, reload the page, and it is still open — without it expansion lasts one mount only, so anything opened is shut again by the next navigation. Groups are keyed by groupId and pages by id. Omit persistKey and no storage is touched at all."
|
|
304
|
+
>
|
|
305
|
+
<div className="w-full h-96 relative overflow-hidden border rounded-lg">
|
|
306
|
+
<LeftNavImpl
|
|
307
|
+
selectedId={selectedId}
|
|
308
|
+
navigation={twoGroupNavigation}
|
|
309
|
+
leftNavMobileMenu={false}
|
|
310
|
+
persistKey="storybook-leftnav-expanded"
|
|
311
|
+
handleBarsOnClick={(id) => setSelectedId(id)}
|
|
312
|
+
handleToggleLeftNavMobileMenu={() => {}}
|
|
313
|
+
renderDashboardLogo={() => renderLogo()}
|
|
314
|
+
renderDashboardContent={renderContent}
|
|
315
|
+
renderDashboardHeaderContent={renderHeader}
|
|
316
|
+
/>
|
|
317
|
+
</div>
|
|
318
|
+
</StorySection>
|
|
319
|
+
|
|
320
|
+
<StorySection
|
|
321
|
+
title="Draggable Groups"
|
|
322
|
+
description="With draggable=true a group header now drags as a block — every row sharing its groupId travels with it, rather than the header moving alone and stranding its rows under whichever group lands above. Drag 'Journals' above 'People' to reorder the two blocks. Items still reorder individually within a group."
|
|
323
|
+
>
|
|
324
|
+
<div className="w-full h-96 relative overflow-hidden border rounded-lg">
|
|
325
|
+
<LeftNavImpl
|
|
326
|
+
selectedId={selectedId}
|
|
327
|
+
navigation={dragGroupNav}
|
|
328
|
+
leftNavMobileMenu={false}
|
|
329
|
+
draggable={true}
|
|
330
|
+
handleBarsOnClick={(id) => setSelectedId(id)}
|
|
331
|
+
handleChangeNavigation={(value) => setDragGroupNav(value)}
|
|
332
|
+
handleDropEnd={() => {}}
|
|
333
|
+
handleToggleLeftNavMobileMenu={() => {}}
|
|
334
|
+
renderDashboardLogo={() => renderLogo()}
|
|
335
|
+
renderDashboardContent={renderContent}
|
|
336
|
+
renderDashboardHeaderContent={renderHeader}
|
|
337
|
+
/>
|
|
338
|
+
</div>
|
|
339
|
+
</StorySection>
|
|
340
|
+
|
|
341
|
+
<StorySection
|
|
342
|
+
title="Transparent"
|
|
343
|
+
description="transparent makes the TOP HEADER BAR see-through, dropping its background, shadow and bottom border so a page can run its own hero or image up under it — the same pair Header carries. mobileOpaque keeps that bar solid below lg, where it holds the hamburger and is the only way back to the nav. The sidebar itself is unaffected. Shown over a gradient page so the effect is visible."
|
|
344
|
+
>
|
|
345
|
+
<div className="w-full h-96 relative overflow-hidden border rounded-lg bg-gradient-to-br from-primary-200 via-white to-primary-100">
|
|
346
|
+
<LeftNavImpl
|
|
347
|
+
selectedId={selectedId}
|
|
348
|
+
navigation={manyNavigation}
|
|
349
|
+
leftNavMobileMenu={false}
|
|
350
|
+
transparent={true}
|
|
351
|
+
mobileOpaque={true}
|
|
352
|
+
compactMode={true}
|
|
353
|
+
searchable={true}
|
|
354
|
+
handleBarsOnClick={(id) => setSelectedId(id)}
|
|
355
|
+
handleToggleLeftNavMobileMenu={() => {}}
|
|
356
|
+
renderDashboardLogo={() => renderLogo()}
|
|
357
|
+
renderDashboardContent={() => (
|
|
358
|
+
<div className="p-6 text-gray-600 text-sm">
|
|
359
|
+
Page content runs up under the header bar.
|
|
360
|
+
</div>
|
|
361
|
+
)}
|
|
362
|
+
renderDashboardHeaderContent={renderHeader}
|
|
363
|
+
/>
|
|
364
|
+
</div>
|
|
365
|
+
</StorySection>
|
|
191
366
|
</>
|
|
192
367
|
);
|
|
193
368
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import BookmarkIcon from "@heroicons/react/24/solid/BookmarkIcon";
|
|
1
2
|
import React, { useState } from "react";
|
|
2
3
|
import { Tabs as TabsImpl } from ".";
|
|
3
4
|
import { StorySection } from "../../storyUtils";
|
|
@@ -28,6 +29,28 @@ export const Tabs = () => {
|
|
|
28
29
|
/>
|
|
29
30
|
</StorySection>
|
|
30
31
|
|
|
32
|
+
<StorySection
|
|
33
|
+
title="Tab actions and icons"
|
|
34
|
+
description="action puts a control on the right of a tab, beside the delete cross. DataTemplate uses it for a bookmark that both shows and sets which tab opens when the url names no view. Solid and always visible when set; outline and revealed on hover when not, so an unset tab does not carry a control it mostly does not need. icon shows what a tab IS rather than what it was named — a file view carries a paperclip, since Docs or Assets says nothing on its own. It is marked rather than merely ordered, because tabs are drag-reorderable — first position would stop meaning default the moment someone rearranged them. An explicit ?view= in the url still wins, so a shared link lands where it was meant to."
|
|
35
|
+
>
|
|
36
|
+
<TabsImpl
|
|
37
|
+
tabs={[
|
|
38
|
+
{ id: "table", name: "Table View", href: "#" },
|
|
39
|
+
{
|
|
40
|
+
id: "gallery",
|
|
41
|
+
name: "My Gallery",
|
|
42
|
+
href: "#",
|
|
43
|
+
action: (
|
|
44
|
+
<BookmarkIcon className="ml-2 h-4 w-4 self-center text-primary-500" />
|
|
45
|
+
),
|
|
46
|
+
},
|
|
47
|
+
{ id: "timeline", name: "Timeline", href: "#" },
|
|
48
|
+
]}
|
|
49
|
+
selectedId="gallery"
|
|
50
|
+
onClick={() => {}}
|
|
51
|
+
/>
|
|
52
|
+
</StorySection>
|
|
53
|
+
|
|
31
54
|
<StorySection
|
|
32
55
|
title="Draggable"
|
|
33
56
|
description="Set draggable=true and provide handleChangeTabs to persist the new order. handleDropEnd fires when the drag interaction ends."
|
|
@@ -116,7 +116,7 @@ const INSTALLATIONS: Installation[] = [
|
|
|
116
116
|
type: "Installation Defect",
|
|
117
117
|
date: dayOffset(5),
|
|
118
118
|
status: "In Progress",
|
|
119
|
-
client: "
|
|
119
|
+
client: "Northwind Energy Sdn Bhd",
|
|
120
120
|
address: "Lot 7, Persiaran Industri, Selangor",
|
|
121
121
|
capacity: "640 kW",
|
|
122
122
|
cost: 96000,
|
|
@@ -162,7 +162,7 @@ const INSTALLATIONS: Installation[] = [
|
|
|
162
162
|
type: "Roof Inspection",
|
|
163
163
|
date: dayOffset(-5),
|
|
164
164
|
status: "Completed",
|
|
165
|
-
client: "
|
|
165
|
+
client: "Northwind Energy Sdn Bhd",
|
|
166
166
|
address: "Lot 9, Taman Industri, Pahang",
|
|
167
167
|
capacity: "720 kW",
|
|
168
168
|
cost: 38000,
|
|
@@ -173,7 +173,7 @@ const INSTALLATIONS: Installation[] = [
|
|
|
173
173
|
];
|
|
174
174
|
|
|
175
175
|
// INFO: NewCalendar's `type` field drives the color via colorRules.
|
|
176
|
-
// Modelled on the
|
|
176
|
+
// Modelled on the five job categories of a field-operations dashboard.
|
|
177
177
|
const COLOR_RULES = {
|
|
178
178
|
"PV Delivery": {
|
|
179
179
|
bg: "bg-emerald-500",
|
|
@@ -345,7 +345,7 @@ export const AppCalendarView = () => {
|
|
|
345
345
|
);
|
|
346
346
|
|
|
347
347
|
// INFO: cost roll-ups for the list view. Total + per-status breakdown,
|
|
348
|
-
// mirroring how
|
|
348
|
+
// mirroring how an operations dashboard surfaces cost summaries above its job lists.
|
|
349
349
|
const totalCost = INSTALLATIONS.reduce((s, i) => s + i.cost, 0);
|
|
350
350
|
const completedCost = INSTALLATIONS.filter((i) => i.status === "Completed").reduce(
|
|
351
351
|
(s, i) => s + i.cost,
|
|
@@ -35,7 +35,7 @@ export default meta;
|
|
|
35
35
|
|
|
36
36
|
const Logo = new URL("../../../assets/logo.png", import.meta.url).href;
|
|
37
37
|
|
|
38
|
-
// ─── Sample data (domain-neutral, modelled on
|
|
38
|
+
// ─── Sample data (domain-neutral, modelled on a sales proposal inbox) ──
|
|
39
39
|
|
|
40
40
|
const NAVIGATION = [
|
|
41
41
|
{ name: "Dashboard", href: "#" },
|
|
@@ -64,7 +64,7 @@ const FOOTER_LIST = [
|
|
|
64
64
|
];
|
|
65
65
|
|
|
66
66
|
// INFO: left-side selectable tabs. Each id maps to a content renderer in
|
|
67
|
-
// the center column. Mirrors
|
|
67
|
+
// the center column. Mirrors a proposal inbox's right-tab pattern
|
|
68
68
|
// but renders as a vertical list on the left so it stays visible while
|
|
69
69
|
// the user scrolls long chat threads in the center.
|
|
70
70
|
type CenterTabId = "messages" | "proposals" | "journeys" | "analytics";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBackendComponent.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/getBackendComponent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"getBackendComponent.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/getBackendComponent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwDxB,eAAO,MAAM,uBAAuB;;;;;;;;;;CA6DnC,CAAC"}
|
|
@@ -59,12 +59,16 @@ const BACKEND_COMPONENTS = {
|
|
|
59
59
|
function readFileIfExists(filePath) {
|
|
60
60
|
return fs.existsSync(filePath) ? fs.readFileSync(filePath, "utf-8") : null;
|
|
61
61
|
}
|
|
62
|
+
// INFO: the file written AS documentation wins. The first-found fallback chose
|
|
63
|
+
// by readdir order, which made the consumer fixtures — client configurations —
|
|
64
|
+
// the DataTemplateWrapper usage examples; those are no longer shipped at all.
|
|
65
|
+
const PREFERRED_STORIES = ["dataWrapper.bareHooks.stories.tsx"];
|
|
62
66
|
function findStoriesFile(dir) {
|
|
63
67
|
if (!fs.existsSync(dir))
|
|
64
68
|
return null;
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
.find((f) => f.endsWith(".stories.tsx") || f.endsWith(".stories.ts"));
|
|
69
|
+
const files = fs.readdirSync(dir);
|
|
70
|
+
const found = PREFERRED_STORIES.find((f) => files.includes(f)) ??
|
|
71
|
+
files.find((f) => f.endsWith(".stories.tsx") || f.endsWith(".stories.ts"));
|
|
68
72
|
return found ? path.join(dir, found) : null;
|
|
69
73
|
}
|
|
70
74
|
exports.getBackendComponentTool = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBackendComponent.js","sourceRoot":"","sources":["../../../src/mcp/tools/getBackendComponent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,6BAAwB;AACxB,qDAA8D;AAE9D,MAAM,QAAQ,GAAG,IAAA,2CAA0B,EAAC,MAAM,CAAC,CAAC;AAEpD;;;;GAIG;AACH,MAAM,kBAAkB,GACtB;IACE,WAAW,EAAE;QACX,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC;QACvC,WAAW,EACT,sKAAsK;KACzK;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC;QACxC,WAAW,EACT,gIAAgI;KACnI;IACD,SAAS,EAAE;QACT,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC;QACrC,WAAW,EACT,wEAAwE;KAC3E;IACD,SAAS,EAAE;QACT,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC;QACrC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AAO,GAAG,WAAW,CAC1D,CAAC;aACH;SACF;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;iBAC5B;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -139,7 +139,7 @@ const TEMPLATE_METADATA = {
|
|
|
139
139
|
],
|
|
140
140
|
},
|
|
141
141
|
calendarView: {
|
|
142
|
-
description: "Calendar-first schedule view modelled on
|
|
142
|
+
description: "Calendar-first schedule view modelled on a field-operations dashboard. Header + Breadcrumb + page title + stat tiles + ButtonGroup (Calendar / List view + Month / Week / Agenda variant) + color-coded legend (5 categories) + <NewCalendar variant='fullMonth' colorRules={...} />. Clicking a calendar event opens a Modal with a DetailList of metadata + a NewList of documents (with download actions). List view uses NewTable with the same data shape.",
|
|
143
143
|
useCase: [
|
|
144
144
|
"calendar",
|
|
145
145
|
"calendar view",
|
|
@@ -170,7 +170,7 @@ const TEMPLATE_METADATA = {
|
|
|
170
170
|
],
|
|
171
171
|
},
|
|
172
172
|
chatDashboard: {
|
|
173
|
-
description: "Three-column lead/conversation workspace modelled on
|
|
173
|
+
description: "Three-column lead/conversation workspace modelled on a sales proposal inbox. Header + Breadcrumb + lead summary header (name + phone + region + status Tag + Call/Email Buttons), then a 12-col grid: LEFT NewList of selectable sections (Messages / Proposals / Journeys / Analytics), CENTER renders the section content with <ChatBase> for Messages or NewList grids for the others, RIGHT shows an Activity log Collapse containing <NewFeeds> (chronological timeline). Stacks on mobile.",
|
|
174
174
|
useCase: [
|
|
175
175
|
"chat",
|
|
176
176
|
"chat dashboard",
|
|
@@ -199,7 +199,7 @@ const TEMPLATE_METADATA = {
|
|
|
199
199
|
],
|
|
200
200
|
},
|
|
201
201
|
mapLayout: {
|
|
202
|
-
description: "Map-first analytics layout with bare->detail navigation. Header + Breadcrumb + page title + Tabs (Map / List) + shared filter row (search + category ButtonGroup) + sidebar location list (NewList) next to a full-view <MapView enablePolygonSelect>. MapView's built-in colour legend shows per-category counts. The polygon-draw toolbar lets users lasso an area; handleSelectPolygon returns the contained marker IDs and the sidebar switches into a 'X selected — Bulk edit / Clear' selection panel. Clicking a marker, a sidebar item, or a NewTable row replaces the bare view with a DetailList of the location's attributes — same bare->detail pattern DataTemplateWrapper uses. Mirrors the
|
|
202
|
+
description: "Map-first analytics layout with bare->detail navigation. Header + Breadcrumb + page title + Tabs (Map / List) + shared filter row (search + category ButtonGroup) + sidebar location list (NewList) next to a full-view <MapView enablePolygonSelect>. MapView's built-in colour legend shows per-category counts. The polygon-draw toolbar lets users lasso an area; handleSelectPolygon returns the contained marker IDs and the sidebar switches into a 'X selected — Bulk edit / Clear' selection panel. Clicking a marker, a sidebar item, or a NewTable row replaces the bare view with a DetailList of the location's attributes — same bare->detail pattern DataTemplateWrapper uses. Mirrors the a production dashboard layout.",
|
|
203
203
|
useCase: [
|
|
204
204
|
"map",
|
|
205
205
|
"map layout",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestTemplate.js","sourceRoot":"","sources":["../../../src/mcp/tools/suggestTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,6BAAwB;AACxB,qDAA8D;AAE9D,MAAM,aAAa,GAAG,IAAA,2CAA0B,EAAC,UAAU,CAAC,CAAC;AAE7D;;;GAGG;AACH,MAAM,iBAAiB,GAOnB;IACF,QAAQ,EAAE;QACR,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC;QAClE,UAAU,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;KAC5C;IACD,WAAW,EAAE;QACX,WAAW,EACT,4FAA4F;QAC9F,OAAO,EAAE;YACP,SAAS;YACT,WAAW;YACX,UAAU;YACV,cAAc;YACd,SAAS;YAC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;KACF;IACD,YAAY,EAAE;QACZ,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"suggestTemplate.js","sourceRoot":"","sources":["../../../src/mcp/tools/suggestTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,6BAAwB;AACxB,qDAA8D;AAE9D,MAAM,aAAa,GAAG,IAAA,2CAA0B,EAAC,UAAU,CAAC,CAAC;AAE7D;;;GAGG;AACH,MAAM,iBAAiB,GAOnB;IACF,QAAQ,EAAE;QACR,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC;QAClE,UAAU,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;KAC5C;IACD,WAAW,EAAE;QACX,WAAW,EACT,4FAA4F;QAC9F,OAAO,EAAE;YACP,SAAS;YACT,WAAW;YACX,UAAU;YACV,cAAc;YACd,SAAS;YACT,UAAU;SACX;QACD,UAAU,EAAE;YACV,QAAQ;YACR,aAAa;YACb,aAAa;YACb,cAAc;YACd,aAAa;YACb,UAAU;YACV,aAAa;YACb,UAAU;YACV,WAAW;YACX,eAAe;YACf,eAAe;SAChB;KACF;IACD,cAAc,EAAE;QACd,WAAW,EACT,mHAAmH;QACrH,OAAO,EAAE;YACP,WAAW;YACX,iBAAiB;YACjB,MAAM;YACN,OAAO;YACP,WAAW;YACX,UAAU;SACX;QACD,UAAU,EAAE;YACV,QAAQ;YACR,aAAa;YACb,MAAM;YACN,MAAM;YACN,QAAQ;YACR,eAAe;YACf,eAAe;SAChB;KACF;IACD,eAAe,EAAE;QACf,WAAW,EAAE,wCAAwC;QACrD,OAAO,EAAE;YACP,gBAAgB;YAChB,kBAAkB;YAClB,aAAa;YACb,cAAc;SACf;QACD,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC;KAChD;IACD,YAAY,EAAE;Q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C,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,EAAE;YACtE,QAAQ,CAAC,IAAI,CACX,0BAA0B,QAAQ,CAAC,IAAI,QAAQ,QAAQ,CAAC,IAAI,CAAC,WAAW,IAAI;gBAC1E,eAAe,QAAQ,CAAC,IAAI,CAAC,UAAU;qBACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;qBACtB,IAAI,CAAC,IAAI,CAAC,EAAE,CAClB,CAAC;SACH;QAED,gEAAgE;QAChE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC;aAC9C,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;aACrD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,QAAQ,CAAC,IAAI,CAAC,0CAA0C,OAAO,EAAE,CAAC,CAAC;QAEnE,uCAAuC;QACvC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,OAAO,EAAE;YACX,QAAQ,CAAC,IAAI,CACX,iBAAiB,IAAI,CAAC,IAAI,wCAAwC,OAAO,UAAU,CACpF,CAAC;SACH;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;iBAC5B;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { Menu, Transition } from "@headlessui/react";
|
|
2
|
-
import axios from "axios";
|
|
3
|
-
import Papa from "papaparse";
|
|
4
|
-
import React, { useEffect, useState } from "react";
|
|
5
|
-
import { Loading } from "../../display/loading";
|
|
6
|
-
import { Container } from "../../structure/container";
|
|
7
|
-
import { Query, Sort } from "../readQuery";
|
|
8
|
-
import { getSpaceData, getWorkspaceData } from "../stories";
|
|
9
|
-
import { blixifyDevCollection, blixifyDevWorkspace } from "../testData";
|
|
10
|
-
import { parseSpaceToDataStructure, parseWorkspaceSettings } from "../utils";
|
|
11
|
-
import { DataTemplateProps } from "./dataStateModel";
|
|
12
|
-
import { DataStructure } from "./model";
|
|
13
|
-
import SampleModule from "./SampleModule";
|
|
14
|
-
import { AdditionalQuery, ExtendedTabs, Space } from "./spaceModel";
|
|
15
|
-
import { Workspace } from "./workspaceModel";
|
|
16
|
-
|
|
17
|
-
const meta = { title: "Data/Data Module" };
|
|
18
|
-
export default meta;
|
|
19
|
-
|
|
20
|
-
export const DataModule = () => {
|
|
21
|
-
const [selectedSpace, setSelectedSpace] = useState<Space | null>(null);
|
|
22
|
-
const [selectedWorkspace, setSelectedWorkspace] = useState<Workspace | null>(
|
|
23
|
-
null,
|
|
24
|
-
);
|
|
25
|
-
const [mount, setMount] = useState<boolean>(false);
|
|
26
|
-
const [sort, setSort] = useState<Sort | undefined>({
|
|
27
|
-
sortId: "baseUpdatedAt",
|
|
28
|
-
type: "desc",
|
|
29
|
-
});
|
|
30
|
-
const [tabs, setTabs] = useState<ExtendedTabs[]>([]);
|
|
31
|
-
const [queries, setQueries] = useState<AdditionalQuery[]>([]);
|
|
32
|
-
|
|
33
|
-
//INFO : Change this to test for Blixify Space Sample
|
|
34
|
-
const [collectionParam] = useState(blixifyDevCollection);
|
|
35
|
-
const workspaceParam = blixifyDevWorkspace;
|
|
36
|
-
|
|
37
|
-
const [viewParam, setViewParam] = useState("general");
|
|
38
|
-
const [typeParam, setTypeParam] = useState("list");
|
|
39
|
-
const [dataParam, setDataParam] = useState(
|
|
40
|
-
"0f95e0b6-fcf7-4046-8395-06f2f271f56a",
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const getLocalUrl = "/dashboard/spaceD";
|
|
44
|
-
const isProd = true;
|
|
45
|
-
const queryAPI = isProd
|
|
46
|
-
? "https://space.blixify.co"
|
|
47
|
-
: "https://space-dev.blixify.co";
|
|
48
|
-
const storageUrl = "https://firebasestorage.googleapis.com/v0/b/";
|
|
49
|
-
|
|
50
|
-
const defaultAPIUrl = `${queryAPI}/api/spaceD`;
|
|
51
|
-
const defaultAssetAPI = `${storageUrl}${
|
|
52
|
-
isProd ? "blixify-space" : "blixify-space-dev"
|
|
53
|
-
}.appspot.com/o/`;
|
|
54
|
-
const defaultUploadAPI = `${queryAPI}/api/asset`;
|
|
55
|
-
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
setMount(false);
|
|
58
|
-
handleRetrieveData();
|
|
59
|
-
}, [collectionParam]);
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
try {
|
|
63
|
-
const mapAPIKey = "";
|
|
64
|
-
const mapScript = document.createElement("script");
|
|
65
|
-
mapScript.id = "googleMaps";
|
|
66
|
-
mapScript.type = "text/javascript";
|
|
67
|
-
mapScript.src = `https://maps.googleapis.com/maps/api/js?key=${mapAPIKey}&libraries=places,drawing,geometry`;
|
|
68
|
-
mapScript.async = true;
|
|
69
|
-
mapScript.defer = true;
|
|
70
|
-
const head = document.getElementsByTagName("head")[0];
|
|
71
|
-
if (head) {
|
|
72
|
-
head.appendChild(mapScript);
|
|
73
|
-
}
|
|
74
|
-
} catch (err) {}
|
|
75
|
-
}, []);
|
|
76
|
-
|
|
77
|
-
const handleNavigate = (
|
|
78
|
-
type: string,
|
|
79
|
-
selectedId?: string,
|
|
80
|
-
viewId?: string,
|
|
81
|
-
) => {
|
|
82
|
-
setTypeParam(type);
|
|
83
|
-
if (selectedId) setDataParam(selectedId);
|
|
84
|
-
if (viewId) setViewParam(viewId);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const handleRetrieveData = async () => {
|
|
88
|
-
if (collectionParam) {
|
|
89
|
-
const space: Space = await getSpaceData(collectionParam);
|
|
90
|
-
if (space) {
|
|
91
|
-
setSelectedSpace(space);
|
|
92
|
-
setTabs(space.extendedTabs ?? []);
|
|
93
|
-
setQueries(space.additionalQuery ?? []);
|
|
94
|
-
if (space?.sortBy?.sortId !== "") {
|
|
95
|
-
setSort(space.sortBy ?? undefined);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (workspaceParam) {
|
|
100
|
-
const workspace: any = await getWorkspaceData(workspaceParam);
|
|
101
|
-
if (workspace) {
|
|
102
|
-
setSelectedWorkspace(workspace);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
setMount(true);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
if (!mount) {
|
|
109
|
-
return <Loading />;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const renderDataTemplateProps = (selectedSpace: Space) => {
|
|
113
|
-
const title = selectedSpace?.name;
|
|
114
|
-
const description = selectedSpace?.description ?? "";
|
|
115
|
-
const schema: DataStructure[] = parseSpaceToDataStructure(selectedSpace);
|
|
116
|
-
|
|
117
|
-
let spaceAdditionalQuery: Query[] = [];
|
|
118
|
-
let defaultPrefillSettings: { key: string; value: string }[] = [];
|
|
119
|
-
|
|
120
|
-
const workspaceDeveloperSettings = parseWorkspaceSettings({
|
|
121
|
-
dbEndpoint: defaultAPIUrl,
|
|
122
|
-
imageEndpoint: defaultAssetAPI,
|
|
123
|
-
uploadEndpoint: defaultUploadAPI,
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
const dataTemplateProps: DataTemplateProps = {
|
|
127
|
-
title: title,
|
|
128
|
-
description: description,
|
|
129
|
-
type: typeParam,
|
|
130
|
-
id: dataParam,
|
|
131
|
-
collectionId: collectionParam,
|
|
132
|
-
model: schema,
|
|
133
|
-
localURLEndpoint: getLocalUrl,
|
|
134
|
-
space: selectedSpace,
|
|
135
|
-
limit: 10,
|
|
136
|
-
edit: {
|
|
137
|
-
allEditable: true,
|
|
138
|
-
deleteBtn: false,
|
|
139
|
-
listEditable: true,
|
|
140
|
-
enableUpdateDraft: true,
|
|
141
|
-
},
|
|
142
|
-
organise: {
|
|
143
|
-
sort: sort?.sortId ? sort : undefined,
|
|
144
|
-
additionalQuery: queries,
|
|
145
|
-
extendedTabs: tabs,
|
|
146
|
-
viewId: viewParam,
|
|
147
|
-
filterComponentNewRow: queries.length >= 4,
|
|
148
|
-
handleNavigate: handleNavigate,
|
|
149
|
-
},
|
|
150
|
-
lib: {
|
|
151
|
-
axios,
|
|
152
|
-
Transition,
|
|
153
|
-
Menu,
|
|
154
|
-
papaParser: Papa,
|
|
155
|
-
},
|
|
156
|
-
devSettings: {
|
|
157
|
-
...workspaceDeveloperSettings,
|
|
158
|
-
schemaEndpoint: "/api/data",
|
|
159
|
-
schemaEndpointToken: "",
|
|
160
|
-
maxFileSize: 1024,
|
|
161
|
-
organisationMembers: [],
|
|
162
|
-
currentUser: {
|
|
163
|
-
userEmail: "",
|
|
164
|
-
userName: "",
|
|
165
|
-
},
|
|
166
|
-
functionEndpoint: `https://asia-southeast1-blixify-space${
|
|
167
|
-
!isProd ? "-dev" : ""
|
|
168
|
-
}.cloudfunctions.net`,
|
|
169
|
-
},
|
|
170
|
-
bareSettings: {
|
|
171
|
-
bareListFilterQuery: spaceAdditionalQuery,
|
|
172
|
-
bareUpdatePrefill: () => {
|
|
173
|
-
return defaultPrefillSettings;
|
|
174
|
-
},
|
|
175
|
-
bareCSVExportSettings: true,
|
|
176
|
-
bareCSVImportSettings: true,
|
|
177
|
-
},
|
|
178
|
-
linkType: "next",
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
return dataTemplateProps;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
return (
|
|
185
|
-
<Container bgColor="bg-white">
|
|
186
|
-
{selectedSpace && selectedWorkspace && (
|
|
187
|
-
<SampleModule dataProps={renderDataTemplateProps(selectedSpace)} />
|
|
188
|
-
)}
|
|
189
|
-
</Container>
|
|
190
|
-
);
|
|
191
|
-
};
|