@40rty/ams-ui 0.3.1 → 0.4.2
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/agent.js +5 -5
- package/dist/{chunk-MHUEIBJ3.js → chunk-GQURT3IR.js} +3 -47
- package/dist/{chunk-BFZ3YCUY.js → chunk-H6MSAD5M.js} +1 -40
- package/dist/{chunk-ORIOBWTD.js → chunk-PHXP2SKS.js} +5 -1
- package/dist/{chunk-OKP7MC72.js → chunk-RKPDCXL4.js} +241 -195
- package/dist/{chunk-TEPH476O.js → chunk-RMJDSHLA.js} +6 -36
- package/dist/hooks.js +4 -4
- package/dist/index.js +172 -338
- package/dist/presence.js +3 -4
- package/dist/shell.js +419 -570
- package/dist/thread-panel.js +3 -3
- package/dist/types/agent/presence/AgentAsk.d.ts +13 -0
- package/dist/types/agent/presence/index.d.ts +3 -1
- package/dist/types/agent/presence/read-data.d.ts +5 -0
- package/dist/types/components/ecommerce/cart/CartFoot.d.ts +1 -2
- package/dist/types/components/ecommerce/cart/CartLineRow.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/labels.d.ts +6 -0
- package/dist/types/shell/Composer.d.ts +1 -1
- package/dist/types/shell/ShellScaffold.d.ts +2 -1
- package/dist/types/shell/TurnAsk.d.ts +14 -0
- package/dist/types/shell/composer/AttachmentStrip.d.ts +1 -1
- package/dist/types/shell/dock-context.d.ts +1 -1
- package/dist/types/shell/index.d.ts +2 -2
- package/dist/types/shell/mobile/IslandComposeGroup.d.ts +1 -1
- package/dist/types/shell/mobile/IslandInputBar.d.ts +1 -1
- package/dist/types/shell/mobile/MorphIsland.d.ts +1 -1
- package/dist/types/shell/mobile/RestIsland.d.ts +1 -1
- package/dist/types/shell/slots.d.ts +1 -5
- package/package.json +3 -4
- package/dist/types/agent/presence/use-forget-fact.d.ts +0 -56
- package/dist/types/components/ecommerce/cart/use-cart-view.d.ts +0 -50
- package/dist/types/hooks/use-projection.d.ts +0 -24
- package/dist/types/shell/composer/heic-convert.d.ts +0 -6
- package/dist/types/shell/composer/useComposerAttachments.d.ts +0 -37
- package/dist/types/shell/composer/usePromptComposer.d.ts +0 -51
- package/dist/types/shell/use-dock-state.d.ts +0 -54
- package/dist/types/utils/use-is-seed-home.d.ts +0 -13
- package/dist/types/utils/use-safe-cart.d.ts +0 -17
- package/dist/types/utils/use-safe-facts.d.ts +0 -9
- package/dist/types/utils/use-safe-fourty-session.d.ts +0 -15
package/dist/shell.js
CHANGED
|
@@ -3,9 +3,8 @@ import {
|
|
|
3
3
|
SIDE_DOCK_EASE,
|
|
4
4
|
SIDE_DOCK_REVEAL_MS,
|
|
5
5
|
SideDock,
|
|
6
|
-
useDockState,
|
|
7
6
|
useSideDockSpacing
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-H6MSAD5M.js";
|
|
9
8
|
import {
|
|
10
9
|
DragSheet,
|
|
11
10
|
Spinner,
|
|
@@ -17,8 +16,8 @@ import {
|
|
|
17
16
|
AgentPresenceWidget,
|
|
18
17
|
PresenceBriefRail,
|
|
19
18
|
useLabels
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-RKPDCXL4.js";
|
|
20
|
+
import "./chunk-RMJDSHLA.js";
|
|
22
21
|
import {
|
|
23
22
|
AgentCaret,
|
|
24
23
|
AnimatePresence,
|
|
@@ -36,12 +35,12 @@ import {
|
|
|
36
35
|
import {
|
|
37
36
|
submitOnEnter,
|
|
38
37
|
useScrollThreshold
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-PHXP2SKS.js";
|
|
39
|
+
import "./chunk-GQURT3IR.js";
|
|
41
40
|
|
|
42
41
|
// src/shell/Composer.tsx
|
|
43
|
-
import * as
|
|
44
|
-
import { useFourtySession as
|
|
42
|
+
import * as React10 from "react";
|
|
43
|
+
import { useFourtySession as useFourtySession2, useConversationState, useComposerPlaceholder as useComposerPlaceholder2, useFormFactor as useFormFactor5 } from "@40rty/ams-sdk";
|
|
45
44
|
import { ThreadHeadroom, useHydrated, useScrollHasMoreBelow, useThreadRows, useThreadJumpMarks, useThreadLanding } from "@40rty/ams-sdk";
|
|
46
45
|
|
|
47
46
|
// src/shell/thread-reland.ts
|
|
@@ -572,219 +571,18 @@ function InlineCompletion({
|
|
|
572
571
|
);
|
|
573
572
|
}
|
|
574
573
|
|
|
575
|
-
// src/shell/
|
|
576
|
-
import
|
|
577
|
-
import { useFourtySession as useFourtySession2, useVoiceCapture, useComposerDraft } from "@40rty/ams-sdk";
|
|
578
|
-
|
|
579
|
-
// src/shell/composer/useComposerAttachments.ts
|
|
580
|
-
import * as React4 from "react";
|
|
581
|
-
import { useFourtySession } from "@40rty/ams-sdk";
|
|
582
|
-
import { mintId } from "@40rty/ams-sdk";
|
|
583
|
-
import { ALLOWED_ATTACHMENT_TYPES, MAX_ATTACHMENT_BYTES, isAllowedAttachmentType, isImageAttachment } from "@40rty/ams-sdk";
|
|
584
|
-
|
|
585
|
-
// src/shell/composer/heic-convert.ts
|
|
586
|
-
var HEIC_EXT = /\.hei[cf]$/i;
|
|
587
|
-
function isHeic(file) {
|
|
588
|
-
const type = file.type.toLowerCase();
|
|
589
|
-
if (type === "image/heic" || type === "image/heif") return true;
|
|
590
|
-
if (type.length === 0) return HEIC_EXT.test(file.name);
|
|
591
|
-
return false;
|
|
592
|
-
}
|
|
593
|
-
async function heicToJpeg(file) {
|
|
594
|
-
const { default: heic2any } = await import("heic2any");
|
|
595
|
-
const converted = await heic2any({ blob: file, toType: "image/jpeg", quality: 0.9 });
|
|
596
|
-
const blob = Array.isArray(converted) ? converted[0] : converted;
|
|
597
|
-
const base = file.name.replace(HEIC_EXT, "");
|
|
598
|
-
const name = `${base.length > 0 ? base : "image"}.jpg`;
|
|
599
|
-
return new File([blob], name, { type: "image/jpeg" });
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
// src/shell/composer/useComposerAttachments.ts
|
|
603
|
-
var ATTACHMENT_ACCEPT = ALLOWED_ATTACHMENT_TYPES.join(",");
|
|
604
|
-
var MAX_MB = Math.round(MAX_ATTACHMENT_BYTES / (1024 * 1024));
|
|
605
|
-
function validate(file) {
|
|
606
|
-
if (file.size === 0) return "File is empty.";
|
|
607
|
-
if (!isAllowedAttachmentType(file.type)) {
|
|
608
|
-
return file.type.length > 0 ? `${file.type} isn't supported.` : "This file type isn't supported.";
|
|
609
|
-
}
|
|
610
|
-
if (file.size > MAX_ATTACHMENT_BYTES) return `File is larger than ${MAX_MB}MB.`;
|
|
611
|
-
return null;
|
|
612
|
-
}
|
|
613
|
-
function useComposerAttachments() {
|
|
614
|
-
const session = useFourtySession();
|
|
615
|
-
const [attachments, setAttachments] = React4.useState([]);
|
|
616
|
-
const createdUrls = React4.useRef(/* @__PURE__ */ new Set());
|
|
617
|
-
const update = React4.useCallback((localId, patch) => {
|
|
618
|
-
setAttachments((prev) => prev.map((a) => a.localId === localId ? { ...a, ...patch } : a));
|
|
619
|
-
}, []);
|
|
620
|
-
const startUpload = React4.useCallback(
|
|
621
|
-
(localId, file) => {
|
|
622
|
-
const error = validate(file);
|
|
623
|
-
if (error !== null) {
|
|
624
|
-
update(localId, { status: "error", error, name: file.name, mimeType: file.type, size: file.size });
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
const previewUrl = isImageAttachment(file.type) ? URL.createObjectURL(file) : null;
|
|
628
|
-
if (previewUrl !== null) createdUrls.current.add(previewUrl);
|
|
629
|
-
update(localId, {
|
|
630
|
-
status: "uploading",
|
|
631
|
-
name: file.name,
|
|
632
|
-
mimeType: file.type,
|
|
633
|
-
size: file.size,
|
|
634
|
-
previewUrl,
|
|
635
|
-
error: null
|
|
636
|
-
});
|
|
637
|
-
session.uploadAttachment(file).then(
|
|
638
|
-
(ref) => update(localId, { status: "ready", ref }),
|
|
639
|
-
(err) => update(localId, {
|
|
640
|
-
status: "error",
|
|
641
|
-
error: err instanceof Error ? err.message : "Upload failed."
|
|
642
|
-
})
|
|
643
|
-
);
|
|
644
|
-
},
|
|
645
|
-
[session, update]
|
|
646
|
-
);
|
|
647
|
-
const addFiles = React4.useCallback(
|
|
648
|
-
(files) => {
|
|
649
|
-
const list = Array.from(files);
|
|
650
|
-
for (const file of list) {
|
|
651
|
-
const localId = mintId("attach");
|
|
652
|
-
setAttachments((prev) => [
|
|
653
|
-
...prev,
|
|
654
|
-
{
|
|
655
|
-
localId,
|
|
656
|
-
name: file.name,
|
|
657
|
-
mimeType: file.type,
|
|
658
|
-
size: file.size,
|
|
659
|
-
previewUrl: null,
|
|
660
|
-
status: "uploading",
|
|
661
|
-
ref: null,
|
|
662
|
-
error: null
|
|
663
|
-
}
|
|
664
|
-
]);
|
|
665
|
-
if (isHeic(file)) {
|
|
666
|
-
heicToJpeg(file).then(
|
|
667
|
-
(jpeg) => startUpload(localId, jpeg),
|
|
668
|
-
(err) => {
|
|
669
|
-
console.warn("[attachments] HEIC decode failed; uploading original", err);
|
|
670
|
-
startUpload(localId, file);
|
|
671
|
-
}
|
|
672
|
-
);
|
|
673
|
-
continue;
|
|
674
|
-
}
|
|
675
|
-
startUpload(localId, file);
|
|
676
|
-
}
|
|
677
|
-
},
|
|
678
|
-
[startUpload]
|
|
679
|
-
);
|
|
680
|
-
const revoke = React4.useCallback((url) => {
|
|
681
|
-
if (url !== null && createdUrls.current.has(url)) {
|
|
682
|
-
URL.revokeObjectURL(url);
|
|
683
|
-
createdUrls.current.delete(url);
|
|
684
|
-
}
|
|
685
|
-
}, []);
|
|
686
|
-
const remove = React4.useCallback(
|
|
687
|
-
(localId) => {
|
|
688
|
-
setAttachments((prev) => {
|
|
689
|
-
const target = prev.find((a) => a.localId === localId);
|
|
690
|
-
if (target) revoke(target.previewUrl);
|
|
691
|
-
return prev.filter((a) => a.localId !== localId);
|
|
692
|
-
});
|
|
693
|
-
},
|
|
694
|
-
[revoke]
|
|
695
|
-
);
|
|
696
|
-
const clear = React4.useCallback(() => {
|
|
697
|
-
for (const url of createdUrls.current) URL.revokeObjectURL(url);
|
|
698
|
-
createdUrls.current.clear();
|
|
699
|
-
setAttachments([]);
|
|
700
|
-
}, []);
|
|
701
|
-
React4.useEffect(
|
|
702
|
-
() => () => {
|
|
703
|
-
for (const url of createdUrls.current) URL.revokeObjectURL(url);
|
|
704
|
-
createdUrls.current.clear();
|
|
705
|
-
},
|
|
706
|
-
[]
|
|
707
|
-
);
|
|
708
|
-
const hasPending = attachments.some((a) => a.status === "uploading");
|
|
709
|
-
const readyRefs = React4.useMemo(
|
|
710
|
-
() => attachments.filter((a) => a.ref !== null).map((a) => a.ref),
|
|
711
|
-
[attachments]
|
|
712
|
-
);
|
|
713
|
-
return { attachments, addFiles, remove, clear, hasPending, readyRefs };
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
// src/shell/composer/usePromptComposer.ts
|
|
717
|
-
function usePromptComposer(options = {}) {
|
|
718
|
-
const { attachments: attachmentsController } = options;
|
|
719
|
-
const session = useFourtySession2();
|
|
720
|
-
const internalAttach = useComposerAttachments();
|
|
721
|
-
const attach = attachmentsController !== void 0 ? attachmentsController : internalAttach;
|
|
722
|
-
const [value, setValue] = useComposerDraft();
|
|
723
|
-
const dictationBaseRef = React5.useRef("");
|
|
724
|
-
const handleDictationResult = React5.useCallback((transcript) => {
|
|
725
|
-
const base = dictationBaseRef.current;
|
|
726
|
-
setValue(base.length > 0 ? `${base} ${transcript}` : transcript);
|
|
727
|
-
}, [setValue]);
|
|
728
|
-
const submitRef = React5.useRef(() => {
|
|
729
|
-
});
|
|
730
|
-
const voiceCapture = useVoiceCapture({
|
|
731
|
-
onResult: handleDictationResult,
|
|
732
|
-
onCommit: () => submitRef.current()
|
|
733
|
-
});
|
|
734
|
-
const valueRef = React5.useRef(value);
|
|
735
|
-
valueRef.current = value;
|
|
736
|
-
const toggleDictation = React5.useCallback(() => {
|
|
737
|
-
if (voiceCapture.state !== "listening") {
|
|
738
|
-
dictationBaseRef.current = valueRef.current;
|
|
739
|
-
}
|
|
740
|
-
voiceCapture.toggle();
|
|
741
|
-
}, [voiceCapture]);
|
|
742
|
-
const onPaste = React5.useCallback(
|
|
743
|
-
(e) => {
|
|
744
|
-
const files = e.clipboardData.files;
|
|
745
|
-
if (files.length > 0) {
|
|
746
|
-
e.preventDefault();
|
|
747
|
-
attach.addFiles(files);
|
|
748
|
-
}
|
|
749
|
-
},
|
|
750
|
-
[attach]
|
|
751
|
-
);
|
|
752
|
-
const canSend = (value.trim().length > 0 || attach.readyRefs.length > 0) && !attach.hasPending;
|
|
753
|
-
const submit = React5.useCallback(() => {
|
|
754
|
-
if (!((value.trim().length > 0 || attach.readyRefs.length > 0) && !attach.hasPending)) return;
|
|
755
|
-
voiceCapture.cancel();
|
|
756
|
-
session.sendMessage(
|
|
757
|
-
value,
|
|
758
|
-
attach.readyRefs.length > 0 ? { attachments: attach.readyRefs } : void 0
|
|
759
|
-
);
|
|
760
|
-
setValue("");
|
|
761
|
-
attach.clear();
|
|
762
|
-
}, [session, value, attach, setValue, voiceCapture]);
|
|
763
|
-
submitRef.current = submit;
|
|
764
|
-
return {
|
|
765
|
-
value,
|
|
766
|
-
setValue,
|
|
767
|
-
attachments: attach,
|
|
768
|
-
dictation: {
|
|
769
|
-
listening: voiceCapture.state === "listening",
|
|
770
|
-
supported: voiceCapture.supported,
|
|
771
|
-
toggle: toggleDictation
|
|
772
|
-
},
|
|
773
|
-
onPaste,
|
|
774
|
-
canSend,
|
|
775
|
-
submit
|
|
776
|
-
};
|
|
777
|
-
}
|
|
574
|
+
// src/shell/Composer.tsx
|
|
575
|
+
import { usePromptComposer } from "@40rty/ams-sdk";
|
|
778
576
|
|
|
779
577
|
// src/shell/composer/AttachmentStrip.tsx
|
|
780
|
-
import * as
|
|
578
|
+
import * as React4 from "react";
|
|
781
579
|
import { X, FileText, AlertCircle, ImageOff } from "lucide-react";
|
|
782
|
-
import { isImageAttachment
|
|
580
|
+
import { isImageAttachment } from "@40rty/ams-sdk";
|
|
783
581
|
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
784
582
|
var STRIP_CLASS = "fourty-composer-attachments";
|
|
785
583
|
var THUMB = 52;
|
|
786
584
|
function Thumb({ a }) {
|
|
787
|
-
const [imgFailed, setImgFailed] =
|
|
585
|
+
const [imgFailed, setImgFailed] = React4.useState(false);
|
|
788
586
|
if (a.previewUrl !== null && !imgFailed) {
|
|
789
587
|
return /* @__PURE__ */ jsx6(
|
|
790
588
|
"img",
|
|
@@ -796,7 +594,7 @@ function Thumb({ a }) {
|
|
|
796
594
|
}
|
|
797
595
|
);
|
|
798
596
|
}
|
|
799
|
-
const Icon =
|
|
597
|
+
const Icon = isImageAttachment(a.mimeType) ? ImageOff : FileText;
|
|
800
598
|
return /* @__PURE__ */ jsxs2(
|
|
801
599
|
"div",
|
|
802
600
|
{
|
|
@@ -925,13 +723,14 @@ function AttachmentStrip({
|
|
|
925
723
|
}
|
|
926
724
|
|
|
927
725
|
// src/shell/composer/AttachButton.tsx
|
|
928
|
-
import * as
|
|
726
|
+
import * as React5 from "react";
|
|
929
727
|
import { Image as ImageIcon } from "lucide-react";
|
|
728
|
+
import { ATTACHMENT_ACCEPT } from "@40rty/ams-sdk";
|
|
930
729
|
import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
931
730
|
var ATTACH_CLASS = "fourty-composer-attach";
|
|
932
731
|
var ATTACH_COLOR = "var(--fourty-attach-color, var(--color-text-muted))";
|
|
933
732
|
function AttachButton({ onFiles, className, style }) {
|
|
934
|
-
const inputRef =
|
|
733
|
+
const inputRef = React5.useRef(null);
|
|
935
734
|
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
936
735
|
/* @__PURE__ */ jsx7(
|
|
937
736
|
"input",
|
|
@@ -1030,7 +829,7 @@ function ClearSessionButton({
|
|
|
1030
829
|
}
|
|
1031
830
|
|
|
1032
831
|
// src/shell/composer/ConversationHistoryButton.tsx
|
|
1033
|
-
import * as
|
|
832
|
+
import * as React6 from "react";
|
|
1034
833
|
import { History, Check } from "lucide-react";
|
|
1035
834
|
import { useFormFactor as useFormFactor2 } from "@40rty/ams-sdk";
|
|
1036
835
|
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -1047,10 +846,10 @@ function ConversationHistoryButton({
|
|
|
1047
846
|
className,
|
|
1048
847
|
style
|
|
1049
848
|
}) {
|
|
1050
|
-
const [open, setOpen] =
|
|
1051
|
-
const rootRef =
|
|
849
|
+
const [open, setOpen] = React6.useState(false);
|
|
850
|
+
const rootRef = React6.useRef(null);
|
|
1052
851
|
const { isMobile } = useFormFactor2();
|
|
1053
|
-
|
|
852
|
+
React6.useEffect(() => {
|
|
1054
853
|
if (!open) return;
|
|
1055
854
|
const root = rootRef.current;
|
|
1056
855
|
if (!root) return;
|
|
@@ -1185,9 +984,9 @@ function formatRelative(ts) {
|
|
|
1185
984
|
}
|
|
1186
985
|
|
|
1187
986
|
// src/shell/composer/ShareCanvasButton.tsx
|
|
1188
|
-
import * as
|
|
987
|
+
import * as React7 from "react";
|
|
1189
988
|
import { Check as Check2, Share2 } from "lucide-react";
|
|
1190
|
-
import { useFormFactor as useFormFactor3, useFourtySession
|
|
989
|
+
import { useFormFactor as useFormFactor3, useFourtySession } from "@40rty/ams-sdk";
|
|
1191
990
|
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1192
991
|
var SHARE_CLASS = "fourty-composer-share";
|
|
1193
992
|
var SHARE_COLOR = "var(--fourty-clear-color, var(--color-text-muted))";
|
|
@@ -1198,16 +997,16 @@ var SHARE_HOVER_COLOR = "var(--fourty-clear-hover-color, var(--fourty-clear-colo
|
|
|
1198
997
|
var ACK_MS = 2200;
|
|
1199
998
|
var LINK_DAYS = 30;
|
|
1200
999
|
function ShareCanvasButton() {
|
|
1201
|
-
const { sessionId, shareCanvas } =
|
|
1000
|
+
const { sessionId, shareCanvas } = useFourtySession();
|
|
1202
1001
|
const labels = useLabels();
|
|
1203
1002
|
const { isMobile } = useFormFactor3();
|
|
1204
|
-
const [phase, setPhase] =
|
|
1205
|
-
const rootRef =
|
|
1206
|
-
const ackRef =
|
|
1207
|
-
|
|
1003
|
+
const [phase, setPhase] = React7.useState({ kind: "closed" });
|
|
1004
|
+
const rootRef = React7.useRef(null);
|
|
1005
|
+
const ackRef = React7.useRef(null);
|
|
1006
|
+
React7.useEffect(() => () => {
|
|
1208
1007
|
if (ackRef.current !== null) clearTimeout(ackRef.current);
|
|
1209
1008
|
}, []);
|
|
1210
|
-
|
|
1009
|
+
React7.useEffect(() => {
|
|
1211
1010
|
if (phase.kind === "closed") return;
|
|
1212
1011
|
const onDown = (e) => {
|
|
1213
1012
|
const root = rootRef.current;
|
|
@@ -1343,7 +1142,7 @@ function ShareCanvasButton() {
|
|
|
1343
1142
|
}
|
|
1344
1143
|
|
|
1345
1144
|
// src/shell/composer/ThreadJumpRail.tsx
|
|
1346
|
-
import * as
|
|
1145
|
+
import * as React8 from "react";
|
|
1347
1146
|
import { useFormFactor as useFormFactor4 } from "@40rty/ams-sdk";
|
|
1348
1147
|
|
|
1349
1148
|
// src/shell/composer/composer-metrics.ts
|
|
@@ -1372,21 +1171,21 @@ var TICK_OPACITY = 0.35;
|
|
|
1372
1171
|
var TICK_CURRENT_OPACITY = 0.9;
|
|
1373
1172
|
function ThreadJumpRail({ marks, className }) {
|
|
1374
1173
|
const { isMobile } = useFormFactor4();
|
|
1375
|
-
const [open, setOpen] =
|
|
1376
|
-
const [rowHoverKey, setRowHoverKey] =
|
|
1377
|
-
const rootRef =
|
|
1378
|
-
const panelRef =
|
|
1379
|
-
const trackRef =
|
|
1380
|
-
const openTimer =
|
|
1381
|
-
const clearOpenTimer =
|
|
1174
|
+
const [open, setOpen] = React8.useState(false);
|
|
1175
|
+
const [rowHoverKey, setRowHoverKey] = React8.useState(null);
|
|
1176
|
+
const rootRef = React8.useRef(null);
|
|
1177
|
+
const panelRef = React8.useRef(null);
|
|
1178
|
+
const trackRef = React8.useRef(null);
|
|
1179
|
+
const openTimer = React8.useRef(null);
|
|
1180
|
+
const clearOpenTimer = React8.useCallback(() => {
|
|
1382
1181
|
if (openTimer.current !== null) {
|
|
1383
1182
|
clearTimeout(openTimer.current);
|
|
1384
1183
|
openTimer.current = null;
|
|
1385
1184
|
}
|
|
1386
1185
|
}, []);
|
|
1387
|
-
|
|
1388
|
-
const [scrubbing, setScrubbing] =
|
|
1389
|
-
const scrub =
|
|
1186
|
+
React8.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
1187
|
+
const [scrubbing, setScrubbing] = React8.useState(false);
|
|
1188
|
+
const scrub = React8.useRef({
|
|
1390
1189
|
startX: 0,
|
|
1391
1190
|
startY: 0,
|
|
1392
1191
|
lastY: 0,
|
|
@@ -1394,14 +1193,14 @@ function ThreadJumpRail({ marks, className }) {
|
|
|
1394
1193
|
timer: null,
|
|
1395
1194
|
active: false
|
|
1396
1195
|
});
|
|
1397
|
-
const clearLongPressTimer =
|
|
1196
|
+
const clearLongPressTimer = React8.useCallback(() => {
|
|
1398
1197
|
if (scrub.current.timer !== null) {
|
|
1399
1198
|
clearTimeout(scrub.current.timer);
|
|
1400
1199
|
scrub.current.timer = null;
|
|
1401
1200
|
}
|
|
1402
1201
|
}, []);
|
|
1403
|
-
|
|
1404
|
-
const jumpToClientY =
|
|
1202
|
+
React8.useEffect(() => clearLongPressTimer, [clearLongPressTimer]);
|
|
1203
|
+
const jumpToClientY = React8.useCallback((clientY) => {
|
|
1405
1204
|
const track = trackRef.current;
|
|
1406
1205
|
if (track === null || marks.length === 0) return;
|
|
1407
1206
|
const rect = track.getBoundingClientRect();
|
|
@@ -1451,7 +1250,7 @@ function ThreadJumpRail({ marks, className }) {
|
|
|
1451
1250
|
e.stopPropagation();
|
|
1452
1251
|
}
|
|
1453
1252
|
};
|
|
1454
|
-
|
|
1253
|
+
React8.useEffect(() => {
|
|
1455
1254
|
if (!isMobile || !open) return;
|
|
1456
1255
|
const root = rootRef.current;
|
|
1457
1256
|
if (root === null) return;
|
|
@@ -1465,7 +1264,7 @@ function ThreadJumpRail({ marks, className }) {
|
|
|
1465
1264
|
const tickCount = Math.min(marks.length, MAX_TICKS);
|
|
1466
1265
|
const currentIndex = marks.findIndex((m) => m.isCurrent);
|
|
1467
1266
|
const activeTick = currentIndex < 0 ? -1 : Math.floor(currentIndex / marks.length * tickCount);
|
|
1468
|
-
|
|
1267
|
+
React8.useEffect(() => {
|
|
1469
1268
|
if (!open) return;
|
|
1470
1269
|
const panel = panelRef.current;
|
|
1471
1270
|
if (panel === null) return;
|
|
@@ -1668,10 +1467,10 @@ function ThreadJumpRail({ marks, className }) {
|
|
|
1668
1467
|
}
|
|
1669
1468
|
|
|
1670
1469
|
// src/shell/composer/use-field-autosize.ts
|
|
1671
|
-
import * as
|
|
1470
|
+
import * as React9 from "react";
|
|
1672
1471
|
function useFieldAutosize(taRef, value, ghostPx, maxLines) {
|
|
1673
|
-
const [fieldPx, setFieldPx] =
|
|
1674
|
-
|
|
1472
|
+
const [fieldPx, setFieldPx] = React9.useState(COMPOSER_MIN_FIELD_PX);
|
|
1473
|
+
React9.useEffect(() => {
|
|
1675
1474
|
const ta = taRef.current;
|
|
1676
1475
|
if (ta === null) return;
|
|
1677
1476
|
ta.style.height = "auto";
|
|
@@ -1714,7 +1513,7 @@ function Composer({
|
|
|
1714
1513
|
shareCanvas = false,
|
|
1715
1514
|
attachments: attachmentsController
|
|
1716
1515
|
}) {
|
|
1717
|
-
const session =
|
|
1516
|
+
const session = useFourtySession2();
|
|
1718
1517
|
const { isStreaming, hasCommittedTurns } = useConversationState();
|
|
1719
1518
|
const hydrated = useHydrated();
|
|
1720
1519
|
const hasConversation = hydrated && hasCommittedTurns;
|
|
@@ -1725,14 +1524,14 @@ function Composer({
|
|
|
1725
1524
|
const { isMobile } = useFormFactor5();
|
|
1726
1525
|
const chipOrientation = isMobile ? "row" : "list";
|
|
1727
1526
|
const chipArea = chipAreaPx(isMobile);
|
|
1728
|
-
const onAbort =
|
|
1527
|
+
const onAbort = React10.useCallback(() => session.abortGeneration(), [session]);
|
|
1729
1528
|
const agentPlaceholder = useComposerPlaceholder2();
|
|
1730
1529
|
const effectivePlaceholder = agentPlaceholder !== null ? agentPlaceholder : placeholder;
|
|
1731
|
-
const [focused, setFocused] =
|
|
1732
|
-
const taRef =
|
|
1733
|
-
const scrollRef =
|
|
1734
|
-
const [scrollerEl, setScrollerEl] =
|
|
1735
|
-
const attachScroller =
|
|
1530
|
+
const [focused, setFocused] = React10.useState(false);
|
|
1531
|
+
const taRef = React10.useRef(null);
|
|
1532
|
+
const scrollRef = React10.useRef(null);
|
|
1533
|
+
const [scrollerEl, setScrollerEl] = React10.useState(null);
|
|
1534
|
+
const attachScroller = React10.useCallback((el) => {
|
|
1736
1535
|
scrollRef.current = el;
|
|
1737
1536
|
setScrollerEl(el);
|
|
1738
1537
|
}, []);
|
|
@@ -1750,10 +1549,10 @@ function Composer({
|
|
|
1750
1549
|
canSend,
|
|
1751
1550
|
submit
|
|
1752
1551
|
} = usePromptComposer({ attachments: attachmentsController });
|
|
1753
|
-
const [ghostPx, setGhostPx] =
|
|
1552
|
+
const [ghostPx, setGhostPx] = React10.useState(0);
|
|
1754
1553
|
const fieldPx = useFieldAutosize(taRef, value, ghostPx);
|
|
1755
1554
|
const expanded = isFieldExpanded(fieldPx);
|
|
1756
|
-
|
|
1555
|
+
React10.useEffect(() => {
|
|
1757
1556
|
if (!typeToFocus) return;
|
|
1758
1557
|
const ta = taRef.current;
|
|
1759
1558
|
if (!ta) return;
|
|
@@ -2118,17 +1917,17 @@ function Composer({
|
|
|
2118
1917
|
}
|
|
2119
1918
|
|
|
2120
1919
|
// src/shell/ConversationTransition.tsx
|
|
2121
|
-
import * as
|
|
2122
|
-
import { useFourtySession as
|
|
1920
|
+
import * as React11 from "react";
|
|
1921
|
+
import { useFourtySession as useFourtySession3 } from "@40rty/ams-sdk";
|
|
2123
1922
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2124
1923
|
function ConversationTransition({
|
|
2125
1924
|
children,
|
|
2126
1925
|
className,
|
|
2127
1926
|
style
|
|
2128
1927
|
}) {
|
|
2129
|
-
const { sessionId } =
|
|
1928
|
+
const { sessionId } = useFourtySession3();
|
|
2130
1929
|
const reduce = useReducedMotion();
|
|
2131
|
-
const firstSessionRef =
|
|
1930
|
+
const firstSessionRef = React11.useRef(null);
|
|
2132
1931
|
if (firstSessionRef.current === null && sessionId !== null) firstSessionRef.current = sessionId;
|
|
2133
1932
|
const isFirstSession = sessionId === null || sessionId === firstSessionRef.current;
|
|
2134
1933
|
const conversationKey = isFirstSession ? "\u2205" : sessionId;
|
|
@@ -2150,8 +1949,8 @@ function ConversationTransition({
|
|
|
2150
1949
|
}
|
|
2151
1950
|
|
|
2152
1951
|
// src/shell/VoiceControl.tsx
|
|
2153
|
-
import * as
|
|
2154
|
-
import { useFourtySession as
|
|
1952
|
+
import * as React12 from "react";
|
|
1953
|
+
import { useFourtySession as useFourtySession4, useVoiceCapture } from "@40rty/ams-sdk";
|
|
2155
1954
|
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2156
1955
|
var ROOT_CLASS3 = "fourty-voice-control";
|
|
2157
1956
|
var TRANSCRIPT_CLASS = "fourty-voice-control__transcript";
|
|
@@ -2160,12 +1959,12 @@ function VoiceControl({
|
|
|
2160
1959
|
className,
|
|
2161
1960
|
style
|
|
2162
1961
|
}) {
|
|
2163
|
-
const session =
|
|
2164
|
-
const onCommit =
|
|
1962
|
+
const session = useFourtySession4();
|
|
1963
|
+
const onCommit = React12.useCallback(
|
|
2165
1964
|
(text) => session.sendMessage(text),
|
|
2166
1965
|
[session]
|
|
2167
1966
|
);
|
|
2168
|
-
const voice =
|
|
1967
|
+
const voice = useVoiceCapture(
|
|
2169
1968
|
silenceMs !== void 0 ? { onCommit, silenceMs } : { onCommit }
|
|
2170
1969
|
);
|
|
2171
1970
|
if (!voice.supported) return null;
|
|
@@ -2217,7 +2016,7 @@ function VoiceControl({
|
|
|
2217
2016
|
}
|
|
2218
2017
|
|
|
2219
2018
|
// src/shell/VoiceIsland.tsx
|
|
2220
|
-
import * as
|
|
2019
|
+
import * as React13 from "react";
|
|
2221
2020
|
import { ArrowUp as ArrowUp2, X as X2 } from "lucide-react";
|
|
2222
2021
|
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2223
2022
|
var ROOT_CLASS4 = "fourty-voice-island";
|
|
@@ -2230,8 +2029,8 @@ var ISLAND_FG = "var(--fourty-voice-island-fg, var(--color-surface))";
|
|
|
2230
2029
|
var WAVE_COLOR = "var(--fourty-voice-wave, var(--fourty-voice-island-fg, var(--color-surface)))";
|
|
2231
2030
|
function VoiceIsland({ transcript, onStop, onCancel, idleHint = "Listening\u2026" }) {
|
|
2232
2031
|
const hasText = transcript.trim().length > 0;
|
|
2233
|
-
const captionRef =
|
|
2234
|
-
|
|
2032
|
+
const captionRef = React13.useRef(null);
|
|
2033
|
+
React13.useEffect(() => {
|
|
2235
2034
|
const el = captionRef.current;
|
|
2236
2035
|
if (el === null) return;
|
|
2237
2036
|
el.scrollTop = el.scrollHeight;
|
|
@@ -2352,7 +2151,7 @@ function VoiceIsland({ transcript, onStop, onCancel, idleHint = "Listening\u2026
|
|
|
2352
2151
|
}
|
|
2353
2152
|
|
|
2354
2153
|
// src/shell/BottomSheet.tsx
|
|
2355
|
-
import * as
|
|
2154
|
+
import * as React14 from "react";
|
|
2356
2155
|
import {
|
|
2357
2156
|
motion as motion2,
|
|
2358
2157
|
animate as animate2,
|
|
@@ -2387,18 +2186,18 @@ function BottomSheet({
|
|
|
2387
2186
|
const reduceMotion = useReducedMotion2() === true;
|
|
2388
2187
|
const [sheetRef, sheetBounds] = useMeasure();
|
|
2389
2188
|
const dragControls = useDragControls();
|
|
2390
|
-
const [detent, setDetent] =
|
|
2391
|
-
const [bodyMounted, setBodyMounted] =
|
|
2189
|
+
const [detent, setDetent] = React14.useState("peek");
|
|
2190
|
+
const [bodyMounted, setBodyMounted] = React14.useState(false);
|
|
2392
2191
|
const y = useMotionValue2(2e3);
|
|
2393
2192
|
const fullPx = sheetBounds.height;
|
|
2394
2193
|
const collapsedT = fullPx > 0 ? Math.max(0, fullPx - peekHeight) : 0;
|
|
2395
|
-
const targetFor =
|
|
2194
|
+
const targetFor = React14.useCallback(
|
|
2396
2195
|
(d) => d === "full" ? 0 : collapsedT,
|
|
2397
2196
|
[collapsedT]
|
|
2398
2197
|
);
|
|
2399
|
-
const didInit =
|
|
2400
|
-
const prevDetent =
|
|
2401
|
-
|
|
2198
|
+
const didInit = React14.useRef(false);
|
|
2199
|
+
const prevDetent = React14.useRef(detent);
|
|
2200
|
+
React14.useEffect(() => {
|
|
2402
2201
|
if (collapsedT === 0 && fullPx === 0) return;
|
|
2403
2202
|
const target = targetFor(detent);
|
|
2404
2203
|
const isTransition = prevDetent.current !== detent;
|
|
@@ -2410,14 +2209,14 @@ function BottomSheet({
|
|
|
2410
2209
|
y.set(target);
|
|
2411
2210
|
didInit.current = true;
|
|
2412
2211
|
}, [detent, targetFor, collapsedT, fullPx, reduceMotion, y]);
|
|
2413
|
-
|
|
2212
|
+
React14.useEffect(() => {
|
|
2414
2213
|
if (detent === "full") setBodyMounted(true);
|
|
2415
2214
|
}, [detent]);
|
|
2416
|
-
|
|
2215
|
+
React14.useEffect(() => {
|
|
2417
2216
|
if (onDetentChange !== void 0) onDetentChange(detent);
|
|
2418
2217
|
}, [detent, onDetentChange]);
|
|
2419
|
-
const collapseInit =
|
|
2420
|
-
|
|
2218
|
+
const collapseInit = React14.useRef(true);
|
|
2219
|
+
React14.useEffect(() => {
|
|
2421
2220
|
if (collapseInit.current) {
|
|
2422
2221
|
collapseInit.current = false;
|
|
2423
2222
|
return;
|
|
@@ -2438,7 +2237,7 @@ function BottomSheet({
|
|
|
2438
2237
|
}
|
|
2439
2238
|
dragControls.start(e);
|
|
2440
2239
|
};
|
|
2441
|
-
const dragConstraints =
|
|
2240
|
+
const dragConstraints = React14.useMemo(() => ({ top: 0, bottom: collapsedT }), [collapsedT]);
|
|
2442
2241
|
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
2443
2242
|
/* @__PURE__ */ jsx16(
|
|
2444
2243
|
motion2.div,
|
|
@@ -2558,25 +2357,65 @@ function BottomSheet({
|
|
|
2558
2357
|
] });
|
|
2559
2358
|
}
|
|
2560
2359
|
|
|
2360
|
+
// src/shell/TurnAsk.tsx
|
|
2361
|
+
import * as React15 from "react";
|
|
2362
|
+
import { turnAskSegments, useTurnAskReply } from "@40rty/ams-sdk";
|
|
2363
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2364
|
+
function TurnAsk({ ask, answerable }) {
|
|
2365
|
+
const reply = useTurnAskReply();
|
|
2366
|
+
return /* @__PURE__ */ jsx17("p", { className: "fourty-turn-ask", style: { margin: "0.75em 0 0" }, children: turnAskSegments(ask).map((segment, i) => {
|
|
2367
|
+
if (segment.kind === "text" || !answerable) return /* @__PURE__ */ jsx17(React15.Fragment, { children: segment.text }, i);
|
|
2368
|
+
return /* @__PURE__ */ jsx17(
|
|
2369
|
+
"button",
|
|
2370
|
+
{
|
|
2371
|
+
type: "button",
|
|
2372
|
+
className: "fourty-turn-ask__answer",
|
|
2373
|
+
onClick: (event) => {
|
|
2374
|
+
event.stopPropagation();
|
|
2375
|
+
reply(segment.text);
|
|
2376
|
+
},
|
|
2377
|
+
style: ANSWER_STYLE,
|
|
2378
|
+
children: segment.text
|
|
2379
|
+
},
|
|
2380
|
+
i
|
|
2381
|
+
);
|
|
2382
|
+
}) });
|
|
2383
|
+
}
|
|
2384
|
+
var ANSWER_STYLE = {
|
|
2385
|
+
font: "inherit",
|
|
2386
|
+
color: "inherit",
|
|
2387
|
+
// Buttons do not inherit these from the sentence by default.
|
|
2388
|
+
textTransform: "inherit",
|
|
2389
|
+
letterSpacing: "inherit",
|
|
2390
|
+
fontWeight: 600,
|
|
2391
|
+
background: "none",
|
|
2392
|
+
border: "none",
|
|
2393
|
+
padding: 0,
|
|
2394
|
+
cursor: "pointer",
|
|
2395
|
+
textDecoration: "underline",
|
|
2396
|
+
textDecorationThickness: "1.5px",
|
|
2397
|
+
textUnderlineOffset: "3px"
|
|
2398
|
+
};
|
|
2399
|
+
|
|
2561
2400
|
// src/shell/TypedPlaceholder.tsx
|
|
2562
|
-
import * as
|
|
2563
|
-
import { jsx as
|
|
2401
|
+
import * as React16 from "react";
|
|
2402
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2564
2403
|
var TYPE_MS = 46;
|
|
2565
2404
|
var DELETE_MS = 22;
|
|
2566
2405
|
var HOLD_MS = 1600;
|
|
2567
2406
|
var RESTART_MS = 420;
|
|
2568
2407
|
function TypedPlaceholder({ entries, caret = true, className }) {
|
|
2569
2408
|
const key = entries.join("\0");
|
|
2570
|
-
const list =
|
|
2409
|
+
const list = React16.useMemo(
|
|
2571
2410
|
() => entries.filter((e) => e.length > 0),
|
|
2572
2411
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2573
2412
|
[key]
|
|
2574
2413
|
);
|
|
2575
2414
|
const reduced = useReducedMotion() === true;
|
|
2576
|
-
const [index, setIndex] =
|
|
2577
|
-
const [count, setCount] =
|
|
2578
|
-
const [phase, setPhase] =
|
|
2579
|
-
const [seen, setSeen] =
|
|
2415
|
+
const [index, setIndex] = React16.useState(0);
|
|
2416
|
+
const [count, setCount] = React16.useState(0);
|
|
2417
|
+
const [phase, setPhase] = React16.useState("typing");
|
|
2418
|
+
const [seen, setSeen] = React16.useState(list);
|
|
2580
2419
|
if (seen !== list) {
|
|
2581
2420
|
setSeen(list);
|
|
2582
2421
|
setIndex(0);
|
|
@@ -2584,7 +2423,7 @@ function TypedPlaceholder({ entries, caret = true, className }) {
|
|
|
2584
2423
|
setPhase("typing");
|
|
2585
2424
|
}
|
|
2586
2425
|
const current = list.length > 0 ? list[index % list.length] : void 0;
|
|
2587
|
-
|
|
2426
|
+
React16.useEffect(() => {
|
|
2588
2427
|
if (reduced || current === void 0) return;
|
|
2589
2428
|
const step = () => {
|
|
2590
2429
|
if (phase === "typing") {
|
|
@@ -2613,12 +2452,18 @@ function TypedPlaceholder({ entries, caret = true, className }) {
|
|
|
2613
2452
|
const shown = reduced ? current : current.slice(0, count);
|
|
2614
2453
|
return /* @__PURE__ */ jsxs11("span", { className, "aria-hidden": "true", children: [
|
|
2615
2454
|
shown,
|
|
2616
|
-
caret && !reduced && /* @__PURE__ */
|
|
2455
|
+
caret && !reduced && /* @__PURE__ */ jsx18(AgentCaret, { inline: true })
|
|
2617
2456
|
] });
|
|
2618
2457
|
}
|
|
2619
2458
|
|
|
2459
|
+
// src/shell/index.ts
|
|
2460
|
+
import {
|
|
2461
|
+
usePromptComposer as usePromptComposer3
|
|
2462
|
+
} from "@40rty/ams-sdk";
|
|
2463
|
+
|
|
2620
2464
|
// src/shell/ShellScaffold.tsx
|
|
2621
|
-
import
|
|
2465
|
+
import React28 from "react";
|
|
2466
|
+
import { useDockState } from "@40rty/ams-sdk";
|
|
2622
2467
|
|
|
2623
2468
|
// src/shell/slots.ts
|
|
2624
2469
|
function resolveShellSlot(slot, dock) {
|
|
@@ -2628,16 +2473,16 @@ function resolveShellSlot(slot, dock) {
|
|
|
2628
2473
|
}
|
|
2629
2474
|
|
|
2630
2475
|
// src/shell/mobile/DefaultMobileShell.tsx
|
|
2631
|
-
import * as
|
|
2632
|
-
import { useSessionState, useFourtySession as
|
|
2476
|
+
import * as React26 from "react";
|
|
2477
|
+
import { useSessionState, useFourtySession as useFourtySession7 } from "@40rty/ams-sdk";
|
|
2633
2478
|
|
|
2634
2479
|
// src/shell/mobile/MobileChrome.tsx
|
|
2635
2480
|
import { useScrollContainerRef } from "@40rty/ams-sdk";
|
|
2636
2481
|
|
|
2637
2482
|
// src/shell/ChromeSurface.tsx
|
|
2638
|
-
import { jsx as
|
|
2483
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2639
2484
|
function ChromeSurface({ visible, lifted }) {
|
|
2640
|
-
return /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ jsx19(
|
|
2641
2486
|
"div",
|
|
2642
2487
|
{
|
|
2643
2488
|
"aria-hidden": true,
|
|
@@ -2679,7 +2524,7 @@ var ISLAND_CLEARANCE_BREATHING = 16 + 16;
|
|
|
2679
2524
|
var MOBILE_CANVAS_BOTTOM_CLEARANCE = VOICE_ISLAND_HEIGHT + ISLAND_CLEARANCE_BREATHING;
|
|
2680
2525
|
|
|
2681
2526
|
// src/shell/mobile/MobileChrome.tsx
|
|
2682
|
-
import { jsx as
|
|
2527
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2683
2528
|
function MobileChrome({ logo, launchers }) {
|
|
2684
2529
|
const scrolled = useScrollThreshold(useScrollContainerRef(), 0);
|
|
2685
2530
|
return /* @__PURE__ */ jsxs12(
|
|
@@ -2696,7 +2541,7 @@ function MobileChrome({ logo, launchers }) {
|
|
|
2696
2541
|
zIndex: 50
|
|
2697
2542
|
},
|
|
2698
2543
|
children: [
|
|
2699
|
-
/* @__PURE__ */
|
|
2544
|
+
/* @__PURE__ */ jsx20(ChromeSurface, { visible: true, lifted: scrolled }),
|
|
2700
2545
|
/* @__PURE__ */ jsxs12(
|
|
2701
2546
|
"div",
|
|
2702
2547
|
{
|
|
@@ -2712,8 +2557,8 @@ function MobileChrome({ logo, launchers }) {
|
|
|
2712
2557
|
pointerEvents: "none"
|
|
2713
2558
|
},
|
|
2714
2559
|
children: [
|
|
2715
|
-
/* @__PURE__ */
|
|
2716
|
-
/* @__PURE__ */
|
|
2560
|
+
/* @__PURE__ */ jsx20("div", { style: { pointerEvents: "auto", minWidth: 0, display: "inline-flex", alignItems: "center", overflow: "hidden" }, children: logo }),
|
|
2561
|
+
/* @__PURE__ */ jsx20("div", { style: { pointerEvents: "auto", flexShrink: 0, display: "inline-flex", alignItems: "center", gap: 2 }, children: launchers })
|
|
2717
2562
|
]
|
|
2718
2563
|
}
|
|
2719
2564
|
)
|
|
@@ -2723,8 +2568,8 @@ function MobileChrome({ logo, launchers }) {
|
|
|
2723
2568
|
}
|
|
2724
2569
|
|
|
2725
2570
|
// src/shell/mobile/MobileVoiceConsole.tsx
|
|
2726
|
-
import * as
|
|
2727
|
-
import { useCurrentMessageIndex, useDisplayedLayout, useExclusiveOverlay, useFourtySession as
|
|
2571
|
+
import * as React25 from "react";
|
|
2572
|
+
import { useCurrentMessageIndex, useDisplayedLayout, useExclusiveOverlay, useFourtySession as useFourtySession6, useVoiceCapture as useVoiceCapture2, useScrollContainerRef as useScrollContainerRef2, useWakeLock } from "@40rty/ams-sdk";
|
|
2728
2573
|
|
|
2729
2574
|
// src/shell/mobile/turn-end-action.ts
|
|
2730
2575
|
function turnEndAction(inputs) {
|
|
@@ -2737,19 +2582,23 @@ function turnEndAction(inputs) {
|
|
|
2737
2582
|
return layoutSignature === startLayoutSignature ? "open" : "close";
|
|
2738
2583
|
}
|
|
2739
2584
|
|
|
2585
|
+
// src/shell/mobile/MobileVoiceConsole.tsx
|
|
2586
|
+
import { useComposerAttachments } from "@40rty/ams-sdk";
|
|
2587
|
+
|
|
2740
2588
|
// src/shell/mobile/MorphIsland.tsx
|
|
2741
|
-
import * as
|
|
2589
|
+
import * as React21 from "react";
|
|
2742
2590
|
import { useComposerChipSelect } from "@40rty/ams-sdk";
|
|
2743
2591
|
|
|
2744
2592
|
// src/shell/mobile/RestIsland.tsx
|
|
2745
|
-
import * as
|
|
2746
|
-
import { useComposerPlaceholder as useComposerPlaceholder3, useFourtySession as
|
|
2593
|
+
import * as React19 from "react";
|
|
2594
|
+
import { useComposerPlaceholder as useComposerPlaceholder3, useFourtySession as useFourtySession5 } from "@40rty/ams-sdk";
|
|
2747
2595
|
|
|
2748
2596
|
// src/shell/mobile/IslandInputBar.tsx
|
|
2749
|
-
import * as
|
|
2597
|
+
import * as React18 from "react";
|
|
2598
|
+
import { usePromptComposer as usePromptComposer2 } from "@40rty/ams-sdk";
|
|
2750
2599
|
|
|
2751
2600
|
// src/shell/mobile/IslandComposeGroup.tsx
|
|
2752
|
-
import { Fragment as
|
|
2601
|
+
import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2753
2602
|
function IslandComposeGroup({
|
|
2754
2603
|
value,
|
|
2755
2604
|
onValueChange,
|
|
@@ -2762,8 +2611,8 @@ function IslandComposeGroup({
|
|
|
2762
2611
|
attachments,
|
|
2763
2612
|
taRef
|
|
2764
2613
|
}) {
|
|
2765
|
-
return /* @__PURE__ */ jsxs13(
|
|
2766
|
-
/* @__PURE__ */
|
|
2614
|
+
return /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
2615
|
+
/* @__PURE__ */ jsx21(
|
|
2767
2616
|
AttachButton,
|
|
2768
2617
|
{
|
|
2769
2618
|
onFiles: attachments.addFiles,
|
|
@@ -2772,7 +2621,7 @@ function IslandComposeGroup({
|
|
|
2772
2621
|
}
|
|
2773
2622
|
),
|
|
2774
2623
|
/* @__PURE__ */ jsxs13("div", { style: { position: "relative", flex: 1, minWidth: 0 }, children: [
|
|
2775
|
-
/* @__PURE__ */
|
|
2624
|
+
/* @__PURE__ */ jsx21(
|
|
2776
2625
|
"textarea",
|
|
2777
2626
|
{
|
|
2778
2627
|
ref: taRef,
|
|
@@ -2821,7 +2670,7 @@ function IslandComposeGroup({
|
|
|
2821
2670
|
}
|
|
2822
2671
|
}
|
|
2823
2672
|
),
|
|
2824
|
-
placeholderAnimated === true && value.length === 0 && /* @__PURE__ */
|
|
2673
|
+
placeholderAnimated === true && value.length === 0 && /* @__PURE__ */ jsx21(
|
|
2825
2674
|
"span",
|
|
2826
2675
|
{
|
|
2827
2676
|
"aria-hidden": "true",
|
|
@@ -2837,7 +2686,7 @@ function IslandComposeGroup({
|
|
|
2837
2686
|
pointerEvents: "none",
|
|
2838
2687
|
overflow: "hidden"
|
|
2839
2688
|
},
|
|
2840
|
-
children: /* @__PURE__ */
|
|
2689
|
+
children: /* @__PURE__ */ jsx21(AnimatedPlaceholder, { text: placeholder })
|
|
2841
2690
|
}
|
|
2842
2691
|
)
|
|
2843
2692
|
] })
|
|
@@ -2845,10 +2694,10 @@ function IslandComposeGroup({
|
|
|
2845
2694
|
}
|
|
2846
2695
|
|
|
2847
2696
|
// src/shell/mobile/use-blur-on-canvas-gesture.ts
|
|
2848
|
-
import * as
|
|
2697
|
+
import * as React17 from "react";
|
|
2849
2698
|
var SURFACE = ".fourty-morph-surface";
|
|
2850
2699
|
function useBlurOnCanvasGesture(taRef) {
|
|
2851
|
-
|
|
2700
|
+
React17.useEffect(() => {
|
|
2852
2701
|
const doc = document;
|
|
2853
2702
|
const onGesture = (e) => {
|
|
2854
2703
|
const field = taRef.current;
|
|
@@ -2872,7 +2721,7 @@ function useBlurOnCanvasGesture(taRef) {
|
|
|
2872
2721
|
// src/shell/mobile/IslandNavButtons.tsx
|
|
2873
2722
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
2874
2723
|
import { useCanvasBack, useCanvasForward } from "@40rty/ams-sdk";
|
|
2875
|
-
import { Fragment as
|
|
2724
|
+
import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2876
2725
|
var STEP_BUTTON_STYLE = {
|
|
2877
2726
|
flexShrink: 0,
|
|
2878
2727
|
height: 40,
|
|
@@ -2889,8 +2738,8 @@ function IslandNavButtons() {
|
|
|
2889
2738
|
const { canGoBack, goBack } = useCanvasBack();
|
|
2890
2739
|
const { canGoForward, goForward } = useCanvasForward();
|
|
2891
2740
|
if (!canGoBack && !canGoForward) return null;
|
|
2892
|
-
return /* @__PURE__ */ jsxs14(
|
|
2893
|
-
canGoBack && /* @__PURE__ */
|
|
2741
|
+
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
2742
|
+
canGoBack && /* @__PURE__ */ jsx22(
|
|
2894
2743
|
"button",
|
|
2895
2744
|
{
|
|
2896
2745
|
type: "button",
|
|
@@ -2898,10 +2747,10 @@ function IslandNavButtons() {
|
|
|
2898
2747
|
onClick: goBack,
|
|
2899
2748
|
"aria-label": "Back",
|
|
2900
2749
|
style: STEP_BUTTON_STYLE,
|
|
2901
|
-
children: /* @__PURE__ */
|
|
2750
|
+
children: /* @__PURE__ */ jsx22(ChevronLeft, { size: 19, strokeWidth: 1.8 })
|
|
2902
2751
|
}
|
|
2903
2752
|
),
|
|
2904
|
-
canGoForward && /* @__PURE__ */
|
|
2753
|
+
canGoForward && /* @__PURE__ */ jsx22(
|
|
2905
2754
|
"button",
|
|
2906
2755
|
{
|
|
2907
2756
|
type: "button",
|
|
@@ -2909,7 +2758,7 @@ function IslandNavButtons() {
|
|
|
2909
2758
|
onClick: goForward,
|
|
2910
2759
|
"aria-label": "Forward",
|
|
2911
2760
|
style: STEP_BUTTON_STYLE,
|
|
2912
|
-
children: /* @__PURE__ */
|
|
2761
|
+
children: /* @__PURE__ */ jsx22(ChevronRight, { size: 19, strokeWidth: 1.8 })
|
|
2913
2762
|
}
|
|
2914
2763
|
)
|
|
2915
2764
|
] });
|
|
@@ -2917,7 +2766,7 @@ function IslandNavButtons() {
|
|
|
2917
2766
|
|
|
2918
2767
|
// src/shell/mobile/IslandTrailingAction.tsx
|
|
2919
2768
|
import { AudioLines as AudioLines2, ArrowUp as ArrowUp3, Square as Square2 } from "lucide-react";
|
|
2920
|
-
import { jsx as
|
|
2769
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2921
2770
|
var STAMP_BUTTON_STYLE = {
|
|
2922
2771
|
flexShrink: 0,
|
|
2923
2772
|
marginLeft: 2,
|
|
@@ -2933,12 +2782,12 @@ var STAMP_BUTTON_STYLE = {
|
|
|
2933
2782
|
};
|
|
2934
2783
|
function IslandTrailingAction({ state }) {
|
|
2935
2784
|
if (state.kind === "send") {
|
|
2936
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ jsx23("button", { type: "button", className: "fourty-island-send", onClick: state.onSend, "aria-label": "Send", style: STAMP_BUTTON_STYLE, children: /* @__PURE__ */ jsx23(ArrowUp3, { size: 18, strokeWidth: 2.2 }) });
|
|
2937
2786
|
}
|
|
2938
2787
|
if (state.kind === "stop") {
|
|
2939
|
-
return /* @__PURE__ */
|
|
2788
|
+
return /* @__PURE__ */ jsx23("button", { type: "button", className: "fourty-island-stop", onClick: state.onStop, "aria-label": "Stop", style: STAMP_BUTTON_STYLE, children: /* @__PURE__ */ jsx23(Square2, { size: 13, strokeWidth: 1.5, fill: "currentColor" }) });
|
|
2940
2789
|
}
|
|
2941
|
-
return /* @__PURE__ */
|
|
2790
|
+
return /* @__PURE__ */ jsx23(
|
|
2942
2791
|
"button",
|
|
2943
2792
|
{
|
|
2944
2793
|
type: "button",
|
|
@@ -2957,13 +2806,13 @@ function IslandTrailingAction({ state }) {
|
|
|
2957
2806
|
alignItems: "center",
|
|
2958
2807
|
justifyContent: "center"
|
|
2959
2808
|
},
|
|
2960
|
-
children: /* @__PURE__ */
|
|
2809
|
+
children: /* @__PURE__ */ jsx23(AudioLines2, { size: 18, strokeWidth: 1.7 })
|
|
2961
2810
|
}
|
|
2962
2811
|
);
|
|
2963
2812
|
}
|
|
2964
2813
|
|
|
2965
2814
|
// src/shell/mobile/IslandInputBar.tsx
|
|
2966
|
-
import { jsx as
|
|
2815
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2967
2816
|
var NOTCH_PAD_LEFT = 8;
|
|
2968
2817
|
function IslandInputBar({
|
|
2969
2818
|
onSpeak,
|
|
@@ -2980,10 +2829,10 @@ function IslandInputBar({
|
|
|
2980
2829
|
notchExpanded
|
|
2981
2830
|
}) {
|
|
2982
2831
|
const labels = useLabels();
|
|
2983
|
-
const { value, setValue, canSend, submit, onPaste } =
|
|
2832
|
+
const { value, setValue, canSend, submit, onPaste } = usePromptComposer2({ attachments });
|
|
2984
2833
|
const showStop = isStreaming && !canSend;
|
|
2985
|
-
const taRef =
|
|
2986
|
-
const send =
|
|
2834
|
+
const taRef = React18.useRef(null);
|
|
2835
|
+
const send = React18.useCallback(() => {
|
|
2987
2836
|
submit();
|
|
2988
2837
|
taRef.current?.blur();
|
|
2989
2838
|
}, [submit]);
|
|
@@ -3003,12 +2852,12 @@ function IslandInputBar({
|
|
|
3003
2852
|
className: "fourty-island-bar",
|
|
3004
2853
|
style: { display: "flex", alignItems: expanded ? "flex-end" : "center", gap: 2, minHeight: height, padding: "4px 6px" },
|
|
3005
2854
|
children: [
|
|
3006
|
-
!showStop && /* @__PURE__ */
|
|
2855
|
+
!showStop && /* @__PURE__ */ jsx24(IslandNavButtons, {}),
|
|
3007
2856
|
showStop ? (
|
|
3008
2857
|
// Non-scrolling shell: owns the tap; when expanded it carries the
|
|
3009
2858
|
// bottom scroll-fade so that stays put while the read region below
|
|
3010
2859
|
// it scrolls.
|
|
3011
|
-
/* @__PURE__ */
|
|
2860
|
+
/* @__PURE__ */ jsx24(
|
|
3012
2861
|
"div",
|
|
3013
2862
|
{
|
|
3014
2863
|
role: "button",
|
|
@@ -3025,7 +2874,7 @@ function IslandInputBar({
|
|
|
3025
2874
|
className: "fourty-island-notch",
|
|
3026
2875
|
"data-expanded": notchExpanded ? "true" : "false",
|
|
3027
2876
|
style: { flex: 1, minWidth: 0, cursor: "pointer" },
|
|
3028
|
-
children: /* @__PURE__ */
|
|
2877
|
+
children: /* @__PURE__ */ jsx24(
|
|
3029
2878
|
"div",
|
|
3030
2879
|
{
|
|
3031
2880
|
className: "fourty-island-notch__read",
|
|
@@ -3035,7 +2884,7 @@ function IslandInputBar({
|
|
|
3035
2884
|
)
|
|
3036
2885
|
}
|
|
3037
2886
|
)
|
|
3038
|
-
) : /* @__PURE__ */
|
|
2887
|
+
) : /* @__PURE__ */ jsx24(
|
|
3039
2888
|
IslandComposeGroup,
|
|
3040
2889
|
{
|
|
3041
2890
|
value,
|
|
@@ -3050,14 +2899,14 @@ function IslandInputBar({
|
|
|
3050
2899
|
taRef
|
|
3051
2900
|
}
|
|
3052
2901
|
),
|
|
3053
|
-
/* @__PURE__ */
|
|
2902
|
+
/* @__PURE__ */ jsx24(IslandTrailingAction, { state: trailingState })
|
|
3054
2903
|
]
|
|
3055
2904
|
}
|
|
3056
2905
|
);
|
|
3057
2906
|
}
|
|
3058
2907
|
|
|
3059
2908
|
// src/shell/mobile/RestIsland.tsx
|
|
3060
|
-
import { jsx as
|
|
2909
|
+
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3061
2910
|
var SETTLE_EASE = [0.22, 1, 0.36, 1];
|
|
3062
2911
|
var READ_FADE = { duration: 0.24, ease: SETTLE_EASE };
|
|
3063
2912
|
function RestIsland({
|
|
@@ -3070,37 +2919,37 @@ function RestIsland({
|
|
|
3070
2919
|
}) {
|
|
3071
2920
|
const agentHint = useComposerPlaceholder3({ seed: placeholderExamples });
|
|
3072
2921
|
const hasHint = typeof agentHint === "string" && agentHint.trim().length > 0;
|
|
3073
|
-
const session =
|
|
2922
|
+
const session = useFourtySession5();
|
|
3074
2923
|
const isStreaming = session.isSubmitting || session.isRunning;
|
|
3075
|
-
const onStop =
|
|
3076
|
-
const [notchExpanded, setNotchExpanded] =
|
|
3077
|
-
|
|
2924
|
+
const onStop = React19.useCallback(() => session.abortGeneration(), [session]);
|
|
2925
|
+
const [notchExpanded, setNotchExpanded] = React19.useState(false);
|
|
2926
|
+
React19.useEffect(() => {
|
|
3078
2927
|
if (!isStreaming) setNotchExpanded(false);
|
|
3079
2928
|
}, [isStreaming]);
|
|
3080
|
-
const onNotchClick =
|
|
3081
|
-
const notch = /* @__PURE__ */
|
|
3082
|
-
const [focused, setFocused] =
|
|
3083
|
-
const blurTimer =
|
|
2929
|
+
const onNotchClick = React19.useCallback(() => setNotchExpanded((v) => !v), []);
|
|
2930
|
+
const notch = /* @__PURE__ */ jsx25(AgentPresenceWidget, { expanded: notchExpanded, suppressIdleFallback: true, staticBand: true });
|
|
2931
|
+
const [focused, setFocused] = React19.useState(false);
|
|
2932
|
+
const blurTimer = React19.useRef(null);
|
|
3084
2933
|
const clearBlurTimer = () => {
|
|
3085
2934
|
if (blurTimer.current !== null) {
|
|
3086
2935
|
clearTimeout(blurTimer.current);
|
|
3087
2936
|
blurTimer.current = null;
|
|
3088
2937
|
}
|
|
3089
2938
|
};
|
|
3090
|
-
const onInputFocus =
|
|
2939
|
+
const onInputFocus = React19.useCallback(() => {
|
|
3091
2940
|
clearBlurTimer();
|
|
3092
2941
|
setFocused(true);
|
|
3093
2942
|
}, []);
|
|
3094
|
-
const onInputBlur =
|
|
2943
|
+
const onInputBlur = React19.useCallback(() => {
|
|
3095
2944
|
clearBlurTimer();
|
|
3096
2945
|
blurTimer.current = setTimeout(() => setFocused(false), 150);
|
|
3097
2946
|
}, []);
|
|
3098
|
-
|
|
3099
|
-
|
|
2947
|
+
React19.useEffect(() => clearBlurTimer, []);
|
|
2948
|
+
React19.useEffect(() => {
|
|
3100
2949
|
if (onComposeFocusChange === void 0) return;
|
|
3101
2950
|
onComposeFocusChange(focused);
|
|
3102
2951
|
}, [focused, onComposeFocusChange]);
|
|
3103
|
-
|
|
2952
|
+
React19.useEffect(() => {
|
|
3104
2953
|
if (!isStreaming) return;
|
|
3105
2954
|
if (blurTimer.current !== null) {
|
|
3106
2955
|
clearTimeout(blurTimer.current);
|
|
@@ -3121,7 +2970,7 @@ function RestIsland({
|
|
|
3121
2970
|
color: "var(--fourty-island-fg, var(--color-on-dark, #FFFFFF))"
|
|
3122
2971
|
},
|
|
3123
2972
|
children: [
|
|
3124
|
-
/* @__PURE__ */
|
|
2973
|
+
/* @__PURE__ */ jsx25(AnimatePresence, { initial: false, children: showBrief && /* @__PURE__ */ jsx25(
|
|
3125
2974
|
motion.div,
|
|
3126
2975
|
{
|
|
3127
2976
|
className: "fourty-island-dossier",
|
|
@@ -3129,11 +2978,11 @@ function RestIsland({
|
|
|
3129
2978
|
animate: { opacity: 1 },
|
|
3130
2979
|
exit: { opacity: 0 },
|
|
3131
2980
|
transition: READ_FADE,
|
|
3132
|
-
children: /* @__PURE__ */
|
|
2981
|
+
children: /* @__PURE__ */ jsx25(PresenceBriefRail, {})
|
|
3133
2982
|
},
|
|
3134
2983
|
"presence-brief"
|
|
3135
2984
|
) }),
|
|
3136
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ jsx25(AnimatePresence, { initial: false, children: focused && /* @__PURE__ */ jsx25(
|
|
3137
2986
|
motion.div,
|
|
3138
2987
|
{
|
|
3139
2988
|
className: "fourty-island-chips",
|
|
@@ -3141,7 +2990,7 @@ function RestIsland({
|
|
|
3141
2990
|
animate: { opacity: 1 },
|
|
3142
2991
|
exit: { opacity: 0 },
|
|
3143
2992
|
transition: READ_FADE,
|
|
3144
|
-
children: /* @__PURE__ */
|
|
2993
|
+
children: /* @__PURE__ */ jsx25(
|
|
3145
2994
|
ComposerChipStrip,
|
|
3146
2995
|
{
|
|
3147
2996
|
orientation: "row",
|
|
@@ -3154,8 +3003,8 @@ function RestIsland({
|
|
|
3154
3003
|
},
|
|
3155
3004
|
"chips"
|
|
3156
3005
|
) }),
|
|
3157
|
-
/* @__PURE__ */
|
|
3158
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ jsx25(AttachmentStrip, { attachments: attachments.attachments, onRemove: attachments.remove }),
|
|
3007
|
+
/* @__PURE__ */ jsx25(
|
|
3159
3008
|
IslandInputBar,
|
|
3160
3009
|
{
|
|
3161
3010
|
onSpeak,
|
|
@@ -3205,7 +3054,7 @@ function nearestDetent(current, velocityY, travelPx, ladder) {
|
|
|
3205
3054
|
}
|
|
3206
3055
|
|
|
3207
3056
|
// src/shell/mobile/use-sheet-fold-gesture.ts
|
|
3208
|
-
import * as
|
|
3057
|
+
import * as React20 from "react";
|
|
3209
3058
|
function findVerticalScrollerAtTouch(target) {
|
|
3210
3059
|
let el = target instanceof HTMLElement ? target : null;
|
|
3211
3060
|
while (el !== null && !el.classList.contains("fourty-morph-surface")) {
|
|
@@ -3224,13 +3073,13 @@ function isScrollerAtTop(scroller) {
|
|
|
3224
3073
|
return scroller.scrollTop <= 0;
|
|
3225
3074
|
}
|
|
3226
3075
|
function useSheetFoldGesture({ sheetFaceRef, atSheet, travel, progress, settle }) {
|
|
3227
|
-
const atSheetRef =
|
|
3076
|
+
const atSheetRef = React20.useRef(atSheet);
|
|
3228
3077
|
atSheetRef.current = atSheet;
|
|
3229
|
-
const travelRef =
|
|
3078
|
+
const travelRef = React20.useRef(travel);
|
|
3230
3079
|
travelRef.current = travel;
|
|
3231
|
-
const settleRef =
|
|
3080
|
+
const settleRef = React20.useRef(settle);
|
|
3232
3081
|
settleRef.current = settle;
|
|
3233
|
-
|
|
3082
|
+
React20.useEffect(() => {
|
|
3234
3083
|
const el = sheetFaceRef.current;
|
|
3235
3084
|
if (el === null) return;
|
|
3236
3085
|
let tracking = false;
|
|
@@ -3319,7 +3168,7 @@ function useSheetFoldGesture({ sheetFaceRef, atSheet, travel, progress, settle }
|
|
|
3319
3168
|
}
|
|
3320
3169
|
|
|
3321
3170
|
// src/shell/mobile/MorphIsland.tsx
|
|
3322
|
-
import { jsx as
|
|
3171
|
+
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3323
3172
|
var SNAP_SPRING = { type: "spring", stiffness: 380, damping: 40, mass: 0.9 };
|
|
3324
3173
|
var FLUSH_EASE = [0.22, 1, 0.36, 1];
|
|
3325
3174
|
var FLUSH_SETTLE = { duration: 0.24, ease: FLUSH_EASE };
|
|
@@ -3327,7 +3176,7 @@ var FOLD_SETTLE = { duration: 0.25, ease: FLUSH_EASE };
|
|
|
3327
3176
|
var FOLD_CONTENT_OUT = 0.3;
|
|
3328
3177
|
var FOLD_GLYPH_IN = 0.34;
|
|
3329
3178
|
var ISLAND_EDGE_LAYER = "var(--fourty-island-edge, 0 0 0 0 transparent)";
|
|
3330
|
-
var DEFAULT_COLLAPSED_MARK = /* @__PURE__ */
|
|
3179
|
+
var DEFAULT_COLLAPSED_MARK = /* @__PURE__ */ jsx26("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.75, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx26("rect", { x: "2", y: "9", width: "20", height: "6", rx: "3" }) });
|
|
3331
3180
|
var NACRE_PAINT_ID = "fourty-island-nacre";
|
|
3332
3181
|
var RING_GAP = 2;
|
|
3333
3182
|
var NACRE_PERIOD_S = 10;
|
|
@@ -3345,7 +3194,7 @@ function NacreDefs({ animate: animated }) {
|
|
|
3345
3194
|
treat as having no timeline to run, and this surface's primary target is
|
|
3346
3195
|
iOS Safari — the one engine with a history of doing so. The element costs
|
|
3347
3196
|
a pixel nobody will ever see. */
|
|
3348
|
-
/* @__PURE__ */
|
|
3197
|
+
/* @__PURE__ */ jsx26(
|
|
3349
3198
|
"svg",
|
|
3350
3199
|
{
|
|
3351
3200
|
width: "1",
|
|
@@ -3353,7 +3202,7 @@ function NacreDefs({ animate: animated }) {
|
|
|
3353
3202
|
"aria-hidden": true,
|
|
3354
3203
|
focusable: "false",
|
|
3355
3204
|
style: { position: "absolute", width: 1, height: 1, overflow: "hidden", pointerEvents: "none" },
|
|
3356
|
-
children: /* @__PURE__ */
|
|
3205
|
+
children: /* @__PURE__ */ jsx26("defs", { children: /* @__PURE__ */ jsxs17(
|
|
3357
3206
|
"linearGradient",
|
|
3358
3207
|
{
|
|
3359
3208
|
id: NACRE_PAINT_ID,
|
|
@@ -3365,21 +3214,21 @@ function NacreDefs({ animate: animated }) {
|
|
|
3365
3214
|
spreadMethod: "pad",
|
|
3366
3215
|
gradientTransform: "translate(-44 0)",
|
|
3367
3216
|
children: [
|
|
3368
|
-
/* @__PURE__ */
|
|
3369
|
-
/* @__PURE__ */
|
|
3370
|
-
/* @__PURE__ */
|
|
3371
|
-
/* @__PURE__ */
|
|
3372
|
-
/* @__PURE__ */
|
|
3373
|
-
/* @__PURE__ */
|
|
3374
|
-
/* @__PURE__ */
|
|
3375
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ jsx26("stop", { offset: "0%", stopColor: "#FFFFFF" }),
|
|
3218
|
+
/* @__PURE__ */ jsx26("stop", { offset: "18%", stopColor: "#FFFFFF" }),
|
|
3219
|
+
/* @__PURE__ */ jsx26("stop", { offset: "32%", stopColor: "#FFC2E2" }),
|
|
3220
|
+
/* @__PURE__ */ jsx26("stop", { offset: "44%", stopColor: "#FFE3AE" }),
|
|
3221
|
+
/* @__PURE__ */ jsx26("stop", { offset: "56%", stopColor: "#6FE9D2" }),
|
|
3222
|
+
/* @__PURE__ */ jsx26("stop", { offset: "68%", stopColor: "#9FB4FF" }),
|
|
3223
|
+
/* @__PURE__ */ jsx26("stop", { offset: "82%", stopColor: "#FFFFFF" }),
|
|
3224
|
+
/* @__PURE__ */ jsx26("stop", { offset: "100%", stopColor: "#FFFFFF" }),
|
|
3376
3225
|
animated && /* Off one edge to off the other in the first fifth of the cycle,
|
|
3377
3226
|
then parked for the remaining eight seconds — the same proportion
|
|
3378
3227
|
the old border sheen settled on, for the same reason: a light
|
|
3379
3228
|
that is always moving is one nobody notices. The end positions
|
|
3380
3229
|
put the coloured span clear of the 0-24 box, so the eight quiet
|
|
3381
3230
|
seconds are a mark that is exactly plain white. */
|
|
3382
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ jsx26(
|
|
3383
3232
|
"animateTransform",
|
|
3384
3233
|
{
|
|
3385
3234
|
attributeName: "gradientTransform",
|
|
@@ -3398,8 +3247,8 @@ function NacreDefs({ animate: animated }) {
|
|
|
3398
3247
|
);
|
|
3399
3248
|
}
|
|
3400
3249
|
function usePrefersReducedMotion() {
|
|
3401
|
-
const [reduced, setReduced] =
|
|
3402
|
-
|
|
3250
|
+
const [reduced, setReduced] = React21.useState(false);
|
|
3251
|
+
React21.useEffect(() => {
|
|
3403
3252
|
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
3404
3253
|
setReduced(mq.matches);
|
|
3405
3254
|
const onChange = (e) => setReduced(e.matches);
|
|
@@ -3412,20 +3261,20 @@ var SHEET_TOP_INSET = MOBILE_TOPBAR_HEIGHT;
|
|
|
3412
3261
|
var SHEET_SIDE_INSET = 8;
|
|
3413
3262
|
var ISLAND_FALLBACK_H = VOICE_ISLAND_HEIGHT + 20;
|
|
3414
3263
|
var GRIP_H = ISLAND_GRIP_H;
|
|
3415
|
-
var MorphIsland =
|
|
3264
|
+
var MorphIsland = React21.forwardRef(
|
|
3416
3265
|
function MorphIsland2({ placeholder, placeholderExamples, attachments, onSpeak, folded, restGapPx, onSummon, historySheet, bottomOffset, enterFromFloor = false, sheetFlush, onOpenChange, onIslandHeightChange, onComposeFocusChange, collapsedMark }, ref) {
|
|
3417
3266
|
const onChipSelect = useComposerChipSelect();
|
|
3418
3267
|
const reducedMotion = usePrefersReducedMotion();
|
|
3419
3268
|
const progress = useMotionValue(0);
|
|
3420
|
-
const dockRef =
|
|
3421
|
-
const islandFaceRef =
|
|
3422
|
-
const gripRef =
|
|
3423
|
-
const sheetFaceRef =
|
|
3424
|
-
const [vw, setVw] =
|
|
3425
|
-
const [vh, setVh] =
|
|
3426
|
-
const [islandH, setIslandH] =
|
|
3427
|
-
const [gripH, setGripH] =
|
|
3428
|
-
|
|
3269
|
+
const dockRef = React21.useRef(null);
|
|
3270
|
+
const islandFaceRef = React21.useRef(null);
|
|
3271
|
+
const gripRef = React21.useRef(null);
|
|
3272
|
+
const sheetFaceRef = React21.useRef(null);
|
|
3273
|
+
const [vw, setVw] = React21.useState(0);
|
|
3274
|
+
const [vh, setVh] = React21.useState(0);
|
|
3275
|
+
const [islandH, setIslandH] = React21.useState(ISLAND_FALLBACK_H);
|
|
3276
|
+
const [gripH, setGripH] = React21.useState(GRIP_H);
|
|
3277
|
+
React21.useEffect(() => {
|
|
3429
3278
|
const el = dockRef.current;
|
|
3430
3279
|
if (el === null) return;
|
|
3431
3280
|
const view = el.ownerDocument.defaultView;
|
|
@@ -3437,7 +3286,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3437
3286
|
ro.observe(el);
|
|
3438
3287
|
return () => ro.disconnect();
|
|
3439
3288
|
}, []);
|
|
3440
|
-
|
|
3289
|
+
React21.useEffect(() => {
|
|
3441
3290
|
const el = islandFaceRef.current;
|
|
3442
3291
|
if (el === null) return;
|
|
3443
3292
|
const view = el.ownerDocument.defaultView;
|
|
@@ -3452,7 +3301,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3452
3301
|
ro.observe(el);
|
|
3453
3302
|
return () => ro.disconnect();
|
|
3454
3303
|
}, [onIslandHeightChange]);
|
|
3455
|
-
|
|
3304
|
+
React21.useEffect(() => {
|
|
3456
3305
|
const el = gripRef.current;
|
|
3457
3306
|
if (el === null) return;
|
|
3458
3307
|
const view = el.ownerDocument.defaultView;
|
|
@@ -3464,9 +3313,9 @@ var MorphIsland = React22.forwardRef(
|
|
|
3464
3313
|
ro.observe(el);
|
|
3465
3314
|
return () => ro.disconnect();
|
|
3466
3315
|
}, []);
|
|
3467
|
-
const floorProbeRef =
|
|
3468
|
-
const [floorGapPx, setFloorGapPx] =
|
|
3469
|
-
|
|
3316
|
+
const floorProbeRef = React21.useRef(null);
|
|
3317
|
+
const [floorGapPx, setFloorGapPx] = React21.useState(0);
|
|
3318
|
+
React21.useEffect(() => {
|
|
3470
3319
|
const el = floorProbeRef.current;
|
|
3471
3320
|
if (el === null) return;
|
|
3472
3321
|
const view = el.ownerDocument.defaultView;
|
|
@@ -3475,8 +3324,8 @@ var MorphIsland = React22.forwardRef(
|
|
|
3475
3324
|
ro.observe(el);
|
|
3476
3325
|
return () => ro.disconnect();
|
|
3477
3326
|
}, []);
|
|
3478
|
-
const [slabRadius, setSlabRadius] =
|
|
3479
|
-
|
|
3327
|
+
const [slabRadius, setSlabRadius] = React21.useState(0);
|
|
3328
|
+
React21.useLayoutEffect(() => {
|
|
3480
3329
|
const el = floorProbeRef.current;
|
|
3481
3330
|
if (el === null) return;
|
|
3482
3331
|
const view = el.ownerDocument.defaultView;
|
|
@@ -3484,8 +3333,8 @@ var MorphIsland = React22.forwardRef(
|
|
|
3484
3333
|
const r = Number.parseFloat(view.getComputedStyle(el).borderTopLeftRadius);
|
|
3485
3334
|
if (Number.isFinite(r) && r !== slabRadius) setSlabRadius(r);
|
|
3486
3335
|
}, [slabRadius, vw]);
|
|
3487
|
-
const [collapsedRadius, setCollapsedRadius] =
|
|
3488
|
-
|
|
3336
|
+
const [collapsedRadius, setCollapsedRadius] = React21.useState(ISLAND_COLLAPSED_H / 2);
|
|
3337
|
+
React21.useLayoutEffect(() => {
|
|
3489
3338
|
const el = floorProbeRef.current;
|
|
3490
3339
|
if (el === null) return;
|
|
3491
3340
|
const view = el.ownerDocument.defaultView;
|
|
@@ -3499,23 +3348,23 @@ var MorphIsland = React22.forwardRef(
|
|
|
3499
3348
|
const collapsedInset = vw > 0 ? Math.max(0, (vw - ISLAND_COLLAPSED_W) / 2) : sideInset;
|
|
3500
3349
|
const sheetH = vh > 0 ? Math.max(islandH, vh - SHEET_TOP_INSET) : islandH;
|
|
3501
3350
|
const collapsedH = islandH + gripH;
|
|
3502
|
-
const ladder =
|
|
3351
|
+
const ladder = React21.useMemo(
|
|
3503
3352
|
() => detentLadder(collapsedH, sheetH),
|
|
3504
3353
|
[collapsedH, sheetH]
|
|
3505
3354
|
);
|
|
3506
3355
|
const firstOpen = ladder.length > 1 ? ladder[1] : 1;
|
|
3507
|
-
const dim2 =
|
|
3356
|
+
const dim2 = React21.useMemo(() => dimSpan(ladder), [ladder]);
|
|
3508
3357
|
const height = useTransform(progress, [0, 1], [collapsedH, sheetH]);
|
|
3509
3358
|
const foldT = useMotionValue(folded ? 1 : 0);
|
|
3510
|
-
|
|
3359
|
+
React21.useEffect(() => {
|
|
3511
3360
|
const controls = animate(foldT, folded ? 1 : 0, FOLD_SETTLE);
|
|
3512
3361
|
return () => controls.stop();
|
|
3513
3362
|
}, [foldT, folded]);
|
|
3514
|
-
const [folding, setFolding] =
|
|
3363
|
+
const [folding, setFolding] = React21.useState(folded);
|
|
3515
3364
|
useMotionValueEvent(foldT, "change", (v) => setFolding(v > 0));
|
|
3516
3365
|
const entryTravel = collapsedH + restGapPx;
|
|
3517
3366
|
const entryT = useMotionValue(enterFromFloor ? 1 : 0);
|
|
3518
|
-
|
|
3367
|
+
React21.useEffect(() => {
|
|
3519
3368
|
if (!enterFromFloor) return;
|
|
3520
3369
|
const controls = animate(entryT, 0, ISLAND_ENTER_SPRING);
|
|
3521
3370
|
return () => controls.stop();
|
|
@@ -3536,7 +3385,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3536
3385
|
});
|
|
3537
3386
|
const foldContentOut = useTransform(foldT, (f) => 1 - clamp01(f / FOLD_CONTENT_OUT));
|
|
3538
3387
|
const flushMax = useMotionValue(sheetFlush ? floorGapPx : 0);
|
|
3539
|
-
|
|
3388
|
+
React21.useEffect(() => {
|
|
3540
3389
|
const controls = animate(flushMax, sheetFlush ? floorGapPx : 0, FLUSH_SETTLE);
|
|
3541
3390
|
return () => controls.stop();
|
|
3542
3391
|
}, [flushMax, sheetFlush, floorGapPx]);
|
|
@@ -3570,9 +3419,9 @@ var MorphIsland = React22.forwardRef(
|
|
|
3570
3419
|
([o, f]) => (1 - clamp01(o / 0.34)) * clamp01((clamp01(f) - FOLD_GLYPH_IN) / (1 - FOLD_GLYPH_IN))
|
|
3571
3420
|
);
|
|
3572
3421
|
const scrimOpacity = useTransform(progress, [dim2.from, dim2.to], [0, 0.42], { clamp: true });
|
|
3573
|
-
const [atSheet, setAtSheet] =
|
|
3574
|
-
const [modal, setModal] =
|
|
3575
|
-
const [active, setActive] =
|
|
3422
|
+
const [atSheet, setAtSheet] = React21.useState(false);
|
|
3423
|
+
const [modal, setModal] = React21.useState(false);
|
|
3424
|
+
const [active, setActive] = React21.useState(false);
|
|
3576
3425
|
useMotionValueEvent(progress, "change", (v) => {
|
|
3577
3426
|
setAtSheet((prev) => {
|
|
3578
3427
|
const n = v > firstOpen * 0.5;
|
|
@@ -3587,10 +3436,10 @@ var MorphIsland = React22.forwardRef(
|
|
|
3587
3436
|
return prev === n ? prev : n;
|
|
3588
3437
|
});
|
|
3589
3438
|
});
|
|
3590
|
-
|
|
3439
|
+
React21.useEffect(() => {
|
|
3591
3440
|
onOpenChange?.(atSheet);
|
|
3592
3441
|
}, [atSheet, onOpenChange]);
|
|
3593
|
-
|
|
3442
|
+
React21.useLayoutEffect(() => {
|
|
3594
3443
|
if (active) return;
|
|
3595
3444
|
const face = islandFaceRef.current;
|
|
3596
3445
|
if (face !== null && face.offsetHeight > 0 && face.offsetHeight !== islandH) {
|
|
@@ -3603,7 +3452,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3603
3452
|
}
|
|
3604
3453
|
});
|
|
3605
3454
|
useScrollLock(modal, dockRef);
|
|
3606
|
-
const snapTo =
|
|
3455
|
+
const snapTo = React21.useCallback((target) => {
|
|
3607
3456
|
if (target === 0) {
|
|
3608
3457
|
const face = sheetFaceRef.current;
|
|
3609
3458
|
if (face !== null) {
|
|
@@ -3613,11 +3462,11 @@ var MorphIsland = React22.forwardRef(
|
|
|
3613
3462
|
}
|
|
3614
3463
|
animate(progress, target, SNAP_SPRING);
|
|
3615
3464
|
}, [progress]);
|
|
3616
|
-
|
|
3465
|
+
React21.useImperativeHandle(ref, () => ({
|
|
3617
3466
|
open: () => snapTo(1),
|
|
3618
3467
|
close: () => snapTo(0)
|
|
3619
3468
|
}), [snapTo]);
|
|
3620
|
-
const panStart =
|
|
3469
|
+
const panStart = React21.useRef(0);
|
|
3621
3470
|
const travel = Math.max(1, sheetH - islandH);
|
|
3622
3471
|
const onPanStart = () => {
|
|
3623
3472
|
panStart.current = progress.get();
|
|
@@ -3626,13 +3475,13 @@ var MorphIsland = React22.forwardRef(
|
|
|
3626
3475
|
const next = panStart.current + -info.offset.y / travel;
|
|
3627
3476
|
progress.set(Math.min(1, Math.max(0, next)));
|
|
3628
3477
|
};
|
|
3629
|
-
const settle =
|
|
3478
|
+
const settle = React21.useCallback((velocityY) => {
|
|
3630
3479
|
snapTo(nearestDetent(progress.get(), velocityY, travel, ladder));
|
|
3631
3480
|
}, [snapTo, progress, travel, ladder]);
|
|
3632
3481
|
const onPanEnd = (_e, info) => {
|
|
3633
3482
|
settle(info.velocity.y);
|
|
3634
3483
|
};
|
|
3635
|
-
const islandFacePanEngaged =
|
|
3484
|
+
const islandFacePanEngaged = React21.useRef(false);
|
|
3636
3485
|
const onIslandFacePanStart = (e) => {
|
|
3637
3486
|
const target = e.target instanceof HTMLElement ? e.target : null;
|
|
3638
3487
|
const onControl = target !== null && target.closest(
|
|
@@ -3661,7 +3510,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3661
3510
|
transition: { duration: 0.18, ease: [0.22, 1, 0.36, 1] },
|
|
3662
3511
|
style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 60 },
|
|
3663
3512
|
children: [
|
|
3664
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ jsx26(
|
|
3665
3514
|
"div",
|
|
3666
3515
|
{
|
|
3667
3516
|
ref: floorProbeRef,
|
|
@@ -3678,7 +3527,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3678
3527
|
}
|
|
3679
3528
|
}
|
|
3680
3529
|
),
|
|
3681
|
-
/* @__PURE__ */
|
|
3530
|
+
/* @__PURE__ */ jsx26(
|
|
3682
3531
|
motion.div,
|
|
3683
3532
|
{
|
|
3684
3533
|
"aria-hidden": true,
|
|
@@ -3692,7 +3541,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3692
3541
|
}
|
|
3693
3542
|
}
|
|
3694
3543
|
),
|
|
3695
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ jsx26(
|
|
3696
3545
|
motion.div,
|
|
3697
3546
|
{
|
|
3698
3547
|
className: "fourty-island-aura",
|
|
@@ -3712,7 +3561,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3712
3561
|
}
|
|
3713
3562
|
}
|
|
3714
3563
|
),
|
|
3715
|
-
/* @__PURE__ */
|
|
3564
|
+
/* @__PURE__ */ jsx26(
|
|
3716
3565
|
motion.div,
|
|
3717
3566
|
{
|
|
3718
3567
|
className: "fourty-island-ring",
|
|
@@ -3794,7 +3643,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3794
3643
|
flexDirection: "column"
|
|
3795
3644
|
},
|
|
3796
3645
|
children: [
|
|
3797
|
-
/* @__PURE__ */
|
|
3646
|
+
/* @__PURE__ */ jsx26(
|
|
3798
3647
|
motion.div,
|
|
3799
3648
|
{
|
|
3800
3649
|
"aria-hidden": true,
|
|
@@ -3808,7 +3657,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3808
3657
|
}
|
|
3809
3658
|
}
|
|
3810
3659
|
),
|
|
3811
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ jsx26(
|
|
3812
3661
|
motion.div,
|
|
3813
3662
|
{
|
|
3814
3663
|
"aria-hidden": true,
|
|
@@ -3822,7 +3671,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3822
3671
|
}
|
|
3823
3672
|
}
|
|
3824
3673
|
),
|
|
3825
|
-
/* @__PURE__ */
|
|
3674
|
+
/* @__PURE__ */ jsx26(
|
|
3826
3675
|
motion.div,
|
|
3827
3676
|
{
|
|
3828
3677
|
ref: gripRef,
|
|
@@ -3857,7 +3706,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3857
3706
|
pointerEvents: folded ? "none" : "auto"
|
|
3858
3707
|
},
|
|
3859
3708
|
"aria-hidden": folded ? true : void 0,
|
|
3860
|
-
children: /* @__PURE__ */
|
|
3709
|
+
children: /* @__PURE__ */ jsx26(
|
|
3861
3710
|
"svg",
|
|
3862
3711
|
{
|
|
3863
3712
|
"aria-hidden": true,
|
|
@@ -3865,7 +3714,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3865
3714
|
viewBox: "0 0 32 5",
|
|
3866
3715
|
fill: "none",
|
|
3867
3716
|
preserveAspectRatio: "none",
|
|
3868
|
-
children: /* @__PURE__ */
|
|
3717
|
+
children: /* @__PURE__ */ jsx26(
|
|
3869
3718
|
"polyline",
|
|
3870
3719
|
{
|
|
3871
3720
|
points: "1,4 16,1 31,4",
|
|
@@ -3880,7 +3729,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3880
3729
|
)
|
|
3881
3730
|
}
|
|
3882
3731
|
),
|
|
3883
|
-
/* @__PURE__ */
|
|
3732
|
+
/* @__PURE__ */ jsx26(
|
|
3884
3733
|
motion.div,
|
|
3885
3734
|
{
|
|
3886
3735
|
ref: sheetFaceRef,
|
|
@@ -3903,7 +3752,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3903
3752
|
children: historySheet(() => snapTo(0))
|
|
3904
3753
|
}
|
|
3905
3754
|
),
|
|
3906
|
-
/* @__PURE__ */
|
|
3755
|
+
/* @__PURE__ */ jsx26(
|
|
3907
3756
|
motion.div,
|
|
3908
3757
|
{
|
|
3909
3758
|
ref: islandFaceRef,
|
|
@@ -3930,7 +3779,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3930
3779
|
touchAction: "pan-x",
|
|
3931
3780
|
zIndex: 1
|
|
3932
3781
|
},
|
|
3933
|
-
children: /* @__PURE__ */
|
|
3782
|
+
children: /* @__PURE__ */ jsx26(
|
|
3934
3783
|
RestIsland,
|
|
3935
3784
|
{
|
|
3936
3785
|
placeholder,
|
|
@@ -3961,7 +3810,7 @@ var MorphIsland = React22.forwardRef(
|
|
|
3961
3810
|
},
|
|
3962
3811
|
"data-folded": folded ? "true" : "false",
|
|
3963
3812
|
children: [
|
|
3964
|
-
/* @__PURE__ */
|
|
3813
|
+
/* @__PURE__ */ jsx26(NacreDefs, { animate: !reducedMotion }),
|
|
3965
3814
|
collapsedMark !== void 0 ? collapsedMark : DEFAULT_COLLAPSED_MARK
|
|
3966
3815
|
]
|
|
3967
3816
|
}
|
|
@@ -3976,25 +3825,25 @@ var MorphIsland = React22.forwardRef(
|
|
|
3976
3825
|
);
|
|
3977
3826
|
|
|
3978
3827
|
// src/shell/mobile/hero-entry-point.tsx
|
|
3979
|
-
import * as
|
|
3980
|
-
import { jsx as
|
|
3981
|
-
var HeroEntryPointContext =
|
|
3828
|
+
import * as React22 from "react";
|
|
3829
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3830
|
+
var HeroEntryPointContext = React22.createContext(null);
|
|
3982
3831
|
function HeroEntryPointProvider({
|
|
3983
3832
|
claim,
|
|
3984
3833
|
claimed,
|
|
3985
3834
|
children
|
|
3986
3835
|
}) {
|
|
3987
|
-
const value =
|
|
3988
|
-
return /* @__PURE__ */
|
|
3836
|
+
const value = React22.useMemo(() => ({ claim, claimed }), [claim, claimed]);
|
|
3837
|
+
return /* @__PURE__ */ jsx27(HeroEntryPointContext.Provider, { value, children });
|
|
3989
3838
|
}
|
|
3990
3839
|
function useHeroEntryPointVisible() {
|
|
3991
|
-
const ctx =
|
|
3840
|
+
const ctx = React22.useContext(HeroEntryPointContext);
|
|
3992
3841
|
return ctx !== null && ctx.claimed;
|
|
3993
3842
|
}
|
|
3994
3843
|
function useClaimHeroEntryPoint(active) {
|
|
3995
|
-
const ctx =
|
|
3844
|
+
const ctx = React22.useContext(HeroEntryPointContext);
|
|
3996
3845
|
const claim = ctx === null ? null : ctx.claim;
|
|
3997
|
-
|
|
3846
|
+
React22.useEffect(() => {
|
|
3998
3847
|
if (claim === null || !active) return;
|
|
3999
3848
|
claim(1);
|
|
4000
3849
|
return () => claim(-1);
|
|
@@ -4003,8 +3852,8 @@ function useClaimHeroEntryPoint(active) {
|
|
|
4003
3852
|
function useOnScreen(ref, opts) {
|
|
4004
3853
|
const enter = opts !== void 0 && opts.enter !== void 0 ? opts.enter : 0.9;
|
|
4005
3854
|
const exit = opts !== void 0 && opts.exit !== void 0 ? opts.exit : 0.25;
|
|
4006
|
-
const [on, setOn] =
|
|
4007
|
-
|
|
3855
|
+
const [on, setOn] = React22.useState(true);
|
|
3856
|
+
React22.useEffect(() => {
|
|
4008
3857
|
const el = ref.current;
|
|
4009
3858
|
if (el === null || typeof IntersectionObserver === "undefined") return;
|
|
4010
3859
|
const observer = new IntersectionObserver(
|
|
@@ -4023,12 +3872,12 @@ function useOnScreen(ref, opts) {
|
|
|
4023
3872
|
}
|
|
4024
3873
|
|
|
4025
3874
|
// src/shell/mobile/use-island-fold-scroll.ts
|
|
4026
|
-
import * as
|
|
3875
|
+
import * as React23 from "react";
|
|
4027
3876
|
import { isNavScrollActive } from "@40rty/ams-sdk";
|
|
4028
3877
|
var SCROLL_IDLE_MS = 240;
|
|
4029
3878
|
function useIslandFoldScroll(scrollRef) {
|
|
4030
|
-
const [scrolling, setScrolling] =
|
|
4031
|
-
|
|
3879
|
+
const [scrolling, setScrolling] = React23.useState(false);
|
|
3880
|
+
React23.useEffect(() => {
|
|
4032
3881
|
const el = scrollRef.current;
|
|
4033
3882
|
if (el === null) return;
|
|
4034
3883
|
let timer = null;
|
|
@@ -4049,10 +3898,10 @@ function useIslandFoldScroll(scrollRef) {
|
|
|
4049
3898
|
}
|
|
4050
3899
|
|
|
4051
3900
|
// src/shell/mobile/use-keyboard-inset.ts
|
|
4052
|
-
import * as
|
|
3901
|
+
import * as React24 from "react";
|
|
4053
3902
|
function useKeyboardInset(ref) {
|
|
4054
|
-
const [inset, setInset] =
|
|
4055
|
-
|
|
3903
|
+
const [inset, setInset] = React24.useState(0);
|
|
3904
|
+
React24.useEffect(() => {
|
|
4056
3905
|
const el = ref.current;
|
|
4057
3906
|
if (el === null) return;
|
|
4058
3907
|
const doc = el.ownerDocument;
|
|
@@ -4077,21 +3926,21 @@ function useKeyboardInset(ref) {
|
|
|
4077
3926
|
}
|
|
4078
3927
|
|
|
4079
3928
|
// src/shell/mobile/MobileVoiceConsole.tsx
|
|
4080
|
-
import { jsx as
|
|
3929
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4081
3930
|
function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, onIslandHeightChange, enterFromFloor, collapsedMark }) {
|
|
4082
|
-
const session =
|
|
3931
|
+
const session = useFourtySession6();
|
|
4083
3932
|
const layout = useDisplayedLayout();
|
|
4084
|
-
const [mode, setMode] =
|
|
3933
|
+
const [mode, setMode] = React25.useState("rest");
|
|
4085
3934
|
const attach = useComposerAttachments();
|
|
4086
|
-
const morphRef =
|
|
4087
|
-
const [threadRelandKey, setThreadRelandKey] =
|
|
4088
|
-
const [sheetOpen, setSheetOpen] =
|
|
3935
|
+
const morphRef = React25.useRef(null);
|
|
3936
|
+
const [threadRelandKey, setThreadRelandKey] = React25.useState(0);
|
|
3937
|
+
const [sheetOpen, setSheetOpen] = React25.useState(false);
|
|
4089
3938
|
useExclusiveOverlay(
|
|
4090
3939
|
"conversation-sheet",
|
|
4091
3940
|
sheetOpen,
|
|
4092
|
-
|
|
3941
|
+
React25.useCallback(() => morphRef.current?.close(), [])
|
|
4093
3942
|
);
|
|
4094
|
-
const anchorRef =
|
|
3943
|
+
const anchorRef = React25.useRef(null);
|
|
4095
3944
|
const chromeInset = useKeyboardInset(anchorRef);
|
|
4096
3945
|
const keyboardLikely = chromeInset > KEYBOARD_LIKELY_MIN_PX;
|
|
4097
3946
|
const restGap = keyboardLikely ? ISLAND_KEYBOARD_GAP : ISLAND_BOTTOM_GAP;
|
|
@@ -4099,20 +3948,20 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
|
|
|
4099
3948
|
const scrollRef = useScrollContainerRef2();
|
|
4100
3949
|
const { atTop, collapsed } = useScrollDirection({ container: scrollRef });
|
|
4101
3950
|
const { scrolling } = useIslandFoldScroll(scrollRef);
|
|
4102
|
-
const handleIslandHeightChange =
|
|
3951
|
+
const handleIslandHeightChange = React25.useCallback(
|
|
4103
3952
|
(height) => {
|
|
4104
3953
|
onIslandHeightChange?.(height);
|
|
4105
3954
|
},
|
|
4106
3955
|
[onIslandHeightChange]
|
|
4107
3956
|
);
|
|
4108
3957
|
const working = session.isRunning || session.isSubmitting;
|
|
4109
|
-
const [summoned, setSummoned] =
|
|
4110
|
-
const summonArmed =
|
|
4111
|
-
const onSummon =
|
|
3958
|
+
const [summoned, setSummoned] = React25.useState(enterFromFloor === true);
|
|
3959
|
+
const summonArmed = React25.useRef(false);
|
|
3960
|
+
const onSummon = React25.useCallback(() => {
|
|
4112
3961
|
setSummoned(true);
|
|
4113
3962
|
summonArmed.current = false;
|
|
4114
3963
|
}, []);
|
|
4115
|
-
|
|
3964
|
+
React25.useEffect(() => {
|
|
4116
3965
|
if (!summoned) return;
|
|
4117
3966
|
if (!scrolling) {
|
|
4118
3967
|
summonArmed.current = true;
|
|
@@ -4120,23 +3969,23 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
|
|
|
4120
3969
|
}
|
|
4121
3970
|
if (summonArmed.current) setSummoned(false);
|
|
4122
3971
|
}, [scrolling, summoned]);
|
|
4123
|
-
const [composing, setComposing] =
|
|
3972
|
+
const [composing, setComposing] = React25.useState(false);
|
|
4124
3973
|
const heroEntryVisible = useHeroEntryPointVisible();
|
|
4125
|
-
const heroWasVisible =
|
|
4126
|
-
|
|
3974
|
+
const heroWasVisible = React25.useRef(heroEntryVisible);
|
|
3975
|
+
React25.useEffect(() => {
|
|
4127
3976
|
const was = heroWasVisible.current;
|
|
4128
3977
|
heroWasVisible.current = heroEntryVisible;
|
|
4129
3978
|
if (was && !heroEntryVisible) onSummon();
|
|
4130
3979
|
}, [heroEntryVisible, onSummon]);
|
|
4131
3980
|
const folded = mode === "rest" && !working && !sheetOpen && !summoned && !composing && (heroEntryVisible || !atTop && collapsed);
|
|
4132
3981
|
const currentMessageIndex = useCurrentMessageIndex();
|
|
4133
|
-
const prevMessageIndex =
|
|
4134
|
-
|
|
3982
|
+
const prevMessageIndex = React25.useRef(currentMessageIndex);
|
|
3983
|
+
React25.useEffect(() => {
|
|
4135
3984
|
const changed = currentMessageIndex !== prevMessageIndex.current;
|
|
4136
3985
|
prevMessageIndex.current = currentMessageIndex;
|
|
4137
3986
|
if (changed && sheetOpen) morphRef.current?.close();
|
|
4138
3987
|
}, [currentMessageIndex, sheetOpen]);
|
|
4139
|
-
const voice =
|
|
3988
|
+
const voice = useVoiceCapture2({
|
|
4140
3989
|
onCommit: (text) => {
|
|
4141
3990
|
session.sendMessage(text);
|
|
4142
3991
|
setMode("rest");
|
|
@@ -4148,7 +3997,7 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
|
|
|
4148
3997
|
silenceMs: 2e3
|
|
4149
3998
|
});
|
|
4150
3999
|
useWakeLock(voice.state === "listening" || working);
|
|
4151
|
-
const [micDeniedNotice, setMicDeniedNotice] =
|
|
4000
|
+
const [micDeniedNotice, setMicDeniedNotice] = React25.useState(false);
|
|
4152
4001
|
const startVoice = () => {
|
|
4153
4002
|
if (!voice.supported) {
|
|
4154
4003
|
morphRef.current?.open();
|
|
@@ -4166,7 +4015,7 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
|
|
|
4166
4015
|
voice.cancel();
|
|
4167
4016
|
setMode("rest");
|
|
4168
4017
|
};
|
|
4169
|
-
|
|
4018
|
+
React25.useEffect(() => {
|
|
4170
4019
|
if (mode !== "listening" || voice.state !== "idle") return;
|
|
4171
4020
|
setMode("rest");
|
|
4172
4021
|
if (voice.permissionDenied) {
|
|
@@ -4175,11 +4024,11 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
|
|
|
4175
4024
|
return () => clearTimeout(timer);
|
|
4176
4025
|
}
|
|
4177
4026
|
}, [mode, voice.state, voice.permissionDenied]);
|
|
4178
|
-
const wasRunning =
|
|
4179
|
-
const turnStartLayoutSig =
|
|
4180
|
-
const turnStartMsgCount =
|
|
4181
|
-
const answerHandled =
|
|
4182
|
-
|
|
4027
|
+
const wasRunning = React25.useRef(false);
|
|
4028
|
+
const turnStartLayoutSig = React25.useRef("");
|
|
4029
|
+
const turnStartMsgCount = React25.useRef(0);
|
|
4030
|
+
const answerHandled = React25.useRef(true);
|
|
4031
|
+
React25.useEffect(() => {
|
|
4183
4032
|
if (session.isRunning && !wasRunning.current) {
|
|
4184
4033
|
setMode("rest");
|
|
4185
4034
|
morphRef.current?.close();
|
|
@@ -4205,7 +4054,7 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
|
|
|
4205
4054
|
}
|
|
4206
4055
|
}, [session.isRunning, layout, session.messages]);
|
|
4207
4056
|
return /* @__PURE__ */ jsxs18(ThreadRelandContext.Provider, { value: threadRelandKey, children: [
|
|
4208
|
-
/* @__PURE__ */
|
|
4057
|
+
/* @__PURE__ */ jsx28(AnimatePresence, { initial: false, children: mode === "rest" && /* @__PURE__ */ jsx28(
|
|
4209
4058
|
MorphIsland,
|
|
4210
4059
|
{
|
|
4211
4060
|
ref: morphRef,
|
|
@@ -4227,7 +4076,7 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
|
|
|
4227
4076
|
},
|
|
4228
4077
|
"morph"
|
|
4229
4078
|
) }),
|
|
4230
|
-
/* @__PURE__ */
|
|
4079
|
+
/* @__PURE__ */ jsx28(
|
|
4231
4080
|
"div",
|
|
4232
4081
|
{
|
|
4233
4082
|
ref: anchorRef,
|
|
@@ -4243,7 +4092,7 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
|
|
|
4243
4092
|
pointerEvents: "none",
|
|
4244
4093
|
zIndex: 60
|
|
4245
4094
|
},
|
|
4246
|
-
children: /* @__PURE__ */
|
|
4095
|
+
children: /* @__PURE__ */ jsx28("div", { style: { pointerEvents: "auto", display: "flex", justifyContent: "center", maxWidth: "100%" }, children: /* @__PURE__ */ jsx28(AnimatePresence, { mode: "wait", initial: false, children: mode === "listening" ? /* @__PURE__ */ jsx28(VoiceIsland, { transcript: voice.transcript, onStop: stopVoice, onCancel: cancelVoice }, "listening") : null }) })
|
|
4247
4096
|
}
|
|
4248
4097
|
)
|
|
4249
4098
|
] });
|
|
@@ -4270,7 +4119,7 @@ function documentScrollRef(forwarded) {
|
|
|
4270
4119
|
}
|
|
4271
4120
|
|
|
4272
4121
|
// src/shell/mobile/DefaultMobileShell.tsx
|
|
4273
|
-
import { Fragment as
|
|
4122
|
+
import { Fragment as Fragment7, jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4274
4123
|
var MOBILE_GUTTER_MAX = 16;
|
|
4275
4124
|
function scrollToTop() {
|
|
4276
4125
|
if (typeof document === "undefined") return;
|
|
@@ -4280,44 +4129,44 @@ function scrollToTop() {
|
|
|
4280
4129
|
var DEFAULT_PLACEHOLDER = "Ask for anything\u2026";
|
|
4281
4130
|
function DefaultMobileShell(props) {
|
|
4282
4131
|
const { messages } = useSessionState();
|
|
4283
|
-
const { isSubmitting, isRunning } =
|
|
4132
|
+
const { isSubmitting, isRunning } = useFourtySession7();
|
|
4284
4133
|
const working = isSubmitting || isRunning;
|
|
4285
|
-
const [open, setOpen] =
|
|
4286
|
-
const toggle =
|
|
4287
|
-
const dock =
|
|
4134
|
+
const [open, setOpen] = React26.useState(false);
|
|
4135
|
+
const toggle = React26.useCallback(() => setOpen((v) => !v), []);
|
|
4136
|
+
const dock = React26.useMemo(() => ({ open, toggle }), [open, toggle]);
|
|
4288
4137
|
const gutter = Math.min(props.gutter === void 0 ? MOBILE_GUTTER_MAX : props.gutter, MOBILE_GUTTER_MAX);
|
|
4289
4138
|
const placeholder = props.placeholder === void 0 ? DEFAULT_PLACEHOLDER : props.placeholder;
|
|
4290
4139
|
const canvasGutterStyle = { paddingLeft: gutter, paddingRight: gutter, "--fourty-canvas-gutter": `${gutter}px` };
|
|
4291
|
-
const [islandFaceHeight, setIslandFaceHeight] =
|
|
4292
|
-
const [heroEntryClaims, setHeroEntryClaims] =
|
|
4293
|
-
const claimHeroEntry =
|
|
4140
|
+
const [islandFaceHeight, setIslandFaceHeight] = React26.useState(null);
|
|
4141
|
+
const [heroEntryClaims, setHeroEntryClaims] = React26.useState(0);
|
|
4142
|
+
const claimHeroEntry = React26.useCallback((delta) => {
|
|
4294
4143
|
setHeroEntryClaims((n) => Math.max(0, n + delta));
|
|
4295
4144
|
}, []);
|
|
4296
4145
|
const heroOwnsEntry = heroEntryClaims > 0;
|
|
4297
4146
|
const withholdIsland = heroOwnsEntry && !working;
|
|
4298
4147
|
const hasAsked = messages.some((m) => m.role === "user");
|
|
4299
|
-
const hadAsked =
|
|
4300
|
-
|
|
4148
|
+
const hadAsked = React26.useRef(hasAsked);
|
|
4149
|
+
React26.useEffect(() => {
|
|
4301
4150
|
const was = hadAsked.current;
|
|
4302
4151
|
hadAsked.current = hasAsked;
|
|
4303
4152
|
if (!was || hasAsked) return;
|
|
4304
4153
|
scrollToTop();
|
|
4305
4154
|
}, [hasAsked]);
|
|
4306
|
-
const wasWithheld =
|
|
4155
|
+
const wasWithheld = React26.useRef(false);
|
|
4307
4156
|
const enterFromFloor = wasWithheld.current && !withholdIsland;
|
|
4308
|
-
|
|
4157
|
+
React26.useEffect(() => {
|
|
4309
4158
|
wasWithheld.current = withholdIsland;
|
|
4310
4159
|
}, [withholdIsland]);
|
|
4311
4160
|
const canvasBottomClearance = withholdIsland ? 0 : islandFaceHeight === null ? MOBILE_CANVAS_BOTTOM_CLEARANCE : islandFaceHeight + ISLAND_CLEARANCE_BREATHING;
|
|
4312
|
-
const shellRef =
|
|
4161
|
+
const shellRef = React26.useRef(null);
|
|
4313
4162
|
const chromeInset = useKeyboardInset(shellRef);
|
|
4314
4163
|
const restingChromeInset = chromeInset > KEYBOARD_LIKELY_MIN_PX ? 0 : chromeInset;
|
|
4315
4164
|
const resolveScrollRef = documentScrollRef(props.scrollRef);
|
|
4316
|
-
const rootRef =
|
|
4165
|
+
const rootRef = React26.useCallback((node) => {
|
|
4317
4166
|
shellRef.current = node;
|
|
4318
4167
|
resolveScrollRef(node);
|
|
4319
4168
|
}, [props.scrollRef]);
|
|
4320
|
-
|
|
4169
|
+
React26.useLayoutEffect(() => {
|
|
4321
4170
|
if (typeof window === "undefined") return;
|
|
4322
4171
|
const nav = window.performance.getEntriesByType("navigation")[0];
|
|
4323
4172
|
const isReload = nav !== void 0 && nav.type === "reload";
|
|
@@ -4329,7 +4178,7 @@ function DefaultMobileShell(props) {
|
|
|
4329
4178
|
window.history.scrollRestoration = previous;
|
|
4330
4179
|
};
|
|
4331
4180
|
}, []);
|
|
4332
|
-
|
|
4181
|
+
React26.useEffect(() => {
|
|
4333
4182
|
const target = document.scrollingElement;
|
|
4334
4183
|
if (!(target instanceof HTMLElement)) return;
|
|
4335
4184
|
const previous = target.style.scrollPaddingTop;
|
|
@@ -4374,28 +4223,28 @@ function DefaultMobileShell(props) {
|
|
|
4374
4223
|
background: "var(--fourty-color-bg)"
|
|
4375
4224
|
},
|
|
4376
4225
|
children: [
|
|
4377
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ jsx29(MobileChrome, { logo: resolveShellSlot(props.logo, dock), launchers: resolveShellSlot(props.launchers, dock) }),
|
|
4378
4227
|
/* @__PURE__ */ jsxs19(HeroEntryPointProvider, { claim: claimHeroEntry, claimed: heroOwnsEntry, children: [
|
|
4379
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ jsx29(
|
|
4380
4229
|
"main",
|
|
4381
4230
|
{
|
|
4382
4231
|
style: {
|
|
4383
4232
|
paddingBottom: `${canvasBottomClearance + restingChromeInset + ISLAND_BOTTOM_GAP}px`
|
|
4384
4233
|
},
|
|
4385
4234
|
children: /* @__PURE__ */ jsxs19("div", { style: canvasGutterStyle, children: [
|
|
4386
|
-
/* @__PURE__ */
|
|
4235
|
+
/* @__PURE__ */ jsx29(ConversationTransition, { children: props.canvas }),
|
|
4387
4236
|
props.footer
|
|
4388
4237
|
] })
|
|
4389
4238
|
}
|
|
4390
4239
|
),
|
|
4391
|
-
!withholdIsland && /* @__PURE__ */
|
|
4240
|
+
!withholdIsland && /* @__PURE__ */ jsx29(
|
|
4392
4241
|
MobileVoiceConsole,
|
|
4393
4242
|
{
|
|
4394
4243
|
enterFromFloor,
|
|
4395
4244
|
placeholder,
|
|
4396
4245
|
placeholderExamples: props.placeholderExamples,
|
|
4397
4246
|
collapsedMark: props.collapsedMark,
|
|
4398
|
-
historySheet: (close) => /* @__PURE__ */ jsxs19(
|
|
4247
|
+
historySheet: (close) => /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
4399
4248
|
props.presenceNotch !== void 0 && // Bleeds the notch's OWN background up UNDER the grip's row
|
|
4400
4249
|
// (negative `marginTop` pulls the box up by the grip's exact
|
|
4401
4250
|
// height; `paddingTop` pushes the notch's real CONTENT back
|
|
@@ -4405,8 +4254,8 @@ function DefaultMobileShell(props) {
|
|
|
4405
4254
|
// opacity once `atSheet`) — a visible seam between the grip
|
|
4406
4255
|
// and the notch's own color, right where they should read as
|
|
4407
4256
|
// one continuous surface.
|
|
4408
|
-
/* @__PURE__ */
|
|
4409
|
-
/* @__PURE__ */
|
|
4257
|
+
/* @__PURE__ */ jsx29("div", { style: { marginTop: -ISLAND_GRIP_H, paddingTop: ISLAND_GRIP_H }, children: props.presenceNotch }),
|
|
4258
|
+
/* @__PURE__ */ jsx29("div", { style: { position: "relative", flex: 1, minHeight: 0 }, children: resolveShellSlot(props.composer, { open: true, toggle: close }) })
|
|
4410
4259
|
] }),
|
|
4411
4260
|
onIslandHeightChange: setIslandFaceHeight
|
|
4412
4261
|
}
|
|
@@ -4419,14 +4268,14 @@ function DefaultMobileShell(props) {
|
|
|
4419
4268
|
}
|
|
4420
4269
|
|
|
4421
4270
|
// src/shell/dock-context.tsx
|
|
4422
|
-
import * as
|
|
4423
|
-
import { jsx as
|
|
4424
|
-
var ShellDockContext =
|
|
4271
|
+
import * as React27 from "react";
|
|
4272
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
4273
|
+
var ShellDockContext = React27.createContext(null);
|
|
4425
4274
|
function ShellDockProvider({ value, children }) {
|
|
4426
|
-
return /* @__PURE__ */
|
|
4275
|
+
return /* @__PURE__ */ jsx30(ShellDockContext.Provider, { value, children });
|
|
4427
4276
|
}
|
|
4428
4277
|
function useShellDock() {
|
|
4429
|
-
const dock =
|
|
4278
|
+
const dock = React27.useContext(ShellDockContext);
|
|
4430
4279
|
if (dock === null) {
|
|
4431
4280
|
throw new Error("useShellDock: no ShellDockProvider in the tree \u2014 this component must render inside a ShellScaffold canvas.");
|
|
4432
4281
|
}
|
|
@@ -4434,7 +4283,7 @@ function useShellDock() {
|
|
|
4434
4283
|
}
|
|
4435
4284
|
|
|
4436
4285
|
// src/shell/ShellScaffold.tsx
|
|
4437
|
-
import { jsx as
|
|
4286
|
+
import { jsx as jsx31, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4438
4287
|
var DEFAULTS = {
|
|
4439
4288
|
dockWidth: 420,
|
|
4440
4289
|
dockTop: 0,
|
|
@@ -4462,15 +4311,15 @@ function ShellScaffold(props) {
|
|
|
4462
4311
|
const isMobile = useMediaQuery(mq);
|
|
4463
4312
|
const dock = useDockState(props.reopenDockOnMessage === true, props.canvasComposer === void 0);
|
|
4464
4313
|
const resizable = props.resizableDock === true;
|
|
4465
|
-
const [liveWidth, setLiveWidth] =
|
|
4466
|
-
const [resizing, setResizing] =
|
|
4314
|
+
const [liveWidth, setLiveWidth] = React28.useState(dockWidth);
|
|
4315
|
+
const [resizing, setResizing] = React28.useState(false);
|
|
4467
4316
|
const effectiveWidth = resizable ? liveWidth : dockWidth;
|
|
4468
4317
|
const canvasSpacing = useSideDockSpacing(dock.open, effectiveWidth, !resizing);
|
|
4469
4318
|
if (props.mobile !== void 0 && isMobile) {
|
|
4470
|
-
return /* @__PURE__ */
|
|
4319
|
+
return /* @__PURE__ */ jsx31(ShellDockProvider, { value: dock, children: props.mobile });
|
|
4471
4320
|
}
|
|
4472
4321
|
if (isMobile) {
|
|
4473
|
-
return /* @__PURE__ */
|
|
4322
|
+
return /* @__PURE__ */ jsx31(ShellDockProvider, { value: dock, children: /* @__PURE__ */ jsx31(
|
|
4474
4323
|
DefaultMobileShell,
|
|
4475
4324
|
{
|
|
4476
4325
|
canvas: props.canvas,
|
|
@@ -4488,11 +4337,11 @@ function ShellScaffold(props) {
|
|
|
4488
4337
|
}
|
|
4489
4338
|
) });
|
|
4490
4339
|
}
|
|
4491
|
-
const canvasContent = /* @__PURE__ */
|
|
4340
|
+
const canvasContent = /* @__PURE__ */ jsx31(ShellDockProvider, { value: dock, children: wrapTransition ? /* @__PURE__ */ jsx31(ConversationTransition, { children: props.canvas }) : props.canvas });
|
|
4492
4341
|
return /* @__PURE__ */ jsxs20("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0, background: "var(--fourty-color-bg)" }, children: [
|
|
4493
4342
|
props.presenceNotch,
|
|
4494
4343
|
/* @__PURE__ */ jsxs20("div", { style: { position: "relative", flex: 1, minHeight: 0, background: "var(--fourty-color-bg)" }, children: [
|
|
4495
|
-
/* @__PURE__ */
|
|
4344
|
+
/* @__PURE__ */ jsx31(
|
|
4496
4345
|
"main",
|
|
4497
4346
|
{
|
|
4498
4347
|
ref: props.scrollRef,
|
|
@@ -4507,14 +4356,14 @@ function ShellScaffold(props) {
|
|
|
4507
4356
|
...canvasSpacing
|
|
4508
4357
|
},
|
|
4509
4358
|
children: /* @__PURE__ */ jsxs20("div", { "data-fourty-canvas": "", style: canvasGutterStyle, children: [
|
|
4510
|
-
/* @__PURE__ */
|
|
4511
|
-
props.canvasComposer !== void 0 && /* @__PURE__ */
|
|
4359
|
+
/* @__PURE__ */ jsx31("div", { style: { flex: 1, minHeight: 0 }, children: canvasContent }),
|
|
4360
|
+
props.canvasComposer !== void 0 && /* @__PURE__ */ jsx31("div", { "data-fourty-shell-part": "composer", style: { position: "sticky", bottom: 0, zIndex: dockZIndex }, children: resolveShellSlot(props.canvasComposer, dock) }),
|
|
4512
4361
|
props.footer
|
|
4513
4362
|
] })
|
|
4514
4363
|
}
|
|
4515
4364
|
),
|
|
4516
4365
|
resolveShellSlot(props.header, dock),
|
|
4517
|
-
/* @__PURE__ */
|
|
4366
|
+
/* @__PURE__ */ jsx31(
|
|
4518
4367
|
SideDock,
|
|
4519
4368
|
{
|
|
4520
4369
|
open: dock.open,
|
|
@@ -4536,17 +4385,17 @@ function ShellScaffold(props) {
|
|
|
4536
4385
|
}
|
|
4537
4386
|
|
|
4538
4387
|
// src/shell/MenuDrawer.tsx
|
|
4539
|
-
import * as
|
|
4388
|
+
import * as React30 from "react";
|
|
4540
4389
|
import { useFormFactor as useFormFactor6 } from "@40rty/ams-sdk";
|
|
4541
4390
|
|
|
4542
4391
|
// src/shell/menu-columns.tsx
|
|
4543
|
-
import { jsx as
|
|
4392
|
+
import { jsx as jsx32, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4544
4393
|
function MenuColumn({
|
|
4545
4394
|
column,
|
|
4546
4395
|
onPick
|
|
4547
4396
|
}) {
|
|
4548
4397
|
return /* @__PURE__ */ jsxs21("div", { style: { minWidth: 132, display: "flex", flexDirection: "column" }, children: [
|
|
4549
|
-
/* @__PURE__ */
|
|
4398
|
+
/* @__PURE__ */ jsx32(
|
|
4550
4399
|
"div",
|
|
4551
4400
|
{
|
|
4552
4401
|
style: {
|
|
@@ -4560,7 +4409,7 @@ function MenuColumn({
|
|
|
4560
4409
|
children: column.title
|
|
4561
4410
|
}
|
|
4562
4411
|
),
|
|
4563
|
-
column.links.map((l) => /* @__PURE__ */
|
|
4412
|
+
column.links.map((l) => /* @__PURE__ */ jsx32(
|
|
4564
4413
|
motion.button,
|
|
4565
4414
|
{
|
|
4566
4415
|
type: "button",
|
|
@@ -4588,14 +4437,14 @@ function MenuColumn({
|
|
|
4588
4437
|
}
|
|
4589
4438
|
|
|
4590
4439
|
// src/shell/MenuFlyout.tsx
|
|
4591
|
-
import { jsx as
|
|
4440
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
4592
4441
|
function MenuFlyout({
|
|
4593
4442
|
item,
|
|
4594
4443
|
onPick
|
|
4595
4444
|
}) {
|
|
4596
4445
|
const columns = item.megaMenu?.columns;
|
|
4597
4446
|
if (columns === void 0 || columns.length === 0) return null;
|
|
4598
|
-
return /* @__PURE__ */
|
|
4447
|
+
return /* @__PURE__ */ jsx33(
|
|
4599
4448
|
motion.div,
|
|
4600
4449
|
{
|
|
4601
4450
|
initial: { opacity: 0, x: -10 },
|
|
@@ -4615,16 +4464,16 @@ function MenuFlyout({
|
|
|
4615
4464
|
flexWrap: "wrap",
|
|
4616
4465
|
alignContent: "flex-start"
|
|
4617
4466
|
},
|
|
4618
|
-
children: columns.map((col) => /* @__PURE__ */
|
|
4467
|
+
children: columns.map((col) => /* @__PURE__ */ jsx33(MenuColumn, { column: col, onPick }, col.title))
|
|
4619
4468
|
}
|
|
4620
4469
|
);
|
|
4621
4470
|
}
|
|
4622
4471
|
|
|
4623
4472
|
// src/shell/MenuNav.tsx
|
|
4624
|
-
import * as
|
|
4473
|
+
import * as React29 from "react";
|
|
4625
4474
|
|
|
4626
4475
|
// src/shell/MenuAccordionPanel.tsx
|
|
4627
|
-
import { jsx as
|
|
4476
|
+
import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4628
4477
|
function MenuAccordionPanel({
|
|
4629
4478
|
item,
|
|
4630
4479
|
onPick
|
|
@@ -4633,7 +4482,7 @@ function MenuAccordionPanel({
|
|
|
4633
4482
|
const columns = item.megaMenu?.columns;
|
|
4634
4483
|
if (columns === void 0 || columns.length === 0) return null;
|
|
4635
4484
|
const action = item.action;
|
|
4636
|
-
return /* @__PURE__ */
|
|
4485
|
+
return /* @__PURE__ */ jsx34(
|
|
4637
4486
|
motion.div,
|
|
4638
4487
|
{
|
|
4639
4488
|
role: "menu",
|
|
@@ -4683,12 +4532,12 @@ function MenuAccordionPanel({
|
|
|
4683
4532
|
color: "var(--color-text)"
|
|
4684
4533
|
},
|
|
4685
4534
|
children: [
|
|
4686
|
-
/* @__PURE__ */
|
|
4687
|
-
/* @__PURE__ */
|
|
4535
|
+
/* @__PURE__ */ jsx34("span", { children: labels.menu.shopAll(item.label) }),
|
|
4536
|
+
/* @__PURE__ */ jsx34("span", { "aria-hidden": "true", style: { opacity: 0.5 }, children: "\u2192" })
|
|
4688
4537
|
]
|
|
4689
4538
|
}
|
|
4690
4539
|
),
|
|
4691
|
-
columns.map((col) => /* @__PURE__ */
|
|
4540
|
+
columns.map((col) => /* @__PURE__ */ jsx34(MenuColumn, { column: col, onPick }, col.title))
|
|
4692
4541
|
]
|
|
4693
4542
|
}
|
|
4694
4543
|
)
|
|
@@ -4697,7 +4546,7 @@ function MenuAccordionPanel({
|
|
|
4697
4546
|
}
|
|
4698
4547
|
|
|
4699
4548
|
// src/shell/MenuNav.tsx
|
|
4700
|
-
import { jsx as
|
|
4549
|
+
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4701
4550
|
function MenuNav({
|
|
4702
4551
|
items,
|
|
4703
4552
|
mode,
|
|
@@ -4705,11 +4554,11 @@ function MenuNav({
|
|
|
4705
4554
|
onOpenChange,
|
|
4706
4555
|
onPick
|
|
4707
4556
|
}) {
|
|
4708
|
-
return /* @__PURE__ */
|
|
4557
|
+
return /* @__PURE__ */ jsx35("nav", { style: { display: "flex", flexDirection: "column", paddingBottom: 24 }, children: items.map((item, i) => {
|
|
4709
4558
|
const hasMega = item.megaMenu !== void 0 && item.megaMenu.columns.length > 0;
|
|
4710
4559
|
const isOpen = openIndex === i;
|
|
4711
4560
|
const inverted = mode === "hover" && isOpen;
|
|
4712
|
-
return /* @__PURE__ */ jsxs23(
|
|
4561
|
+
return /* @__PURE__ */ jsxs23(React29.Fragment, { children: [
|
|
4713
4562
|
/* @__PURE__ */ jsxs23(
|
|
4714
4563
|
motion.button,
|
|
4715
4564
|
{
|
|
@@ -4747,8 +4596,8 @@ function MenuNav({
|
|
|
4747
4596
|
textAlign: "left"
|
|
4748
4597
|
},
|
|
4749
4598
|
children: [
|
|
4750
|
-
/* @__PURE__ */
|
|
4751
|
-
/* @__PURE__ */
|
|
4599
|
+
/* @__PURE__ */ jsx35("span", { children: item.label }),
|
|
4600
|
+
/* @__PURE__ */ jsx35(
|
|
4752
4601
|
"span",
|
|
4753
4602
|
{
|
|
4754
4603
|
"aria-hidden": "true",
|
|
@@ -4766,13 +4615,13 @@ function MenuNav({
|
|
|
4766
4615
|
]
|
|
4767
4616
|
}
|
|
4768
4617
|
),
|
|
4769
|
-
mode === "accordion" && /* @__PURE__ */
|
|
4618
|
+
mode === "accordion" && /* @__PURE__ */ jsx35(AnimatePresence, { initial: false, children: isOpen && hasMega && /* @__PURE__ */ jsx35(MenuAccordionPanel, { item, onPick }) })
|
|
4770
4619
|
] }, item.label);
|
|
4771
4620
|
}) });
|
|
4772
4621
|
}
|
|
4773
4622
|
|
|
4774
4623
|
// src/shell/MenuDrawer.tsx
|
|
4775
|
-
import { Fragment as
|
|
4624
|
+
import { Fragment as Fragment9, jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4776
4625
|
function MenuTrigger({
|
|
4777
4626
|
onClick,
|
|
4778
4627
|
icon,
|
|
@@ -4804,7 +4653,7 @@ function MenuTrigger({
|
|
|
4804
4653
|
},
|
|
4805
4654
|
children: [
|
|
4806
4655
|
icon,
|
|
4807
|
-
label !== void 0 && /* @__PURE__ */
|
|
4656
|
+
label !== void 0 && /* @__PURE__ */ jsx36("span", { children: label })
|
|
4808
4657
|
]
|
|
4809
4658
|
}
|
|
4810
4659
|
);
|
|
@@ -4817,7 +4666,7 @@ function MenuDrawer({
|
|
|
4817
4666
|
onSelectItem,
|
|
4818
4667
|
panelWidth = DEFAULT_PANEL_WIDTH
|
|
4819
4668
|
}) {
|
|
4820
|
-
const pick =
|
|
4669
|
+
const pick = React30.useCallback(
|
|
4821
4670
|
(item) => {
|
|
4822
4671
|
onClose();
|
|
4823
4672
|
onSelectItem(item);
|
|
@@ -4826,15 +4675,15 @@ function MenuDrawer({
|
|
|
4826
4675
|
);
|
|
4827
4676
|
const { isMobile, isTouch } = useFormFactor6();
|
|
4828
4677
|
const mode = isTouch || isMobile ? "accordion" : "hover";
|
|
4829
|
-
const panelRef =
|
|
4678
|
+
const panelRef = React30.useRef(null);
|
|
4830
4679
|
useScrollLock(open, panelRef);
|
|
4831
|
-
const [openIndex, setOpenIndex] =
|
|
4832
|
-
|
|
4680
|
+
const [openIndex, setOpenIndex] = React30.useState(null);
|
|
4681
|
+
React30.useEffect(() => {
|
|
4833
4682
|
if (!open) setOpenIndex(null);
|
|
4834
4683
|
}, [open]);
|
|
4835
4684
|
const openItem = openIndex === null ? null : items[openIndex];
|
|
4836
|
-
return /* @__PURE__ */
|
|
4837
|
-
/* @__PURE__ */
|
|
4685
|
+
return /* @__PURE__ */ jsx36(AnimatePresence, { children: open && /* @__PURE__ */ jsxs24(Fragment9, { children: [
|
|
4686
|
+
/* @__PURE__ */ jsx36(
|
|
4838
4687
|
motion.div,
|
|
4839
4688
|
{
|
|
4840
4689
|
initial: { opacity: 0 },
|
|
@@ -4898,7 +4747,7 @@ function MenuDrawer({
|
|
|
4898
4747
|
overflowY: "auto"
|
|
4899
4748
|
},
|
|
4900
4749
|
children: [
|
|
4901
|
-
/* @__PURE__ */
|
|
4750
|
+
/* @__PURE__ */ jsx36(
|
|
4902
4751
|
"div",
|
|
4903
4752
|
{
|
|
4904
4753
|
style: {
|
|
@@ -4909,7 +4758,7 @@ function MenuDrawer({
|
|
|
4909
4758
|
justifyContent: "flex-end",
|
|
4910
4759
|
padding: "0 16px"
|
|
4911
4760
|
},
|
|
4912
|
-
children: /* @__PURE__ */
|
|
4761
|
+
children: /* @__PURE__ */ jsx36(
|
|
4913
4762
|
motion.button,
|
|
4914
4763
|
{
|
|
4915
4764
|
type: "button",
|
|
@@ -4931,7 +4780,7 @@ function MenuDrawer({
|
|
|
4931
4780
|
justifyContent: "center",
|
|
4932
4781
|
color: "var(--color-text)"
|
|
4933
4782
|
},
|
|
4934
|
-
children: /* @__PURE__ */
|
|
4783
|
+
children: /* @__PURE__ */ jsx36("svg", { viewBox: "0 0 24 24", width: 13, height: 13, fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx36(
|
|
4935
4784
|
"path",
|
|
4936
4785
|
{
|
|
4937
4786
|
d: "M18 6 6 18M6 6l12 12",
|
|
@@ -4945,7 +4794,7 @@ function MenuDrawer({
|
|
|
4945
4794
|
)
|
|
4946
4795
|
}
|
|
4947
4796
|
),
|
|
4948
|
-
/* @__PURE__ */
|
|
4797
|
+
/* @__PURE__ */ jsx36(
|
|
4949
4798
|
MenuNav,
|
|
4950
4799
|
{
|
|
4951
4800
|
items,
|
|
@@ -4958,7 +4807,7 @@ function MenuDrawer({
|
|
|
4958
4807
|
]
|
|
4959
4808
|
}
|
|
4960
4809
|
),
|
|
4961
|
-
mode === "hover" && /* @__PURE__ */
|
|
4810
|
+
mode === "hover" && /* @__PURE__ */ jsx36(AnimatePresence, { children: openItem !== null && openItem !== void 0 && openItem.megaMenu !== void 0 && /* @__PURE__ */ jsx36(MenuFlyout, { item: openItem, onPick: pick }) })
|
|
4962
4811
|
]
|
|
4963
4812
|
}
|
|
4964
4813
|
)
|
|
@@ -4966,22 +4815,22 @@ function MenuDrawer({
|
|
|
4966
4815
|
}
|
|
4967
4816
|
|
|
4968
4817
|
// src/shell/MenuNavBar.tsx
|
|
4969
|
-
import * as
|
|
4970
|
-
import { jsx as
|
|
4818
|
+
import * as React31 from "react";
|
|
4819
|
+
import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4971
4820
|
function MenuNavBar({
|
|
4972
4821
|
items,
|
|
4973
4822
|
onSelectItem,
|
|
4974
4823
|
gap = 26
|
|
4975
4824
|
}) {
|
|
4976
|
-
const [openIndex, setOpenIndex] =
|
|
4977
|
-
const pick =
|
|
4825
|
+
const [openIndex, setOpenIndex] = React31.useState(null);
|
|
4826
|
+
const pick = React31.useCallback(
|
|
4978
4827
|
(item) => {
|
|
4979
4828
|
setOpenIndex(null);
|
|
4980
4829
|
onSelectItem(item);
|
|
4981
4830
|
},
|
|
4982
4831
|
[onSelectItem]
|
|
4983
4832
|
);
|
|
4984
|
-
return /* @__PURE__ */
|
|
4833
|
+
return /* @__PURE__ */ jsx37(
|
|
4985
4834
|
"nav",
|
|
4986
4835
|
{
|
|
4987
4836
|
"aria-label": "Site menu",
|
|
@@ -5001,7 +4850,7 @@ function MenuNavBar({
|
|
|
5001
4850
|
// THIS label instead of the row's first item regardless of which
|
|
5002
4851
|
// one is hovered.
|
|
5003
4852
|
/* @__PURE__ */ jsxs25("div", { style: { position: "relative" }, children: [
|
|
5004
|
-
/* @__PURE__ */
|
|
4853
|
+
/* @__PURE__ */ jsx37(
|
|
5005
4854
|
motion.button,
|
|
5006
4855
|
{
|
|
5007
4856
|
type: "button",
|
|
@@ -5031,7 +4880,7 @@ function MenuNavBar({
|
|
|
5031
4880
|
children: item.label
|
|
5032
4881
|
}
|
|
5033
4882
|
),
|
|
5034
|
-
/* @__PURE__ */
|
|
4883
|
+
/* @__PURE__ */ jsx37(AnimatePresence, { children: isOpen && item.megaMenu !== void 0 && /* @__PURE__ */ jsx37(
|
|
5035
4884
|
motion.div,
|
|
5036
4885
|
{
|
|
5037
4886
|
initial: { opacity: 0, y: -6 },
|
|
@@ -5047,7 +4896,7 @@ function MenuNavBar({
|
|
|
5047
4896
|
paddingTop: 14,
|
|
5048
4897
|
zIndex: 55
|
|
5049
4898
|
},
|
|
5050
|
-
children: /* @__PURE__ */
|
|
4899
|
+
children: /* @__PURE__ */ jsx37(
|
|
5051
4900
|
"div",
|
|
5052
4901
|
{
|
|
5053
4902
|
style: {
|
|
@@ -5057,7 +4906,7 @@ function MenuNavBar({
|
|
|
5057
4906
|
display: "flex",
|
|
5058
4907
|
gap: 30
|
|
5059
4908
|
},
|
|
5060
|
-
children: item.megaMenu.columns.map((col) => /* @__PURE__ */
|
|
4909
|
+
children: item.megaMenu.columns.map((col) => /* @__PURE__ */ jsx37(MenuColumn, { column: col, onPick: pick }, col.title))
|
|
5061
4910
|
}
|
|
5062
4911
|
)
|
|
5063
4912
|
}
|
|
@@ -5070,9 +4919,9 @@ function MenuNavBar({
|
|
|
5070
4919
|
}
|
|
5071
4920
|
|
|
5072
4921
|
// src/shell/ShellMenuChrome.tsx
|
|
5073
|
-
import * as
|
|
4922
|
+
import * as React32 from "react";
|
|
5074
4923
|
import { useExclusiveOverlay as useExclusiveOverlay2, useFormFactor as useFormFactor7, useScrollContainerRef as useScrollContainerRef3 } from "@40rty/ams-sdk";
|
|
5075
|
-
import { Fragment as
|
|
4924
|
+
import { Fragment as Fragment10, jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5076
4925
|
function ShellMenuChrome({
|
|
5077
4926
|
logo,
|
|
5078
4927
|
menuIcon,
|
|
@@ -5084,11 +4933,11 @@ function ShellMenuChrome({
|
|
|
5084
4933
|
panelWidth,
|
|
5085
4934
|
className
|
|
5086
4935
|
}) {
|
|
5087
|
-
const [open, setOpen] =
|
|
5088
|
-
useExclusiveOverlay2("menu", open,
|
|
4936
|
+
const [open, setOpen] = React32.useState(false);
|
|
4937
|
+
useExclusiveOverlay2("menu", open, React32.useCallback(() => setOpen(false), []));
|
|
5089
4938
|
const { isMobile } = useFormFactor7();
|
|
5090
4939
|
const scrolled = useScrollThreshold(useScrollContainerRef3(), 0);
|
|
5091
|
-
return /* @__PURE__ */ jsxs26(
|
|
4940
|
+
return /* @__PURE__ */ jsxs26(Fragment10, { children: [
|
|
5092
4941
|
isMobile ? /* @__PURE__ */ jsxs26(
|
|
5093
4942
|
"div",
|
|
5094
4943
|
{
|
|
@@ -5114,9 +4963,9 @@ function ShellMenuChrome({
|
|
|
5114
4963
|
zIndex: 50
|
|
5115
4964
|
},
|
|
5116
4965
|
children: [
|
|
5117
|
-
/* @__PURE__ */
|
|
5118
|
-
/* @__PURE__ */
|
|
5119
|
-
/* @__PURE__ */
|
|
4966
|
+
/* @__PURE__ */ jsx38("span", { style: { justifySelf: "start", display: "inline-flex", alignItems: "center" }, children: items.length > 0 && /* @__PURE__ */ jsx38(MenuTrigger, { onClick: () => setOpen(true), icon: menuIcon }) }),
|
|
4967
|
+
/* @__PURE__ */ jsx38("span", { style: { display: "inline-flex", alignItems: "center", minWidth: 0 }, children: logo }),
|
|
4968
|
+
/* @__PURE__ */ jsx38("span", { "aria-hidden": true })
|
|
5120
4969
|
]
|
|
5121
4970
|
}
|
|
5122
4971
|
) : /* @__PURE__ */ jsxs26(
|
|
@@ -5141,15 +4990,15 @@ function ShellMenuChrome({
|
|
|
5141
4990
|
zIndex: 50
|
|
5142
4991
|
},
|
|
5143
4992
|
children: [
|
|
5144
|
-
/* @__PURE__ */
|
|
4993
|
+
/* @__PURE__ */ jsx38(ChromeSurface, { visible: scrolled, lifted: scrolled }),
|
|
5145
4994
|
/* @__PURE__ */ jsxs26("div", { style: { position: "relative", display: "flex", alignItems: "center", gap, minWidth: 0 }, children: [
|
|
5146
4995
|
logo,
|
|
5147
|
-
items.length > 0 && /* @__PURE__ */
|
|
4996
|
+
items.length > 0 && /* @__PURE__ */ jsx38(MenuNavBar, { items, onSelectItem })
|
|
5148
4997
|
] })
|
|
5149
4998
|
]
|
|
5150
4999
|
}
|
|
5151
5000
|
),
|
|
5152
|
-
isMobile && /* @__PURE__ */
|
|
5001
|
+
isMobile && /* @__PURE__ */ jsx38(
|
|
5153
5002
|
MenuDrawer,
|
|
5154
5003
|
{
|
|
5155
5004
|
open,
|
|
@@ -5164,7 +5013,7 @@ function ShellMenuChrome({
|
|
|
5164
5013
|
|
|
5165
5014
|
// src/shell/LauncherDock.tsx
|
|
5166
5015
|
import { useFormFactor as useFormFactor8 } from "@40rty/ams-sdk";
|
|
5167
|
-
import { jsx as
|
|
5016
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
5168
5017
|
function LauncherDock({
|
|
5169
5018
|
children,
|
|
5170
5019
|
top = 12,
|
|
@@ -5175,7 +5024,7 @@ function LauncherDock({
|
|
|
5175
5024
|
}) {
|
|
5176
5025
|
const { isMobile } = useFormFactor8();
|
|
5177
5026
|
if (isMobile) {
|
|
5178
|
-
return /* @__PURE__ */
|
|
5027
|
+
return /* @__PURE__ */ jsx39(
|
|
5179
5028
|
"div",
|
|
5180
5029
|
{
|
|
5181
5030
|
"data-fourty-shell-part": "launchers",
|
|
@@ -5185,7 +5034,7 @@ function LauncherDock({
|
|
|
5185
5034
|
}
|
|
5186
5035
|
);
|
|
5187
5036
|
}
|
|
5188
|
-
return /* @__PURE__ */
|
|
5037
|
+
return /* @__PURE__ */ jsx39(
|
|
5189
5038
|
"div",
|
|
5190
5039
|
{
|
|
5191
5040
|
"data-fourty-shell-part": "launchers",
|
|
@@ -5209,7 +5058,7 @@ function LauncherDock({
|
|
|
5209
5058
|
}
|
|
5210
5059
|
|
|
5211
5060
|
// src/shell/Button.tsx
|
|
5212
|
-
import { Fragment as
|
|
5061
|
+
import { Fragment as Fragment11, jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5213
5062
|
var SIZE_SPEC = {
|
|
5214
5063
|
sm: { padding: "8px 14px", fontSize: 11, iconSize: 14, height: 32 },
|
|
5215
5064
|
md: { padding: "12px 24px", fontSize: 13.3333, iconSize: 16, height: 42 },
|
|
@@ -5362,7 +5211,7 @@ function Button({
|
|
|
5362
5211
|
};
|
|
5363
5212
|
const labelText = children !== void 0 ? children : label;
|
|
5364
5213
|
const computedAriaLabel = ariaLabel !== void 0 ? ariaLabel : isIconOnly && label !== void 0 ? label : void 0;
|
|
5365
|
-
return /* @__PURE__ */
|
|
5214
|
+
return /* @__PURE__ */ jsx40(
|
|
5366
5215
|
"button",
|
|
5367
5216
|
{
|
|
5368
5217
|
type,
|
|
@@ -5372,11 +5221,11 @@ function Button({
|
|
|
5372
5221
|
style: baseStyle,
|
|
5373
5222
|
onMouseEnter,
|
|
5374
5223
|
onMouseLeave,
|
|
5375
|
-
children: loading ? /* @__PURE__ */
|
|
5376
|
-
Icon && iconPosition === "left" && !isIconOnly && /* @__PURE__ */
|
|
5377
|
-
Icon && isIconOnly && /* @__PURE__ */
|
|
5224
|
+
children: loading ? /* @__PURE__ */ jsx40(Spinner, { size: s.iconSize - 2 }) : /* @__PURE__ */ jsxs27(Fragment11, { children: [
|
|
5225
|
+
Icon && iconPosition === "left" && !isIconOnly && /* @__PURE__ */ jsx40(Icon, { size: s.iconSize, strokeWidth: 1.5 }),
|
|
5226
|
+
Icon && isIconOnly && /* @__PURE__ */ jsx40(Icon, { size: s.iconSize + 2, strokeWidth: 1.5 }),
|
|
5378
5227
|
!isIconOnly && labelText,
|
|
5379
|
-
Icon && iconPosition === "right" && !isIconOnly && /* @__PURE__ */
|
|
5228
|
+
Icon && iconPosition === "right" && !isIconOnly && /* @__PURE__ */ jsx40(Icon, { size: s.iconSize, strokeWidth: 1.5 })
|
|
5380
5229
|
] })
|
|
5381
5230
|
}
|
|
5382
5231
|
);
|
|
@@ -5384,7 +5233,7 @@ function Button({
|
|
|
5384
5233
|
|
|
5385
5234
|
// src/shell/Skeleton.tsx
|
|
5386
5235
|
import { motion as motion3 } from "framer-motion";
|
|
5387
|
-
import { jsx as
|
|
5236
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
5388
5237
|
var BASE_STYLE = {
|
|
5389
5238
|
display: "inline-block",
|
|
5390
5239
|
backgroundColor: "var(--color-surface-alt, #f3f3f3)",
|
|
@@ -5408,13 +5257,13 @@ function Skeleton({
|
|
|
5408
5257
|
style
|
|
5409
5258
|
}) {
|
|
5410
5259
|
const variantStyle = variant === "text" ? { width: dim(width, "100%"), height: dim(height, "1em") } : variant === "pill" ? { width: dim(width, 48), height: dim(height, 18) } : { width: dim(width, "100%"), height: dim(height, "100%") };
|
|
5411
|
-
return /* @__PURE__ */
|
|
5260
|
+
return /* @__PURE__ */ jsx41(
|
|
5412
5261
|
"span",
|
|
5413
5262
|
{
|
|
5414
5263
|
className,
|
|
5415
5264
|
"aria-hidden": "true",
|
|
5416
5265
|
style: { ...BASE_STYLE, ...variantStyle, ...style },
|
|
5417
|
-
children: /* @__PURE__ */
|
|
5266
|
+
children: /* @__PURE__ */ jsx41(
|
|
5418
5267
|
motion3.span,
|
|
5419
5268
|
{
|
|
5420
5269
|
style: SHIMMER_OVERLAY_STYLE,
|
|
@@ -5461,15 +5310,15 @@ export {
|
|
|
5461
5310
|
SideDock,
|
|
5462
5311
|
Skeleton,
|
|
5463
5312
|
Spinner,
|
|
5313
|
+
TurnAsk,
|
|
5464
5314
|
TypedPlaceholder,
|
|
5465
5315
|
VOICE_ISLAND_HEIGHT,
|
|
5466
5316
|
VoiceControl,
|
|
5467
5317
|
VoiceIsland,
|
|
5468
5318
|
resolveShellSlot,
|
|
5469
5319
|
useClaimHeroEntryPoint,
|
|
5470
|
-
useComposerAttachments,
|
|
5471
5320
|
useOnScreen,
|
|
5472
|
-
usePromptComposer,
|
|
5321
|
+
usePromptComposer3 as usePromptComposer,
|
|
5473
5322
|
useShellDock,
|
|
5474
5323
|
useSideDockSpacing
|
|
5475
5324
|
};
|