@blocklet/pages-kit 0.2.316 → 0.2.317
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/cjs/builtin/async/ai-runtime/components/MarkdownRenderer.js +26 -2
- package/lib/cjs/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +22 -0
- package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/index.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/constants.js +34 -4
- package/lib/cjs/builtin/async/ai-runtime/contexts/ActiveAgent.js +28 -0
- package/lib/cjs/builtin/async/ai-runtime/contexts/ComponentPreferences.js +27 -0
- package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentMessage.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-appearances.js +10 -5
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-header-menu.js +39 -0
- package/lib/cjs/builtin/async/ai-runtime/index.js +17 -3
- package/lib/cjs/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +3 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime/Runtime/index.js +4 -6
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +60 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +50 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +30 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +13 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +46 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.js +2 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +26 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ShareView/index.js +16 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +25 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +73 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +58 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +33 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +23 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningQuestionsView.js +20 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +26 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +28 -134
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +35 -9
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +54 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/state/runtime.js +1 -6
- package/lib/cjs/builtin/mui/material.js +4 -2
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/inject-global-components.js +2 -0
- package/lib/esm/builtin/async/ai-runtime/components/MarkdownRenderer.js +3 -2
- package/lib/esm/builtin/async/ai-runtime/components/OutputFieldContainer/index.js +19 -0
- package/lib/esm/builtin/async/ai-runtime/components/ShareActions/index.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/constants.js +32 -3
- package/lib/esm/builtin/async/ai-runtime/contexts/ActiveAgent.js +23 -0
- package/lib/esm/builtin/async/ai-runtime/contexts/ComponentPreferences.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/contexts/CurrentMessage.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/hooks/use-appearances.js +10 -5
- package/lib/esm/builtin/async/ai-runtime/hooks/use-header-menu.js +32 -0
- package/lib/esm/builtin/async/ai-runtime/index.js +8 -1
- package/lib/esm/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +3 -2
- package/lib/esm/builtin/async/ai-runtime/runtime/Runtime/index.js +4 -6
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +54 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +44 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ImagesView/index.js +24 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/MarkdownView/index.js +7 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.js +40 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.js +1 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.js +20 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ShareView/index.js +10 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.js +44 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +30 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +27 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.js +18 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningQuestionsView.js +14 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +20 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +25 -108
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +36 -10
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +48 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Page.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/state/runtime.js +1 -6
- package/lib/esm/builtin/mui/material.js +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/inject-global-components.js +2 -0
- package/lib/types/builtin/async/ai-runtime/components/OutputFieldContainer/index.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/constants.d.ts +14 -0
- package/lib/types/builtin/async/ai-runtime/contexts/ActiveAgent.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/contexts/ComponentPreferences.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/contexts/CurrentMessage.d.ts +6 -1
- package/lib/types/builtin/async/ai-runtime/hooks/use-appearances.d.ts +4 -1
- package/lib/types/builtin/async/ai-runtime/hooks/use-header-menu.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/index.d.ts +8 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/ImagesView/index.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/MarkdownView/index.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/OpeningQuestionsView/index.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/OutputFieldView/type.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/ReferencedLinksView/index.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/ShareView/index.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/BackgroundImage.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/InputsView.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningMessageView.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningQuestionsView.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/index.d.ts +13 -3
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.d.ts +1 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/state/runtime.d.ts +0 -1
- package/lib/types/builtin/mui/material.d.ts +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/MultiAgentsChat/index.js +0 -193
- package/lib/esm/builtin/async/ai-runtime/runtime-components/MultiAgentsChat/index.js +0 -164
- package/lib/types/builtin/async/ai-runtime/runtime-components/MultiAgentsChat/index.d.ts +0 -11
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import * as arcblockUx from '../builtin/arcblock/ux';
|
|
2
3
|
import * as aiRuntime from '../builtin/async/ai-runtime';
|
|
3
4
|
import * as imagePreview from '../builtin/async/image-preview';
|
|
@@ -59,5 +60,6 @@ function injectGlobalComponents() {
|
|
|
59
60
|
return win[BuiltinModulesGlobalVariableName].modules[module];
|
|
60
61
|
},
|
|
61
62
|
};
|
|
63
|
+
win.React = React;
|
|
62
64
|
}
|
|
63
65
|
injectGlobalComponents();
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
import { OutputVariable } from '@blocklet/ai-runtime/types';
|
|
1
2
|
export declare const AI_STUDIO_DID = "z8iZpog7mcgcgBZzTiXJCWESvmnRrQmnd3XBB";
|
|
2
3
|
export declare const PAYMENT_KIT_DID = "z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk";
|
|
3
4
|
export declare const DEFAULT_PAGE_COMPONENT_ID = "ctnxha29uu8cx4xv";
|
|
4
5
|
export declare const DEFAULT_INPUT_COMPONENT_ID = "1wwtemqcdio6nqf0";
|
|
5
6
|
export declare const DEFAULT_OUTPUT_COMPONENT_ID = "q0ckknkxph4hfwas";
|
|
7
|
+
export declare const MARKDOWN_VIEW_ID = "a4oldpoxv7bikvpj";
|
|
8
|
+
export declare const SUGGESTED_QUESTIONS_VIEW_ID = "6u8m11ss7fvu8t7i";
|
|
9
|
+
export declare const REFERENCED_LINKS_VIEW_ID = "baqmaoccdntqwayc";
|
|
10
|
+
export declare const SHARE_VIEW_ID = "jfq3df9z8lkk9not";
|
|
11
|
+
export declare const IMAGES_VIEW_ID = "txirtdgx8h2bmo7s";
|
|
12
|
+
export declare const DEFAULT_OUTPUT_COMPONENTS: {
|
|
13
|
+
[name: string]: {
|
|
14
|
+
componentId: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare function getDefaultOutputComponent(output: OutputVariable): {
|
|
18
|
+
componentId: string;
|
|
19
|
+
} | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ActiveAgentContext {
|
|
3
|
+
activeAgentId: string;
|
|
4
|
+
setActiveAgentId: (agentId: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function useActiveAgent(): ActiveAgentContext;
|
|
7
|
+
export default function ActiveAgentProvider({ children }: {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,4 +7,9 @@ export default function CurrentMessageProvider({ message, children }: {
|
|
|
7
7
|
message: MessageItem;
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare function useCurrentMessage(
|
|
10
|
+
export declare function useCurrentMessage(args?: {
|
|
11
|
+
optional?: false;
|
|
12
|
+
}): CurrentMessageState;
|
|
13
|
+
export declare function useCurrentMessage(args: {
|
|
14
|
+
optional: true;
|
|
15
|
+
}): CurrentMessageState | undefined;
|
|
@@ -6,9 +6,11 @@ export default function useAppearances(args?: {
|
|
|
6
6
|
appearancePage: {
|
|
7
7
|
componentId: string;
|
|
8
8
|
componentName?: string | undefined;
|
|
9
|
-
|
|
9
|
+
componentProperties?: {
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
} | undefined;
|
|
12
|
+
title?: string | undefined;
|
|
13
|
+
icon?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
appearanceInput: import("@blocklet/ai-runtime/types").RuntimeOutputAppearance;
|
|
14
16
|
appearanceOutput: import("@blocklet/ai-runtime/types").RuntimeOutputAppearance;
|
|
@@ -26,6 +28,7 @@ export declare function useOpeningMessage(args?: {
|
|
|
26
28
|
} | {
|
|
27
29
|
agentId: string;
|
|
28
30
|
}): {
|
|
31
|
+
agent: import("../api/agent").Agent;
|
|
29
32
|
message: string;
|
|
30
33
|
profile: {
|
|
31
34
|
avatar: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useHeaderMenu(): void;
|
|
@@ -8,10 +8,17 @@ export { default as Runtime } from './runtime/Runtime';
|
|
|
8
8
|
export { default as ChatBotButton } from './runtime/ChatBotButton';
|
|
9
9
|
export { default as SimplePage } from './runtime-components/SimplePage';
|
|
10
10
|
export { default as SimpleChat } from './runtime-components/SimpleChat';
|
|
11
|
-
export { default as MultiAgentsChat } from './runtime-components/MultiAgentsChat';
|
|
12
11
|
export { default as PhotoGallery } from './runtime-components/PhotoGallery';
|
|
13
12
|
export { default as AutoForm } from './runtime-components/AutoForm';
|
|
14
13
|
export { default as SimpleOutput } from './runtime-components/SimpleOutput';
|
|
15
14
|
export { default as ChatOutput } from './runtime-components/ChatOutput';
|
|
16
15
|
export { default as PhotoGalleryItem } from './runtime-components/PhotoGalleryItem';
|
|
16
|
+
export { default as SuggestedQuestionsView } from './runtime-components/SuggestedQuestionsView';
|
|
17
|
+
export { default as ReferencedLinksView } from './runtime-components/ReferencedLinksView';
|
|
18
|
+
export { default as ShareView } from './runtime-components/ShareView';
|
|
19
|
+
export { default as OpeningQuestionsView } from './runtime-components/OpeningQuestionsView';
|
|
20
|
+
export { default as ImagesView } from './runtime-components/ImagesView';
|
|
21
|
+
export { default as GoogleSearchRelatedQuestionsView } from './runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView';
|
|
22
|
+
export { default as GoogleSearchSourcesView } from './runtime-components/GoogleSearch/GoogleSearchSourcesView';
|
|
23
|
+
export { default as MarkdownView } from './runtime-components/MarkdownView';
|
|
17
24
|
export * from './runtime-components/V0';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BackgroundImage(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MessageItem } from '../../state/session';
|
|
3
|
+
declare const MessageView: import("react").MemoExoticComponent<({ message }: {
|
|
4
|
+
message: MessageItem;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element | null>;
|
|
6
|
+
export default MessageView;
|
package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/OpeningQuestionsView.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function OpeningQuestionsView(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function UserMessageView(): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[] | undefined;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import ScrollView from '../../components/ScrollView';
|
|
3
|
-
export
|
|
3
|
+
export interface SimpleChatPreferences {
|
|
4
|
+
divider?: boolean;
|
|
5
|
+
hideHeaderMenuButton?: boolean;
|
|
6
|
+
hideUserInputs?: boolean;
|
|
7
|
+
hideAgentAvatar?: boolean;
|
|
8
|
+
backgroundImage?: {
|
|
9
|
+
url?: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default function SimpleChat({ primaryColor, scrollViewProps, ...preferences }: {
|
|
4
15
|
primaryColor?: string;
|
|
5
16
|
scrollViewProps?: ComponentProps<typeof ScrollView>;
|
|
6
|
-
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
} & SimpleChatPreferences): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function SimpleOutput(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export default function SimpleOutput(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Alert, AlertTitle, Autocomplete, Avatar, Box, Button, IconButton, ButtonGroup, Card, CardActionArea, CardActions, CardContent, CardHeader, CardMedia, CircularProgress, ClickAwayListener, Collapse, Container, Dialog, DialogActions, DialogContent, DialogTitle, Divider, Fade, GlobalStyles, Grid, Grow, LinearProgress, Link, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemSecondaryAction, ListSubheader, Menu, MenuItem, MenuList, Paper, Popper, Slide, Stack, Switch, TextField, ThemeProvider, Tooltip, Typography, Zoom, alpha, createTheme, styled, useMediaQuery, useTheme, } from '@mui/material';
|
|
1
|
+
export { Checkbox, ListItemText, Alert, AlertTitle, Autocomplete, Avatar, Box, Button, IconButton, ButtonGroup, Card, CardActionArea, CardActions, CardContent, CardHeader, CardMedia, CircularProgress, ClickAwayListener, Collapse, Container, Dialog, DialogActions, DialogContent, DialogTitle, Divider, Fade, GlobalStyles, Grid, Grow, LinearProgress, Link, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemSecondaryAction, ListSubheader, Menu, MenuItem, MenuList, Paper, Popper, Slide, Stack, Switch, TextField, ThemeProvider, Tooltip, Typography, Zoom, alpha, createTheme, styled, useMediaQuery, useTheme, } from '@mui/material';
|