@depict-ai/react-ui 2.0.12 → 2.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/ES10/index.cjs +51 -15
- package/ES10/index.d.ts +38 -2
- package/ES10/index.js +52 -16
- package/dist/main.js +527 -0
- package/dist/module.js +510 -0
- package/dist/styles/components/PLP/Buttons.scss +181 -0
- package/dist/styles/components/PLP/MorphingSign.scss +30 -0
- package/dist/styles/components/PLP/PLPResults.scss +26 -0
- package/dist/styles/components/PLP/ProductListingPage.scss +168 -0
- package/dist/styles/components/PLP/ScrollStatus.scss +31 -0
- package/dist/styles/components/PLP/SelectedFilters.scss +82 -0
- package/dist/styles/components/PLP/SlidableItems.scss +121 -0
- package/dist/styles/components/PLP/SortAndFilter/FloatingButtons.scss +84 -0
- package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +800 -0
- package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +158 -0
- package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +152 -0
- package/dist/styles/components/PLP/Toast.scss +59 -0
- package/dist/styles/components/PLP/index.scss +51 -0
- package/dist/styles/components/category/BreadCrumbs.scss +32 -0
- package/dist/styles/components/category/CategoryTitle.scss +40 -0
- package/dist/styles/components/category/QuickLinks.scss +80 -0
- package/dist/styles/components/category/index.scss +23 -0
- package/dist/styles/components/search/Autocomplete.scss +197 -0
- package/dist/styles/components/search/CategorySuggestions.scss +82 -0
- package/dist/styles/components/search/InstantCard.scss +122 -0
- package/dist/styles/components/search/InstantResults.scss +12 -0
- package/dist/styles/components/search/PreviousSearches.scss +90 -0
- package/dist/styles/components/search/QueryInput.scss +189 -0
- package/dist/styles/components/search/SearchModal.scss +101 -0
- package/dist/styles/components/search/SearchRecommendations.scss +28 -0
- package/dist/styles/components/search/ShowingResultsFor.scss +13 -0
- package/dist/styles/components/search/index.scss +40 -0
- package/dist/styles/default.css +1 -0
- package/dist/styles/helpers/custom_input.scss +194 -0
- package/dist/styles/helpers/supports-hover.scss +7 -0
- package/dist/styles/helpers/utils.scss +90 -0
- package/dist/styles/plain-css-fallback-styling.css +1 -1
- package/dist/styles/variables.scss +61 -0
- package/latest/index.cjs +51 -15
- package/latest/index.d.ts +38 -2
- package/latest/index.js +52 -16
- package/package.json +7 -7
- package/server/ES10/index.cjs +8 -8
- package/server/ES10/index.d.ts +38 -2
- package/server/ES10/index.js +8 -8
- package/server/latest/index.cjs +8 -8
- package/server/latest/index.d.ts +38 -2
- package/server/latest/index.js +8 -8
package/latest/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { add_to_version_info as $2GFvs$add_to_version_info, catchify as $2GFvs$catchify, queueMacroTask as $2GFvs$queueMacroTask, instant_exec_on_suspect_history_change as $2GFvs$instant_exec_on_suspect_history_change, derror as $2GFvs$derror } from "@depict-ai/utilishared/latest";
|
|
2
2
|
import { CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, DepictAPI as $2GFvs$DepictAPI, DepictSearch as $2GFvs$DepictSearch, DepictCategory as $2GFvs$DepictCategory, get_search_query_updating_blocked_signal as $2GFvs$get_search_query_updating_blocked_signal, SearchPage as $2GFvs$SearchPage, defaultColsAtSize as $2GFvs$defaultColsAtSize, defaultGridSpacing as $2GFvs$defaultGridSpacing, ProductCardError as $2GFvs$ProductCardError, CategoryPage as $2GFvs$CategoryPage, defaultCategoryTitlePlugin as $2GFvs$defaultCategoryTitlePlugin, BreadCrumbs as $2GFvs$BreadCrumbs, QuickLinks as $2GFvs$QuickLinks, ImagePlaceholder as $2GFvs$ImagePlaceholder, TextPlaceholder as $2GFvs$TextPlaceholder, RecommendationSlider as $2GFvs$RecommendationSlider, RecommendationGrid as $2GFvs$RecommendationGrid, open_modal_with_alignment as $2GFvs$open_modal_with_alignment, SearchField as $2GFvs$SearchField, fetchDepictRecommendations as $2GFvs$fetchDepictRecommendations } from "@depict-ai/ui/latest";
|
|
3
|
-
import { untrack as $2GFvs$untrack, createRoot as $2GFvs$createRoot, createEffect as $2GFvs$createEffect, createMemo as $2GFvs$createMemo, createComponent as $2GFvs$createComponent, Show as $2GFvs$Show, createSignal as $2GFvs$createSignal, createComputed as $2GFvs$createComputed, onCleanup as $2GFvs$onCleanup, getOwner as $2GFvs$getOwner, runWithOwner as $2GFvs$runWithOwner, on as $2GFvs$on } from "solid-js";
|
|
3
|
+
import { untrack as $2GFvs$untrack, createRoot as $2GFvs$createRoot, createEffect as $2GFvs$createEffect, createMemo as $2GFvs$createMemo, createComponent as $2GFvs$createComponent, Show as $2GFvs$Show, createSignal as $2GFvs$createSignal, createComputed as $2GFvs$createComputed, onCleanup as $2GFvs$onCleanup, getOwner as $2GFvs$getOwner, runWithOwner as $2GFvs$runWithOwner, on as $2GFvs$on, mapArray as $2GFvs$mapArray } from "solid-js";
|
|
4
4
|
import { createElement as $2GFvs$createElement, Fragment as $2GFvs$Fragment, useEffect as $2GFvs$useEffect, useState as $2GFvs$useState, useRef as $2GFvs$useRef, forwardRef as $2GFvs$forwardRef, Component as $2GFvs$Component, useCallback as $2GFvs$useCallback } from "react";
|
|
5
5
|
import { defaultLocale as $2GFvs$defaultLocale } from "@depict-ai/ui/locales/latest";
|
|
6
6
|
import { render as $2GFvs$render, hydrate as $2GFvs$hydrate, isServer as $2GFvs$isServer } from "solid-js/web";
|
|
@@ -14,7 +14,7 @@ import { renderToString as $2GFvs$renderToString } from "react-dom/server";
|
|
|
14
14
|
// Note, if you add an export here, also add one in src-server/main.ts
|
|
15
15
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
16
16
|
register_es_version("react-ui", "latest");
|
|
17
|
-
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "2.
|
|
17
|
+
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "2.1.1";
|
|
18
18
|
const $42858f023ef23dab$export$8e769ad4338a911e = {
|
|
19
19
|
usedLocale: $2GFvs$createSignal((0, $2GFvs$defaultLocale)),
|
|
20
20
|
search_instances: new Map(),
|
|
@@ -467,8 +467,8 @@ class $d5c9e1f3545b4984$export$d0f82e3ef89b1f22 extends (0, $2GFvs$Component) {
|
|
|
467
467
|
return this.props.children;
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
async function $
|
|
471
|
-
|
|
470
|
+
async function $bcf84a32dc612a43$export$32024253978abdc7({
|
|
471
|
+
component_props: component_props,
|
|
472
472
|
component_portals: component_portals,
|
|
473
473
|
set_portals: set_portals,
|
|
474
474
|
get_react_template: get_react_template
|
|
@@ -485,9 +485,7 @@ async function $75f1064c8b836348$export$79c79419c1ef0081({
|
|
|
485
485
|
const [react_template, set_react_template] = $2GFvs$useState(() => $2GFvs$untrack(get_react_template));
|
|
486
486
|
call_when_template_changes = set_react_template;
|
|
487
487
|
return react_template(props);
|
|
488
|
-
},
|
|
489
|
-
display: display
|
|
490
|
-
});
|
|
488
|
+
}, component_props);
|
|
491
489
|
const reactProductCardInErrorBoundary = $2GFvs$jsx((0, $d5c9e1f3545b4984$export$d0f82e3ef89b1f22), {
|
|
492
490
|
children: reactProductCard,
|
|
493
491
|
on_error: error => $2GFvs$runWithOwner(owner, () => {
|
|
@@ -515,6 +513,28 @@ async function $75f1064c8b836348$export$79c79419c1ef0081({
|
|
|
515
513
|
await react_has_ran_hooks; // After React has created elements it still takes some time to actually connect the refs and run the hooks. We don't want to replace placeholders before then.
|
|
516
514
|
return [solid_container];
|
|
517
515
|
}
|
|
516
|
+
function $73f59b087b0180d0$export$84006927f874e911(blocks, component_portals, set_portals) {
|
|
517
|
+
return $2GFvs$mapArray(blocks, block => {
|
|
518
|
+
if (!block) return block;
|
|
519
|
+
return {
|
|
520
|
+
get span_columns() {
|
|
521
|
+
return block?.spanColumns;
|
|
522
|
+
},
|
|
523
|
+
get span_rows() {
|
|
524
|
+
return block?.spanRows;
|
|
525
|
+
},
|
|
526
|
+
get position() {
|
|
527
|
+
return block?.position;
|
|
528
|
+
},
|
|
529
|
+
content: () => $bcf84a32dc612a43$export$32024253978abdc7({
|
|
530
|
+
get_react_template: () => block.content,
|
|
531
|
+
component_portals: component_portals,
|
|
532
|
+
set_portals: set_portals,
|
|
533
|
+
component_props: {}
|
|
534
|
+
})
|
|
535
|
+
};
|
|
536
|
+
});
|
|
537
|
+
}
|
|
518
538
|
const $4a678f0c87b12e78$var$rendered_components_with_state_key = new Set();
|
|
519
539
|
function $4a678f0c87b12e78$export$a54ec244c8863715(props) {
|
|
520
540
|
return $c83ba9ab79386687$export$f6e64e17bd69eeef({
|
|
@@ -562,6 +582,7 @@ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
|
|
|
562
582
|
return $2GFvs$createMemo(() => {
|
|
563
583
|
const stateKey = $2GFvs$untrack(() => props.stateKey);
|
|
564
584
|
if ($4a678f0c87b12e78$var$rendered_components_with_state_key.has(stateKey)) throw new Error(`You have multiple SearchPage components with the same stateKey: ${stateKey}. Each SearchPage component must have a unique stateKey.`);
|
|
585
|
+
const transformed_content_blocks = $73f59b087b0180d0$export$84006927f874e911(() => props.contentBlocksByRow, component_portals, set_portals);
|
|
565
586
|
$4a678f0c87b12e78$var$rendered_components_with_state_key.add(stateKey);
|
|
566
587
|
$2GFvs$onCleanup(() => $4a678f0c87b12e78$var$rendered_components_with_state_key.delete(stateKey));
|
|
567
588
|
return $2GFvs$SearchPage({
|
|
@@ -576,12 +597,17 @@ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
|
|
|
576
597
|
return props.gridSpacing ?? (0, $2GFvs$defaultGridSpacing);
|
|
577
598
|
},
|
|
578
599
|
depict_search: depict_search(),
|
|
579
|
-
product_card_template: display => $
|
|
580
|
-
|
|
600
|
+
product_card_template: display => $bcf84a32dc612a43$export$32024253978abdc7({
|
|
601
|
+
component_props: {
|
|
602
|
+
display: display
|
|
603
|
+
},
|
|
581
604
|
get_react_template: () => props.productCard,
|
|
582
605
|
component_portals: component_portals,
|
|
583
606
|
set_portals: set_portals
|
|
584
|
-
})
|
|
607
|
+
}),
|
|
608
|
+
get content_blocks_by_row() {
|
|
609
|
+
return transformed_content_blocks();
|
|
610
|
+
}
|
|
585
611
|
});
|
|
586
612
|
});
|
|
587
613
|
}
|
|
@@ -640,6 +666,7 @@ function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
|
|
|
640
666
|
if ($48d7f568740a317d$var$rendered_components_with_state_key.has(stateKey)) throw new Error(`You have multiple CategoryPage components with the same stateKey: ${stateKey}. Each CategoryPage component must have a unique stateKey.`);
|
|
641
667
|
$48d7f568740a317d$var$rendered_components_with_state_key.add(stateKey);
|
|
642
668
|
$2GFvs$onCleanup(() => $48d7f568740a317d$var$rendered_components_with_state_key.delete(stateKey));
|
|
669
|
+
const transformed_content_blocks = $73f59b087b0180d0$export$84006927f874e911(() => props.contentBlocksByRow, component_portals, set_portals);
|
|
643
670
|
return $2GFvs$CategoryPage({
|
|
644
671
|
depict_category: depict_category(),
|
|
645
672
|
get cols_at_size() {
|
|
@@ -655,8 +682,13 @@ function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
|
|
|
655
682
|
get show_quicklinks() {
|
|
656
683
|
return props.showQuicklinks;
|
|
657
684
|
},
|
|
658
|
-
|
|
659
|
-
|
|
685
|
+
get content_blocks_by_row() {
|
|
686
|
+
return transformed_content_blocks();
|
|
687
|
+
},
|
|
688
|
+
product_card_template: display => $bcf84a32dc612a43$export$32024253978abdc7({
|
|
689
|
+
component_props: {
|
|
690
|
+
display: display
|
|
691
|
+
},
|
|
660
692
|
get_react_template: () => props.productCard,
|
|
661
693
|
component_portals: component_portals,
|
|
662
694
|
set_portals: set_portals
|
|
@@ -734,8 +766,10 @@ function $4fd5dc0e231a60d9$export$5abb40edfde2a843(props, set_portals) {
|
|
|
734
766
|
get recommendations() {
|
|
735
767
|
return props.recommendations;
|
|
736
768
|
},
|
|
737
|
-
product_card_template: display => $
|
|
738
|
-
|
|
769
|
+
product_card_template: display => $bcf84a32dc612a43$export$32024253978abdc7({
|
|
770
|
+
component_props: {
|
|
771
|
+
display: display
|
|
772
|
+
},
|
|
739
773
|
get_react_template: () => props.productCard,
|
|
740
774
|
component_portals: component_portals,
|
|
741
775
|
set_portals: set_portals
|
|
@@ -763,8 +797,10 @@ function $8bee51f55543fe0c$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
763
797
|
display: display
|
|
764
798
|
})))
|
|
765
799
|
};
|
|
766
|
-
return $
|
|
767
|
-
|
|
800
|
+
return $bcf84a32dc612a43$export$32024253978abdc7({
|
|
801
|
+
component_props: {
|
|
802
|
+
display: display
|
|
803
|
+
},
|
|
768
804
|
get_react_template: () => props.productCard,
|
|
769
805
|
component_portals: component_portals,
|
|
770
806
|
set_portals: set_portals
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/react-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "ES10/index.d.ts",
|
|
@@ -136,10 +136,10 @@
|
|
|
136
136
|
"@babel/runtime": "latest",
|
|
137
137
|
"@babel/runtime-corejs3": "latest",
|
|
138
138
|
"@depict-ai/dpc": "^1.0.42",
|
|
139
|
-
"@depict-ai/plp-styling": "^1.2.
|
|
140
|
-
"@depict-ai/ui": "^2.
|
|
141
|
-
"@depict-ai/utilishared": "^1.0.
|
|
142
|
-
"solid-js": "^1.
|
|
139
|
+
"@depict-ai/plp-styling": "^1.2.6",
|
|
140
|
+
"@depict-ai/ui": "^2.1.1",
|
|
141
|
+
"@depict-ai/utilishared": "^1.0.47",
|
|
142
|
+
"solid-js": "^1.8.1"
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
145
145
|
"react": ">= 16.14.0",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"@babel/core": "latest",
|
|
151
151
|
"@babel/preset-env": "latest",
|
|
152
152
|
"@babel/preset-typescript": "latest",
|
|
153
|
-
"@depict-ai/plp-styling": "^1.2.
|
|
153
|
+
"@depict-ai/plp-styling": "^1.2.6",
|
|
154
154
|
"@jest/globals": "^29.3.1",
|
|
155
155
|
"@parcel/babel-preset-env": "^2.9.3",
|
|
156
156
|
"@parcel/transformer-sass": "^2.9.3",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"@types/node": "^18.11.11",
|
|
159
159
|
"@types/react": "^18.0.26",
|
|
160
160
|
"@types/react-dom": "^18.0.10",
|
|
161
|
-
"babel-preset-solid": "
|
|
161
|
+
"babel-preset-solid": "^1.8.2",
|
|
162
162
|
"jest": "^29.3.1",
|
|
163
163
|
"jest-environment-jsdom": "^29.3.1",
|
|
164
164
|
"jest-haste-map": "^29.3.1",
|
package/server/ES10/index.cjs
CHANGED
|
@@ -73,9 +73,9 @@ class $e9048b15cf1e8792$export$d0f82e3ef89b1f22 extends (0, $aNCHr$react.Compone
|
|
|
73
73
|
return this.props.children;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
async function $
|
|
76
|
+
async function $3441d987b5ea85cb$export$32024253978abdc7(_ref) {
|
|
77
77
|
let {
|
|
78
|
-
|
|
78
|
+
component_props: component_props,
|
|
79
79
|
component_portals: component_portals,
|
|
80
80
|
set_portals: set_portals,
|
|
81
81
|
get_react_template: get_react_template
|
|
@@ -92,9 +92,7 @@ async function $99405615baa3d774$export$79c79419c1ef0081(_ref) {
|
|
|
92
92
|
const [react_template, set_react_template] = $aNCHr$react.useState(() => $aNCHr$solidjs.untrack(get_react_template));
|
|
93
93
|
call_when_template_changes = set_react_template;
|
|
94
94
|
return react_template(props);
|
|
95
|
-
},
|
|
96
|
-
display: display
|
|
97
|
-
});
|
|
95
|
+
}, component_props);
|
|
98
96
|
const reactProductCardInErrorBoundary = $aNCHr$reactjsxruntime.jsx((0, $e9048b15cf1e8792$export$d0f82e3ef89b1f22), {
|
|
99
97
|
children: reactProductCard,
|
|
100
98
|
on_error: error => $aNCHr$solidjs.runWithOwner(owner, () => {
|
|
@@ -140,8 +138,10 @@ function $27d583018ba6e604$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
140
138
|
display: display
|
|
141
139
|
})))
|
|
142
140
|
};
|
|
143
|
-
return $
|
|
144
|
-
|
|
141
|
+
return $3441d987b5ea85cb$export$32024253978abdc7({
|
|
142
|
+
component_props: {
|
|
143
|
+
display: display
|
|
144
|
+
},
|
|
145
145
|
get_react_template: () => props.productCard,
|
|
146
146
|
component_portals: component_portals,
|
|
147
147
|
set_portals: set_portals
|
|
@@ -170,7 +170,7 @@ function $27d583018ba6e604$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
const $efbdd2dab4314170$export$83d89fbfd8236492 = "2.
|
|
173
|
+
const $efbdd2dab4314170$export$83d89fbfd8236492 = "2.1.1";
|
|
174
174
|
function $202459d454907b31$export$9fac37a9c21c2f3b(props) {
|
|
175
175
|
return props.children;
|
|
176
176
|
}
|
package/server/ES10/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DPC } from "@depict-ai/dpc/ES10";
|
|
2
|
-
import React, { PropsWithChildren, ReactNode, ReactPortal, ReactElement } from "react";
|
|
2
|
+
import React, { PropsWithChildren, ReactNode, FC, ReactPortal, ReactElement } from "react";
|
|
3
3
|
import { BaseProviderConfig, BaseSearchProviderConfig, BaseCategoryProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui/ES10";
|
|
4
4
|
import { Locale } from "@depict-ai/ui/locales/ES10";
|
|
5
5
|
import { Display, ModernDisplay } from "@depict-ai/utilishared/ES10";
|
|
6
|
-
export const version = "2.
|
|
6
|
+
export const version = "2.1.1";
|
|
7
7
|
interface UsePerformanceClientReturn {
|
|
8
8
|
dpc: DPC;
|
|
9
9
|
}
|
|
@@ -172,11 +172,43 @@ export interface DepictProductCardProps<T extends Display> {
|
|
|
172
172
|
* Depict product card to use for rendering products.
|
|
173
173
|
*/
|
|
174
174
|
export type DepictProductCard<T extends Display> = (props: DepictProductCardProps<T>) => ReactNode;
|
|
175
|
+
/**
|
|
176
|
+
* The interface for a content block.
|
|
177
|
+
* Please make sure that you don't have content blocks overlap as that will cause undefined behavior.
|
|
178
|
+
* The height of the content block will be the height of the tallest item in a row, so if there are no products in a row the content block needs to "bring its own height".
|
|
179
|
+
* If you need to load any data in the content block, please make sure to return a placeholder while you're doing so, to avoid layout shifts and ensure scroll restoration works correctly.
|
|
180
|
+
*
|
|
181
|
+
* - `spanColumns`: How many columns the block should span. This will be capped to the number of columns available.
|
|
182
|
+
* - `spanRows`: How many rows the block should span.
|
|
183
|
+
* - `position`: Where the block should be positioned. Can be `left`, `center` or `right`.
|
|
184
|
+
* - `content`: The content to render in the block - please provide a React component.
|
|
185
|
+
*/
|
|
186
|
+
type ReactContentBlock = {
|
|
187
|
+
spanColumns: number;
|
|
188
|
+
spanRows: number;
|
|
189
|
+
position: "left" | "center" | "right";
|
|
190
|
+
content: FC;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* A sparse array containing content blocks to show (or an empty slot or undefined if there's no block at that index). See ReactContentBlock for how a content block looks like. The index is the row where the content block should be shown.
|
|
194
|
+
* For example, to create a block on row 1 and 3 you'd do `[, block1, , block2]`.
|
|
195
|
+
* Alternatively:
|
|
196
|
+
* ```
|
|
197
|
+
* const blocks = [];
|
|
198
|
+
* blocks[1] = block1;
|
|
199
|
+
* blocks[3] = block2;
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
type ReactContentBlocksByRow = (undefined | ReactContentBlock)[];
|
|
175
203
|
interface SearchPageConfig<T extends Display> extends BaseSearchPageConfig, PLPConfig<T> {
|
|
176
204
|
/**
|
|
177
205
|
* When using multiple search instances on the same page, you need to set a unique stateKey for each one. We recommend using an incrementing number, such as "1", "2", "3", etc. To associate a modal with a SearchPage keyed component, set the same stateKey on both. If no stateKey is provided, the "default" instance will be used.
|
|
178
206
|
*/
|
|
179
207
|
stateKey?: string;
|
|
208
|
+
/**
|
|
209
|
+
* See JSDoc of ReactContentBlocksByRow
|
|
210
|
+
*/
|
|
211
|
+
contentBlocksByRow?: ReactContentBlocksByRow;
|
|
180
212
|
}
|
|
181
213
|
/**
|
|
182
214
|
* SearchPage is a component that renders a Depict search results page.
|
|
@@ -242,6 +274,10 @@ interface CategoryPageConfig<T extends Display> extends BaseCategoryPageConfig,
|
|
|
242
274
|
* When using multiple CategoryPage components on the same page, you need to set a unique stateKey for each one. We recommend using an incrementing number, such as "1", "2", "3", etc. To associate a certain BreadCrumbs or QuickLinks component with a certain CategoryPage component, set the same stateKey on both.
|
|
243
275
|
*/
|
|
244
276
|
stateKey?: string;
|
|
277
|
+
/**
|
|
278
|
+
* See JSDoc of ReactContentBlocksByRow
|
|
279
|
+
*/
|
|
280
|
+
contentBlocksByRow?: ReactContentBlocksByRow;
|
|
245
281
|
}
|
|
246
282
|
/**
|
|
247
283
|
* CategoryPage is a component that renders a Depict category page. Go to definition on the props for more info.
|
package/server/ES10/index.js
CHANGED
|
@@ -50,9 +50,9 @@ class $88d93ed7309e90d1$export$d0f82e3ef89b1f22 extends (0, $7h5e1$Component) {
|
|
|
50
50
|
return this.props.children;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
async function $
|
|
53
|
+
async function $cce08f18e2476cbf$export$32024253978abdc7(_ref) {
|
|
54
54
|
let {
|
|
55
|
-
|
|
55
|
+
component_props: component_props,
|
|
56
56
|
component_portals: component_portals,
|
|
57
57
|
set_portals: set_portals,
|
|
58
58
|
get_react_template: get_react_template
|
|
@@ -69,9 +69,7 @@ async function $6593e4e126cb318f$export$79c79419c1ef0081(_ref) {
|
|
|
69
69
|
const [react_template, set_react_template] = $7h5e1$useState(() => $7h5e1$untrack(get_react_template));
|
|
70
70
|
call_when_template_changes = set_react_template;
|
|
71
71
|
return react_template(props);
|
|
72
|
-
},
|
|
73
|
-
display: display
|
|
74
|
-
});
|
|
72
|
+
}, component_props);
|
|
75
73
|
const reactProductCardInErrorBoundary = $7h5e1$jsx((0, $88d93ed7309e90d1$export$d0f82e3ef89b1f22), {
|
|
76
74
|
children: reactProductCard,
|
|
77
75
|
on_error: error => $7h5e1$runWithOwner(owner, () => {
|
|
@@ -117,8 +115,10 @@ function $48b0916cc674770c$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
117
115
|
display: display
|
|
118
116
|
})))
|
|
119
117
|
};
|
|
120
|
-
return $
|
|
121
|
-
|
|
118
|
+
return $cce08f18e2476cbf$export$32024253978abdc7({
|
|
119
|
+
component_props: {
|
|
120
|
+
display: display
|
|
121
|
+
},
|
|
122
122
|
get_react_template: () => props.productCard,
|
|
123
123
|
component_portals: component_portals,
|
|
124
124
|
set_portals: set_portals
|
|
@@ -147,7 +147,7 @@ function $48b0916cc674770c$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "2.
|
|
150
|
+
const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "2.1.1";
|
|
151
151
|
function $5c4add0a8fe94894$export$9fac37a9c21c2f3b(props) {
|
|
152
152
|
return props.children;
|
|
153
153
|
}
|
package/server/latest/index.cjs
CHANGED
|
@@ -72,8 +72,8 @@ class $d7a14567b529586f$export$d0f82e3ef89b1f22 extends (0, $7QqFM$react.Compone
|
|
|
72
72
|
return this.props.children;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
async function $
|
|
76
|
-
|
|
75
|
+
async function $6081519c185fcf70$export$32024253978abdc7({
|
|
76
|
+
component_props: component_props,
|
|
77
77
|
component_portals: component_portals,
|
|
78
78
|
set_portals: set_portals,
|
|
79
79
|
get_react_template: get_react_template
|
|
@@ -90,9 +90,7 @@ async function $ecaac5ceddb08f39$export$79c79419c1ef0081({
|
|
|
90
90
|
const [react_template, set_react_template] = $7QqFM$react.useState(() => $7QqFM$solidjs.untrack(get_react_template));
|
|
91
91
|
call_when_template_changes = set_react_template;
|
|
92
92
|
return react_template(props);
|
|
93
|
-
},
|
|
94
|
-
display: display
|
|
95
|
-
});
|
|
93
|
+
}, component_props);
|
|
96
94
|
const reactProductCardInErrorBoundary = $7QqFM$reactjsxruntime.jsx((0, $d7a14567b529586f$export$d0f82e3ef89b1f22), {
|
|
97
95
|
children: reactProductCard,
|
|
98
96
|
on_error: error => $7QqFM$solidjs.runWithOwner(owner, () => {
|
|
@@ -135,8 +133,10 @@ function $0aaa03f81d756b85$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
135
133
|
display: display
|
|
136
134
|
})))
|
|
137
135
|
};
|
|
138
|
-
return $
|
|
139
|
-
|
|
136
|
+
return $6081519c185fcf70$export$32024253978abdc7({
|
|
137
|
+
component_props: {
|
|
138
|
+
display: display
|
|
139
|
+
},
|
|
140
140
|
get_react_template: () => props.productCard,
|
|
141
141
|
component_portals: component_portals,
|
|
142
142
|
set_portals: set_portals
|
|
@@ -163,7 +163,7 @@ function $0aaa03f81d756b85$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
const $db7b67857900028b$export$83d89fbfd8236492 = "2.
|
|
166
|
+
const $db7b67857900028b$export$83d89fbfd8236492 = "2.1.1";
|
|
167
167
|
function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
|
|
168
168
|
return props.children;
|
|
169
169
|
}
|
package/server/latest/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DPC } from "@depict-ai/dpc/latest";
|
|
2
|
-
import React, { PropsWithChildren, ReactNode, ReactPortal, ReactElement } from "react";
|
|
2
|
+
import React, { PropsWithChildren, ReactNode, FC, ReactPortal, ReactElement } from "react";
|
|
3
3
|
import { BaseProviderConfig, BaseSearchProviderConfig, BaseCategoryProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui/latest";
|
|
4
4
|
import { Locale } from "@depict-ai/ui/locales/latest";
|
|
5
5
|
import { Display, ModernDisplay } from "@depict-ai/utilishared/latest";
|
|
6
|
-
export const version = "2.
|
|
6
|
+
export const version = "2.1.1";
|
|
7
7
|
interface UsePerformanceClientReturn {
|
|
8
8
|
dpc: DPC;
|
|
9
9
|
}
|
|
@@ -172,11 +172,43 @@ export interface DepictProductCardProps<T extends Display> {
|
|
|
172
172
|
* Depict product card to use for rendering products.
|
|
173
173
|
*/
|
|
174
174
|
export type DepictProductCard<T extends Display> = (props: DepictProductCardProps<T>) => ReactNode;
|
|
175
|
+
/**
|
|
176
|
+
* The interface for a content block.
|
|
177
|
+
* Please make sure that you don't have content blocks overlap as that will cause undefined behavior.
|
|
178
|
+
* The height of the content block will be the height of the tallest item in a row, so if there are no products in a row the content block needs to "bring its own height".
|
|
179
|
+
* If you need to load any data in the content block, please make sure to return a placeholder while you're doing so, to avoid layout shifts and ensure scroll restoration works correctly.
|
|
180
|
+
*
|
|
181
|
+
* - `spanColumns`: How many columns the block should span. This will be capped to the number of columns available.
|
|
182
|
+
* - `spanRows`: How many rows the block should span.
|
|
183
|
+
* - `position`: Where the block should be positioned. Can be `left`, `center` or `right`.
|
|
184
|
+
* - `content`: The content to render in the block - please provide a React component.
|
|
185
|
+
*/
|
|
186
|
+
type ReactContentBlock = {
|
|
187
|
+
spanColumns: number;
|
|
188
|
+
spanRows: number;
|
|
189
|
+
position: "left" | "center" | "right";
|
|
190
|
+
content: FC;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* A sparse array containing content blocks to show (or an empty slot or undefined if there's no block at that index). See ReactContentBlock for how a content block looks like. The index is the row where the content block should be shown.
|
|
194
|
+
* For example, to create a block on row 1 and 3 you'd do `[, block1, , block2]`.
|
|
195
|
+
* Alternatively:
|
|
196
|
+
* ```
|
|
197
|
+
* const blocks = [];
|
|
198
|
+
* blocks[1] = block1;
|
|
199
|
+
* blocks[3] = block2;
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
type ReactContentBlocksByRow = (undefined | ReactContentBlock)[];
|
|
175
203
|
interface SearchPageConfig<T extends Display> extends BaseSearchPageConfig, PLPConfig<T> {
|
|
176
204
|
/**
|
|
177
205
|
* When using multiple search instances on the same page, you need to set a unique stateKey for each one. We recommend using an incrementing number, such as "1", "2", "3", etc. To associate a modal with a SearchPage keyed component, set the same stateKey on both. If no stateKey is provided, the "default" instance will be used.
|
|
178
206
|
*/
|
|
179
207
|
stateKey?: string;
|
|
208
|
+
/**
|
|
209
|
+
* See JSDoc of ReactContentBlocksByRow
|
|
210
|
+
*/
|
|
211
|
+
contentBlocksByRow?: ReactContentBlocksByRow;
|
|
180
212
|
}
|
|
181
213
|
/**
|
|
182
214
|
* SearchPage is a component that renders a Depict search results page.
|
|
@@ -242,6 +274,10 @@ interface CategoryPageConfig<T extends Display> extends BaseCategoryPageConfig,
|
|
|
242
274
|
* When using multiple CategoryPage components on the same page, you need to set a unique stateKey for each one. We recommend using an incrementing number, such as "1", "2", "3", etc. To associate a certain BreadCrumbs or QuickLinks component with a certain CategoryPage component, set the same stateKey on both.
|
|
243
275
|
*/
|
|
244
276
|
stateKey?: string;
|
|
277
|
+
/**
|
|
278
|
+
* See JSDoc of ReactContentBlocksByRow
|
|
279
|
+
*/
|
|
280
|
+
contentBlocksByRow?: ReactContentBlocksByRow;
|
|
245
281
|
}
|
|
246
282
|
/**
|
|
247
283
|
* CategoryPage is a component that renders a Depict category page. Go to definition on the props for more info.
|
package/server/latest/index.js
CHANGED
|
@@ -49,8 +49,8 @@ class $d5c9e1f3545b4984$export$d0f82e3ef89b1f22 extends (0, $eOXet$Component) {
|
|
|
49
49
|
return this.props.children;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
async function $
|
|
53
|
-
|
|
52
|
+
async function $bcf84a32dc612a43$export$32024253978abdc7({
|
|
53
|
+
component_props: component_props,
|
|
54
54
|
component_portals: component_portals,
|
|
55
55
|
set_portals: set_portals,
|
|
56
56
|
get_react_template: get_react_template
|
|
@@ -67,9 +67,7 @@ async function $75f1064c8b836348$export$79c79419c1ef0081({
|
|
|
67
67
|
const [react_template, set_react_template] = $eOXet$useState(() => $eOXet$untrack(get_react_template));
|
|
68
68
|
call_when_template_changes = set_react_template;
|
|
69
69
|
return react_template(props);
|
|
70
|
-
},
|
|
71
|
-
display: display
|
|
72
|
-
});
|
|
70
|
+
}, component_props);
|
|
73
71
|
const reactProductCardInErrorBoundary = $eOXet$jsx((0, $d5c9e1f3545b4984$export$d0f82e3ef89b1f22), {
|
|
74
72
|
children: reactProductCard,
|
|
75
73
|
on_error: error => $eOXet$runWithOwner(owner, () => {
|
|
@@ -112,8 +110,10 @@ function $8bee51f55543fe0c$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
112
110
|
display: display
|
|
113
111
|
})))
|
|
114
112
|
};
|
|
115
|
-
return $
|
|
116
|
-
|
|
113
|
+
return $bcf84a32dc612a43$export$32024253978abdc7({
|
|
114
|
+
component_props: {
|
|
115
|
+
display: display
|
|
116
|
+
},
|
|
117
117
|
get_react_template: () => props.productCard,
|
|
118
118
|
component_portals: component_portals,
|
|
119
119
|
set_portals: set_portals
|
|
@@ -140,7 +140,7 @@ function $8bee51f55543fe0c$export$bd8acc07a8bae229(props, set_portals) {
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "2.
|
|
143
|
+
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "2.1.1";
|
|
144
144
|
function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
|
|
145
145
|
return props.children;
|
|
146
146
|
}
|