@fluid-app/portal-sdk 0.1.172 → 0.1.174

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.
Files changed (57) hide show
  1. package/dist/{ContactsScreen-Cx_EJtrO.mjs → ContactsScreen-C1TCBi7p.mjs} +175 -174
  2. package/dist/ContactsScreen-C1TCBi7p.mjs.map +1 -0
  3. package/dist/{ContactsScreen-DPabYFtr.cjs → ContactsScreen-DuUHlWxn.cjs} +1 -1
  4. package/dist/{ContactsScreen-Bufy88vw.cjs → ContactsScreen-RK8gQwUZ.cjs} +174 -173
  5. package/dist/ContactsScreen-RK8gQwUZ.cjs.map +1 -0
  6. package/dist/{MessagingScreen-CK6vqsQI.mjs → MessagingScreen-BDp1yqcC.mjs} +6 -3
  7. package/dist/{MessagingScreen-CK6vqsQI.mjs.map → MessagingScreen-BDp1yqcC.mjs.map} +1 -1
  8. package/dist/{MessagingScreen-mKNu6iHk.cjs → MessagingScreen-DVpyX0RH.cjs} +5 -2
  9. package/dist/{MessagingScreen-mKNu6iHk.cjs.map → MessagingScreen-DVpyX0RH.cjs.map} +1 -1
  10. package/dist/{MessagingScreen-DenN7Doe.cjs → MessagingScreen-DsduPj7E.cjs} +1 -1
  11. package/dist/{MySiteScreen-Y4dsjqFj.mjs → MySiteScreen-BsePIEvg.mjs} +141 -185
  12. package/dist/MySiteScreen-BsePIEvg.mjs.map +1 -0
  13. package/dist/{MySiteScreen-Cw7fTWT1.cjs → MySiteScreen-C_D3tfA8.cjs} +1 -1
  14. package/dist/{MySiteScreen-CaBd2GGy.cjs → MySiteScreen-rYmC05jG.cjs} +140 -184
  15. package/dist/MySiteScreen-rYmC05jG.cjs.map +1 -0
  16. package/dist/{OrdersScreen-CgndBekB.cjs → OrdersScreen-BFeY4w9X.cjs} +1 -1
  17. package/dist/{OrdersScreen-Bb0Ir9UQ.mjs → OrdersScreen-Br-KImu9.mjs} +6 -4
  18. package/dist/{OrdersScreen-Bb0Ir9UQ.mjs.map → OrdersScreen-Br-KImu9.mjs.map} +1 -1
  19. package/dist/{OrdersScreen-Ci3bLi5R.cjs → OrdersScreen-CJDd-LdN.cjs} +5 -3
  20. package/dist/{OrdersScreen-Ci3bLi5R.cjs.map → OrdersScreen-CJDd-LdN.cjs.map} +1 -1
  21. package/dist/{ProductsScreen-5aaLW_mi.mjs → ProductsScreen-CeNMvU4d.mjs} +3 -2
  22. package/dist/ProductsScreen-CeNMvU4d.mjs.map +1 -0
  23. package/dist/{ProductsScreen-uoTQR9PU.mjs → ProductsScreen-DIdRGVvA.mjs} +1 -1
  24. package/dist/{ProductsScreen-BA9KYBz7.cjs → ProductsScreen-fPFSKVOn.cjs} +3 -2
  25. package/dist/ProductsScreen-fPFSKVOn.cjs.map +1 -0
  26. package/dist/{ProductsScreen-CgNQv9T1.cjs → ProductsScreen-iQf4zOus.cjs} +1 -1
  27. package/dist/{ProfileScreen-BZA9PaER.cjs → ProfileScreen-BSWf_Rb-.cjs} +5 -3
  28. package/dist/{ProfileScreen-BZA9PaER.cjs.map → ProfileScreen-BSWf_Rb-.cjs.map} +1 -1
  29. package/dist/{ProfileScreen-0-xeqjHj.mjs → ProfileScreen-DQ7Mjq_K.mjs} +5 -3
  30. package/dist/{ProfileScreen-0-xeqjHj.mjs.map → ProfileScreen-DQ7Mjq_K.mjs.map} +1 -1
  31. package/dist/{ProfileScreen-_m0nqiDQ.cjs → ProfileScreen-Nric2qx3.cjs} +1 -1
  32. package/dist/{ShareablesScreen-C51d1euJ.cjs → ShareablesScreen-Bl6aT0vn.cjs} +3 -3
  33. package/dist/ShareablesScreen-Bl6aT0vn.cjs.map +1 -0
  34. package/dist/{ShareablesScreen-BdAGblEo.mjs → ShareablesScreen-CfchbhSH.mjs} +1 -1
  35. package/dist/{ShareablesScreen-DNWdru1i.cjs → ShareablesScreen-CtuGiQ7_.cjs} +1 -1
  36. package/dist/{ShareablesScreen-0iGOTfNW.mjs → ShareablesScreen-D2JbmO7a.mjs} +5 -5
  37. package/dist/ShareablesScreen-D2JbmO7a.mjs.map +1 -0
  38. package/dist/{SubscriptionsScreen-_iUOr_D1.cjs → SubscriptionsScreen-BuxFW2sw.cjs} +5 -3
  39. package/dist/{SubscriptionsScreen-_iUOr_D1.cjs.map → SubscriptionsScreen-BuxFW2sw.cjs.map} +1 -1
  40. package/dist/{SubscriptionsScreen-DzCRMlX5.cjs → SubscriptionsScreen-Bz6FVnmk.cjs} +1 -1
  41. package/dist/{SubscriptionsScreen-Gig1ciN_.mjs → SubscriptionsScreen-DBUELjIY.mjs} +6 -4
  42. package/dist/{SubscriptionsScreen-Gig1ciN_.mjs.map → SubscriptionsScreen-DBUELjIY.mjs.map} +1 -1
  43. package/dist/index.cjs +27 -27
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.d.cts.map +1 -1
  46. package/dist/index.d.mts.map +1 -1
  47. package/dist/index.mjs +28 -28
  48. package/dist/index.mjs.map +1 -1
  49. package/package.json +16 -16
  50. package/dist/ContactsScreen-Bufy88vw.cjs.map +0 -1
  51. package/dist/ContactsScreen-Cx_EJtrO.mjs.map +0 -1
  52. package/dist/MySiteScreen-CaBd2GGy.cjs.map +0 -1
  53. package/dist/MySiteScreen-Y4dsjqFj.mjs.map +0 -1
  54. package/dist/ProductsScreen-5aaLW_mi.mjs.map +0 -1
  55. package/dist/ProductsScreen-BA9KYBz7.cjs.map +0 -1
  56. package/dist/ShareablesScreen-0iGOTfNW.mjs.map +0 -1
  57. package/dist/ShareablesScreen-C51d1euJ.cjs.map +0 -1
