@blocklet/pages-kit 0.2.364 → 0.2.366
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/AgentErrorBoundary.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/contexts/ComponentPreferences.js +7 -2
- package/lib/cjs/builtin/async/ai-runtime/index.js +9 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +15 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +3 -3
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +25 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +12 -8
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +4 -2
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/types/index.js +1 -0
- package/lib/cjs/utils/inject-global-components.js +2 -0
- package/lib/esm/builtin/async/ai-runtime/components/AgentErrorBoundary.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/contexts/ComponentPreferences.js +4 -2
- package/lib/esm/builtin/async/ai-runtime/index.js +5 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +15 -2
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +4 -4
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +14 -10
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +4 -2
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/types/index.js +1 -0
- package/lib/esm/utils/inject-global-components.js +2 -0
- package/lib/types/builtin/async/ai-runtime/components/AgentErrorBoundary.d.ts +4 -1
- package/lib/types/builtin/async/ai-runtime/contexts/ComponentPreferences.d.ts +9 -3
- package/lib/types/builtin/async/ai-runtime/index.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/index.d.ts +2 -2
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimplePage/index.d.ts +5 -2
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/types/index.d.ts +1 -0
- package/package.json +11 -4
package/lib/esm/types/index.js
CHANGED
|
@@ -27,6 +27,8 @@ import CustomComponentRenderer from '../components/CustomComponentRenderer';
|
|
|
27
27
|
import { BuiltinModulesGlobalVariableName } from '../types/builtin';
|
|
28
28
|
function injectGlobalComponents() {
|
|
29
29
|
const win = window;
|
|
30
|
+
if (win[BuiltinModulesGlobalVariableName])
|
|
31
|
+
return;
|
|
30
32
|
win[BuiltinModulesGlobalVariableName] = {
|
|
31
33
|
modules: {
|
|
32
34
|
'@blocklet/pages-kit/builtin/pages-kit': { CustomComponentRenderer },
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export default function AgentErrorBoundary({ children }: {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
2
5
|
export declare function AgentErrorView({ error }: {
|
|
3
6
|
error: any;
|
|
4
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export interface ComponentPreferencesBase {
|
|
3
|
+
hideInputFields?: string[];
|
|
4
|
+
autoGenerate?: boolean;
|
|
5
|
+
initialInputValues?: Record<string, any>;
|
|
6
|
+
customOutputActionsComponent?: ComponentType<{}>;
|
|
7
|
+
}
|
|
8
|
+
export default function ComponentPreferencesProvider<T extends ComponentPreferencesBase>({ children, ...preferences }: {
|
|
3
9
|
children?: ReactNode;
|
|
4
10
|
} & T): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare function useComponentPreferences<T>(): T | undefined;
|
|
11
|
+
export declare function useComponentPreferences<T>(): (T & ComponentPreferencesBase) | undefined;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
export * from './contexts/ComponentPreferences';
|
|
2
|
+
export { default as ComponentPreferencesProvider } from './contexts/ComponentPreferences';
|
|
1
3
|
export * from './contexts/CurrentAgent';
|
|
2
4
|
export { default as CurrentAgentProvider } from './contexts/CurrentAgent';
|
|
3
5
|
export * from './contexts/CurrentMessage';
|
|
4
6
|
export { default as CurrentMessageProvider } from './contexts/CurrentMessage';
|
|
7
|
+
export * from './contexts/ActiveAgent';
|
|
8
|
+
export { default as ActiveAgentProvider } from './contexts/ActiveAgent';
|
|
9
|
+
export { default as useAppearances } from './hooks/use-appearances';
|
|
5
10
|
export * from './state/runtime';
|
|
6
11
|
export * from './state/session';
|
|
7
12
|
export { default as Runtime } from './runtime/Runtime';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import ScrollView from '../../components/ScrollView';
|
|
3
|
-
|
|
3
|
+
import { ComponentPreferencesBase } from '../../contexts/ComponentPreferences';
|
|
4
|
+
export interface SimpleChatPreferences extends ComponentPreferencesBase {
|
|
4
5
|
divider?: boolean;
|
|
5
|
-
hideHeaderMenuButton?: boolean;
|
|
6
6
|
hideUserInputs?: boolean;
|
|
7
7
|
hideAgentAvatar?: boolean;
|
|
8
8
|
backgroundImage?: {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComponentPreferencesBase } from '../../contexts/ComponentPreferences';
|
|
2
|
+
export interface SimplePagePreferences extends ComponentPreferencesBase {
|
|
3
|
+
}
|
|
4
|
+
export default function SimplePage({ resultTitle, ...preferences }: {
|
|
2
5
|
resultTitle?: string;
|
|
3
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
} & SimplePagePreferences): import("react/jsx-runtime").JSX.Element;
|