@opengeni/react 2.5.0-canary.2 → 3.0.0-canary.0
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/README.md +15 -0
- package/dist/accounts.d.ts +64 -0
- package/dist/accounts.js +746 -0
- package/dist/accounts.js.map +1 -0
- package/dist/{browser-viewer-GXUICIAG.js → browser-viewer-AEFHUYZK.js} +3 -3
- package/dist/{chunk-MXJGO7LE.js → chunk-D3UIAJKY.js} +52 -2
- package/dist/chunk-D3UIAJKY.js.map +1 -0
- package/dist/{chunk-QGBJ6GHG.js → chunk-ELIYWBZR.js} +4 -4
- package/dist/{chunk-6H6S5V4Z.js → chunk-HQVCKCLG.js} +758 -871
- package/dist/chunk-HQVCKCLG.js.map +1 -0
- package/dist/{chunk-T7VAYG2I.js → chunk-MZ2G2XBA.js} +54 -2
- package/dist/chunk-MZ2G2XBA.js.map +1 -0
- package/dist/{chunk-X4JAFD5R.js → chunk-OAM4WAAM.js} +4 -4
- package/dist/{chunk-ZUT5QSQB.js → chunk-RGALCTWO.js} +57 -17
- package/dist/{chunk-ZUT5QSQB.js.map → chunk-RGALCTWO.js.map} +1 -1
- package/dist/chunk-YFKJ7VZH.js +268 -0
- package/dist/chunk-YFKJ7VZH.js.map +1 -0
- package/dist/{chunk-ATQJEWCA.js → chunk-YJFGAFBD.js} +124 -50
- package/dist/chunk-YJFGAFBD.js.map +1 -0
- package/dist/components/composer.d.ts +8 -0
- package/dist/components/file-browser.d.ts +4 -1
- package/dist/components/sandbox-files.d.ts +4 -1
- package/dist/components/sandbox-workspace.d.ts +5 -0
- package/dist/composer.js +3 -3
- package/dist/{computer-viewer-ZOP4Q7A7.js → computer-viewer-FWEZISW4.js} +3 -3
- package/dist/embedded-session-client.d.ts +23 -0
- package/dist/file-node-visibility.d.ts +15 -0
- package/dist/hooks/use-file-attachments.d.ts +9 -2
- package/dist/human-input.d.ts +3 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +139 -53
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +3 -3
- package/dist/session-ui.js +4 -4
- package/dist/session.d.ts +2 -0
- package/dist/session.js +7 -5
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/screenshot-lightbox.d.ts +16 -1
- package/package.json +6 -2
- package/src/accounts.tsx +970 -0
- package/src/components/chat-composer.tsx +88 -84
- package/src/components/composer.tsx +53 -11
- package/src/components/file-browser.tsx +33 -20
- package/src/components/human-input-surface.tsx +10 -6
- package/src/components/message-timeline.tsx +37 -9
- package/src/components/sandbox-files.tsx +42 -2
- package/src/components/sandbox-workspace.tsx +10 -0
- package/src/embedded-session-client.ts +104 -0
- package/src/file-node-visibility.ts +66 -0
- package/src/hooks/use-composer.ts +64 -2
- package/src/hooks/use-file-attachments.ts +38 -6
- package/src/hooks/use-human-input.ts +31 -4
- package/src/human-input.ts +12 -1
- package/src/index.ts +12 -0
- package/src/session.ts +5 -0
- package/src/timeline/index.ts +1 -0
- package/src/timeline/screenshot-lightbox.tsx +93 -29
- package/styles/compiled.css +11 -1
- package/styles/tokens.css +3 -1
- package/dist/chunk-6H6S5V4Z.js.map +0 -1
- package/dist/chunk-ATQJEWCA.js.map +0 -1
- package/dist/chunk-FK6VG4LL.js +0 -90
- package/dist/chunk-FK6VG4LL.js.map +0 -1
- package/dist/chunk-MXJGO7LE.js.map +0 -1
- package/dist/chunk-T7VAYG2I.js.map +0 -1
- /package/dist/{browser-viewer-GXUICIAG.js.map → browser-viewer-AEFHUYZK.js.map} +0 -0
- /package/dist/{chunk-QGBJ6GHG.js.map → chunk-ELIYWBZR.js.map} +0 -0
- /package/dist/{chunk-X4JAFD5R.js.map → chunk-OAM4WAAM.js.map} +0 -0
- /package/dist/{computer-viewer-ZOP4Q7A7.js.map → computer-viewer-FWEZISW4.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
shouldSteerOnKey,
|
|
3
3
|
shouldSubmitOnKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MZ2G2XBA.js";
|
|
5
5
|
import {
|
|
6
6
|
groupPickerRowsByBillingClass
|
|
7
7
|
} from "./chunk-X4A66EWZ.js";
|
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
Tooltip,
|
|
10
10
|
TooltipContent,
|
|
11
11
|
TooltipProvider,
|
|
12
|
-
TooltipTrigger
|
|
13
|
-
|
|
12
|
+
TooltipTrigger,
|
|
13
|
+
useLightboxOptional
|
|
14
|
+
} from "./chunk-YFKJ7VZH.js";
|
|
14
15
|
import {
|
|
15
16
|
ComposerResponsiveContext
|
|
16
17
|
} from "./chunk-VZTQ73XT.js";
|
|
@@ -2936,6 +2937,10 @@ var defaultChatComposerMessages = {
|
|
|
2936
2937
|
removeRestoredResource: (index) => `Remove restored resource ${index + 1}`,
|
|
2937
2938
|
uploading: "Uploading",
|
|
2938
2939
|
uploadFailed: "Upload failed",
|
|
2940
|
+
previewAttachment: (name) => `Preview ${name}`,
|
|
2941
|
+
attachmentPreviewLabel: "Attachment preview",
|
|
2942
|
+
downloadAttachment: (name) => `Download ${name}`,
|
|
2943
|
+
closeAttachmentPreview: "Close",
|
|
2939
2944
|
retryAttachment: (name) => `Retry ${name}`,
|
|
2940
2945
|
retryUpload: "Retry upload",
|
|
2941
2946
|
removeAttachment: (name) => `Remove ${name}`,
|
|
@@ -3047,29 +3052,31 @@ function useChatComposerController({
|
|
|
3047
3052
|
const [submitting, setSubmitting] = useState4(false);
|
|
3048
3053
|
const submittingRef = useRef4(false);
|
|
3049
3054
|
const controlOperationRef = useRef4(false);
|
|
3055
|
+
const deliveryValue = delivery.value;
|
|
3056
|
+
const setDeliveryValue = delivery.setValue;
|
|
3050
3057
|
const mountedRef = useRef4(true);
|
|
3051
|
-
const deliveredValueRef = useRef4(
|
|
3052
|
-
const liveValueRef = useRef4(
|
|
3053
|
-
const [renderedValue, setRenderedValue] = useState4(
|
|
3054
|
-
const deliveryChanged =
|
|
3058
|
+
const deliveredValueRef = useRef4(deliveryValue);
|
|
3059
|
+
const liveValueRef = useRef4(deliveryValue);
|
|
3060
|
+
const [renderedValue, setRenderedValue] = useState4(deliveryValue);
|
|
3061
|
+
const deliveryChanged = deliveryValue !== deliveredValueRef.current;
|
|
3055
3062
|
if (deliveryChanged) {
|
|
3056
|
-
deliveredValueRef.current =
|
|
3057
|
-
liveValueRef.current =
|
|
3063
|
+
deliveredValueRef.current = deliveryValue;
|
|
3064
|
+
liveValueRef.current = deliveryValue;
|
|
3058
3065
|
}
|
|
3059
3066
|
const setComposerValue = useCallback4(
|
|
3060
3067
|
(next) => {
|
|
3061
3068
|
liveValueRef.current = next;
|
|
3062
3069
|
setRenderedValue(next);
|
|
3063
|
-
|
|
3070
|
+
setDeliveryValue(next);
|
|
3064
3071
|
},
|
|
3065
|
-
[
|
|
3072
|
+
[setDeliveryValue]
|
|
3066
3073
|
);
|
|
3067
|
-
const visibleValue = deliveryChanged ?
|
|
3074
|
+
const visibleValue = deliveryChanged ? deliveryValue : renderedValue;
|
|
3068
3075
|
useLayoutEffect(() => {
|
|
3069
3076
|
if (renderedValue !== liveValueRef.current) {
|
|
3070
3077
|
setRenderedValue(liveValueRef.current);
|
|
3071
3078
|
}
|
|
3072
|
-
}, [
|
|
3079
|
+
}, [deliveryValue, renderedValue]);
|
|
3073
3080
|
useEffect3(() => {
|
|
3074
3081
|
mountedRef.current = true;
|
|
3075
3082
|
return () => {
|
|
@@ -3498,7 +3505,8 @@ function Attachments() {
|
|
|
3498
3505
|
attachments: controller.attachments.attachments,
|
|
3499
3506
|
messages: controller.messages,
|
|
3500
3507
|
onRemove: controller.attachments.remove,
|
|
3501
|
-
onRetry: controller.attachments.retry
|
|
3508
|
+
onRetry: controller.attachments.retry,
|
|
3509
|
+
onRetainPreview: controller.attachments.retainPreview
|
|
3502
3510
|
}
|
|
3503
3511
|
);
|
|
3504
3512
|
}
|
|
@@ -4016,8 +4024,10 @@ function AttachmentChips({
|
|
|
4016
4024
|
attachments,
|
|
4017
4025
|
messages,
|
|
4018
4026
|
onRemove,
|
|
4019
|
-
onRetry
|
|
4027
|
+
onRetry,
|
|
4028
|
+
onRetainPreview
|
|
4020
4029
|
}) {
|
|
4030
|
+
const lightbox = useLightboxOptional();
|
|
4021
4031
|
return /* @__PURE__ */ jsx3("div", { className: "flex flex-wrap gap-2 px-3 py-2", children: attachments.map((attachment) => {
|
|
4022
4032
|
const failed = attachment.status === "failed";
|
|
4023
4033
|
const statusText = attachment.status === "uploading" ? messages.uploading : failed ? attachment.error || messages.uploadFailed : messages.formatBytes(attachment.sizeBytes);
|
|
@@ -4029,7 +4039,37 @@ function AttachmentChips({
|
|
|
4029
4039
|
failed ? "border-og-status-failed/40 bg-og-status-failed/10" : "border-og-border bg-og-surface-2"
|
|
4030
4040
|
),
|
|
4031
4041
|
children: [
|
|
4032
|
-
attachment.previewUrl ? /* @__PURE__ */ jsx3(
|
|
4042
|
+
attachment.previewUrl && lightbox ? /* @__PURE__ */ jsx3(
|
|
4043
|
+
"button",
|
|
4044
|
+
{
|
|
4045
|
+
type: "button",
|
|
4046
|
+
className: "size-8 shrink-0 overflow-hidden rounded outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent",
|
|
4047
|
+
"aria-label": messages.previewAttachment(attachment.name),
|
|
4048
|
+
onClick: (event) => {
|
|
4049
|
+
const releasePreview = onRetainPreview(attachment.id);
|
|
4050
|
+
lightbox.open(
|
|
4051
|
+
attachment.previewUrl,
|
|
4052
|
+
attachment.name,
|
|
4053
|
+
event.currentTarget,
|
|
4054
|
+
messages.attachmentPreviewLabel,
|
|
4055
|
+
attachment.name,
|
|
4056
|
+
{
|
|
4057
|
+
download: messages.downloadAttachment(attachment.name),
|
|
4058
|
+
close: messages.closeAttachmentPreview
|
|
4059
|
+
},
|
|
4060
|
+
releasePreview
|
|
4061
|
+
);
|
|
4062
|
+
},
|
|
4063
|
+
children: /* @__PURE__ */ jsx3(
|
|
4064
|
+
"img",
|
|
4065
|
+
{
|
|
4066
|
+
src: attachment.previewUrl,
|
|
4067
|
+
alt: "",
|
|
4068
|
+
className: "h-full w-full object-cover transition-opacity hover:opacity-80"
|
|
4069
|
+
}
|
|
4070
|
+
)
|
|
4071
|
+
}
|
|
4072
|
+
) : attachment.previewUrl ? /* @__PURE__ */ jsx3(
|
|
4033
4073
|
"img",
|
|
4034
4074
|
{
|
|
4035
4075
|
src: attachment.previewUrl,
|
|
@@ -4554,4 +4594,4 @@ export {
|
|
|
4554
4594
|
Status,
|
|
4555
4595
|
ComposerTranscriptionControl
|
|
4556
4596
|
};
|
|
4557
|
-
//# sourceMappingURL=chunk-
|
|
4597
|
+
//# sourceMappingURL=chunk-RGALCTWO.js.map
|