@uipath/apollo-react 3.30.6 → 3.32.0-pr163.020d113
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/canvas/components/BaseNode/BaseNode.cjs +10 -3
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +10 -3
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts +1 -0
- package/dist/canvas/components/BaseNode/BaseNode.types.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/useButtonHandles.cjs +1 -4
- package/dist/canvas/components/ButtonHandle/useButtonHandles.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/useButtonHandles.js +1 -4
- package/dist/canvas/core/CategoryTree.cjs +11 -10
- package/dist/canvas/core/CategoryTree.d.ts.map +1 -1
- package/dist/canvas/core/CategoryTree.js +11 -10
- package/dist/canvas/hooks/ToolbarActionContext.cjs +5 -9
- package/dist/canvas/hooks/ToolbarActionContext.d.ts +1 -2
- package/dist/canvas/hooks/ToolbarActionContext.d.ts.map +1 -1
- package/dist/canvas/hooks/ToolbarActionContext.js +5 -9
- package/dist/canvas/utils/collapse.cjs +54 -0
- package/dist/canvas/utils/collapse.d.ts +9 -0
- package/dist/canvas/utils/collapse.d.ts.map +1 -0
- package/dist/canvas/utils/collapse.js +11 -0
- package/dist/canvas/utils/icon-registry.cjs +8 -0
- package/dist/canvas/utils/icon-registry.d.ts.map +1 -1
- package/dist/canvas/utils/icon-registry.js +9 -1
- package/dist/canvas/utils/index.cjs +45 -36
- package/dist/canvas/utils/index.d.ts +1 -0
- package/dist/canvas/utils/index.d.ts.map +1 -1
- package/dist/canvas/utils/index.js +1 -0
- package/dist/canvas/utils/manifest-resolver.cjs +18 -11
- package/dist/canvas/utils/manifest-resolver.d.ts +3 -3
- package/dist/canvas/utils/manifest-resolver.d.ts.map +1 -1
- package/dist/canvas/utils/manifest-resolver.js +18 -11
- package/dist/canvas/utils/toolbar-resolver.cjs +2 -17
- package/dist/canvas/utils/toolbar-resolver.d.ts +1 -3
- package/dist/canvas/utils/toolbar-resolver.d.ts.map +1 -1
- package/dist/canvas/utils/toolbar-resolver.js +2 -17
- package/dist/material/components/ap-chat/ap-chat.cjs +5 -3
- package/dist/material/components/ap-chat/ap-chat.d.ts.map +1 -1
- package/dist/material/components/ap-chat/ap-chat.js +5 -3
- package/dist/material/components/ap-chat/components/header/header-actions.cjs +5 -5
- package/dist/material/components/ap-chat/components/header/header-actions.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/header/header-actions.js +5 -5
- package/dist/material/components/ap-chat/components/layout/full-screen-layout.cjs +2 -2
- package/dist/material/components/ap-chat/components/layout/full-screen-layout.d.ts +1 -0
- package/dist/material/components/ap-chat/components/layout/full-screen-layout.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/layout/full-screen-layout.js +2 -2
- package/dist/material/components/ap-chat/components/layout/standard-layout.cjs +2 -2
- package/dist/material/components/ap-chat/components/layout/standard-layout.d.ts +1 -0
- package/dist/material/components/ap-chat/components/layout/standard-layout.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/layout/standard-layout.js +2 -2
- package/dist/material/components/ap-chat/components/message/actions/chat-actions.cjs +3 -2
- package/dist/material/components/ap-chat/components/message/actions/chat-actions.js +3 -2
- package/dist/material/components/ap-chat/providers/chat-state-provider.cjs +9 -2
- package/dist/material/components/ap-chat/providers/chat-state-provider.d.ts +1 -0
- package/dist/material/components/ap-chat/providers/chat-state-provider.d.ts.map +1 -1
- package/dist/material/components/ap-chat/providers/chat-state-provider.js +9 -2
- package/dist/material/components/ap-chat/service/ChatModel.cjs +1 -0
- package/dist/material/components/ap-chat/service/ChatModel.d.ts +2 -0
- package/dist/material/components/ap-chat/service/ChatModel.d.ts.map +1 -1
- package/dist/material/components/ap-chat/service/ChatModel.js +1 -0
- package/dist/material/components/ap-chat/service/ChatService.cjs +10 -0
- package/dist/material/components/ap-chat/service/ChatService.d.ts +2 -0
- package/dist/material/components/ap-chat/service/ChatService.d.ts.map +1 -1
- package/dist/material/components/ap-chat/service/ChatService.js +10 -0
- package/package.json +1 -1
|
@@ -29,21 +29,21 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
resolveVisibility: ()=>resolveVisibility,
|
|
30
30
|
resolveHandles: ()=>resolveHandles
|
|
31
31
|
});
|
|
32
|
-
const
|
|
33
|
-
function resolveDisplay(manifestDisplay,
|
|
32
|
+
const external_collapse_cjs_namespaceObject = require("./collapse.cjs");
|
|
33
|
+
function resolveDisplay(manifestDisplay, context) {
|
|
34
34
|
if (!manifestDisplay) return {
|
|
35
35
|
icon: 'help-circle',
|
|
36
36
|
shape: 'square',
|
|
37
|
-
label:
|
|
37
|
+
label: context?.display?.label || 'Unknown Node'
|
|
38
38
|
};
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
39
|
+
const isCollapsed = context?.isCollapsed ?? false;
|
|
40
|
+
const shape = context?.display?.shape ?? manifestDisplay.shape;
|
|
41
|
+
const collapsedShape = (0, external_collapse_cjs_namespaceObject.getCollapsedShape)(shape);
|
|
42
|
+
const expandedShape = manifestDisplay.shape;
|
|
43
43
|
return {
|
|
44
44
|
...manifestDisplay,
|
|
45
|
-
...
|
|
46
|
-
shape: isCollapsed ? collapsedShape :
|
|
45
|
+
...context?.display,
|
|
46
|
+
shape: isCollapsed ? collapsedShape : expandedShape
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
function resolveVisibility(visible, context) {
|
|
@@ -62,6 +62,7 @@ function replaceTemplateVars(template, vars) {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
function resolveHandles(handleGroups, context) {
|
|
65
|
+
const isCollapsed = context?.isCollapsed ?? false;
|
|
65
66
|
return handleGroups.map((group)=>{
|
|
66
67
|
const handles = group.handles.flatMap((handle)=>{
|
|
67
68
|
if (handle.repeat) {
|
|
@@ -77,20 +78,26 @@ function resolveHandles(handleGroups, context) {
|
|
|
77
78
|
[itemVar]: item,
|
|
78
79
|
[indexVar]: index
|
|
79
80
|
};
|
|
81
|
+
const baseVisible = resolveVisibility(handle.visible, context);
|
|
82
|
+
const isArtifactHandle = 'artifact' === handle.handleType;
|
|
83
|
+
const visible = context.isCollapsed && isArtifactHandle ? false : baseVisible;
|
|
80
84
|
return {
|
|
81
85
|
...handle,
|
|
82
86
|
id: replaceTemplateVars(handle.id, vars),
|
|
83
87
|
label: handle.label ? replaceTemplateVars(handle.label, vars) : void 0,
|
|
84
|
-
visible
|
|
88
|
+
visible,
|
|
85
89
|
repeat: void 0,
|
|
86
90
|
itemVar: void 0,
|
|
87
91
|
indexVar: void 0
|
|
88
92
|
};
|
|
89
93
|
});
|
|
90
94
|
}
|
|
95
|
+
const baseVisible = resolveVisibility(handle.visible, context);
|
|
96
|
+
const isArtifactHandle = 'artifact' === handle.handleType;
|
|
97
|
+
const visible = isCollapsed && isArtifactHandle ? false : baseVisible;
|
|
91
98
|
return {
|
|
92
99
|
...handle,
|
|
93
|
-
visible
|
|
100
|
+
visible
|
|
94
101
|
};
|
|
95
102
|
});
|
|
96
103
|
return {
|
|
@@ -5,6 +5,8 @@ import type { HandleActionEvent } from '../components/ButtonHandle/ButtonHandle'
|
|
|
5
5
|
export interface ResolutionContext {
|
|
6
6
|
display?: DisplayConfig;
|
|
7
7
|
inputs?: Record<string, unknown>;
|
|
8
|
+
nodeId?: string;
|
|
9
|
+
isCollapsed?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export type ResolvedDisplay = DisplayConfig & {
|
|
10
12
|
label: string;
|
|
@@ -29,9 +31,7 @@ interface TemplateVars {
|
|
|
29
31
|
item?: unknown;
|
|
30
32
|
index?: number;
|
|
31
33
|
}
|
|
32
|
-
export declare function resolveDisplay(manifestDisplay?: NodeDisplayManifest,
|
|
33
|
-
nodeId?: string;
|
|
34
|
-
}) | undefined): ResolvedDisplay;
|
|
34
|
+
export declare function resolveDisplay(manifestDisplay?: NodeDisplayManifest, context?: ResolutionContext): ResolvedDisplay;
|
|
35
35
|
export declare function resolveVisibility(visible: boolean | string | undefined, context: ResolutionContext): boolean;
|
|
36
36
|
export declare function replaceTemplateVars(template: string, vars: TemplateVars): string;
|
|
37
37
|
export declare function resolveHandles(handleGroups: HandleGroupManifest[], context: ResolutionContext): ResolvedHandleGroup[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-resolver.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/manifest-resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-resolver.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/manifest-resolver.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAMjF,MAAM,WAAW,iBAAiB;IAEhC,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAMD,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wBAAwB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5C,CAAC;AAKF,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;IAE7F,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,EAAE,OAAO,CAAC;IAEjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC/C;AAKD,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC;IAE/E,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAKD,UAAU,YAAY;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD,wBAAgB,cAAc,CAC5B,eAAe,CAAC,EAAE,mBAAmB,EACrC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,eAAe,CAoBjB;AA6BD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,EACrC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAmBT;AAiCD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAKhF;AAuCD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,mBAAmB,EAAE,EACnC,OAAO,EAAE,iBAAiB,GACzB,mBAAmB,EAAE,CA+DvB"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function resolveDisplay(manifestDisplay,
|
|
1
|
+
import { getCollapsedShape } from "./collapse.js";
|
|
2
|
+
function resolveDisplay(manifestDisplay, context) {
|
|
3
3
|
if (!manifestDisplay) return {
|
|
4
4
|
icon: 'help-circle',
|
|
5
5
|
shape: 'square',
|
|
6
|
-
label:
|
|
6
|
+
label: context?.display?.label || 'Unknown Node'
|
|
7
7
|
};
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
8
|
+
const isCollapsed = context?.isCollapsed ?? false;
|
|
9
|
+
const shape = context?.display?.shape ?? manifestDisplay.shape;
|
|
10
|
+
const collapsedShape = getCollapsedShape(shape);
|
|
11
|
+
const expandedShape = manifestDisplay.shape;
|
|
12
12
|
return {
|
|
13
13
|
...manifestDisplay,
|
|
14
|
-
...
|
|
15
|
-
shape: isCollapsed ? collapsedShape :
|
|
14
|
+
...context?.display,
|
|
15
|
+
shape: isCollapsed ? collapsedShape : expandedShape
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
function resolveVisibility(visible, context) {
|
|
@@ -31,6 +31,7 @@ function replaceTemplateVars(template, vars) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
function resolveHandles(handleGroups, context) {
|
|
34
|
+
const isCollapsed = context?.isCollapsed ?? false;
|
|
34
35
|
return handleGroups.map((group)=>{
|
|
35
36
|
const handles = group.handles.flatMap((handle)=>{
|
|
36
37
|
if (handle.repeat) {
|
|
@@ -46,20 +47,26 @@ function resolveHandles(handleGroups, context) {
|
|
|
46
47
|
[itemVar]: item,
|
|
47
48
|
[indexVar]: index
|
|
48
49
|
};
|
|
50
|
+
const baseVisible = resolveVisibility(handle.visible, context);
|
|
51
|
+
const isArtifactHandle = 'artifact' === handle.handleType;
|
|
52
|
+
const visible = context.isCollapsed && isArtifactHandle ? false : baseVisible;
|
|
49
53
|
return {
|
|
50
54
|
...handle,
|
|
51
55
|
id: replaceTemplateVars(handle.id, vars),
|
|
52
56
|
label: handle.label ? replaceTemplateVars(handle.label, vars) : void 0,
|
|
53
|
-
visible
|
|
57
|
+
visible,
|
|
54
58
|
repeat: void 0,
|
|
55
59
|
itemVar: void 0,
|
|
56
60
|
indexVar: void 0
|
|
57
61
|
};
|
|
58
62
|
});
|
|
59
63
|
}
|
|
64
|
+
const baseVisible = resolveVisibility(handle.visible, context);
|
|
65
|
+
const isArtifactHandle = 'artifact' === handle.handleType;
|
|
66
|
+
const visible = isCollapsed && isArtifactHandle ? false : baseVisible;
|
|
60
67
|
return {
|
|
61
68
|
...handle,
|
|
62
|
-
visible
|
|
69
|
+
visible
|
|
63
70
|
};
|
|
64
71
|
});
|
|
65
72
|
return {
|
|
@@ -141,23 +141,8 @@ function mergeToolbarConfigs(base, extension) {
|
|
|
141
141
|
}
|
|
142
142
|
function resolveToolbar(manifest, context, nodeData) {
|
|
143
143
|
const { nodeType, toolbarExtensions: manifestToolbarExtensions } = manifest;
|
|
144
|
-
const { mode
|
|
145
|
-
|
|
146
|
-
modeDefaults = {
|
|
147
|
-
...modeDefaults,
|
|
148
|
-
actions: modeDefaults?.actions?.map((action)=>{
|
|
149
|
-
const isCollapsed = Boolean(nodeData?.nodeId && collapsed?.has(nodeData.nodeId));
|
|
150
|
-
switch(action.id){
|
|
151
|
-
case 'collapse':
|
|
152
|
-
return {
|
|
153
|
-
...action,
|
|
154
|
-
icon: isCollapsed ? 'chevrons-up-down' : 'chevrons-down-up'
|
|
155
|
-
};
|
|
156
|
-
default:
|
|
157
|
-
return action;
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
};
|
|
144
|
+
const { mode } = (0, ToolbarActionContext_cjs_namespaceObject.getToolbarActionStore)();
|
|
145
|
+
const modeDefaults = toolbarRegistry.getModeDefaults(mode);
|
|
161
146
|
const nodeExtensions = manifestToolbarExtensions?.[mode];
|
|
162
147
|
const merged = mergeToolbarConfigs(modeDefaults, nodeExtensions);
|
|
163
148
|
const filteredActions = merged.actions.filter((action)=>evaluateCondition(manifest, action, nodeType, context)).map((action)=>convertToNodeAction(action, mode, nodeData));
|
|
@@ -2,8 +2,6 @@ import type { NodeManifest, NodeStatusContext, NodeToolbarConfig } from '../inde
|
|
|
2
2
|
interface ExtendedNodeContext extends NodeStatusContext {
|
|
3
3
|
permissions?: string[];
|
|
4
4
|
}
|
|
5
|
-
export declare function resolveToolbar(manifest: NodeManifest, context: ExtendedNodeContext, nodeData?:
|
|
6
|
-
nodeId?: string;
|
|
7
|
-
}) | undefined): NodeToolbarConfig | undefined;
|
|
5
|
+
export declare function resolveToolbar(manifest: NodeManifest, context: ExtendedNodeContext, nodeData?: Record<string, unknown>): NodeToolbarConfig | undefined;
|
|
8
6
|
export {};
|
|
9
7
|
//# sourceMappingURL=toolbar-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar-resolver.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/toolbar-resolver.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAKrC,UAAU,mBAAoB,SAAQ,iBAAiB;IAErD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AA0ID,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"toolbar-resolver.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/toolbar-resolver.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAKrC,UAAU,mBAAoB,SAAQ,iBAAiB;IAErD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AA0ID,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,iBAAiB,GAAG,SAAS,CAmC/B"}
|
|
@@ -113,23 +113,8 @@ function mergeToolbarConfigs(base, extension) {
|
|
|
113
113
|
}
|
|
114
114
|
function resolveToolbar(manifest, context, nodeData) {
|
|
115
115
|
const { nodeType, toolbarExtensions: manifestToolbarExtensions } = manifest;
|
|
116
|
-
const { mode
|
|
117
|
-
|
|
118
|
-
modeDefaults = {
|
|
119
|
-
...modeDefaults,
|
|
120
|
-
actions: modeDefaults?.actions?.map((action)=>{
|
|
121
|
-
const isCollapsed = Boolean(nodeData?.nodeId && collapsed?.has(nodeData.nodeId));
|
|
122
|
-
switch(action.id){
|
|
123
|
-
case 'collapse':
|
|
124
|
-
return {
|
|
125
|
-
...action,
|
|
126
|
-
icon: isCollapsed ? 'chevrons-up-down' : 'chevrons-down-up'
|
|
127
|
-
};
|
|
128
|
-
default:
|
|
129
|
-
return action;
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
};
|
|
116
|
+
const { mode } = getToolbarActionStore();
|
|
117
|
+
const modeDefaults = toolbarRegistry.getModeDefaults(mode);
|
|
133
118
|
const nodeExtensions = manifestToolbarExtensions?.[mode];
|
|
134
119
|
const merged = mergeToolbarConfigs(modeDefaults, nodeExtensions);
|
|
135
120
|
const filteredActions = merged.actions.filter((action)=>evaluateCondition(manifest, action, nodeType, context)).map((action)=>convertToNodeAction(action, mode, nodeData));
|
|
@@ -99,7 +99,7 @@ const ApI18nWithLocale = /*#__PURE__*/ external_react_default().memo(({ children
|
|
|
99
99
|
});
|
|
100
100
|
const AutopilotChatContent = /*#__PURE__*/ external_react_default().memo(()=>{
|
|
101
101
|
const { width, shouldAnimate } = (0, chat_width_provider_cjs_namespaceObject.useChatWidth)();
|
|
102
|
-
const { historyOpen, settingsOpen, disabledFeatures, chatMode } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
102
|
+
const { historyOpen, settingsOpen, disabledFeatures, chatMode, readOnly } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
103
103
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ChatContainer, {
|
|
104
104
|
shouldAnimate: shouldAnimate,
|
|
105
105
|
mode: chatMode,
|
|
@@ -113,7 +113,8 @@ const AutopilotChatContent = /*#__PURE__*/ external_react_default().memo(()=>{
|
|
|
113
113
|
historyDisabled: disabledFeatures.history ?? false,
|
|
114
114
|
settingsDisabled: disabledFeatures.settings ?? false,
|
|
115
115
|
headerSeparatorDisabled: disabledFeatures.headerSeparator ?? false,
|
|
116
|
-
mode: chatMode
|
|
116
|
+
mode: chatMode,
|
|
117
|
+
readOnly: readOnly
|
|
117
118
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(layout_index_cjs_namespaceObject.StandardLayout, {
|
|
118
119
|
historyOpen: historyOpen,
|
|
119
120
|
settingsOpen: settingsOpen,
|
|
@@ -121,7 +122,8 @@ const AutopilotChatContent = /*#__PURE__*/ external_react_default().memo(()=>{
|
|
|
121
122
|
settingsDisabled: disabledFeatures.settings ?? false,
|
|
122
123
|
headerDisabled: disabledFeatures.header ?? false,
|
|
123
124
|
headerSeparatorDisabled: disabledFeatures.headerSeparator ?? false,
|
|
124
|
-
mode: chatMode
|
|
125
|
+
mode: chatMode,
|
|
126
|
+
readOnly: readOnly
|
|
125
127
|
})
|
|
126
128
|
]
|
|
127
129
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ap-chat.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-chat/ap-chat.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAsBrE,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ap-chat.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-chat/ap-chat.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAsBrE,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;AAiGnB,MAAM,WAAW,WAAW;IAI1B,mBAAmB,EAAE,oBAAoB,CAAC;IAK1C,MAAM,CAAC,EAAE,eAAe,CAAC;IAKzB,KAAK,CAAC,EAAE,WAAW,CAAC;IAMpB,eAAe,CAAC,EAAE,WAAW,CAAC;IAQ9B,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAStC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,wBAAgB,MAAM,CAAC,EACrB,mBAAmB,EACnB,MAAM,EAAE,aAAoB,EAC5B,KAAK,EAAE,YAAsB,EAC7B,eAAe,EACf,2BAAmC,EACnC,qBAA6B,GAC9B,EAAE,WAAW,2CAuFb"}
|
|
@@ -60,7 +60,7 @@ const ApI18nWithLocale = /*#__PURE__*/ react.memo(({ children })=>{
|
|
|
60
60
|
});
|
|
61
61
|
const AutopilotChatContent = /*#__PURE__*/ react.memo(()=>{
|
|
62
62
|
const { width, shouldAnimate } = useChatWidth();
|
|
63
|
-
const { historyOpen, settingsOpen, disabledFeatures, chatMode } = useChatState();
|
|
63
|
+
const { historyOpen, settingsOpen, disabledFeatures, chatMode, readOnly } = useChatState();
|
|
64
64
|
return /*#__PURE__*/ jsxs(ChatContainer, {
|
|
65
65
|
shouldAnimate: shouldAnimate,
|
|
66
66
|
mode: chatMode,
|
|
@@ -74,7 +74,8 @@ const AutopilotChatContent = /*#__PURE__*/ react.memo(()=>{
|
|
|
74
74
|
historyDisabled: disabledFeatures.history ?? false,
|
|
75
75
|
settingsDisabled: disabledFeatures.settings ?? false,
|
|
76
76
|
headerSeparatorDisabled: disabledFeatures.headerSeparator ?? false,
|
|
77
|
-
mode: chatMode
|
|
77
|
+
mode: chatMode,
|
|
78
|
+
readOnly: readOnly
|
|
78
79
|
}) : /*#__PURE__*/ jsx(StandardLayout, {
|
|
79
80
|
historyOpen: historyOpen,
|
|
80
81
|
settingsOpen: settingsOpen,
|
|
@@ -82,7 +83,8 @@ const AutopilotChatContent = /*#__PURE__*/ react.memo(()=>{
|
|
|
82
83
|
settingsDisabled: disabledFeatures.settings ?? false,
|
|
83
84
|
headerDisabled: disabledFeatures.header ?? false,
|
|
84
85
|
headerSeparatorDisabled: disabledFeatures.headerSeparator ?? false,
|
|
85
|
-
mode: chatMode
|
|
86
|
+
mode: chatMode,
|
|
87
|
+
readOnly: readOnly
|
|
86
88
|
})
|
|
87
89
|
]
|
|
88
90
|
});
|
|
@@ -57,7 +57,7 @@ const StyledActions = (0, styles_namespaceObject.styled)('div')(()=>({
|
|
|
57
57
|
function AutopilotChatHeaderActionsComponent() {
|
|
58
58
|
const { _ } = (0, react_namespaceObject.useLingui)();
|
|
59
59
|
const chatService = (0, chat_service_provider_cjs_namespaceObject.useChatService)();
|
|
60
|
-
const { disabledFeatures, chatMode, historyOpen, settingsOpen, setHistoryAnchorElement } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
60
|
+
const { disabledFeatures, chatMode, historyOpen, settingsOpen, setHistoryAnchorElement, readOnly } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
61
61
|
const { clearAttachments } = (0, attachements_provider_cjs_namespaceObject.useAttachments)();
|
|
62
62
|
const { customHeaderActions, handleCustomHeaderAction } = (0, picker_provider_cjs_namespaceObject.usePicker)();
|
|
63
63
|
const [actionMenuAnchorEl, setActionMenuAnchorEl] = external_react_default().useState(null);
|
|
@@ -138,7 +138,7 @@ function AutopilotChatHeaderActionsComponent() {
|
|
|
138
138
|
]);
|
|
139
139
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(StyledActions, {
|
|
140
140
|
children: [
|
|
141
|
-
!disabledFeatures.newChat && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(action_button_cjs_namespaceObject.AutopilotChatActionButton, {
|
|
141
|
+
!readOnly && !disabledFeatures.newChat && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(action_button_cjs_namespaceObject.AutopilotChatActionButton, {
|
|
142
142
|
iconName: "new_chat",
|
|
143
143
|
variant: "custom",
|
|
144
144
|
tooltip: _({
|
|
@@ -150,7 +150,7 @@ function AutopilotChatHeaderActionsComponent() {
|
|
|
150
150
|
onClick: handleNewChat,
|
|
151
151
|
"data-testid": "autopilot-chat-new-chat"
|
|
152
152
|
}),
|
|
153
|
-
!disabledFeatures.settings && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(action_button_cjs_namespaceObject.AutopilotChatActionButton, {
|
|
153
|
+
!readOnly && !disabledFeatures.settings && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(action_button_cjs_namespaceObject.AutopilotChatActionButton, {
|
|
154
154
|
iconName: "settings",
|
|
155
155
|
tooltip: _({
|
|
156
156
|
id: 'autopilot-chat.header.actions.settings'
|
|
@@ -161,7 +161,7 @@ function AutopilotChatHeaderActionsComponent() {
|
|
|
161
161
|
onClick: toggleSettings,
|
|
162
162
|
"data-testid": "autopilot-chat-settings"
|
|
163
163
|
}),
|
|
164
|
-
!disabledFeatures.history && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(action_button_cjs_namespaceObject.AutopilotChatActionButton, {
|
|
164
|
+
!readOnly && !disabledFeatures.history && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(action_button_cjs_namespaceObject.AutopilotChatActionButton, {
|
|
165
165
|
ref: setHistoryAnchorElement,
|
|
166
166
|
iconName: "history",
|
|
167
167
|
variant: "custom",
|
|
@@ -189,7 +189,7 @@ function AutopilotChatHeaderActionsComponent() {
|
|
|
189
189
|
onClick: handleToggleChat,
|
|
190
190
|
"data-testid": "autopilot-chat-toggle-fullscreen"
|
|
191
191
|
}),
|
|
192
|
-
customHeaderActions.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
192
|
+
!readOnly && customHeaderActions.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
193
193
|
children: [
|
|
194
194
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(action_button_cjs_namespaceObject.AutopilotChatActionButton, {
|
|
195
195
|
iconName: "more_vert",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-actions.d.ts","sourceRoot":"","sources":["../../../../../../src/material/components/ap-chat/components/header/header-actions.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,iBAAS,mCAAmC,
|
|
1
|
+
{"version":3,"file":"header-actions.d.ts","sourceRoot":"","sources":["../../../../../../src/material/components/ap-chat/components/header/header-actions.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,iBAAS,mCAAmC,4CA0M3C;AAED,eAAO,MAAM,0BAA0B,uEAAkD,CAAC"}
|
|
@@ -18,7 +18,7 @@ const StyledActions = styled('div')(()=>({
|
|
|
18
18
|
function AutopilotChatHeaderActionsComponent() {
|
|
19
19
|
const { _ } = useLingui();
|
|
20
20
|
const chatService = useChatService();
|
|
21
|
-
const { disabledFeatures, chatMode, historyOpen, settingsOpen, setHistoryAnchorElement } = useChatState();
|
|
21
|
+
const { disabledFeatures, chatMode, historyOpen, settingsOpen, setHistoryAnchorElement, readOnly } = useChatState();
|
|
22
22
|
const { clearAttachments } = useAttachments();
|
|
23
23
|
const { customHeaderActions, handleCustomHeaderAction } = usePicker();
|
|
24
24
|
const [actionMenuAnchorEl, setActionMenuAnchorEl] = react.useState(null);
|
|
@@ -99,7 +99,7 @@ function AutopilotChatHeaderActionsComponent() {
|
|
|
99
99
|
]);
|
|
100
100
|
return /*#__PURE__*/ jsxs(StyledActions, {
|
|
101
101
|
children: [
|
|
102
|
-
!disabledFeatures.newChat && /*#__PURE__*/ jsx(AutopilotChatActionButton, {
|
|
102
|
+
!readOnly && !disabledFeatures.newChat && /*#__PURE__*/ jsx(AutopilotChatActionButton, {
|
|
103
103
|
iconName: "new_chat",
|
|
104
104
|
variant: "custom",
|
|
105
105
|
tooltip: _({
|
|
@@ -111,7 +111,7 @@ function AutopilotChatHeaderActionsComponent() {
|
|
|
111
111
|
onClick: handleNewChat,
|
|
112
112
|
"data-testid": "autopilot-chat-new-chat"
|
|
113
113
|
}),
|
|
114
|
-
!disabledFeatures.settings && /*#__PURE__*/ jsx(AutopilotChatActionButton, {
|
|
114
|
+
!readOnly && !disabledFeatures.settings && /*#__PURE__*/ jsx(AutopilotChatActionButton, {
|
|
115
115
|
iconName: "settings",
|
|
116
116
|
tooltip: _({
|
|
117
117
|
id: 'autopilot-chat.header.actions.settings'
|
|
@@ -122,7 +122,7 @@ function AutopilotChatHeaderActionsComponent() {
|
|
|
122
122
|
onClick: toggleSettings,
|
|
123
123
|
"data-testid": "autopilot-chat-settings"
|
|
124
124
|
}),
|
|
125
|
-
!disabledFeatures.history && /*#__PURE__*/ jsx(AutopilotChatActionButton, {
|
|
125
|
+
!readOnly && !disabledFeatures.history && /*#__PURE__*/ jsx(AutopilotChatActionButton, {
|
|
126
126
|
ref: setHistoryAnchorElement,
|
|
127
127
|
iconName: "history",
|
|
128
128
|
variant: "custom",
|
|
@@ -150,7 +150,7 @@ function AutopilotChatHeaderActionsComponent() {
|
|
|
150
150
|
onClick: handleToggleChat,
|
|
151
151
|
"data-testid": "autopilot-chat-toggle-fullscreen"
|
|
152
152
|
}),
|
|
153
|
-
customHeaderActions.length > 0 && /*#__PURE__*/ jsxs(Fragment, {
|
|
153
|
+
!readOnly && customHeaderActions.length > 0 && /*#__PURE__*/ jsxs(Fragment, {
|
|
154
154
|
children: [
|
|
155
155
|
/*#__PURE__*/ jsx(AutopilotChatActionButton, {
|
|
156
156
|
iconName: "more_vert",
|
|
@@ -80,7 +80,7 @@ const InputContainer = (0, styles_namespaceObject.styled)('div')(()=>({
|
|
|
80
80
|
margin: '0 auto',
|
|
81
81
|
width: '100%'
|
|
82
82
|
}));
|
|
83
|
-
const FullScreenLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerSeparatorDisabled })=>{
|
|
83
|
+
const FullScreenLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerSeparatorDisabled, readOnly })=>{
|
|
84
84
|
const { setFullScreenContainer } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
85
85
|
const chatInternalService = (0, chat_service_provider_cjs_namespaceObject.useChatService)().__internalService__;
|
|
86
86
|
const mainContainerRef = external_react_default().useRef(null);
|
|
@@ -111,7 +111,7 @@ const FullScreenLayout = ({ historyOpen, settingsOpen, historyDisabled, settings
|
|
|
111
111
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_scroll_container_cjs_namespaceObject.ChatScrollContainer, {
|
|
112
112
|
mode: mode
|
|
113
113
|
}),
|
|
114
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InputBackground, {
|
|
114
|
+
!readOnly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InputBackground, {
|
|
115
115
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InputContainer, {
|
|
116
116
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_input_cjs_namespaceObject.AutopilotChatInput, {})
|
|
117
117
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full-screen-layout.d.ts","sourceRoot":"","sources":["../../../../../../src/material/components/ap-chat/components/layout/full-screen-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,eAAe,CAAC;AA4CvB,UAAU,qBAAqB;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"full-screen-layout.d.ts","sourceRoot":"","sources":["../../../../../../src/material/components/ap-chat/components/layout/full-screen-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,eAAe,CAAC;AA4CvB,UAAU,qBAAqB;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA4D5D,CAAC"}
|
|
@@ -40,7 +40,7 @@ const InputContainer = styled('div')(()=>({
|
|
|
40
40
|
margin: '0 auto',
|
|
41
41
|
width: '100%'
|
|
42
42
|
}));
|
|
43
|
-
const FullScreenLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerSeparatorDisabled })=>{
|
|
43
|
+
const FullScreenLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerSeparatorDisabled, readOnly })=>{
|
|
44
44
|
const { setFullScreenContainer } = useChatState();
|
|
45
45
|
const chatInternalService = useChatService().__internalService__;
|
|
46
46
|
const mainContainerRef = react.useRef(null);
|
|
@@ -71,7 +71,7 @@ const FullScreenLayout = ({ historyOpen, settingsOpen, historyDisabled, settings
|
|
|
71
71
|
/*#__PURE__*/ jsx(ChatScrollContainer, {
|
|
72
72
|
mode: mode
|
|
73
73
|
}),
|
|
74
|
-
/*#__PURE__*/ jsx(InputBackground, {
|
|
74
|
+
!readOnly && /*#__PURE__*/ jsx(InputBackground, {
|
|
75
75
|
children: /*#__PURE__*/ jsx(InputContainer, {
|
|
76
76
|
children: /*#__PURE__*/ jsx(AutopilotChatInput, {})
|
|
77
77
|
})
|
|
@@ -71,7 +71,7 @@ const InputContainer = (0, styles_namespaceObject.styled)('div')(()=>({
|
|
|
71
71
|
margin: '0 auto',
|
|
72
72
|
width: '100%'
|
|
73
73
|
}));
|
|
74
|
-
const StandardLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerDisabled, headerSeparatorDisabled })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
74
|
+
const StandardLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerDisabled, headerSeparatorDisabled, readOnly })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
75
75
|
children: [
|
|
76
76
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(MainContainer, {
|
|
77
77
|
historyOpen: historyOpen,
|
|
@@ -83,7 +83,7 @@ const StandardLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDi
|
|
|
83
83
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_scroll_container_cjs_namespaceObject.ChatScrollContainer, {
|
|
84
84
|
mode: mode
|
|
85
85
|
}),
|
|
86
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InputBackground, {
|
|
86
|
+
!readOnly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InputBackground, {
|
|
87
87
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InputContainer, {
|
|
88
88
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_input_cjs_namespaceObject.AutopilotChatInput, {})
|
|
89
89
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-layout.d.ts","sourceRoot":"","sources":["../../../../../../src/material/components/ap-chat/components/layout/standard-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,eAAe,CAAC;AAoCvB,UAAU,mBAAmB;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"standard-layout.d.ts","sourceRoot":"","sources":["../../../../../../src/material/components/ap-chat/components/layout/standard-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,eAAe,CAAC;AAoCvB,UAAU,mBAAmB;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyCxD,CAAC"}
|
|
@@ -32,7 +32,7 @@ const InputContainer = styled('div')(()=>({
|
|
|
32
32
|
margin: '0 auto',
|
|
33
33
|
width: '100%'
|
|
34
34
|
}));
|
|
35
|
-
const StandardLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerDisabled, headerSeparatorDisabled })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
35
|
+
const StandardLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDisabled, mode, headerDisabled, headerSeparatorDisabled, readOnly })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
36
36
|
children: [
|
|
37
37
|
/*#__PURE__*/ jsxs(MainContainer, {
|
|
38
38
|
historyOpen: historyOpen,
|
|
@@ -44,7 +44,7 @@ const StandardLayout = ({ historyOpen, settingsOpen, historyDisabled, settingsDi
|
|
|
44
44
|
/*#__PURE__*/ jsx(ChatScrollContainer, {
|
|
45
45
|
mode: mode
|
|
46
46
|
}),
|
|
47
|
-
/*#__PURE__*/ jsx(InputBackground, {
|
|
47
|
+
!readOnly && /*#__PURE__*/ jsx(InputBackground, {
|
|
48
48
|
children: /*#__PURE__*/ jsx(InputContainer, {
|
|
49
49
|
children: /*#__PURE__*/ jsx(AutopilotChatInput, {})
|
|
50
50
|
})
|
|
@@ -47,7 +47,7 @@ const external_chat_actions_list_cjs_namespaceObject = require("./chat-actions-l
|
|
|
47
47
|
function AutopilotChatMessageActionsComponent({ message, containerElement }) {
|
|
48
48
|
const { _ } = (0, react_namespaceObject.useLingui)();
|
|
49
49
|
const chatService = (0, chat_service_provider_cjs_namespaceObject.useChatService)();
|
|
50
|
-
const { disabledFeatures } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
50
|
+
const { disabledFeatures, readOnly } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
51
51
|
const [isLastAssistantMessage, setIsLastAssistantMessage] = external_react_default().useState(false);
|
|
52
52
|
const [isVisible, setIsVisible] = external_react_default().useState(false);
|
|
53
53
|
const isUserInteractingWithActions = external_react_default().useRef(false);
|
|
@@ -78,7 +78,7 @@ function AutopilotChatMessageActionsComponent({ message, containerElement }) {
|
|
|
78
78
|
icon: 'content_copy',
|
|
79
79
|
eventName: index_cjs_namespaceObject.AutopilotChatEvent.Copy
|
|
80
80
|
});
|
|
81
|
-
if (message.role !== index_cjs_namespaceObject.AutopilotChatRole.Assistant || disabledFeatures.feedback) return baseActions;
|
|
81
|
+
if (message.role !== index_cjs_namespaceObject.AutopilotChatRole.Assistant || readOnly || disabledFeatures.feedback) return baseActions;
|
|
82
82
|
if (message.feedback) {
|
|
83
83
|
const { isPositive } = message.feedback;
|
|
84
84
|
return [
|
|
@@ -124,6 +124,7 @@ function AutopilotChatMessageActionsComponent({ message, containerElement }) {
|
|
|
124
124
|
];
|
|
125
125
|
}, [
|
|
126
126
|
message,
|
|
127
|
+
readOnly,
|
|
127
128
|
disabledFeatures.feedback,
|
|
128
129
|
disabledFeatures.copy,
|
|
129
130
|
_
|
|
@@ -9,7 +9,7 @@ import { AutopilotChatActionsList } from "./chat-actions-list.js";
|
|
|
9
9
|
function AutopilotChatMessageActionsComponent({ message, containerElement }) {
|
|
10
10
|
const { _ } = useLingui();
|
|
11
11
|
const chatService = useChatService();
|
|
12
|
-
const { disabledFeatures } = useChatState();
|
|
12
|
+
const { disabledFeatures, readOnly } = useChatState();
|
|
13
13
|
const [isLastAssistantMessage, setIsLastAssistantMessage] = react.useState(false);
|
|
14
14
|
const [isVisible, setIsVisible] = react.useState(false);
|
|
15
15
|
const isUserInteractingWithActions = react.useRef(false);
|
|
@@ -40,7 +40,7 @@ function AutopilotChatMessageActionsComponent({ message, containerElement }) {
|
|
|
40
40
|
icon: 'content_copy',
|
|
41
41
|
eventName: AutopilotChatEvent.Copy
|
|
42
42
|
});
|
|
43
|
-
if (message.role !== AutopilotChatRole.Assistant || disabledFeatures.feedback) return baseActions;
|
|
43
|
+
if (message.role !== AutopilotChatRole.Assistant || readOnly || disabledFeatures.feedback) return baseActions;
|
|
44
44
|
if (message.feedback) {
|
|
45
45
|
const { isPositive } = message.feedback;
|
|
46
46
|
return [
|
|
@@ -86,6 +86,7 @@ function AutopilotChatMessageActionsComponent({ message, containerElement }) {
|
|
|
86
86
|
];
|
|
87
87
|
}, [
|
|
88
88
|
message,
|
|
89
|
+
readOnly,
|
|
89
90
|
disabledFeatures.feedback,
|
|
90
91
|
disabledFeatures.copy,
|
|
91
92
|
_
|
|
@@ -130,6 +130,7 @@ const AutopilotChatStateProvider = ({ children, portalContainer })=>{
|
|
|
130
130
|
suggestions: []
|
|
131
131
|
});
|
|
132
132
|
const [hasMessages, setHasMessages] = external_react_default().useState(false);
|
|
133
|
+
const [readOnly, setReadOnly] = external_react_default().useState(chatService?.getReadOnly() ?? false);
|
|
133
134
|
const [spacing, setSpacing] = external_react_default().useState(calculateSpacing(chatService?.getConfig()?.spacing));
|
|
134
135
|
const [theming, setTheming] = external_react_default().useState(chatService?.getConfig()?.theming);
|
|
135
136
|
external_react_default().useEffect(()=>{
|
|
@@ -155,6 +156,9 @@ const AutopilotChatStateProvider = ({ children, portalContainer })=>{
|
|
|
155
156
|
const unsubscribeAllowedAttachments = chatInternalService.on(index_cjs_namespaceObject.AutopilotChatInternalEvent.SetAllowedAttachments, (allowed)=>{
|
|
156
157
|
setAllowedAttachments(allowed);
|
|
157
158
|
});
|
|
159
|
+
const unsubscribeReadOnly = chatService.on(index_cjs_namespaceObject.AutopilotChatEvent.SetReadOnly, (isReadOnly)=>{
|
|
160
|
+
setReadOnly(isReadOnly);
|
|
161
|
+
});
|
|
158
162
|
const unsubscribeSpacing = chatInternalService.on(index_cjs_namespaceObject.AutopilotChatInternalEvent.SetSpacing, (spacingConfig)=>{
|
|
159
163
|
setSpacing(calculateSpacing(spacingConfig));
|
|
160
164
|
});
|
|
@@ -168,6 +172,7 @@ const AutopilotChatStateProvider = ({ children, portalContainer })=>{
|
|
|
168
172
|
unsubscribeDisabledFeatures();
|
|
169
173
|
unsubscribeOverrideLabels();
|
|
170
174
|
unsubscribeFirstRunExperience();
|
|
175
|
+
unsubscribeReadOnly();
|
|
171
176
|
unsubscribeAllowedAttachments();
|
|
172
177
|
unsubscribeSpacing();
|
|
173
178
|
unsubscribeTheming();
|
|
@@ -192,7 +197,8 @@ const AutopilotChatStateProvider = ({ children, portalContainer })=>{
|
|
|
192
197
|
setHasMessages,
|
|
193
198
|
spacing,
|
|
194
199
|
theming,
|
|
195
|
-
portalContainer
|
|
200
|
+
portalContainer,
|
|
201
|
+
readOnly
|
|
196
202
|
}), [
|
|
197
203
|
historyOpen,
|
|
198
204
|
settingsOpen,
|
|
@@ -209,7 +215,8 @@ const AutopilotChatStateProvider = ({ children, portalContainer })=>{
|
|
|
209
215
|
setHasMessages,
|
|
210
216
|
spacing,
|
|
211
217
|
theming,
|
|
212
|
-
portalContainer
|
|
218
|
+
portalContainer,
|
|
219
|
+
readOnly
|
|
213
220
|
]);
|
|
214
221
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AutopilotChatStateContext.Provider, {
|
|
215
222
|
value: value,
|
|
@@ -20,6 +20,7 @@ interface AutopilotChatStateContextType {
|
|
|
20
20
|
spacing: DeepRequired<NonNullable<AutopilotChatConfiguration['spacing']>>;
|
|
21
21
|
theming?: AutopilotChatConfiguration['theming'];
|
|
22
22
|
portalContainer?: HTMLElement;
|
|
23
|
+
readOnly: boolean;
|
|
23
24
|
}
|
|
24
25
|
interface AutopilotChatStateProviderProps {
|
|
25
26
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-state-provider.d.ts","sourceRoot":"","sources":["../../../../../src/material/components/ap-chat/providers/chat-state-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAGlC,iBAAiB,EACjB,KAAK,2BAA2B,EAUjC,MAAM,YAAY,CAAC;AAIpB,KAAK,YAAY,CAAC,CAAC,IAAI;KACpB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACrC,CAAC;AAEF,UAAU,6BAA6B;IACrC,oBAAoB,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC,uBAAuB,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,mBAAmB,EAAE,WAAW,GAAG,IAAI,CAAC;IACxC,sBAAsB,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9D,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,cAAc,EAAE,2BAA2B,CAAC;IAC5C,kBAAkB,EAAE,0BAA0B,CAAC,oBAAoB,CAAC,CAAC;IACrE,kBAAkB,EAAE,+BAA+B,CAAC;IACpD,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1E,OAAO,CAAC,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAChD,eAAe,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-state-provider.d.ts","sourceRoot":"","sources":["../../../../../src/material/components/ap-chat/providers/chat-state-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAGlC,iBAAiB,EACjB,KAAK,2BAA2B,EAUjC,MAAM,YAAY,CAAC;AAIpB,KAAK,YAAY,CAAC,CAAC,IAAI;KACpB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACrC,CAAC;AAEF,UAAU,6BAA6B;IACrC,oBAAoB,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC,uBAAuB,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,mBAAmB,EAAE,WAAW,GAAG,IAAI,CAAC;IACxC,sBAAsB,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9D,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,cAAc,EAAE,2BAA2B,CAAC;IAC5C,kBAAkB,EAAE,0BAA0B,CAAC,oBAAoB,CAAC,CAAC;IACrE,kBAAkB,EAAE,+BAA+B,CAAC;IACpD,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1E,OAAO,CAAC,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAChD,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAID,UAAU,+BAA+B;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,WAAW,CAAC;CAC/B;AA4ED,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CA6KhF,CAAC;AAEF,eAAO,MAAM,YAAY,qCAQxB,CAAC"}
|