@@ -37,7 +37,7 @@ require("./SpacerWidget-DcxMAM1g.cjs");
37
37
  require("./TableWidget-C0ZCnkJh.cjs");
38
38
  require("./ToDoWidget-CnO1TQ4L.cjs");
39
39
  require("./VideoWidget-CqFrRQpB.cjs");
40
- const require_MessagingScreen = require("./MessagingScreen-mKNu6iHk.cjs");
40
+ const require_MessagingScreen = require("./MessagingScreen-DVpyX0RH.cjs");
41
41
  require("./dist-RSRllN0L.cjs");
42
42
  require("./es-Bd1u7pBf.cjs");
43
43
  exports.MessagingScreen = require_MessagingScreen.MessagingScreen;
@@ -1,7 +1,6 @@
1
1
  import { r as __exportAll } from "./es-CtZEZp97.mjs";
2
- import { Ct as CardContent, E as Separator, Et as CardTitle, Jt as BreadcrumbLink, Kt as Breadcrumb, P as Input, St as CardAction, Tt as CardHeader, U as Label, Xt as BreadcrumbPage, Yt as BreadcrumbList, Zt as BreadcrumbSeparator, _n as useZodForm, at as DialogFooter, b as Skeleton, lt as DialogTitle, ot as DialogHeader, qt as BreadcrumbItem, rt as DialogContent, s as Textarea, tt as Dialog, un as Button, vn as cn, xt as Card } from "./src-BYkS71q3.mjs";
2
+ import { Ct as CardContent, E as Separator, Et as CardTitle, Jt as BreadcrumbLink, Kt as Breadcrumb, P as Input, St as CardAction, Tt as CardHeader, U as Label, Xt as BreadcrumbPage, Yt as BreadcrumbList, Zt as BreadcrumbSeparator, _ as fluidToast, _n as useZodForm, at as DialogFooter, b as Skeleton, lt as DialogTitle, ot as DialogHeader, qt as BreadcrumbItem, rt as DialogContent, s as Textarea, tt as Dialog, un as Button, vn as cn, xt as Card } from "./src-BYkS71q3.mjs";
3
3
  import { r as useScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-DhC-5Y4x.mjs";
4
- import { n as useAppNavigation } from "./AppNavigationContext-qFKCN8FO.mjs";
5
4
  import { a as verticalListSortingStrategy, c as PointerSensor, d as useSensors, f as CSS, i as useSortable, l as closestCenter, n as arrayMove, o as DndContext, r as sortableKeyboardCoordinates, s as KeyboardSensor, t as SortableContext, u as useSensor } from "./sortable.esm-CzzU6kIR.mjs";
6
5
  import { a as usePortalFavorites, c as usePortalMySiteThemes, d as usePortalUpdateLink, f as usePortalUpdateProfile, i as usePortalDeleteLink, l as usePortalReorderFavorites, n as usePortalCreateLink, o as usePortalLinks, p as usePortalUpdateSettings, r as usePortalDeleteFavorite, s as usePortalMySiteProfile, u as usePortalReorderLinks } from "./use-mysite-portal-CtU6iAbx.mjs";
7
6
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
@@ -10,72 +9,28 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
9
  import { ArrowLeft, Camera, Check, ChevronRight, Copy, Eye, GripVertical, LayoutGrid, Link2, LoaderCircle, Palette, Pencil, Plus, Trash2, User, Users } from "lucide-react";
11
10
  import { z } from "zod";
12
11
  //#region ../../mysite/ui/src/portal/components/animation-utils.ts
13
- function getContentStyle(phase) {
12
+ function getContentClassName(phase) {
14
13
  switch (phase) {
15
- case "idle": return {
16
- transform: "translateX(0)",
17
- opacity: 1,
18
- transition: "none"
19
- };
20
- case "fade-out": return {
21
- transform: "translateX(0)",
22
- opacity: 0,
23
- transition: `opacity 300ms ease-in-out`
24
- };
25
- case "slide": return {
26
- transform: "translateX(50%)",
27
- opacity: 0,
28
- transition: `transform 500ms ease-in-out`
29
- };
30
- case "fade-in": return {
31
- transform: "translateX(50%)",
32
- opacity: 1,
33
- transition: `opacity 300ms ease-in-out`
34
- };
35
- case "editing": return {
36
- transform: "translateX(50%)",
37
- opacity: 1,
38
- transition: "none"
39
- };
40
- case "exit-fade-out": return {
41
- transform: "translateX(50%)",
42
- opacity: 0,
43
- transition: `opacity 300ms ease-in-out`
44
- };
45
- case "exit-slide": return {
46
- transform: "translateX(0)",
47
- opacity: 0,
48
- transition: `transform 500ms ease-in-out`
49
- };
50
- case "exit-fade-in": return {
51
- transform: "translateX(0)",
52
- opacity: 1,
53
- transition: `opacity 300ms ease-in-out`
54
- };
14
+ case "idle": return "opacity-100 transition-none";
15
+ case "fade-out": return "opacity-0 transition-opacity duration-300 ease-in-out";
16
+ case "slide": return "opacity-0 2xl:translate-x-[50%] transition-transform duration-500 ease-in-out";
17
+ case "fade-in": return "opacity-100 2xl:translate-x-[50%] transition-opacity duration-300 ease-in-out";
18
+ case "editing": return "opacity-100 2xl:translate-x-[50%] transition-none";
19
+ case "exit-fade-out": return "opacity-0 2xl:translate-x-[50%] transition-opacity duration-300 ease-in-out";
20
+ case "exit-slide": return "opacity-0 transition-transform duration-500 ease-in-out";
21
+ case "exit-fade-in": return "opacity-100 transition-opacity duration-300 ease-in-out";
55
22
  }
56
23
  }
57
- function getPreviewStyle(phase) {
24
+ function getPreviewClassName(phase) {
58
25
  switch (phase) {
59
26
  case "idle":
60
27
  case "fade-out":
61
- case "exit-fade-in": return {
62
- transform: "translateX(0)",
63
- transition: "none"
64
- };
65
- case "slide": return {
66
- transform: "translateX(-200%)",
67
- transition: `transform 500ms ease-in-out`
68
- };
28
+ case "exit-fade-in": return "transition-none";
29
+ case "slide": return "2xl:-translate-x-[200%] transition-transform duration-500 ease-in-out";
69
30
  case "fade-in":
70
31
  case "editing":
71
- case "exit-fade-out": return {
72
- transform: "translateX(-200%)",
73
- transition: "none"
74
- };
75
- case "exit-slide": return {
76
- transform: "translateX(0)",
77
- transition: `transform 500ms ease-in-out`
78
- };
32
+ case "exit-fade-out": return "2xl:-translate-x-[200%] transition-none";
33
+ case "exit-slide": return "transition-transform duration-500 ease-in-out";
79
34
  }
80
35
  }
81
36
  //#endregion
@@ -263,7 +218,7 @@ function MySitePhonePreview({ mysiteUrl, themeName, previewKey, isUpdating, onPr
263
218
  className: "text-foreground text-sm font-semibold",
264
219
  children: themeName
265
220
  })] }), /* @__PURE__ */ jsx(Button, {
266
- className: "col-start-2 row-span-2 row-start-1 self-center justify-self-end",
221
+ className: "col-start-2 row-span-2 row-start-1 cursor-pointer self-center justify-self-end",
267
222
  variant: "secondary",
268
223
  size: "sm",
269
224
  onClick: onPreview,
@@ -1152,43 +1107,36 @@ function MySiteProfileForm({ onBack, onToast, onUploadPhoto, avatarUrl, userName
1152
1107
  })]
1153
1108
  })]
1154
1109
  }),
1155
- /* @__PURE__ */ jsxs(Card, {
1156
- className: "p-4 sm:p-6",
1157
- children: [/* @__PURE__ */ jsx("h2", {
1158
- className: "text-foreground mb-4 text-base font-semibold sm:text-lg",
1159
- children: "Display Name"
1160
- }), /* @__PURE__ */ jsxs("div", {
1161
- className: "space-y-2",
1162
- children: [/* @__PURE__ */ jsx(Label, {
1163
- htmlFor: "profile-display-name",
1164
- children: "Name shown on your MySite"
1165
- }), /* @__PURE__ */ jsx(Input, {
1166
- id: "profile-display-name",
1167
- type: "text",
1168
- value: formState.display_name,
1169
- onChange: (e) => handleFieldChange("display_name", e.target.value),
1170
- placeholder: "Your display name"
1171
- })]
1172
- })]
1173
- }),
1174
- /* @__PURE__ */ jsxs(Card, {
1175
- className: "p-4 sm:p-6",
1176
- children: [/* @__PURE__ */ jsx("h2", {
1177
- className: "text-foreground mb-4 text-base font-semibold sm:text-lg",
1178
- children: "Bio"
1179
- }), /* @__PURE__ */ jsxs("div", {
1180
- className: "space-y-2",
1181
- children: [/* @__PURE__ */ jsx(Label, {
1182
- htmlFor: "profile-bio",
1183
- children: "About you"
1184
- }), /* @__PURE__ */ jsx(Textarea, {
1185
- id: "profile-bio",
1186
- rows: 4,
1187
- value: formState.bio,
1188
- onChange: (e) => handleFieldChange("bio", e.target.value),
1189
- placeholder: "Tell people a little about yourself..."
1110
+ /* @__PURE__ */ jsx(Card, {
1111
+ className: "h-auto gap-0 py-0 shadow-none",
1112
+ children: /* @__PURE__ */ jsxs(CardContent, {
1113
+ className: "space-y-4 p-4 sm:p-6",
1114
+ children: [/* @__PURE__ */ jsxs("div", {
1115
+ className: "space-y-2",
1116
+ children: [/* @__PURE__ */ jsx(Label, {
1117
+ htmlFor: "profile-display-name",
1118
+ children: "Display Name"
1119
+ }), /* @__PURE__ */ jsx(Input, {
1120
+ id: "profile-display-name",
1121
+ type: "text",
1122
+ value: formState.display_name,
1123
+ onChange: (e) => handleFieldChange("display_name", e.target.value),
1124
+ placeholder: "Your display name"
1125
+ })]
1126
+ }), /* @__PURE__ */ jsxs("div", {
1127
+ className: "space-y-2",
1128
+ children: [/* @__PURE__ */ jsx(Label, {
1129
+ htmlFor: "profile-bio",
1130
+ children: "Bio"
1131
+ }), /* @__PURE__ */ jsx(Textarea, {
1132
+ id: "profile-bio",
1133
+ rows: 4,
1134
+ value: formState.bio,
1135
+ onChange: (e) => handleFieldChange("bio", e.target.value),
1136
+ placeholder: "Tell people a little about yourself..."
1137
+ })]
1190
1138
  })]
1191
- })]
1139
+ })
1192
1140
  }),
1193
1141
  /* @__PURE__ */ jsx("div", {
1194
1142
  className: "flex justify-end",
@@ -1207,7 +1155,7 @@ function MySiteProfileForm({ onBack, onToast, onUploadPhoto, avatarUrl, userName
1207
1155
  const navigationItems = [
1208
1156
  {
1209
1157
  label: "Profile",
1210
- slug: "my-site/profile",
1158
+ key: "profile",
1211
1159
  icon: User
1212
1160
  },
1213
1161
  {
@@ -1226,34 +1174,13 @@ const navigationItems = [
1226
1174
  icon: Link2
1227
1175
  }
1228
1176
  ];
1229
- function defaultToast$1(message, type) {
1230
- if (type === "error") console.warn("[MySite]", message);
1231
- else console.info("[MySite]", message);
1177
+ function defaultToast(message, type) {
1178
+ fluidToast({
1179
+ title: message,
1180
+ type
1181
+ });
1232
1182
  }
1233
- function MySiteMainView() {
1234
- const { navigate } = useAppNavigation();
1235
- const [animPhase, setAnimPhase] = useState("idle");
1236
- const [editingSection, setEditingSection] = useState(null);
1237
- const timeoutsRef = useRef([]);
1238
- useEffect(() => {
1239
- const ref = timeoutsRef;
1240
- return () => ref.current.forEach(clearTimeout);
1241
- }, []);
1242
- const cancelScheduled = useCallback(() => {
1243
- timeoutsRef.current.forEach(clearTimeout);
1244
- timeoutsRef.current = [];
1245
- }, []);
1246
- const schedule = useCallback((phase, delay) => {
1247
- const id = setTimeout(() => setAnimPhase(phase), delay);
1248
- timeoutsRef.current.push(id);
1249
- }, []);
1250
- const showEditContent = [
1251
- "slide",
1252
- "fade-in",
1253
- "editing",
1254
- "exit-fade-out",
1255
- "exit-slide"
1256
- ].includes(animPhase);
1183
+ function MySiteMainView({ editingSection, animPhase, showEditContent, onEditSection, onBackClick }) {
1257
1184
  const { data: profile, isLoading: isProfileLoading } = usePortalMySiteProfile();
1258
1185
  const { data: themes = [] } = usePortalMySiteThemes();
1259
1186
  const updateSettingsMutation = usePortalUpdateSettings();
@@ -1272,12 +1199,12 @@ function MySiteMainView() {
1272
1199
  setSelectedThemeId(theme.id);
1273
1200
  updateSettingsMutation.mutate({ theme_id: theme.id }, {
1274
1201
  onSuccess: () => {
1275
- defaultToast$1(`Theme changed to "${theme.name}"`, "success");
1202
+ defaultToast(`Theme changed to "${theme.name}"`, "success");
1276
1203
  refreshPreview();
1277
1204
  },
1278
1205
  onError: () => {
1279
1206
  setSelectedThemeId(previousThemeId);
1280
- defaultToast$1("Failed to update theme", "error");
1207
+ defaultToast("Failed to update theme", "error");
1281
1208
  }
1282
1209
  });
1283
1210
  }, [
@@ -1294,25 +1221,6 @@ function MySiteMainView() {
1294
1221
  });
1295
1222
  });
1296
1223
  }, [updateSettingsMutation]);
1297
- const handleEditSection = useCallback((section) => {
1298
- cancelScheduled();
1299
- setEditingSection(section);
1300
- setAnimPhase("fade-out");
1301
- schedule("slide", 300);
1302
- schedule("fade-in", 800);
1303
- schedule("editing", 1100);
1304
- }, [cancelScheduled, schedule]);
1305
- const handleBackClick = useCallback(() => {
1306
- cancelScheduled();
1307
- setAnimPhase("exit-fade-out");
1308
- schedule("exit-slide", 300);
1309
- schedule("exit-fade-in", 800);
1310
- const id = setTimeout(() => {
1311
- setAnimPhase("idle");
1312
- setEditingSection(null);
1313
- }, 1100);
1314
- timeoutsRef.current.push(id);
1315
- }, [cancelScheduled, schedule]);
1316
1224
  const handlePreview = useCallback(() => {
1317
1225
  if (mysiteUrl) window.open(`${mysiteUrl}?preview=true`, "_blank");
1318
1226
  }, [mysiteUrl]);
@@ -1320,6 +1228,7 @@ function MySiteMainView() {
1320
1228
  if (editingSection === "theme") return "Theme";
1321
1229
  if (editingSection === "buttons") return "Buttons";
1322
1230
  if (editingSection === "content") return "MySite Content";
1231
+ if (editingSection === "profile") return "Profile";
1323
1232
  return "";
1324
1233
  }, [editingSection]);
1325
1234
  if (isProfileLoading) return /* @__PURE__ */ jsxs("div", {
@@ -1349,13 +1258,12 @@ function MySiteMainView() {
1349
1258
  })
1350
1259
  })]
1351
1260
  });
1352
- const contentStyle = getContentStyle(animPhase);
1353
- const previewStyle = getPreviewStyle(animPhase);
1261
+ const contentAnimClassName = getContentClassName(animPhase);
1262
+ const previewAnimClassName = getPreviewClassName(animPhase);
1354
1263
  return /* @__PURE__ */ jsxs("div", {
1355
1264
  className: "flex h-full overflow-hidden px-2 py-6",
1356
1265
  children: [/* @__PURE__ */ jsx("div", {
1357
- className: "w-full px-4 2xl:w-2/3 2xl:shrink-0",
1358
- style: contentStyle,
1266
+ className: `w-full px-4 2xl:w-2/3 2xl:shrink-0 ${contentAnimClassName}`,
1359
1267
  children: /* @__PURE__ */ jsx("div", {
1360
1268
  className: "flex h-full min-w-0 flex-col gap-5 overflow-y-auto",
1361
1269
  children: showEditContent && editingSection === "theme" ? /* @__PURE__ */ jsx(MySiteThemeEditor, {
@@ -1363,15 +1271,18 @@ function MySiteMainView() {
1363
1271
  selectedThemeId: resolvedThemeId,
1364
1272
  onSelectTheme: handleSelectTheme,
1365
1273
  isPending: updateSettingsMutation.isPending,
1366
- onBack: handleBackClick
1274
+ onBack: onBackClick
1367
1275
  }) : showEditContent && editingSection === "buttons" ? /* @__PURE__ */ jsx(PortalButtonsEditor, {
1368
- onBack: handleBackClick,
1276
+ onBack: onBackClick,
1369
1277
  onRefreshPreview: refreshPreview,
1370
- onToast: defaultToast$1
1278
+ onToast: defaultToast
1371
1279
  }) : showEditContent && editingSection === "content" ? /* @__PURE__ */ jsx(PortalFavoritesEditor, {
1372
- onBack: handleBackClick,
1280
+ onBack: onBackClick,
1373
1281
  onRefreshPreview: refreshPreview,
1374
- onToast: defaultToast$1
1282
+ onToast: defaultToast
1283
+ }) : showEditContent && editingSection === "profile" ? /* @__PURE__ */ jsx(MySiteProfileForm, {
1284
+ onBack: onBackClick,
1285
+ onToast: defaultToast
1375
1286
  }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
1376
1287
  /* @__PURE__ */ jsxs("div", {
1377
1288
  className: "flex items-center gap-2",
@@ -1391,7 +1302,7 @@ function MySiteMainView() {
1391
1302
  mysiteUrl,
1392
1303
  displayUrl,
1393
1304
  onUpdateSlug: handleUpdateSlug,
1394
- onToast: defaultToast$1
1305
+ onToast: defaultToast
1395
1306
  }),
1396
1307
  /* @__PURE__ */ jsx("div", {
1397
1308
  className: "border-border bg-card divide-border divide-y overflow-hidden rounded-lg border",
@@ -1399,10 +1310,7 @@ function MySiteMainView() {
1399
1310
  const Icon = item.icon;
1400
1311
  return /* @__PURE__ */ jsxs("button", {
1401
1312
  type: "button",
1402
- onClick: () => {
1403
- if ("key" in item) handleEditSection(item.key);
1404
- else navigate(item.slug);
1405
- },
1313
+ onClick: () => onEditSection(item.key),
1406
1314
  className: "group hover:bg-muted flex w-full items-center gap-2.5 px-3 py-2.5 transition-colors text-left cursor-pointer",
1407
1315
  children: [
1408
1316
  /* @__PURE__ */ jsx("div", {
@@ -1421,8 +1329,7 @@ function MySiteMainView() {
1421
1329
  ] })
1422
1330
  })
1423
1331
  }), /* @__PURE__ */ jsx("div", {
1424
- className: "hidden w-1/3 shrink-0 overflow-y-hidden px-4 2xl:block",
1425
- style: previewStyle,
1332
+ className: `hidden w-1/3 shrink-0 overflow-y-hidden px-4 2xl:block ${previewAnimClassName}`,
1426
1333
  children: /* @__PURE__ */ jsx(MySitePhonePreview, {
1427
1334
  mysiteUrl,
1428
1335
  themeName,
@@ -1434,17 +1341,53 @@ function MySiteMainView() {
1434
1341
  });
1435
1342
  }
1436
1343
  //#endregion
1437
- //#region src/screens/MySiteScreen/MySiteProfileView.tsx
1438
- function defaultToast(message, type) {
1439
- if (type === "error") console.warn("[MySite]", message);
1440
- else console.info("[MySite]", message);
1441
- }
1442
- function MySiteProfileView() {
1443
- const { navigate } = useAppNavigation();
1444
- return /* @__PURE__ */ jsx(MySiteProfileForm, {
1445
- onBack: () => navigate("my-site"),
1446
- onToast: defaultToast
1447
- });
1344
+ //#region src/screens/MySiteScreen/use-mysite-editing-section.ts
1345
+ function useMySiteEditingSection() {
1346
+ const [animPhase, setAnimPhase] = useState("idle");
1347
+ const [editingSection, setEditingSection] = useState(null);
1348
+ const timeoutsRef = useRef([]);
1349
+ useEffect(() => {
1350
+ const ref = timeoutsRef;
1351
+ return () => ref.current.forEach(clearTimeout);
1352
+ }, []);
1353
+ const cancelScheduled = useCallback(() => {
1354
+ timeoutsRef.current.forEach(clearTimeout);
1355
+ timeoutsRef.current = [];
1356
+ }, []);
1357
+ const schedule = useCallback((phase, delay) => {
1358
+ const id = setTimeout(() => setAnimPhase(phase), delay);
1359
+ timeoutsRef.current.push(id);
1360
+ }, []);
1361
+ return {
1362
+ editingSection,
1363
+ animPhase,
1364
+ showEditContent: [
1365
+ "slide",
1366
+ "fade-in",
1367
+ "editing",
1368
+ "exit-fade-out",
1369
+ "exit-slide"
1370
+ ].includes(animPhase),
1371
+ handleEditSection: useCallback((section) => {
1372
+ cancelScheduled();
1373
+ setEditingSection(section);
1374
+ setAnimPhase("fade-out");
1375
+ schedule("slide", 300);
1376
+ schedule("fade-in", 800);
1377
+ schedule("editing", 1100);
1378
+ }, [cancelScheduled, schedule]),
1379
+ handleBackClick: useCallback(() => {
1380
+ cancelScheduled();
1381
+ setAnimPhase("exit-fade-out");
1382
+ schedule("exit-slide", 300);
1383
+ schedule("exit-fade-in", 800);
1384
+ const id = setTimeout(() => {
1385
+ setAnimPhase("idle");
1386
+ setEditingSection(null);
1387
+ }, 1100);
1388
+ timeoutsRef.current.push(id);
1389
+ }, [cancelScheduled, schedule])
1390
+ };
1448
1391
  }
1449
1392
  //#endregion
1450
1393
  //#region src/screens/MySiteScreen/index.tsx
@@ -1453,29 +1396,42 @@ var MySiteScreen_exports = /* @__PURE__ */ __exportAll({
1453
1396
  mySiteScreenPropertySchema: () => mySiteScreenPropertySchema
1454
1397
  });
1455
1398
  function MySiteScreen({ background, textColor, accentColor, padding, borderRadius, ...divProps }) {
1456
- const { currentSlug, navigate } = useAppNavigation();
1457
- const isProfileView = (currentSlug.split("/")[1] ?? null) === "profile";
1399
+ const { editingSection, animPhase, showEditContent, handleEditSection, handleBackClick } = useMySiteEditingSection();
1400
+ const sectionLabel = useMemo(() => {
1401
+ if (editingSection === "theme") return "Theme";
1402
+ if (editingSection === "buttons") return "Buttons";
1403
+ if (editingSection === "content") return "MySite Content";
1404
+ if (editingSection === "profile") return "Profile";
1405
+ return null;
1406
+ }, [editingSection]);
1407
+ const handleRootCrumbClick = useCallback((e) => {
1408
+ e.preventDefault();
1409
+ if (editingSection !== null) handleBackClick();
1410
+ }, [editingSection, handleBackClick]);
1458
1411
  useScreenHeaderBreadcrumbs(useMemo(() => /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, {
1459
1412
  className: "text-lg",
1460
- children: [/* @__PURE__ */ jsx(BreadcrumbItem, { children: isProfileView ? /* @__PURE__ */ jsx(BreadcrumbLink, {
1413
+ children: [/* @__PURE__ */ jsx(BreadcrumbItem, { children: sectionLabel ? /* @__PURE__ */ jsx(BreadcrumbLink, {
1461
1414
  href: "#",
1462
- onClick: (e) => {
1463
- e.preventDefault();
1464
- navigate("my-site");
1465
- },
1415
+ onClick: handleRootCrumbClick,
1466
1416
  children: "My Site"
1467
1417
  }) : /* @__PURE__ */ jsx(BreadcrumbPage, {
1468
1418
  className: "font-semibold",
1469
1419
  children: "My Site"
1470
- }) }), isProfileView && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(BreadcrumbSeparator, {}), /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
1420
+ }) }), sectionLabel && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(BreadcrumbSeparator, {}), /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
1471
1421
  className: "font-semibold",
1472
- children: "Profile"
1422
+ children: sectionLabel
1473
1423
  }) })] })]
1474
- }) }), [isProfileView, navigate]));
1424
+ }) }), [sectionLabel, handleRootCrumbClick]));
1475
1425
  return /* @__PURE__ */ jsx("div", {
1476
1426
  ...divProps,
1477
1427
  className: `h-full ${divProps.className ?? ""}`,
1478
- children: isProfileView ? /* @__PURE__ */ jsx(MySiteProfileView, {}) : /* @__PURE__ */ jsx(MySiteMainView, {})
1428
+ children: /* @__PURE__ */ jsx(MySiteMainView, {
1429
+ editingSection,
1430
+ animPhase,
1431
+ showEditContent,
1432
+ onEditSection: handleEditSection,
1433
+ onBackClick: handleBackClick
1434
+ })
1479
1435
  });
1480
1436
  }
1481
1437
  const mySiteScreenPropertySchema = {
@@ -1490,4 +1446,4 @@ const mySiteScreenPropertySchema = {
1490
1446
  //#endregion
1491
1447
  export { MySiteScreen_exports as n, mySiteScreenPropertySchema as r, MySiteScreen as t };
1492
1448
 
1493
- //# sourceMappingURL=MySiteScreen-Y4dsjqFj.mjs.map
1449
+ //# sourceMappingURL=MySiteScreen-BsePIEvg.mjs.map