Socket
Socket
Sign inDemoInstall

@depict-ai/js-ui

Package Overview
Dependencies
Maintainers
5
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@depict-ai/js-ui - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

3

dist/index.d.ts
import { BaseProviderConfig, BaseSearchProviderConfig, SearchFilter, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, ImagePlaceholderProps, TextPlaceholderProps } from "@depict-ai/ui";
import { search_i18n, category_i18n } from "@depict-ai/ui/locales";
import { Display } from "@depict-ai/utilishared";
export const version = "0.0.22";
export const version = "0.0.24";
interface SearchProviderConfig extends BaseProviderConfig, BaseSearchProviderConfig {

@@ -147,2 +147,1 @@ locale?: search_i18n;

export { fetchDepictRecommendations } from "@depict-ai/ui";
export { DPC } from "@depict-ai/dpc";
var $kJ2V0$depictaiutilishared = require("@depict-ai/utilishared");
var $kJ2V0$depictaiui = require("@depict-ai/ui");
var $kJ2V0$depictaidpc = require("@depict-ai/dpc");
var $kJ2V0$depictaiuilocales = require("@depict-ai/ui/locales");

@@ -23,5 +22,4 @@ var $kJ2V0$solidjsweb = require("solid-js/web");

$parcel$export(module.exports, "onExistsObserver", () => $8d9df0131d250f69$export$7278f0e6b349961b);
$parcel$export(module.exports, "DPC", () => $05c934aa8b1a01c6$re_export$DPC);
$parcel$export(module.exports, "version", () => $98b48f9e57507434$export$83d89fbfd8236492);
const $98b48f9e57507434$export$83d89fbfd8236492 = "0.0.22";
const $98b48f9e57507434$export$83d89fbfd8236492 = "0.0.24";

@@ -61,16 +59,3 @@

merchant: merchant,
localization: usedLocale,
// Navigate between different categories using `history.pushState` by default, to avoid costly full page loads on server side rendered sites
on_navigation: (url, _event, _ref)=>{
let { query_id: query_id , page_url: page_url } = _ref;
if (!query_id) {
location.href = page_url;
return;
}
// When we push an url, also save the category id in the state, so we can restore it on back/forward
history.pushState({
...history.state,
category_current_query_id: query_id
}, "", url);
}
localization: usedLocale
});

@@ -162,15 +147,9 @@ if (categoryId) this.#category.category_id = categoryId;

const card = productCard(display);
const card_array = Array.isArray(card) ? card : [
return Array.isArray(card) ? card : [
card
];
if (!display) return card_array;
if (display.search_result_id) card_array[0].setAttribute("data-search-result-id", display.search_result_id);
else if (display.recommendation_id) // Search recommendations
card_array[0].setAttribute("data-search-result-id", display.recommendation_id);
return card_array;
} catch (e) {
throw new (0, $kJ2V0$depictaiui.ProductCardError)(e);
}
},
disable_default_tracking: true
}
}));

@@ -231,12 +210,9 @@ return _el$;

const card = productCard(display);
const card_array = Array.isArray(card) ? card : [
return Array.isArray(card) ? card : [
card
];
if (display) card_array[0].setAttribute("data-product-listing-result-id", display.product_listing_result_id);
return card_array;
} catch (e) {
throw new (0, $kJ2V0$depictaiui.ProductCardError)(e);
}
},
disable_default_tracking: true
}
}));

@@ -278,2 +254,11 @@ return _el$;

let { recommendations: recommendations , productCard: productCard , columnsAtSize: columnsAtSize , gridSpacing: gridSpacing } = _ref;
// Todo: Avoid setting the tenant and market here. The only thing we really need it for at this point, given that we already have the recommendations promise,
// is having the values to send for tracking. What we could do instead is to set the data-recommendation-id attribute on the rendered product cards,
// then activate DPC with auto tracking. Because we will need DPC active regardless, to get A2C + purchase tracking. Ping Sverre about the plans for this.
const void_tenant = new (0, $kJ2V0$depictaiutilishared.Tenant)({
TENANT: "depict",
MARKET: "se",
get_product_id: ()=>"",
GA_ID: ""
});
// Todo: shared defaults with react-ui

