@depict-ai/utilishared 0.0.60 → 0.0.62

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference path="../jsx.d.ts" />
2
2
  import { EUnavailabilityType } from "@depict-ai/types/api/TrackV2Request";
3
- export const version = "0.0.60";
3
+ export const version = "0.0.62";
4
4
  export const is_debug: boolean;
5
5
  /**
6
6
  * Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
@@ -1113,7 +1113,17 @@ interface ModernDisplay {
1113
1113
  /** Recommendation type logic used by Depict */
1114
1114
  logic?: string;
1115
1115
  }
1116
- export type Display = LegacyDisplay | ModernDisplay;
1116
+ interface BasicDisplay {
1117
+ product_id: string;
1118
+ /** Unique recommendation ID used by Depict */
1119
+ recommendation_id?: string;
1120
+ /** Unique search result ID used by Depict */
1121
+ search_result_id?: string;
1122
+ /** Recommendation type logic used by Depict */
1123
+ logic?: string;
1124
+ [key: string]: any;
1125
+ }
1126
+ export type Display = LegacyDisplay | ModernDisplay | BasicDisplay;
1117
1127
  export type Node_Iterable = HTMLCollection | NodeListOf<ChildNode> | Node_Array;
1118
1128
  export type Node_Array = (Element | Text | Comment)[];
1119
1129
  export type RecRendererResult<T extends Display> = Record<string, never> | {
package/dist/main.js CHANGED
@@ -271,7 +271,7 @@ $parcel$export(module.exports, "camelCasifyObject", () => $89758b55120b0cbd$expo
271
271
  $parcel$export(module.exports, "snakeCasifyObject", () => $89758b55120b0cbd$export$b481488de1caa85);
272
272
  $parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fbfd8236492);
273
273
  $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
274
- const $815f67c61b4c0a42$export$83d89fbfd8236492 = "0.0.60";
274
+ const $815f67c61b4c0a42$export$83d89fbfd8236492 = "0.0.62";
275
275
 
276
276
 
277
277
  const $7b5e577a60b81e60$export$55fe61489d2c7417 = /*@__PURE__*/ (()=>process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (document.currentScript?.dataset?.debug === "true" || localStorage.getItem("debug") === "true"))();
@@ -3414,7 +3414,7 @@ async function $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, rendering_options) {
3414
3414
  function $558ccd2de887e6d9$export$e0009e7da572f99b(template, display = {}) {
3415
3415
  const discount_matcher = /{DISCOUNT{([\s\S]+?)}}/g;
3416
3416
  const no_discount_matcher = /{NODISCOUNT{([\s\S]+?)}}/g;
3417
- if ("variant_index" in display) throw new Error("Modern display in ancient templating");
3417
+ if ("variant_index" in display || !("sale_price" in display)) throw new Error("Modern display in ancient templating");
3418
3418
  const { sale_price: sale_price , original_price: original_price } = display;
3419
3419
  if (sale_price !== original_price) template = template.replaceAll(discount_matcher, "$1").replaceAll(no_discount_matcher, "");
3420
3420
  else template = template.replaceAll(discount_matcher, "").replaceAll(no_discount_matcher, "$1");
@@ -5046,7 +5046,8 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
5046
5046
  return;
5047
5047
  }
5048
5048
  $0b6a8303b64cced1$var$pageview_sent = true;
5049
- (0, $72ee205b59322497$export$eee4c4d924348b05)(this.settings);
5049
+ const { product_id: product_id } = this.settings;
5050
+ (0, $72ee205b59322497$export$eee4c4d924348b05)(typeof product_id === "function" ? product_id() : product_id);
5050
5051
  }
5051
5052
  trackClick(index) {
5052
5053
  const item = this.data[index];
package/dist/module.js CHANGED
@@ -4,7 +4,7 @@ function $parcel$export(e, n, v, s) {
4
4
  function $parcel$interopDefault(a) {
5
5
  return a && a.__esModule ? a.default : a;
6
6
  }
7
- const $0766c85d387a9765$export$83d89fbfd8236492 = "0.0.60";
7
+ const $0766c85d387a9765$export$83d89fbfd8236492 = "0.0.62";
8
8
 
9
9
 
10
10
  const $571bce04eb920cd8$export$55fe61489d2c7417 = /*@__PURE__*/ (()=>process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (document.currentScript?.dataset?.debug === "true" || localStorage.getItem("debug") === "true"))();
@@ -3147,7 +3147,7 @@ async function $5cbe24d064a033ed$export$a9fc160c5ed83bd7(t, rendering_options) {
3147
3147
  function $5cbe24d064a033ed$export$e0009e7da572f99b(template, display = {}) {
3148
3148
  const discount_matcher = /{DISCOUNT{([\s\S]+?)}}/g;
3149
3149
  const no_discount_matcher = /{NODISCOUNT{([\s\S]+?)}}/g;
3150
- if ("variant_index" in display) throw new Error("Modern display in ancient templating");
3150
+ if ("variant_index" in display || !("sale_price" in display)) throw new Error("Modern display in ancient templating");
3151
3151
  const { sale_price: sale_price , original_price: original_price } = display;
3152
3152
  if (sale_price !== original_price) template = template.replaceAll(discount_matcher, "$1").replaceAll(no_discount_matcher, "");
3153
3153
  else template = template.replaceAll(discount_matcher, "").replaceAll(no_discount_matcher, "$1");
@@ -4779,7 +4779,8 @@ class $366fff12da348e66$export$1a8782481a9af507 {
4779
4779
  return;
4780
4780
  }
4781
4781
  $366fff12da348e66$var$pageview_sent = true;
4782
- (0, $aa0140679dc70b7a$export$eee4c4d924348b05)(this.settings);
4782
+ const { product_id: product_id } = this.settings;
4783
+ (0, $aa0140679dc70b7a$export$eee4c4d924348b05)(typeof product_id === "function" ? product_id() : product_id);
4783
4784
  }
4784
4785
  trackClick(index) {
4785
4786
  const item = this.data[index];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/utilishared",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -42,7 +42,7 @@
42
42
  "@babel/core": "latest",
43
43
  "@babel/runtime": "latest",
44
44
  "@babel/runtime-corejs3": "latest",
45
- "@depict-ai/types": "^0.0.15",
45
+ "@depict-ai/types": "^0.0.17",
46
46
  "@parcel/resolver-default": "^2.8.0",
47
47
  "@sentry/cli": "latest",
48
48
  "@sentry/types": "^7.13.0",