@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.
- package/dist/{ContactsScreen-Cx_EJtrO.mjs → ContactsScreen-C1TCBi7p.mjs} +175 -174
- package/dist/ContactsScreen-C1TCBi7p.mjs.map +1 -0
- package/dist/{ContactsScreen-DPabYFtr.cjs → ContactsScreen-DuUHlWxn.cjs} +1 -1
- package/dist/{ContactsScreen-Bufy88vw.cjs → ContactsScreen-RK8gQwUZ.cjs} +174 -173
- package/dist/ContactsScreen-RK8gQwUZ.cjs.map +1 -0
- package/dist/{MessagingScreen-CK6vqsQI.mjs → MessagingScreen-BDp1yqcC.mjs} +6 -3
- package/dist/{MessagingScreen-CK6vqsQI.mjs.map → MessagingScreen-BDp1yqcC.mjs.map} +1 -1
- package/dist/{MessagingScreen-mKNu6iHk.cjs → MessagingScreen-DVpyX0RH.cjs} +5 -2
- package/dist/{MessagingScreen-mKNu6iHk.cjs.map → MessagingScreen-DVpyX0RH.cjs.map} +1 -1
- package/dist/{MessagingScreen-DenN7Doe.cjs → MessagingScreen-DsduPj7E.cjs} +1 -1
- package/dist/{MySiteScreen-Y4dsjqFj.mjs → MySiteScreen-BsePIEvg.mjs} +141 -185
- package/dist/MySiteScreen-BsePIEvg.mjs.map +1 -0
- package/dist/{MySiteScreen-Cw7fTWT1.cjs → MySiteScreen-C_D3tfA8.cjs} +1 -1
- package/dist/{MySiteScreen-CaBd2GGy.cjs → MySiteScreen-rYmC05jG.cjs} +140 -184
- package/dist/MySiteScreen-rYmC05jG.cjs.map +1 -0
- package/dist/{OrdersScreen-CgndBekB.cjs → OrdersScreen-BFeY4w9X.cjs} +1 -1
- package/dist/{OrdersScreen-Bb0Ir9UQ.mjs → OrdersScreen-Br-KImu9.mjs} +6 -4
- package/dist/{OrdersScreen-Bb0Ir9UQ.mjs.map → OrdersScreen-Br-KImu9.mjs.map} +1 -1
- package/dist/{OrdersScreen-Ci3bLi5R.cjs → OrdersScreen-CJDd-LdN.cjs} +5 -3
- package/dist/{OrdersScreen-Ci3bLi5R.cjs.map → OrdersScreen-CJDd-LdN.cjs.map} +1 -1
- package/dist/{ProductsScreen-5aaLW_mi.mjs → ProductsScreen-CeNMvU4d.mjs} +3 -2
- package/dist/ProductsScreen-CeNMvU4d.mjs.map +1 -0
- package/dist/{ProductsScreen-uoTQR9PU.mjs → ProductsScreen-DIdRGVvA.mjs} +1 -1
- package/dist/{ProductsScreen-BA9KYBz7.cjs → ProductsScreen-fPFSKVOn.cjs} +3 -2
- package/dist/ProductsScreen-fPFSKVOn.cjs.map +1 -0
- package/dist/{ProductsScreen-CgNQv9T1.cjs → ProductsScreen-iQf4zOus.cjs} +1 -1
- package/dist/{ProfileScreen-BZA9PaER.cjs → ProfileScreen-BSWf_Rb-.cjs} +5 -3
- package/dist/{ProfileScreen-BZA9PaER.cjs.map → ProfileScreen-BSWf_Rb-.cjs.map} +1 -1
- package/dist/{ProfileScreen-0-xeqjHj.mjs → ProfileScreen-DQ7Mjq_K.mjs} +5 -3
- package/dist/{ProfileScreen-0-xeqjHj.mjs.map → ProfileScreen-DQ7Mjq_K.mjs.map} +1 -1
- package/dist/{ProfileScreen-_m0nqiDQ.cjs → ProfileScreen-Nric2qx3.cjs} +1 -1
- package/dist/{ShareablesScreen-C51d1euJ.cjs → ShareablesScreen-Bl6aT0vn.cjs} +3 -3
- package/dist/ShareablesScreen-Bl6aT0vn.cjs.map +1 -0
- package/dist/{ShareablesScreen-BdAGblEo.mjs → ShareablesScreen-CfchbhSH.mjs} +1 -1
- package/dist/{ShareablesScreen-DNWdru1i.cjs → ShareablesScreen-CtuGiQ7_.cjs} +1 -1
- package/dist/{ShareablesScreen-0iGOTfNW.mjs → ShareablesScreen-D2JbmO7a.mjs} +5 -5
- package/dist/ShareablesScreen-D2JbmO7a.mjs.map +1 -0
- package/dist/{SubscriptionsScreen-_iUOr_D1.cjs → SubscriptionsScreen-BuxFW2sw.cjs} +5 -3
- package/dist/{SubscriptionsScreen-_iUOr_D1.cjs.map → SubscriptionsScreen-BuxFW2sw.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-DzCRMlX5.cjs → SubscriptionsScreen-Bz6FVnmk.cjs} +1 -1
- package/dist/{SubscriptionsScreen-Gig1ciN_.mjs → SubscriptionsScreen-DBUELjIY.mjs} +6 -4
- package/dist/{SubscriptionsScreen-Gig1ciN_.mjs.map → SubscriptionsScreen-DBUELjIY.mjs.map} +1 -1
- package/dist/index.cjs +27 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +28 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/dist/ContactsScreen-Bufy88vw.cjs.map +0 -1
- package/dist/ContactsScreen-Cx_EJtrO.mjs.map +0 -1
- package/dist/MySiteScreen-CaBd2GGy.cjs.map +0 -1
- package/dist/MySiteScreen-Y4dsjqFj.mjs.map +0 -1
- package/dist/ProductsScreen-5aaLW_mi.mjs.map +0 -1
- package/dist/ProductsScreen-BA9KYBz7.cjs.map +0 -1
- package/dist/ShareablesScreen-0iGOTfNW.mjs.map +0 -1
- package/dist/ShareablesScreen-C51d1euJ.cjs.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-9hOWP6kD.cjs");
|
|
2
2
|
const require_src = require("./src-B0AAcRhB.cjs");
|
|
3
3
|
const require_ScreenHeaderContext = require("./ScreenHeaderContext-DA8cEfP-.cjs");
|
|
4
|
-
const require_AppNavigationContext = require("./AppNavigationContext-N5oUbgNL.cjs");
|
|
5
4
|
const require_dist$3 = require("./dist-Mf7Sx86H.cjs");
|
|
6
5
|
const require_use_mysite_portal = require("./use-mysite-portal-BkEi6LG-.cjs");
|
|
7
6
|
let react = require("react");
|
|
@@ -11,72 +10,28 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
11
10
|
let lucide_react = require("lucide-react");
|
|
12
11
|
let zod = require("zod");
|
|
13
12
|
//#region ../../mysite/ui/src/portal/components/animation-utils.ts
|
|
14
|
-
function
|
|
13
|
+
function getContentClassName(phase) {
|
|
15
14
|
switch (phase) {
|
|
16
|
-
case "idle": return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
case "fade-out": return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
transition: `opacity 300ms ease-in-out`
|
|
25
|
-
};
|
|
26
|
-
case "slide": return {
|
|
27
|
-
transform: "translateX(50%)",
|
|
28
|
-
opacity: 0,
|
|
29
|
-
transition: `transform 500ms ease-in-out`
|
|
30
|
-
};
|
|
31
|
-
case "fade-in": return {
|
|
32
|
-
transform: "translateX(50%)",
|
|
33
|
-
opacity: 1,
|
|
34
|
-
transition: `opacity 300ms ease-in-out`
|
|
35
|
-
};
|
|
36
|
-
case "editing": return {
|
|
37
|
-
transform: "translateX(50%)",
|
|
38
|
-
opacity: 1,
|
|
39
|
-
transition: "none"
|
|
40
|
-
};
|
|
41
|
-
case "exit-fade-out": return {
|
|
42
|
-
transform: "translateX(50%)",
|
|
43
|
-
opacity: 0,
|
|
44
|
-
transition: `opacity 300ms ease-in-out`
|
|
45
|
-
};
|
|
46
|
-
case "exit-slide": return {
|
|
47
|
-
transform: "translateX(0)",
|
|
48
|
-
opacity: 0,
|
|
49
|
-
transition: `transform 500ms ease-in-out`
|
|
50
|
-
};
|
|
51
|
-
case "exit-fade-in": return {
|
|
52
|
-
transform: "translateX(0)",
|
|
53
|
-
opacity: 1,
|
|
54
|
-
transition: `opacity 300ms ease-in-out`
|
|
55
|
-
};
|
|
15
|
+
case "idle": return "opacity-100 transition-none";
|
|
16
|
+
case "fade-out": return "opacity-0 transition-opacity duration-300 ease-in-out";
|
|
17
|
+
case "slide": return "opacity-0 2xl:translate-x-[50%] transition-transform duration-500 ease-in-out";
|
|
18
|
+
case "fade-in": return "opacity-100 2xl:translate-x-[50%] transition-opacity duration-300 ease-in-out";
|
|
19
|
+
case "editing": return "opacity-100 2xl:translate-x-[50%] transition-none";
|
|
20
|
+
case "exit-fade-out": return "opacity-0 2xl:translate-x-[50%] transition-opacity duration-300 ease-in-out";
|
|
21
|
+
case "exit-slide": return "opacity-0 transition-transform duration-500 ease-in-out";
|
|
22
|
+
case "exit-fade-in": return "opacity-100 transition-opacity duration-300 ease-in-out";
|
|
56
23
|
}
|
|
57
24
|
}
|
|
58
|
-
function
|
|
25
|
+
function getPreviewClassName(phase) {
|
|
59
26
|
switch (phase) {
|
|
60
27
|
case "idle":
|
|
61
28
|
case "fade-out":
|
|
62
|
-
case "exit-fade-in": return
|
|
63
|
-
|
|
64
|
-
transition: "none"
|
|
65
|
-
};
|
|
66
|
-
case "slide": return {
|
|
67
|
-
transform: "translateX(-200%)",
|
|
68
|
-
transition: `transform 500ms ease-in-out`
|
|
69
|
-
};
|
|
29
|
+
case "exit-fade-in": return "transition-none";
|
|
30
|
+
case "slide": return "2xl:-translate-x-[200%] transition-transform duration-500 ease-in-out";
|
|
70
31
|
case "fade-in":
|
|
71
32
|
case "editing":
|
|
72
|
-
case "exit-fade-out": return
|
|
73
|
-
|
|
74
|
-
transition: "none"
|
|
75
|
-
};
|
|
76
|
-
case "exit-slide": return {
|
|
77
|
-
transform: "translateX(0)",
|
|
78
|
-
transition: `transform 500ms ease-in-out`
|
|
79
|
-
};
|
|
33
|
+
case "exit-fade-out": return "2xl:-translate-x-[200%] transition-none";
|
|
34
|
+
case "exit-slide": return "transition-transform duration-500 ease-in-out";
|
|
80
35
|
}
|
|
81
36
|
}
|
|
82
37
|
//#endregion
|
|
@@ -264,7 +219,7 @@ function MySitePhonePreview({ mysiteUrl, themeName, previewKey, isUpdating, onPr
|
|
|
264
219
|
className: "text-foreground text-sm font-semibold",
|
|
265
220
|
children: themeName
|
|
266
221
|
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
|
|
267
|
-
className: "col-start-2 row-span-2 row-start-1 self-center justify-self-end",
|
|
222
|
+
className: "col-start-2 row-span-2 row-start-1 cursor-pointer self-center justify-self-end",
|
|
268
223
|
variant: "secondary",
|
|
269
224
|
size: "sm",
|
|
270
225
|
onClick: onPreview,
|
|
@@ -1158,43 +1113,36 @@ function MySiteProfileForm({ onBack, onToast, onUploadPhoto, avatarUrl, userName
|
|
|
1158
1113
|
})]
|
|
1159
1114
|
})]
|
|
1160
1115
|
}),
|
|
1161
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1162
|
-
className: "
|
|
1163
|
-
children:
|
|
1164
|
-
className: "
|
|
1165
|
-
children: "
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
})
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
children: "About you"
|
|
1190
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Textarea, {
|
|
1191
|
-
id: "profile-bio",
|
|
1192
|
-
rows: 4,
|
|
1193
|
-
value: formState.bio,
|
|
1194
|
-
onChange: (e) => handleFieldChange("bio", e.target.value),
|
|
1195
|
-
placeholder: "Tell people a little about yourself..."
|
|
1116
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Card, {
|
|
1117
|
+
className: "h-auto gap-0 py-0 shadow-none",
|
|
1118
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.CardContent, {
|
|
1119
|
+
className: "space-y-4 p-4 sm:p-6",
|
|
1120
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1121
|
+
className: "space-y-2",
|
|
1122
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
|
|
1123
|
+
htmlFor: "profile-display-name",
|
|
1124
|
+
children: "Display Name"
|
|
1125
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Input, {
|
|
1126
|
+
id: "profile-display-name",
|
|
1127
|
+
type: "text",
|
|
1128
|
+
value: formState.display_name,
|
|
1129
|
+
onChange: (e) => handleFieldChange("display_name", e.target.value),
|
|
1130
|
+
placeholder: "Your display name"
|
|
1131
|
+
})]
|
|
1132
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1133
|
+
className: "space-y-2",
|
|
1134
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Label, {
|
|
1135
|
+
htmlFor: "profile-bio",
|
|
1136
|
+
children: "Bio"
|
|
1137
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Textarea, {
|
|
1138
|
+
id: "profile-bio",
|
|
1139
|
+
rows: 4,
|
|
1140
|
+
value: formState.bio,
|
|
1141
|
+
onChange: (e) => handleFieldChange("bio", e.target.value),
|
|
1142
|
+
placeholder: "Tell people a little about yourself..."
|
|
1143
|
+
})]
|
|
1196
1144
|
})]
|
|
1197
|
-
})
|
|
1145
|
+
})
|
|
1198
1146
|
}),
|
|
1199
1147
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1200
1148
|
className: "flex justify-end",
|
|
@@ -1213,7 +1161,7 @@ function MySiteProfileForm({ onBack, onToast, onUploadPhoto, avatarUrl, userName
|
|
|
1213
1161
|
const navigationItems = [
|
|
1214
1162
|
{
|
|
1215
1163
|
label: "Profile",
|
|
1216
|
-
|
|
1164
|
+
key: "profile",
|
|
1217
1165
|
icon: lucide_react.User
|
|
1218
1166
|
},
|
|
1219
1167
|
{
|
|
@@ -1232,34 +1180,13 @@ const navigationItems = [
|
|
|
1232
1180
|
icon: lucide_react.Link2
|
|
1233
1181
|
}
|
|
1234
1182
|
];
|
|
1235
|
-
function defaultToast
|
|
1236
|
-
|
|
1237
|
-
|
|
1183
|
+
function defaultToast(message, type) {
|
|
1184
|
+
require_src.fluidToast({
|
|
1185
|
+
title: message,
|
|
1186
|
+
type
|
|
1187
|
+
});
|
|
1238
1188
|
}
|
|
1239
|
-
function MySiteMainView() {
|
|
1240
|
-
const { navigate } = require_AppNavigationContext.useAppNavigation();
|
|
1241
|
-
const [animPhase, setAnimPhase] = (0, react.useState)("idle");
|
|
1242
|
-
const [editingSection, setEditingSection] = (0, react.useState)(null);
|
|
1243
|
-
const timeoutsRef = (0, react.useRef)([]);
|
|
1244
|
-
(0, react.useEffect)(() => {
|
|
1245
|
-
const ref = timeoutsRef;
|
|
1246
|
-
return () => ref.current.forEach(clearTimeout);
|
|
1247
|
-
}, []);
|
|
1248
|
-
const cancelScheduled = (0, react.useCallback)(() => {
|
|
1249
|
-
timeoutsRef.current.forEach(clearTimeout);
|
|
1250
|
-
timeoutsRef.current = [];
|
|
1251
|
-
}, []);
|
|
1252
|
-
const schedule = (0, react.useCallback)((phase, delay) => {
|
|
1253
|
-
const id = setTimeout(() => setAnimPhase(phase), delay);
|
|
1254
|
-
timeoutsRef.current.push(id);
|
|
1255
|
-
}, []);
|
|
1256
|
-
const showEditContent = [
|
|
1257
|
-
"slide",
|
|
1258
|
-
"fade-in",
|
|
1259
|
-
"editing",
|
|
1260
|
-
"exit-fade-out",
|
|
1261
|
-
"exit-slide"
|
|
1262
|
-
].includes(animPhase);
|
|
1189
|
+
function MySiteMainView({ editingSection, animPhase, showEditContent, onEditSection, onBackClick }) {
|
|
1263
1190
|
const { data: profile, isLoading: isProfileLoading } = require_use_mysite_portal.usePortalMySiteProfile();
|
|
1264
1191
|
const { data: themes = [] } = require_use_mysite_portal.usePortalMySiteThemes();
|
|
1265
1192
|
const updateSettingsMutation = require_use_mysite_portal.usePortalUpdateSettings();
|
|
@@ -1278,12 +1205,12 @@ function MySiteMainView() {
|
|
|
1278
1205
|
setSelectedThemeId(theme.id);
|
|
1279
1206
|
updateSettingsMutation.mutate({ theme_id: theme.id }, {
|
|
1280
1207
|
onSuccess: () => {
|
|
1281
|
-
defaultToast
|
|
1208
|
+
defaultToast(`Theme changed to "${theme.name}"`, "success");
|
|
1282
1209
|
refreshPreview();
|
|
1283
1210
|
},
|
|
1284
1211
|
onError: () => {
|
|
1285
1212
|
setSelectedThemeId(previousThemeId);
|
|
1286
|
-
defaultToast
|
|
1213
|
+
defaultToast("Failed to update theme", "error");
|
|
1287
1214
|
}
|
|
1288
1215
|
});
|
|
1289
1216
|
}, [
|
|
@@ -1300,25 +1227,6 @@ function MySiteMainView() {
|
|
|
1300
1227
|
});
|
|
1301
1228
|
});
|
|
1302
1229
|
}, [updateSettingsMutation]);
|
|
1303
|
-
const handleEditSection = (0, react.useCallback)((section) => {
|
|
1304
|
-
cancelScheduled();
|
|
1305
|
-
setEditingSection(section);
|
|
1306
|
-
setAnimPhase("fade-out");
|
|
1307
|
-
schedule("slide", 300);
|
|
1308
|
-
schedule("fade-in", 800);
|
|
1309
|
-
schedule("editing", 1100);
|
|
1310
|
-
}, [cancelScheduled, schedule]);
|
|
1311
|
-
const handleBackClick = (0, react.useCallback)(() => {
|
|
1312
|
-
cancelScheduled();
|
|
1313
|
-
setAnimPhase("exit-fade-out");
|
|
1314
|
-
schedule("exit-slide", 300);
|
|
1315
|
-
schedule("exit-fade-in", 800);
|
|
1316
|
-
const id = setTimeout(() => {
|
|
1317
|
-
setAnimPhase("idle");
|
|
1318
|
-
setEditingSection(null);
|
|
1319
|
-
}, 1100);
|
|
1320
|
-
timeoutsRef.current.push(id);
|
|
1321
|
-
}, [cancelScheduled, schedule]);
|
|
1322
1230
|
const handlePreview = (0, react.useCallback)(() => {
|
|
1323
1231
|
if (mysiteUrl) window.open(`${mysiteUrl}?preview=true`, "_blank");
|
|
1324
1232
|
}, [mysiteUrl]);
|
|
@@ -1326,6 +1234,7 @@ function MySiteMainView() {
|
|
|
1326
1234
|
if (editingSection === "theme") return "Theme";
|
|
1327
1235
|
if (editingSection === "buttons") return "Buttons";
|
|
1328
1236
|
if (editingSection === "content") return "MySite Content";
|
|
1237
|
+
if (editingSection === "profile") return "Profile";
|
|
1329
1238
|
return "";
|
|
1330
1239
|
}, [editingSection]);
|
|
1331
1240
|
if (isProfileLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1355,13 +1264,12 @@ function MySiteMainView() {
|
|
|
1355
1264
|
})
|
|
1356
1265
|
})]
|
|
1357
1266
|
});
|
|
1358
|
-
const
|
|
1359
|
-
const
|
|
1267
|
+
const contentAnimClassName = getContentClassName(animPhase);
|
|
1268
|
+
const previewAnimClassName = getPreviewClassName(animPhase);
|
|
1360
1269
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1361
1270
|
className: "flex h-full overflow-hidden px-2 py-6",
|
|
1362
1271
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1363
|
-
className:
|
|
1364
|
-
style: contentStyle,
|
|
1272
|
+
className: `w-full px-4 2xl:w-2/3 2xl:shrink-0 ${contentAnimClassName}`,
|
|
1365
1273
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1366
1274
|
className: "flex h-full min-w-0 flex-col gap-5 overflow-y-auto",
|
|
1367
1275
|
children: showEditContent && editingSection === "theme" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MySiteThemeEditor, {
|
|
@@ -1369,15 +1277,18 @@ function MySiteMainView() {
|
|
|
1369
1277
|
selectedThemeId: resolvedThemeId,
|
|
1370
1278
|
onSelectTheme: handleSelectTheme,
|
|
1371
1279
|
isPending: updateSettingsMutation.isPending,
|
|
1372
|
-
onBack:
|
|
1280
|
+
onBack: onBackClick
|
|
1373
1281
|
}) : showEditContent && editingSection === "buttons" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortalButtonsEditor, {
|
|
1374
|
-
onBack:
|
|
1282
|
+
onBack: onBackClick,
|
|
1375
1283
|
onRefreshPreview: refreshPreview,
|
|
1376
|
-
onToast: defaultToast
|
|
1284
|
+
onToast: defaultToast
|
|
1377
1285
|
}) : showEditContent && editingSection === "content" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortalFavoritesEditor, {
|
|
1378
|
-
onBack:
|
|
1286
|
+
onBack: onBackClick,
|
|
1379
1287
|
onRefreshPreview: refreshPreview,
|
|
1380
|
-
onToast: defaultToast
|
|
1288
|
+
onToast: defaultToast
|
|
1289
|
+
}) : showEditContent && editingSection === "profile" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MySiteProfileForm, {
|
|
1290
|
+
onBack: onBackClick,
|
|
1291
|
+
onToast: defaultToast
|
|
1381
1292
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
1382
1293
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1383
1294
|
className: "flex items-center gap-2",
|
|
@@ -1397,7 +1308,7 @@ function MySiteMainView() {
|
|
|
1397
1308
|
mysiteUrl,
|
|
1398
1309
|
displayUrl,
|
|
1399
1310
|
onUpdateSlug: handleUpdateSlug,
|
|
1400
|
-
onToast: defaultToast
|
|
1311
|
+
onToast: defaultToast
|
|
1401
1312
|
}),
|
|
1402
1313
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1403
1314
|
className: "border-border bg-card divide-border divide-y overflow-hidden rounded-lg border",
|
|
@@ -1405,10 +1316,7 @@ function MySiteMainView() {
|
|
|
1405
1316
|
const Icon = item.icon;
|
|
1406
1317
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1407
1318
|
type: "button",
|
|
1408
|
-
onClick: () =>
|
|
1409
|
-
if ("key" in item) handleEditSection(item.key);
|
|
1410
|
-
else navigate(item.slug);
|
|
1411
|
-
},
|
|
1319
|
+
onClick: () => onEditSection(item.key),
|
|
1412
1320
|
className: "group hover:bg-muted flex w-full items-center gap-2.5 px-3 py-2.5 transition-colors text-left cursor-pointer",
|
|
1413
1321
|
children: [
|
|
1414
1322
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -1427,8 +1335,7 @@ function MySiteMainView() {
|
|
|
1427
1335
|
] })
|
|
1428
1336
|
})
|
|
1429
1337
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1430
|
-
className:
|
|
1431
|
-
style: previewStyle,
|
|
1338
|
+
className: `hidden w-1/3 shrink-0 overflow-y-hidden px-4 2xl:block ${previewAnimClassName}`,
|
|
1432
1339
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MySitePhonePreview, {
|
|
1433
1340
|
mysiteUrl,
|
|
1434
1341
|
themeName,
|
|
@@ -1440,44 +1347,93 @@ function MySiteMainView() {
|
|
|
1440
1347
|
});
|
|
1441
1348
|
}
|
|
1442
1349
|
//#endregion
|
|
1443
|
-
//#region src/screens/MySiteScreen/
|
|
1444
|
-
function
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1350
|
+
//#region src/screens/MySiteScreen/use-mysite-editing-section.ts
|
|
1351
|
+
function useMySiteEditingSection() {
|
|
1352
|
+
const [animPhase, setAnimPhase] = (0, react.useState)("idle");
|
|
1353
|
+
const [editingSection, setEditingSection] = (0, react.useState)(null);
|
|
1354
|
+
const timeoutsRef = (0, react.useRef)([]);
|
|
1355
|
+
(0, react.useEffect)(() => {
|
|
1356
|
+
const ref = timeoutsRef;
|
|
1357
|
+
return () => ref.current.forEach(clearTimeout);
|
|
1358
|
+
}, []);
|
|
1359
|
+
const cancelScheduled = (0, react.useCallback)(() => {
|
|
1360
|
+
timeoutsRef.current.forEach(clearTimeout);
|
|
1361
|
+
timeoutsRef.current = [];
|
|
1362
|
+
}, []);
|
|
1363
|
+
const schedule = (0, react.useCallback)((phase, delay) => {
|
|
1364
|
+
const id = setTimeout(() => setAnimPhase(phase), delay);
|
|
1365
|
+
timeoutsRef.current.push(id);
|
|
1366
|
+
}, []);
|
|
1367
|
+
return {
|
|
1368
|
+
editingSection,
|
|
1369
|
+
animPhase,
|
|
1370
|
+
showEditContent: [
|
|
1371
|
+
"slide",
|
|
1372
|
+
"fade-in",
|
|
1373
|
+
"editing",
|
|
1374
|
+
"exit-fade-out",
|
|
1375
|
+
"exit-slide"
|
|
1376
|
+
].includes(animPhase),
|
|
1377
|
+
handleEditSection: (0, react.useCallback)((section) => {
|
|
1378
|
+
cancelScheduled();
|
|
1379
|
+
setEditingSection(section);
|
|
1380
|
+
setAnimPhase("fade-out");
|
|
1381
|
+
schedule("slide", 300);
|
|
1382
|
+
schedule("fade-in", 800);
|
|
1383
|
+
schedule("editing", 1100);
|
|
1384
|
+
}, [cancelScheduled, schedule]),
|
|
1385
|
+
handleBackClick: (0, react.useCallback)(() => {
|
|
1386
|
+
cancelScheduled();
|
|
1387
|
+
setAnimPhase("exit-fade-out");
|
|
1388
|
+
schedule("exit-slide", 300);
|
|
1389
|
+
schedule("exit-fade-in", 800);
|
|
1390
|
+
const id = setTimeout(() => {
|
|
1391
|
+
setAnimPhase("idle");
|
|
1392
|
+
setEditingSection(null);
|
|
1393
|
+
}, 1100);
|
|
1394
|
+
timeoutsRef.current.push(id);
|
|
1395
|
+
}, [cancelScheduled, schedule])
|
|
1396
|
+
};
|
|
1454
1397
|
}
|
|
1455
1398
|
//#endregion
|
|
1456
1399
|
//#region src/screens/MySiteScreen/index.tsx
|
|
1457
1400
|
function MySiteScreen({ background, textColor, accentColor, padding, borderRadius, ...divProps }) {
|
|
1458
|
-
const {
|
|
1459
|
-
const
|
|
1401
|
+
const { editingSection, animPhase, showEditContent, handleEditSection, handleBackClick } = useMySiteEditingSection();
|
|
1402
|
+
const sectionLabel = (0, react.useMemo)(() => {
|
|
1403
|
+
if (editingSection === "theme") return "Theme";
|
|
1404
|
+
if (editingSection === "buttons") return "Buttons";
|
|
1405
|
+
if (editingSection === "content") return "MySite Content";
|
|
1406
|
+
if (editingSection === "profile") return "Profile";
|
|
1407
|
+
return null;
|
|
1408
|
+
}, [editingSection]);
|
|
1409
|
+
const handleRootCrumbClick = (0, react.useCallback)((e) => {
|
|
1410
|
+
e.preventDefault();
|
|
1411
|
+
if (editingSection !== null) handleBackClick();
|
|
1412
|
+
}, [editingSection, handleBackClick]);
|
|
1460
1413
|
require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Breadcrumb, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.BreadcrumbList, {
|
|
1461
1414
|
className: "text-lg",
|
|
1462
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children:
|
|
1415
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: sectionLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbLink, {
|
|
1463
1416
|
href: "#",
|
|
1464
|
-
onClick:
|
|
1465
|
-
e.preventDefault();
|
|
1466
|
-
navigate("my-site");
|
|
1467
|
-
},
|
|
1417
|
+
onClick: handleRootCrumbClick,
|
|
1468
1418
|
children: "My Site"
|
|
1469
1419
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
|
|
1470
1420
|
className: "font-semibold",
|
|
1471
1421
|
children: "My Site"
|
|
1472
|
-
}) }),
|
|
1422
|
+
}) }), sectionLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbSeparator, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.BreadcrumbPage, {
|
|
1473
1423
|
className: "font-semibold",
|
|
1474
|
-
children:
|
|
1424
|
+
children: sectionLabel
|
|
1475
1425
|
}) })] })]
|
|
1476
|
-
}) }), [
|
|
1426
|
+
}) }), [sectionLabel, handleRootCrumbClick]));
|
|
1477
1427
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1478
1428
|
...divProps,
|
|
1479
1429
|
className: `h-full ${divProps.className ?? ""}`,
|
|
1480
|
-
children:
|
|
1430
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MySiteMainView, {
|
|
1431
|
+
editingSection,
|
|
1432
|
+
animPhase,
|
|
1433
|
+
showEditContent,
|
|
1434
|
+
onEditSection: handleEditSection,
|
|
1435
|
+
onBackClick: handleBackClick
|
|
1436
|
+
})
|
|
1481
1437
|
});
|
|
1482
1438
|
}
|
|
1483
1439
|
const mySiteScreenPropertySchema = {
|
|
@@ -1503,4 +1459,4 @@ Object.defineProperty(exports, "mySiteScreenPropertySchema", {
|
|
|
1503
1459
|
}
|
|
1504
1460
|
});
|
|
1505
1461
|
|
|
1506
|
-
//# sourceMappingURL=MySiteScreen-
|
|
1462
|
+
//# sourceMappingURL=MySiteScreen-rYmC05jG.cjs.map
|