@@ -305,13 +290,10 @@ const cols_at_size = (0, $kJ2V0$depictaiui.convert_sdk_cols_at_size_to_layout)(columnsAtSize ?? [

};
const rendered_slider = await (0, $kJ2V0$depictaiutilishared.RecommendationSlider)(null, {
const rendered_slider = await (0, $kJ2V0$depictaiutilishared.RecommendationSlider)(void_tenant, {
recs: recommendations,
// Todo: find the most optimized way to do this optional array wrapping (maybe do it inside ui instead?)
template: (display, info)=>{
const is_placeholder = info.rendering_options.type == "placeholder";
const card = productCard(is_placeholder ? null : display);
const card_array = Array.isArray(card) ? card : [
const card = productCard(info.rendering_options.type == "placeholder" ? null : display);
return Array.isArray(card) ? card : [
card
];
if (!is_placeholder) card_array[0].setAttribute("data-recommendation-id", display.recommendation_id);
return card_array;
},

@@ -369,2 +351,11 @@ type: "slider",

let { recommendations: recommendations , productCard: productCard , columnsAtSize: columnsAtSize , gridSpacing: gridSpacing , maxRows: maxRows } = _ref;
// Todo: Avoid setting the tenant and market here. The only thing we really need it for at this point, given that we already have the recommendations promise,
// is having the values to send for tracking. What we could do instead is to set the data-recommendation-id attribute on the rendered product cards,
// then activate DPC with auto tracking. Because we will need DPC active regardless, to get A2C + purchase tracking. Ping Sverre about the plans for this.
const void_tenant = new (0, $kJ2V0$depictaiutilishared.Tenant)({
TENANT: "depict",
MARKET: "se",
get_product_id: ()=>"",
GA_ID: ""
});
// Todo: shared defaults with react-ui

@@ -392,13 +383,10 @@ const cols_at_size = (0, $kJ2V0$depictaiui.convert_sdk_cols_at_size_to_layout)(columnsAtSize ?? [

};
const rendered_grid = await (0, $kJ2V0$depictaiutilishared.RecommendationGrid)(null, {
const rendered_grid = await (0, $kJ2V0$depictaiutilishared.RecommendationGrid)(void_tenant, {
recs: recommendations,
// Todo: find the most optimized way to do this optional array wrapping (maybe do it inside ui instead?)
template: (display, info)=>{
const is_placeholder = info.rendering_options.type == "placeholder";
const card = productCard(is_placeholder ? null : display);
const card_array = Array.isArray(card) ? card : [
const card = productCard(info.rendering_options.type == "placeholder" ? null : display);
return Array.isArray(card) ? card : [
card
];
if (!is_placeholder) card_array[0].setAttribute("data-recommendation-id", display.recommendation_id);
return card_array;
},

@@ -467,5 +455,4 @@ type: "grid",

(0, $kJ2V0$depictaiutilishared.add_to_version_info)("js-ui", (0, $98b48f9e57507434$export$83d89fbfd8236492));

@@ -1,8 +0,7 @@

import {add_to_version_info as $gXbnb$add_to_version_info, catchify as $gXbnb$catchify, href_change_ipns as $gXbnb$href_change_ipns, RecommendationSlider as $gXbnb$RecommendationSlider, make_placeholder_rr as $gXbnb$make_placeholder_rr, GenericSliderArrowButton as $gXbnb$GenericSliderArrowButton, RecommendationGrid as $gXbnb$RecommendationGrid, Placeholder as $gXbnb$Placeholder, ContainedPlaceholderImage as $gXbnb$ContainedPlaceholderImage, observer as $gXbnb$observer} from "@depict-ai/utilishared";
import {add_to_version_info as $gXbnb$add_to_version_info, catchify as $gXbnb$catchify, href_change_ipns as $gXbnb$href_change_ipns, Tenant as $gXbnb$Tenant, RecommendationSlider as $gXbnb$RecommendationSlider, make_placeholder_rr as $gXbnb$make_placeholder_rr, GenericSliderArrowButton as $gXbnb$GenericSliderArrowButton, RecommendationGrid as $gXbnb$RecommendationGrid, Placeholder as $gXbnb$Placeholder, ContainedPlaceholderImage as $gXbnb$ContainedPlaceholderImage, observer as $gXbnb$observer} from "@depict-ai/utilishared";
import {fetchDepictRecommendations as $b9ade2e31ecd6301$re_export$fetchDepictRecommendations, DepictCategory as $gXbnb$DepictCategory, open_modal_with_alignment as $gXbnb$open_modal_with_alignment, DepictSearch as $gXbnb$DepictSearch, SearchPage as $gXbnb$SearchPage, ProductCardError as $gXbnb$ProductCardError, SearchField as $gXbnb$SearchField, CategoryPage as $gXbnb$CategoryPage, CategoryTitle as $gXbnb$CategoryTitle, PageReplacer as $gXbnb$PageReplacer, convert_sdk_cols_at_size_to_layout as $gXbnb$convert_sdk_cols_at_size_to_layout} from "@depict-ai/ui";
import {DPC as $b9ade2e31ecd6301$re_export$DPC} from "@depict-ai/dpc";
import {en as $gXbnb$en} from "@depict-ai/ui/locales";
import {template as $gXbnb$template, insert as $gXbnb$insert} from "solid-js/web";
const $384f36a64c74679e$export$83d89fbfd8236492 = "0.0.22";
const $384f36a64c74679e$export$83d89fbfd8236492 = "0.0.24";

@@ -42,16 +41,3 @@

merchant: merchant,
localization: usedLocale,
// Navigate between different categories using `history.pushState` by default, to avoid costly full page loads on server side rendered sites
on_navigation: (url, _event, _ref)=>{
let { query_id: query_id , page_url: page_url } = _ref;
if (!query_id) {
location.href = page_url;
return;
}
// When we push an url, also save the category id in the state, so we can restore it on back/forward
history.pushState({
...history.state,
category_current_query_id: query_id
}, "", url);
}
localization: usedLocale
});

@@ -143,15 +129,9 @@ if (categoryId) this.#category.category_id = categoryId;

const card = productCard(display);
const card_array = Array.isArray(card) ? card : [
return Array.isArray(card) ? card : [
card
];
if (!display) return card_array;
if (display.search_result_id) card_array[0].setAttribute("data-search-result-id", display.search_result_id);
else if (display.recommendation_id) // Search recommendations
card_array[0].setAttribute("data-search-result-id", display.recommendation_id);
return card_array;
} catch (e) {
throw new (0, $gXbnb$ProductCardError)(e);
}
},
disable_default_tracking: true
}
}));

@@ -212,12 +192,9 @@ return _el$;

const card = productCard(display);
const card_array = Array.isArray(card) ? card : [
return Array.isArray(card) ? card : [
card
];
if (display) card_array[0].setAttribute("data-product-listing-result-id", display.product_listing_result_id);
return card_array;
} catch (e) {
throw new (0, $gXbnb$ProductCardError)(e);
}
},
disable_default_tracking: true
}
}));

