@envive-ai/react-hooks 0.1.0 → 0.1.1
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/{GridInsertionService-CS_bnPh0.cjs → GridInsertionService-C00upKLB.js} +18 -6
- package/dist/{GridInsertionService-CEYo9pGj.js → GridInsertionService-CMJVhD6q.cjs} +31 -1
- package/dist/{bandolier-Bm2xAt_j.cjs → bandolier-3rHPPhkF.cjs} +27 -28
- package/dist/{bandolier-Ble8jEa8.js → bandolier-DpF-HUG_.js} +7 -8
- package/dist/{carpe-Da7b-LCW.cjs → carpe-BG7Q_KCG.cjs} +14 -15
- package/dist/{carpe-W13mhRRP.js → carpe-DLuc07V7.js} +7 -8
- package/dist/contexts/index.cjs +9 -4
- package/dist/contexts/index.d.cts +8 -22
- package/dist/contexts/index.d.ts +11 -26
- package/dist/contexts/index.js +5 -5
- package/dist/contexts-C4Iz162H.cjs +11631 -0
- package/dist/contexts-Dq7tO_0y.js +11459 -0
- package/dist/{coterie-3y0D9ko4.cjs → coterie-DUdvJvAs.cjs} +10 -10
- package/dist/{coterie-DOWcJAYv.js → coterie-FybYN_xE.js} +7 -7
- package/dist/{default-D_KPZdPJ.cjs → default-CKyjzyLc.cjs} +1 -1
- package/dist/{default-C2fEZKXk.js → default-CL94oJfj.js} +1 -1
- package/dist/default-DMtAjA62.cjs +4 -0
- package/dist/default-zcmT2032.js +4 -0
- package/dist/{divIds-DnZNd7rA.cjs → divIds-BOqjn3bE.cjs} +0 -20
- package/dist/{divIds-Bss-btao.js → divIds-Cfp3v_rG.js} +1 -15
- package/dist/{models-DHdb7QWn.js → domInsertionService-BtzuH2Sc.js} +15 -1
- package/dist/{models-ixxUsGL_.cjs → domInsertionService-Cb9814oM.cjs} +20 -0
- package/dist/{dreamlandBaby-DCIsuU9R.cjs → dreamlandBaby-C8yzW4Nl.cjs} +11 -12
- package/dist/{dreamlandBaby-DvSaZGrz.js → dreamlandBaby-WXcbsTXO.js} +7 -8
- package/dist/{fiveCbd-CkOlVby_.cjs → fiveCbd-CZYzZPl3.cjs} +10 -11
- package/dist/{fiveCbd-B1SESMCO.js → fiveCbd-kl6CoxoF.js} +7 -8
- package/dist/{forLoveAndLemons-DmwYZIk0.js → forLoveAndLemons-BD2qh-6B.js} +5 -5
- package/dist/{forLoveAndLemons-CfYPMnKS.cjs → forLoveAndLemons-BNu-PfFB.cjs} +7 -7
- package/dist/{greenpan-Bsl3ir59.cjs → greenpan-D6fDmjU8.cjs} +11 -12
- package/dist/{greenpan-BtOi45lf.js → greenpan-LDDXZTsh.js} +7 -8
- package/dist/{grooveLife-Cmm1PSCL.cjs → grooveLife-CcylXabB.cjs} +12 -13
- package/dist/{grooveLife-6_dtYsRk.js → grooveLife-D-1qfxwj.js} +8 -9
- package/dist/{homegrownCannabis-CO0uY_mp.cjs → homegrownCannabis-BEZzwFlm.cjs} +10 -10
- package/dist/{homegrownCannabis-C-kw-74X.js → homegrownCannabis-BScZhy9v.js} +6 -6
- package/dist/hooks/index.cjs +16 -4
- package/dist/hooks/index.d.cts +256 -45
- package/dist/hooks/index.d.ts +257 -45
- package/dist/hooks/index.js +5 -5
- package/dist/{jackArcher-DdYTIzAV.cjs → jackArcher-BwMClqMP.cjs} +11 -12
- package/dist/{jackArcher-CLVmwwpI.js → jackArcher-cJJVulZ9.js} +7 -8
- package/dist/{jordanCraig-_u3-w4Hp.cjs → jordanCraig-DGsCO2o1.cjs} +19 -20
- package/dist/{jordanCraig-Am-Oor-O.js → jordanCraig-DNDMT0hn.js} +7 -8
- package/dist/{kindredBravely-eWp-ud_E.js → kindredBravely-ROyesnVk.js} +6 -7
- package/dist/{kindredBravely-CWovIDSc.cjs → kindredBravely-wV2XT1r_.cjs} +10 -11
- package/dist/{kutFromTheKloth-Q589bAOC.cjs → kutFromTheKloth-B6GR8tO9.cjs} +11 -12
- package/dist/{kutFromTheKloth-BMV4BuGQ.js → kutFromTheKloth-BCUOHegv.js} +7 -8
- package/dist/{larryAndSerges-CEau764j.cjs → larryAndSerges-CIqB9tKz.cjs} +8 -8
- package/dist/{larryAndSerges-BMUlTgI-.js → larryAndSerges-CqS02fnX.js} +5 -5
- package/dist/{leapsAndRebounds-DHAtRTJD.cjs → leapsAndRebounds-CFj9F_z1.cjs} +12 -13
- package/dist/{leapsAndRebounds-DGMzPO7T.js → leapsAndRebounds-j4YqSvNb.js} +7 -8
- package/dist/{longevityrx-jH2JLhNH.js → longevityrx-9sUQZCVZ.js} +7 -8
- package/dist/{longevityrx-CZW8Hxzi.cjs → longevityrx-C-Yc5LPR.cjs} +10 -11
- package/dist/{lookOptic-BGXP5P_V.js → lookOptic-CQryypdM.js} +7 -8
- package/dist/{lookOptic-CA6RwLbG.cjs → lookOptic-dbaaorhR.cjs} +10 -11
- package/dist/{mantraBrand-Cm9_PBCT.js → mantraBrand-CifBQtHp.js} +8 -9
- package/dist/{mantraBrand-DByNqpnL.cjs → mantraBrand-D5MTZ6Mj.cjs} +23 -24
- package/dist/{medterra-DnPN2ksU.cjs → medterra-BCrXdmFE.cjs} +12 -13
- package/dist/{medterra-B0wxj_PV.js → medterra-DhENCf-m.js} +7 -8
- package/dist/{modells-CoYgkLSp.cjs → modells-C_P_894S.cjs} +10 -11
- package/dist/{modells-Bmz8Ag5M.js → modells-aQrV10D7.js} +7 -8
- package/dist/{pressedFloral-DSKs_oVG.js → pressedFloral-D-amnTQK.js} +7 -8
- package/dist/{pressedFloral-DjBiSoUl.cjs → pressedFloral-DErfwwl0.cjs} +13 -14
- package/dist/{skinPerfection-B_3xzVNS.cjs → skinPerfection-DF6nQXjh.cjs} +10 -11
- package/dist/{skinPerfection-IDrBuAPt.js → skinPerfection-DRVPJp3h.js} +7 -8
- package/dist/{snapSupplements-BStTsdOZ.cjs → snapSupplements-CLZjItJi.cjs} +10 -11
- package/dist/{snapSupplements-BJk5T5ba.js → snapSupplements-Yxs4jgC-.js} +7 -8
- package/dist/{spanx-LwU1zSzq.cjs → spanx-Cpbot5J5.cjs} +14 -15
- package/dist/{spanx-BYg0LE7R.js → spanx-DVDyAyFC.js} +9 -10
- package/dist/{spanxStaging-CfSmuKYB.js → spanxStaging-DAiFEMRU.js} +9 -10
- package/dist/{spanxStaging-OZLV9qix.cjs → spanxStaging-DbaVonN6.cjs} +20 -21
- package/dist/{supergoop-BqPXDnKk.cjs → supergoop-B5VQlsoe.cjs} +11 -12
- package/dist/{supergoop-CIlrHND_.js → supergoop-C4McrZPT.js} +7 -8
- package/dist/types-D4vlfTd0.d.ts +1026 -0
- package/dist/types-DGoFEos_.d.cts +1026 -0
- package/dist/{types-CYNvLeSA.js → types-DZzSQ5a6.js} +33 -33
- package/dist/{types-C4T5UOIW.cjs → types-QJObznro.cjs} +33 -33
- package/dist/{uniqueVintage-B30mOqbH.cjs → uniqueVintage-BLp_UtBR.cjs} +22 -23
- package/dist/{uniqueVintage-CFueJOhO.js → uniqueVintage-CS4TgOJW.js} +7 -8
- package/dist/{venaCbd-DHGZy49P.cjs → venaCbd-BxmadOeJ.cjs} +11 -12
- package/dist/{venaCbd-T0CqVD4k.js → venaCbd-DfnFV7Qp.js} +7 -8
- package/dist/{westonJonBoucher-BdMzs_Yg.cjs → westonJonBoucher-BZdusJgo.cjs} +12 -13
- package/dist/{westonJonBoucher-b4TCQ4ev.js → westonJonBoucher-C0FE4Wup.js} +7 -8
- package/dist/{wineEnthusiast-BqR0i_54.js → wineEnthusiast-CmhNg47M.js} +7 -8
- package/dist/{wineEnthusiast-BLGlOjgr.cjs → wineEnthusiast-DQxdV8Yg.cjs} +12 -13
- package/dist/{wolfMattress-DNGZOivg.cjs → wolfMattress-CqyOUgPB.cjs} +11 -11
- package/dist/{wolfMattress-CyyO-LoC.js → wolfMattress-vMvqmwgI.js} +6 -6
- package/dist/{wolfTactical-3Mm2fvVF.js → wolfTactical-DvqxZtoA.js} +7 -8
- package/dist/{wolfTactical-BmXYlFjr.cjs → wolfTactical-q3TVDP85.cjs} +11 -12
- package/package.json +1 -1
- package/src/atoms/org/org.ts +2 -2
- package/src/hooks/useSearch.tsx +1 -4
- package/src/initialize.ts +1 -1
- package/src/main.tsx +10 -25
- package/dist/chatElementDisplayLocation-CX8fuNao.d.cts +0 -239
- package/dist/chatElementDisplayLocation-CwptS9tx.d.ts +0 -239
- package/dist/contexts-BRjfVq_k.js +0 -5064
- package/dist/contexts-BYArqZtK.cjs +0 -5164
- package/dist/default-CBUq6Q6G.cjs +0 -4
- package/dist/default-CGIFZK6m.js +0 -4
- package/dist/logger-Dln20ans.cjs +0 -25
- package/dist/logger-pdEEY8T2.js +0 -19
- package/src/main.ts +0 -85
- /package/dist/{cdnService-zQfKk3Eb.js → cdnService-CAyO3axV.js} +0 -0
- /package/dist/{cdnService-CZ-aXcY6.cjs → cdnService-DIF1i7VC.cjs} +0 -0
- /package/dist/{custservice-types-CkfxZiHY.cjs → custservice-types-BgjGHCtD.cjs} +0 -0
- /package/dist/{custservice-types-CFIFwZ-r.js → custservice-types-V6FWABp4.js} +0 -0
- /package/dist/{entrypoints-D_JUvkgy.cjs → entrypoints-C8JwiMYA.cjs} +0 -0
- /package/dist/{entrypoints-YLQsbBRD.js → entrypoints-RmIbdYxh.js} +0 -0
- /package/dist/{socialProofClasses-CrQBWdSA.cjs → socialProofClasses-CaA83vI4.cjs} +0 -0
- /package/dist/{socialProofClasses-Bhv2Vulz.js → socialProofClasses-KB7zOMmg.js} +0 -0
- /package/dist/{suggestionBarV2-types-CaovchMP.cjs → suggestionBarV2-types-XHYD3j8E.cjs} +0 -0
- /package/dist/{suggestionBarV2-types-BllzwsBD.js → suggestionBarV2-types-aiQmVx5m.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
require('./
|
|
2
|
-
const require_types = require('./types-
|
|
1
|
+
const require_domInsertionService = require('./domInsertionService-Cb9814oM.cjs');
|
|
2
|
+
const require_types = require('./types-QJObznro.cjs');
|
|
3
3
|
require('./enviveConfigContext-Dfr2VH6u.cjs');
|
|
4
|
-
const require_divIds = require('./divIds-
|
|
5
|
-
const require_suggestionBarV2_types = require('./suggestionBarV2-types-
|
|
6
|
-
const require_cdnService = require('./cdnService-
|
|
7
|
-
const require_default = require('./default-
|
|
4
|
+
const require_divIds = require('./divIds-BOqjn3bE.cjs');
|
|
5
|
+
const require_suggestionBarV2_types = require('./suggestionBarV2-types-XHYD3j8E.cjs');
|
|
6
|
+
const require_cdnService = require('./cdnService-DIF1i7VC.cjs');
|
|
7
|
+
const require_default = require('./default-CKyjzyLc.cjs');
|
|
8
8
|
|
|
9
9
|
//#region src/merchants/wolfMattress/wolfMattress.ts
|
|
10
10
|
const wolfMattressColors = {
|
|
@@ -292,7 +292,7 @@ const wolfMattressPageConfig = () => ({
|
|
|
292
292
|
testId: require_divIds.CHAT_PREVIEW_TESTID,
|
|
293
293
|
insertionPoint: {
|
|
294
294
|
selector: ".productgrid--items",
|
|
295
|
-
insertionType:
|
|
295
|
+
insertionType: require_domInsertionService.DOMInsertionType.AFTER
|
|
296
296
|
}
|
|
297
297
|
},
|
|
298
298
|
chatPreviewPLPHomepage: {
|
|
@@ -301,7 +301,7 @@ const wolfMattressPageConfig = () => ({
|
|
|
301
301
|
testId: require_divIds.CHAT_PREVIEW_TESTID,
|
|
302
302
|
insertionPoint: {
|
|
303
303
|
selector: ".section--canonical",
|
|
304
|
-
insertionType:
|
|
304
|
+
insertionType: require_domInsertionService.DOMInsertionType.BEFORE
|
|
305
305
|
},
|
|
306
306
|
style: {
|
|
307
307
|
marginTop: "60px",
|
|
@@ -318,7 +318,7 @@ const wolfMattressPageConfig = () => ({
|
|
|
318
318
|
testId: require_divIds.CHAT_PREVIEW_TESTID,
|
|
319
319
|
insertionPoint: {
|
|
320
320
|
selector: "section.product__container",
|
|
321
|
-
insertionType:
|
|
321
|
+
insertionType: require_domInsertionService.DOMInsertionType.ADJACENT_BEFORE_END
|
|
322
322
|
},
|
|
323
323
|
style: { marginTop: "16px" }
|
|
324
324
|
},
|
|
@@ -328,7 +328,7 @@ const wolfMattressPageConfig = () => ({
|
|
|
328
328
|
testId: require_divIds.TOP_SUGGESTION_BAR_TESTID,
|
|
329
329
|
insertionPoint: {
|
|
330
330
|
selector: ".affirm-as-low-as:first-of-type",
|
|
331
|
-
insertionType:
|
|
331
|
+
insertionType: require_domInsertionService.DOMInsertionType.AFTER
|
|
332
332
|
},
|
|
333
333
|
style: {
|
|
334
334
|
marginTop: "16px",
|
|
@@ -341,7 +341,7 @@ const wolfMattressPageConfig = () => ({
|
|
|
341
341
|
testId: require_divIds.BOTTOM_SUGGESTION_BAR_TESTID,
|
|
342
342
|
insertionPoint: {
|
|
343
343
|
selector: ".ElementsWidget__header:has(> .header__inner)",
|
|
344
|
-
insertionType:
|
|
344
|
+
insertionType: require_domInsertionService.DOMInsertionType.AFTER
|
|
345
345
|
},
|
|
346
346
|
style: { marginBottom: "16px" }
|
|
347
347
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { ColorNames, OrgShortName, PageVariantTestType, WidgetType, colorVar } from "./types-
|
|
1
|
+
import { DOMInsertionType } from "./domInsertionService-BtzuH2Sc.js";
|
|
2
|
+
import { ColorNames, OrgShortName, PageVariantTestType, WidgetType, colorVar } from "./types-DZzSQ5a6.js";
|
|
3
3
|
import "./enviveConfigContext-CUGLpPGU.js";
|
|
4
|
-
import { BOTTOM_REVIEWS_BAR_ID, BOTTOM_SUGGESTION_BAR_TESTID, CHAT_PREVIEW_CONTAINER_ID, CHAT_PREVIEW_TESTID,
|
|
5
|
-
import { ChatElementDisplayLocation, SuggestionBarLocationForMetrics } from "./suggestionBarV2-types-
|
|
6
|
-
import { CdnService } from "./cdnService-
|
|
7
|
-
import { defaultOrgUIConfig } from "./default-
|
|
4
|
+
import { BOTTOM_REVIEWS_BAR_ID, BOTTOM_SUGGESTION_BAR_TESTID, CHAT_PREVIEW_CONTAINER_ID, CHAT_PREVIEW_TESTID, TOP_SUGGESTION_BAR_PDP_ID, TOP_SUGGESTION_BAR_TESTID } from "./divIds-Cfp3v_rG.js";
|
|
5
|
+
import { ChatElementDisplayLocation, SuggestionBarLocationForMetrics } from "./suggestionBarV2-types-aiQmVx5m.js";
|
|
6
|
+
import { CdnService } from "./cdnService-CAyO3axV.js";
|
|
7
|
+
import { defaultOrgUIConfig } from "./default-CL94oJfj.js";
|
|
8
8
|
|
|
9
9
|
//#region src/merchants/wolfMattress/wolfMattress.ts
|
|
10
10
|
const wolfMattressColors = {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import { ColorNames, OrgShortName, PageVariantTestType, WidgetType } from "./types-
|
|
1
|
+
import { GridInsertionType } from "./GridInsertionService-C00upKLB.js";
|
|
2
|
+
import { DOMInsertionType } from "./domInsertionService-BtzuH2Sc.js";
|
|
3
|
+
import { ColorNames, OrgShortName, PageVariantTestType, WidgetType } from "./types-DZzSQ5a6.js";
|
|
4
4
|
import "./enviveConfigContext-CUGLpPGU.js";
|
|
5
|
-
import { BOTTOM_REVIEWS_BAR_ID, BOTTOM_SUGGESTION_BAR_TESTID, CHAT_PREVIEW_CONTAINER_ID, CHAT_PREVIEW_TESTID,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { defaultOrgUIConfig } from "./default-C2fEZKXk.js";
|
|
5
|
+
import { BOTTOM_REVIEWS_BAR_ID, BOTTOM_SUGGESTION_BAR_TESTID, CHAT_PREVIEW_CONTAINER_ID, CHAT_PREVIEW_TESTID, TOP_SUGGESTION_BAR_PDP_ID, TOP_SUGGESTION_BAR_TESTID } from "./divIds-Cfp3v_rG.js";
|
|
6
|
+
import { ChatElementDisplayLocation, SuggestionBarLocationForMetrics } from "./suggestionBarV2-types-aiQmVx5m.js";
|
|
7
|
+
import { CdnService } from "./cdnService-CAyO3axV.js";
|
|
8
|
+
import { defaultOrgUIConfig } from "./default-CL94oJfj.js";
|
|
10
9
|
|
|
11
10
|
//#region src/merchants/wolfTactical/wolfTactical.ts
|
|
12
11
|
const wolfTacticalColors = {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
require('./
|
|
2
|
-
require('./
|
|
3
|
-
const require_types = require('./types-
|
|
1
|
+
const require_GridInsertionService = require('./GridInsertionService-CMJVhD6q.cjs');
|
|
2
|
+
const require_domInsertionService = require('./domInsertionService-Cb9814oM.cjs');
|
|
3
|
+
const require_types = require('./types-QJObznro.cjs');
|
|
4
4
|
require('./enviveConfigContext-Dfr2VH6u.cjs');
|
|
5
|
-
const require_divIds = require('./divIds-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const require_default = require('./default-D_KPZdPJ.cjs');
|
|
5
|
+
const require_divIds = require('./divIds-BOqjn3bE.cjs');
|
|
6
|
+
const require_suggestionBarV2_types = require('./suggestionBarV2-types-XHYD3j8E.cjs');
|
|
7
|
+
const require_cdnService = require('./cdnService-DIF1i7VC.cjs');
|
|
8
|
+
const require_default = require('./default-CKyjzyLc.cjs');
|
|
10
9
|
|
|
11
10
|
//#region src/merchants/wolfTactical/wolfTactical.ts
|
|
12
11
|
const wolfTacticalColors = {
|
|
@@ -279,7 +278,7 @@ const wolfTacticalPageConfig = () => ({
|
|
|
279
278
|
testId: require_divIds.CHAT_PREVIEW_TESTID,
|
|
280
279
|
insertionPoint: {
|
|
281
280
|
selector: ".grid--uniform",
|
|
282
|
-
insertionType:
|
|
281
|
+
insertionType: require_domInsertionService.DOMInsertionType.AFTER
|
|
283
282
|
},
|
|
284
283
|
gridInsertionType: require_GridInsertionService.GridInsertionType.FIXED_4,
|
|
285
284
|
className: "grid__item grid-product",
|
|
@@ -295,7 +294,7 @@ const wolfTacticalPageConfig = () => ({
|
|
|
295
294
|
testId: require_divIds.CHAT_PREVIEW_TESTID,
|
|
296
295
|
insertionPoint: {
|
|
297
296
|
selector: ".product-block > .rte > p",
|
|
298
|
-
insertionType:
|
|
297
|
+
insertionType: require_domInsertionService.DOMInsertionType.BEFORE
|
|
299
298
|
},
|
|
300
299
|
style: {
|
|
301
300
|
borderTop: `1px solid ${wolfTacticalColors[require_types.ColorNames.BorderLight]}`,
|
|
@@ -311,7 +310,7 @@ const wolfTacticalPageConfig = () => ({
|
|
|
311
310
|
testId: require_divIds.TOP_SUGGESTION_BAR_TESTID,
|
|
312
311
|
insertionPoint: {
|
|
313
312
|
selector: ".product-block--price",
|
|
314
|
-
insertionType:
|
|
313
|
+
insertionType: require_domInsertionService.DOMInsertionType.AFTER
|
|
315
314
|
},
|
|
316
315
|
style: { marginBottom: "20px" }
|
|
317
316
|
},
|
|
@@ -321,7 +320,7 @@ const wolfTacticalPageConfig = () => ({
|
|
|
321
320
|
testId: require_divIds.BOTTOM_SUGGESTION_BAR_TESTID,
|
|
322
321
|
insertionPoint: {
|
|
323
322
|
selector: ".fake-selector",
|
|
324
|
-
insertionType:
|
|
323
|
+
insertionType: require_domInsertionService.DOMInsertionType.AFTER
|
|
325
324
|
}
|
|
326
325
|
}
|
|
327
326
|
}
|
package/package.json
CHANGED
package/src/atoms/org/org.ts
CHANGED
|
@@ -7,14 +7,14 @@ import { GraphQLClient } from "src/adapters/spiffy/commerce/graphql";
|
|
|
7
7
|
import { OrgConfig } from "src/application/models/api/orgConfigResults";
|
|
8
8
|
import { EnvironmentService } from "src/application/service/environmentService";
|
|
9
9
|
import { FeatureFlagService } from "src/application/service/featureFlagService";
|
|
10
|
-
import { FeatureGates } from "src/application/models/featureGates";
|
|
10
|
+
// import { FeatureGates } from "src/application/models/featureGates";
|
|
11
11
|
import { UserIdentityService } from "src/application/service/userIdentityService";
|
|
12
12
|
import { AtomStore, getAtomStore } from "src/atoms/atomStore";
|
|
13
13
|
import { PerfMetricsEvents, logPerfMetricAtom } from "src/atoms/chat";
|
|
14
14
|
import { orgAnalyticsConfigAtom } from "src/atoms/org/orgAnalyticsConfig";
|
|
15
15
|
import { colorsConfigAtom, frontendConfigAtom } from "./graphqlConfig";
|
|
16
16
|
import { getOrgUIConfig } from "./orgUIConfig";
|
|
17
|
-
import Logger from "src/application/logging/logger";
|
|
17
|
+
// import Logger from "src/application/logging/logger";
|
|
18
18
|
import { useEnviveConfig } from "src/contexts/enviveConfigContext";
|
|
19
19
|
|
|
20
20
|
const internalApiKeyAtom = atom<string | undefined>(undefined);
|
package/src/hooks/useSearch.tsx
CHANGED
|
@@ -32,10 +32,7 @@ import { ProductCardConfig } from "src/contexts/types";
|
|
|
32
32
|
import Logger from "src/application/logging/logger";
|
|
33
33
|
import { SearchResult } from "src/application/models/api/search";
|
|
34
34
|
import { SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
|
|
35
|
-
import {
|
|
36
|
-
SearchFilter,
|
|
37
|
-
SelectFilterItem,
|
|
38
|
-
} from "src/types/search-filter-types.ts";
|
|
35
|
+
import { SearchFilter, SelectFilterItem } from "src/types/search-filter-types";
|
|
39
36
|
import { getSearchResultsState, SearchResultsState } from "./utils";
|
|
40
37
|
|
|
41
38
|
export interface SearchResultsHocProps {
|
package/src/initialize.ts
CHANGED
|
@@ -89,7 +89,7 @@ const loadAndInit = async () => {
|
|
|
89
89
|
script.id = "spiffy-injection-script";
|
|
90
90
|
document.head.appendChild(script);
|
|
91
91
|
// #else
|
|
92
|
-
const { initApp } = await import("./main
|
|
92
|
+
const { initApp } = await import("./main");
|
|
93
93
|
await initApp();
|
|
94
94
|
// #endif
|
|
95
95
|
};
|
package/src/main.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { EnvironmentService } from "./application/service/environmentService";
|
|
12
12
|
import { OrgInfo } from "./types";
|
|
13
13
|
import { prepareMerchantPage } from "./application/utils/merchantUtils";
|
|
14
|
-
import { CONTAINER_ID
|
|
14
|
+
import { CONTAINER_ID } from "./config/divIds";
|
|
15
15
|
import { hasParsedVariantInfoAtom } from "./atoms/app/variant";
|
|
16
16
|
import { EnviveConfigProvider } from "./contexts/enviveConfigContext";
|
|
17
17
|
import React from "react";
|
|
@@ -23,16 +23,6 @@ declare global {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const createFloatingButtonContainer = () => {
|
|
27
|
-
const floatingButtonRoot = document.createElement("div");
|
|
28
|
-
floatingButtonRoot.id = FLOATING_BUTTON_ID;
|
|
29
|
-
floatingButtonRoot.style.position = "fixed";
|
|
30
|
-
floatingButtonRoot.style.zIndex = "1000";
|
|
31
|
-
floatingButtonRoot.style.display = "block";
|
|
32
|
-
document.body.appendChild(floatingButtonRoot);
|
|
33
|
-
return floatingButtonRoot;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
26
|
const createReactRoot = () => {
|
|
37
27
|
const containerRoot = document.createElement("div");
|
|
38
28
|
containerRoot.id = CONTAINER_ID;
|
|
@@ -78,13 +68,8 @@ const RootApp: React.FC = () => {
|
|
|
78
68
|
EventsDispatcher.dispatch(SpiffyEvent.APP_INITIALIZED);
|
|
79
69
|
EventsDispatcher.dispatch(SpiffyEvent.CALL_MERCHANT_APP);
|
|
80
70
|
prepareMerchantPage();
|
|
81
|
-
// getAsyncOrgConfig will now use the context
|
|
82
71
|
getAsyncOrgConfig();
|
|
83
72
|
|
|
84
|
-
// container to render the chat
|
|
85
|
-
// const reactContainerRoot = createReactRoot();
|
|
86
|
-
createFloatingButtonContainer();
|
|
87
|
-
|
|
88
73
|
const existing = window[EnvironmentService.getIdentifyingPrefix()] || {};
|
|
89
74
|
window[EnvironmentService.getIdentifyingPrefix()] = {
|
|
90
75
|
...existing,
|
|
@@ -107,15 +92,15 @@ export const initApp = async () => {
|
|
|
107
92
|
const reactContainerRoot = createReactRoot();
|
|
108
93
|
reactContainerRoot.render(
|
|
109
94
|
<EnviveConfigProvider
|
|
110
|
-
amplitudeApiKey={process.env.
|
|
111
|
-
dataResidency={process.env.
|
|
112
|
-
env={process.env.
|
|
113
|
-
baseUrl={process.env.
|
|
114
|
-
reactAppName={process.env.
|
|
115
|
-
cdnUrl={process.env.
|
|
116
|
-
contextSource={process.env.
|
|
117
|
-
orgLevelApiKey={process.env.
|
|
118
|
-
orgShortName={process.env.
|
|
95
|
+
amplitudeApiKey={process.env.VITE_AMPLITUDE_API_KEY || ""}
|
|
96
|
+
dataResidency={process.env.VITE_DATA_RESIDENCY || ""}
|
|
97
|
+
env={process.env.VITE_ENV || ""}
|
|
98
|
+
baseUrl={process.env.VITE_BASE_URL || ""}
|
|
99
|
+
reactAppName={process.env.VITE_REACT_APP_NAME || ""}
|
|
100
|
+
cdnUrl={process.env.VITE_SPIFFY_CDN_URL || ""}
|
|
101
|
+
contextSource={process.env.VITE_CONTEXT_SOURCE || ""}
|
|
102
|
+
orgLevelApiKey={process.env.VITE_SPIFFY_ORG_LEVEL_API_KEY || ""}
|
|
103
|
+
orgShortName={process.env.VITE_ORG_SHORT_NAME || ""}
|
|
119
104
|
>
|
|
120
105
|
<RootApp />
|
|
121
106
|
</EnviveConfigProvider>
|
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import { GenerationParams } from "@spiffy-ai/commerce-api-client";
|
|
2
|
-
|
|
3
|
-
//#region src/application/models/utilityTypes/trim.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Remove spaces from the left side.
|
|
7
|
-
*/
|
|
8
|
-
type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
|
|
9
|
-
/**
|
|
10
|
-
* Remove spaces from the right side.
|
|
11
|
-
*/
|
|
12
|
-
type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
|
|
13
|
-
/**
|
|
14
|
-
* Remove leading and trailing spaces from a string.
|
|
15
|
-
* @example
|
|
16
|
-
* ```
|
|
17
|
-
* import type {Trim} from 'type-fest';
|
|
18
|
-
*
|
|
19
|
-
* Trim<' foo '>
|
|
20
|
-
* //=> 'foo'
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @category String
|
|
24
|
-
* @category Template literal
|
|
25
|
-
*/
|
|
26
|
-
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/application/models/utilityTypes/internal.d.ts
|
|
29
|
-
/**
|
|
30
|
-
* Returns a boolean for whether the string is numeric.
|
|
31
|
-
*
|
|
32
|
-
* This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
33
|
-
*/
|
|
34
|
-
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
35
|
-
/**
|
|
36
|
-
* Returns a boolean for whether the string is lowercased.
|
|
37
|
-
*/
|
|
38
|
-
type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
|
|
39
|
-
/**
|
|
40
|
-
* Returns a boolean for whether the string is upper-cased.
|
|
41
|
-
*/
|
|
42
|
-
type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
|
|
43
|
-
type WordSeparators = '-' | '_' | Whitespace;
|
|
44
|
-
type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/application/models/utilityTypes/splitWords.d.ts
|
|
47
|
-
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
48
|
-
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
49
|
-
/**
|
|
50
|
-
* Split a string (almost) like Lodash's `_.words()` function.
|
|
51
|
-
*
|
|
52
|
-
* - Split on each word that begins with a capital letter.
|
|
53
|
-
* - Split on each {@link WordSeparators}.
|
|
54
|
-
* - Split on numeric sequence.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```
|
|
58
|
-
* type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
|
|
59
|
-
* type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
|
|
60
|
-
* type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
|
|
61
|
-
* type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
|
|
62
|
-
* type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
|
|
63
|
-
* ```
|
|
64
|
-
*
|
|
65
|
-
* @internal
|
|
66
|
-
* @category Change case
|
|
67
|
-
* @category Template literal
|
|
68
|
-
*/
|
|
69
|
-
type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/application/models/utilityTypes/camelCase.d.ts
|
|
72
|
-
/**
|
|
73
|
-
* CamelCase options.
|
|
74
|
-
*
|
|
75
|
-
* @see {@link CamelCase}
|
|
76
|
-
*/
|
|
77
|
-
type CamelCaseOptions = {
|
|
78
|
-
/**
|
|
79
|
-
* Whether to preserved consecutive uppercase letter.
|
|
80
|
-
*
|
|
81
|
-
* @default true
|
|
82
|
-
*/
|
|
83
|
-
preserveConsecutiveUppercase?: boolean;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Convert an array of words to camel-case.
|
|
87
|
-
*/
|
|
88
|
-
type CamelCaseFromArray<Words extends string[], Options extends CamelCaseOptions, OutputString extends string = ''> = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]] ? Options['preserveConsecutiveUppercase'] extends true ? `${Capitalize<FirstWord>}${CamelCaseFromArray<RemainingWords, Options>}` : `${Capitalize<Lowercase<FirstWord>>}${CamelCaseFromArray<RemainingWords, Options>}` : OutputString;
|
|
89
|
-
/**
|
|
90
|
-
* Convert a string literal to camel-case.
|
|
91
|
-
*
|
|
92
|
-
* This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
|
|
93
|
-
*
|
|
94
|
-
* By default, consecutive uppercase letter are preserved. See {@link CamelCaseOptions.preserveConsecutiveUppercase preserveConsecutiveUppercase} option to change this behaviour.
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* ```
|
|
98
|
-
* import type {CamelCase} from 'type-fest';
|
|
99
|
-
*
|
|
100
|
-
* // Simple
|
|
101
|
-
*
|
|
102
|
-
* const someVariable: CamelCase<'foo-bar'> = 'fooBar';
|
|
103
|
-
*
|
|
104
|
-
* // Advanced
|
|
105
|
-
*
|
|
106
|
-
* type CamelCasedProperties<T> = {
|
|
107
|
-
* [K in keyof T as CamelCase<K>]: T[K]
|
|
108
|
-
* };
|
|
109
|
-
*
|
|
110
|
-
* interface RawOptions {
|
|
111
|
-
* 'dry-run': boolean;
|
|
112
|
-
* 'full_family_name': string;
|
|
113
|
-
* foo: number;
|
|
114
|
-
* BAR: string;
|
|
115
|
-
* QUZ_QUX: number;
|
|
116
|
-
* 'OTHER-FIELD': boolean;
|
|
117
|
-
* }
|
|
118
|
-
*
|
|
119
|
-
* const dbResult: CamelCasedProperties<RawOptions> = {
|
|
120
|
-
* dryRun: true,
|
|
121
|
-
* fullFamilyName: 'bar.js',
|
|
122
|
-
* foo: 123,
|
|
123
|
-
* bar: 'foo',
|
|
124
|
-
* quzQux: 6,
|
|
125
|
-
* otherField: false
|
|
126
|
-
* };
|
|
127
|
-
* ```
|
|
128
|
-
*
|
|
129
|
-
* @category Change case
|
|
130
|
-
* @category Template literal
|
|
131
|
-
*/
|
|
132
|
-
type CamelCase<Type, Options extends CamelCaseOptions = {
|
|
133
|
-
preserveConsecutiveUppercase: true;
|
|
134
|
-
}> = Type extends string ? string extends Type ? Type : Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> : Type;
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/application/models/utilityTypes/unknownArray.d.ts
|
|
137
|
-
/**
|
|
138
|
-
* Represents an array with `unknown` value.
|
|
139
|
-
*
|
|
140
|
-
* Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* ```
|
|
144
|
-
* import type {UnknownArray} from 'type-fest';
|
|
145
|
-
*
|
|
146
|
-
* type IsArray<T> = T extends UnknownArray ? true : false;
|
|
147
|
-
*
|
|
148
|
-
* type A = IsArray<['foo']>;
|
|
149
|
-
* //=> true
|
|
150
|
-
*
|
|
151
|
-
* type B = IsArray<readonly number[]>;
|
|
152
|
-
* //=> true
|
|
153
|
-
*
|
|
154
|
-
* type C = IsArray<string>;
|
|
155
|
-
* //=> false
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* @category Type
|
|
159
|
-
* @category Array
|
|
160
|
-
*/
|
|
161
|
-
type UnknownArray = readonly unknown[];
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
|
|
164
|
-
/**
|
|
165
|
-
* Convert object properties to camel case recursively.
|
|
166
|
-
*
|
|
167
|
-
* This can be useful when, for example, converting some API types from a different style.
|
|
168
|
-
*
|
|
169
|
-
* @see CamelCasedProperties
|
|
170
|
-
* @see CamelCase
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* ```
|
|
174
|
-
* import type {CamelCasedPropertiesDeep} from 'type-fest';
|
|
175
|
-
*
|
|
176
|
-
* interface User {
|
|
177
|
-
* UserId: number;
|
|
178
|
-
* UserName: string;
|
|
179
|
-
* }
|
|
180
|
-
*
|
|
181
|
-
* interface UserWithFriends {
|
|
182
|
-
* UserInfo: User;
|
|
183
|
-
* UserFriends: User[];
|
|
184
|
-
* }
|
|
185
|
-
*
|
|
186
|
-
* const result: CamelCasedPropertiesDeep<UserWithFriends> = {
|
|
187
|
-
* userInfo: {
|
|
188
|
-
* userId: 1,
|
|
189
|
-
* userName: 'Tom',
|
|
190
|
-
* },
|
|
191
|
-
* userFriends: [
|
|
192
|
-
* {
|
|
193
|
-
* userId: 2,
|
|
194
|
-
* userName: 'Jerry',
|
|
195
|
-
* },
|
|
196
|
-
* {
|
|
197
|
-
* userId: 3,
|
|
198
|
-
* userName: 'Spike',
|
|
199
|
-
* },
|
|
200
|
-
* ],
|
|
201
|
-
* };
|
|
202
|
-
* ```
|
|
203
|
-
*
|
|
204
|
-
* @category Change case
|
|
205
|
-
* @category Template literal
|
|
206
|
-
* @category Object
|
|
207
|
-
*/
|
|
208
|
-
type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
|
|
209
|
-
preserveConsecutiveUppercase: true;
|
|
210
|
-
}> = Value extends Function ? Value : Value extends UnknownArray ? CamelCasedPropertiesArrayDeep<Value> : Value extends Set<infer U> ? Set<CamelCasedPropertiesDeep<U, Options>> : { [K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options> };
|
|
211
|
-
type CamelCasedPropertiesArrayDeep<Value extends UnknownArray> = Value extends [] ? [] : Value extends [infer U, ...infer V] ? [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [infer U, ...infer V] ? readonly [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? readonly [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends Array<infer U> ? Array<CamelCasedPropertiesDeep<U>> : Value extends ReadonlyArray<infer U> ? ReadonlyArray<CamelCasedPropertiesDeep<U>> : never;
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region src/application/models/api/generationParams.d.ts
|
|
214
|
-
interface GenerationParams$1 extends CamelCasedPropertiesDeep<GenerationParams> {}
|
|
215
|
-
//#endregion
|
|
216
|
-
//#region src/application/models/chatElementDisplayLocation.d.ts
|
|
217
|
-
declare enum ChatElementDisplayLocation {
|
|
218
|
-
IN_CHAT = "in_chat",
|
|
219
|
-
CHAT_PREVIEW = "chat_preview",
|
|
220
|
-
FLOATING_BUTTON = "floating_button",
|
|
221
|
-
HELP_ME_CHOOSE = "help_me_choose",
|
|
222
|
-
PLP_IMAGE_BANNER = "plp_image_banner",
|
|
223
|
-
TOP_REVIEWS_SNIPPET = "top_reviews_snippet",
|
|
224
|
-
BOTTOM_REVIEWS_SNIPPET = "bottom_reviews_snippet",
|
|
225
|
-
BLOCK_BACK_BUTTON = "block_back_button",
|
|
226
|
-
SWITCH_TO_AGENT = "switch_to_agent",
|
|
227
|
-
CONVERSATIONAL_SEARCH = "conversational_search",
|
|
228
|
-
GLOBAL_SEARCH_ENTRYPOINT = "global_search_entrypoint",
|
|
229
|
-
SEARCH_NAV_ENTRYPOINT = "search_nav_entrypoint",
|
|
230
|
-
SEARCH_PROMPT = "search_prompt",
|
|
231
|
-
SEARCH_PROMPT_BUTTON = "search_prompt_button",
|
|
232
|
-
PRODUCT_GRID = "product_grid",
|
|
233
|
-
UNSPECIFIED = "unspecified",
|
|
234
|
-
FILTER_MODAL = "filter_modal",
|
|
235
|
-
PROMPT_CARD = "prompt_card",
|
|
236
|
-
WINDOW_API_CALL = "window_api_call",
|
|
237
|
-
}
|
|
238
|
-
//#endregion
|
|
239
|
-
export { CamelCasedPropertiesDeep, ChatElementDisplayLocation, GenerationParams$1 as GenerationParams };
|