@depict-ai/ui 0.0.77 → 0.0.78
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/index.d.ts +1 -1
- package/dist/main.js +16 -13
- package/dist/module.js +16 -13
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { SearchSuggestionsResponse, CategorySuggestion } from "@depict-ai/types/
|
|
|
7
7
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
8
8
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
9
9
|
import { ProductListingResponse } from "@depict-ai/types/api/ProductListingResponse";
|
|
10
|
-
export const version = "0.0.
|
|
10
|
+
export const version = "0.0.78";
|
|
11
11
|
export type OnNavigation = ((options: {
|
|
12
12
|
is_replace: boolean;
|
|
13
13
|
new_url: URL;
|
package/dist/main.js
CHANGED
|
@@ -35,7 +35,7 @@ $parcel$export(module.exports, "solid_format_price", () => $5fc9fc23df1591db$exp
|
|
|
35
35
|
$parcel$export(module.exports, "connect_search_field_height_to_aligner_height", () => $246e3e89a097f014$export$828dcdd425fd3231);
|
|
36
36
|
$parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
|
|
37
37
|
$parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
|
|
38
|
-
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.
|
|
38
|
+
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.78";
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -4344,7 +4344,8 @@ function $495e9998757c5d32$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
|
|
|
4344
4344
|
new_url_: href(),
|
|
4345
4345
|
is_replace_: false,
|
|
4346
4346
|
event_: ev,
|
|
4347
|
-
force_spa_navigation_: true
|
|
4347
|
+
force_spa_navigation_: true,
|
|
4348
|
+
category_query_id_: display_accessor()?.query_id
|
|
4348
4349
|
})), true);
|
|
4349
4350
|
(0, $46MJV$solidjsweb.insert)(_el$2, ()=>display_accessor().title);
|
|
4350
4351
|
(0, $46MJV$solidjsweb.effect)(()=>(0, $46MJV$solidjsweb.setAttribute)(_el$2, "href", href()));
|
|
@@ -4532,7 +4533,8 @@ function $cdc2c00c0a7da86e$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4532
4533
|
new_url_: url,
|
|
4533
4534
|
is_replace_: false,
|
|
4534
4535
|
event_: ev,
|
|
4535
|
-
force_spa_navigation_: true
|
|
4536
|
+
force_spa_navigation_: true,
|
|
4537
|
+
category_query_id_: display_accessor()?.query_id
|
|
4536
4538
|
});
|
|
4537
4539
|
}), true);
|
|
4538
4540
|
(0, $46MJV$solidjsweb.insert)(_el$3, ()=>display_accessor()?.title || (0, $46MJV$solidjsweb.createComponent)((0, $46MJV$depictaiutilishared.Placeholder), {
|
|
@@ -4641,7 +4643,8 @@ function $207f7b30db90d048$var$delete_sideways_param_flag(router) {
|
|
|
4641
4643
|
searchParams.delete((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac));
|
|
4642
4644
|
router.navigate_.go_to_({
|
|
4643
4645
|
new_url_: url_object,
|
|
4644
|
-
is_replace_: true
|
|
4646
|
+
is_replace_: true,
|
|
4647
|
+
force_spa_navigation_: true
|
|
4645
4648
|
});
|
|
4646
4649
|
return true;
|
|
4647
4650
|
}
|
|
@@ -5278,9 +5281,6 @@ function $004640621ca953d0$export$7bcff1eb3eca57d7(router) {
|
|
|
5278
5281
|
|
|
5279
5282
|
|
|
5280
5283
|
class $43940d5ca403c293$export$7e1297a3a19f10d8 {
|
|
5281
|
-
#forced_default_on_navigation({ is_replace: is_replace , new_url: new_url }) {
|
|
5282
|
-
history[is_replace ? "replaceState" : "pushState"](history.state, "", new_url);
|
|
5283
|
-
}
|
|
5284
5284
|
/**
|
|
5285
5285
|
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
5286
5286
|
*/ #throwing_on_navigation(...args) {
|
|
@@ -5303,10 +5303,10 @@ class $43940d5ca403c293$export$7e1297a3a19f10d8 {
|
|
|
5303
5303
|
/**
|
|
5304
5304
|
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
5305
5305
|
* This standardises waiting for all kinds of routers
|
|
5306
|
-
*/ #get_navigation_happened_promise(
|
|
5306
|
+
*/ #get_navigation_happened_promise(is_replace) {
|
|
5307
5307
|
return new Promise((resolve)=>{
|
|
5308
5308
|
const handler = (what_happened)=>{
|
|
5309
|
-
if (what_happened === (
|
|
5309
|
+
if (what_happened === (is_replace ? "replaceState" : "pushState")) {
|
|
5310
5310
|
resolve();
|
|
5311
5311
|
(0, $46MJV$depictaiutilishared.instant_exec_on_suspect_history_change).delete(handler);
|
|
5312
5312
|
}
|
|
@@ -5327,7 +5327,7 @@ class $43940d5ca403c293$export$7e1297a3a19f10d8 {
|
|
|
5327
5327
|
* @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
|
|
5328
5328
|
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
5329
5329
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5330
|
-
*/ go_to_: async ({ new_url_: new_url_ , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ })=>{
|
|
5330
|
+
*/ go_to_: async ({ new_url_: new_url_ , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ , category_query_id_: category_query_id_ })=>{
|
|
5331
5331
|
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
5332
5332
|
if (this.#dont_attempt_navigation(event_)) return;
|
|
5333
5333
|
if (wants_hard_navigation && !force_spa_navigation_) {
|
|
@@ -5337,9 +5337,12 @@ class $43940d5ca403c293$export$7e1297a3a19f10d8 {
|
|
|
5337
5337
|
}
|
|
5338
5338
|
event_?.preventDefault();
|
|
5339
5339
|
const promise = this.#get_navigation_happened_promise(true);
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5340
|
+
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
5341
|
+
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
5342
|
+
const new_state = history.state;
|
|
5343
|
+
if (category_query_id_) new_state.category_current_query_id = category_query_id_;
|
|
5344
|
+
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
5345
|
+
} else this.#throwing_on_navigation.call(this, {
|
|
5343
5346
|
is_replace: is_replace_,
|
|
5344
5347
|
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_)
|
|
5345
5348
|
});
|
package/dist/module.js
CHANGED
|
@@ -3,7 +3,7 @@ import {template as $g9l4l$template, insert as $g9l4l$insert, effect as $g9l4l$e
|
|
|
3
3
|
import {createSignal as $g9l4l$createSignal, onCleanup as $g9l4l$onCleanup, createComputed as $g9l4l$createComputed, createEffect as $g9l4l$createEffect, untrack as $g9l4l$untrack, batch as $g9l4l$batch, createResource as $g9l4l$createResource, createMemo as $g9l4l$createMemo, Show as $g9l4l$Show, createRenderEffect as $g9l4l$createRenderEffect, runWithOwner as $g9l4l$runWithOwner, createRoot as $g9l4l$createRoot, getOwner as $g9l4l$getOwner, createReaction as $g9l4l$createReaction, on as $g9l4l$on, ErrorBoundary as $g9l4l$ErrorBoundary, Index as $g9l4l$Index, For as $g9l4l$For} from "solid-js";
|
|
4
4
|
import {compressToBase64 as $g9l4l$compressToBase64, decompressFromBase64 as $g9l4l$decompressFromBase64} from "lz-string";
|
|
5
5
|
|
|
6
|
-
/*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.
|
|
6
|
+
/*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.78";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -4312,7 +4312,8 @@ function $1b5a927e48d892a1$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
|
|
|
4312
4312
|
new_url_: href(),
|
|
4313
4313
|
is_replace_: false,
|
|
4314
4314
|
event_: ev,
|
|
4315
|
-
force_spa_navigation_: true
|
|
4315
|
+
force_spa_navigation_: true,
|
|
4316
|
+
category_query_id_: display_accessor()?.query_id
|
|
4316
4317
|
})), true);
|
|
4317
4318
|
(0, $g9l4l$insert)(_el$2, ()=>display_accessor().title);
|
|
4318
4319
|
(0, $g9l4l$effect)(()=>(0, $g9l4l$setAttribute)(_el$2, "href", href()));
|
|
@@ -4500,7 +4501,8 @@ function $6af87e1502f04aa3$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4500
4501
|
new_url_: url,
|
|
4501
4502
|
is_replace_: false,
|
|
4502
4503
|
event_: ev,
|
|
4503
|
-
force_spa_navigation_: true
|
|
4504
|
+
force_spa_navigation_: true,
|
|
4505
|
+
category_query_id_: display_accessor()?.query_id
|
|
4504
4506
|
});
|
|
4505
4507
|
}), true);
|
|
4506
4508
|
(0, $g9l4l$insert)(_el$3, ()=>display_accessor()?.title || (0, $g9l4l$createComponent)((0, $g9l4l$Placeholder), {
|
|
@@ -4609,7 +4611,8 @@ function $cb20e79516018342$var$delete_sideways_param_flag(router) {
|
|
|
4609
4611
|
searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
|
|
4610
4612
|
router.navigate_.go_to_({
|
|
4611
4613
|
new_url_: url_object,
|
|
4612
|
-
is_replace_: true
|
|
4614
|
+
is_replace_: true,
|
|
4615
|
+
force_spa_navigation_: true
|
|
4613
4616
|
});
|
|
4614
4617
|
return true;
|
|
4615
4618
|
}
|
|
@@ -5246,9 +5249,6 @@ function $b4291f5d2e6b2fae$export$7bcff1eb3eca57d7(router) {
|
|
|
5246
5249
|
|
|
5247
5250
|
|
|
5248
5251
|
class $cfa2761d36e5714c$export$7e1297a3a19f10d8 {
|
|
5249
|
-
#forced_default_on_navigation({ is_replace: is_replace , new_url: new_url }) {
|
|
5250
|
-
history[is_replace ? "replaceState" : "pushState"](history.state, "", new_url);
|
|
5251
|
-
}
|
|
5252
5252
|
/**
|
|
5253
5253
|
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
5254
5254
|
*/ #throwing_on_navigation(...args) {
|
|
@@ -5271,10 +5271,10 @@ class $cfa2761d36e5714c$export$7e1297a3a19f10d8 {
|
|
|
5271
5271
|
/**
|
|
5272
5272
|
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
5273
5273
|
* This standardises waiting for all kinds of routers
|
|
5274
|
-
*/ #get_navigation_happened_promise(
|
|
5274
|
+
*/ #get_navigation_happened_promise(is_replace) {
|
|
5275
5275
|
return new Promise((resolve)=>{
|
|
5276
5276
|
const handler = (what_happened)=>{
|
|
5277
|
-
if (what_happened === (
|
|
5277
|
+
if (what_happened === (is_replace ? "replaceState" : "pushState")) {
|
|
5278
5278
|
resolve();
|
|
5279
5279
|
(0, $g9l4l$instant_exec_on_suspect_history_change).delete(handler);
|
|
5280
5280
|
}
|
|
@@ -5295,7 +5295,7 @@ class $cfa2761d36e5714c$export$7e1297a3a19f10d8 {
|
|
|
5295
5295
|
* @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
|
|
5296
5296
|
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
5297
5297
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5298
|
-
*/ go_to_: async ({ new_url_: new_url_ , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ })=>{
|
|
5298
|
+
*/ go_to_: async ({ new_url_: new_url_ , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ , category_query_id_: category_query_id_ })=>{
|
|
5299
5299
|
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
5300
5300
|
if (this.#dont_attempt_navigation(event_)) return;
|
|
5301
5301
|
if (wants_hard_navigation && !force_spa_navigation_) {
|
|
@@ -5305,9 +5305,12 @@ class $cfa2761d36e5714c$export$7e1297a3a19f10d8 {
|
|
|
5305
5305
|
}
|
|
5306
5306
|
event_?.preventDefault();
|
|
5307
5307
|
const promise = this.#get_navigation_happened_promise(true);
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5308
|
+
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
5309
|
+
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
5310
|
+
const new_state = history.state;
|
|
5311
|
+
if (category_query_id_) new_state.category_current_query_id = category_query_id_;
|
|
5312
|
+
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
5313
|
+
} else this.#throwing_on_navigation.call(this, {
|
|
5311
5314
|
is_replace: is_replace_,
|
|
5312
5315
|
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_)
|
|
5313
5316
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"source": [
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"ts-jest": "^29.0.3"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@depict-ai/plp-styling": "^0.0.
|
|
89
|
-
"@depict-ai/types": "^0.0.
|
|
90
|
-
"@depict-ai/utilishared": "^0.0.
|
|
88
|
+
"@depict-ai/plp-styling": "^0.0.40",
|
|
89
|
+
"@depict-ai/types": "^0.0.30",
|
|
90
|
+
"@depict-ai/utilishared": "^0.0.82",
|
|
91
91
|
"lz-string": "^1.4.4",
|
|
92
92
|
"solid-js": "^1.6.2"
|
|
93
93
|
},
|