@chrryai/chrry 1.4.60 → 1.4.62

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.
@@ -15,11 +15,9 @@
15
15
  }
16
16
 
17
17
  .threadsContainer {
18
- opacity: 0;
19
18
  }
20
19
 
21
20
  .threadsItem {
22
- opacity: 0;
23
21
  }
24
22
 
25
23
  .characterProfiles {
package/dist/index.js CHANGED
@@ -1899,7 +1899,7 @@ var init_utils = __esm({
1899
1899
  };
1900
1900
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
1901
1901
  config = getSiteConfig(getClientHostname());
1902
- VERSION = config.version || "1.4.60";
1902
+ VERSION = config.version || "1.4.62";
1903
1903
  getSlugFromPathname = (path) => {
1904
1904
  return getAppAndStoreSlugs(path, {
1905
1905
  defaultAppSlug: config.slug,
@@ -24196,7 +24196,7 @@ function DataProvider({ children, ...rest }) {
24196
24196
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24197
24197
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24198
24198
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24199
- const VERSION4 = "1.4.60";
24199
+ const VERSION4 = "1.4.62";
24200
24200
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24201
24201
  const {
24202
24202
  API_URL: API_URL2,
@@ -34086,7 +34086,7 @@ function Instructions({
34086
34086
  const { FRONTEND_URL: FRONTEND_URL2, API_URL: API_URL2 } = useData();
34087
34087
  const styles4 = useInstructionsStyles();
34088
34088
  const { utilities } = useStyles();
34089
- const { defaultInstructions, instructions: contextInstructions } = useApp();
34089
+ const { defaultInstructions, isAppInstructions } = useApp();
34090
34090
  const { token, language, user, guest, app, focus, baseApp } = useAuth();
34091
34091
  const {
34092
34092
  selectedAgent,
@@ -35028,7 +35028,7 @@ ${t6(`The more specific you are, the better AI can assist you!`)}`)
35028
35028
  return /* @__PURE__ */ import_react55.default.createElement(
35029
35029
  MotiView,
35030
35030
  {
35031
- key: instruction.id,
35031
+ key: `instruction-${instruction.id}-isAppInstructions-${isAppInstructions ? "true" : "false"}`,
35032
35032
  from: { opacity: 0, translateY: -10 },
35033
35033
  animate: { opacity: 1, translateY: 0 },
35034
35034
  transition: {
@@ -40564,7 +40564,7 @@ function EmptyStateTips({
40564
40564
  style: style2
40565
40565
  }) {
40566
40566
  const { isManagingApp, canEditApp, app } = useApp();
40567
- const { reduceMotion: reduceMotionContext } = useTheme2();
40567
+ const { reduceMotion: reduceMotionContext, reduceMotion } = useTheme2();
40568
40568
  const styles4 = useEmptyStateTipsStyles();
40569
40569
  const { t: t6 } = useAppContext();
40570
40570
  const { viewPortHeight } = usePlatform();
@@ -40748,6 +40748,12 @@ function EmptyStateTips({
40748
40748
  if (app?.slug === "vault") return "\u{1F4B0} " + t6("Finance Tips");
40749
40749
  return "\u{1F3AF} " + t6("Pro Tips");
40750
40750
  };
40751
+ const [animationKey, setAnimationKey] = (0, import_react63.useState)(0);
40752
+ (0, import_react63.useEffect)(() => {
40753
+ if (!reduceMotion) {
40754
+ setAnimationKey((prev2) => prev2 + 1);
40755
+ }
40756
+ }, [reduceMotion]);
40751
40757
  return /* @__PURE__ */ import_react63.default.createElement(Section, { style: { ...styles4.emptyStateTips, ...style2 } }, /* @__PURE__ */ import_react63.default.createElement(H3, { style: { marginBottom: 10, marginTop: 0 } }, t6(getAppTitle())), /* @__PURE__ */ import_react63.default.createElement(Div, { style: { ...styles4.ul.style } }, currentTips.map((item, i) => {
40752
40758
  if (viewPortHeight < 600 && i >= 3) return null;
40753
40759
  if (viewPortHeight < 700 && i >= 4) return null;
@@ -40756,7 +40762,7 @@ function EmptyStateTips({
40756
40762
  return /* @__PURE__ */ import_react63.default.createElement(
40757
40763
  MotiView,
40758
40764
  {
40759
- key: i,
40765
+ key: `tip-${i}-${animationKey}`,
40760
40766
  style: styles4.tip.style,
40761
40767
  from: {
40762
40768
  opacity: 0,
@@ -41037,6 +41043,11 @@ function Menu({
41037
41043
  };
41038
41044
  const timelineListRef = (0, import_react64.useRef)(null);
41039
41045
  const [animationKey, setAnimationKey] = (0, import_react64.useState)(0);
41046
+ (0, import_react64.useEffect)(() => {
41047
+ if (!reduceMotionContext) {
41048
+ setAnimationKey((prev2) => prev2 + 1);
41049
+ }
41050
+ }, [reduceMotionContext]);
41040
41051
  const innerRef = import_react64.default.useRef(null);
41041
41052
  (0, import_react64.useEffect)(() => {
41042
41053
  if (typeof window !== "undefined" && document.addEventListener) {
@@ -41559,9 +41570,6 @@ function Menu({
41559
41570
  title: t6("Motion"),
41560
41571
  onClick: () => {
41561
41572
  setReduceMotion(!reduceMotionContext);
41562
- if (reduceMotionContext) {
41563
- setAnimationKey((prev2) => prev2 + 1);
41564
- }
41565
41573
  },
41566
41574
  style: {
41567
41575
  ...styles4.reduceMotionButton.style,
@@ -42718,7 +42726,7 @@ function SignIn({
42718
42726
  if (isExtension2) {
42719
42727
  return null;
42720
42728
  }
42721
- return /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement("div", { style: style2, className: (0, import_clsx7.default)(import_SignIn_module.default.container, className) }, !user ? /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, showSignIn && /* @__PURE__ */ import_react68.default.createElement(
42729
+ return /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, !user ? /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, showSignIn && /* @__PURE__ */ import_react68.default.createElement(
42722
42730
  "button",
42723
42731
  {
42724
42732
  "data-testid": "login-button",
@@ -44752,7 +44760,7 @@ function Skeleton({
44752
44760
  " ",
44753
44761
  "Blossom"
44754
44762
  )),
44755
- /* @__PURE__ */ React.createElement(Div, { style: { ...skeletonStyles.right.style } }, /* @__PURE__ */ React.createElement(CharacterProfiles, null), /* @__PURE__ */ React.createElement(Subscribe, null), !isMobileDevice ? /* @__PURE__ */ React.createElement(SignIn, { showSignIn: false }) : null, /* @__PURE__ */ React.createElement(LanguageSwitcher_default, null))
44763
+ /* @__PURE__ */ React.createElement(Div, { style: { ...skeletonStyles.right.style } }, /* @__PURE__ */ React.createElement(CharacterProfiles, null), /* @__PURE__ */ React.createElement(Subscribe, null), /* @__PURE__ */ React.createElement(SignIn, { showSignIn: false, showRegister: isMobileDevice }), /* @__PURE__ */ React.createElement(LanguageSwitcher_default, null))
44756
44764
  ),
44757
44765
  /* @__PURE__ */ React.createElement(Div, { style: { ...skeletonStyles.contentContainer.style } }, /* @__PURE__ */ React.createElement(React.Fragment, null, children))
44758
44766
  )
@@ -79751,9 +79759,7 @@ var init_Threads_styles = __esm({
79751
79759
  gap: 20,
79752
79760
  marginTop: 5
79753
79761
  },
79754
- threadsItem: {
79755
- opacity: 0
79756
- },
79762
+ threadsItem: {},
79757
79763
  characterProfiles: {
79758
79764
  display: "flex",
79759
79765
  gap: 5,
@@ -79828,7 +79834,7 @@ var Threads_exports = {};
79828
79834
  __export(Threads_exports, {
79829
79835
  default: () => Threads_default
79830
79836
  });
79831
- var import_react113, import_swr7, import_motion2, Threads, Threads_default;
79837
+ var import_react113, import_swr7, Threads, Threads_default;
79832
79838
  var init_Threads = __esm({
79833
79839
  "Threads.tsx"() {
79834
79840
  "use strict";
@@ -79839,7 +79845,7 @@ var init_Threads = __esm({
79839
79845
  import_swr7 = __toESM(require("swr"));
79840
79846
  init_icons();
79841
79847
  init_utils();
79842
- import_motion2 = require("motion");
79848
+ init_MotiView();
79843
79849
  init_Search();
79844
79850
  init_Skeleton();
79845
79851
  init_EditThread();
@@ -79867,6 +79873,12 @@ var init_Threads = __esm({
79867
79873
  userNameByUrl
79868
79874
  } = useNavigationContext();
79869
79875
  const { reduceMotion } = useTheme2();
79876
+ const [animationKey, setAnimationKey] = (0, import_react113.useState)(0);
79877
+ (0, import_react113.useEffect)(() => {
79878
+ if (!reduceMotion) {
79879
+ setAnimationKey((prev2) => prev2 + 1);
79880
+ }
79881
+ }, [reduceMotion]);
79870
79882
  const {
79871
79883
  token,
79872
79884
  user,
@@ -79947,39 +79959,6 @@ var init_Threads = __esm({
79947
79959
  setIsLoading(false);
79948
79960
  }
79949
79961
  }, [error]);
79950
- const animateThreads = () => {
79951
- if (typeof window !== "undefined") {
79952
- const prefersReducedMotion = reduceMotion || window.matchMedia("(prefers-reduced-motion: reduce)").matches;
79953
- if (prefersReducedMotion) {
79954
- const menuThreadList = document?.querySelector(".threadList");
79955
- const menuThreadItems = document?.querySelectorAll(".threadsItem");
79956
- if (menuThreadList) {
79957
- ;
79958
- menuThreadList.style.opacity = "1";
79959
- }
79960
- menuThreadItems?.forEach((item) => {
79961
- ;
79962
- item.style.opacity = "1";
79963
- });
79964
- } else {
79965
- (0, import_motion2.animate)([
79966
- [".threadList", { opacity: [0, 1] }, { duration: 0 }],
79967
- [
79968
- ".threadsItem",
79969
- {
79970
- y: [-10, 0],
79971
- opacity: [0, 1],
79972
- transform: ["translateX(-10px)", "none"]
79973
- },
79974
- {
79975
- delay: (0, import_motion2.stagger)(0.05),
79976
- duration: 0.1
79977
- }
79978
- ]
79979
- ]);
79980
- }
79981
- }
79982
- };
79983
79962
  const [isLoadingMore, setIsLoadingMore] = (0, import_react113.useState)(false);
79984
79963
  (0, import_react113.useEffect)(() => {
79985
79964
  if (threadsData && Array.isArray(threadsData.threads)) {
@@ -79987,13 +79966,6 @@ var init_Threads = __esm({
79987
79966
  setIsLoading(false);
79988
79967
  }
79989
79968
  }, [threadsData, user]);
79990
- (0, import_react113.useEffect)(() => {
79991
- if (typeof window !== "undefined" && !isLoading && !isLoadingMore && !search) {
79992
- setTimeout(() => {
79993
- animateThreads();
79994
- }, 200);
79995
- }
79996
- }, [isLoading, isLoadingMore, search, sortByDate, collaborationStatus]);
79997
79969
  return /* @__PURE__ */ import_react113.default.createElement(Skeleton, null, /* @__PURE__ */ import_react113.default.createElement(Div, { style: { ...styles4.threads.style } }, /* @__PURE__ */ import_react113.default.createElement(H2, { style: { ...styles4.threadsTitle.style } }, profile?.image ? /* @__PURE__ */ import_react113.default.createElement(
79998
79970
  ImageComponent,
79999
79971
  {
@@ -80104,55 +80076,66 @@ var init_Threads = __esm({
80104
80076
  "data-testid": "threads-container",
80105
80077
  style: { ...styles4.threadsContainer.style }
80106
80078
  },
80107
- sortedThreads.map((thread2) => /* @__PURE__ */ import_react113.default.createElement(
80108
- Div,
80079
+ sortedThreads.map((thread2, index) => /* @__PURE__ */ import_react113.default.createElement(
80080
+ MotiView,
80109
80081
  {
80110
- "data-testid": "threads-item",
80111
- ref: (el) => {
80112
- threadRefs.current[thread2.id] = el;
80113
- },
80114
- className: "threadsItem",
80115
- key: thread2.id
80082
+ key: `${thread2.id}-${animationKey}`,
80083
+ from: { opacity: 0, translateY: 0, translateX: -10 },
80084
+ animate: { opacity: 1, translateY: 0, translateX: 0 },
80085
+ transition: {
80086
+ duration: reduceMotion ? 0 : 100,
80087
+ delay: reduceMotion ? 0 : index * 50
80088
+ }
80116
80089
  },
80117
- /* @__PURE__ */ import_react113.default.createElement(Div, { style: { ...styles4.threadItemTitle.style } }, !isVisitor && /* @__PURE__ */ import_react113.default.createElement(
80118
- EditThread,
80090
+ /* @__PURE__ */ import_react113.default.createElement(
80091
+ Div,
80119
80092
  {
80120
- refetch: async () => {
80121
- await refetch();
80093
+ "data-testid": "threads-item",
80094
+ ref: (el) => {
80095
+ threadRefs.current[thread2.id] = el;
80122
80096
  },
80123
- isIcon: true,
80124
- thread: thread2
80125
- }
80126
- ), (() => {
80127
- const url = `/threads/${thread2.id}`;
80128
- return /* @__PURE__ */ import_react113.default.createElement(
80129
- A,
80097
+ className: "threadsItem"
80098
+ },
80099
+ /* @__PURE__ */ import_react113.default.createElement(Div, { style: { ...styles4.threadItemTitle.style } }, !isVisitor && /* @__PURE__ */ import_react113.default.createElement(
80100
+ EditThread,
80130
80101
  {
80131
- "data-testid": "threads-item-title",
80132
- onClick: (e) => {
80133
- if (e.metaKey || e.ctrlKey) {
80134
- return;
80135
- }
80136
- e.preventDefault();
80137
- router.push(url);
80102
+ refetch: async () => {
80103
+ await refetch();
80138
80104
  },
80139
- href: url,
80140
- key: thread2.id
80141
- },
80142
- thread2.title
80143
- );
80144
- })(), !isVisitor && /* @__PURE__ */ import_react113.default.createElement(
80145
- Bookmark,
80146
- {
80147
- dataTestId: "threads",
80148
- onSave: () => {
80149
- refetch();
80150
- refetchThreads();
80151
- },
80152
- thread: thread2
80153
- }
80154
- ), /* @__PURE__ */ import_react113.default.createElement(Div, { style: { ...styles4.right.style } }, /* @__PURE__ */ import_react113.default.createElement(Span, { style: { ...styles4.threadItemDate.style } }, timeAgo2(thread2.createdOn, language)), !isVisitor && /* @__PURE__ */ import_react113.default.createElement(Share3, { thread: thread2, size: 13 }))),
80155
- /* @__PURE__ */ import_react113.default.createElement(Span, { style: { ...styles4.threadAiResponse.style } }, thread2.aiResponse)
80105
+ isIcon: true,
80106
+ thread: thread2
80107
+ }
80108
+ ), (() => {
80109
+ const url = `/threads/${thread2.id}`;
80110
+ return /* @__PURE__ */ import_react113.default.createElement(
80111
+ A,
80112
+ {
80113
+ "data-testid": "threads-item-title",
80114
+ onClick: (e) => {
80115
+ if (e.metaKey || e.ctrlKey) {
80116
+ return;
80117
+ }
80118
+ e.preventDefault();
80119
+ router.push(url);
80120
+ },
80121
+ href: url,
80122
+ key: thread2.id
80123
+ },
80124
+ thread2.title
80125
+ );
80126
+ })(), !isVisitor && /* @__PURE__ */ import_react113.default.createElement(
80127
+ Bookmark,
80128
+ {
80129
+ dataTestId: "threads",
80130
+ onSave: () => {
80131
+ refetch();
80132
+ refetchThreads();
80133
+ },
80134
+ thread: thread2
80135
+ }
80136
+ ), /* @__PURE__ */ import_react113.default.createElement(Div, { style: { ...styles4.right.style } }, /* @__PURE__ */ import_react113.default.createElement(Span, { style: { ...styles4.threadItemDate.style } }, timeAgo2(thread2.createdOn, language)), !isVisitor && /* @__PURE__ */ import_react113.default.createElement(Share3, { thread: thread2, size: 13 }))),
80137
+ /* @__PURE__ */ import_react113.default.createElement(Span, { style: { ...styles4.threadAiResponse.style } }, thread2.aiResponse)
80138
+ )
80156
80139
  )),
80157
80140
  threads.threads.length === 0 && /* @__PURE__ */ import_react113.default.createElement(P, null, t6("Nothing here yet")),
80158
80141
  threads.hasNextPage && /* @__PURE__ */ import_react113.default.createElement(Div, { style: { ...styles4.loadMoreButtonContainer.style } }, /* @__PURE__ */ import_react113.default.createElement(