@peers-app/peers-ui 0.27.3 → 0.27.4
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/screens/network-viewer/network-viewer-ipc.d.ts +3 -1
- package/dist/screens/network-viewer/network-viewer-ipc.js +6 -0
- package/dist/screens/network-viewer/sync-recovery.js +103 -1
- package/dist/screens/variables/variable-details.js +2 -1
- package/dist/tabs-layout/network-status-indicator.js +26 -12
- package/dist/tabs-layout/use-network-status.d.ts +6 -1
- package/dist/tabs-layout/use-network-status.js +27 -4
- package/package.json +9 -3
- package/.claude/settings.local.json +0 -34
- package/.github/README.md +0 -52
- package/.github/workflows/delete-all-artifacts.yml +0 -49
- package/.github/workflows/publish.yml +0 -51
- package/babel.config.js +0 -7
- package/biome.json +0 -198
- package/dist/app-updates/app-updates-consumer.test.d.ts +0 -1
- package/dist/app-updates/app-updates-consumer.test.js +0 -56
- package/dist/app-updates/app-updates-settings.test.d.ts +0 -1
- package/dist/app-updates/app-updates-settings.test.js +0 -93
- package/dist/app-updates/remote-app-update-panel.test.d.ts +0 -1
- package/dist/app-updates/remote-app-update-panel.test.js +0 -165
- package/dist/components/access-level-field.test.d.ts +0 -1
- package/dist/components/access-level-field.test.js +0 -28
- package/dist/components/message-logs/tool-access-approval-card.test.d.ts +0 -1
- package/dist/components/message-logs/tool-access-approval-card.test.js +0 -102
- package/dist/components/responsive-section-nav.test.d.ts +0 -1
- package/dist/components/responsive-section-nav.test.js +0 -45
- package/dist/globals-hash.test.d.ts +0 -1
- package/dist/globals-hash.test.js +0 -16
- package/dist/hooks/use-observable-state.test.d.ts +0 -1
- package/dist/hooks/use-observable-state.test.js +0 -64
- package/dist/hooks/use-observable.test.d.ts +0 -1
- package/dist/hooks/use-observable.test.js +0 -191
- package/dist/hooks/use-rows.test.d.ts +0 -1
- package/dist/hooks/use-rows.test.js +0 -175
- package/dist/hooks/use-tool.test.d.ts +0 -1
- package/dist/hooks/use-tool.test.js +0 -190
- package/dist/host-shell/host-shell-consumer.test.d.ts +0 -1
- package/dist/host-shell/host-shell-consumer.test.js +0 -28
- package/dist/root-layout/root-layout-host.test.d.ts +0 -1
- package/dist/root-layout/root-layout-host.test.js +0 -86
- package/dist/screens/account/account-screen.test.d.ts +0 -1
- package/dist/screens/account/account-screen.test.js +0 -51
- package/dist/screens/assistants/assistant-config.test.d.ts +0 -1
- package/dist/screens/assistants/assistant-config.test.js +0 -57
- package/dist/screens/contacts/contact-list.test.d.ts +0 -1
- package/dist/screens/contacts/contact-list.test.js +0 -48
- package/dist/screens/device-pairing/device-pairing.test.d.ts +0 -1
- package/dist/screens/device-pairing/device-pairing.test.js +0 -119
- package/dist/screens/devices/devices-list.test.d.ts +0 -1
- package/dist/screens/devices/devices-list.test.js +0 -53
- package/dist/screens/groups/group-list.test.d.ts +0 -1
- package/dist/screens/groups/group-list.test.js +0 -38
- package/dist/screens/identity/identity-routes.test.d.ts +0 -1
- package/dist/screens/identity/identity-routes.test.js +0 -51
- package/dist/screens/identity/identity-screen.test.d.ts +0 -1
- package/dist/screens/identity/identity-screen.test.js +0 -103
- package/dist/screens/invites/accept-invite.test.d.ts +0 -1
- package/dist/screens/invites/accept-invite.test.js +0 -103
- package/dist/screens/invites/activity-view.test.d.ts +0 -1
- package/dist/screens/invites/activity-view.test.js +0 -108
- package/dist/screens/invites/invite-classify.test.d.ts +0 -1
- package/dist/screens/invites/invite-classify.test.js +0 -115
- package/dist/screens/network-viewer/network-viewer-ipc.test.d.ts +0 -1
- package/dist/screens/network-viewer/network-viewer-ipc.test.js +0 -61
- package/dist/screens/network-viewer/network-viewer.section.test.d.ts +0 -1
- package/dist/screens/network-viewer/network-viewer.section.test.js +0 -63
- package/dist/screens/network-viewer/sync-recovery.test.d.ts +0 -1
- package/dist/screens/network-viewer/sync-recovery.test.js +0 -104
- package/dist/screens/packages/package-helpers.test.d.ts +0 -1
- package/dist/screens/packages/package-helpers.test.js +0 -53
- package/dist/screens/packages/package-runtime-status.test.d.ts +0 -1
- package/dist/screens/packages/package-runtime-status.test.js +0 -50
- package/dist/screens/packages/packages-ipc.test.d.ts +0 -1
- package/dist/screens/packages/packages-ipc.test.js +0 -43
- package/dist/screens/settings/settings-page.test.d.ts +0 -1
- package/dist/screens/settings/settings-page.test.js +0 -19
- package/dist/screens/tools/tool-access-ipc.test.d.ts +0 -1
- package/dist/screens/tools/tool-access-ipc.test.js +0 -40
- package/dist/screens/tools/tool-catalog-ipc.test.d.ts +0 -1
- package/dist/screens/tools/tool-catalog-ipc.test.js +0 -52
- package/dist/tabs-layout/network-status-indicator.test.d.ts +0 -1
- package/dist/tabs-layout/network-status-indicator.test.js +0 -665
- package/dist/tabs-layout/tabs-state.test.d.ts +0 -1
- package/dist/tabs-layout/tabs-state.test.js +0 -110
- package/dist/tabs-layout/use-network-status.test.d.ts +0 -1
- package/dist/tabs-layout/use-network-status.test.js +0 -45
- package/dist/ui-router/ui-loader.test.d.ts +0 -1
- package/dist/ui-router/ui-loader.test.js +0 -91
- package/jest.config.js +0 -25
- package/release-guard.js +0 -10
- package/src/app-updates/app-update-controls.tsx +0 -73
- package/src/app-updates/app-updates-consumer.test.ts +0 -83
- package/src/app-updates/app-updates-consumer.ts +0 -121
- package/src/app-updates/app-updates-settings.test.tsx +0 -109
- package/src/app-updates/app-updates-settings.tsx +0 -136
- package/src/app-updates/remote-app-update-panel.test.tsx +0 -205
- package/src/app-updates/remote-app-update-panel.tsx +0 -210
- package/src/app-updates/use-app-update-status.ts +0 -16
- package/src/command-palette/command-palette-ui.tsx +0 -564
- package/src/command-palette/command-palette.ts +0 -242
- package/src/components/access-level-field.test.tsx +0 -32
- package/src/components/access-level-field.tsx +0 -68
- package/src/components/checkbox.tsx +0 -25
- package/src/components/group-switcher.tsx +0 -526
- package/src/components/input-date.tsx +0 -29
- package/src/components/input-number.tsx +0 -83
- package/src/components/input.tsx +0 -25
- package/src/components/inverse-lazy-list.tsx +0 -107
- package/src/components/io-schema-values.tsx +0 -103
- package/src/components/io-schema.tsx +0 -259
- package/src/components/lazy-list.tsx +0 -115
- package/src/components/list-screen.tsx +0 -126
- package/src/components/loading-indicator.tsx +0 -7
- package/src/components/markdown-editor/autolink-plugin.tsx +0 -29
- package/src/components/markdown-editor/editor-inline.tsx +0 -9
- package/src/components/markdown-editor/editor.tsx +0 -158
- package/src/components/markdown-editor/markdown-plugin.tsx +0 -202
- package/src/components/markdown-editor/mention-node.ts +0 -204
- package/src/components/markdown-editor/mentions-plugin.tsx +0 -354
- package/src/components/markdown-editor/move-line-plugin.tsx +0 -186
- package/src/components/markdown-editor/select-line-boundary-plugin.tsx +0 -95
- package/src/components/markdown-editor/theme.ts +0 -46
- package/src/components/markdown-editor/toolbar.tsx +0 -269
- package/src/components/markdown-with-mentions.tsx +0 -198
- package/src/components/message-logs/message-logs.tsx +0 -523
- package/src/components/message-logs/tool-access-approval-card.test.tsx +0 -127
- package/src/components/message-logs/tool-access-approval-card.tsx +0 -178
- package/src/components/messages/avatar.tsx +0 -171
- package/src/components/messages/channel-message-list.tsx +0 -189
- package/src/components/messages/channel-view.tsx +0 -92
- package/src/components/messages/message-compose.tsx +0 -192
- package/src/components/messages/message-display.tsx +0 -231
- package/src/components/messages/thread-message-list.tsx +0 -135
- package/src/components/qr-scanner.tsx +0 -180
- package/src/components/responsive-section-nav.test.tsx +0 -88
- package/src/components/responsive-section-nav.tsx +0 -92
- package/src/components/router.tsx +0 -175
- package/src/components/save-button.tsx +0 -134
- package/src/components/sortable-list.tsx +0 -130
- package/src/components/tabs.tsx +0 -76
- package/src/components/tooltip.tsx +0 -43
- package/src/components/trust-level-badge.tsx +0 -44
- package/src/components/trust-level-dropdown.tsx +0 -136
- package/src/components/typeahead.tsx +0 -357
- package/src/globals-hash.test.ts +0 -19
- package/src/globals.tsx +0 -226
- package/src/hooks/index.ts +0 -8
- package/src/hooks/use-host-contract.ts +0 -75
- package/src/hooks/use-observable-state.test.tsx +0 -101
- package/src/hooks/use-observable-state.ts +0 -29
- package/src/hooks/use-observable.test.tsx +0 -258
- package/src/hooks/use-observable.ts +0 -67
- package/src/hooks/use-on-screen.ts +0 -24
- package/src/hooks/use-promise.ts +0 -34
- package/src/hooks/use-rows.test.tsx +0 -196
- package/src/hooks/use-rows.ts +0 -120
- package/src/hooks/use-subscription.ts +0 -24
- package/src/hooks/use-tool.test.tsx +0 -225
- package/src/hooks/use-tool.ts +0 -116
- package/src/host-shell/host-shell-consumer.test.ts +0 -32
- package/src/host-shell/host-shell-consumer.ts +0 -53
- package/src/index.tsx +0 -42
- package/src/mention-configs.ts +0 -185
- package/src/operator-console/operator-console-state.ts +0 -119
- package/src/operator-console/operator-console.tsx +0 -233
- package/src/peers-services-registration.ts +0 -6
- package/src/root-layout/global-overlays.ts +0 -50
- package/src/root-layout/layout-picker.tsx +0 -47
- package/src/root-layout/layouts/full-screen-layout.tsx +0 -144
- package/src/root-layout/layouts/tabs-with-console-layout.tsx +0 -260
- package/src/root-layout/root-layout-host.test.tsx +0 -108
- package/src/root-layout/root-layout-host.tsx +0 -147
- package/src/root-layout/root-layout-registry.ts +0 -51
- package/src/root-layout/root-layout-state.ts +0 -55
- package/src/root-layout/root-layout.ts +0 -32
- package/src/screens/account/account-screen.test.tsx +0 -65
- package/src/screens/account/account-screen.tsx +0 -942
- package/src/screens/assistants/assistant-config.test.tsx +0 -54
- package/src/screens/assistants/assistant-config.tsx +0 -121
- package/src/screens/assistants/assistant-details.tsx +0 -89
- package/src/screens/assistants/assistant-info.tsx +0 -66
- package/src/screens/assistants/assistant-list.tsx +0 -145
- package/src/screens/assistants/assistant-tools.tsx +0 -82
- package/src/screens/console-logs/console-logs-list.tsx +0 -374
- package/src/screens/console-logs/log-display.tsx +0 -137
- package/src/screens/console-logs/log-filters.tsx +0 -64
- package/src/screens/console-logs/mobile-log-card.tsx +0 -161
- package/src/screens/console-logs/resizable-table-header.tsx +0 -110
- package/src/screens/contacts/contact-details.tsx +0 -123
- package/src/screens/contacts/contact-list.test.tsx +0 -59
- package/src/screens/contacts/contact-list.tsx +0 -286
- package/src/screens/contacts/index.ts +0 -2
- package/src/screens/data-explorer/data-explorer.tsx +0 -633
- package/src/screens/data-explorer/index.ts +0 -6
- package/src/screens/data-explorer/query-executor.tsx +0 -520
- package/src/screens/device-pairing/device-pairing.test.tsx +0 -143
- package/src/screens/device-pairing/device-pairing.tsx +0 -461
- package/src/screens/device-pairing/identity-ipc.ts +0 -25
- package/src/screens/device-pairing/index.ts +0 -2
- package/src/screens/device-pairing/use-device-pairing-state.ts +0 -15
- package/src/screens/devices/devices-list.test.tsx +0 -68
- package/src/screens/devices/devices-list.tsx +0 -365
- package/src/screens/devices/index.ts +0 -1
- package/src/screens/groups/group-details.tsx +0 -160
- package/src/screens/groups/group-invite-panel.tsx +0 -311
- package/src/screens/groups/group-list.test.tsx +0 -44
- package/src/screens/groups/group-list.tsx +0 -317
- package/src/screens/groups/group-members.tsx +0 -343
- package/src/screens/groups/index.ts +0 -3
- package/src/screens/identity/identity-routes.test.ts +0 -70
- package/src/screens/identity/identity-routes.ts +0 -301
- package/src/screens/identity/identity-screen.test.tsx +0 -138
- package/src/screens/identity/identity-screen.tsx +0 -282
- package/src/screens/identity/index.ts +0 -2
- package/src/screens/identity/invite-contact-panel.tsx +0 -45
- package/src/screens/identity/profile-invite.tsx +0 -93
- package/src/screens/invites/accept-invite.test.tsx +0 -115
- package/src/screens/invites/accept-invite.tsx +0 -318
- package/src/screens/invites/activity-view.test.tsx +0 -127
- package/src/screens/invites/activity-view.tsx +0 -162
- package/src/screens/invites/index.ts +0 -6
- package/src/screens/invites/invite-capture.ts +0 -104
- package/src/screens/invites/invite-classify.test.ts +0 -129
- package/src/screens/invites/invite-share.tsx +0 -104
- package/src/screens/invites/invites-ipc.ts +0 -25
- package/src/screens/invites/pending-invites-list.tsx +0 -256
- package/src/screens/network-viewer/connection-troubleshooter.tsx +0 -395
- package/src/screens/network-viewer/cpu-usage-graph.tsx +0 -294
- package/src/screens/network-viewer/device-details-modal.tsx +0 -339
- package/src/screens/network-viewer/group-details-modal.tsx +0 -421
- package/src/screens/network-viewer/index.ts +0 -8
- package/src/screens/network-viewer/network-viewer-ipc.test.ts +0 -72
- package/src/screens/network-viewer/network-viewer-ipc.ts +0 -39
- package/src/screens/network-viewer/network-viewer-section.ts +0 -12
- package/src/screens/network-viewer/network-viewer.section.test.tsx +0 -68
- package/src/screens/network-viewer/network-viewer.tsx +0 -708
- package/src/screens/network-viewer/remote-logs-panel.tsx +0 -190
- package/src/screens/network-viewer/sync-recovery.test.tsx +0 -114
- package/src/screens/network-viewer/sync-recovery.tsx +0 -461
- package/src/screens/network-viewer/usage-graph.tsx +0 -455
- package/src/screens/packages/local-folder-grants-panel.tsx +0 -290
- package/src/screens/packages/local-folders-ipc.ts +0 -28
- package/src/screens/packages/package-details.tsx +0 -166
- package/src/screens/packages/package-helpers.test.ts +0 -57
- package/src/screens/packages/package-helpers.ts +0 -137
- package/src/screens/packages/package-info.tsx +0 -354
- package/src/screens/packages/package-list.tsx +0 -519
- package/src/screens/packages/package-network-panel.tsx +0 -82
- package/src/screens/packages/package-new-local.tsx +0 -100
- package/src/screens/packages/package-runtime-status.test.tsx +0 -58
- package/src/screens/packages/package-runtime-status.tsx +0 -68
- package/src/screens/packages/package-versions.tsx +0 -298
- package/src/screens/packages/packages-ipc.test.ts +0 -47
- package/src/screens/packages/packages-ipc.ts +0 -125
- package/src/screens/peer-types/peer-type-details.tsx +0 -172
- package/src/screens/peer-types/peer-type-list.tsx +0 -64
- package/src/screens/search/global-search.tsx +0 -406
- package/src/screens/settings/color-mode-dropdown.tsx +0 -82
- package/src/screens/settings/settings-page.test.tsx +0 -24
- package/src/screens/settings/settings-page.tsx +0 -426
- package/src/screens/setup-user.tsx +0 -355
- package/src/screens/tools/tool-access-ipc.test.ts +0 -55
- package/src/screens/tools/tool-access-ipc.ts +0 -27
- package/src/screens/tools/tool-catalog-ipc.test.ts +0 -52
- package/src/screens/tools/tool-catalog-ipc.ts +0 -51
- package/src/screens/tools/tool-details.tsx +0 -52
- package/src/screens/tools/tool-info.tsx +0 -45
- package/src/screens/tools/tool-list.tsx +0 -106
- package/src/screens/tools/tool-schema.tsx +0 -44
- package/src/screens/tools/tool-test-details.tsx +0 -89
- package/src/screens/tools/tool-test-list.tsx +0 -73
- package/src/screens/variables/variable-details.tsx +0 -289
- package/src/screens/variables/variable-list.tsx +0 -110
- package/src/screens/welcome-modal.tsx +0 -294
- package/src/screens/workflows/workflow-details.tsx +0 -115
- package/src/screens/workflows/workflow-info.tsx +0 -22
- package/src/screens/workflows/workflow-instructions.tsx +0 -134
- package/src/screens/workflows/workflow-list.tsx +0 -117
- package/src/setupTests.ts +0 -38
- package/src/system-apps/assistants.app.ts +0 -7
- package/src/system-apps/console-logs.app.ts +0 -7
- package/src/system-apps/data-explorer.app.ts +0 -8
- package/src/system-apps/identity.app.ts +0 -9
- package/src/system-apps/index.ts +0 -77
- package/src/system-apps/mobile-settings.app.ts +0 -7
- package/src/system-apps/network-viewer.app.ts +0 -8
- package/src/system-apps/packages.app.ts +0 -7
- package/src/system-apps/search.app.ts +0 -8
- package/src/system-apps/settings.app.ts +0 -7
- package/src/system-apps/threads.app.ts +0 -7
- package/src/system-apps/tools.app.ts +0 -7
- package/src/system-apps/types.app.ts +0 -7
- package/src/system-apps/variables.app.ts +0 -7
- package/src/system-apps/workflows.app.ts +0 -7
- package/src/tabs-layout/network-status-indicator.test.tsx +0 -799
- package/src/tabs-layout/network-status-indicator.tsx +0 -756
- package/src/tabs-layout/tabs-layout.tsx +0 -857
- package/src/tabs-layout/tabs-state.test.ts +0 -152
- package/src/tabs-layout/tabs-state.ts +0 -587
- package/src/tabs-layout/use-network-status.test.tsx +0 -58
- package/src/tabs-layout/use-network-status.ts +0 -68
- package/src/ui-defaults/index.ts +0 -2
- package/src/ui-defaults/list-screen.tsx +0 -94
- package/src/ui-defaults/markdown-field.tsx +0 -87
- package/src/ui-router/routes-loader.ts +0 -193
- package/src/ui-router/ui-loader.test.tsx +0 -108
- package/src/ui-router/ui-loader.tsx +0 -606
- package/src/utils.ts +0 -95
- package/tsconfig.json +0 -18
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type IDoc,
|
|
3
|
-
type IOSchema,
|
|
4
|
-
type IPeerType,
|
|
5
|
-
type Observable,
|
|
6
|
-
PeerTypes,
|
|
7
|
-
} from "@peers-app/peers-sdk";
|
|
8
|
-
import { useEffect } from "react";
|
|
9
|
-
import { Input } from "../../components/input";
|
|
10
|
-
import { IOSchemaEditor } from "../../components/io-schema";
|
|
11
|
-
import { LoadingIndicator } from "../../components/loading-indicator";
|
|
12
|
-
import { MarkdownEditorInline } from "../../components/markdown-editor/editor-inline";
|
|
13
|
-
import { SaveButton } from "../../components/save-button";
|
|
14
|
-
import { ScreenTabBody, Tabs } from "../../components/tabs";
|
|
15
|
-
import { Tooltip } from "../../components/tooltip";
|
|
16
|
-
import { useObservable, usePromise } from "../../hooks";
|
|
17
|
-
import { updateActiveTabTitle } from "../../tabs-layout/tabs-state";
|
|
18
|
-
|
|
19
|
-
interface IProps {
|
|
20
|
-
peerTypeId: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const PeerTypeDetails = (props: IProps) => {
|
|
24
|
-
const valueType = usePromise(
|
|
25
|
-
async () => {
|
|
26
|
-
const valueType = await PeerTypes().get(props.peerTypeId);
|
|
27
|
-
if (!valueType) {
|
|
28
|
-
throw new Error("Variable not found");
|
|
29
|
-
}
|
|
30
|
-
const doc = PeerTypes().initDoc(valueType);
|
|
31
|
-
updateActiveTabTitle(doc.name || "Type");
|
|
32
|
-
return doc;
|
|
33
|
-
},
|
|
34
|
-
undefined,
|
|
35
|
-
[props.peerTypeId],
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (!valueType) return;
|
|
40
|
-
const sub = valueType.qs.name.subscribe(() => {
|
|
41
|
-
valueType.name = valueType.qs
|
|
42
|
-
.name()
|
|
43
|
-
.replaceAll(/\s/g, "_")
|
|
44
|
-
.replaceAll(/[^a-zA-Z0-9_-]/g, "");
|
|
45
|
-
});
|
|
46
|
-
return () => {
|
|
47
|
-
sub.dispose();
|
|
48
|
-
};
|
|
49
|
-
}, [valueType]);
|
|
50
|
-
|
|
51
|
-
if (!valueType) {
|
|
52
|
-
return <LoadingIndicator />;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div className="container-fluid p-3">
|
|
57
|
-
<div className="d-flex">
|
|
58
|
-
<div>
|
|
59
|
-
<h4>
|
|
60
|
-
<i className="bi bi-code-square me-2"></i>
|
|
61
|
-
</h4>
|
|
62
|
-
</div>
|
|
63
|
-
<div className="flex-grow-1">
|
|
64
|
-
<h4>
|
|
65
|
-
<Input
|
|
66
|
-
key={valueType.peerTypeId}
|
|
67
|
-
className="border border-0"
|
|
68
|
-
style={{ width: "100%", outline: "none", backgroundColor: "transparent" }}
|
|
69
|
-
value={valueType.qs.name}
|
|
70
|
-
/>
|
|
71
|
-
</h4>
|
|
72
|
-
</div>
|
|
73
|
-
<div>
|
|
74
|
-
<SaveButton key={valueType.peerTypeId} doc={valueType} />
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<Tabs
|
|
79
|
-
key={valueType.peerTypeId}
|
|
80
|
-
tabs={[
|
|
81
|
-
{
|
|
82
|
-
name: "Info",
|
|
83
|
-
content: (
|
|
84
|
-
<ScreenTabBody>
|
|
85
|
-
<VariableInfo valueType={valueType} />
|
|
86
|
-
</ScreenTabBody>
|
|
87
|
-
),
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: "Schema",
|
|
91
|
-
content: (
|
|
92
|
-
<ScreenTabBody>
|
|
93
|
-
<VariableSchema valueType={valueType} />
|
|
94
|
-
</ScreenTabBody>
|
|
95
|
-
),
|
|
96
|
-
},
|
|
97
|
-
]}
|
|
98
|
-
/>
|
|
99
|
-
</div>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const VariableInfo = (props: { valueType: IDoc<IPeerType> }) => {
|
|
104
|
-
const { valueType } = props;
|
|
105
|
-
|
|
106
|
-
valueType.description = valueType.description || "";
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
<div>
|
|
110
|
-
<small className="text-body-secondary">Name:</small>
|
|
111
|
-
<Input
|
|
112
|
-
value={valueType.qs.name}
|
|
113
|
-
className="form-control mb-3 p-0 ps-2"
|
|
114
|
-
placeholder="Variable name"
|
|
115
|
-
title="Variable name"
|
|
116
|
-
/>
|
|
117
|
-
|
|
118
|
-
<small className="text-body-secondary">
|
|
119
|
-
Icon Class:
|
|
120
|
-
<small>
|
|
121
|
-
<Tooltip
|
|
122
|
-
markdownContent={[
|
|
123
|
-
"Icon classes can be found at:",
|
|
124
|
-
"[Bootstrap Icons](https://icons.getbootstrap.com/)",
|
|
125
|
-
].join(" ")}
|
|
126
|
-
/>
|
|
127
|
-
</small>
|
|
128
|
-
</small>
|
|
129
|
-
<IconPicker icon={valueType.qs.iconClass} />
|
|
130
|
-
|
|
131
|
-
<small className="mt-2 text-body-secondary">Description:</small>
|
|
132
|
-
<MarkdownEditorInline value={valueType.qs.description as Observable<string>} />
|
|
133
|
-
</div>
|
|
134
|
-
);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const VariableSchema = (props: { valueType: IDoc<IPeerType> }) => {
|
|
138
|
-
const { valueType } = props;
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<div>
|
|
142
|
-
<IOSchemaEditor
|
|
143
|
-
ioSchema={valueType.qs.schema as Observable<IOSchema>}
|
|
144
|
-
simpleValueName="value"
|
|
145
|
-
/>
|
|
146
|
-
</div>
|
|
147
|
-
);
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export const IconPicker = (props: { icon: Observable<string | undefined> }) => {
|
|
151
|
-
const { icon } = props;
|
|
152
|
-
|
|
153
|
-
useObservable(icon);
|
|
154
|
-
|
|
155
|
-
if (icon() === undefined) {
|
|
156
|
-
icon("");
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
<div className="d-flex">
|
|
161
|
-
<Input
|
|
162
|
-
value={icon}
|
|
163
|
-
className="form-control mb-3 p-0 ps-2"
|
|
164
|
-
placeholder="icon class"
|
|
165
|
-
title="Icon"
|
|
166
|
-
/>
|
|
167
|
-
<div className="me-2 ms-2" style={{ width: "22px" }}>
|
|
168
|
-
<i className={icon()}></i>
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
);
|
|
172
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { IOSchemaType, type IPeerType, newid, PeerTypes } from "@peers-app/peers-sdk";
|
|
2
|
-
import { ListScreen } from "../../components/list-screen";
|
|
3
|
-
import { MarkdownWithMentions } from "../../components/markdown-with-mentions";
|
|
4
|
-
import { mainContentPath } from "../../globals";
|
|
5
|
-
import { registerInternalPeersUI } from "../../ui-router/ui-loader";
|
|
6
|
-
|
|
7
|
-
export function PeerTypeLists() {
|
|
8
|
-
async function newRecord(name: string) {
|
|
9
|
-
const peerTypeName = name.replace(/\s+/g, "_");
|
|
10
|
-
let valueType = await PeerTypes().insert({
|
|
11
|
-
peerTypeId: newid(),
|
|
12
|
-
name: peerTypeName,
|
|
13
|
-
description: "",
|
|
14
|
-
schema: {
|
|
15
|
-
type: IOSchemaType.none,
|
|
16
|
-
fields: [],
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
valueType = await PeerTypes().save(valueType);
|
|
20
|
-
mainContentPath(`peer-types/${valueType.peerTypeId}`);
|
|
21
|
-
return valueType;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function getFilter(searchText: string) {
|
|
25
|
-
return {
|
|
26
|
-
$or: [{ name: { $matchWords: searchText } }, { description: { $matchWords: searchText } }],
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function renderItem(item: IPeerType) {
|
|
31
|
-
return (
|
|
32
|
-
<div key={item.peerTypeId} className="container-fluid pb-4">
|
|
33
|
-
<i className={item.iconClass ?? "bi bi-code-square"}></i>
|
|
34
|
-
<a href={`#peer-types/${item.peerTypeId}`}>{item.name || "<empty-name>"}</a>
|
|
35
|
-
<div style={{ paddingLeft: "20px" }}>
|
|
36
|
-
<MarkdownWithMentions content={item.description || ""} />
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<ListScreen
|
|
44
|
-
table={PeerTypes()}
|
|
45
|
-
newRecord={newRecord}
|
|
46
|
-
getFilter={getFilter}
|
|
47
|
-
sortBy={["name"]}
|
|
48
|
-
renderItem={renderItem}
|
|
49
|
-
placeholderName="value type"
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
registerInternalPeersUI({
|
|
55
|
-
peersUIId: "00m5fshz2g6ea23v8z6y0a1cj",
|
|
56
|
-
component: PeerTypeLists,
|
|
57
|
-
routes: [
|
|
58
|
-
{
|
|
59
|
-
isMatch: (_props, context) => context.path === "peer-types",
|
|
60
|
-
uiCategory: "screen",
|
|
61
|
-
priority: 2,
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
});
|
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
import type { IAppNav, IMentionData } from "@peers-app/peers-sdk";
|
|
2
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { useObservable } from "../../hooks";
|
|
4
|
-
import {
|
|
5
|
-
assistantMentionConfig,
|
|
6
|
-
type IMentionConfig,
|
|
7
|
-
toolMentionConfig,
|
|
8
|
-
userMentionConfig,
|
|
9
|
-
valueTypeMentionConfig,
|
|
10
|
-
workflowMentionConfig,
|
|
11
|
-
} from "../../mention-configs";
|
|
12
|
-
import { systemPackage } from "../../system-apps";
|
|
13
|
-
import { goToTabPath } from "../../tabs-layout/tabs-state";
|
|
14
|
-
import { allPackages } from "../../ui-router/routes-loader";
|
|
15
|
-
import { colorMode } from "../settings/color-mode-dropdown";
|
|
16
|
-
|
|
17
|
-
interface SearchResult {
|
|
18
|
-
config: IMentionConfig;
|
|
19
|
-
items: IMentionData[];
|
|
20
|
-
category: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface AppSearchItem {
|
|
24
|
-
packageId: string;
|
|
25
|
-
packageName: string;
|
|
26
|
-
navItem: IAppNav;
|
|
27
|
-
path: string;
|
|
28
|
-
name: string;
|
|
29
|
-
displayName: string;
|
|
30
|
-
iconClassName: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const searchConfigs: Array<{
|
|
34
|
-
config: IMentionConfig;
|
|
35
|
-
category: string;
|
|
36
|
-
navigationPath: string;
|
|
37
|
-
}> = [
|
|
38
|
-
{ config: toolMentionConfig, category: "Tools", navigationPath: "tools" },
|
|
39
|
-
{ config: assistantMentionConfig, category: "Assistants", navigationPath: "assistants" },
|
|
40
|
-
{ config: workflowMentionConfig, category: "Workflows", navigationPath: "workflows" },
|
|
41
|
-
{ config: valueTypeMentionConfig, category: "Types", navigationPath: "peer-types" },
|
|
42
|
-
{ config: userMentionConfig, category: "People", navigationPath: "identity/people" },
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
/** Search system apps and known entities, then navigate to their canonical routes. */
|
|
46
|
-
export function GlobalSearch() {
|
|
47
|
-
const [_colorMode] = useObservable(colorMode);
|
|
48
|
-
const [packages] = useObservable(allPackages);
|
|
49
|
-
const [searchQuery, setSearchQuery] = useState("");
|
|
50
|
-
const [searchResults, setSearchResults] = useState<SearchResult[]>([]);
|
|
51
|
-
const [appResults, setAppResults] = useState<AppSearchItem[]>([]);
|
|
52
|
-
const [isSearching, setIsSearching] = useState(false);
|
|
53
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
|
54
|
-
|
|
55
|
-
const isDark = _colorMode === "dark";
|
|
56
|
-
|
|
57
|
-
// Focus search input on mount
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (inputRef.current) {
|
|
60
|
-
inputRef.current.focus();
|
|
61
|
-
}
|
|
62
|
-
}, []);
|
|
63
|
-
|
|
64
|
-
// Get all apps (system and user)
|
|
65
|
-
const getAllApps = useCallback((): AppSearchItem[] => {
|
|
66
|
-
const allPackages_ = [...packages, systemPackage];
|
|
67
|
-
return allPackages_
|
|
68
|
-
.filter((p) => !p.disabled && p.appNavs && p.appNavs.length > 0)
|
|
69
|
-
.flatMap((pkg) => {
|
|
70
|
-
const navs = pkg.appNavs;
|
|
71
|
-
if (!navs?.length) return [];
|
|
72
|
-
return navs.map((navItem) => {
|
|
73
|
-
// Construct path - use direct path for system apps, package-nav for others
|
|
74
|
-
let path: string;
|
|
75
|
-
if (pkg.packageId === "system-apps") {
|
|
76
|
-
path = navItem.navigationPath ?? navItem.name.replace(/\s/g, "-").toLowerCase();
|
|
77
|
-
} else {
|
|
78
|
-
path = `package-nav/${pkg.packageId}/${(navItem.navigationPath ?? navItem.name).replace(/[^a-zA-Z0-9]/g, "-").toLowerCase()}`;
|
|
79
|
-
while (path.includes("//")) {
|
|
80
|
-
path = path.replace("//", "/");
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
packageId: pkg.packageId,
|
|
86
|
-
packageName: pkg.name,
|
|
87
|
-
navItem,
|
|
88
|
-
path,
|
|
89
|
-
name: navItem.name,
|
|
90
|
-
displayName: navItem.displayName || navItem.name,
|
|
91
|
-
iconClassName: navItem.iconClassName || "bi-box-seam",
|
|
92
|
-
};
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
}, [packages]);
|
|
96
|
-
|
|
97
|
-
// Debounced search effect
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
if (!searchQuery.trim()) {
|
|
100
|
-
setSearchResults([]);
|
|
101
|
-
setAppResults([]);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const timeoutId = setTimeout(async () => {
|
|
106
|
-
setIsSearching(true);
|
|
107
|
-
try {
|
|
108
|
-
// Search all entity types in parallel
|
|
109
|
-
const searchPromises = searchConfigs.map(async ({ config, category }) => {
|
|
110
|
-
try {
|
|
111
|
-
const items = await config.query(searchQuery);
|
|
112
|
-
if (items.length > 0) {
|
|
113
|
-
return { config, items, category };
|
|
114
|
-
}
|
|
115
|
-
return null;
|
|
116
|
-
} catch (error) {
|
|
117
|
-
console.warn(`Search failed for ${category}:`, error);
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
const searchResults = await Promise.all(searchPromises);
|
|
123
|
-
const filteredResults = searchResults.filter(Boolean) as SearchResult[];
|
|
124
|
-
|
|
125
|
-
setSearchResults(filteredResults);
|
|
126
|
-
|
|
127
|
-
// Search apps
|
|
128
|
-
const allApps = getAllApps();
|
|
129
|
-
const lowerQuery = searchQuery.toLowerCase();
|
|
130
|
-
const filteredApps = allApps.filter(
|
|
131
|
-
(app) =>
|
|
132
|
-
app.name.toLowerCase().includes(lowerQuery) ||
|
|
133
|
-
app.displayName.toLowerCase().includes(lowerQuery) ||
|
|
134
|
-
app.packageName.toLowerCase().includes(lowerQuery),
|
|
135
|
-
);
|
|
136
|
-
setAppResults(filteredApps);
|
|
137
|
-
} finally {
|
|
138
|
-
setIsSearching(false);
|
|
139
|
-
}
|
|
140
|
-
}, 300); // 300ms debounce
|
|
141
|
-
|
|
142
|
-
return () => clearTimeout(timeoutId);
|
|
143
|
-
}, [searchQuery, getAllApps]);
|
|
144
|
-
|
|
145
|
-
const handleItemClick = (result: SearchResult, item: IMentionData) => {
|
|
146
|
-
// Try using the config's onClick first
|
|
147
|
-
if (result.config.onClick) {
|
|
148
|
-
result.config.onClick(item);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Detail route under the same system app as list (e.g. tools/:id, contacts/:userId).
|
|
153
|
-
const configPath = searchConfigs.find((c) => c.config === result.config)?.navigationPath;
|
|
154
|
-
if (configPath) {
|
|
155
|
-
goToTabPath(`${configPath}/${item.id}`);
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const handleAppClick = (app: AppSearchItem) => {
|
|
160
|
-
goToTabPath(app.path);
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
const totalResults =
|
|
164
|
-
searchResults.reduce((sum, result) => sum + result.items.length, 0) + appResults.length;
|
|
165
|
-
|
|
166
|
-
return (
|
|
167
|
-
<div className="container-fluid h-100 p-4" style={{ maxHeight: "100vh", overflowY: "auto" }}>
|
|
168
|
-
{/* Search Header */}
|
|
169
|
-
<div className="mb-4">
|
|
170
|
-
<h1 className="h3 mb-3 d-flex align-items-center">
|
|
171
|
-
<i className="bi-search me-3" />
|
|
172
|
-
Search Everything
|
|
173
|
-
</h1>
|
|
174
|
-
|
|
175
|
-
{/* Search Input */}
|
|
176
|
-
<div className="position-relative">
|
|
177
|
-
<i
|
|
178
|
-
className="bi-search position-absolute"
|
|
179
|
-
style={{
|
|
180
|
-
left: "16px",
|
|
181
|
-
top: "50%",
|
|
182
|
-
transform: "translateY(-50%)",
|
|
183
|
-
color: "#6c757d",
|
|
184
|
-
zIndex: 1,
|
|
185
|
-
fontSize: "18px",
|
|
186
|
-
}}
|
|
187
|
-
/>
|
|
188
|
-
<input
|
|
189
|
-
ref={inputRef}
|
|
190
|
-
type="text"
|
|
191
|
-
className={`form-control form-control-lg ${isDark ? "bg-dark text-light border-secondary" : ""}`}
|
|
192
|
-
placeholder="Search across apps, tools, assistants, workflows, and more..."
|
|
193
|
-
value={searchQuery}
|
|
194
|
-
onChange={(e) => setSearchQuery(e.target.value)}
|
|
195
|
-
style={{
|
|
196
|
-
paddingLeft: "50px",
|
|
197
|
-
fontSize: "18px",
|
|
198
|
-
borderRadius: "12px",
|
|
199
|
-
backgroundColor: isDark ? "#343a40" : "#f8f9fa",
|
|
200
|
-
border: isDark ? "2px solid #495057" : "2px solid #dee2e6",
|
|
201
|
-
}}
|
|
202
|
-
/>
|
|
203
|
-
{isSearching && (
|
|
204
|
-
<div
|
|
205
|
-
className="position-absolute"
|
|
206
|
-
style={{
|
|
207
|
-
right: "16px",
|
|
208
|
-
top: "50%",
|
|
209
|
-
transform: "translateY(-50%)",
|
|
210
|
-
}}
|
|
211
|
-
>
|
|
212
|
-
<div className="spinner-border spinner-border-sm text-muted" />
|
|
213
|
-
</div>
|
|
214
|
-
)}
|
|
215
|
-
</div>
|
|
216
|
-
|
|
217
|
-
{/* Search Stats */}
|
|
218
|
-
{searchQuery && (
|
|
219
|
-
<div className="mt-3 text-muted small">
|
|
220
|
-
{isSearching
|
|
221
|
-
? "Searching..."
|
|
222
|
-
: totalResults > 0
|
|
223
|
-
? `Found ${totalResults} result${totalResults !== 1 ? "s" : ""}`
|
|
224
|
-
: searchQuery.trim()
|
|
225
|
-
? "No results found"
|
|
226
|
-
: null}
|
|
227
|
-
</div>
|
|
228
|
-
)}
|
|
229
|
-
</div>
|
|
230
|
-
|
|
231
|
-
{/* Search Results */}
|
|
232
|
-
{searchQuery && !isSearching && (
|
|
233
|
-
<div>
|
|
234
|
-
{searchResults.length === 0 && appResults.length === 0 ? (
|
|
235
|
-
<div className="text-center py-5">
|
|
236
|
-
<i className="bi-search mb-3 d-block text-muted" style={{ fontSize: "48px" }} />
|
|
237
|
-
<h4 className="text-muted">No results found</h4>
|
|
238
|
-
<p className="text-muted">Try different keywords or check your spelling</p>
|
|
239
|
-
</div>
|
|
240
|
-
) : (
|
|
241
|
-
<div>
|
|
242
|
-
{/* Apps Section */}
|
|
243
|
-
{appResults.length > 0 && (
|
|
244
|
-
<div className="mb-5">
|
|
245
|
-
<div className="d-flex align-items-center mb-3">
|
|
246
|
-
<i
|
|
247
|
-
className="bi-grid-3x3-gap me-3"
|
|
248
|
-
style={{ fontSize: "20px", color: "#6c757d" }}
|
|
249
|
-
/>
|
|
250
|
-
<h4 className="mb-0 me-3">Apps</h4>
|
|
251
|
-
<span className="badge bg-secondary">{appResults.length}</span>
|
|
252
|
-
</div>
|
|
253
|
-
<div className="row g-3">
|
|
254
|
-
{appResults.map((app) => (
|
|
255
|
-
<div
|
|
256
|
-
key={`${app.packageId}-${app.path}`}
|
|
257
|
-
className="col-12 col-md-6 col-lg-4"
|
|
258
|
-
>
|
|
259
|
-
<div
|
|
260
|
-
className={`card h-100 ${isDark ? "bg-dark border-secondary" : "bg-light"}`}
|
|
261
|
-
style={{
|
|
262
|
-
cursor: "pointer",
|
|
263
|
-
transition: "all 0.15s ease",
|
|
264
|
-
borderRadius: "8px",
|
|
265
|
-
}}
|
|
266
|
-
onClick={() => handleAppClick(app)}
|
|
267
|
-
onMouseEnter={(e) => {
|
|
268
|
-
e.currentTarget.style.transform = "translateY(-2px)";
|
|
269
|
-
e.currentTarget.style.boxShadow = isDark
|
|
270
|
-
? "0 4px 12px rgba(0,0,0,0.3)"
|
|
271
|
-
: "0 4px 12px rgba(0,0,0,0.1)";
|
|
272
|
-
}}
|
|
273
|
-
onMouseLeave={(e) => {
|
|
274
|
-
e.currentTarget.style.transform = "translateY(0)";
|
|
275
|
-
e.currentTarget.style.boxShadow = "none";
|
|
276
|
-
}}
|
|
277
|
-
>
|
|
278
|
-
<div className="card-body p-3">
|
|
279
|
-
<div className="d-flex align-items-start">
|
|
280
|
-
<i
|
|
281
|
-
className={`${app.iconClassName} me-3 mt-1`}
|
|
282
|
-
style={{
|
|
283
|
-
fontSize: "16px",
|
|
284
|
-
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
285
|
-
minWidth: "16px",
|
|
286
|
-
}}
|
|
287
|
-
/>
|
|
288
|
-
<div className="flex-grow-1">
|
|
289
|
-
<h6 className="card-title mb-1 fw-medium">{app.displayName}</h6>
|
|
290
|
-
<small
|
|
291
|
-
className="text-muted text-uppercase"
|
|
292
|
-
style={{ fontSize: "11px", letterSpacing: "0.5px" }}
|
|
293
|
-
>
|
|
294
|
-
{app.packageId === "system-apps" ? "System App" : app.packageName}
|
|
295
|
-
</small>
|
|
296
|
-
</div>
|
|
297
|
-
<i
|
|
298
|
-
className="bi-arrow-right text-muted"
|
|
299
|
-
style={{ fontSize: "12px" }}
|
|
300
|
-
/>
|
|
301
|
-
</div>
|
|
302
|
-
</div>
|
|
303
|
-
</div>
|
|
304
|
-
</div>
|
|
305
|
-
))}
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
)}
|
|
309
|
-
|
|
310
|
-
{/* Entity Results */}
|
|
311
|
-
{searchResults.map((result) => (
|
|
312
|
-
<div key={result.category} className="mb-5">
|
|
313
|
-
{/* Category Header */}
|
|
314
|
-
<div className="d-flex align-items-center mb-3">
|
|
315
|
-
<i
|
|
316
|
-
className={`${result.config.iconClass} me-3`}
|
|
317
|
-
style={{ fontSize: "20px", color: "#6c757d" }}
|
|
318
|
-
/>
|
|
319
|
-
<h4 className="mb-0 me-3">{result.category}</h4>
|
|
320
|
-
<span className="badge bg-secondary">{result.items.length}</span>
|
|
321
|
-
</div>
|
|
322
|
-
|
|
323
|
-
{/* Items */}
|
|
324
|
-
<div className="row g-3">
|
|
325
|
-
{result.items.map((item) => (
|
|
326
|
-
<div key={item.id} className="col-12 col-md-6 col-lg-4">
|
|
327
|
-
<div
|
|
328
|
-
className={`card h-100 ${isDark ? "bg-dark border-secondary" : "bg-light"}`}
|
|
329
|
-
style={{
|
|
330
|
-
cursor: "pointer",
|
|
331
|
-
transition: "all 0.15s ease",
|
|
332
|
-
borderRadius: "8px",
|
|
333
|
-
}}
|
|
334
|
-
onClick={() => handleItemClick(result, item)}
|
|
335
|
-
onMouseEnter={(e) => {
|
|
336
|
-
e.currentTarget.style.transform = "translateY(-2px)";
|
|
337
|
-
e.currentTarget.style.boxShadow = isDark
|
|
338
|
-
? "0 4px 12px rgba(0,0,0,0.3)"
|
|
339
|
-
: "0 4px 12px rgba(0,0,0,0.1)";
|
|
340
|
-
}}
|
|
341
|
-
onMouseLeave={(e) => {
|
|
342
|
-
e.currentTarget.style.transform = "translateY(0)";
|
|
343
|
-
e.currentTarget.style.boxShadow = "none";
|
|
344
|
-
}}
|
|
345
|
-
>
|
|
346
|
-
<div className="card-body p-3">
|
|
347
|
-
<div className="d-flex align-items-start">
|
|
348
|
-
<i
|
|
349
|
-
className={`${result.config.iconClass} me-3 mt-1`}
|
|
350
|
-
style={{
|
|
351
|
-
fontSize: "16px",
|
|
352
|
-
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
353
|
-
minWidth: "16px",
|
|
354
|
-
}}
|
|
355
|
-
/>
|
|
356
|
-
<div className="flex-grow-1">
|
|
357
|
-
<h6 className="card-title mb-1 fw-medium">{item.name}</h6>
|
|
358
|
-
<small
|
|
359
|
-
className="text-muted text-uppercase"
|
|
360
|
-
style={{ fontSize: "11px", letterSpacing: "0.5px" }}
|
|
361
|
-
>
|
|
362
|
-
{result.category.slice(0, -1)}
|
|
363
|
-
</small>
|
|
364
|
-
</div>
|
|
365
|
-
<i
|
|
366
|
-
className="bi-arrow-right text-muted"
|
|
367
|
-
style={{ fontSize: "12px" }}
|
|
368
|
-
/>
|
|
369
|
-
</div>
|
|
370
|
-
</div>
|
|
371
|
-
</div>
|
|
372
|
-
</div>
|
|
373
|
-
))}
|
|
374
|
-
</div>
|
|
375
|
-
</div>
|
|
376
|
-
))}
|
|
377
|
-
</div>
|
|
378
|
-
)}
|
|
379
|
-
</div>
|
|
380
|
-
)}
|
|
381
|
-
|
|
382
|
-
{/* Initial State */}
|
|
383
|
-
{!searchQuery && (
|
|
384
|
-
<div className="text-center py-5">
|
|
385
|
-
<i className="bi-search mb-3 d-block text-muted" style={{ fontSize: "64px" }} />
|
|
386
|
-
<h3 className="text-muted mb-3">Search across everything</h3>
|
|
387
|
-
<p className="text-muted mb-4" style={{ maxWidth: "400px", margin: "0 auto" }}>
|
|
388
|
-
Find apps, tools, assistants, workflows, types, and users all in one place.
|
|
389
|
-
</p>
|
|
390
|
-
<div className="d-flex flex-wrap justify-content-center gap-2">
|
|
391
|
-
{searchConfigs.map(({ config, category }) => (
|
|
392
|
-
<span
|
|
393
|
-
key={category}
|
|
394
|
-
className={`badge ${isDark ? "bg-secondary" : "bg-light text-dark"} px-3 py-2 d-flex align-items-center`}
|
|
395
|
-
style={{ fontSize: "12px" }}
|
|
396
|
-
>
|
|
397
|
-
<i className={`${config.iconClass} me-2`} />
|
|
398
|
-
{category}
|
|
399
|
-
</span>
|
|
400
|
-
))}
|
|
401
|
-
</div>
|
|
402
|
-
</div>
|
|
403
|
-
)}
|
|
404
|
-
</div>
|
|
405
|
-
);
|
|
406
|
-
}
|