@coveo/headless 4.0.0-pre.ff258cf819 → 4.0.1-pre.3f9b368bf2
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/cjs/case-assist/headless.cjs +1 -1
- package/dist/cjs/commerce/headless.cjs +1 -1
- package/dist/cjs/headless.cjs +1 -1
- package/dist/cjs/insight/headless.cjs +1 -1
- package/dist/cjs/recommendation/headless.cjs +1 -1
- package/dist/cjs/ssr/headless.cjs +1 -1
- package/dist/cjs/ssr-commerce/headless.cjs +1 -1
- package/dist/cjs/ssr-commerce-next/headless.cjs +432 -526
- package/dist/cjs/ssr-commerce-next/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr-next/headless.cjs +137 -160
- package/dist/cjs/ssr-next/node.cjs.stats.json +1 -1
- package/dist/definitions/ssr/common/types/hydrate-static-state.d.ts +0 -4
- package/dist/definitions/ssr-next/commerce/types/engine.d.ts +6 -3
- package/dist/definitions/ssr-next/commerce/types/fetch-static-state.d.ts +1 -1
- package/dist/definitions/ssr-next/common/types/engine.d.ts +1 -1
- package/dist/definitions/ssr-next/search/controller-utils.d.ts +2 -2
- package/dist/definitions/ssr-next/search/types/hydrate-static-state.d.ts +1 -1
- package/dist/esm/ssr-next/search/controller-utils.js +2 -2
- package/dist/esm/ssr-next/search/engine/search-engine.ssr.js +2 -4
- package/dist/esm/utils/version.js +1 -1
- package/dist/quantic/case-assist/headless.js +1 -1
- package/dist/quantic/commerce/headless.js +1 -1
- package/dist/quantic/headless.js +1 -1
- package/dist/quantic/insight/headless.js +1 -1
- package/dist/quantic/recommendation/headless.js +1 -1
- package/package.json +1 -1
|
@@ -46,9 +46,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
46
46
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
47
47
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
48
48
|
|
|
49
|
-
// src/ssr
|
|
50
|
-
var
|
|
51
|
-
__export(
|
|
49
|
+
// src/ssr.index.ts
|
|
50
|
+
var ssr_index_exports = {};
|
|
51
|
+
__export(ssr_index_exports, {
|
|
52
52
|
DefaultFieldsToInclude: () => DefaultFieldsToInclude,
|
|
53
53
|
EcommerceDefaultFieldsToInclude: () => EcommerceDefaultFieldsToInclude,
|
|
54
54
|
MinimumFieldsToInclude: () => MinimumFieldsToInclude,
|
|
@@ -162,7 +162,7 @@ __export(ssr_next_index_exports, {
|
|
|
162
162
|
parseCriterionExpression: () => parseCriterionExpression,
|
|
163
163
|
validateRelativeDate: () => validateRelativeDate
|
|
164
164
|
});
|
|
165
|
-
module.exports = __toCommonJS(
|
|
165
|
+
module.exports = __toCommonJS(ssr_index_exports);
|
|
166
166
|
|
|
167
167
|
// src/utils/fetch-event-source/parse.ts
|
|
168
168
|
async function getBytes(stream, onChunk) {
|
|
@@ -1306,7 +1306,7 @@ var import_toolkit2 = require("@reduxjs/toolkit");
|
|
|
1306
1306
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
1307
1307
|
|
|
1308
1308
|
// src/utils/version.ts
|
|
1309
|
-
var VERSION = "4.0.
|
|
1309
|
+
var VERSION = "4.0.1-pre.3f9b368bf2";
|
|
1310
1310
|
var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
|
|
1311
1311
|
|
|
1312
1312
|
// src/api/analytics/analytics-selectors.ts
|
|
@@ -11169,7 +11169,7 @@ function loadBreadcrumbManagerReducers(engine) {
|
|
|
11169
11169
|
return true;
|
|
11170
11170
|
}
|
|
11171
11171
|
|
|
11172
|
-
// src/ssr
|
|
11172
|
+
// src/ssr/search/controllers/breadcrumb-manager/headless-breadcrumb-manager.ssr.ts
|
|
11173
11173
|
function defineBreadcrumbManager() {
|
|
11174
11174
|
return {
|
|
11175
11175
|
build: (engine) => buildBreadcrumbManager(engine)
|
|
@@ -11317,7 +11317,13 @@ function buildContext(engine, props) {
|
|
|
11317
11317
|
return buildCoreContext(engine, props);
|
|
11318
11318
|
}
|
|
11319
11319
|
|
|
11320
|
-
// src/ssr
|
|
11320
|
+
// src/ssr/commerce/types/controller-constants.ts
|
|
11321
|
+
var recommendationOptionKey = "recommendation-internal-options";
|
|
11322
|
+
var recommendationInternalOptionKey = Symbol.for(
|
|
11323
|
+
recommendationOptionKey
|
|
11324
|
+
);
|
|
11325
|
+
|
|
11326
|
+
// src/ssr/common/errors.ts
|
|
11321
11327
|
var MissingControllerProps = class extends Error {
|
|
11322
11328
|
constructor(controller) {
|
|
11323
11329
|
super();
|
|
@@ -11326,7 +11332,7 @@ var MissingControllerProps = class extends Error {
|
|
|
11326
11332
|
}
|
|
11327
11333
|
};
|
|
11328
11334
|
|
|
11329
|
-
// src/ssr
|
|
11335
|
+
// src/ssr/search/controllers/context/headless-context.ssr.ts
|
|
11330
11336
|
function defineContext() {
|
|
11331
11337
|
return {
|
|
11332
11338
|
buildWithProps: (engine, props) => {
|
|
@@ -11433,7 +11439,7 @@ function loadReducers(engine) {
|
|
|
11433
11439
|
return true;
|
|
11434
11440
|
}
|
|
11435
11441
|
|
|
11436
|
-
// src/ssr
|
|
11442
|
+
// src/ssr/search/controllers/dictionary-field-context/headless-dictionary-field-context.ssr.ts
|
|
11437
11443
|
function defineDictionaryFieldContext() {
|
|
11438
11444
|
return {
|
|
11439
11445
|
build: (engine) => buildDictionaryFieldContext(engine)
|
|
@@ -11581,7 +11587,7 @@ function buildDidYouMean(engine, props = {}) {
|
|
|
11581
11587
|
};
|
|
11582
11588
|
}
|
|
11583
11589
|
|
|
11584
|
-
// src/ssr
|
|
11590
|
+
// src/ssr/search/controllers/did-you-mean/headless-did-you-mean.ssr.ts
|
|
11585
11591
|
function defineDidYouMean() {
|
|
11586
11592
|
return {
|
|
11587
11593
|
build: (engine) => buildDidYouMean(engine)
|
|
@@ -11671,7 +11677,7 @@ function buildFacetManager(engine) {
|
|
|
11671
11677
|
return buildCoreFacetManager(engine);
|
|
11672
11678
|
}
|
|
11673
11679
|
|
|
11674
|
-
// src/ssr
|
|
11680
|
+
// src/ssr/search/controllers/facet-manager/headless-facet-manager.ssr.ts
|
|
11675
11681
|
function defineFacetManager() {
|
|
11676
11682
|
return {
|
|
11677
11683
|
build: (engine) => buildFacetManager(engine)
|
|
@@ -11890,7 +11896,7 @@ function loadAutomaticFacetGeneratorReducers(engine) {
|
|
|
11890
11896
|
return true;
|
|
11891
11897
|
}
|
|
11892
11898
|
|
|
11893
|
-
// src/ssr
|
|
11899
|
+
// src/ssr/search/controllers/facets/automatic-facet-generator/headless-automatic-facet-generator.ssr.ts
|
|
11894
11900
|
function defineAutomaticFacetGenerator(props) {
|
|
11895
11901
|
return {
|
|
11896
11902
|
build: (engine) => buildAutomaticFacetGenerator(engine, props)
|
|
@@ -13562,7 +13568,7 @@ function getToggleSelectAnalyticsAction(selection) {
|
|
|
13562
13568
|
return isSelected ? facetDeselect() : facetSelect();
|
|
13563
13569
|
}
|
|
13564
13570
|
|
|
13565
|
-
// src/ssr
|
|
13571
|
+
// src/ssr/search/controllers/facets/category-facet/headless-category-facet.ssr.ts
|
|
13566
13572
|
function defineCategoryFacet(props) {
|
|
13567
13573
|
return {
|
|
13568
13574
|
build: (engine) => buildCategoryFacet(engine, props)
|
|
@@ -14132,7 +14138,7 @@ function loadFacetReducers2(engine) {
|
|
|
14132
14138
|
return true;
|
|
14133
14139
|
}
|
|
14134
14140
|
|
|
14135
|
-
// src/ssr
|
|
14141
|
+
// src/ssr/search/controllers/facets/facet/headless-facet.ssr.ts
|
|
14136
14142
|
function defineFacet(props) {
|
|
14137
14143
|
return {
|
|
14138
14144
|
build: (engine) => buildFacet(engine, props)
|
|
@@ -14425,7 +14431,7 @@ function buildDateFacet(engine, props) {
|
|
|
14425
14431
|
};
|
|
14426
14432
|
}
|
|
14427
14433
|
|
|
14428
|
-
// src/ssr
|
|
14434
|
+
// src/ssr/search/controllers/facets/range-facet/date-facet/headless-date-facet.ssr.ts
|
|
14429
14435
|
function defineDateFacet(props) {
|
|
14430
14436
|
return {
|
|
14431
14437
|
build: (engine) => buildDateFacet(engine, props)
|
|
@@ -14557,7 +14563,7 @@ function loadDateFilterReducer2(engine) {
|
|
|
14557
14563
|
return true;
|
|
14558
14564
|
}
|
|
14559
14565
|
|
|
14560
|
-
// src/ssr
|
|
14566
|
+
// src/ssr/search/controllers/facets/range-facet/date-facet/headless-date-filter.ssr.ts
|
|
14561
14567
|
function defineDateFilter(props) {
|
|
14562
14568
|
return {
|
|
14563
14569
|
build: (engine) => buildDateFilter(engine, props)
|
|
@@ -14733,7 +14739,7 @@ function loadNumericFacetReducers2(engine) {
|
|
|
14733
14739
|
return true;
|
|
14734
14740
|
}
|
|
14735
14741
|
|
|
14736
|
-
// src/ssr
|
|
14742
|
+
// src/ssr/search/controllers/facets/range-facet/numeric-facet/headless-numeric-facet.ssr.ts
|
|
14737
14743
|
function defineNumericFacet(props) {
|
|
14738
14744
|
return {
|
|
14739
14745
|
build: (engine) => buildNumericFacet(engine, props)
|
|
@@ -14865,7 +14871,7 @@ function loadNumericFilterReducer2(engine) {
|
|
|
14865
14871
|
return true;
|
|
14866
14872
|
}
|
|
14867
14873
|
|
|
14868
|
-
// src/ssr
|
|
14874
|
+
// src/ssr/search/controllers/facets/range-facet/numeric-facet/headless-numeric-filter.ssr.ts
|
|
14869
14875
|
function defineNumericFilter(props) {
|
|
14870
14876
|
return {
|
|
14871
14877
|
build: (engine) => buildNumericFilter(engine, props)
|
|
@@ -14924,7 +14930,7 @@ function loadCategoryFieldSuggestionsReducers(engine) {
|
|
|
14924
14930
|
return true;
|
|
14925
14931
|
}
|
|
14926
14932
|
|
|
14927
|
-
// src/ssr
|
|
14933
|
+
// src/ssr/search/controllers/field-suggestions/category-facet/headless-category-field-suggestions.ssr.ts
|
|
14928
14934
|
function defineCategoryFieldSuggestions(props) {
|
|
14929
14935
|
return {
|
|
14930
14936
|
build: (engine) => buildCategoryFieldSuggestions(engine, props)
|
|
@@ -14997,7 +15003,7 @@ function loadFieldSuggestionsReducers(engine) {
|
|
|
14997
15003
|
return true;
|
|
14998
15004
|
}
|
|
14999
15005
|
|
|
15000
|
-
// src/ssr
|
|
15006
|
+
// src/ssr/search/controllers/field-suggestions/facet/headless-field-suggestions.ssr.ts
|
|
15001
15007
|
function defineFieldSuggestions(props) {
|
|
15002
15008
|
return {
|
|
15003
15009
|
build: (engine) => buildFieldSuggestions(engine, props)
|
|
@@ -15661,7 +15667,7 @@ function buildFoldedResultList(engine, props = {}) {
|
|
|
15661
15667
|
};
|
|
15662
15668
|
}
|
|
15663
15669
|
|
|
15664
|
-
// src/ssr
|
|
15670
|
+
// src/ssr/search/controllers/folded-result-list/headless-folded-result-list.ssr.ts
|
|
15665
15671
|
function defineFoldedResultList(props) {
|
|
15666
15672
|
return {
|
|
15667
15673
|
build: (engine) => buildFoldedResultList(engine, props)
|
|
@@ -16059,7 +16065,7 @@ function loadHistoryManagerReducers(engine) {
|
|
|
16059
16065
|
return true;
|
|
16060
16066
|
}
|
|
16061
16067
|
|
|
16062
|
-
// src/ssr
|
|
16068
|
+
// src/ssr/search/controllers/history-manager/headless-history-manager.ssr.ts
|
|
16063
16069
|
function defineHistoryManager() {
|
|
16064
16070
|
return {
|
|
16065
16071
|
build: (engine) => buildHistoryManager(engine)
|
|
@@ -16279,7 +16285,7 @@ function loadInstantResultsReducers(engine) {
|
|
|
16279
16285
|
return true;
|
|
16280
16286
|
}
|
|
16281
16287
|
|
|
16282
|
-
// src/ssr
|
|
16288
|
+
// src/ssr/search/controllers/instant-results/instant-results.ssr.ts
|
|
16283
16289
|
function defineInstantResults(props) {
|
|
16284
16290
|
return {
|
|
16285
16291
|
build: (engine) => buildInstantResults(engine, props)
|
|
@@ -16576,7 +16582,7 @@ function buildPager(engine, props = {}) {
|
|
|
16576
16582
|
};
|
|
16577
16583
|
}
|
|
16578
16584
|
|
|
16579
|
-
// src/ssr
|
|
16585
|
+
// src/ssr/search/controllers/pager/headless-pager.ssr.ts
|
|
16580
16586
|
function definePager(props) {
|
|
16581
16587
|
return {
|
|
16582
16588
|
build: (engine) => buildPager(engine, props)
|
|
@@ -16610,7 +16616,7 @@ function buildQueryError(engine) {
|
|
|
16610
16616
|
return buildCoreQueryError(engine);
|
|
16611
16617
|
}
|
|
16612
16618
|
|
|
16613
|
-
// src/ssr
|
|
16619
|
+
// src/ssr/search/controllers/query-error/headless-query-error.ssr.ts
|
|
16614
16620
|
function defineQueryError() {
|
|
16615
16621
|
return {
|
|
16616
16622
|
build: (engine) => buildQueryError(engine)
|
|
@@ -16656,7 +16662,7 @@ function buildQuerySummary(engine) {
|
|
|
16656
16662
|
return buildCoreQuerySummary(engine);
|
|
16657
16663
|
}
|
|
16658
16664
|
|
|
16659
|
-
// src/ssr
|
|
16665
|
+
// src/ssr/search/controllers/query-summary/headless-query-summary.ssr.ts
|
|
16660
16666
|
function defineQuerySummary() {
|
|
16661
16667
|
return {
|
|
16662
16668
|
build: (engine) => buildQuerySummary(engine)
|
|
@@ -16942,7 +16948,7 @@ function loadSearchQuickviewReducers(engine) {
|
|
|
16942
16948
|
return true;
|
|
16943
16949
|
}
|
|
16944
16950
|
|
|
16945
|
-
// src/ssr
|
|
16951
|
+
// src/ssr/search/controllers/quickview/headless-quickview.ssr.ts
|
|
16946
16952
|
function defineQuickview(props) {
|
|
16947
16953
|
return {
|
|
16948
16954
|
build: (engine) => buildQuickview(engine, props)
|
|
@@ -17139,7 +17145,7 @@ function loadRecentQueriesListReducer(engine) {
|
|
|
17139
17145
|
return true;
|
|
17140
17146
|
}
|
|
17141
17147
|
|
|
17142
|
-
// src/ssr
|
|
17148
|
+
// src/ssr/search/controllers/recent-queries-list/headless-recent-queries-list.ssr.ts
|
|
17143
17149
|
function defineRecentQueriesList(props) {
|
|
17144
17150
|
return {
|
|
17145
17151
|
build: (engine) => buildRecentQueriesList(engine, props)
|
|
@@ -17278,7 +17284,7 @@ function loadRecentResultsListReducer(engine) {
|
|
|
17278
17284
|
return true;
|
|
17279
17285
|
}
|
|
17280
17286
|
|
|
17281
|
-
// src/ssr
|
|
17287
|
+
// src/ssr/search/controllers/recent-results-list/headless-recent-results-list.ssr.ts
|
|
17282
17288
|
function defineRecentResultsList(props) {
|
|
17283
17289
|
return {
|
|
17284
17290
|
build: (engine) => buildRecentResultsList(engine, props)
|
|
@@ -17494,7 +17500,7 @@ function loadRelevanceInspectorReducers(engine) {
|
|
|
17494
17500
|
return true;
|
|
17495
17501
|
}
|
|
17496
17502
|
|
|
17497
|
-
// src/ssr
|
|
17503
|
+
// src/ssr/search/controllers/relevance-inspector/headless-relevance-inspector.ssr.ts
|
|
17498
17504
|
function defineRelevanceInspector(props) {
|
|
17499
17505
|
return {
|
|
17500
17506
|
build: (engine) => buildRelevanceInspector(engine, props)
|
|
@@ -17509,7 +17515,7 @@ function buildResultList(engine, props) {
|
|
|
17509
17515
|
});
|
|
17510
17516
|
}
|
|
17511
17517
|
|
|
17512
|
-
// src/ssr
|
|
17518
|
+
// src/ssr/search/controllers/result-list/headless-result-list.ssr.ts
|
|
17513
17519
|
function defineResultList(props) {
|
|
17514
17520
|
return {
|
|
17515
17521
|
build: (engine) => buildResultList(engine, props)
|
|
@@ -17583,7 +17589,7 @@ function loadResultsPerPageReducers2(engine) {
|
|
|
17583
17589
|
return true;
|
|
17584
17590
|
}
|
|
17585
17591
|
|
|
17586
|
-
// src/ssr
|
|
17592
|
+
// src/ssr/search/controllers/results-per-page/headless-results-per-page.ssr.ts
|
|
17587
17593
|
function defineResultsPerPage(props) {
|
|
17588
17594
|
return {
|
|
17589
17595
|
build: (engine) => buildResultsPerPage(engine, props)
|
|
@@ -18034,7 +18040,7 @@ function buildSearchBox(engine, props = {}) {
|
|
|
18034
18040
|
};
|
|
18035
18041
|
}
|
|
18036
18042
|
|
|
18037
|
-
// src/ssr
|
|
18043
|
+
// src/ssr/search/controllers/search-box/headless-search-box.ssr.ts
|
|
18038
18044
|
function defineSearchBox(props) {
|
|
18039
18045
|
return {
|
|
18040
18046
|
build: (engine) => buildSearchBox(engine, props)
|
|
@@ -18774,7 +18780,7 @@ function activateTabIfIdExists(state, id) {
|
|
|
18774
18780
|
});
|
|
18775
18781
|
}
|
|
18776
18782
|
|
|
18777
|
-
// src/ssr
|
|
18783
|
+
// src/ssr/search/controllers/search-parameter-manager/headless-search-parameter-manager.ssr.ts
|
|
18778
18784
|
function defineSearchParameterManager() {
|
|
18779
18785
|
return {
|
|
18780
18786
|
buildWithProps: (engine, props) => {
|
|
@@ -18815,7 +18821,7 @@ function buildSearchStatus(engine) {
|
|
|
18815
18821
|
return buildCoreStatus(engine);
|
|
18816
18822
|
}
|
|
18817
18823
|
|
|
18818
|
-
// src/ssr
|
|
18824
|
+
// src/ssr/search/controllers/search-status/headless-search-status.ssr.ts
|
|
18819
18825
|
function defineSearchStatus() {
|
|
18820
18826
|
return {
|
|
18821
18827
|
build: (engine) => buildSearchStatus(engine)
|
|
@@ -19622,7 +19628,7 @@ function buildSmartSnippet(engine, props) {
|
|
|
19622
19628
|
};
|
|
19623
19629
|
}
|
|
19624
19630
|
|
|
19625
|
-
// src/ssr
|
|
19631
|
+
// src/ssr/search/controllers/smart-snippet/headless-smart-snippet.ssr.ts
|
|
19626
19632
|
function defineSmartSnippet(props) {
|
|
19627
19633
|
return {
|
|
19628
19634
|
build: (engine) => buildSmartSnippet(engine, props)
|
|
@@ -19798,7 +19804,7 @@ function buildSmartSnippetQuestionsList(engine, props) {
|
|
|
19798
19804
|
};
|
|
19799
19805
|
}
|
|
19800
19806
|
|
|
19801
|
-
// src/ssr
|
|
19807
|
+
// src/ssr/search/controllers/smart-snippet-questions-list/headless-smart-snippet-questions-list.ssr.ts
|
|
19802
19808
|
function defineSmartSnippetQuestionsList(props) {
|
|
19803
19809
|
return {
|
|
19804
19810
|
build: (engine) => buildSmartSnippetQuestionsList(engine, props)
|
|
@@ -19879,7 +19885,7 @@ function buildSort(engine, props = {}) {
|
|
|
19879
19885
|
};
|
|
19880
19886
|
}
|
|
19881
19887
|
|
|
19882
|
-
// src/ssr
|
|
19888
|
+
// src/ssr/search/controllers/sort/headless-sort.ssr.ts
|
|
19883
19889
|
function defineSort(props) {
|
|
19884
19890
|
return {
|
|
19885
19891
|
build: (engine) => buildSort(engine, props)
|
|
@@ -20178,7 +20184,7 @@ function loadStandaloneSearchBoxReducers(engine) {
|
|
|
20178
20184
|
return true;
|
|
20179
20185
|
}
|
|
20180
20186
|
|
|
20181
|
-
// src/ssr
|
|
20187
|
+
// src/ssr/search/controllers/standalone-search-box/headless-standalone-search-box.ssr.ts
|
|
20182
20188
|
function defineStandaloneSearchBox(props) {
|
|
20183
20189
|
return {
|
|
20184
20190
|
build: (engine) => buildStandaloneSearchBox(engine, props)
|
|
@@ -20289,7 +20295,7 @@ function getLegacyAnalyticsActionForToggledValue(id, value) {
|
|
|
20289
20295
|
});
|
|
20290
20296
|
}
|
|
20291
20297
|
|
|
20292
|
-
// src/ssr
|
|
20298
|
+
// src/ssr/search/controllers/static-filter/headless-static-filter.ssr.ts
|
|
20293
20299
|
function defineStaticFilter(props) {
|
|
20294
20300
|
return {
|
|
20295
20301
|
build: (engine) => buildStaticFilter(engine, props)
|
|
@@ -20385,7 +20391,7 @@ function buildTab(engine, props) {
|
|
|
20385
20391
|
};
|
|
20386
20392
|
}
|
|
20387
20393
|
|
|
20388
|
-
// src/ssr
|
|
20394
|
+
// src/ssr/search/controllers/tab/headless-tab.ssr.ts
|
|
20389
20395
|
function defineTab(props) {
|
|
20390
20396
|
return {
|
|
20391
20397
|
build: (engine) => buildTab(engine, props)
|
|
@@ -20429,7 +20435,7 @@ function buildTabManager(engine) {
|
|
|
20429
20435
|
};
|
|
20430
20436
|
}
|
|
20431
20437
|
|
|
20432
|
-
// src/ssr
|
|
20438
|
+
// src/ssr/search/controllers/tab-manager/headless-tab-manager.ssr.ts
|
|
20433
20439
|
function defineTabManager() {
|
|
20434
20440
|
return {
|
|
20435
20441
|
build: (engine) => buildTabManager(engine)
|
|
@@ -20551,7 +20557,7 @@ function loadExecuteTriggerReducers(engine) {
|
|
|
20551
20557
|
return true;
|
|
20552
20558
|
}
|
|
20553
20559
|
|
|
20554
|
-
// src/ssr
|
|
20560
|
+
// src/ssr/search/controllers/triggers/headless-execute-trigger.ssr.ts
|
|
20555
20561
|
function defineExecuteTrigger() {
|
|
20556
20562
|
return {
|
|
20557
20563
|
build: (engine) => buildExecuteTrigger(engine)
|
|
@@ -20606,7 +20612,7 @@ function buildNotifyTrigger(engine) {
|
|
|
20606
20612
|
});
|
|
20607
20613
|
}
|
|
20608
20614
|
|
|
20609
|
-
// src/ssr
|
|
20615
|
+
// src/ssr/search/controllers/triggers/headless-notify-trigger.ssr.ts
|
|
20610
20616
|
function defineNotifyTrigger() {
|
|
20611
20617
|
return {
|
|
20612
20618
|
build: (engine) => buildNotifyTrigger(engine)
|
|
@@ -20650,7 +20656,7 @@ function loadQueryTriggerReducers(engine) {
|
|
|
20650
20656
|
return true;
|
|
20651
20657
|
}
|
|
20652
20658
|
|
|
20653
|
-
// src/ssr
|
|
20659
|
+
// src/ssr/search/controllers/triggers/headless-query-trigger.ssr.ts
|
|
20654
20660
|
function defineQueryTrigger() {
|
|
20655
20661
|
return {
|
|
20656
20662
|
build: (engine) => buildQueryTrigger(engine)
|
|
@@ -20692,7 +20698,7 @@ function loadRedirectionReducers(engine) {
|
|
|
20692
20698
|
return true;
|
|
20693
20699
|
}
|
|
20694
20700
|
|
|
20695
|
-
// src/ssr
|
|
20701
|
+
// src/ssr/search/controllers/triggers/headless-redirection-trigger.ssr.ts
|
|
20696
20702
|
function defineRedirectionTrigger() {
|
|
20697
20703
|
return {
|
|
20698
20704
|
build: (engine) => buildRedirectionTrigger(engine)
|
|
@@ -21014,7 +21020,7 @@ function loadUrlManagerReducers(engine) {
|
|
|
21014
21020
|
return true;
|
|
21015
21021
|
}
|
|
21016
21022
|
|
|
21017
|
-
// src/ssr
|
|
21023
|
+
// src/ssr/search/controllers/url-manager/headless-url-manager.ssr.ts
|
|
21018
21024
|
var defineUrlManager = () => ({
|
|
21019
21025
|
buildWithProps: (engine, props) => {
|
|
21020
21026
|
if (props === void 0) {
|
|
@@ -21029,7 +21035,7 @@ function isBrowser2() {
|
|
|
21029
21035
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
21030
21036
|
}
|
|
21031
21037
|
|
|
21032
|
-
// src/ssr
|
|
21038
|
+
// src/ssr/common/augment-preprocess-request.ts
|
|
21033
21039
|
function augmentPreprocessRequestWithForwardedFor(options) {
|
|
21034
21040
|
const originalPreprocessRequest = options.preprocessRequest;
|
|
21035
21041
|
return async (request, clientOrigin, metadata) => {
|
|
@@ -21053,109 +21059,48 @@ function augmentPreprocessRequestWithForwardedFor(options) {
|
|
|
21053
21059
|
};
|
|
21054
21060
|
}
|
|
21055
21061
|
|
|
21056
|
-
// src/ssr
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
this._definition = definition4;
|
|
21064
|
-
this._engine = engine;
|
|
21065
|
-
this._props = props;
|
|
21066
|
-
}
|
|
21067
|
-
withAdditionalArgs(additionalArgs = []) {
|
|
21068
|
-
this._additionalArgs = additionalArgs;
|
|
21069
|
-
return this;
|
|
21070
|
-
}
|
|
21071
|
-
build() {
|
|
21072
|
-
if ("build" in this._definition && typeof this._definition.build === "function") {
|
|
21073
|
-
return this.buildWithoutProps();
|
|
21074
|
-
}
|
|
21075
|
-
if ("buildWithProps" in this._definition && typeof this._definition.buildWithProps === "function") {
|
|
21076
|
-
return this.buildWithProps();
|
|
21077
|
-
}
|
|
21078
|
-
throw new Error(
|
|
21079
|
-
"Controller definition must have a build or buildWithProps method."
|
|
21080
|
-
);
|
|
21081
|
-
}
|
|
21082
|
-
buildWithoutProps() {
|
|
21083
|
-
const buildFn = this._definition.build;
|
|
21084
|
-
return buildFn(this._engine, ...this._additionalArgs);
|
|
21085
|
-
}
|
|
21086
|
-
buildWithProps() {
|
|
21087
|
-
const buildWithPropsFn = this._definition.buildWithProps;
|
|
21088
|
-
const controller = buildWithPropsFn(
|
|
21089
|
-
this._engine,
|
|
21090
|
-
this._props,
|
|
21091
|
-
...this._additionalArgs
|
|
21092
|
-
);
|
|
21093
|
-
return { ...controller, initialState: controller.state };
|
|
21094
|
-
}
|
|
21095
|
-
};
|
|
21096
|
-
|
|
21097
|
-
// src/ssr-next/common/builders/static-controller-builder.ts
|
|
21098
|
-
var StaticControllerBuilder = class {
|
|
21099
|
-
constructor() {
|
|
21100
|
-
__publicField(this, "_state");
|
|
21101
|
-
__publicField(this, "_initialState");
|
|
21102
|
-
}
|
|
21103
|
-
withState(state) {
|
|
21104
|
-
this._state = clone(state);
|
|
21105
|
-
return this;
|
|
21106
|
-
}
|
|
21107
|
-
withInitialState(initialState) {
|
|
21108
|
-
this._initialState = clone(initialState);
|
|
21109
|
-
return this;
|
|
21110
|
-
}
|
|
21111
|
-
/**
|
|
21112
|
-
* Builds and returns the static controller state object
|
|
21113
|
-
*/
|
|
21114
|
-
build() {
|
|
21115
|
-
const result = {
|
|
21116
|
-
state: this._state
|
|
21117
|
-
};
|
|
21118
|
-
if (this._initialState) {
|
|
21119
|
-
result.initialState = this._initialState;
|
|
21120
|
-
}
|
|
21121
|
-
return result;
|
|
21122
|
-
}
|
|
21123
|
-
};
|
|
21124
|
-
function createStaticControllerBuilder(controller) {
|
|
21125
|
-
const builder = new StaticControllerBuilder().withState(controller.state);
|
|
21126
|
-
if ("initialState" in controller) {
|
|
21127
|
-
builder.withInitialState(
|
|
21128
|
-
controller.initialState
|
|
21129
|
-
);
|
|
21130
|
-
}
|
|
21131
|
-
return builder;
|
|
21062
|
+
// src/ssr/common/controller-utils.ts
|
|
21063
|
+
function buildControllerFromDefinition({
|
|
21064
|
+
definition: definition4,
|
|
21065
|
+
engine,
|
|
21066
|
+
props
|
|
21067
|
+
}) {
|
|
21068
|
+
return "build" in definition4 ? definition4.build(engine) : definition4.buildWithProps(engine, props);
|
|
21132
21069
|
}
|
|
21133
|
-
|
|
21134
|
-
// src/ssr-next/search/controller-utils.ts
|
|
21135
21070
|
function buildControllerDefinitions({
|
|
21136
21071
|
definitionsMap,
|
|
21137
21072
|
engine,
|
|
21138
21073
|
propsMap
|
|
21139
21074
|
}) {
|
|
21140
|
-
return mapObject(
|
|
21141
|
-
|
|
21142
|
-
|
|
21143
|
-
|
|
21075
|
+
return mapObject(
|
|
21076
|
+
definitionsMap,
|
|
21077
|
+
(definition4, key) => buildControllerFromDefinition({
|
|
21078
|
+
definition: definition4,
|
|
21079
|
+
engine,
|
|
21080
|
+
props: propsMap?.[key]
|
|
21081
|
+
})
|
|
21082
|
+
);
|
|
21144
21083
|
}
|
|
21145
21084
|
function createStaticState({
|
|
21146
|
-
|
|
21085
|
+
searchAction,
|
|
21147
21086
|
controllers
|
|
21148
21087
|
}) {
|
|
21149
21088
|
return {
|
|
21150
|
-
controllers: mapObject(
|
|
21151
|
-
|
|
21152
|
-
|
|
21153
|
-
)
|
|
21154
|
-
searchActions: clone(searchActions)
|
|
21089
|
+
controllers: mapObject(controllers, (controller) => ({
|
|
21090
|
+
state: clone(controller.state)
|
|
21091
|
+
})),
|
|
21092
|
+
searchAction: clone(searchAction)
|
|
21155
21093
|
};
|
|
21156
21094
|
}
|
|
21095
|
+
function composeFunction(parentFunction, children) {
|
|
21096
|
+
const newFunction = (...params) => parentFunction(...params);
|
|
21097
|
+
for (const [key, value] of Object.entries(children)) {
|
|
21098
|
+
newFunction[key] = value;
|
|
21099
|
+
}
|
|
21100
|
+
return newFunction;
|
|
21101
|
+
}
|
|
21157
21102
|
|
|
21158
|
-
// src/ssr
|
|
21103
|
+
// src/ssr/search/engine/search-engine.ssr.ts
|
|
21159
21104
|
function isSearchCompletedAction(action) {
|
|
21160
21105
|
return /^search\/executeSearch\/(fulfilled|rejected)$/.test(
|
|
21161
21106
|
action.type
|
|
@@ -21194,7 +21139,9 @@ function defineSearchEngine(options) {
|
|
|
21194
21139
|
"[WARNING] Missing navigator context in server-side code. Make sure to set it with `setNavigatorContextProvider` before calling fetchStaticState()"
|
|
21195
21140
|
);
|
|
21196
21141
|
}
|
|
21197
|
-
const engine = buildSSRSearchEngine(
|
|
21142
|
+
const engine = buildSSRSearchEngine(
|
|
21143
|
+
buildOptions2?.extend ? await buildOptions2.extend(getOptions()) : getOptions()
|
|
21144
|
+
);
|
|
21198
21145
|
const controllers = buildControllerDefinitions({
|
|
21199
21146
|
definitionsMap: controllerDefinitions ?? {},
|
|
21200
21147
|
engine,
|
|
@@ -21205,29 +21152,59 @@ function defineSearchEngine(options) {
|
|
|
21205
21152
|
controllers
|
|
21206
21153
|
};
|
|
21207
21154
|
};
|
|
21208
|
-
const fetchStaticState =
|
|
21209
|
-
|
|
21210
|
-
|
|
21211
|
-
|
|
21212
|
-
|
|
21213
|
-
|
|
21214
|
-
|
|
21215
|
-
|
|
21216
|
-
|
|
21217
|
-
|
|
21218
|
-
|
|
21219
|
-
|
|
21220
|
-
|
|
21221
|
-
|
|
21222
|
-
|
|
21223
|
-
|
|
21224
|
-
|
|
21225
|
-
|
|
21226
|
-
|
|
21227
|
-
|
|
21228
|
-
|
|
21229
|
-
|
|
21155
|
+
const fetchStaticState = composeFunction(
|
|
21156
|
+
async (...params) => {
|
|
21157
|
+
const buildResult = await build(...params);
|
|
21158
|
+
const staticState = await fetchStaticState.fromBuildResult({
|
|
21159
|
+
buildResult
|
|
21160
|
+
});
|
|
21161
|
+
options.configuration.preprocessRequest = augmentPreprocessRequestWithForwardedFor({
|
|
21162
|
+
preprocessRequest: options.configuration.preprocessRequest,
|
|
21163
|
+
navigatorContextProvider: options.navigatorContextProvider,
|
|
21164
|
+
loggerOptions: options.loggerOptions
|
|
21165
|
+
});
|
|
21166
|
+
return staticState;
|
|
21167
|
+
},
|
|
21168
|
+
{
|
|
21169
|
+
fromBuildResult: async (...params) => {
|
|
21170
|
+
const [
|
|
21171
|
+
{
|
|
21172
|
+
buildResult: { engine, controllers }
|
|
21173
|
+
}
|
|
21174
|
+
] = params;
|
|
21175
|
+
engine.executeFirstSearch();
|
|
21176
|
+
return createStaticState({
|
|
21177
|
+
searchAction: await engine.waitForSearchCompletedAction(),
|
|
21178
|
+
controllers
|
|
21179
|
+
});
|
|
21180
|
+
}
|
|
21181
|
+
}
|
|
21182
|
+
);
|
|
21183
|
+
const hydrateStaticState = composeFunction(
|
|
21184
|
+
async (...params) => {
|
|
21185
|
+
const buildResult = await build(...params);
|
|
21186
|
+
const staticState = await hydrateStaticState.fromBuildResult({
|
|
21187
|
+
buildResult,
|
|
21188
|
+
searchAction: params[0].searchAction
|
|
21189
|
+
});
|
|
21190
|
+
return staticState;
|
|
21191
|
+
},
|
|
21192
|
+
{
|
|
21193
|
+
fromBuildResult: async (...params) => {
|
|
21194
|
+
const [
|
|
21195
|
+
{
|
|
21196
|
+
buildResult: { engine, controllers },
|
|
21197
|
+
searchAction
|
|
21198
|
+
}
|
|
21199
|
+
] = params;
|
|
21200
|
+
engine.dispatch(searchAction);
|
|
21201
|
+
await engine.waitForSearchCompletedAction();
|
|
21202
|
+
return { engine, controllers };
|
|
21203
|
+
}
|
|
21204
|
+
}
|
|
21205
|
+
);
|
|
21230
21206
|
return {
|
|
21207
|
+
build,
|
|
21231
21208
|
fetchStaticState,
|
|
21232
21209
|
hydrateStaticState,
|
|
21233
21210
|
setNavigatorContextProvider
|