@chrryai/chrry 1.6.0 → 1.6.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/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3108,7 +3108,7 @@ var init_utils = __esm({
|
|
|
3108
3108
|
};
|
|
3109
3109
|
isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
|
|
3110
3110
|
config = getSiteConfig(getClientHostname());
|
|
3111
|
-
VERSION = config.version || "1.6.
|
|
3111
|
+
VERSION = config.version || "1.6.2";
|
|
3112
3112
|
getSlugFromPathname = (path) => {
|
|
3113
3113
|
return getAppAndStoreSlugs(path, {
|
|
3114
3114
|
defaultAppSlug: config.slug,
|
|
@@ -24616,7 +24616,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24616
24616
|
const [instructions, setInstructions] = (0, import_react21.useState)([]);
|
|
24617
24617
|
const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
|
|
24618
24618
|
const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
|
|
24619
|
-
const VERSION4 = "1.6.
|
|
24619
|
+
const VERSION4 = "1.6.2";
|
|
24620
24620
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
24621
24621
|
const {
|
|
24622
24622
|
API_URL: API_URL2,
|
|
@@ -24802,7 +24802,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24802
24802
|
});
|
|
24803
24803
|
}
|
|
24804
24804
|
}, [weatherData]);
|
|
24805
|
-
const
|
|
24805
|
+
const isE2E2 = process.env.NEXT_PUBLIC_TESTING_ENV === "e2e";
|
|
24806
24806
|
const [aiAgents, setAiAgents] = (0, import_react21.useState)(session2?.aiAgents || []);
|
|
24807
24807
|
const { data: aiAgentsData } = (0, import_swr2.default)(
|
|
24808
24808
|
token && siteConfig.mode !== "chrryDev" && aiAgents?.length > 0 ? null : ["aiAgents", token, app?.id],
|
|
@@ -24870,7 +24870,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24870
24870
|
PROD_FRONTEND_URL: PROD_FRONTEND_URL2,
|
|
24871
24871
|
MONTHLY_GUEST_CREDITS,
|
|
24872
24872
|
actions,
|
|
24873
|
-
isE2E:
|
|
24873
|
+
isE2E: isE2E2,
|
|
24874
24874
|
pageSizes: pageSizes3,
|
|
24875
24875
|
setNeedsUpdateModalOpen,
|
|
24876
24876
|
needsUpdateModalOpen,
|
|
@@ -26872,8 +26872,8 @@ function ChatProvider({
|
|
|
26872
26872
|
if (!a) return;
|
|
26873
26873
|
setSelectedAgent(a);
|
|
26874
26874
|
}, [app, aiAgents]);
|
|
26875
|
-
const { isDevelopment: isDevelopment3, isE2E:
|
|
26876
|
-
const hourlyLimit = isDevelopment3 && !
|
|
26875
|
+
const { isDevelopment: isDevelopment3, isE2E: isE2E2, actions } = useData();
|
|
26876
|
+
const hourlyLimit = isDevelopment3 && !isE2E2 ? 5e4 : getHourlyLimit({
|
|
26877
26877
|
member: user,
|
|
26878
26878
|
guest
|
|
26879
26879
|
});
|
|
@@ -26920,8 +26920,7 @@ function ChatProvider({
|
|
|
26920
26920
|
const shouldStopAutoScrollRef = (0, import_react29.useRef)(false);
|
|
26921
26921
|
const [isLoadingMore, setIsLoadingMore] = (0, import_react29.useState)(false);
|
|
26922
26922
|
const scrollToBottom = (timeout = 500, force = false) => {
|
|
26923
|
-
if (
|
|
26924
|
-
if (isChatFloating && !force) return;
|
|
26923
|
+
if (isChatFloating || !force) return;
|
|
26925
26924
|
setTimeout(() => {
|
|
26926
26925
|
window.scrollTo({ top: document.body.scrollHeight, behavior: "smooth" });
|
|
26927
26926
|
}, timeout);
|
|
@@ -28247,12 +28246,12 @@ var init_AppContext = __esm({
|
|
|
28247
28246
|
}) => {
|
|
28248
28247
|
const { t: i18nT } = (0, import_react_i18next4.useTranslation)();
|
|
28249
28248
|
const { user, storeApps, atlas: atlas2 } = useAuth();
|
|
28250
|
-
const
|
|
28249
|
+
const isE2E2 = process.env.NEXT_PUBLIC_TESTING_ENV === "e2e";
|
|
28251
28250
|
const isCI2 = process.env.NEXT_PUBLIC_CI === "true";
|
|
28252
28251
|
const config2 = getSiteConfig();
|
|
28253
28252
|
const t5 = (key, values, autoAdd = true) => {
|
|
28254
28253
|
const result = i18nT(key, values);
|
|
28255
|
-
if (autoAdd && !isCI2 &&
|
|
28254
|
+
if (autoAdd && !isCI2 && isE2E2 && user?.role === "admin" && typeof window !== "undefined" && !checkedKeys.has(key)) {
|
|
28256
28255
|
checkedKeys.add(key);
|
|
28257
28256
|
if (result === key && !reportedMissingKeys.has(key)) {
|
|
28258
28257
|
reportedMissingKeys.add(key);
|
|
@@ -37272,7 +37271,8 @@ function Chat({
|
|
|
37272
37271
|
setIsImageGenerationEnabled,
|
|
37273
37272
|
setShouldFocus,
|
|
37274
37273
|
shouldFocus,
|
|
37275
|
-
isChatFloating: isChatFloatingContext
|
|
37274
|
+
isChatFloating: isChatFloatingContext,
|
|
37275
|
+
messages: messages2
|
|
37276
37276
|
} = useChat();
|
|
37277
37277
|
const {
|
|
37278
37278
|
router,
|
|
@@ -37384,12 +37384,14 @@ function Chat({
|
|
|
37384
37384
|
`\u{1F680} ~ file: Chat.tsx:398 ~ shouldUseCompactMode:`,
|
|
37385
37385
|
shouldUseCompactMode
|
|
37386
37386
|
);
|
|
37387
|
-
const floatingInitial = shouldUseCompactMode ? true : empty ? false : isChatFloatingContext && !showChatInput;
|
|
37387
|
+
const floatingInitial = isE2E && messages2.length <= 2 ? false : shouldUseCompactMode ? true : empty ? false : isChatFloatingContext && !showChatInput;
|
|
37388
37388
|
const [isChatFloating] = useSyncedState(floatingInitial, [
|
|
37389
37389
|
empty,
|
|
37390
37390
|
shouldUseCompactMode,
|
|
37391
37391
|
isChatFloatingContext,
|
|
37392
|
-
showChatInput
|
|
37392
|
+
showChatInput,
|
|
37393
|
+
messages2.length,
|
|
37394
|
+
isE2E
|
|
37393
37395
|
]);
|
|
37394
37396
|
(0, import_react55.useEffect)(() => {
|
|
37395
37397
|
setIsChatFloating(isChatFloating);
|
|
@@ -42727,7 +42729,7 @@ function SignIn({
|
|
|
42727
42729
|
const { t: t5 } = useAppContext();
|
|
42728
42730
|
const {
|
|
42729
42731
|
FRONTEND_URL: FRONTEND_URL2,
|
|
42730
|
-
isE2E:
|
|
42732
|
+
isE2E: isE2E2,
|
|
42731
42733
|
isCI: isCI2,
|
|
42732
42734
|
API_URL: API_URL2,
|
|
42733
42735
|
TEST_GUEST_FINGERPRINTS,
|
|
@@ -42759,7 +42761,7 @@ function SignIn({
|
|
|
42759
42761
|
window.removeEventListener("keydown", handleKeyDown);
|
|
42760
42762
|
};
|
|
42761
42763
|
}, [part]);
|
|
42762
|
-
const E2E =
|
|
42764
|
+
const E2E = isE2E2 || fingerprint && (TEST_GUEST_FINGERPRINTS.includes(fingerprint) || TEST_MEMBER_FINGERPRINTS.includes(fingerprint));
|
|
42763
42765
|
const handleSignIn = async (part2) => {
|
|
42764
42766
|
if (E2E) {
|
|
42765
42767
|
part2 = "credentials";
|
|
@@ -42827,7 +42829,7 @@ function SignIn({
|
|
|
42827
42829
|
return;
|
|
42828
42830
|
} else {
|
|
42829
42831
|
const redirectUrl2 = signInResult?.url || successUrl.toString();
|
|
42830
|
-
if (
|
|
42832
|
+
if (isE2E2) {
|
|
42831
42833
|
setRedirectUrl(redirectUrl2);
|
|
42832
42834
|
!isCI2 && setTimeout(() => {
|
|
42833
42835
|
window.location.href = redirectUrl2;
|