@tiledev/sdk-apptile-live-selling 0.14.0 → 0.15.0
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/README.md +30 -8
- package/dist/clipsPage.d.ts +29 -0
- package/dist/clipsPage.d.ts.map +1 -0
- package/dist/clipsPage.js +49 -0
- package/dist/clipsPage.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/linkLots.d.ts +64 -0
- package/dist/linkLots.d.ts.map +1 -0
- package/dist/linkLots.js +84 -0
- package/dist/linkLots.js.map +1 -0
- package/dist/livePages.d.ts +91 -4
- package/dist/livePages.d.ts.map +1 -1
- package/dist/livePages.js +101 -4
- package/dist/livePages.js.map +1 -1
- package/dist/pageOptions.d.ts +24 -6
- package/dist/pageOptions.d.ts.map +1 -1
- package/dist/pageOptions.js +20 -3
- package/dist/pageOptions.js.map +1 -1
- package/dist/pageTypes.d.ts +58 -0
- package/dist/pageTypes.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.d.ts +11 -3
- package/dist/react/LiveSellingProvider.d.ts.map +1 -1
- package/dist/react/LiveSellingProvider.js +26 -8
- package/dist/react/LiveSellingProvider.js.map +1 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +6 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.web.d.ts +3 -1
- package/dist/react/index.web.d.ts.map +1 -1
- package/dist/react/index.web.js +7 -1
- package/dist/react/index.web.js.map +1 -1
- package/dist/react/shopifyProviders.d.ts +4 -3
- package/dist/react/shopifyProviders.d.ts.map +1 -1
- package/dist/react/shopifyProviders.js +6 -4
- package/dist/react/shopifyProviders.js.map +1 -1
- package/dist/react/useAccountName.d.ts +8 -0
- package/dist/react/useAccountName.d.ts.map +1 -0
- package/dist/react/useAccountName.js +49 -0
- package/dist/react/useAccountName.js.map +1 -0
- package/dist/react/useClipsPage.d.ts +47 -0
- package/dist/react/useClipsPage.d.ts.map +1 -0
- package/dist/react/useClipsPage.js +130 -0
- package/dist/react/useClipsPage.js.map +1 -0
- package/dist/react/useLiveAuction.d.ts +5 -3
- package/dist/react/useLiveAuction.d.ts.map +1 -1
- package/dist/react/useLiveAuction.js +10 -5
- package/dist/react/useLiveAuction.js.map +1 -1
- package/dist/react/useLiveChat.d.ts +42 -7
- package/dist/react/useLiveChat.d.ts.map +1 -1
- package/dist/react/useLiveChat.js +90 -12
- package/dist/react/useLiveChat.js.map +1 -1
- package/dist/react/useLiveGiveawaysAndPolls.d.ts +14 -3
- package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +1 -1
- package/dist/react/useLiveGiveawaysAndPolls.js +56 -11
- package/dist/react/useLiveGiveawaysAndPolls.js.map +1 -1
- package/dist/react/useLivePage.d.ts +22 -1
- package/dist/react/useLivePage.d.ts.map +1 -1
- package/dist/react/useLivePage.js +51 -11
- package/dist/react/useLivePage.js.map +1 -1
- package/dist/react/useLiveShop.d.ts +25 -5
- package/dist/react/useLiveShop.d.ts.map +1 -1
- package/dist/react/useLiveShop.js +65 -19
- package/dist/react/useLiveShop.js.map +1 -1
- package/dist/react/useReplayPage.d.ts +20 -4
- package/dist/react/useReplayPage.d.ts.map +1 -1
- package/dist/react/useReplayPage.js +94 -33
- package/dist/react/useReplayPage.js.map +1 -1
- package/dist/showNames.d.ts +11 -0
- package/dist/showNames.d.ts.map +1 -1
- package/dist/showNames.js +23 -1
- package/dist/showNames.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/react/index.web.ts"],"names":[],"mappings":"AA2BA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;AAGrB,OAA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E;AAED,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,QAAQ,CAEpE"}
|
package/dist/react/index.web.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useReplayPage = exports.useLiveGiveawaysAndPolls = exports.useLiveAuction = exports.shareAddress = exports.shareProduct = exports.useLiveShop = exports.useLiveChat = exports.useLivePage = exports.useKeepScreenAwake = exports.useReplayPlayer = exports.ReplayPlayerProvider = exports.ShopifyLiveSessionProvider = exports.ShopifyLiveSellingProvider = exports.useLivePageOptions = exports.useAuctionWins = exports.useAuctionBidGate = exports.SHEET_HANDOFF_MS = exports.LiveVideoTarget = exports.NativeVideoView = exports.isNativeVideoSupported = exports.useLiveShow = exports.useLiveSession = exports.LiveSessionProvider = exports.SHOWS_PAGE_SIZE = exports.useLiveRailFor = exports.useLiveHubPageFor = exports.useItemsYouWonPageFor = exports.nativeViewTag = exports.useSilentAuctionRounds = exports.useMySilentAuctionBids = exports.useSilentAuctionLot = exports.useSilentAuctionLots = exports.useCommentLinkCards = exports.useGiveawayPrize = exports.useGiveawayEntry = exports.useShowClock = exports.useAuctionCountdown = exports.refreshStreamRecordsIfStale = exports.refreshStreamRecords = exports.useStreamInfo = exports.useClips = exports.useReplays = exports.useAuction = exports.useLiveStreams = exports.refreshOngoingLive = exports.useOngoingLive = exports.useHiddenShows = exports.useLiveSelling = exports.LiveSellingProvider = void 0;
|
|
3
|
+
exports.useAccountName = exports.useReplayPage = exports.useLiveGiveawaysAndPolls = exports.useLiveAuction = exports.shareAddress = exports.shareProduct = exports.useLiveShop = exports.useLiveChat = exports.useLivePage = exports.useKeepScreenAwake = exports.useReplayPlayer = exports.ReplayPlayerProvider = exports.ShopifyLiveSessionProvider = exports.ShopifyLiveSellingProvider = exports.useLivePageOptions = exports.useAuctionWins = exports.useAuctionBidGate = exports.SHEET_HANDOFF_MS = exports.LiveVideoTarget = exports.NativeVideoView = exports.isNativeVideoSupported = exports.useLiveShow = exports.useLiveSession = exports.LiveSessionProvider = exports.SHOWS_PAGE_SIZE = exports.useLiveRailFor = exports.useLiveHubPageFor = exports.useItemsYouWonPageFor = exports.nativeViewTag = exports.useSilentAuctionRounds = exports.useMySilentAuctionBids = exports.useSilentAuctionLot = exports.useSilentAuctionLots = exports.useCommentLinkCards = exports.useGiveawayPrize = exports.useGiveawayEntry = exports.useShowClock = exports.useAuctionCountdown = exports.refreshStreamRecordsIfStale = exports.refreshStreamRecords = exports.useStreamInfo = exports.useClips = exports.useReplays = exports.useAuction = exports.useLiveStreams = exports.refreshOngoingLive = exports.useOngoingLive = exports.useHiddenShows = exports.useLiveSelling = exports.LiveSellingProvider = void 0;
|
|
4
|
+
exports.useClipsPage = void 0;
|
|
4
5
|
exports.useItemsYouWonPage = useItemsYouWonPage;
|
|
5
6
|
exports.useLiveHubPage = useLiveHubPage;
|
|
6
7
|
exports.useLiveRail = useLiveRail;
|
|
@@ -123,6 +124,11 @@ var useLiveGiveawaysAndPolls_1 = require("./useLiveGiveawaysAndPolls");
|
|
|
123
124
|
Object.defineProperty(exports, "useLiveGiveawaysAndPolls", { enumerable: true, get: function () { return useLiveGiveawaysAndPolls_1.useLiveGiveawaysAndPolls; } });
|
|
124
125
|
var useReplayPage_1 = require("./useReplayPage");
|
|
125
126
|
Object.defineProperty(exports, "useReplayPage", { enumerable: true, get: function () { return useReplayPage_1.useReplayPage; } });
|
|
127
|
+
// 0.15.0: the name on the shopper's account, for the name asks; the Clips page.
|
|
128
|
+
var useAccountName_1 = require("./useAccountName");
|
|
129
|
+
Object.defineProperty(exports, "useAccountName", { enumerable: true, get: function () { return useAccountName_1.useAccountName; } });
|
|
130
|
+
var useClipsPage_1 = require("./useClipsPage");
|
|
131
|
+
Object.defineProperty(exports, "useClipsPage", { enumerable: true, get: function () { return useClipsPage_1.useClipsPage; } });
|
|
126
132
|
// ─── The page models ─────────────────────────────────────────────────────────
|
|
127
133
|
/** The Items You Won tab over the empty wins: signed in, it says nothing was won. */
|
|
128
134
|
function useItemsYouWonPage(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../src/react/index.web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../src/react/index.web.ts"],"names":[],"mappings":";;;;AA0IA,gDAEC;AAGD,wCAEC;AAGD,kCAEC;AAtJD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,+DAAqE;AACrE,2CASqB;AAErB,+FAA+F;AAC/F,6DAK+B;AAJ7B,0HAAA,mBAAmB,OAAA;AACnB,qHAAA,cAAc,OAAA;AAIhB,mDAA6E;AAApE,gHAAA,cAAc,OAAA;AACvB,mDAA4E;AAAnE,gHAAA,cAAc,OAAA;AACvB,wDAAyD;AAAhD,sHAAA,kBAAkB,OAAA;AAC3B,mDAA4E;AAAnE,gHAAA,cAAc,OAAA;AACvB,2CAAgE;AAAvD,wGAAA,UAAU,OAAA;AACnB,2CAAwF;AAA/E,wGAAA,UAAU,OAAA;AACnB,uCAA0D;AAAjD,oGAAA,QAAQ,OAAA;AACjB,iDAKyB;AAJvB,8GAAA,aAAa,OAAA;AACb,qHAAA,oBAAoB,OAAA;AACpB,4HAAA,2BAA2B,OAAA;AAG7B,+EAA+E;AAC/E,mCAA6D;AAApD,6GAAA,mBAAmB,OAAA;AAAE,sGAAA,YAAY,OAAA;AAC1C,uGAAuG;AACvG,0CAA0C;AAC1C,uDAM4B;AAL1B,oHAAA,gBAAgB,OAAA;AAMlB,uDAAkF;AAAzE,oHAAA,gBAAgB,OAAA;AACzB,6DAAmF;AAA1E,0HAAA,mBAAmB,OAAA;AAC5B,8DAA8D;AAC9D,+DAA4H;AAAnH,4HAAA,oBAAoB,OAAA;AAC7B,6DAA2H;AAAlH,0HAAA,mBAAmB,OAAA;AAC5B,mEAAoI;AAA3H,g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AAqF;AACrF,SAAgB,kBAAkB,CAAiB,OAAkC;IACnF,OAAO,IAAA,iCAAqB,EAAC,IAAA,oCAAc,GAAQ,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAED,qGAAqG;AACrG,SAAgB,cAAc,CAAC,OAA8B;IAC3D,OAAO,IAAA,6BAAiB,EAAC,kCAAY,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,uDAAuD;AACvD,SAAgB,WAAW,CAAC,OAA8B;IACxD,OAAO,IAAA,0BAAc,EAAC,kCAAY,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -57,12 +57,13 @@ export interface ShopifyLiveSessionProviderProps extends Omit<LiveSessionProvide
|
|
|
57
57
|
* the account has; never an email nor its part before the @), so a name edited on Account reaches the
|
|
58
58
|
* room without a restart. Null with no name on the account, or signed out, so a name the shopper typed
|
|
59
59
|
* on this phone stays in charge (the comment box asks for one: `useLivePage`'s chat).
|
|
60
|
-
* - **`blockedNames
|
|
61
|
-
* the
|
|
60
|
+
* - **`blockedNames`**: the names nobody watching may go by. `LiveSellingProvider`'s (0.15.0: the list
|
|
61
|
+
* the name asks check too, so the session and the sheets agree), unless one is passed here; Host and
|
|
62
|
+
* Moderator unless the app says otherwise.
|
|
62
63
|
* - **`onPipRestore`**: the phone's picture-in-picture window, opened from the Live screen and then
|
|
63
64
|
* expanded (or, on iOS, left up when the shopper came back by the app's icon), comes back to the Live
|
|
64
65
|
* screen (`routes.openLive`). A window opened from the bubble goes back to the bubble instead, which
|
|
65
66
|
* the session does itself without calling this. An `onPipRestore` of the app's own replaces it.
|
|
66
67
|
*/
|
|
67
|
-
export declare function ShopifyLiveSessionProvider({ children, onPipRestore, ...props }: ShopifyLiveSessionProviderProps): import("react").FunctionComponentElement<LiveSessionProviderProps>;
|
|
68
|
+
export declare function ShopifyLiveSessionProvider({ children, onPipRestore, blockedNames, ...props }: ShopifyLiveSessionProviderProps): import("react").FunctionComponentElement<LiveSessionProviderProps>;
|
|
68
69
|
//# sourceMappingURL=shopifyProviders.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopifyProviders.d.ts","sourceRoot":"","sources":["../../src/react/shopifyProviders.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAA2C,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAE/G,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,UAAU,GAAG,wBAAwB,GAAG,UAAU,CAAC,GAAG;IAC/H,4GAA4G;IAC5G,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,aAAa,CAAC;IAC/G;;;;;OAKG;IACH,MAAM,EAAE,wBAAwB,CAAC;IACjC,sHAAsH;IACtH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,8FAA8F;IAC9F,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,MAAM,EACN,cAAc,EACd,aAAa,EACb,cAA2B,EAC3B,GAAG,SAAS,EACb,EAAE,+BAA+B,sEA4BjC;AAED,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAAC,wBAAwB,EAAE,YAAY,GAAG,UAAU,CAAC;IAChH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED
|
|
1
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AAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,+BAA+B,sEAkB7H"}
|
|
@@ -74,16 +74,17 @@ function ShopifyLiveSellingProvider({ children, config, cartSourceName, prizeWri
|
|
|
74
74
|
* the account has; never an email nor its part before the @), so a name edited on Account reaches the
|
|
75
75
|
* room without a restart. Null with no name on the account, or signed out, so a name the shopper typed
|
|
76
76
|
* on this phone stays in charge (the comment box asks for one: `useLivePage`'s chat).
|
|
77
|
-
* - **`blockedNames
|
|
78
|
-
* the
|
|
77
|
+
* - **`blockedNames`**: the names nobody watching may go by. `LiveSellingProvider`'s (0.15.0: the list
|
|
78
|
+
* the name asks check too, so the session and the sheets agree), unless one is passed here; Host and
|
|
79
|
+
* Moderator unless the app says otherwise.
|
|
79
80
|
* - **`onPipRestore`**: the phone's picture-in-picture window, opened from the Live screen and then
|
|
80
81
|
* expanded (or, on iOS, left up when the shopper came back by the app's icon), comes back to the Live
|
|
81
82
|
* screen (`routes.openLive`). A window opened from the bubble goes back to the bubble instead, which
|
|
82
83
|
* the session does itself without calling this. An `onPipRestore` of the app's own replaces it.
|
|
83
84
|
*/
|
|
84
|
-
function ShopifyLiveSessionProvider({ children, onPipRestore, ...props }) {
|
|
85
|
+
function ShopifyLiveSessionProvider({ children, onPipRestore, blockedNames, ...props }) {
|
|
85
86
|
const { customer } = (0, sdk_shopify_1.useCustomer)();
|
|
86
|
-
const { routes } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
87
|
+
const { routes, blockedNames: providerBlockedNames } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
87
88
|
const backToTheLiveShow = (0, react_1.useMemo)(() => onPipRestore !== null && onPipRestore !== void 0 ? onPipRestore : ((streamId) => {
|
|
88
89
|
if (streamId)
|
|
89
90
|
routes.openLive(streamId);
|
|
@@ -91,6 +92,7 @@ function ShopifyLiveSessionProvider({ children, onPipRestore, ...props }) {
|
|
|
91
92
|
return (0, react_1.createElement)(platformSession_1.LiveSessionProvider, {
|
|
92
93
|
...props,
|
|
93
94
|
viewerName: (0, showNames_1.viewerNameFor)(customer),
|
|
95
|
+
blockedNames: blockedNames !== null && blockedNames !== void 0 ? blockedNames : providerBlockedNames,
|
|
94
96
|
onPipRestore: backToTheLiveShow,
|
|
95
97
|
children,
|
|
96
98
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopifyProviders.js","sourceRoot":"","sources":["../../src/react/shopifyProviders.ts"],"names":[],"mappings":";;;;;AA8DA,gEAmCC;
|
|
1
|
+
{"version":3,"file":"shopifyProviders.js","sourceRoot":"","sources":["../../src/react/shopifyProviders.ts"],"names":[],"mappings":";;;;;AA8DA,gEAmCC;AAyBD,gEAkBC;AA5ID;;;;;;;GAOG;AACH,8FAAqE;AACrE,sDAAwE;AACxE,iCAAuD;AAGvD,wDAA2F;AAC3F,wDAA+D;AAC/D,4CAA6C;AAE7C,+DAA+G;AAC/G,uDAAwD;AA+BxD;;;;;;;;;;;;GAYG;AACH,SAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,MAAM,EACN,cAAc,EACd,aAAa,EACb,cAAc,GAAG,wBAAU,EAC3B,GAAG,SAAS,EACoB;;IAChC,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,IAAA,cAAM,EAAC,QAAQ,CAAC,CAAC;IACxC,cAAc,CAAC,OAAO,GAAG,QAAQ,CAAC;IAElC,MAAM,UAAU,GAAG,IAAA,eAAO,EAAoB,GAAG,EAAE;;QACjD,MAAM,QAAQ,GAAG,IAAA,2CAAyB,EAAC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACzE,OAAO;YACL,GAAG,MAAM;YACT,OAAO,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,uBAAY;YACvC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;YACvD,QAAQ,EAAE,IAAA,2CAAy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+1,8 @@
|
|
|
1
|
+
import type { NameOnAccount } from '../pageTypes';
|
|
2
|
+
export interface AccountName {
|
|
3
|
+
accountLoading: boolean;
|
|
4
|
+
nameToComplete: NameOnAccount | null;
|
|
5
|
+
saveNameToAccount: (firstName: string, lastName: string) => Promise<string | null>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useAccountName(): AccountName;
|
|
8
|
+
//# sourceMappingURL=useAccountName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccountName.d.ts","sourceRoot":"","sources":["../../src/react/useAccountName.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACpF;AAED,wBAAgB,cAAc,IAAI,WAAW,CAyB5C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAccountName = useAccountName;
|
|
4
|
+
/**
|
|
5
|
+
* `useAccountName()` — the signed-in shopper's name on their Shopify account, for the Live screen's name
|
|
6
|
+
* asks (0.15.0, moved from amore-v2's `src/core/hooks/useAccountName.ts`): the comment box's "Commenting
|
|
7
|
+
* As:" (`useLiveChat`) and the giveaway's "Entering As:" (`useLiveGiveawaysAndPolls`).
|
|
8
|
+
*
|
|
9
|
+
* amore-v2's ENG-686, decided 2026-10-19 by its Head of Engineering (old Amore's and old K-Marie's way,
|
|
10
|
+
* for giveaways too the same day): a Shopify sign-in by emailed code leaves the account's name blank, and
|
|
11
|
+
* since 0.13.0 the room names nobody by their email. Such a shopper is asked once, by whichever comes
|
|
12
|
+
* first, a comment or a giveaway entry, for a first and a last name (the last optional), which go on the
|
|
13
|
+
* account (sdk-shopify's `updateProfile`, which says "Profile updated" as Edit Profile does). The account
|
|
14
|
+
* then names them in the room, on Account and on their orders, and neither ask comes again.
|
|
15
|
+
*
|
|
16
|
+
* - **`accountLoading`:** signed in, the account not read yet (`accountLoadingOf`). Send and Enter wait.
|
|
17
|
+
* - **`nameToComplete`:** the account has been read and has no first name, or a name the show's team
|
|
18
|
+
* goes by (`LiveSellingProvider`'s `blockedNames`): what it has, for the ask to start from
|
|
19
|
+
* (`accountNameToComplete`). Null when it has a first name, while it loads, and when signed out.
|
|
20
|
+
* - **`saveNameToAccount(firstName, lastName)`:** the name as it went on the account ("Jane Doe", or
|
|
21
|
+
* "Jane"), or null when it didn't: no first name, a team name (`tidyAccountName`), or Shopify refused
|
|
22
|
+
* it or couldn't be reached.
|
|
23
|
+
*/
|
|
24
|
+
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
25
|
+
const react_1 = require("react");
|
|
26
|
+
const livePages_1 = require("../livePages");
|
|
27
|
+
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
28
|
+
function useAccountName() {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const { loggedIn, restoring, customer, updateProfile } = (0, sdk_shopify_1.useCustomer)();
|
|
31
|
+
const { blockedNames } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
32
|
+
const account = { loggedIn: !!loggedIn, restoring: !!restoring, customer };
|
|
33
|
+
const accountLoading = (0, livePages_1.accountLoadingOf)(account);
|
|
34
|
+
const needed = (0, livePages_1.accountNameToComplete)(account, blockedNames);
|
|
35
|
+
const firstName = (_a = needed === null || needed === void 0 ? void 0 : needed.firstName) !== null && _a !== void 0 ? _a : null;
|
|
36
|
+
const lastName = (_b = needed === null || needed === void 0 ? void 0 : needed.lastName) !== null && _b !== void 0 ? _b : null;
|
|
37
|
+
// One object while the name it needs stays the same, so a tile's sheet doesn't start over each draw.
|
|
38
|
+
const nameToComplete = (0, react_1.useMemo)(() => (firstName !== null ? { firstName, lastName } : null), [firstName, lastName]);
|
|
39
|
+
const saveNameToAccount = (0, react_1.useCallback)(async (typedFirstName, typedLastName) => {
|
|
40
|
+
const name = (0, livePages_1.tidyAccountName)(typedFirstName, typedLastName, blockedNames);
|
|
41
|
+
if (!name)
|
|
42
|
+
return null;
|
|
43
|
+
if (!(await updateProfile({ firstName: name.firstName, lastName: name.lastName })))
|
|
44
|
+
return null;
|
|
45
|
+
return name.fullName;
|
|
46
|
+
}, [blockedNames, updateProfile]);
|
|
47
|
+
return { accountLoading, nameToComplete, saveNameToAccount };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=useAccountName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccountName.js","sourceRoot":"","sources":["../../src/react/useAccountName.ts"],"names":[],"mappings":";;AAiCA,wCAyBC;AA1DD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sDAAmD;AACnD,iCAA6C;AAE7C,4CAAwF;AAExF,+DAA2D;AAQ3D,SAAgB,cAAc;;IAC5B,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAA,yBAAW,GAAE,CAAC;IACvE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,wCAAkB,GAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC3E,MAAM,cAAc,GAAG,IAAA,4BAAgB,EAAC,OAAO,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,IAAA,iCAAqB,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,mCAAI,IAAI,CAAC;IAC5C,MAAM,QAAQ,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,mCAAI,IAAI,CAAC;IAC1C,qGAAqG;IACrG,MAAM,cAAc,GAAG,IAAA,eAAO,EAC5B,GAAG,EAAE,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAC3D,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtB,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,KAAK,EAAE,cAAsB,EAAE,aAAqB,EAA0B,EAAE;QAC9E,MAAM,IAAI,GAAG,IAAA,2BAAe,EAAC,cAAc,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAChG,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC,EACD,CAAC,YAAY,EAAE,aAAa,CAAC,CAC9B,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ClipReelItem } from '../pageTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Everything the Clips page wires, so the screen stays plain tiles: the reel (`reel`, the reel tile's
|
|
4
|
+
* props) and the bar over it (`header`). Call it from the screen and from each of its tiles' wiring.
|
|
5
|
+
*
|
|
6
|
+
* - **The reel** is the live-selling gateway's video collection (`useClips`): which clips, in what
|
|
7
|
+
* order, the video each plays and its poster. The merchant curates it in the dashboard.
|
|
8
|
+
* - **Each clip's product** comes from Shopify, in one read for the whole reel (`shopify.products.byIds`,
|
|
9
|
+
* at sdk-shopify's `CARD_IMAGE`, the grids' card size, which the product store keeps as the product's
|
|
10
|
+
* card image). A clip whose product the store no longer has is left out (`clipReelItems`): there is
|
|
11
|
+
* nothing to buy from it. Products are kept across reads, so a refreshed reel only waits for products
|
|
12
|
+
* it hasn't seen.
|
|
13
|
+
* - **Loading** until the clips' first read has started (`useClips` reads only once the SDK is ready,
|
|
14
|
+
* and says `loading` only from then: until it has read once, an empty reel is still loading, not "No
|
|
15
|
+
* clips yet.") and while products it shows are on their way. A failed read of either is `error`;
|
|
16
|
+
* Retry reads both again.
|
|
17
|
+
* - **Playback:** only while the page is on screen (`paused` otherwise); one mute setting for the reel,
|
|
18
|
+
* starting muted.
|
|
19
|
+
* - **Buy** opens the variant page (`routes.openVariantPage`): the product page's tiles in a sheet over
|
|
20
|
+
* the reel. **Share** sends the product's link (`productShareUrl`). **Close** goes back to where the
|
|
21
|
+
* shopper came from; the bar's cart opens the Cart (`routes.openCart`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function useClipsPage(): {
|
|
24
|
+
/** The reel has a clip to show. */
|
|
25
|
+
hasReel: boolean;
|
|
26
|
+
/** The page is on show: light status bar glyphs over the video. */
|
|
27
|
+
isFocused: boolean;
|
|
28
|
+
reel: {
|
|
29
|
+
clips: ClipReelItem[];
|
|
30
|
+
loading: boolean;
|
|
31
|
+
error: boolean;
|
|
32
|
+
paused: boolean;
|
|
33
|
+
muted: boolean;
|
|
34
|
+
onToggleMute: () => void;
|
|
35
|
+
onShare: (clip: ClipReelItem) => void;
|
|
36
|
+
onBuy: (clip: ClipReelItem) => void;
|
|
37
|
+
onRetry: () => void;
|
|
38
|
+
};
|
|
39
|
+
header: {
|
|
40
|
+
cartCount: number;
|
|
41
|
+
onClose: () => void;
|
|
42
|
+
onCart: () => void;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** What `useClipsPage` hands the Clips page and its tiles. */
|
|
46
|
+
export type ClipsPage = ReturnType<typeof useClipsPage>;
|
|
47
|
+
//# sourceMappingURL=useClipsPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClipsPage.d.ts","sourceRoot":"","sources":["../../src/react/useClipsPage.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY;IA+DxB,mCAAmC;;IAEnC,mEAAmE;;;;;;;;;wBASjD,YAAY;sBAId,YAAY;;;;;;;;EAe/B;AAED,8DAA8D;AAC9D,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useClipsPage = useClipsPage;
|
|
4
|
+
/**
|
|
5
|
+
* The Clips page's page model (0.15.0, moved from amore-v2's `src/core/hooks/useClipsPage.ts`, ported
|
|
6
|
+
* there from the earlier app's Clips tab, 2026-10-18): the reel a rail of clips opens, on the clip tapped.
|
|
7
|
+
* The routes are the app's (`LiveSellingProvider`'s `routes`); the clip to open on is the app's route
|
|
8
|
+
* param, which its screen hands the reel tile (amore-v2: `clipId`, as `firstClipId`).
|
|
9
|
+
*/
|
|
10
|
+
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const clipsPage_1 = require("../clipsPage");
|
|
13
|
+
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
14
|
+
const useClips_1 = require("./useClips");
|
|
15
|
+
const useLiveShop_1 = require("./useLiveShop");
|
|
16
|
+
const navigation_1 = require("./navigation");
|
|
17
|
+
/**
|
|
18
|
+
* Everything the Clips page wires, so the screen stays plain tiles: the reel (`reel`, the reel tile's
|
|
19
|
+
* props) and the bar over it (`header`). Call it from the screen and from each of its tiles' wiring.
|
|
20
|
+
*
|
|
21
|
+
* - **The reel** is the live-selling gateway's video collection (`useClips`): which clips, in what
|
|
22
|
+
* order, the video each plays and its poster. The merchant curates it in the dashboard.
|
|
23
|
+
* - **Each clip's product** comes from Shopify, in one read for the whole reel (`shopify.products.byIds`,
|
|
24
|
+
* at sdk-shopify's `CARD_IMAGE`, the grids' card size, which the product store keeps as the product's
|
|
25
|
+
* card image). A clip whose product the store no longer has is left out (`clipReelItems`): there is
|
|
26
|
+
* nothing to buy from it. Products are kept across reads, so a refreshed reel only waits for products
|
|
27
|
+
* it hasn't seen.
|
|
28
|
+
* - **Loading** until the clips' first read has started (`useClips` reads only once the SDK is ready,
|
|
29
|
+
* and says `loading` only from then: until it has read once, an empty reel is still loading, not "No
|
|
30
|
+
* clips yet.") and while products it shows are on their way. A failed read of either is `error`;
|
|
31
|
+
* Retry reads both again.
|
|
32
|
+
* - **Playback:** only while the page is on screen (`paused` otherwise); one mute setting for the reel,
|
|
33
|
+
* starting muted.
|
|
34
|
+
* - **Buy** opens the variant page (`routes.openVariantPage`): the product page's tiles in a sheet over
|
|
35
|
+
* the reel. **Share** sends the product's link (`productShareUrl`). **Close** goes back to where the
|
|
36
|
+
* shopper came from; the bar's cart opens the Cart (`routes.openCart`).
|
|
37
|
+
*/
|
|
38
|
+
function useClipsPage() {
|
|
39
|
+
const nav = (0, navigation_1.useNavigation)();
|
|
40
|
+
const isFocused = (0, navigation_1.useIsFocused)();
|
|
41
|
+
const { ready: liveSellingReady } = (0, LiveSellingProvider_1.useLiveSelling)();
|
|
42
|
+
const { routes } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
43
|
+
const { ready: shopifyReady } = (0, sdk_shopify_1.useShopify)();
|
|
44
|
+
const { clips, loading: loadingClips, error: clipsError, refresh: refreshClips } = (0, useClips_1.useClips)();
|
|
45
|
+
const { itemCount } = (0, sdk_shopify_1.useCart)();
|
|
46
|
+
// `useClips` starts reading only once the live-selling SDK is ready, and says `loading` only from
|
|
47
|
+
// then: until it has read once, an empty reel is still loading, not "No clips yet.".
|
|
48
|
+
const [clipsReadStarted, setClipsReadStarted] = (0, react_1.useState)(false);
|
|
49
|
+
(0, react_1.useEffect)(() => {
|
|
50
|
+
if (loadingClips)
|
|
51
|
+
setClipsReadStarted(true);
|
|
52
|
+
}, [loadingClips]);
|
|
53
|
+
// The clips' products by id: `null` for one the store no longer has. Kept across reads.
|
|
54
|
+
const [productsById, setProductsById] = (0, react_1.useState)(new Map());
|
|
55
|
+
const [productsFailed, setProductsFailed] = (0, react_1.useState)(false);
|
|
56
|
+
const [productReadCount, setProductReadCount] = (0, react_1.useState)(0);
|
|
57
|
+
const productIds = (0, react_1.useMemo)(() => [...new Set(clips.map(clipsPage_1.clipProductId).filter((id) => !!id))], [clips]);
|
|
58
|
+
const missingIds = productIds.filter((id) => !productsById.has(id));
|
|
59
|
+
const missingKey = missingIds.join(',');
|
|
60
|
+
(0, react_1.useEffect)(() => {
|
|
61
|
+
if (!shopifyReady || !missingKey)
|
|
62
|
+
return;
|
|
63
|
+
const ids = missingKey.split(',');
|
|
64
|
+
let stillMounted = true;
|
|
65
|
+
setProductsFailed(false);
|
|
66
|
+
sdk_shopify_1.shopify.products
|
|
67
|
+
.byIds(ids, { imageTransform: sdk_shopify_1.CARD_IMAGE, keepMissing: true })
|
|
68
|
+
.then((found) => {
|
|
69
|
+
if (!stillMounted)
|
|
70
|
+
return;
|
|
71
|
+
setProductsById((known) => {
|
|
72
|
+
const next = new Map(known);
|
|
73
|
+
ids.forEach((id, index) => { var _a; return next.set(id, (_a = found[index]) !== null && _a !== void 0 ? _a : null); });
|
|
74
|
+
return next;
|
|
75
|
+
});
|
|
76
|
+
})
|
|
77
|
+
.catch(() => {
|
|
78
|
+
if (stillMounted)
|
|
79
|
+
setProductsFailed(true);
|
|
80
|
+
});
|
|
81
|
+
return () => {
|
|
82
|
+
stillMounted = false;
|
|
83
|
+
};
|
|
84
|
+
}, [shopifyReady, missingKey, productReadCount]);
|
|
85
|
+
const reel = (0, react_1.useMemo)(() => (0, clipsPage_1.clipReelItems)(clips, productsById), [clips, productsById]);
|
|
86
|
+
const productOfClip = (0, react_1.useCallback)((clipId) => {
|
|
87
|
+
var _a;
|
|
88
|
+
const clip = clips.find((candidate) => candidate.id === clipId);
|
|
89
|
+
const productId = clip ? (0, clipsPage_1.clipProductId)(clip) : null;
|
|
90
|
+
return productId ? ((_a = productsById.get(productId)) !== null && _a !== void 0 ? _a : null) : null;
|
|
91
|
+
}, [clips, productsById]);
|
|
92
|
+
const [muted, setMuted] = (0, react_1.useState)(true);
|
|
93
|
+
const waitingForProducts = missingIds.length > 0 && !productsFailed;
|
|
94
|
+
const hasReel = reel.length > 0;
|
|
95
|
+
return {
|
|
96
|
+
/** The reel has a clip to show. */
|
|
97
|
+
hasReel,
|
|
98
|
+
/** The page is on show: light status bar glyphs over the video. */
|
|
99
|
+
isFocused,
|
|
100
|
+
reel: {
|
|
101
|
+
clips: reel,
|
|
102
|
+
loading: !liveSellingReady || !clipsReadStarted || loadingClips || waitingForProducts,
|
|
103
|
+
error: !!clipsError || productsFailed,
|
|
104
|
+
paused: !isFocused,
|
|
105
|
+
muted,
|
|
106
|
+
onToggleMute: () => setMuted((wasMuted) => !wasMuted),
|
|
107
|
+
onShare: (clip) => {
|
|
108
|
+
const product = productOfClip(clip.id);
|
|
109
|
+
if (product)
|
|
110
|
+
void (0, useLiveShop_1.shareAddress)((0, sdk_shopify_1.productShareUrl)(product));
|
|
111
|
+
},
|
|
112
|
+
onBuy: (clip) => {
|
|
113
|
+
const product = productOfClip(clip.id);
|
|
114
|
+
if (product)
|
|
115
|
+
routes.openVariantPage({ handle: product.handle }, nav);
|
|
116
|
+
},
|
|
117
|
+
onRetry: () => {
|
|
118
|
+
if (productsFailed)
|
|
119
|
+
setProductReadCount((count) => count + 1);
|
|
120
|
+
void refreshClips();
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
header: {
|
|
124
|
+
cartCount: itemCount,
|
|
125
|
+
onClose: () => nav.goBack(),
|
|
126
|
+
onCart: () => routes.openCart({ itemsYouWon: false }, nav),
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=useClipsPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClipsPage.js","sourceRoot":"","sources":["../../src/react/useClipsPage.ts"],"names":[],"mappings":";;AAqCA,oCA6FC;AAlID;;;;;GAKG;AACH,sDAA+G;AAC/G,iCAAkE;AAElE,4CAA4D;AAE5D,+DAA2E;AAC3E,yCAAsC;AACtC,+CAA6C;AAC7C,6CAAoG;AAEpG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,YAAY;IAC1B,MAAM,GAAG,GAAG,IAAA,0BAAa,GAAiC,CAAC;IAC3D,MAAM,SAAS,GAAG,IAAA,yBAAY,GAAE,CAAC;IACjC,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,IAAA,oCAAc,GAAE,CAAC;IACrD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,wCAAkB,GAAE,CAAC;IACxC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAA,wBAAU,GAAE,CAAC;IAC7C,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IAC9F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,qBAAO,GAAE,CAAC;IAEhC,kGAAkG;IAClG,qFAAqF;IACrF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAChE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,YAAY;YAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,wFA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E,SAAS;YACpB,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE;YAC3B,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,GAAG,CAAC;SAC3D;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* (`LiveSellingProvider`'s `routes` and `shopName`); the route's `streamId` param is read here.
|
|
5
5
|
*/
|
|
6
6
|
import { type Product } from '@tiledev/sdk-shopify';
|
|
7
|
-
import type { LiveAuctionLot, LiveAuctionRound, LiveAuctionWinner, LiveBidRefusal, LiveBidStep } from '../pageTypes';
|
|
7
|
+
import type { LiveAuctionLot, LiveAuctionRound, LiveAuctionWinner, LiveBidRefusal, LiveBidStep, LiveShopLink } from '../pageTypes';
|
|
8
8
|
/** What the Live screen hands the auction. */
|
|
9
9
|
export interface LiveAuctionScreen {
|
|
10
10
|
/**
|
|
@@ -49,7 +49,9 @@ export interface LiveAuctionScreen {
|
|
|
49
49
|
* the winner's name, not who they are. No name is handed out as an email. The win itself reaches the
|
|
50
50
|
* cart's Items You Won from the server; that page reads it each time it opens.
|
|
51
51
|
* - **The lots** for the Shop button's sheet and the card (`lotStateFor`): open (the round is on it),
|
|
52
|
-
* closed (won: on the show's record, or seen here), else upcoming.
|
|
52
|
+
* closed (won: on the show's record, or seen here), else upcoming. A link the host added (0.15.0,
|
|
53
|
+
* `showLinkOf`) sits among them with its price and no state, and a featured link has no round on the
|
|
54
|
+
* card: it is opened, never bid on (`useLiveShop` opens it).
|
|
53
55
|
* - **The store's name** in the bidding rules is `shopName` (old Amore's took the host's, which can be
|
|
54
56
|
* a person's).
|
|
55
57
|
* - **Nothing shows** until the session holds this show's record (`useLiveShow`; never a hidden show the
|
|
@@ -96,7 +98,7 @@ export declare function useLiveAuction({ openItemsYouWon }: LiveAuctionScreen):
|
|
|
96
98
|
};
|
|
97
99
|
/** The auction part of the Shop button: its sheet lists the lots. */
|
|
98
100
|
shopButton: {
|
|
99
|
-
lots: LiveAuctionLot[] | null;
|
|
101
|
+
lots: (LiveShopLink | LiveAuctionLot)[] | null;
|
|
100
102
|
};
|
|
101
103
|
};
|
|
102
104
|
/** What `useLiveAuction` hands the Live screen's auction tiles. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveAuction.d.ts","sourceRoot":"","sources":["../../src/react/useLiveAuction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAuC,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLiveAuction.d.ts","sourceRoot":"","sources":["../../src/react/useLiveAuction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAuC,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAKzF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAiBnI,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,cAAc,CAAC,EAAE,eAAe,EAAE,EAAE,iBAAiB;;;;;;;;;;;;;;;;wBAqFxD,MAAM;;;;;;;;;;;;;;;;;;IAsGf,2EAA2E;;;;IAE3E,qEAAqE;;;;EAGxE;AAED,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -9,6 +9,7 @@ exports.useLiveAuction = useLiveAuction;
|
|
|
9
9
|
const sdk_shopify_1 = require("@tiledev/sdk-shopify");
|
|
10
10
|
const react_1 = require("react");
|
|
11
11
|
const auctionRules_1 = require("../auctionRules");
|
|
12
|
+
const linkLots_1 = require("../linkLots");
|
|
12
13
|
const LiveSellingProvider_1 = require("./LiveSellingProvider");
|
|
13
14
|
const platformSession_1 = require("./platformSession");
|
|
14
15
|
const navigation_1 = require("./navigation");
|
|
@@ -57,7 +58,9 @@ const moneyIn = (currencyCode) => (amount) => (0, sdk_shopify_1.formatMoney)({ a
|
|
|
57
58
|
* the winner's name, not who they are. No name is handed out as an email. The win itself reaches the
|
|
58
59
|
* cart's Items You Won from the server; that page reads it each time it opens.
|
|
59
60
|
* - **The lots** for the Shop button's sheet and the card (`lotStateFor`): open (the round is on it),
|
|
60
|
-
* closed (won: on the show's record, or seen here), else upcoming.
|
|
61
|
+
* closed (won: on the show's record, or seen here), else upcoming. A link the host added (0.15.0,
|
|
62
|
+
* `showLinkOf`) sits among them with its price and no state, and a featured link has no round on the
|
|
63
|
+
* card: it is opened, never bid on (`useLiveShop` opens it).
|
|
61
64
|
* - **The store's name** in the bidding rules is `shopName` (old Amore's took the host's, which can be
|
|
62
65
|
* a person's).
|
|
63
66
|
* - **Nothing shows** until the session holds this show's record (`useLiveShow`; never a hidden show the
|
|
@@ -72,7 +75,7 @@ function useLiveAuction({ openItemsYouWon }) {
|
|
|
72
75
|
const { placeBid, dismissAuctionWin } = session.actions;
|
|
73
76
|
const customer = (0, sdk_shopify_1.useCustomer)();
|
|
74
77
|
const nav = (0, navigation_1.useNavigation)();
|
|
75
|
-
const { routes, shopName } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
78
|
+
const { routes, shopName, canOpenLinks } = (0, LiveSellingProvider_1.useLivePageOptions)();
|
|
76
79
|
const signIn = (0, sdk_shopify_1.useSignIn)({ onOpenSignInPage: (method) => routes.openSignIn(method, nav) });
|
|
77
80
|
const { auction } = session;
|
|
78
81
|
// ─── Which show ────────────────────────────────────────────────────────────────────────────────
|
|
@@ -186,16 +189,18 @@ function useLiveAuction({ openItemsYouWon }) {
|
|
|
186
189
|
return null;
|
|
187
190
|
return session.products.flatMap((item) => {
|
|
188
191
|
var _a;
|
|
192
|
+
// A link the host added: opened, not bid on.
|
|
189
193
|
if (!item.raw)
|
|
190
|
-
return [];
|
|
194
|
+
return item.externalUrl ? [(0, linkLots_1.showLinkOf)(item, { canOpen: canOpenLinks })] : [];
|
|
191
195
|
// The lot's opening bid, joined onto the product from the record by the session.
|
|
192
196
|
const startingBid = (_a = item.baseBidPrice) !== null && _a !== void 0 ? _a : null;
|
|
193
197
|
return [{ product: item.raw, startingBid: startingBid !== null ? money(startingBid) : null, state: stateOf(item.storeProductId) }];
|
|
194
198
|
});
|
|
195
|
-
}, [isAuction, session.products, money, stateOf]);
|
|
199
|
+
}, [isAuction, session.products, money, stateOf, canOpenLinks]);
|
|
196
200
|
const featured = session.activeProduct;
|
|
197
201
|
const auctionRound = (0, react_1.useMemo)(() => {
|
|
198
|
-
|
|
202
|
+
// A featured link is never on the block.
|
|
203
|
+
if (!isAuction || !featured || (!featured.raw && featured.externalUrl))
|
|
199
204
|
return null;
|
|
200
205
|
const state = stateOf(featured.storeProductId);
|
|
201
206
|
const onThisLot = state === 'open';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveAuction.js","sourceRoot":"","sources":["../../src/react/useLiveAuction.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"useLiveAuction.js","sourceRoot":"","sources":["../../src/react/useLiveAuction.ts"],"names":[],"mappings":";;AA6FA,wCAgMC;AA7RD;;;;GAIG;AACH,sDAAyF;AACzF,iCAA0E;AAE1E,kDAA8C;AAC9C,0CAAyC;AAGzC,+DAA2D;AAC3D,uDAAmF;AACnF,6CAQsB;AAetB;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;AAErF,sEAAsE;AACtE,MAAM,OAAO,GAAG,CAAC,YAAoB,EAAE,EAAE,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,IAAA,yBAAW,EAAC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YAC/B,eAAe,EAAE,IAAI,CAAC,aAAa;YACnC,WAAW,EAAE,OAAO;YACpB,SAAS,EAAE,OAAO;SACnB;QACD,cAAc,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;QAClE,UAAU,EAAE;YACV,MAAM,EAAE,SAAS,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,YAAY;YACtD,MAAM,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;SACpC;QACD,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE;QAC1C,2EAA2E;QAC3E,WAAW,EAAE,EAAE,YAAY,EAAE;QAC7B,qEAAqE;QACrE,UAAU,EAAE,EAAE,IAAI,EAAE;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -7,6 +7,14 @@ export interface LiveChatShow {
|
|
|
7
7
|
canComment: boolean;
|
|
8
8
|
/** The show takes reactions (`capabilitiesFor(show).canReact`). */
|
|
9
9
|
canReact: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Opens a link from the chat inside the app, the show in the bubble (`useLivePage`'s `openLink`, 0.15.0).
|
|
12
|
+
* The chat hands over only the host's and moderators' links (the comments tile decides by the line's
|
|
13
|
+
* `source`). Unset, or an app with no `routes.openLink`: the chat's links are words.
|
|
14
|
+
*/
|
|
15
|
+
openLink?: (url: string) => void;
|
|
16
|
+
/** An auction show (`capabilitiesFor(show).canBid`, 0.15.0): the comment box's "Sign in to comment" has a switch per kind of show. */
|
|
17
|
+
auction?: boolean;
|
|
10
18
|
}
|
|
11
19
|
/**
|
|
12
20
|
* The Live screen's chat and reactions. `useLivePage` calls it with what it knows about the show and
|
|
@@ -20,21 +28,40 @@ export interface LiveChatShow {
|
|
|
20
28
|
* account loads, the pin (`session.pinnedComment`), the host's reaction setting
|
|
21
29
|
* (`session.reactionStyle`), and the shopper's own comment and reaction shown at once. Nothing here
|
|
22
30
|
* repeats it.
|
|
23
|
-
* - **Anyone can comment** (Freckled Poppy's rule, decided): a shopper the room has no name
|
|
24
|
-
* for one on their first comment, inside the comment box, and the session saves it on
|
|
25
|
-
* (`chooseViewerName`) before the comment goes out. A signed-in shopper comments under their
|
|
31
|
+
* - **Anyone can comment** (Freckled Poppy's rule, decided): a signed-out shopper the room has no name
|
|
32
|
+
* for is asked for one on their first comment, inside the comment box, and the session saves it on
|
|
33
|
+
* this phone (`chooseViewerName`) before the comment goes out. A signed-in shopper comments under their
|
|
26
34
|
* account's name (`ShopifyLiveSessionProvider`'s `viewerName`); while their account loads (on app
|
|
27
|
-
* open, or a moment after signing in), Send waits.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
35
|
+
* open, or a moment after signing in), Send waits (`accountNameAsk`).
|
|
36
|
+
* - **A signed-in shopper with no first name on their account is asked once** (0.15.0; amore-v2's
|
|
37
|
+
* ENG-686, decided 2026-10-19 by its Head of Engineering: old Amore's and old K-Marie's way). A Shopify
|
|
38
|
+
* sign-in by emailed code leaves the name blank, and since 0.13.0 the room names nobody by their
|
|
39
|
+
* email. The comment box asks for a first and a last name (`commentBox.accountName`, starting from what
|
|
40
|
+
* the account has), saves them on the account (`onSaveAccountName`, through `useAccountName`) and only
|
|
41
|
+
* then sends the comment, so the account, the room and the next show all have it. A giveaway entry
|
|
42
|
+
* asks the same way, so whichever comes first asks, once. A name typed as a guest before signing in
|
|
43
|
+
* isn't used: the account's name governs. A save that didn't go through sends nothing, and the sheet
|
|
44
|
+
* says so. A comment box without the account's fields asks for one name, kept on this phone
|
|
45
|
+
* (`onSaveName`), as in 0.14.0.
|
|
46
|
+
* - **The show's team's names can't be used** (0.15.0; Host and Moderator unless `LiveSellingProvider`'s
|
|
47
|
+
* `blockedNames` says), signed in or not: the sheet says so as the name is typed (`isNameAllowed`), and
|
|
48
|
+
* an account named as one is asked as one with no name. The session refuses them too.
|
|
49
|
+
* - **"Sign in to comment"** (0.15.0; decided 2026-10-19 by amore-v2's Head of Engineering): the comment
|
|
50
|
+
* box's two switches, one for live shows and one for auction shows (`auction` says which applies), off
|
|
51
|
+
* by default. On, a signed-out shopper's tap on the box starts the app's sign-in (sdk-shopify's
|
|
52
|
+
* `useSignIn`; the app's Sign In page is `routes.openSignIn`) in place of the name sheet; back on this
|
|
53
|
+
* screen signed in, the keyboard comes up in the box (`keyboardRequest`). Back still signed out,
|
|
54
|
+
* nothing more happens, now or after a later sign-in elsewhere.
|
|
30
55
|
* - **Reactions** need no sign-in. Which ones is the button tile's; the Live screen hands the same list
|
|
31
56
|
* to the floating reactions.
|
|
32
57
|
* - **A tap on a name** in the chat puts "@name" in the comment box.
|
|
58
|
+
* - **A tap on a host's or moderator's link** opens it inside the app, the show in the bubble
|
|
59
|
+
* (`comments.onOpenLink`, 0.15.0, amore-v2's ENG-656). None without a way to open links.
|
|
33
60
|
* - **Hide Comments** is the shopper's, for this visit to the screen.
|
|
34
61
|
* - **`keyboardUp`**: the comment box's keyboard is up, so the screen lets a tap on the video put it
|
|
35
62
|
* away (iOS has no key for that).
|
|
36
63
|
*/
|
|
37
|
-
export declare function useLiveChat({ onAir, canComment, canReact }: LiveChatShow): {
|
|
64
|
+
export declare function useLiveChat({ onAir, canComment, canReact, openLink, auction }: LiveChatShow): {
|
|
38
65
|
keyboardUp: boolean;
|
|
39
66
|
/** The comment box has the keyboard: the screen lifts its bottom group for it, and for nothing else. */
|
|
40
67
|
typing: boolean;
|
|
@@ -44,16 +71,24 @@ export declare function useLiveChat({ onAir, canComment, canReact }: LiveChatSho
|
|
|
44
71
|
hidden: boolean;
|
|
45
72
|
onToggleHidden: () => void;
|
|
46
73
|
onPressName: ((name: string) => void) | undefined;
|
|
74
|
+
onOpenLink: ((url: string) => void) | undefined;
|
|
47
75
|
};
|
|
48
76
|
commentBox: {
|
|
49
77
|
visible: boolean;
|
|
50
78
|
askForName: boolean;
|
|
79
|
+
accountName: import("../pageTypes").NameOnAccount | null;
|
|
51
80
|
waitingForName: boolean;
|
|
81
|
+
signedOut: boolean;
|
|
82
|
+
auction: boolean;
|
|
83
|
+
keyboardRequest: number;
|
|
84
|
+
onSignInToComment: () => void;
|
|
52
85
|
sending: boolean;
|
|
53
86
|
mention: LiveCommentMention | null;
|
|
54
87
|
nameMaxLength: number;
|
|
55
88
|
onSend: (text: string) => Promise<void>;
|
|
56
89
|
onSaveName: (name: string) => Promise<boolean>;
|
|
90
|
+
onSaveAccountName: (firstName: string, lastName: string) => Promise<boolean>;
|
|
91
|
+
isNameAllowed: (name: string) => boolean;
|
|
57
92
|
onTypingChange: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
58
93
|
};
|
|
59
94
|
reactionButton: {
|