@@ -259,2 +236,11 @@ return _el$;

let { recommendations: recommendations , productCard: productCard , columnsAtSize: columnsAtSize , gridSpacing: gridSpacing } = _ref;
// Todo: Avoid setting the tenant and market here. The only thing we really need it for at this point, given that we already have the recommendations promise,
// is having the values to send for tracking. What we could do instead is to set the data-recommendation-id attribute on the rendered product cards,
// then activate DPC with auto tracking. Because we will need DPC active regardless, to get A2C + purchase tracking. Ping Sverre about the plans for this.
const void_tenant = new (0, $gXbnb$Tenant)({
TENANT: "depict",
MARKET: "se",
get_product_id: ()=>"",
GA_ID: ""
});
// Todo: shared defaults with react-ui

@@ -286,13 +272,10 @@ const cols_at_size = (0, $gXbnb$convert_sdk_cols_at_size_to_layout)(columnsAtSize ?? [

};
const rendered_slider = await (0, $gXbnb$RecommendationSlider)(null, {
const rendered_slider = await (0, $gXbnb$RecommendationSlider)(void_tenant, {
recs: recommendations,
// Todo: find the most optimized way to do this optional array wrapping (maybe do it inside ui instead?)
template: (display, info)=>{
const is_placeholder = info.rendering_options.type == "placeholder";
const card = productCard(is_placeholder ? null : display);
const card_array = Array.isArray(card) ? card : [
const card = productCard(info.rendering_options.type == "placeholder" ? null : display);
return Array.isArray(card) ? card : [
card
];
if (!is_placeholder) card_array[0].setAttribute("data-recommendation-id", display.recommendation_id);
return card_array;
},

@@ -350,2 +333,11 @@ type: "slider",

let { recommendations: recommendations , productCard: productCard , columnsAtSize: columnsAtSize , gridSpacing: gridSpacing , maxRows: maxRows } = _ref;
// Todo: Avoid setting the tenant and market here. The only thing we really need it for at this point, given that we already have the recommendations promise,
// is having the values to send for tracking. What we could do instead is to set the data-recommendation-id attribute on the rendered product cards,
// then activate DPC with auto tracking. Because we will need DPC active regardless, to get A2C + purchase tracking. Ping Sverre about the plans for this.
const void_tenant = new (0, $gXbnb$Tenant)({
TENANT: "depict",
MARKET: "se",
get_product_id: ()=>"",
GA_ID: ""
});
// Todo: shared defaults with react-ui

@@ -373,13 +365,10 @@ const cols_at_size = (0, $gXbnb$convert_sdk_cols_at_size_to_layout)(columnsAtSize ?? [

};
const rendered_grid = await (0, $gXbnb$RecommendationGrid)(null, {
const rendered_grid = await (0, $gXbnb$RecommendationGrid)(void_tenant, {
recs: recommendations,
// Todo: find the most optimized way to do this optional array wrapping (maybe do it inside ui instead?)
template: (display, info)=>{
const is_placeholder = info.rendering_options.type == "placeholder";
const card = productCard(is_placeholder ? null : display);
const card_array = Array.isArray(card) ? card : [
const card = productCard(info.rendering_options.type == "placeholder" ? null : display);
return Array.isArray(card) ? card : [
card
];
if (!is_placeholder) card_array[0].setAttribute("data-recommendation-id", display.recommendation_id);
return card_array;
},

@@ -448,6 +437,5 @@ type: "grid",

(0, $gXbnb$add_to_version_info)("js-ui", (0, $384f36a64c74679e$export$83d89fbfd8236492));
export {$2d74c140fd7068d0$export$5d13af1f32ae532e as DepictCategoryProvider, $140f992baa1081ff$export$9aa84a6b7bde7bae as DepictSearchProvider, $0fcd5f18160cc39d$export$a54ec244c8863715 as SearchPage, $bae8104bbb62fa4a$export$b94867ecbd698f21 as SearchField, $fb06f2a0e9f40e9f$export$f7d2f673fc2f091d as CategoryPage, $0821002aa3b2b433$export$64e18aecaa12222c as SetupPageReplacer, $b9ade2e31ecd6301$re_export$fetchDepictRecommendations as fetchDepictRecommendations, $88e8b83d93cbcc2a$export$82cfdc85a4d15688 as RecommendationSlider, $4c2205960ebe8b64$export$b0a773486c1c2312 as RecommendationGrid, $fca29229130cb86d$export$89c6019e4baa40b1 as TextPlaceholder, $fca29229130cb86d$export$3f37af283f8fb843 as ImagePlaceholder, $ffa68e12dba2c222$export$7278f0e6b349961b as onExistsObserver, $b9ade2e31ecd6301$re_export$DPC as DPC, $384f36a64c74679e$export$83d89fbfd8236492 as version};
export {$2d74c140fd7068d0$export$5d13af1f32ae532e as DepictCategoryProvider, $140f992baa1081ff$export$9aa84a6b7bde7bae as DepictSearchProvider, $0fcd5f18160cc39d$export$a54ec244c8863715 as SearchPage, $bae8104bbb62fa4a$export$b94867ecbd698f21 as SearchField, $fb06f2a0e9f40e9f$export$f7d2f673fc2f091d as CategoryPage, $0821002aa3b2b433$export$64e18aecaa12222c as SetupPageReplacer, $b9ade2e31ecd6301$re_export$fetchDepictRecommendations as fetchDepictRecommendations, $88e8b83d93cbcc2a$export$82cfdc85a4d15688 as RecommendationSlider, $4c2205960ebe8b64$export$b0a773486c1c2312 as RecommendationGrid, $fca29229130cb86d$export$89c6019e4baa40b1 as TextPlaceholder, $fca29229130cb86d$export$3f37af283f8fb843 as ImagePlaceholder, $ffa68e12dba2c222$export$7278f0e6b349961b as onExistsObserver, $384f36a64c74679e$export$83d89fbfd8236492 as version};
export type { plp_shared_i18n, search_i18n, category_i18n, Locale } from "@depict-ai/ui/locales";
export { cz, de, en, da, fi, pl, fr, sv, pt, no, nl, es, it } from "@depict-ai/ui/locales";
export * from "@depict-ai/ui/locales";
module.exports = require("@depict-ai/ui/locales");
{
"name": "@depict-ai/js-ui",
"version": "0.0.23",
"version": "0.0.24",
"packageManager": "yarn@3.2.2",

@@ -60,6 +60,5 @@ "source": "src/index.ts",

"dependencies": {
"@depict-ai/dpc": "^0.0.10",
"@depict-ai/plp-styling": "^0.0.33",
"@depict-ai/ui": "^0.0.72",
"@depict-ai/utilishared": "^0.0.76",
"@depict-ai/plp-styling": "^0.0.35",
"@depict-ai/ui": "^0.0.73",
"@depict-ai/utilishared": "^0.0.77",
"solid-js": "^1.6.2"

@@ -66,0 +65,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc