@fluid-app/portal-sdk 0.1.243 → 0.1.245

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 (117) hide show
  1. package/dist/{AppDownloadScreen-DQR40F0y.mjs → AppDownloadScreen-DPnbWP5G.mjs} +1 -1
  2. package/dist/{AppDownloadScreen-DQR40F0y.mjs.map → AppDownloadScreen-DPnbWP5G.mjs.map} +1 -1
  3. package/dist/{AppDownloadScreen-BXnl23_d.cjs → AppDownloadScreen-Og_iMsw5.cjs} +1 -1
  4. package/dist/{AppDownloadScreen-BXnl23_d.cjs.map → AppDownloadScreen-Og_iMsw5.cjs.map} +1 -1
  5. package/dist/{AppNavigationContext-C1-hd9Rw.cjs → AppNavigationContext-BDs1cOuG.cjs} +1 -1
  6. package/dist/{AppNavigationContext-C1-hd9Rw.cjs.map → AppNavigationContext-BDs1cOuG.cjs.map} +1 -1
  7. package/dist/{AppNavigationContext-Dvc0yoZF.mjs → AppNavigationContext-DNod9mf6.mjs} +1 -1
  8. package/dist/{AppNavigationContext-Dvc0yoZF.mjs.map → AppNavigationContext-DNod9mf6.mjs.map} +1 -1
  9. package/dist/{ContactsScreen-Cj0_VI0d.cjs → ContactsScreen-CZ2hrMqf.cjs} +6 -6
  10. package/dist/{ContactsScreen-Cj0_VI0d.cjs.map → ContactsScreen-CZ2hrMqf.cjs.map} +1 -1
  11. package/dist/{ContactsScreen-CMBERzKU.mjs → ContactsScreen-DuhDzRtI.mjs} +6 -6
  12. package/dist/{ContactsScreen-CMBERzKU.mjs.map → ContactsScreen-DuhDzRtI.mjs.map} +1 -1
  13. package/dist/{ContactsScreen-CH_P8WxC.cjs → ContactsScreen-Dv1SJNBo.cjs} +5 -5
  14. package/dist/{InfiniteScrollSentinel-DeIL8UkW.cjs → InfiniteScrollSentinel-BaPx1tjC.cjs} +1 -1
  15. package/dist/{InfiniteScrollSentinel-DeIL8UkW.cjs.map → InfiniteScrollSentinel-BaPx1tjC.cjs.map} +1 -1
  16. package/dist/{InfiniteScrollSentinel-B_clNL9Y.mjs → InfiniteScrollSentinel-D0XRJi51.mjs} +1 -1
  17. package/dist/{InfiniteScrollSentinel-B_clNL9Y.mjs.map → InfiniteScrollSentinel-D0XRJi51.mjs.map} +1 -1
  18. package/dist/{MessagingScreen-KYx6DSMx.cjs → MessagingScreen-BwI0RShj.cjs} +3 -3
  19. package/dist/{MessagingScreen-vb5P-7jP.mjs → MessagingScreen-DiSZ7fyd.mjs} +3 -3
  20. package/dist/{MessagingScreen-vb5P-7jP.mjs.map → MessagingScreen-DiSZ7fyd.mjs.map} +1 -1
  21. package/dist/{MessagingScreen-CCbgNRp1.cjs → MessagingScreen-WCeHWGlX.cjs} +5 -5
  22. package/dist/{MessagingScreen-CCbgNRp1.cjs.map → MessagingScreen-WCeHWGlX.cjs.map} +1 -1
  23. package/dist/{MySiteScreen-B_16cPgD.cjs → MySiteScreen-Bdd7a6Hy.cjs} +3 -2
  24. package/dist/MySiteScreen-CK84vXa9.mjs +301 -0
  25. package/dist/MySiteScreen-CK84vXa9.mjs.map +1 -0
  26. package/dist/MySiteScreen-zfajm9da.cjs +309 -0
  27. package/dist/MySiteScreen-zfajm9da.cjs.map +1 -0
  28. package/dist/{OrdersScreen-Cuch7aki.cjs → OrdersScreen-BLs1xTv7.cjs} +4 -4
  29. package/dist/{OrdersScreen-DPcp2dLW.cjs → OrdersScreen-BbS7Alby.cjs} +86 -41
  30. package/dist/OrdersScreen-BbS7Alby.cjs.map +1 -0
  31. package/dist/{OrdersScreen-BV3vJ7xy.mjs → OrdersScreen-b-ZC4_NI.mjs} +86 -41
  32. package/dist/OrdersScreen-b-ZC4_NI.mjs.map +1 -0
  33. package/dist/{PortalProductsApiProvider-BIZg_c4Y.mjs → PortalProductsApiProvider-BFdHFvog.mjs} +1 -1
  34. package/dist/{PortalProductsApiProvider-BIZg_c4Y.mjs.map → PortalProductsApiProvider-BFdHFvog.mjs.map} +1 -1
  35. package/dist/{PortalProductsApiProvider-DL8nl7To.cjs → PortalProductsApiProvider-CkS7OIGt.cjs} +1 -1
  36. package/dist/{PortalProductsApiProvider-DL8nl7To.cjs.map → PortalProductsApiProvider-CkS7OIGt.cjs.map} +1 -1
  37. package/dist/{ProfileScreen-BT0iys-q.cjs → ProfileScreen-BfvdQa0q.cjs} +114 -33
  38. package/dist/ProfileScreen-BfvdQa0q.cjs.map +1 -0
  39. package/dist/{ProfileScreen-CZAIUM2a.mjs → ProfileScreen-CRLf8oDe.mjs} +116 -35
  40. package/dist/ProfileScreen-CRLf8oDe.mjs.map +1 -0
  41. package/dist/{ProfileScreen-CKcdtroU.cjs → ProfileScreen-Za3ZIWPO.cjs} +4 -2
  42. package/dist/{SearchSort-CeJqRK2c.cjs → SearchSort-BP2ktxyN.cjs} +1 -1
  43. package/dist/{SearchSort-CeJqRK2c.cjs.map → SearchSort-BP2ktxyN.cjs.map} +1 -1
  44. package/dist/{SearchSort-CFHU38Er.mjs → SearchSort-CokMCrhy.mjs} +1 -1
  45. package/dist/{SearchSort-CFHU38Er.mjs.map → SearchSort-CokMCrhy.mjs.map} +1 -1
  46. package/dist/{ShareablesScreen-sieWBlAl.mjs → ShareablesScreen-BZZ-RT71.mjs} +8 -8
  47. package/dist/{ShareablesScreen-sieWBlAl.mjs.map → ShareablesScreen-BZZ-RT71.mjs.map} +1 -1
  48. package/dist/{ShareablesScreen-A69L0Nok.cjs → ShareablesScreen-BxOKbuuU.cjs} +20 -20
  49. package/dist/{ShareablesScreen-A69L0Nok.cjs.map → ShareablesScreen-BxOKbuuU.cjs.map} +1 -1
  50. package/dist/{ShareablesScreen-BUYG-mjj.cjs → ShareablesScreen-CsDxLODp.cjs} +7 -7
  51. package/dist/{ShopScreen-sLUTgIcQ.mjs → ShopScreen-BG1pxd2D.mjs} +4 -4
  52. package/dist/{ShopScreen-sLUTgIcQ.mjs.map → ShopScreen-BG1pxd2D.mjs.map} +1 -1
  53. package/dist/{ShopScreen-DVpCo-OV.cjs → ShopScreen-BigHJ5wE.cjs} +3 -3
  54. package/dist/{ShopScreen-Dm85_rMp.cjs → ShopScreen-S6rBaoWM.cjs} +4 -4
  55. package/dist/{ShopScreen-Dm85_rMp.cjs.map → ShopScreen-S6rBaoWM.cjs.map} +1 -1
  56. package/dist/{SubscriptionsScreen-DrDSwMXS.cjs → SubscriptionsScreen-B88_dLfE.cjs} +9 -9
  57. package/dist/{SubscriptionsScreen-DrDSwMXS.cjs.map → SubscriptionsScreen-B88_dLfE.cjs.map} +1 -1
  58. package/dist/{SubscriptionsScreen-CXM2zmF7.mjs → SubscriptionsScreen-DK9-h3Cz.mjs} +8 -8
  59. package/dist/{SubscriptionsScreen-CXM2zmF7.mjs.map → SubscriptionsScreen-DK9-h3Cz.mjs.map} +1 -1
  60. package/dist/{SubscriptionsScreen-t5wtDGfB.cjs → SubscriptionsScreen-dhnfYn4L.cjs} +5 -5
  61. package/dist/{UpgradeScreen-DUvg-WZv.cjs → UpgradeScreen-Bl9lb32K.cjs} +1 -1
  62. package/dist/{UpgradeScreen-DAKe_hiv.cjs → UpgradeScreen-C-hFDAR2.cjs} +1 -1
  63. package/dist/{UpgradeScreen-DAKe_hiv.cjs.map → UpgradeScreen-C-hFDAR2.cjs.map} +1 -1
  64. package/dist/{UpgradeScreen-DnGnWVTf.mjs → UpgradeScreen-X6j0_625.mjs} +1 -1
  65. package/dist/{UpgradeScreen-DnGnWVTf.mjs.map → UpgradeScreen-X6j0_625.mjs.map} +1 -1
  66. package/dist/{MySiteScreen-CUyJteDm.cjs → components-BKADyCYp.cjs} +42 -466
  67. package/dist/components-BKADyCYp.cjs.map +1 -0
  68. package/dist/{MySiteScreen-CN0ZDBgy.mjs → components-CjgEvBYG.mjs} +6 -470
  69. package/dist/components-CjgEvBYG.mjs.map +1 -0
  70. package/dist/{dist-PbA1vxAz.mjs → dist-BstXVe25.mjs} +1 -1
  71. package/dist/{dist-PbA1vxAz.mjs.map → dist-BstXVe25.mjs.map} +1 -1
  72. package/dist/{dist-o2cjwzIa.mjs → dist-CTLDCXCc.mjs} +2 -2
  73. package/dist/{dist-o2cjwzIa.mjs.map → dist-CTLDCXCc.mjs.map} +1 -1
  74. package/dist/{dist-BQZkLGL6.cjs → dist-DJAHGHHi.cjs} +1 -19
  75. package/dist/{dist-BQZkLGL6.cjs.map → dist-DJAHGHHi.cjs.map} +1 -1
  76. package/dist/{dist-DbRTQ2QF.cjs → dist-D_3_ZuC5.cjs} +1 -1
  77. package/dist/{dist-DbRTQ2QF.cjs.map → dist-D_3_ZuC5.cjs.map} +1 -1
  78. package/dist/{dist-myuZC8sf.cjs → dist-vhBaFZ9L.cjs} +2 -2
  79. package/dist/{dist-myuZC8sf.cjs.map → dist-vhBaFZ9L.cjs.map} +1 -1
  80. package/dist/{es-UfEBhcZD.cjs → es-B5heQ57j.cjs} +1 -1
  81. package/dist/{es-UfEBhcZD.cjs.map → es-B5heQ57j.cjs.map} +1 -1
  82. package/dist/{fluid-pay-api-adapter-eNT8m0xB.mjs → fluid-pay-api-adapter-CJ7-I8k-.mjs} +673 -381
  83. package/dist/fluid-pay-api-adapter-CJ7-I8k-.mjs.map +1 -0
  84. package/dist/{fluid-pay-api-adapter-BszgrFL6.cjs → fluid-pay-api-adapter-D63KLi5c.cjs} +700 -378
  85. package/dist/fluid-pay-api-adapter-D63KLi5c.cjs.map +1 -0
  86. package/dist/{format-CytB2M00.cjs → format-CLUjV1oR.cjs} +1 -1
  87. package/dist/{format-CytB2M00.cjs.map → format-CLUjV1oR.cjs.map} +1 -1
  88. package/dist/index.cjs +51 -116
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts.map +1 -1
  91. package/dist/index.d.mts.map +1 -1
  92. package/dist/index.mjs +50 -115
  93. package/dist/index.mjs.map +1 -1
  94. package/dist/{order-status-badge-DHyaK6mU.cjs → order-status-badge-BKvLeVsM.cjs} +3 -3
  95. package/dist/{order-status-badge-DHyaK6mU.cjs.map → order-status-badge-BKvLeVsM.cjs.map} +1 -1
  96. package/dist/{order-status-badge-Dmo8lLnt.mjs → order-status-badge-xuJ732eH.mjs} +3 -3
  97. package/dist/{order-status-badge-Dmo8lLnt.mjs.map → order-status-badge-xuJ732eH.mjs.map} +1 -1
  98. package/dist/{query-keys-oQKvV4jp.mjs → query-keys-8SVs82aF.mjs} +1 -1
  99. package/dist/{query-keys-elu0svUd.cjs.map → query-keys-8SVs82aF.mjs.map} +1 -1
  100. package/dist/{query-keys-elu0svUd.cjs → query-keys-e9EEoWxN.cjs} +1 -1
  101. package/dist/{query-keys-oQKvV4jp.mjs.map → query-keys-e9EEoWxN.cjs.map} +1 -1
  102. package/dist/{sortable.esm-C8G00cCP.mjs → sortable.esm-C8riJ_zv.mjs} +2 -14
  103. package/dist/{sortable.esm-C8G00cCP.mjs.map → sortable.esm-C8riJ_zv.mjs.map} +1 -1
  104. package/dist/{use-account-C1X-VLY-.cjs → use-account-D6Z9hkDX.cjs} +2 -2
  105. package/dist/{use-account-C1X-VLY-.cjs.map → use-account-D6Z9hkDX.cjs.map} +1 -1
  106. package/dist/{use-account-C76sphlu.mjs → use-account-DsTz5BlS.mjs} +2 -2
  107. package/dist/{use-account-C76sphlu.mjs.map → use-account-DsTz5BlS.mjs.map} +1 -1
  108. package/package.json +10 -9
  109. package/styles/packages.css +1 -0
  110. package/dist/MySiteScreen-CN0ZDBgy.mjs.map +0 -1
  111. package/dist/MySiteScreen-CUyJteDm.cjs.map +0 -1
  112. package/dist/OrdersScreen-BV3vJ7xy.mjs.map +0 -1
  113. package/dist/OrdersScreen-DPcp2dLW.cjs.map +0 -1
  114. package/dist/ProfileScreen-BT0iys-q.cjs.map +0 -1
  115. package/dist/ProfileScreen-CZAIUM2a.mjs.map +0 -1
  116. package/dist/fluid-pay-api-adapter-BszgrFL6.cjs.map +0 -1
  117. package/dist/fluid-pay-api-adapter-eNT8m0xB.mjs.map +0 -1
@@ -1,11 +1,9 @@
1
- import { r as __exportAll } from "./es-BXxGlAp6.mjs";
2
- import { At as CardTitle, C as Skeleton, Dn as Button, Et as CardContent, Fn as cn, K as Label, L as Input, Pn as useZodForm, Tt as CardAction, b as fluidToast, ct as DialogFooter, dn as BreadcrumbLink, fn as BreadcrumbList, ft as DialogTitle, it as Dialog, k as Separator, kt as CardHeader, ln as Breadcrumb, lt as DialogHeader, mn as BreadcrumbSeparator, ot as DialogContent, pn as BreadcrumbPage, s as Textarea, un as BreadcrumbItem, wt as Card } from "./src-pgBBOcJa.mjs";
3
- import { r as useScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-Cemdo7bM.mjs";
4
- import { C as usePortalUpdateLink, S as usePortalReorderLinks, T as usePortalUpdateSettings, _ as usePortalFavorites, a as verticalListSortingStrategy, b as usePortalMySiteThemes, c as PointerSensor, d as useSensors, f as CSS, g as usePortalDeleteLink, h as usePortalDeleteFavorite, i as useSortable, l as closestCenter, m as usePortalCreateLink, n as arrayMove, o as DndContext, r as sortableKeyboardCoordinates, s as KeyboardSensor, t as SortableContext, u as useSensor, v as usePortalLinks, w as usePortalUpdateProfile, x as usePortalReorderFavorites, y as usePortalMySiteProfile } from "./sortable.esm-C8G00cCP.mjs";
5
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
1
+ import { At as CardTitle, C as Skeleton, Dn as Button, Et as CardContent, Fn as cn, K as Label, L as Input, Pn as useZodForm, Tt as CardAction, ct as DialogFooter, ft as DialogTitle, it as Dialog, k as Separator, kt as CardHeader, lt as DialogHeader, ot as DialogContent, wt as Card } from "./src-pgBBOcJa.mjs";
2
+ import { C as usePortalUpdateLink, S as usePortalReorderLinks, _ as usePortalFavorites, a as verticalListSortingStrategy, c as PointerSensor, d as useSensors, f as CSS, g as usePortalDeleteLink, h as usePortalDeleteFavorite, i as useSortable, l as closestCenter, m as usePortalCreateLink, n as arrayMove, o as DndContext, r as sortableKeyboardCoordinates, s as KeyboardSensor, t as SortableContext, u as useSensor, v as usePortalLinks, x as usePortalReorderFavorites } from "./sortable.esm-C8riJ_zv.mjs";
3
+ import { useCallback, useEffect, useRef, useState } from "react";
6
4
  import "@tanstack/react-query";
7
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
- import { ArrowLeft, Camera, Check, ChevronRight, Copy, Eye, GripVertical, LayoutGrid, Link2, LoaderCircle, Palette, Pencil, Plus, Trash2, User, Users } from "lucide-react";
6
+ import { ArrowLeft, Check, Copy, Eye, GripVertical, LoaderCircle, Palette, Pencil, Plus, Trash2, Users } from "lucide-react";
9
7
  import { z } from "zod";
10
8
  //#region ../../mysite/ui/src/portal/components/animation-utils.ts
11
9
  function getContentClassName(phase) {
@@ -985,468 +983,6 @@ function PortalFavoritesEditor({ onBack, onRefreshPreview, onToast }) {
985
983
  ] });
986
984
  }
987
985
  //#endregion
988
- //#region ../../mysite/ui/src/portal/components/MySiteProfileForm.tsx
989
- function MySiteProfileForm({ onBack, onToast, onRefreshPreview, onUploadPhoto, avatarUrl, userName, userInitial }) {
990
- const { data: profile, isLoading: isProfileLoading } = usePortalMySiteProfile();
991
- const updateProfileMutation = usePortalUpdateProfile();
992
- const [formState, setFormState] = useState(() => ({ bio: "" }));
993
- const profileSyncedRef = useRef(false);
994
- useEffect(() => {
995
- if (profile && !profileSyncedRef.current) {
996
- profileSyncedRef.current = true;
997
- setFormState({ bio: profile.bio ?? "" });
998
- }
999
- }, [profile]);
1000
- const isDirty = formState.bio.trim() !== (profile?.bio ?? "");
1001
- const handleFieldChange = useCallback((field, value) => {
1002
- setFormState((s) => ({
1003
- ...s,
1004
- [field]: value
1005
- }));
1006
- }, []);
1007
- const handleSave = useCallback(() => {
1008
- const trimmedBio = formState.bio.trim();
1009
- updateProfileMutation.mutate({ bio: trimmedBio }, {
1010
- onSuccess: () => {
1011
- profileSyncedRef.current = false;
1012
- onToast?.("Profile updated successfully", "success");
1013
- onRefreshPreview?.();
1014
- },
1015
- onError: () => {
1016
- onToast?.("Failed to update profile", "error");
1017
- }
1018
- });
1019
- }, [
1020
- formState,
1021
- updateProfileMutation,
1022
- onToast,
1023
- onRefreshPreview
1024
- ]);
1025
- const fileInputRef = useRef(null);
1026
- const [isUploadingPhoto, setIsUploadingPhoto] = useState(false);
1027
- const [previewUrl, setPreviewUrl] = useState(null);
1028
- useEffect(() => {
1029
- return () => {
1030
- if (previewUrl) URL.revokeObjectURL(previewUrl);
1031
- };
1032
- }, [previewUrl]);
1033
- const handleFileSelected = useCallback(async (e) => {
1034
- const file = e.target.files?.[0];
1035
- if (!file || !onUploadPhoto) return;
1036
- if (!file.type.startsWith("image/")) {
1037
- onToast?.("Please select an image file", "error");
1038
- return;
1039
- }
1040
- setPreviewUrl(URL.createObjectURL(file));
1041
- setIsUploadingPhoto(true);
1042
- try {
1043
- const imageUrl = await onUploadPhoto(file);
1044
- updateProfileMutation.mutate({ avatar_url: imageUrl }, {
1045
- onSuccess: () => {
1046
- setPreviewUrl(null);
1047
- onToast?.("Profile photo updated", "success");
1048
- onRefreshPreview?.();
1049
- },
1050
- onError: () => {
1051
- setPreviewUrl(null);
1052
- onToast?.("Failed to save profile photo", "error");
1053
- }
1054
- });
1055
- } catch {
1056
- setPreviewUrl(null);
1057
- onToast?.("Failed to upload photo", "error");
1058
- } finally {
1059
- setIsUploadingPhoto(false);
1060
- if (fileInputRef.current) fileInputRef.current.value = "";
1061
- }
1062
- }, [
1063
- onUploadPhoto,
1064
- updateProfileMutation,
1065
- onToast,
1066
- onRefreshPreview
1067
- ]);
1068
- if (isProfileLoading) return /* @__PURE__ */ jsx("div", {
1069
- className: "flex h-full items-center justify-center",
1070
- children: /* @__PURE__ */ jsx("div", {
1071
- className: "text-muted-foreground animate-pulse",
1072
- children: "Loading..."
1073
- })
1074
- });
1075
- const displayAvatarUrl = previewUrl || avatarUrl || profile?.avatar_url;
1076
- return /* @__PURE__ */ jsxs("div", {
1077
- className: "space-y-4 p-4 sm:space-y-6 sm:p-6",
1078
- children: [
1079
- /* @__PURE__ */ jsxs("div", {
1080
- className: "flex items-center gap-3",
1081
- children: [/* @__PURE__ */ jsx("button", {
1082
- type: "button",
1083
- onClick: onBack,
1084
- className: "text-muted-foreground hover:bg-muted hover:text-foreground flex h-10 w-10 items-center justify-center rounded-full transition-colors",
1085
- "aria-label": "Go back",
1086
- children: /* @__PURE__ */ jsx(ArrowLeft, { className: "h-5 w-5" })
1087
- }), /* @__PURE__ */ jsx("h1", {
1088
- className: "text-foreground text-xl font-bold sm:text-2xl",
1089
- children: "Profile"
1090
- })]
1091
- }),
1092
- onUploadPhoto && /* @__PURE__ */ jsxs(Card, {
1093
- className: "p-4 sm:p-6",
1094
- children: [/* @__PURE__ */ jsx("input", {
1095
- ref: fileInputRef,
1096
- type: "file",
1097
- accept: "image/*",
1098
- className: "hidden",
1099
- onChange: handleFileSelected
1100
- }), /* @__PURE__ */ jsxs("div", {
1101
- className: "flex flex-col items-center gap-3 sm:flex-row sm:gap-4",
1102
- children: [/* @__PURE__ */ jsxs("div", {
1103
- className: "relative h-[120px] w-[120px] shrink-0 overflow-hidden rounded-full bg-gray-200",
1104
- children: [displayAvatarUrl ? /* @__PURE__ */ jsx("img", {
1105
- src: displayAvatarUrl,
1106
- alt: userName || "Profile",
1107
- className: "h-full w-full object-cover"
1108
- }) : /* @__PURE__ */ jsx("div", {
1109
- className: "bg-background text-foreground flex h-full w-full items-center justify-center text-xl font-semibold",
1110
- children: userInitial || "U"
1111
- }), isUploadingPhoto && /* @__PURE__ */ jsx("div", {
1112
- className: "absolute inset-0 flex items-center justify-center rounded-full bg-black/40",
1113
- children: /* @__PURE__ */ jsx("div", { className: "border-t-primary h-6 w-6 animate-spin rounded-full border-2 border-white" })
1114
- })]
1115
- }), /* @__PURE__ */ jsxs(Button, {
1116
- variant: "secondary",
1117
- size: "sm",
1118
- onClick: () => fileInputRef.current?.click(),
1119
- disabled: isUploadingPhoto,
1120
- children: [/* @__PURE__ */ jsx(Camera, { className: "mr-1 h-4 w-4" }), isUploadingPhoto ? "Uploading..." : "Change Photo"]
1121
- })]
1122
- })]
1123
- }),
1124
- /* @__PURE__ */ jsx(Card, {
1125
- className: "h-auto gap-0 py-0 shadow-none",
1126
- children: /* @__PURE__ */ jsx(CardContent, {
1127
- className: "space-y-4 p-4 sm:p-6",
1128
- children: /* @__PURE__ */ jsxs("div", {
1129
- className: "space-y-2",
1130
- children: [/* @__PURE__ */ jsx(Label, {
1131
- htmlFor: "profile-bio",
1132
- children: "Bio"
1133
- }), /* @__PURE__ */ jsx(Textarea, {
1134
- id: "profile-bio",
1135
- rows: 4,
1136
- value: formState.bio,
1137
- onChange: (e) => handleFieldChange("bio", e.target.value),
1138
- placeholder: "Tell people a little about yourself..."
1139
- })]
1140
- })
1141
- })
1142
- }),
1143
- /* @__PURE__ */ jsx("div", {
1144
- className: "flex justify-end",
1145
- children: /* @__PURE__ */ jsx(Button, {
1146
- onClick: handleSave,
1147
- disabled: !isDirty || updateProfileMutation.isPending,
1148
- className: "w-full sm:w-auto",
1149
- children: updateProfileMutation.isPending ? "Saving..." : "Save Changes"
1150
- })
1151
- })
1152
- ]
1153
- });
1154
- }
1155
- //#endregion
1156
- //#region src/screens/MySiteScreen/MySiteMainView.tsx
1157
- const navigationItems = [
1158
- {
1159
- label: "Profile",
1160
- key: "profile",
1161
- icon: User
1162
- },
1163
- {
1164
- label: "Theme",
1165
- key: "theme",
1166
- icon: Palette
1167
- },
1168
- {
1169
- label: "MySite Content",
1170
- key: "content",
1171
- icon: LayoutGrid
1172
- },
1173
- {
1174
- label: "Buttons",
1175
- key: "buttons",
1176
- icon: Link2
1177
- }
1178
- ];
1179
- function defaultToast(message, type) {
1180
- fluidToast({
1181
- title: message,
1182
- type
1183
- });
1184
- }
1185
- function MySiteMainView({ editingSection, animPhase, showEditContent, onEditSection, onBackClick }) {
1186
- const { data: profile, isLoading: isProfileLoading } = usePortalMySiteProfile();
1187
- const { data: themes = [] } = usePortalMySiteThemes();
1188
- const updateSettingsMutation = usePortalUpdateSettings();
1189
- const [previewKey, setPreviewKey] = useState(0);
1190
- const refreshPreview = useCallback(() => setPreviewKey((k) => k + 1), []);
1191
- const [selectedThemeId, setSelectedThemeId] = useState(null);
1192
- const resolvedThemeId = selectedThemeId ?? profile?.theme_id ?? themes.find((t) => t.name === "Default")?.id ?? themes[0]?.id ?? null;
1193
- const themeName = themes.find((t) => t.id === resolvedThemeId)?.name ?? "Default";
1194
- const mysiteUrl = profile?.mysite_url ?? "";
1195
- const displayUrl = mysiteUrl ? mysiteUrl.replace(/^https?:\/\//, "") : "";
1196
- const views = profile?.mysite_views ?? 0;
1197
- const leads = profile?.mysite_leads ?? 0;
1198
- const handleSelectTheme = useCallback((theme) => {
1199
- if (theme.id === resolvedThemeId) return;
1200
- const previousThemeId = selectedThemeId;
1201
- setSelectedThemeId(theme.id);
1202
- updateSettingsMutation.mutate({ theme_id: theme.id }, {
1203
- onSuccess: () => {
1204
- defaultToast(`Theme changed to "${theme.name}"`, "success");
1205
- refreshPreview();
1206
- },
1207
- onError: () => {
1208
- setSelectedThemeId(previousThemeId);
1209
- defaultToast("Failed to update theme", "error");
1210
- }
1211
- });
1212
- }, [
1213
- resolvedThemeId,
1214
- selectedThemeId,
1215
- updateSettingsMutation,
1216
- refreshPreview
1217
- ]);
1218
- const handleUpdateSlug = useCallback(async (slug) => {
1219
- await new Promise((resolve, reject) => {
1220
- updateSettingsMutation.mutate({ slug }, {
1221
- onSuccess: () => resolve(),
1222
- onError: () => reject(/* @__PURE__ */ new Error("Failed"))
1223
- });
1224
- });
1225
- }, [updateSettingsMutation]);
1226
- const handlePreview = useCallback(() => {
1227
- if (mysiteUrl) window.open(`${mysiteUrl}?preview=true`, "_blank");
1228
- }, [mysiteUrl]);
1229
- const sectionLabel = useMemo(() => {
1230
- if (editingSection === "theme") return "Theme";
1231
- if (editingSection === "buttons") return "Buttons";
1232
- if (editingSection === "content") return "MySite Content";
1233
- if (editingSection === "profile") return "Profile";
1234
- return "";
1235
- }, [editingSection]);
1236
- if (isProfileLoading) return /* @__PURE__ */ jsxs("div", {
1237
- className: "flex h-full flex-col overflow-y-auto px-2 py-6 2xl:flex-row 2xl:overflow-hidden",
1238
- children: [/* @__PURE__ */ jsx("div", {
1239
- className: "w-full px-4 2xl:w-2/3 2xl:shrink-0",
1240
- children: /* @__PURE__ */ jsxs("div", {
1241
- className: "flex flex-col gap-5",
1242
- children: [
1243
- /* @__PURE__ */ jsx("div", { className: "bg-muted h-7 w-32 animate-pulse rounded-md" }),
1244
- /* @__PURE__ */ jsx("div", { className: "bg-muted h-20 w-full animate-pulse rounded-lg" }),
1245
- /* @__PURE__ */ jsx("div", { className: "bg-muted h-16 w-full animate-pulse rounded-lg" }),
1246
- /* @__PURE__ */ jsx("div", { className: "bg-muted h-40 w-full animate-pulse rounded-lg" })
1247
- ]
1248
- })
1249
- }), /* @__PURE__ */ jsx("div", {
1250
- className: "w-full shrink-0 overflow-y-hidden px-4 pt-5 2xl:w-1/3 2xl:pt-0",
1251
- children: /* @__PURE__ */ jsxs("div", {
1252
- className: "bg-muted flex h-full flex-col items-center gap-4 rounded-xl p-5",
1253
- children: [/* @__PURE__ */ jsxs("div", {
1254
- className: "flex w-full items-center justify-between",
1255
- children: [/* @__PURE__ */ jsxs("div", {
1256
- className: "space-y-1",
1257
- children: [/* @__PURE__ */ jsx("div", { className: "bg-background/50 h-3 w-24 animate-pulse rounded" }), /* @__PURE__ */ jsx("div", { className: "bg-background/50 h-4 w-28 animate-pulse rounded" })]
1258
- }), /* @__PURE__ */ jsx("div", { className: "bg-background/50 h-8 w-20 animate-pulse rounded-md" })]
1259
- }), /* @__PURE__ */ jsx("div", { className: "bg-background/50 h-[490px] w-[260px] animate-pulse rounded-[36px] sm:h-[600px] sm:w-[320px]" })]
1260
- })
1261
- })]
1262
- });
1263
- const contentAnimClassName = getContentClassName(animPhase);
1264
- const previewAnimClassName = getPreviewClassName(animPhase);
1265
- return /* @__PURE__ */ jsxs("div", {
1266
- className: "flex h-full flex-col overflow-y-auto px-2 py-6 2xl:flex-row 2xl:overflow-hidden",
1267
- children: [/* @__PURE__ */ jsx("div", {
1268
- className: `w-full px-4 2xl:w-2/3 2xl:shrink-0 ${contentAnimClassName}`,
1269
- children: /* @__PURE__ */ jsx("div", {
1270
- className: "flex min-w-0 flex-col gap-5 2xl:h-full 2xl:overflow-y-auto",
1271
- children: showEditContent && editingSection === "theme" ? /* @__PURE__ */ jsx(MySiteThemeEditor, {
1272
- themes,
1273
- selectedThemeId: resolvedThemeId,
1274
- onSelectTheme: handleSelectTheme,
1275
- isPending: updateSettingsMutation.isPending,
1276
- onBack: onBackClick
1277
- }) : showEditContent && editingSection === "buttons" ? /* @__PURE__ */ jsx(PortalButtonsEditor, {
1278
- onBack: onBackClick,
1279
- onRefreshPreview: refreshPreview,
1280
- onToast: defaultToast
1281
- }) : showEditContent && editingSection === "content" ? /* @__PURE__ */ jsx(PortalFavoritesEditor, {
1282
- onBack: onBackClick,
1283
- onRefreshPreview: refreshPreview,
1284
- onToast: defaultToast
1285
- }) : showEditContent && editingSection === "profile" ? /* @__PURE__ */ jsx(MySiteProfileForm, {
1286
- onBack: onBackClick,
1287
- onRefreshPreview: refreshPreview,
1288
- onToast: defaultToast
1289
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
1290
- /* @__PURE__ */ jsxs("div", {
1291
- className: "flex items-center gap-2",
1292
- children: [/* @__PURE__ */ jsx("h1", {
1293
- className: "text-foreground text-xl font-bold",
1294
- children: "MySite"
1295
- }), animPhase !== "idle" && sectionLabel && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground h-4 w-4" }), /* @__PURE__ */ jsx("span", {
1296
- className: "text-foreground text-xl font-bold",
1297
- children: sectionLabel
1298
- })] })]
1299
- }),
1300
- /* @__PURE__ */ jsx(MySiteVisitorDetailsCard, {
1301
- views,
1302
- leads
1303
- }),
1304
- /* @__PURE__ */ jsx(MySiteLinkCard, {
1305
- mysiteUrl,
1306
- displayUrl,
1307
- onUpdateSlug: handleUpdateSlug,
1308
- onToast: defaultToast
1309
- }),
1310
- /* @__PURE__ */ jsx("div", {
1311
- className: "border-border bg-card divide-border divide-y overflow-hidden rounded-lg border",
1312
- children: navigationItems.map((item) => {
1313
- const Icon = item.icon;
1314
- return /* @__PURE__ */ jsxs("button", {
1315
- type: "button",
1316
- onClick: () => onEditSection(item.key),
1317
- className: "group hover:bg-muted flex w-full items-center gap-2.5 px-3 py-2.5 transition-colors text-left cursor-pointer",
1318
- children: [
1319
- /* @__PURE__ */ jsx("div", {
1320
- className: "bg-muted text-foreground flex h-7 w-7 shrink-0 items-center justify-center rounded-full",
1321
- children: /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" })
1322
- }),
1323
- /* @__PURE__ */ jsx("span", {
1324
- className: "text-foreground flex-1 text-sm font-medium",
1325
- children: item.label
1326
- }),
1327
- /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground h-3 w-3 shrink-0 transition-transform group-hover:translate-x-0.5" })
1328
- ]
1329
- }, item.label);
1330
- })
1331
- })
1332
- ] })
1333
- })
1334
- }), /* @__PURE__ */ jsx("div", {
1335
- className: `w-full shrink-0 overflow-y-hidden px-4 pt-5 2xl:w-1/3 2xl:pt-0 ${previewAnimClassName}`,
1336
- children: /* @__PURE__ */ jsx(MySitePhonePreview, {
1337
- mysiteUrl,
1338
- themeName,
1339
- previewKey,
1340
- isUpdating: updateSettingsMutation.isPending,
1341
- onPreview: handlePreview
1342
- })
1343
- })]
1344
- });
1345
- }
1346
- //#endregion
1347
- //#region src/screens/MySiteScreen/use-mysite-editing-section.ts
1348
- function useMySiteEditingSection() {
1349
- const [animPhase, setAnimPhase] = useState("idle");
1350
- const [editingSection, setEditingSection] = useState(null);
1351
- const timeoutsRef = useRef([]);
1352
- useEffect(() => {
1353
- const ref = timeoutsRef;
1354
- return () => ref.current.forEach(clearTimeout);
1355
- }, []);
1356
- const cancelScheduled = useCallback(() => {
1357
- timeoutsRef.current.forEach(clearTimeout);
1358
- timeoutsRef.current = [];
1359
- }, []);
1360
- const schedule = useCallback((phase, delay) => {
1361
- const id = setTimeout(() => setAnimPhase(phase), delay);
1362
- timeoutsRef.current.push(id);
1363
- }, []);
1364
- return {
1365
- editingSection,
1366
- animPhase,
1367
- showEditContent: [
1368
- "slide",
1369
- "fade-in",
1370
- "editing",
1371
- "exit-fade-out",
1372
- "exit-slide"
1373
- ].includes(animPhase),
1374
- handleEditSection: useCallback((section) => {
1375
- cancelScheduled();
1376
- setEditingSection(section);
1377
- setAnimPhase("fade-out");
1378
- schedule("slide", 300);
1379
- schedule("fade-in", 800);
1380
- schedule("editing", 1100);
1381
- }, [cancelScheduled, schedule]),
1382
- handleBackClick: useCallback(() => {
1383
- cancelScheduled();
1384
- setAnimPhase("exit-fade-out");
1385
- schedule("exit-slide", 300);
1386
- schedule("exit-fade-in", 800);
1387
- const id = setTimeout(() => {
1388
- setAnimPhase("idle");
1389
- setEditingSection(null);
1390
- }, 1100);
1391
- timeoutsRef.current.push(id);
1392
- }, [cancelScheduled, schedule])
1393
- };
1394
- }
1395
- //#endregion
1396
- //#region src/screens/MySiteScreen/index.tsx
1397
- var MySiteScreen_exports = /* @__PURE__ */ __exportAll({
1398
- MySiteScreen: () => MySiteScreen,
1399
- mySiteScreenPropertySchema: () => mySiteScreenPropertySchema
1400
- });
1401
- function MySiteScreen({ background, textColor, accentColor, padding, borderRadius, ...divProps }) {
1402
- const { editingSection, animPhase, showEditContent, handleEditSection, handleBackClick } = useMySiteEditingSection();
1403
- const sectionLabel = useMemo(() => {
1404
- if (editingSection === "theme") return "Theme";
1405
- if (editingSection === "buttons") return "Buttons";
1406
- if (editingSection === "content") return "MySite Content";
1407
- if (editingSection === "profile") return "Profile";
1408
- return null;
1409
- }, [editingSection]);
1410
- const handleRootCrumbClick = useCallback((e) => {
1411
- e.preventDefault();
1412
- if (editingSection !== null) handleBackClick();
1413
- }, [editingSection, handleBackClick]);
1414
- useScreenHeaderBreadcrumbs(useMemo(() => /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, {
1415
- className: "text-lg",
1416
- children: [/* @__PURE__ */ jsx(BreadcrumbItem, { children: sectionLabel ? /* @__PURE__ */ jsx(BreadcrumbLink, {
1417
- href: "#",
1418
- onClick: handleRootCrumbClick,
1419
- children: "My Site"
1420
- }) : /* @__PURE__ */ jsx(BreadcrumbPage, {
1421
- className: "font-semibold",
1422
- children: "My Site"
1423
- }) }), sectionLabel && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(BreadcrumbSeparator, {}), /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
1424
- className: "font-semibold",
1425
- children: sectionLabel
1426
- }) })] })]
1427
- }) }), [sectionLabel, handleRootCrumbClick]));
1428
- return /* @__PURE__ */ jsx("div", {
1429
- ...divProps,
1430
- className: `h-full ${divProps.className ?? ""}`,
1431
- children: /* @__PURE__ */ jsx(MySiteMainView, {
1432
- editingSection,
1433
- animPhase,
1434
- showEditContent,
1435
- onEditSection: handleEditSection,
1436
- onBackClick: handleBackClick
1437
- })
1438
- });
1439
- }
1440
- const mySiteScreenPropertySchema = {
1441
- widgetType: "MySiteScreen",
1442
- displayName: "My Site Screen",
1443
- tabsConfig: [{
1444
- id: "styling",
1445
- label: "Styling"
1446
- }],
1447
- fields: []
1448
- };
1449
- //#endregion
1450
- export { MySiteScreen_exports as n, mySiteScreenPropertySchema as r, MySiteScreen as t };
986
+ export { MySiteLinkCard as a, getPreviewClassName as c, MySitePhonePreview as i, PortalButtonsEditor as n, MySiteVisitorDetailsCard as o, MySiteThemeEditor as r, getContentClassName as s, PortalFavoritesEditor as t };
1451
987
 
1452
- //# sourceMappingURL=MySiteScreen-CN0ZDBgy.mjs.map
988
+ //# sourceMappingURL=components-CjgEvBYG.mjs.map