@fluid-app/portal-sdk 0.1.637 → 0.1.639
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/{ShareablesScreen-CkRRPhG0.cjs → ShareablesScreen-D4PJT2iu.cjs} +1 -1
- package/dist/{ShareablesScreen-BBykHf1K.cjs → ShareablesScreen-DUkC1Gu8.cjs} +199 -166
- package/dist/{ShareablesScreen-BBykHf1K.cjs.map → ShareablesScreen-DUkC1Gu8.cjs.map} +1 -1
- package/dist/{ShareablesScreen-C5vqkkaM.mjs → ShareablesScreen-tozMkBD-.mjs} +1 -1
- package/dist/{ShareablesScreen-BwIl6E-f.mjs → ShareablesScreen-wKo6gZPp.mjs} +198 -165
- package/dist/ShareablesScreen-wKo6gZPp.mjs.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +21 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +21 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/ShareablesScreen-BwIl6E-f.mjs.map +0 -1
|
@@ -7,7 +7,7 @@ require("./MobileBottomSheet-BnYPI2l1.cjs");
|
|
|
7
7
|
require("./static-dict-adapter-BCgoKiVT.cjs");
|
|
8
8
|
require("./SearchSort-Dpk27tPM.cjs");
|
|
9
9
|
require("./use-share-link-CwfwFW1s.cjs");
|
|
10
|
-
const require_ShareablesScreen = require("./ShareablesScreen-
|
|
10
|
+
const require_ShareablesScreen = require("./ShareablesScreen-DUkC1Gu8.cjs");
|
|
11
11
|
require("./translation-api-context-factory-mbsJk2UU.cjs");
|
|
12
12
|
require("./src-B7NUvt4E.cjs");
|
|
13
13
|
require("./MobileActionSheet-BOE8d_Lr.cjs");
|
|
@@ -250601,6 +250601,30 @@ const PAGE_SIZE$6 = 20;
|
|
|
250601
250601
|
* created was missing from the picker on reopen.
|
|
250602
250602
|
*/
|
|
250603
250603
|
const PICKER_PLAYLISTS_KEY = ["add-to-playlist", "playlists"];
|
|
250604
|
+
/**
|
|
250605
|
+
* The member's own playlists, as the picker lists them. Declared once so a
|
|
250606
|
+
* host can run the same query ahead of the dialog (to learn whether playlists
|
|
250607
|
+
* are served at all) and leave its result in the cache for the dialog to use.
|
|
250608
|
+
*/
|
|
250609
|
+
function playlistPickerQuery(api, search) {
|
|
250610
|
+
return {
|
|
250611
|
+
queryKey: [...PICKER_PLAYLISTS_KEY, search],
|
|
250612
|
+
queryFn: async ({ pageParam }) => {
|
|
250613
|
+
const response = await api.playlists.getPlaylists({
|
|
250614
|
+
"filter[title]": search || void 0,
|
|
250615
|
+
"filter[ownership]": "mine",
|
|
250616
|
+
"page[cursor]": pageParam,
|
|
250617
|
+
"page[limit]": PAGE_SIZE$6
|
|
250618
|
+
});
|
|
250619
|
+
return {
|
|
250620
|
+
playlists: response.playlists,
|
|
250621
|
+
nextCursor: response.meta.pagination.next_cursor
|
|
250622
|
+
};
|
|
250623
|
+
},
|
|
250624
|
+
getNextPageParam: (lastPage) => lastPage.nextCursor ?? void 0,
|
|
250625
|
+
initialPageParam: void 0
|
|
250626
|
+
};
|
|
250627
|
+
}
|
|
250604
250628
|
function AddToPlaylistDialog({ open, onOpenChange, contentId, contentType, mode, resumePlaylistId = null, onPlaylistCreated, onAdded, restoreFocusTo }) {
|
|
250605
250629
|
const api = require_use_share_link.useShareablesApi();
|
|
250606
250630
|
const isMobile = require_MobileBottomSheet.useIsMobile();
|
|
@@ -250635,23 +250659,9 @@ function AddToPlaylistDialog({ open, onOpenChange, contentId, contentType, mode,
|
|
|
250635
250659
|
return () => clearTimeout(timer);
|
|
250636
250660
|
}, [search]);
|
|
250637
250661
|
const { data, hasNextPage, isFetchingNextPage, fetchNextPage, error, isPending, isFetching, refetch } = (0, _tanstack_react_query.useInfiniteQuery)({
|
|
250638
|
-
|
|
250662
|
+
...playlistPickerQuery(api, debouncedSearch),
|
|
250639
250663
|
enabled: open && effectiveMode === "pick",
|
|
250640
|
-
placeholderData: _tanstack_react_query.keepPreviousData
|
|
250641
|
-
queryFn: async ({ pageParam }) => {
|
|
250642
|
-
const response = await api.playlists.getPlaylists({
|
|
250643
|
-
"filter[title]": debouncedSearch || void 0,
|
|
250644
|
-
"filter[ownership]": "mine",
|
|
250645
|
-
"page[cursor]": pageParam,
|
|
250646
|
-
"page[limit]": PAGE_SIZE$6
|
|
250647
|
-
});
|
|
250648
|
-
return {
|
|
250649
|
-
playlists: response.playlists,
|
|
250650
|
-
nextCursor: response.meta.pagination.next_cursor
|
|
250651
|
-
};
|
|
250652
|
-
},
|
|
250653
|
-
getNextPageParam: (lastPage) => lastPage.nextCursor ?? void 0,
|
|
250654
|
-
initialPageParam: void 0
|
|
250664
|
+
placeholderData: _tanstack_react_query.keepPreviousData
|
|
250655
250665
|
});
|
|
250656
250666
|
const playlists = data?.pages.flatMap((page) => page.playlists) ?? [];
|
|
250657
250667
|
const refusalAnnouncement = !lastRefusal ? "" : lastRefusal.title ? t("playlist_item_already_exists_named", { title: lastRefusal.title }) : t("playlist_item_already_exists");
|
|
@@ -255937,14 +255947,15 @@ const FilePicker = ({ config: configInput = {}, onFilesSelected, onClose, open,
|
|
|
255937
255947
|
return result.success ? result.data : filePickerConfigSchema.parse({});
|
|
255938
255948
|
}, [configInput]);
|
|
255939
255949
|
const defaultTab = defaultMethod ?? "dam";
|
|
255940
|
-
const
|
|
255950
|
+
const startMethod = (() => {
|
|
255941
255951
|
if (config.allowedMethods && config.allowedMethods.length > 0) {
|
|
255942
255952
|
const allowed = config.allowedMethods;
|
|
255943
255953
|
if (allowed.includes(defaultTab)) return defaultTab;
|
|
255944
255954
|
return allowed[0] ?? "dam";
|
|
255945
255955
|
}
|
|
255946
255956
|
return defaultTab;
|
|
255947
|
-
});
|
|
255957
|
+
})();
|
|
255958
|
+
const [activeMethod, setActiveMethod] = (0, react.useState)(startMethod);
|
|
255948
255959
|
(0, react.useEffect)(() => {
|
|
255949
255960
|
if (config.allowedMethods && config.allowedMethods.length > 0 && !config.allowedMethods.includes(activeMethod)) setActiveMethod(config.allowedMethods[0] ?? "dam");
|
|
255950
255961
|
}, [config.allowedMethods, activeMethod]);
|
|
@@ -255981,7 +255992,7 @@ const FilePicker = ({ config: configInput = {}, onFilesSelected, onClose, open,
|
|
|
255981
255992
|
const [viewMode, setViewMode] = (0, react.useState)("grid");
|
|
255982
255993
|
const [showNamesOnMedia, setShowNamesOnMedia] = (0, react.useState)(true);
|
|
255983
255994
|
const resetPicker = (0, react.useCallback)(() => {
|
|
255984
|
-
setActiveMethod(
|
|
255995
|
+
setActiveMethod(startMethod);
|
|
255985
255996
|
setSelectedResults([]);
|
|
255986
255997
|
setDamSelectionCount(0);
|
|
255987
255998
|
setDamSelectedFiles([]);
|
|
@@ -256008,7 +256019,7 @@ const FilePicker = ({ config: configInput = {}, onFilesSelected, onClose, open,
|
|
|
256008
256019
|
setSortOption(void 0);
|
|
256009
256020
|
damLibraryRef.current?.clearSelection?.();
|
|
256010
256021
|
setPreviewAsset(null);
|
|
256011
|
-
}, [
|
|
256022
|
+
}, [startMethod]);
|
|
256012
256023
|
const handleMethodChange = (0, react.useCallback)((newMethod) => {
|
|
256013
256024
|
if (!config.unifiedSelection) {
|
|
256014
256025
|
setSelectedResults([]);
|
|
@@ -260169,6 +260180,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
260169
260180
|
locale
|
|
260170
260181
|
]);
|
|
260171
260182
|
const pickerAvailable = !!filePickerApi && !!filePickerContextValue;
|
|
260183
|
+
const taggedCanAdd = SECTIONS.tagged.allowedMethods.some((method) => method === "media" || pickerSources?.[method] != null);
|
|
260172
260184
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
260173
260185
|
className: "space-y-8",
|
|
260174
260186
|
children: [
|
|
@@ -260182,7 +260194,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
260182
260194
|
isDeletePending: removeItemMutation.isPending,
|
|
260183
260195
|
disableAdd: !pickerAvailable
|
|
260184
260196
|
}),
|
|
260185
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlaylistItemsSubsection, {
|
|
260197
|
+
(!pickerAvailable || taggedCanAdd || taggedItems.length > 0) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlaylistItemsSubsection, {
|
|
260186
260198
|
section: SECTIONS.tagged,
|
|
260187
260199
|
items: taggedItems,
|
|
260188
260200
|
onAdd: () => setOpenSection("tagged"),
|
|
@@ -260190,7 +260202,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
260190
260202
|
onDeleteItem: handleDeleteItem,
|
|
260191
260203
|
isPending: addItemMutation.isPending,
|
|
260192
260204
|
isDeletePending: removeItemMutation.isPending,
|
|
260193
|
-
disableAdd: !pickerAvailable
|
|
260205
|
+
disableAdd: !pickerAvailable || !taggedCanAdd
|
|
260194
260206
|
}),
|
|
260195
260207
|
pickerAvailable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilePickerApiProvider, {
|
|
260196
260208
|
api: filePickerApi,
|
|
@@ -261064,15 +261076,30 @@ function getSourceProductIdForMediaDetail(currentRoute, parentSlug) {
|
|
|
261064
261076
|
}
|
|
261065
261077
|
//#endregion
|
|
261066
261078
|
//#region src/screens/ShareablesScreen.tsx
|
|
261067
|
-
|
|
261079
|
+
/** Keeps only the sources a host allows; no allowlist keeps them all. */
|
|
261080
|
+
function pickSources(sources, keys) {
|
|
261081
|
+
if (!keys) return sources;
|
|
261082
|
+
const picked = {};
|
|
261083
|
+
for (const key of keys) {
|
|
261084
|
+
const source = sources[key];
|
|
261085
|
+
if (source) Object.assign(picked, { [key]: source });
|
|
261086
|
+
}
|
|
261087
|
+
return picked;
|
|
261088
|
+
}
|
|
261089
|
+
function ShareablesScreen({ background, textColor, accentColor, padding, borderRadius, showProductSharablesCarousel = false, readOnly, canCuratePlaylists, pickerSourceKeys, ...divProps }) {
|
|
261068
261090
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
261069
261091
|
...divProps,
|
|
261070
261092
|
className: `h-full ${divProps.className ?? ""}`,
|
|
261071
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareablesTranslationBridge, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_prop_types.PortalContentApiProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareablesScreenContent, {
|
|
261093
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareablesTranslationBridge, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_prop_types.PortalContentApiProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareablesScreenContent, {
|
|
261094
|
+
showProductSharablesCarousel,
|
|
261095
|
+
readOnly,
|
|
261096
|
+
canCuratePlaylists,
|
|
261097
|
+
pickerSourceKeys
|
|
261098
|
+
}) }) })
|
|
261072
261099
|
});
|
|
261073
261100
|
}
|
|
261074
261101
|
/** Inner component rendered inside providers so hooks can access context. */
|
|
261075
|
-
function ShareablesScreenContent({ showProductSharablesCarousel }) {
|
|
261102
|
+
function ShareablesScreenContent({ showProductSharablesCarousel, readOnly, canCuratePlaylists, pickerSourceKeys }) {
|
|
261076
261103
|
const { t, locale } = useShareablesTranslation();
|
|
261077
261104
|
const tRef = (0, react.useRef)(t);
|
|
261078
261105
|
tRef.current = t;
|
|
@@ -261085,7 +261112,7 @@ function ShareablesScreenContent({ showProductSharablesCarousel }) {
|
|
|
261085
261112
|
const { data: store } = require_use_store.useStore();
|
|
261086
261113
|
const { currentSlug, navigate } = require_AppNavigationContext.useAppNavigation();
|
|
261087
261114
|
const parentBreadcrumb = require_use_navigation_parent.useNavigationParent();
|
|
261088
|
-
const isCustomer = require_member_permissions.deniesRepSurfaces(account);
|
|
261115
|
+
const isCustomer = readOnly ?? require_member_permissions.deniesRepSurfaces(account);
|
|
261089
261116
|
const client = require_prop_types.usePortalTenantContentClient();
|
|
261090
261117
|
const queryClient = (0, _tanstack_react_query.useQueryClient)();
|
|
261091
261118
|
const fetchProducts = (0, react.useCallback)(async (search, cursor, limit, sort) => {
|
|
@@ -261126,156 +261153,162 @@ function ShareablesScreenContent({ showProductSharablesCarousel }) {
|
|
|
261126
261153
|
detailId,
|
|
261127
261154
|
screen
|
|
261128
261155
|
]);
|
|
261129
|
-
|
|
261130
|
-
|
|
261131
|
-
|
|
261132
|
-
|
|
261133
|
-
|
|
261134
|
-
|
|
261135
|
-
|
|
261136
|
-
|
|
261137
|
-
|
|
261138
|
-
|
|
261139
|
-
|
|
261140
|
-
|
|
261141
|
-
|
|
261142
|
-
|
|
261143
|
-
|
|
261144
|
-
|
|
261145
|
-
|
|
261146
|
-
|
|
261147
|
-
|
|
261148
|
-
|
|
261149
|
-
|
|
261156
|
+
const coreConfig = (0, react.useMemo)(() => ({
|
|
261157
|
+
user: account ? { id: account.id } : null,
|
|
261158
|
+
repContext: true
|
|
261159
|
+
}), [account]);
|
|
261160
|
+
const uiConfig = (0, react.useMemo)(() => ({
|
|
261161
|
+
user: account ? {
|
|
261162
|
+
id: account.id,
|
|
261163
|
+
company: { logo_url: store?.logo_url ?? null }
|
|
261164
|
+
} : void 0,
|
|
261165
|
+
affiliateId: null,
|
|
261166
|
+
basePath: "",
|
|
261167
|
+
navigate: (path) => {
|
|
261168
|
+
const cleanPath = path.replace(/^\//, "");
|
|
261169
|
+
navigate(cleanPath.startsWith("share/") ? cleanPath : `share/${cleanPath}`);
|
|
261170
|
+
},
|
|
261171
|
+
showToast: (opts) => {
|
|
261172
|
+
require_src.fluidToast({
|
|
261173
|
+
title: opts.title,
|
|
261174
|
+
type: opts.type
|
|
261175
|
+
});
|
|
261176
|
+
if (opts.error) console.error("[Shareables]", opts.error);
|
|
261177
|
+
},
|
|
261178
|
+
filePickerApi,
|
|
261179
|
+
onToggleFavorite: async (params) => {
|
|
261180
|
+
const result = await require_prop_types.toggleFavorite(client, params.favoriteableId, params.favoriteableType);
|
|
261181
|
+
queryClient.invalidateQueries({ queryKey: require_use_mysite_portal.PORTAL_MYSITE_KEYS.favorites() });
|
|
261182
|
+
return result;
|
|
261183
|
+
},
|
|
261184
|
+
onMySiteShare: async (params) => {
|
|
261185
|
+
await require_prop_types.toggleFavorite(client, params.relateable_id, params.relateable_type);
|
|
261186
|
+
queryClient.invalidateQueries({ queryKey: require_use_mysite_portal.PORTAL_MYSITE_KEYS.favorites() });
|
|
261187
|
+
},
|
|
261188
|
+
onDeletePlaylist: async (playlistId) => {
|
|
261189
|
+
await shareablesCtx.playlistsAdapter.deletePlaylist(playlistId);
|
|
261190
|
+
},
|
|
261191
|
+
mediaProductsApi: isCustomer ? void 0 : {
|
|
261192
|
+
...shareablesCtx.mediaProductsAdapter,
|
|
261193
|
+
listMediaProducts: (mediumId, params) => shareablesCtx.mediaProductsAdapter.listMediaProducts(mediumId, {
|
|
261194
|
+
...params,
|
|
261195
|
+
language_iso: params?.language_iso ?? localeRef.current
|
|
261196
|
+
})
|
|
261197
|
+
},
|
|
261198
|
+
searchProducts: isCustomer ? void 0 : async (query, options) => {
|
|
261199
|
+
const limit = options?.limit ?? 25;
|
|
261200
|
+
const cursor = options?.cursor ?? void 0;
|
|
261201
|
+
const result = query.trim().length > 0 ? await portalProductsApi.searchProducts(query, {
|
|
261202
|
+
cursor,
|
|
261203
|
+
limit
|
|
261204
|
+
}) : await portalProductsApi.listProducts({
|
|
261205
|
+
cursor,
|
|
261206
|
+
limit
|
|
261207
|
+
});
|
|
261208
|
+
return {
|
|
261209
|
+
products: (result.products ?? []).map((p) => p.id != null ? {
|
|
261210
|
+
id: p.id,
|
|
261211
|
+
name: p.name ?? p.title ?? tRef.current("common_untitled"),
|
|
261212
|
+
image_url: p.image_url ?? p.images?.[0]?.url ?? null,
|
|
261213
|
+
price: p.price ?? null
|
|
261214
|
+
} : null).filter((p) => p !== null),
|
|
261215
|
+
nextCursor: result.meta?.pagination?.next_cursor ?? null
|
|
261216
|
+
};
|
|
261217
|
+
},
|
|
261218
|
+
readOnly: isCustomer,
|
|
261219
|
+
canCuratePlaylists: canCuratePlaylists ?? true,
|
|
261220
|
+
pickerSources: {
|
|
261221
|
+
pages: {
|
|
261222
|
+
cacheKey: `locale:${locale}`,
|
|
261223
|
+
list: async ({ search, cursor, limit }) => {
|
|
261224
|
+
const response = await shareablesCtx.pagesAdapter.listPages({
|
|
261225
|
+
cursor: cursor ?? void 0,
|
|
261226
|
+
limit,
|
|
261227
|
+
"filter[title]": search && search.trim().length > 0 ? search : void 0,
|
|
261228
|
+
language_iso: localeRef.current
|
|
261150
261229
|
});
|
|
261151
|
-
|
|
261152
|
-
|
|
261153
|
-
|
|
261154
|
-
|
|
261155
|
-
|
|
261156
|
-
|
|
261157
|
-
|
|
261158
|
-
|
|
261159
|
-
|
|
261160
|
-
|
|
261161
|
-
|
|
261162
|
-
}
|
|
261163
|
-
|
|
261164
|
-
|
|
261165
|
-
|
|
261166
|
-
|
|
261167
|
-
...shareablesCtx.mediaProductsAdapter,
|
|
261168
|
-
listMediaProducts: (mediumId, params) => shareablesCtx.mediaProductsAdapter.listMediaProducts(mediumId, {
|
|
261169
|
-
...params,
|
|
261170
|
-
language_iso: params?.language_iso ?? localeRef.current
|
|
261171
|
-
})
|
|
261172
|
-
},
|
|
261173
|
-
searchProducts: isCustomer ? void 0 : async (query, options) => {
|
|
261174
|
-
const limit = options?.limit ?? 25;
|
|
261175
|
-
const cursor = options?.cursor ?? void 0;
|
|
261176
|
-
const result = query.trim().length > 0 ? await portalProductsApi.searchProducts(query, {
|
|
261177
|
-
cursor,
|
|
261230
|
+
return {
|
|
261231
|
+
items: response.pages.map((p) => ({
|
|
261232
|
+
id: p.id,
|
|
261233
|
+
title: p.title ?? tRef.current("pages_fallback_name", { id: String(p.id) }),
|
|
261234
|
+
image_url: p.image_url ?? null
|
|
261235
|
+
})),
|
|
261236
|
+
nextCursor: response.meta.pagination?.next_cursor ?? null
|
|
261237
|
+
};
|
|
261238
|
+
}
|
|
261239
|
+
},
|
|
261240
|
+
products: {
|
|
261241
|
+
cacheKey: `locale:${locale}`,
|
|
261242
|
+
list: async ({ search, cursor, limit }) => {
|
|
261243
|
+
const trimmedSearch = search?.trim() ?? "";
|
|
261244
|
+
const result = trimmedSearch.length > 0 ? await portalProductsApi.searchProducts(trimmedSearch, {
|
|
261245
|
+
cursor: cursor ?? void 0,
|
|
261178
261246
|
limit
|
|
261179
261247
|
}) : await portalProductsApi.listProducts({
|
|
261180
|
-
cursor,
|
|
261248
|
+
cursor: cursor ?? void 0,
|
|
261181
261249
|
limit
|
|
261182
261250
|
});
|
|
261183
261251
|
return {
|
|
261184
|
-
|
|
261252
|
+
items: (result.products ?? []).map((p) => p.id != null ? {
|
|
261185
261253
|
id: p.id,
|
|
261186
|
-
name: p.name ??
|
|
261187
|
-
image_url: p.
|
|
261254
|
+
name: p.name ?? tRef.current("common_untitled"),
|
|
261255
|
+
image_url: p.images?.[0]?.url ?? null,
|
|
261188
261256
|
price: p.price ?? null
|
|
261189
261257
|
} : null).filter((p) => p !== null),
|
|
261190
261258
|
nextCursor: result.meta?.pagination?.next_cursor ?? null
|
|
261191
261259
|
};
|
|
261192
|
-
}
|
|
261193
|
-
|
|
261194
|
-
|
|
261195
|
-
|
|
261196
|
-
|
|
261197
|
-
|
|
261198
|
-
|
|
261199
|
-
|
|
261200
|
-
|
|
261201
|
-
|
|
261202
|
-
|
|
261203
|
-
|
|
261204
|
-
|
|
261205
|
-
|
|
261206
|
-
|
|
261207
|
-
|
|
261208
|
-
|
|
261209
|
-
|
|
261210
|
-
|
|
261211
|
-
|
|
261212
|
-
|
|
261213
|
-
|
|
261214
|
-
|
|
261215
|
-
|
|
261216
|
-
|
|
261217
|
-
|
|
261218
|
-
|
|
261219
|
-
|
|
261220
|
-
|
|
261221
|
-
|
|
261222
|
-
|
|
261223
|
-
|
|
261224
|
-
|
|
261225
|
-
|
|
261226
|
-
|
|
261227
|
-
|
|
261228
|
-
|
|
261229
|
-
|
|
261230
|
-
|
|
261231
|
-
|
|
261232
|
-
|
|
261233
|
-
|
|
261234
|
-
|
|
261235
|
-
|
|
261236
|
-
|
|
261237
|
-
|
|
261238
|
-
|
|
261239
|
-
|
|
261240
|
-
|
|
261241
|
-
|
|
261242
|
-
|
|
261243
|
-
|
|
261244
|
-
});
|
|
261245
|
-
return {
|
|
261246
|
-
items: response.enrollment_packs.map((pack) => ({
|
|
261247
|
-
id: pack.id,
|
|
261248
|
-
title: pack.title || tRef.current("enrollment_pack_fallback_name", { id: String(pack.id) }),
|
|
261249
|
-
image_url: pack.images[0]?.url ?? null
|
|
261250
|
-
})),
|
|
261251
|
-
nextCursor: response.meta.pagination?.next_cursor ?? null
|
|
261252
|
-
};
|
|
261253
|
-
}
|
|
261254
|
-
}
|
|
261255
|
-
},
|
|
261256
|
-
uploadThumbnail: isCustomer ? void 0 : async (blob, filename) => {
|
|
261257
|
-
const url = (await filePickerApi.createDamAsset({
|
|
261258
|
-
file: new File([blob], filename, { type: blob.type }),
|
|
261259
|
-
name: filename
|
|
261260
|
-
})).asset?.default_variant_url;
|
|
261261
|
-
if (!url) throw new Error("Thumbnail upload succeeded but no URL returned");
|
|
261262
|
-
return url;
|
|
261263
|
-
}
|
|
261264
|
-
}), [
|
|
261265
|
-
account,
|
|
261266
|
-
store,
|
|
261267
|
-
locale,
|
|
261268
|
-
navigate,
|
|
261269
|
-
filePickerApi,
|
|
261270
|
-
isCustomer,
|
|
261271
|
-
shareablesCtx.playlistsAdapter,
|
|
261272
|
-
shareablesCtx.pagesAdapter,
|
|
261273
|
-
shareablesCtx.enrollmentPacksAdapter,
|
|
261274
|
-
shareablesCtx.mediaProductsAdapter,
|
|
261275
|
-
portalProductsApi,
|
|
261276
|
-
client,
|
|
261277
|
-
queryClient
|
|
261278
|
-
]),
|
|
261260
|
+
}
|
|
261261
|
+
},
|
|
261262
|
+
enrollment_packs: {
|
|
261263
|
+
cacheKey: `locale:${locale}`,
|
|
261264
|
+
supportsSearch: false,
|
|
261265
|
+
list: async ({ cursor, limit }) => {
|
|
261266
|
+
const response = await shareablesCtx.enrollmentPacksAdapter.listEnrollmentPacks({
|
|
261267
|
+
cursor: cursor ?? void 0,
|
|
261268
|
+
limit
|
|
261269
|
+
});
|
|
261270
|
+
return {
|
|
261271
|
+
items: response.enrollment_packs.map((pack) => ({
|
|
261272
|
+
id: pack.id,
|
|
261273
|
+
title: pack.title || tRef.current("enrollment_pack_fallback_name", { id: String(pack.id) }),
|
|
261274
|
+
image_url: pack.images[0]?.url ?? null
|
|
261275
|
+
})),
|
|
261276
|
+
nextCursor: response.meta.pagination?.next_cursor ?? null
|
|
261277
|
+
};
|
|
261278
|
+
}
|
|
261279
|
+
}
|
|
261280
|
+
},
|
|
261281
|
+
uploadThumbnail: isCustomer ? void 0 : async (blob, filename) => {
|
|
261282
|
+
const url = (await filePickerApi.createDamAsset({
|
|
261283
|
+
file: new File([blob], filename, { type: blob.type }),
|
|
261284
|
+
name: filename
|
|
261285
|
+
})).asset?.default_variant_url;
|
|
261286
|
+
if (!url) throw new Error("Thumbnail upload succeeded but no URL returned");
|
|
261287
|
+
return url;
|
|
261288
|
+
}
|
|
261289
|
+
}), [
|
|
261290
|
+
account,
|
|
261291
|
+
store,
|
|
261292
|
+
locale,
|
|
261293
|
+
navigate,
|
|
261294
|
+
filePickerApi,
|
|
261295
|
+
isCustomer,
|
|
261296
|
+
canCuratePlaylists,
|
|
261297
|
+
shareablesCtx.playlistsAdapter,
|
|
261298
|
+
shareablesCtx.pagesAdapter,
|
|
261299
|
+
shareablesCtx.enrollmentPacksAdapter,
|
|
261300
|
+
shareablesCtx.mediaProductsAdapter,
|
|
261301
|
+
portalProductsApi,
|
|
261302
|
+
client,
|
|
261303
|
+
queryClient
|
|
261304
|
+
]);
|
|
261305
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_prop_types.ShareablesCoreProvider, {
|
|
261306
|
+
config: coreConfig,
|
|
261307
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareablesUIProvider, {
|
|
261308
|
+
config: (0, react.useMemo)(() => pickerSourceKeys ? {
|
|
261309
|
+
...uiConfig,
|
|
261310
|
+
pickerSources: pickSources(uiConfig.pickerSources, pickerSourceKeys)
|
|
261311
|
+
} : uiConfig, [uiConfig, pickerSourceKeys]),
|
|
261279
261312
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShareablesApp, {
|
|
261280
261313
|
screen,
|
|
261281
261314
|
detailId,
|
|
@@ -261323,4 +261356,4 @@ Object.defineProperty(exports, "shareablesScreenPropertySchema", {
|
|
|
261323
261356
|
}
|
|
261324
261357
|
});
|
|
261325
261358
|
|
|
261326
|
-
//# sourceMappingURL=ShareablesScreen-
|
|
261359
|
+
//# sourceMappingURL=ShareablesScreen-DUkC1Gu8.cjs.map
|